sidebar | permalink | summary |
---|---|---|
sidebar |
api-keysets.html |
How to use the Keysets API resource for the NKS API. |
Keysets are credentials used by the system to provision clusters, add nodes, or install applications. Keysets are scoped by organization.
Warning
|
Only an organization Owner or Admin can create, update, or delete Keysets. |
Note
|
For VCS keysets, only GET and DELETE are allowed through the API. To create or modify VCS credentials, you will need to use the UI. |
Get all of the Keysets belonging to the specified Organization. Each Keyset contains one or more Keys.
Path Parameter
Name |
Required |
Description |
Org ID |
Yes |
The Organization ID. |
GET https://api.nks.netapp.io/orgs/{Org ID}/keysets
Example request:
curl -X GET \
-H "Authorization: Bearer abcdef123456789abcdef123456789" \
"https://api.nks.netapp.io/orgs/2/keysets"
Example response:
[
{
"pk": 1,
"name": "My AWS Credentials",
"category": "provider",
"entity": "aws",
"org": 2,
"workspaces": [
],
"user": 1,
"is_default": false,
"keys": [
{
"pk": 2,
"keyset": 1,
"key_type": "pub",
"fingerprint": "",
"user": 1
},
{
"pk": 3,
"keyset": 2,
"key_type": "pvt",
"fingerprint": "",
"user": 1
}
],
"created": "2018-11-14T22:03:02.892559Z"
}
]
Return Values
Name | Description |
---|---|
pk |
Keyset ID. |
name |
Credential name. |
category |
Keyset category. Options include |
entity |
Provider name. |
org |
Organization ID. |
workspaces |
The workspace(s) to which the credential is assigned. |
user |
The user to whom the credential is assigned. |
is_default |
Whether the credential is set as "Default" or not. |
keys |
Credentials contained in the keyset. |
keyset |
The Keyset ID to which the credential belongs. |
key_type |
The type of Key. |
fingerprint |
For SSH credentials: The RSA fingerprint. |
created |
Timestamp of the Keyset’s create date. |
Get information for a specific Keyset.
Path Parameters
Name | Required | Description |
---|---|---|
Org ID |
Yes |
The Organization ID. |
Keyset ID |
Yes |
The Keyset ID |
GET https://api.nks.netapp.io/orgs/{Org ID}/keysets/{Keyset ID}
Example request:
curl -X GET \
-H "Authorization: Bearer abcdef123456789abcdef123456789" \
"https://api.nks.netapp.io/orgs/2/keysets/3"
Example response:
{
"pk": 3,
"name": "JDoe AWS Credentials",
"category": "provider",
"entity": "",
"org": 2,
"workspaces": [
],
"user": 3,
"is_default": false,
"keys": [
],
"created": "2019-02-06T17:32:05.802960Z"
}
Return Values
Name | Description |
---|---|
pk |
Keyset ID. |
name |
Credential name. |
category |
Keyset category. Options include |
entity |
The entity to which the Keyset belongs. |
org |
Organization ID. |
workspaces |
The workspace(s) to which the credential is assigned. |
user |
The user to whom the credential is assigned. |
is_default |
Whether the credential is set as "Default" or not. |
keys |
Credentials contained in the keyset. |
keyset |
The Keyset ID to which the credential belongs. |
key_type |
The type of Key. |
fingerprint |
For SSH credentials: The RSA fingerprint. |
created |
Timestamp of the Keyset’s create date. |
Create a new Keyset for the specified organization. Each keyset contains one or more Keys.
Path Parameter
Name | Required | Description |
---|---|---|
Org ID |
Yes |
The Organization ID. |
POST https://api.nks.netapp.io/orgs/{Org ID}/keysets
Example request: Create an AWS Keyset
curl -X POST \
-H "Authorization: Bearer abcdef123456789abcdef123456789" \
-H "Content-Type: application/json" \
-d @create-aws-keyset.json \
"https://api.nks.netapp.io/orgs/1/keysets"
Contents of create-aws-keyset.json
:
{
"name": "My AWS Keyset",
"category": "provider",
"entity": "aws",
"workspaces": [],
"keys": [
{
"key_type": "pub",
"key": "123456789aBcDeF"
},
{
"key_type": "pvt",
"key": "aBcDeF123456789"
}
]
}
Example response:
{
"pk": 45675,
"name": "My AWS Keyset",
"category": "provider",
"entity": "aws",
"org": 2,
"workspaces": [
],
"user": 2,
"is_default": false,
"keys": [
{
"pk": 3,
"keyset": 5,
"key_type": "pvt",
"fingerprint": "",
"user": 380
},
{
"pk": 4,
"keyset": 6,
"key_type": "pub",
"fingerprint": "",
"user": 380
}
],
"created": "2019-02-07T21:24:43.037968Z"
}
Keyset and Key Values
Name | Type | Required | Description |
---|---|---|---|
name |
string |
Yes |
The Keyset name. Must be unique within the Organization by category and entity. |
category |
string |
Yes |
The Keyset category. Allowed values are: |
entity |
string |
No |
The entity to which the keyset applies. [See below for more details and allowed values](#keyset-details). |
org |
integer |
Yes |
The Organization ID. |
workspaces |
list of integers |
No |
A list of Workspace IDs within the Organization to which the Keyset applies. To enable Organization-wide access, leave this value empty. |
user |
integer |
No |
The ID of the user to whom the key is assigned. |
is_default |
string |
No |
Whether or not this is a default credential. Allowed values are |
keys |
list of objects |
Yes |
A list of keys to attach to the Keyset. |
key_type |
string |
Yes |
Type of key. Varies by keyset category and entity. [See below for more details and allowed values](#keyset-details). |
key |
string |
Yes |
The content of the key. This value is encrypted before being stored to the database. This value is not returned in GET requests. |
Note
|
When creating a Keyset, the required number of Keys must be passed. |
Entity | Number of Keys | Key Type | Data Type | Description |
---|---|---|---|---|
|
4 |
|
string |
|
|
string |
Tenant ID |
||
|
string |
Client ID |
||
|
string |
Client Password |
||
|
2 |
|
string |
|
|
string |
Secret Access Key |
||
|
4 |
|
string |
|
|
string |
Tenant ID |
||
|
string |
Client ID |
||
|
string |
Client Secret |
||
|
1 |
|
string |
API Token |
|
2 |
|
string |
|
|
string |
Secret Access Key |
||
|
1 |
|
string |
|
|
1 |
|
string |
|
|
1 |
|
string |
API Token |
|
1 |
|
string |
API Key |
|
2 |
|
string (email) |
ProfitBricks username |
|
string |
Password |
Solutions
Entity |
Number of Keys |
Key Type |
Data Type |
Description |
|
2 |
|
string |
API Key |
|
string |
Secret Key |
||
|
1 |
|
string |
Sysdig Cloud Access Key |
|
4 |
|
string |
Turbonomic Instance URL |
|
string |
Username |
||
|
string |
Password |
||
|
string |
Value must be |
Storage
Entity |
Number of Keys |
Key Type |
Data Type |
Description |
|
2 |
|
string |
|
|
Access Key |
User SSH
Entity |
Number of Keys |
Key Type |
Data Type |
Description |
1 |
|
string |
SSH Public key |
Update information for an existing Keyset.
Note
|
The PATCH method allows you to update the Workspace(s) for a Keyset. To activate Workspace restrictions for the Keyset, pass the Workspace ID(s) in the workspaces array. To make the Keyset available for the entire Organization, delete the Workspace ID(s).
|
Path Parameters
Name |
Required |
Description |
Org ID |
Yes |
The Organization ID. |
Keyset ID |
Yes |
The Keyset ID |
PATCH https://api.nks.netapp.io/orgs/{Org ID}/keysets/{Keyset ID}
Example request: Update an AWS Keyset name using a JSON file
curl -X PATCH \
-H "Authorization: Bearer abcdef123456789abcdef123456789" \
-H "Content-Type: application/json" \
-d @rename-aws-keyset.json \
"https://api.nks.netapp.io/orgs/2/keysets/4"
Contents of rename-aws-keyset.json
:
{
"name": "My Renamed AWS Keyset"
}
Alternate example: Update an AWS Keyset name as form data:
curl -X PATCH \
-H "Authorization: Bearer abcdef123456789abcdef123456789" \
-H "Content-Type: multipart/form-data" \
-F name="My Renamed AWS Keyset" \
"https://api.nks.netapp.io/orgs/2/keysets/4"
Example response:
{
"pk": 4,
"name": "My Renamed AWS Keyset2",
"category": "provider",
"entity": "aws",
"org": 2,
"workspaces": [
],
"user": 3,
"is_default": false,
"keys": [
{
"pk": 5,
"keyset": 4,
"key_type": "pub",
"fingerprint": "",
"user": 3
},
{
"pk": 6,
"keyset": 4,
"key_type": "pvt",
"fingerprint": "",
"user": 3
}
],
"created": "2019-02-07T21:40:50.675410Z"
}
Keyset and Key Values
Name | Type | Required | Description |
---|---|---|---|
name |
string |
Yes |
The Keyset name. Must be unique within the Organization by category and entity. |
category |
string |
Yes |
The Keyset category. Allowed values are: |
entity |
string |
No |
The entity to which the keyset applies. [See below for more details and allowed values](#keyset-details). |
org |
integer |
Yes |
The Organization ID. |
workspaces |
list of integers |
No |
A list of Workspace IDs within the Organization to which the Keyset applies. To enable Organization-wide access, leave this value empty. |
user |
integer |
No |
The ID of the user to whom the key is assigned. |
is_default |
string |
No |
Whether or not this is a default credential. Allowed values are |
keys |
list of objects |
Yes |
A list of keys to attach to the Keyset. |
key_type |
string |
Yes |
Type of key. Varies by keyset category and entity. [See below for more details and allowed values](#keyset-details). |
key |
string |
Yes |
The content of the key. This value is encrypted before being stored to the database. This value is not returned in GET requests. |
Note
|
When creating a Keyset, the required number of Keys must be passed. |
Providers
Entity | Number of Keys | Key Type | Data Type | Description |
---|---|---|---|---|
|
4 |
|
string |
|
|
string |
Tenant ID |
||
|
string |
Client ID |
||
|
string |
Client Password |
||
|
2 |
|
string |
|
|
string |
Secret Access Key |
||
|
4 |
|
string |
|
|
string |
Tenant ID |
||
|
string |
Client ID |
||
|
string |
Client Secret |
||
|
1 |
|
string |
API Token |
|
2 |
|
string |
|
|
string |
Secret Access Key |
||
|
1 |
|
string |
|
|
1 |
|
string |
|
|
1 |
|
string |
API Token |
|
1 |
|
string |
API Key |
|
2 |
|
string (email) |
ProfitBricks username |
|
string |
Password |
Solutions
Entity |
Number of Keys |
Key Type |
Data Type |
Description |
|
2 |
|
string |
API Key |
|
string |
Secret Key |
||
|
1 |
|
string |
Sysdig Cloud Access Key |
|
4 |
|
string |
Turbonomic Instance URL |
|
string |
Username |
||
|
string |
Password |
||
|
string |
Value must be |
Storage
Entity |
Number of Keys |
Key Type |
Data Type |
Description |
|
2 |
|
string |
|
|
Access Key |
User SSH
Entity |
Number of Keys |
Key Type |
Data Type |
Description |
1 |
|
string |
SSH Public key |
Delete the specified Keyset. All associated keys are removed.
Path Parameters
Name |
Required |
Description |
Org ID |
Yes |
The Organization ID. |
Keyset ID |
Yes |
The Keyset ID |
Warning
|
If you delete a keyset associated with a running cluster, you will not be able to add or remove nodes or delete the cluster cleanly. |
DELETE https://api.nks.netapp.io/orgs/{Org ID}/keysets/{Keyset ID}
Example: Delete Keyset ID 3
curl -X DELETE \
-H "Authorization: Bearer abcdef123456789abcdef123456789" \
"https://api.nks.netapp.io/orgs/2/keysets/3"
A successful DELETE returns an empty response with status code 204