Credentials
Before you can do any Ocean deployments, you need to register your cloud credentials to Ocean. These credentials will be used by Ocean to access your cloud account and deploy any resources you need in your Ocean deployments.

Create a credential

Register a cloud credential to Ocean.
Request
1
POST /v0/credentials HTTP1.1
2
Authorization: Bearer {token}
3
Content-Type: application/json
4
5
{request body}
Copied!
The following are some example request payloads for {request body} per provider.
Alibaba:
1
{
2
"vendor":"alicloud",
3
"name":"testalicloudcreds",
4
"key":"ABCDEF",
5
"secret":"somesecret"
6
}
Copied!
AWS:
1
{
2
"vendor":"aws",
3
"name":"testawscreds",
4
"key":"ABCDEF",
5
"secret":"somesecret"
6
}
Copied!
Azure:
1
{
2
"vendor":"azure",
3
"name":"testazurecreds",
4
"key":"ABCDEF",
5
"secret":"somesecret",
6
"application":"997613dc-032a-440f-bead-2bb5b19ad002",
7
"subscription":"c825c2bf-cdc5-4b96-9644-a1dd5144ae0f",
8
"directory":"292cd594-02c7-4a56-86e7-e30615557e83"
9
}
Copied!
GCP (for GCP, secret is your service account's JSON file):
1
{
2
"vendor":"gcp",
3
"name":"testgcpcreds",
4
"project_id":"gcp-project-id",
5
"secret":"aGVsbG93b3JsZA==",
6
"isbase64":true
7
}
Copied!
Response
1
HTTP 201
2
3
{
4
"credential_id":"cred-aws-58c2297d25645-fa7vzi6E1l",
5
"user_id":"1234567890",
6
"username":"testsubuser",
7
"name":"testawscreds",
8
"key":"ABCDEF",
9
"secret":"***",
10
"create_time":"2019-04-04T04:16:02Z",
11
"update_time":"2019-04-04T04:16:02Z",
12
"vendor":"aws"
13
}
Copied!
When creating Ocean templates, you will use the credential's name part as the name for the template's credential entry. This name should be unique per account.

List credentials

Return a list of registered credentials.
Request
1
GET /v0/credentials[?vendor={vendor-name}] HTTP1.1
2
Authorization: Bearer {token}
Copied!
Response
Example:
1
HTTP 200
2
3
{
4
"alicloud":[
5
{
6
"credential_id":"cred-alicloud-xx",
7
"user_id":"1234",
8
"username":"subuser",
9
"name":"testalicloudcreds",
10
"key":"ABCDEF",
11
"secret":"***",
12
"create_time":"2019-01-31T06:47:08Z",
13
"update_time":"2019-01-31T06:47:08Z",
14
"vendor":"alicloud"
15
}
16
],
17
"aws":[
18
{
19
"credential_id":"cred-aws-xx",
20
"user_id":"1234",
21
"username":"subuser",
22
"name":"testawscreds",
23
"key":"ADCDEF",
24
"secret":"***",
25
"create_time":"2019-04-04T04:16:02Z",
26
"update_time":"2019-04-04T04:16:02Z",
27
"vendor":"aws"
28
}
29
],
30
"gcp":[
31
{
32
"credential_id":"cred-gcp-xx",
33
"user_id":"1234",
34
"username":"subuser",
35
"name":"testgcpcreds",
36
"key":"testgcpcreds",
37
"secret":"***",
38
"project_id":"gcp-project-id",
39
"create_time":"2018-05-21T17:15:36+09:00",
40
"update_time":"2018-05-21T17:15:36+09:00",
41
"vendor":"gcp"
42
}
43
],
44
"azure":[
45
{
46
"credential_id":"cred-azure-xx",
47
"user_id":"1234",
48
"username":"subuser",
49
"name":"testazurecreds",
50
"key":"ABCDEF",
51
"secret":"***",
52
"application_id":"997613dc-032a-440f-bead-2bb5b19ad002",
53
"subscription_id":"c825c2bf-cdc5-4b96-9644-a1dd5144ae0f",
54
"directory_id":"292cd594-02c7-4a56-86e7-e30615557e83",
55
"create_time":"2018-05-21T17:15:36+09:00",
56
"update_time":"2018-05-21T17:15:36+09:00",
57
"vendor":"azure"
58
}
59
]
60
}
Copied!

Describe a credential

Describe a specific credential specified by id.
Request
1
GET /v0/credentials/{id} HTTP1.1
2
Authorization: Bearer {token}
Copied!
Response
1
HTTP 200
2
3
{
4
"credential_id":"cred-gcp-xx",
5
"user_id":"1234",
6
"username":"subuser",
7
"name":"testgcpcreds",
8
"key":"testgcpcreds",
9
"secret":"***",
10
"project_id":"gcp-project-id",
11
"create_time":"2018-05-21T17:15:36+09:00",
12
"update_time":"2018-05-21T17:15:36+09:00",
13
"vendor":"gcp"
14
}
Copied!

Delete a credential

Remove a registered credential from Ocean.
Request
1
DELETE /v0/credentials/{id} HTTP1.1
2
Authorization: Bearer {token}
Copied!
Response
1
HTTP 200
Copied!
Last modified 2yr ago