Skip to content

Marketplace Attribute Options

Operations Summary

Method Endpoint Description
GET /api/marketplace-attribute-options/ List attribute options
GET /api/marketplace-attribute-options/{uuid}/ Retrieve an attribute option
POST /api/marketplace-attribute-options/ Create an attribute option
PUT /api/marketplace-attribute-options/{uuid}/ Update an attribute option
PATCH /api/marketplace-attribute-options/{uuid}/ Partially update an attribute option
DELETE /api/marketplace-attribute-options/{uuid}/ Delete an attribute option

List attribute options

Returns a paginated list of options for choice-type attributes. Filter by attribute (URL). Default option is determined by attribute.default.

1
2
3
4
http \
  GET \
  https://api.example.com/api/marketplace-attribute-options/ \
  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.marketplace_attribute_options import marketplace_attribute_options_list # (1)

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

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

try {
  const response = await marketplaceAttributeOptionsList({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Description
attribute string (uri) Attribute URL
page integer A page number within the paginated result set.
page_size integer Number of results to return per page.

200 -

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

Field Type Description
url string (uri)
uuid string (uuid)
id integer
key string
title string
attribute string (uri)
attribute_title string
is_default boolean Return True if this option is the default for its attribute.

Retrieve an attribute option

Returns the details of a specific attribute option.

1
2
3
4
http \
  GET \
  https://api.example.com/api/marketplace-attribute-options/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.marketplace_attribute_options import marketplace_attribute_options_retrieve # (1)

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

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

try {
  const response = await marketplaceAttributeOptionsRetrieve({
  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)

200 -

Field Type Description
url string (uri)
uuid string (uuid)
id integer
key string
title string
attribute string (uri)
attribute_title string
is_default boolean Return True if this option is the default for its attribute.

Create an attribute option

Creates a new option for a choice-type attribute. Requires staff permissions.

1
2
3
4
5
6
7
http \
  POST \
  https://api.example.com/api/marketplace-attribute-options/ \
  Authorization:"Token YOUR_API_TOKEN" \
  key="ssh-rsa AAAAB3NzaC1yc2EAAA..." \
  title="string-value" \
  attribute="https://api.example.com/api/attribute/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.attribute_option_request import AttributeOptionRequest # (1)
from waldur_api_client.api.marketplace_attribute_options import marketplace_attribute_options_create # (2)

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

body_data = AttributeOptionRequest(
    key="ssh-rsa AAAAB3NzaC1yc2EAAA...",
    title="string-value",
    attribute="https://api.example.com/api/attribute/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
)
response = marketplace_attribute_options_create.sync(
    client=client,
    body=body_data
)

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

try {
  const response = await marketplaceAttributeOptionsCreate({
  auth: "Token YOUR_API_TOKEN",
  body: {
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAA...",
    "title": "string-value",
    "attribute": "https://api.example.com/api/attribute/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Field Type Required
key string
title string
attribute string (uri)

201 -

Field Type Description
url string (uri)
uuid string (uuid)
id integer
key string
title string
attribute string (uri)
attribute_title string
is_default boolean Return True if this option is the default for its attribute.

Update an attribute option

Updates an existing attribute option. Requires staff permissions.

1
2
3
4
5
6
7
http \
  PUT \
  https://api.example.com/api/marketplace-attribute-options/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN" \
  key="ssh-rsa AAAAB3NzaC1yc2EAAA..." \
  title="string-value" \
  attribute="https://api.example.com/api/attribute/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.attribute_option_request import AttributeOptionRequest # (1)
from waldur_api_client.api.marketplace_attribute_options import marketplace_attribute_options_update # (2)

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

body_data = AttributeOptionRequest(
    key="ssh-rsa AAAAB3NzaC1yc2EAAA...",
    title="string-value",
    attribute="https://api.example.com/api/attribute/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
)
response = marketplace_attribute_options_update.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

print(response)
  1. Model Source: AttributeOptionRequest
  2. API Source: marketplace_attribute_options_update
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import { marketplaceAttributeOptionsUpdate } from 'waldur-js-client';

try {
  const response = await marketplaceAttributeOptionsUpdate({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  },
  body: {
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAA...",
    "title": "string-value",
    "attribute": "https://api.example.com/api/attribute/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)
Field Type Required
key string
title string
attribute string (uri)

200 -

Field Type Description
url string (uri)
uuid string (uuid)
id integer
key string
title string
attribute string (uri)
attribute_title string
is_default boolean Return True if this option is the default for its attribute.

Partially update an attribute option

Partially updates an existing attribute option. To set the default option, PATCH the attribute with default=. Requires staff permissions.

1
2
3
4
http \
  PATCH \
  https://api.example.com/api/marketplace-attribute-options/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.patched_attribute_option_request import PatchedAttributeOptionRequest # (1)
from waldur_api_client.api.marketplace_attribute_options import marketplace_attribute_options_partial_update # (2)

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

body_data = PatchedAttributeOptionRequest()
response = marketplace_attribute_options_partial_update.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

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

try {
  const response = await marketplaceAttributeOptionsPartialUpdate({
  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)
Field Type Required
key string
title string
attribute string (uri)

200 -

Field Type Description
url string (uri)
uuid string (uuid)
id integer
key string
title string
attribute string (uri)
attribute_title string
is_default boolean Return True if this option is the default for its attribute.

Delete an attribute option

Deletes an attribute option. Requires staff permissions.

1
2
3
4
http \
  DELETE \
  https://api.example.com/api/marketplace-attribute-options/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.marketplace_attribute_options import marketplace_attribute_options_destroy # (1)

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

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

try {
  const response = await marketplaceAttributeOptionsDestroy({
  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