Copying an SSH Key Pair (V2)
Function
Copies a user's key pairs to the current user. The two users must belong to the same account.
URI
Requests
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
user_name |
Yes |
String |
Name of the target user under the same tenant account |
force |
No |
Boolean |
Indicates whether to forcibly overwrite an existing key pair. |
Responses
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
changed |
Yes |
Integer |
Number of copied key pairs. |
success |
Yes |
Array of objects |
List of key pairs that were successfully copied. For details, see Table 4. |
failed |
Yes |
Array of objects |
List of key pairs that failed to be copied. For details, see Table 4. |
Examples
- Example request
{ "user_name": "kpsuser" }
- Example response
{ "changed": 2, "success": [ { "keypair": "KeyPair-test1", "message": "imported" }, { "keypair": "KeyPair-test2", "message": "imported" } ], "failed": [ { "keypair": "KeyPair-test3", "message": "exist" } ] }
or
{ "error_code": "KPS.XXXX", "error_msg": "XXXX" }
Status Codes
For details, see Status Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.