-
Notifications
You must be signed in to change notification settings - Fork 10
REST: Credentials related api
bugzmanov edited this page Aug 2, 2012
·
8 revisions
Path:/rest/projects/(projectId)/credentials
Type: GET
Path parameters
| Parameter | Type | Description |
|---|---|---|
| projectId | Number | id of the project credentials belong to |
Example results:
[{ "id":34,
"projectId":1,
"cloudProvider":"gdnova",
"pairName":"genesis-key",
"identity":"root",
"fingerPrint":"74:8e:94:5b:52:64:46:eb:ea:92:da:ba:2e:62:c2:a6:1b:4c:6b:c8"
}]Path: /rest/projects/(projectId)/credentials/
Type: POST
Path parameters:
| Parameter | Type | Description |
|---|---|---|
| projectId | Number | id of the project new credentials should belong to |
Request body:
consists form a single JSON map contains the following entries:
| Entry name | Type | Mandatory | Description |
|---|---|---|---|
| pairName | String | Y | name of the ([identity:credentials][1]) pair |
| cloudProvider | String | Y | code of the cloud provider |
| identity | String | Y | identity associated with credentials |
| credential | String | В | either password or ssh private key |
Example:
Request
{"cloudProvider":"nova","pairName":"genesis-key","identity":"root","credential":"password"}Example results:
Error on update (common result object):
{
"isSuccess": false,
"isNotFound": false,
"variablesErrors" : {"fieldName": "Error message"},
"compoundServiceErrors" : ["Error message 1", "Error message 2"]
}{
"result":{
"id":3,
"projectId":1,
"cloudProvider":"amazon-aws",
"pairName":"genesis-key",
"identity":"root",
"fingerPrint":"5b:ff:30:a5:ff:9f:d8:38:33:1d:87:3e:25:b5:5d:c7:88:6a:3e:fe"
},
"isSuccess":true
}Path: /rest/projects/(projectId)/credentials/(**credentialsId**)
Type: DELETE
Path parameters:
| Parameter | Type | Description |
|---|---|---|
| projectId | Number | id of the project new credentials should belong to |
| credentialsId | Number | id of the key pair (can be obtain from list request) |
Example:
Request
DELETE http://localhost:8080/rest/projects/1/credentials/35