Skip to content

Keys

Operations Summary

Method Endpoint Description
GET /api/keys/ List Keys
GET /api/keys/{uuid}/ Retrieve
POST /api/keys/ Create
DELETE /api/keys/{uuid}/ Delete

List Keys

1
2
3
4
http \
  GET \
  https://api.example.com/api/keys/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.keys import keys_list # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = keys_list.sync(client=client)

for item in response:
    print(item)
  1. API Source: keys_list
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import { keysList } from 'waldur-js-client';

try {
  const response = await keysList({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Description
created string (date-time) Created after
field array
fingerprint_md5 string
fingerprint_sha256 string
fingerprint_sha512 string
is_shared boolean
modified string (date-time) Modified after
name string
name_exact string
o array Ordering

page integer A page number within the paginated result set.
page_size integer Number of results to return per page.
user_uuid string (uuid)
uuid string (uuid)

200 -

The response body is an array of objects, where each object has the following structure:

Field Type
url string (uri)
uuid string (uuid)
name string
public_key string
fingerprint_md5 string
fingerprint_sha256 string
fingerprint_sha512 string
user_uuid string (uuid)
is_shared boolean
type string

Retrieve

1
2
3
4
http \
  GET \
  https://api.example.com/api/keys/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.keys import keys_retrieve # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = keys_retrieve.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: keys_retrieve
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { keysRetrieve } from 'waldur-js-client';

try {
  const response = await keysRetrieve({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)
Name Type
field array

200 -

Field Type
url string (uri)
uuid string (uuid)
name string
public_key string
fingerprint_md5 string
fingerprint_sha256 string
fingerprint_sha512 string
user_uuid string (uuid)
is_shared boolean
type string

Create

1
2
3
4
5
http \
  POST \
  https://api.example.com/api/keys/ \
  Authorization:"Token YOUR_API_TOKEN" \
  public_key="string-value"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.ssh_key_request import SshKeyRequest # (1)
from waldur_api_client.api.keys import keys_create # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = SshKeyRequest(
    public_key="string-value"
)
response = keys_create.sync(
    client=client,
    body=body_data
)

print(response)
  1. Model Source: SshKeyRequest
  2. API Source: keys_create
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { keysCreate } from 'waldur-js-client';

try {
  const response = await keysCreate({
  auth: "Token YOUR_API_TOKEN",
  body: {
    "public_key": "string-value"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Field Type Required
name string
public_key string

201 -

Field Type
url string (uri)
uuid string (uuid)
name string
public_key string
fingerprint_md5 string
fingerprint_sha256 string
fingerprint_sha512 string
user_uuid string (uuid)
is_shared boolean
type string

Delete

1
2
3
4
http \
  DELETE \
  https://api.example.com/api/keys/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.keys import keys_destroy # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = keys_destroy.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: keys_destroy
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { keysDestroy } from 'waldur-js-client';

try {
  const response = await keysDestroy({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)

204 - No response body