Adding a Deployment Key (Deprecated)
Function
Add a deployment key.
URI
POST /v1/repositories/{repository_id}/deploy_keys
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
repository_id |
Yes |
Integer |
Repository short ID |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. The user token can be obtained by calling the corresponding IAM API. The value of X-Subject-Token in the response header is the user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
application |
Yes |
String |
Deployment key source |
|
can_push |
Yes |
Boolean |
Whether the deployment key can be used to push code |
|
key |
Yes |
String |
Deployment key |
|
key_title |
Yes |
String |
Deployment key name |
Response Parameters
Status code: 200
Request Example
POST https://{endpoint}/v1/repositories/{repository_id}/deploy_keys
{
"key_title" : "z00464114@SZXG4Z004641141",
"key" : "ssh-rsa AAAAB3NzaC1yXXXXXXXX",
"can_push" : true,
"application" : ""
}
Response Example
Status code: 200
OK
{
"result" : {
"key_id" : "1034546",
"key_title" : "z00464114@SZXG4Z004641141",
"key" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAxxxxxxxxxxxxx"
},
"status" : "success"
}
Status Codes
|
Status Codes |
Description |
|---|---|
|
200 |
OK |
Error Codes
See error 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
