Read a CreditGrant
const url = 'https://example.com/apis/nodus.dev/v1/creditgrants/example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/apis/nodus.dev/v1/creditgrants/exampleParameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The object’s name.
Responses
Section titled “ Responses ”OK
CreditGrant is promotional or operator credit in its own wallet bucket: the starter grant, a promo code redemption, an admin credit or goodwill. The system and operators create grants; customers read them. A grant is drawn before purchased credit, soonest expiry first, and its unspent remainder expires.
object
object
object
object
object
object
object
CreditGrantSpec is what was granted.
object
AmountUSD is the credit granted, such as “30.00”.
ExpirationTime is when the unspent remainder expires; unset means it never does.
PromoCode is the redeemed code, masked to its last four characters (****AB12).
Reason is the note shown with the grant.
Scope restricts the grant to one kind of usage, such as nodus/auto for Composer model calls; unset grants pay for any usage.
Source is where the grant came from.
CreditGrantStatus is how much of the grant is left. RemainingUSD + SpentUSD + ExpiredUSD = AmountUSD.
object
Conditions carry Expired once the remainder has expired.
object
ExpiredUSD is the remainder that expired unspent.
GrantedTime is when the credit was added.
HeldUSD is the part of RemainingUSD held for running work.
RemainingUSD is the unspent credit, including any held for running work.
SpentUSD is what usage has drawn from the grant.
Example generated
{ "apiVersion": "example", "kind": "example", "metadata": { "annotations": { "additionalProperty": "example" }, "creationTimestamp": "example", "deletionGracePeriodSeconds": 1, "deletionTimestamp": "example", "finalizers": [ "example" ], "generateName": "example", "generation": 1, "labels": { "additionalProperty": "example" }, "managedFields": [ { "apiVersion": "example", "fieldsType": "example", "fieldsV1": { "additionalProperty": "example" }, "manager": "example", "operation": "example", "subresource": "example", "time": "example" } ], "name": "example", "namespace": "example", "ownerReferences": [ { "apiVersion": "example", "blockOwnerDeletion": true, "controller": true, "kind": "example", "name": "example", "uid": "example" } ], "resourceVersion": "example", "selfLink": "example", "uid": "example" }, "spec": { "amountUSD": "example", "expirationTime": "example", "promoCode": "example", "reason": "example", "scope": "example", "source": "example" }, "status": { "conditions": [ { "lastTransitionTime": "example", "message": "example", "observedGeneration": 1, "reason": "example", "status": "example", "type": "example" } ], "expiredUSD": "example", "grantedTime": "example", "heldUSD": "example", "remainingUSD": "example", "spentUSD": "example" }}default
Section titled “ default ”An error: a metav1.Status whose reason is a registered code.
Status is the error body of every API response: a Kubernetes metav1.Status (so kubectl and client-go understand it) plus three top-level extensions that those clients ignore (ADR-028).
object
object
object
Docs is the URL of the code’s docs page.
Fix says what to do next, for example a CLI command or the field to change.
object
object
RequestID identifies the request in logs and support tickets.
Example generated
{ "apiVersion": "example", "code": 1, "details": { "causes": [ { "field": "example", "message": "example", "reason": "example" } ], "group": "example", "kind": "example", "name": "example", "retryAfterSeconds": 1, "uid": "example" }, "docs": "example", "fix": "example", "kind": "example", "message": "example", "metadata": { "continue": "example", "remainingItemCount": 1, "resourceVersion": "example", "selfLink": "example", "shardInfo": { "selector": "example" } }, "reason": "example", "requestId": "example", "status": "example"}