Skip to content

Marketplace Component Usages

Operations Summary

Method Endpoint Description
Core CRUD
GET /api/marketplace-component-usages/ List Marketplace Component Usages
GET /api/marketplace-component-usages/{uuid}/ Retrieve
Other Actions
POST /api/marketplace-component-usages/set_usage/ Set usage
POST /api/marketplace-component-usages/{uuid}/set_user_usage/ Set user usage

Core CRUD

List Marketplace Component Usages

1
2
3
4
http \
  GET \
  https://api.example.com/api/marketplace-component-usages/ \
  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_component_usages import marketplace_component_usages_list # (1)

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

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

try {
  const response = await marketplaceComponentUsagesList({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Description
billing_period string (date)
billing_period_month number
billing_period_year number
customer_uuid string (uuid)
date_after string (date)
date_before string (date)
field array
o array Ordering

offering_uuid string (uuid)
page integer A page number within the paginated result set.
page_size integer Number of results to return per page.
project_uuid string (uuid)
resource string
resource_uuid string (uuid)
type string

200 -

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

Field Type Description
uuid string (uuid)
created string (date-time)
description string
type string Unique internal name of the measured unit, for example floating_ip.
name string Display name for the measured unit, for example, Floating IP.
measured_unit string Unit of measurement, for example, GB.
usage integer
date string (date-time)
recurring boolean Reported value is reused every month until changed.
resource_name string
resource_uuid string (uuid)
offering_name string
offering_uuid string (uuid)
project_name string
project_uuid string
customer_name string
customer_uuid string
billing_period string (date)
modified_by integer

Retrieve

1
2
3
4
http \
  GET \
  https://api.example.com/api/marketplace-component-usages/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_component_usages import marketplace_component_usages_retrieve # (1)

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

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

try {
  const response = await marketplaceComponentUsagesRetrieve({
  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 Description
uuid string (uuid)
created string (date-time)
description string
type string Unique internal name of the measured unit, for example floating_ip.
name string Display name for the measured unit, for example, Floating IP.
measured_unit string Unit of measurement, for example, GB.
usage integer
date string (date-time)
recurring boolean Reported value is reused every month until changed.
resource_name string
resource_uuid string (uuid)
offering_name string
offering_uuid string (uuid)
project_name string
project_uuid string
customer_name string
customer_uuid string
billing_period string (date)
modified_by integer

Other Actions

Set usage

1
2
3
4
5
http \
  POST \
  https://api.example.com/api/marketplace-component-usages/set_usage/ \
  Authorization:"Token YOUR_API_TOKEN" \
  usages:='[]'
 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.component_usage_create_request import ComponentUsageCreateRequest # (1)
from waldur_api_client.api.marketplace_component_usages import marketplace_component_usages_set_usage # (2)

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

body_data = ComponentUsageCreateRequest(
    usages=[]
)
response = marketplace_component_usages_set_usage.sync(
    client=client,
    body=body_data
)

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

try {
  const response = await marketplaceComponentUsagesSetUsage({
  auth: "Token YOUR_API_TOKEN",
  body: {
    "usages": []
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Field Type Required
usages array of objects
usages.type string
usages.amount string (decimal)
usages.description string
usages.recurring boolean
plan_period string (uuid)
resource string (uuid)

201 - No response body


Set user usage

1
2
3
4
5
http \
  POST \
  https://api.example.com/api/marketplace-component-usages/a1b2c3d4-e5f6-7890-abcd-ef1234567890/set_user_usage/ \
  Authorization:"Token YOUR_API_TOKEN" \
  username="alice"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.component_user_usage_create_request import ComponentUserUsageCreateRequest # (1)
from waldur_api_client.api.marketplace_component_usages import marketplace_component_usages_set_user_usage # (2)

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

body_data = ComponentUserUsageCreateRequest(
    username="alice"
)
response = marketplace_component_usages_set_user_usage.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

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

try {
  const response = await marketplaceComponentUsagesSetUserUsage({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  },
  body: {
    "username": "alice"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)
Field Type Required
usage string (decimal)
username string
user string (uri)

201 - No response body