Skip to content

Project Credits

Operations Summary

Method Endpoint Description
GET /api/project-credits/ List Project Credits
GET /api/project-credits/{uuid}/ Retrieve
POST /api/project-credits/ Create
PUT /api/project-credits/{uuid}/ Update
PATCH /api/project-credits/{uuid}/ Partial Update
DELETE /api/project-credits/{uuid}/ Delete

List Project Credits

1
2
3
4
http \
  GET \
  https://api.example.com/api/project-credits/ \
  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.project_credits import project_credits_list # (1)

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

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

try {
  const response = await projectCreditsList({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Description
customer_name string
customer_slug string
customer_uuid string (uuid)
o array Ordering

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

200 -

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

Field Type
uuid string (uuid)
url string (uri)
value string (decimal)
project string (uri)
project_name string
project_uuid string (uuid)
project_slug string
customer_name string
customer_slug string
customer_uuid string (uuid)
customer_credit string (decimal)
allocated_customer_credit number (double)
consumption_last_month number (double)
offerings array of objects
offerings.uuid string (uuid)
offerings.url string (uri)
offerings.type string
offerings.name string
end_date string (date)
expected_consumption string (decimal)
minimal_consumption number (double)
minimal_consumption_logic string
grace_coefficient string (decimal)
apply_as_minimal_consumption boolean
mark_unused_credit_as_spent_on_project_termination boolean

Retrieve

1
2
3
4
http \
  GET \
  https://api.example.com/api/project-credits/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.project_credits import project_credits_retrieve # (1)

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

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

try {
  const response = await projectCreditsRetrieve({
  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
uuid string (uuid)
url string (uri)
value string (decimal)
project string (uri)
project_name string
project_uuid string (uuid)
project_slug string
customer_name string
customer_slug string
customer_uuid string (uuid)
customer_credit string (decimal)
allocated_customer_credit number (double)
consumption_last_month number (double)
offerings array of objects
offerings.uuid string (uuid)
offerings.url string (uri)
offerings.type string
offerings.name string
end_date string (date)
expected_consumption string (decimal)
minimal_consumption number (double)
minimal_consumption_logic string
grace_coefficient string (decimal)
apply_as_minimal_consumption boolean
mark_unused_credit_as_spent_on_project_termination boolean

Create

1
2
3
4
5
http \
  POST \
  https://api.example.com/api/project-credits/ \
  Authorization:"Token YOUR_API_TOKEN" \
  project="https://api.example.com/api/project/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
 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.project_credit_request import ProjectCreditRequest # (1)
from waldur_api_client.api.project_credits import project_credits_create # (2)

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

body_data = ProjectCreditRequest(
    project="https://api.example.com/api/project/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
)
response = project_credits_create.sync(
    client=client,
    body=body_data
)

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

try {
  const response = await projectCreditsCreate({
  auth: "Token YOUR_API_TOKEN",
  body: {
    "project": "https://api.example.com/api/project/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Field Type Required
value string (decimal)
project string (uri)
end_date string (date)
expected_consumption string (decimal)
minimal_consumption_logic string
grace_coefficient string (decimal)
apply_as_minimal_consumption boolean
mark_unused_credit_as_spent_on_project_termination boolean

201 -

Field Type
uuid string (uuid)
url string (uri)
value string (decimal)
project string (uri)
project_name string
project_uuid string (uuid)
project_slug string
customer_name string
customer_slug string
customer_uuid string (uuid)
customer_credit string (decimal)
allocated_customer_credit number (double)
consumption_last_month number (double)
offerings array of objects
offerings.uuid string (uuid)
offerings.url string (uri)
offerings.type string
offerings.name string
end_date string (date)
expected_consumption string (decimal)
minimal_consumption number (double)
minimal_consumption_logic string
grace_coefficient string (decimal)
apply_as_minimal_consumption boolean
mark_unused_credit_as_spent_on_project_termination boolean

Update

1
2
3
4
5
http \
  PUT \
  https://api.example.com/api/project-credits/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN" \
  project="https://api.example.com/api/project/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
 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.project_credit_request import ProjectCreditRequest # (1)
from waldur_api_client.api.project_credits import project_credits_update # (2)

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

body_data = ProjectCreditRequest(
    project="https://api.example.com/api/project/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
)
response = project_credits_update.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

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

try {
  const response = await projectCreditsUpdate({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  },
  body: {
    "project": "https://api.example.com/api/project/a1b2c3d4-e5f6-7890-abcd-ef1234567890/"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid)
Field Type Required
value string (decimal)
project string (uri)
end_date string (date)
expected_consumption string (decimal)
minimal_consumption_logic string
grace_coefficient string (decimal)
apply_as_minimal_consumption boolean
mark_unused_credit_as_spent_on_project_termination boolean

200 -

Field Type
uuid string (uuid)
url string (uri)
value string (decimal)
project string (uri)
project_name string
project_uuid string (uuid)
project_slug string
customer_name string
customer_slug string
customer_uuid string (uuid)
customer_credit string (decimal)
allocated_customer_credit number (double)
consumption_last_month number (double)
offerings array of objects
offerings.uuid string (uuid)
offerings.url string (uri)
offerings.type string
offerings.name string
end_date string (date)
expected_consumption string (decimal)
minimal_consumption number (double)
minimal_consumption_logic string
grace_coefficient string (decimal)
apply_as_minimal_consumption boolean
mark_unused_credit_as_spent_on_project_termination boolean

Partial Update

1
2
3
4
http \
  PATCH \
  https://api.example.com/api/project-credits/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_project_credit_request import PatchedProjectCreditRequest # (1)
from waldur_api_client.api.project_credits import project_credits_partial_update # (2)

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

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

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

try {
  const response = await projectCreditsPartialUpdate({
  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
value string (decimal)
project string (uri)
end_date string (date)
expected_consumption string (decimal)
minimal_consumption_logic string
grace_coefficient string (decimal)
apply_as_minimal_consumption boolean
mark_unused_credit_as_spent_on_project_termination boolean

200 -

Field Type
uuid string (uuid)
url string (uri)
value string (decimal)
project string (uri)
project_name string
project_uuid string (uuid)
project_slug string
customer_name string
customer_slug string
customer_uuid string (uuid)
customer_credit string (decimal)
allocated_customer_credit number (double)
consumption_last_month number (double)
offerings array of objects
offerings.uuid string (uuid)
offerings.url string (uri)
offerings.type string
offerings.name string
end_date string (date)
expected_consumption string (decimal)
minimal_consumption number (double)
minimal_consumption_logic string
grace_coefficient string (decimal)
apply_as_minimal_consumption boolean
mark_unused_credit_as_spent_on_project_termination boolean

Delete

1
2
3
4
http \
  DELETE \
  https://api.example.com/api/project-credits/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.project_credits import project_credits_destroy # (1)

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

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

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