Skip to content

Commit 83525ba

Browse files
authored
Adding Query Parameter to GenerateSshKeyPair API (#26090)
* init * PR comments * Turning this into a POST * fix * another fix * fixes * fixes * fix
1 parent 3879354 commit 83525ba

3 files changed

Lines changed: 73 additions & 0 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"api-version": "2023-09-01",
6+
"sshPublicKeyName": "mySshPublicKeyName",
7+
"parameters": {
8+
"encryptionType": "RSA"
9+
}
10+
},
11+
"responses": {
12+
"200": {
13+
"body": {
14+
"privateKey": "{ssh private key}",
15+
"publicKey": "{ssh-rsa public key}",
16+
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"
17+
}
18+
}
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "{subscription-id}",
4+
"resourceGroupName": "myResourceGroup",
5+
"api-version": "2023-09-01",
6+
"sshPublicKeyName": "mySshPublicKeyName",
7+
"parameters": {
8+
"encryptionType": "RSA"
9+
}
10+
},
11+
"responses": {
12+
"200": {
13+
"body": {
14+
"privateKey": "{ed25519 private key}",
15+
"publicKey": "{ed25519 public key}",
16+
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"
17+
}
18+
}
19+
}
20+
}

specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-09-01/sshPublicKey.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,15 @@
371371
"type": "string",
372372
"description": "The name of the SSH public key."
373373
},
374+
{
375+
"name": "parameters",
376+
"in": "body",
377+
"required": false,
378+
"schema": {
379+
"$ref": "#/definitions/SshGenerateKeyPairInputParameters"
380+
},
381+
"description": "Parameters supplied to generate the SSH public key."
382+
},
374383
{
375384
"$ref": "../../../common-types/v1/common.json#/parameters/ApiVersionParameter"
376385
},
@@ -395,6 +404,12 @@
395404
"x-ms-examples": {
396405
"Generate an SSH key pair.": {
397406
"$ref": "./examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json"
407+
},
408+
"Generate an SSH key pair with RSA encryption.": {
409+
"$ref": "./examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json"
410+
},
411+
"Generate an SSH key pair with Ed25519 encryption.": {
412+
"$ref": "./examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json"
398413
}
399414
}
400415
}
@@ -480,6 +495,24 @@
480495
"value"
481496
],
482497
"description": "The list SSH public keys operation response."
498+
},
499+
"SshGenerateKeyPairInputParameters": {
500+
"type": "object",
501+
"properties": {
502+
"encryptionType": {
503+
"type": "string",
504+
"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",
505+
"enum": [
506+
"RSA",
507+
"Ed25519"
508+
],
509+
"x-ms-enum": {
510+
"name": "SshEncryptionTypes",
511+
"modelAsString": true
512+
}
513+
}
514+
},
515+
"description": "Parameters for GenerateSshKeyPair."
483516
}
484517
}
485518
}

0 commit comments

Comments
 (0)