Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Read the workspace Credits spending limit and commitment

Generated from the checked-in source. Do not edit this reference by hand.

GET /api/v1/organizations/{organization}/projects/{project}/units/limit

Workspace read permission required. Returns the workspace’s explicit Credits atom limit, policy revision, committed atoms (settled charges minus original-range restorations plus unresolved holds and known overrun liabilities), remaining allowance, and whether an existing monetary workspace limit is preserved. A preserved monetary limit blocks Credits admission until an explicit Credits workspace limit revision (integer atoms or null for unlimited) is published. Never exposes company balance or procurement costs.

Operation: getWorkspaceCustomerUnitSpendingLimit.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"bearerAuth": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X GET "$NIU_ORIGIN/api/v1/organizations/{organization}/projects/{project}/units/limit" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN"

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

No request body is declared.

Current workspace Credits spending limit state

Content type: application/json.

JSON
{
"type": "object",
"additionalProperties": false,
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"unit",
"limit_atoms",
"revision",
"definition_revision",
"committed_atoms",
"remaining_atoms",
"monetary_limit_preserved",
"credits_admission_blocked_by_monetary_limit"
],
"properties": {
"unit": {
"type": [
"object",
"null"
],
"additionalProperties": false,
"required": [
"definition_revision",
"name",
"display_precision",
"atoms_per_unit"
],
"properties": {
"definition_revision": {
"type": "string",
"pattern": "^[1-9][0-9]*$"
},
"name": {
"type": "string"
},
"display_precision": {
"type": "integer",
"minimum": 0,
"maximum": 9
},
"atoms_per_unit": {
"type": "string",
"const": "1000000000"
}
}
},
"limit_atoms": {
"type": [
"string",
"null"
],
"pattern": "^(0|[1-9][0-9]*)$"
},
"revision": {
"type": [
"string",
"null"
],
"pattern": "^[1-9][0-9]*$"
},
"definition_revision": {
"type": [
"string",
"null"
],
"pattern": "^[1-9][0-9]*$"
},
"committed_atoms": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$"
},
"remaining_atoms": {
"type": [
"string",
"null"
],
"pattern": "^(0|[1-9][0-9]*)$"
},
"monetary_limit_preserved": {
"type": "boolean"
},
"credits_admission_blocked_by_monetary_limit": {
"type": "boolean"
}
}
}
}
}

Authentication required or revoked

Workspace access denied

Workspace not found in the authorized scope

Storage unavailable

Workspace read permission required. Returns the workspace’s explicit Credits atom limit, policy revision, committed atoms (settled charges minus original-range restorations plus unresolved holds and known overrun liabilities), remaining allowance, and whether an existing monetary workspace limit is preserved. A preserved monetary limit blocks Credits admission until an explicit Credits workspace limit revision (integer atoms or null for unlimited) is published. Never exposes company balance or procurement costs.

Supported scope: implemented