Help Center/ Application Operations Management/ API Reference/ APIs/ Prometheus Instance/ Obtaining the Credential for Calling a Prometheus Instance

Obtaining the Credential for Calling a Prometheus Instance

Updated on 2025-01-07 GMT+08:00

Function

This API is used to obtain the credential for calling a Prometheus instance.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/access-code

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID obtained from IAM. Generally, a project ID contains 32 characters.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM.

Content-Type

Yes

String

Content type, which is application/json.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

access_codes

Array of AccessCodeModel objects

Access codes.

Table 4 AccessCodeModel

Parameter

Type

Description

access_code

String

Access code.

access_code_id

String

Access code ID.

create_at

Long

Creation time.

status

String

Status.

Example Requests

Obtain the credential for calling a Prometheus instance.

https://{Endpoint}/v1/{project_id}/access-code

Example Responses

Status code: 200

OK: The request is successful.

{
  "access_codes" : [ {
    "access_code" : "b***OOJpV***B4ciU*******NfR2f9xZ******tgpba******yQS66Ih****a",
    "access_code_id" : "c6*04****ee6e******092*****45**3",
    "create_at" : 1700796457506243016,
    "status" : "enable"
  } ]
}

Status Codes

Status Code

Description

200

OK: The request is successful.

Error Codes

See Error Codes.

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback