Enterprise Dashboard API v1 (Current)

As an admin user of your organization, you can create API keys, these API keys will allow you to gather consumption data for your organization.

Be aware that API keys from a global organization (payer account) can access data of all tenants, which are part of the global organization.

You can create API Keys in your organization settings (Configuration API Keys) or via API. The tokens are valid for up to 90 days per default. Please make sure that the token security level is set as “Admin” during creation.

You can access https://api-enterprise-dashboard.otc-service.com/ to get started with different API endpoints as well. Please keep in mind that you still need at least a user account with admin permissions to interact with the API. All endpoints, except the Health Endpoints, require Authentification.

../_images/image3.png

Consumption

GET
/v1/consumption

Show Consumption

This API fetches your consumption data. Please create a API Key either in Enterprise Dashboard UI or with the API.

Success

Code

Reason

200 - OK

Request was successful.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

Name

In

Type

Description

limit (Optional)

body

integer

Limits the number consumption data to be returned.

default = 10, min = 1, max = 100

offset (Optional)

body

integer

Allows you to fetch next set of consumption data.

default = 0, min = 0

contract (Optional)

body

integer

To filter based on contract.

consumption_date (Optional)

body

string

This field displays the date the service was consumed.

format = YYYY-MM-DD

tagged (Optional)

body

boolean

This field decides if the tagged resources should be filtered or not.

product (Optional)

body

integer

To filter based on Product Id.

min = 1, max = 32

product_description (Optional)

body

string

To filter baes on Product Description.

project_name (Optional)

body

string

This field displays your project name like "eu-de"

resource_id (Optional)

body

string

This field displays the resource id. This field is a unique identifier for all services.

tag_key (Optional)

body

string

This field displays the tag key attached to a resource.

tag_value (Optional)

body

string

This field displays the tag value. Please note that tags are a pair of tag key and tag value.

Curl Example

curl -G 'https://api-enterprise-dashboard.otc-service.com/v1/consumption' \
    -H 'Authorization: Bearer {API_Key}' \
    --data-urlencode offset=0 \
    --data-urlencode limit=10 \
--data-raw '{
    "contract": 1000021234}'

Response Parameters

Response Example

{
    "offset": 0,
    "total": 261,
    "limit": 3,
    "kind": "Collection",
    "contents": [
        {
            "kind": "Consumption",
            "contract": 1000021234,
            "business_partner_id": 12345,
            "reseller_id": 12345,
            "quantity_unit": "H",
            "consumption_date": "2020-02-01 00:00:00",
            "unit_price": 2.19,
            "listprice_amount": 52.56,
            "amount": 42.048,
            "product": "OTC_D24XL8_LI",
            "product_description": "Disk Intensive d2.4xl.8 Linux",
            "project_id": "499378d37f2b4b93a85d81df93fe2d2f",
            "resource_id": "129dea56-f552-4db9-8caf-1e3fea3d78cb",
            "billing_quantity": 24.0,
            "project_name": "eu-de",
            "consumption_type_description": "Usage for PLM Cloud with price",	  
            "region": "EU-DE"
        }
    ]
}
GET
/v1/consumption/day

Show Daily Consumption

Success

Code

Reason

200 - OK

Request was successful.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

Name

In

Type

Description

consumption_date (Optional)

query

string

Return the data of the selected date.

Curl Example

curl -G 'https://api-enterprise-dashboard.otc-service.com/v1/consumption/day?consumption_date=2020-08-01' \
    -H 'Authorization: Bearer {API_Key}'

Response Parameters

Response Example

{
    "total": 261,
    "kind": "Collection",
    "contents": [
        {
            "kind": "Consumption",
            "contract": 1000021234,
            "business_partner_id": 12345,
            "reseller_id": 12345,
            "quantity_unit": "H",
            "consumption_date": "2020-08-01 00:00:00",
            "unit_price": 2.19,
            "listprice_amount": 52.56,
            "amount": 42.048,
            "product": "OTC_D24XL8_LI",
            "product_description": "Disk Intensive d2.4xl.8 Linux",
            "project_id": "499378d37f2b4b93a85d81df93fe2d2f",
            "resource_id": "129dea56-f552-4db9-8caf-1e3fea3d78cb",
            "billing_quantity": 24.0,
            "project_name": "eu-de",
            "consumption_type_description": "Usage for PLM Cloud with price",
            "region": "EU-DE"
        }
    ]
}
GET
/v1/consumption/day

Show Weekly Consumption

Success

Code

Reason

200 - OK

Request was successful.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

Name

In

Type

Description

year

query

integer

The selected year.

week

query

integer

Return the data of the selected week.

Curl Example

curl -G 'https://api-enterprise-dashboard.otc-service.com/v1/consumption/week?year=2020\&week=33' \
    -H 'Authorization: Bearer {API_Key}'

Response Parameters

Response Example

{
    "total": 261,
    "kind": "Collection",
    "contents": [
        {
            "kind": "Consumption",
            "contract": 1000021234,
            "business_partner_id": 12345,
            "reseller_id": 12345,
            "quantity_unit": "H",
            "consumption_date": "2020-02-01 00:00:00",
            "unit_price": 2.19,
            "listprice_amount": 52.56,
            "amount": 42.048,
            "product": "OTC_D24XL8_LI",
            "product_description": "Disk Intensive d2.4xl.8 Linux",
            "project_id": "499378d37f2b4b93a85d81df93fe2d2f",
            "resource_id": "129dea56-f552-4db9-8caf-1e3fea3d78cb",
            "billing_quantity": 24.0,
            "project_name": "eu-de",
            "consumption_type_description": "Usage for PLM Cloud with price",
            "region": "EU-DE"
        }
    ]
}
GET
/v1/consumption/month

Show Montly Consumption

Success

Code

Reason

200 - OK

Request was successful.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

Name

In

Type

Description

month

query

integer

Return the data of the selected month.

Curl Example

curl -G 'https://api-enterprise-dashboard.otc-service.com/v1/consumption/month?month=2020-07' \
    -H 'Authorization: Bearer {API_Key}' 

Response Parameters

Response Example

{
    "total": 261,
    "kind": "Collection",
    "contents": [
        {
            "kind": "Consumption",
            "contract": 1000021234,
            "business_partner_id": 12345,
            "reseller_id": 12345,
            "quantity_unit": "H",
            "consumption_date": "2020-02-01 00:00:00",
            "unit_price": 2.19,
            "listprice_amount": 52.56,
            "amount": 42.048,
            "product": "OTC_D24XL8_LI",
            "product_description": "Disk Intensive d2.4xl.8 Linux",
            "project_id": "499378d37f2b4b93a85d81df93fe2d2f",
            "resource_id": "129dea56-f552-4db9-8caf-1e3fea3d78cb",
            "billing_quantity": 24.0,
            "project_name": "eu-de",
            "consumption_type_description": "Usage for PLM Cloud with price",
            "region": "EU-DE"
        },
    ]
}
GET
/v1/consumption/reserved

Show Reserved packages data

This API fetches your reserved packages data.

Success

Code

Reason

200 - OK

Request was successful.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

Name

In

Type

Description

contract (Optional)

body

integer

To filter based on contract.

Curl Example

curl -G 'https://api-enterprise-dashboard.otc-service.com/v1/consumption/reserved' \
    -H 'Authorization: Bearer {API_Key}' \
    --data-raw '{"contract": 1000038535}'

Response Parameters

Response Example

{
    "kind": "Collection",
    "contents": [
        {
            "kind": "Consumption",
            "time": "2020-10-01 00:00:00",
            "consumption_date ": "2020-10-01 00:00:00",
            "contract ": 1000038535,
            "customer_name": "T-Systems",
            "regulator_id": 1234,
            "product": "General Purpose 1:2 v2 s2.m.2 Linux",
            "product_description": "General Purpose 1:2 v2 s2.m.2 Linux",
            "billing_quantity": "2 ST",
            "reserved_type": "upfront",
            "amount": 375.44,
            "region": "EU-DE"
        }
    ]
}       

Health

GET
/v1/consumption/health

Health

This endpoint is used to get the API's health. There is no authentication required and results are not cached. It's used for monitoring the health of our service.

Success

Code

Reason

200 - OK

Request was successful.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

N/A

Curl Example

curl -G 'https://api-enterprise-dashboard.otc-service.com/v1/consumption/health'

Response Parameters

N/A

Grafana API Key

Warning

Attention API endpoint /v1/Grafana/keys is deprecated and will be taken offline on 31.07.2023.

Use the API provided by Grafana. This API allows you to manage Grafana API keys: https://enterprise-dashboard-dev.otc-service.com/api/auth/keys

Documentation: https://grafana.com/docs/grafana/latest/administration/api-keys/

This API allows you to manage Grafana API keys:

  • List keys

  • Create API key

  • Delete key

Please use your username and password as basic authentificaton for Grafana API endpoints. These credentials are also used to log into the UI.

GET
/v1/Grafana/keys

List Keys

Success

Code

Reason

200 - OK

Request was successful.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

N/A

Curl Example

curl -X GET 'https://api-enterprise-dashboard.otc-service.com/v1/Grafana/auth/keys' \
    -H 'Authorization: Basic {base64(username:password)}'

Response Parameters

N/A

Reponse Example

{
    "list": [
        {
            "id": 1,
            "name": "myApiKey",
            "role": "Admin"
        }
    ]
}
POST
/v1/Grafana/keys

Create Key

Success

Code

Reason

200 - OK

Request was successful.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

Name

In

Type

Description

name

body

string

Name of the API key.

Curl Example

curl -X POST 'https://api-enterprise-dashboard.otc-service.com/v1/grafana/auth/keys' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Basic {base64(username:password)}' \
  --data-raw '{"name": "myApiKey"}'

Response Parameters

N/A

Reponse Example

    "id": 1234,
    "name": "myApiKey",
    "key": "eyJrIgetc2lpMjh6NEVXVkZsTmp6MFZyZ1FzOENxOG5GbVZnMUkiLCJuIjoidG9rZW5uYW1lMjEyMjIzIiwiaWQiOjF9"
}
DELETE
/v1/Grafana/keys

Delete Key

Success

Code

Reason

204 - No Content

Request fulfilled but service does not return anything.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

N/A

Curl Example

curl -X DELETE 'https://api-enterprise-dashboard.otc-service.com/v1/Grafana/auth/keys/{Key_Id}' \
    -H 'Authorization: Basic {base64(username:password)}' 

Response Parameters

N/A

Reponse Example

N/A

Organizations

Warning

Attention API endpoint v1/grafana/user/orgs is deprecated and will be taken offline on 31.07.2023.

Use the API provided by Grafana.

Documentation: https://grafana.com/docs/grafana/latest/developers/http_api/user/#get-organizations-for-user

This API allows you to manage Grafana Organization:

  • Get organizations for user

  • Get current organization

  • Switch user context to the given organization

Please use your username and password as basic authentificaton for Grafana API endpoints. These credentials are also used to log into the UI.

GET
/v1/grafana/user/orgs

Get Organization for user

Success

Code

Reason

200 - OK

Request was successful.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

N/A

Curl Example

curl -X GET 'https://api-enterprise-dashboard.otc-service.com/v1/grafana/user/orgs' \
    -H 'Authorization: Basic {base64(username:password)}'

Response Parameters

Response Example

{
    "list": [
        {
            "orgId": 1,
            "name": "Main Org.",
            "role": "Admin"
        }
    ]
}
GET
/v1/grafana/user/orgs/current

Get Current organization

Success

Code

Reason

200 - OK

Request was successful.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

N/A

Curl Example

curl -X GET 'https://api-enterprise-dashboard.otc-service.com/v1/grafana/user/orgs/current' \
	-H 'Authorization: Basic {base64(username:password)}'

Response Parameters

Response Example

{
    "id": 1,
    "name": "Main Org.",
    "address": {
        "address1": "",
        "address2": "",
        "city": "",
        "zipCode": "",
        "state": "",
        "country": ""
    }
}
GET
/v1/grafana/user/using/1

Switch user context to the given organization

Success

Code

Reason

200 - OK

Request was successful.

Error

Code

Reason

400 - Bad Request

Some content in the request was invalid.

Request

N/A

Curl Example

curl -X GET 'https://api-enterprise-dashboard.otc-service.com/v1/grafana/user/using/1' \
    -H 'Authorization: Basic {base64(username:password)}'

Response Parameters

Response Example

{
    "message": "Active organization changed"
}