Skip to content

Commit

Permalink
Adding Query Parameter to GenerateSshKeyPair API (#26090)
Browse files Browse the repository at this point in the history
* init

* PR comments

* Turning this into a POST

* fix

* another fix

* fixes

* fixes

* fix
  • Loading branch information
kamusta-msft authored Nov 16, 2023
1 parent 3879354 commit 83525ba
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"api-version": "2023-09-01",
"sshPublicKeyName": "mySshPublicKeyName",
"parameters": {
"encryptionType": "RSA"
}
},
"responses": {
"200": {
"body": {
"privateKey": "{ssh private key}",
"publicKey": "{ssh-rsa public key}",
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"api-version": "2023-09-01",
"sshPublicKeyName": "mySshPublicKeyName",
"parameters": {
"encryptionType": "RSA"
}
},
"responses": {
"200": {
"body": {
"privateKey": "{ed25519 private key}",
"publicKey": "{ed25519 public key}",
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,15 @@
"type": "string",
"description": "The name of the SSH public key."
},
{
"name": "parameters",
"in": "body",
"required": false,
"schema": {
"$ref": "#/definitions/SshGenerateKeyPairInputParameters"
},
"description": "Parameters supplied to generate the SSH public key."
},
{
"$ref": "../../../common-types/v1/common.json#/parameters/ApiVersionParameter"
},
Expand All @@ -395,6 +404,12 @@
"x-ms-examples": {
"Generate an SSH key pair.": {
"$ref": "./examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json"
},
"Generate an SSH key pair with RSA encryption.": {
"$ref": "./examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json"
},
"Generate an SSH key pair with Ed25519 encryption.": {
"$ref": "./examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json"
}
}
}
Expand Down Expand Up @@ -480,6 +495,24 @@
"value"
],
"description": "The list SSH public keys operation response."
},
"SshGenerateKeyPairInputParameters": {
"type": "object",
"properties": {
"encryptionType": {
"type": "string",
"description": "The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. If not provided, will default to RSA",
"enum": [
"RSA",
"Ed25519"
],
"x-ms-enum": {
"name": "SshEncryptionTypes",
"modelAsString": true
}
}
},
"description": "Parameters for GenerateSshKeyPair."
}
}
}

0 comments on commit 83525ba

Please sign in to comment.