summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHentioe <me@bluerain.io>2020-11-21 09:40:43 +0800
committerHentioe <me@bluerain.io>2020-11-21 09:40:43 +0800
commitdeaeab977fcfc98b4027de6f4c2e77b21b09d678 (patch)
tree7f87aa5365b6d3de3ea52aec80abec5626a0673b
parentUpdate configuration (diff)
Add ssh related APIs
-rw-r--r--lib/azure_ex.ex35
-rw-r--r--lib/azure_ex/model/ssh_public_keys/create.ex20
2 files changed, 55 insertions, 0 deletions
diff --git a/lib/azure_ex.ex b/lib/azure_ex.ex
index a9ab514..d628938 100644
--- a/lib/azure_ex.ex
+++ b/lib/azure_ex.ex
@@ -95,4 +95,39 @@ defmodule AzureEx do
"DeleteDisks",
"DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}?api-version=2020-06-30"
)
+
+ defendpoint(
+ "CreateSshPublicKeys",
+ "PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}?api-version=2020-06-01"
+ )
+
+ defendpoint(
+ "GetSshPublicKeys",
+ "GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}?api-version=2020-06-01"
+ )
+
+ defendpoint(
+ "ListByReourceGroupSshPublicKeys",
+ "GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys?api-version=2020-06-01"
+ )
+
+ defendpoint(
+ "GenerateKeyPairSshPublicKeys",
+ "POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair?api-version=2020-06-01"
+ )
+
+ defendpoint(
+ "DeleteSshPublicKeys",
+ "DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}?api-version=2020-06-01"
+ )
+
+ defendpoint(
+ "ListMetrics",
+ "GET https://management.azure.com/{resourceUri}/providers/microsoft.insights/metrics?api-version=2018-01-01"
+ )
+
+ defendpoint(
+ "ListResources",
+ "GET https://management.azure.com/subscriptions/{subscriptionId}/resources?api-version=2020-06-01"
+ )
end
diff --git a/lib/azure_ex/model/ssh_public_keys/create.ex b/lib/azure_ex/model/ssh_public_keys/create.ex
new file mode 100644
index 0000000..03c2117
--- /dev/null
+++ b/lib/azure_ex/model/ssh_public_keys/create.ex
@@ -0,0 +1,20 @@
+defmodule AzureEx.Model.SshPublicKeys.Create do
+ @moduledoc false
+
+ use TypedStruct
+
+ alias __MODULE__.Properties
+
+ typedstruct module: Properties do
+ @derive Jason.Encoder
+
+ field :publicKey, String.t()
+ end
+
+ typedstruct do
+ @derive Jason.Encoder
+
+ field :location, String.t()
+ field :properties, Properties.t()
+ end
+end