diff options
author | Hentioe <me@bluerain.io> | 2020-10-28 11:07:30 +0800 |
---|---|---|
committer | Hentioe <me@bluerain.io> | 2020-10-28 11:07:30 +0800 |
commit | 030fb5e70fe6e3be8bfcedf64ed10e2567891d48 (patch) | |
tree | 22ba9f678c0dddb397f4fb5ee618b83d6ec94850 /lib/azure_ex.ex | |
parent | Simplify the calling process (diff) |
Optimize DSL
Diffstat (limited to 'lib/azure_ex.ex')
-rw-r--r-- | lib/azure_ex.ex | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/azure_ex.ex b/lib/azure_ex.ex index 7dce3c9..d8fa55d 100644 --- a/lib/azure_ex.ex +++ b/lib/azure_ex.ex @@ -8,13 +8,16 @@ defmodule AzureEx do defendpoint( "ListAllVirtualMachines", - "https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines", - {:get, "2020-06-01"} + "GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines?api-version=2020-06-01" ) defendpoint( "GetNetworkInterface", - "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - {:get, "2020-06-01"} + "GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}?api-version=2020-06-01" + ) + + defendpoint( + "PowerOffVirtualMachines", + "POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff?api-version=2020-06-01" ) end |