diff options
author | Hentioe <me@bluerain.io> | 2020-11-04 10:08:47 +0800 |
---|---|---|
committer | Hentioe <me@bluerain.io> | 2020-11-04 10:08:47 +0800 |
commit | e4ad6926ea263030910922e9721d9040a69cd478 (patch) | |
tree | dcc6c7ba1d34d62669efa481c370f24a98083102 | |
parent | Wrap remote error (diff) |
Add some APIs
-rw-r--r-- | lib/azure_ex.ex | 20 | ||||
-rw-r--r-- | lib/azure_ex/model/subnets/create_or_update.ex | 20 | ||||
-rw-r--r-- | lib/azure_ex/model/virtual_networks/create_or_update.ex | 26 |
3 files changed, 66 insertions, 0 deletions
diff --git a/lib/azure_ex.ex b/lib/azure_ex.ex index c284809..a9ab514 100644 --- a/lib/azure_ex.ex +++ b/lib/azure_ex.ex @@ -47,11 +47,31 @@ defmodule AzureEx do ) defendpoint( + "InstanceViewVirtualMachines", + "GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView?api-version=2020-06-01" + ) + + defendpoint( "CreateOrUpdateNetworkInterfaces", "PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}?api-version=2020-05-01" ) defendpoint( + "GetVirtualNetworks", + "GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}?api-version=2020-05-01" + ) + + defendpoint( + "CreateOrUpdateVirtualNetworks", + "PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}?api-version=2020-05-01" + ) + + defendpoint( + "GetSubnet", + "GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}?api-version=2020-05-01" + ) + + defendpoint( "CreateOrUpdateSubnets", "PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}?api-version=2020-05-01" ) diff --git a/lib/azure_ex/model/subnets/create_or_update.ex b/lib/azure_ex/model/subnets/create_or_update.ex new file mode 100644 index 0000000..678a11a --- /dev/null +++ b/lib/azure_ex/model/subnets/create_or_update.ex @@ -0,0 +1,20 @@ +defmodule AzureEx.Model.Subnets.CreateOrUpdate do + @moduledoc false + + use TypedStruct + + alias __MODULE__.Properties + + typedstruct module: Properties do + @derive Jason.Encoder + + field :addressPrefix, String.t() + end + + typedstruct do + @derive Jason.Encoder + + field :name, String.t() + field :properties, Properties.t() + end +end diff --git a/lib/azure_ex/model/virtual_networks/create_or_update.ex b/lib/azure_ex/model/virtual_networks/create_or_update.ex new file mode 100644 index 0000000..f1e2d5d --- /dev/null +++ b/lib/azure_ex/model/virtual_networks/create_or_update.ex @@ -0,0 +1,26 @@ +defmodule AzureEx.Model.VirtualNetworks.CreateOrUpdate do + @moduledoc false + + use TypedStruct + + alias __MODULE__.{Properties, AddressSpace} + + typedstruct module: AddressSpace do + @derive Jason.Encoder + + field :addressPrefixes, [String.t()] + end + + typedstruct module: Properties do + @derive Jason.Encoder + + field :addressSpace, AddressSpace.t() + end + + typedstruct do + @derive Jason.Encoder + + field :location, String.t() + field :properties, Properties.t() + end +end |