Copying an SSH Key Pair (V2)
Function
A tenant may contain multiple users. This API is used to copy the key pair from the target user to the current user under the same tenant 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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot