Skip to content

Service Usage API (1)

This API provides services to manage service usage.

Overview
Languages
Servers
Mock server

https://idp.cdq.com/_mock/apis/service-usage-api/api-v1/

Production SOAP

https://service-usage-api.reverse-proxy.prod.k8s.production.cdq-cloud-engine.com/soap/v1/

Production

https://service-usage-api.reverse-proxy.prod.k8s.production.cdq-cloud-engine.com/

Quotas

Categorizes endpoints related to the creation, retrieval, and management of quota allocations and usages.

Operations

Returns Quota Usage

Request

Returns the quota usage for the given services and organizations.

Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johndoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
Bodyapplication/jsonrequired
valuesArray of objects(QuotaUsageRequest)[ 1 .. 100 ] itemsrequired

List of quota usage requests.

values[].​serviceobject(QuotaUsageServiceRequest)required

Request object for querying quota usage.

values[].​service.​technicalKeystring(DataSourceTechnicalKey)required

Technical key of the data source.

Example: "BR_RF"
values[].​service.​authoritystring(ServiceAuthority)

Authority like in istio (host).

Example: "api.cdq.com"
values[].​service.​methodstring(ServiceMethod)

Method like in istio.

Example: "GET"
values[].​service.​pathstring(ServicePath)

Path like in istio.

Example: "/api/v1/data"
values[].​organizationobject(QuotaUsageOrganizationRequest)required

Request object for querying quota usage.

values[].​organization.​idstring(OrganizationId)required

Uniquely identifying ID of the organization.

Example: "cdq_monitor"
values[].​workspaceobject(QuotaUsageWorkspaceRequest)

Request object for querying quota usage.

values[].​resetstring(QuotaReset)

Defines after which time interval to reset the amount of the quota.

Example: "WEEK"
curl -i -X POST \
  https://idp.cdq.com/_mock/apis/service-usage-api/api-v1/quotas/usage \
  -H 'Content-Type: application/json' \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3' \
  -d '{
    "values": [
      {
        "service": {
          "technicalKey": "BR_RF",
          "authority": "api.cdq.com",
          "method": "GET",
          "path": "/api/v1/data"
        },
        "organization": {
          "id": "cdq_monitor"
        },
        "workspace": {
          "id": "c074b9f3-abf0-4f8e-9a20-74deb6cfa2a4"
        },
        "reset": "WEEK"
      }
    ]
  }'

Responses

successful operation

Bodyapplication/json
valuesArray of objects(QuotaUsageSearchResult)

List of quota usage results.

Response
application/json
{ "values": [ {} ] }

Query External Service

Request

Check if the user can query the external service and increments the usage.

Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johndoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
Bodyapplication/jsonrequired
serviceobject(QuotaUsageServiceRequest)required

Request object for querying quota usage.

service.​technicalKeystring(DataSourceTechnicalKey)required

Technical key of the data source.

Example: "BR_RF"
service.​authoritystring(ServiceAuthority)

Authority like in istio (host).

Example: "api.cdq.com"
service.​methodstring(ServiceMethod)

Method like in istio.

Example: "GET"
service.​pathstring(ServicePath)

Path like in istio.

Example: "/api/v1/data"
apiKeyCredentialsobject(QuotaCheckApiKeyCredentialsRequest)

Request object for checking quota usage.

quotaAmountinteger(int32)(QuotaCheckQuotaAmountRequest)

-1 is enabled for JOBS.

Default 1
Example: "1"
curl -i -X POST \
  https://idp.cdq.com/_mock/apis/service-usage-api/api-v1/quotas/consume \
  -H 'Content-Type: application/json' \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3' \
  -d '{
    "service": {
      "technicalKey": "BR_RF",
      "authority": "api.cdq.com",
      "method": "GET",
      "path": "/api/v1/data"
    },
    "apiKeyCredentials": {
      "organizationId": "cdq_monitor",
      "workspaceId": "c074b9f3-abf0-4f8e-9a20-74deb6cfa2a4",
      "preferredUsername": "johndoe"
    },
    "quotaAmount": "1"
  }'

Responses

successful operation

Bodyapplication/json
statusstring(QuotaCheckStatus)

Possible values: OK, OVER_LIMIT.

Example: "OK"
Response
application/json
{ "status": "OK" }

Quotas Usage

Categorizes endpoints related to the management of quota usages.

Operations