All Products
Search
Document Center

Managed Service for Prometheus:ListEnvCustomJobs

Last Updated:May 09, 2024

Queries the custom jobs of an environment.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
arms:ListEnvCustomJobsList
  • Environment
    acs:arms:{#regionId}:{#accountId}:environment/{#environmentId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID.

cn-hangzhou
EnvironmentIdstringYes

The ID of the environment instance.

env-xxxxx
EncryptYamlbooleanNo

Specifies whether to return the encrypted YAML string.

true

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

2A0CEDF1-06FE-44AC-8E21-21A5BE65****
Codeinteger

The HTTP status code. The status code 200 indicates that the request was successful.

200
Dataobject []

The returned struct.

EnvironmentIdstring

The ID of the environment instance.

env-xxxx
RegionIdstring

The region ID.

cn-hangzhou
CustomJobNamestring

The name of the custom job.

job1
ConfigYamlstring

If the request parameter EncryptYaml is set to true, a Base64-encoded YAML string is returned. Otherwise, a plaintext YAML string is returned.

Refer to supplementary instructions.
Statusstring

The status of the custom job.

run
CreationTimestampstring

The time when the custom job was created. The value of this parameter is a timestamp.

2022-01-01T10:11:34Z
AddonNamestring

The name of the component to which the custom job belongs.

mysql
AddonReleaseNamestring

The instance name of the component.

mysql1
AddonVersionstring

The version of the component.

1.1.0
ScrapeConfigsobject []

The capture configurations.

JobNamestring

The name of the job.

custom-sd-demo
ScrapeIntervalstring

The capture interval.

30s
MetricsPathstring

The path of the metric.

/metrics
ScrapeDiscoverysarray

The service discovery methods.

string

The service discovery method.

static_configs
Messagestring

The returned message.

success

Examples

Sample success responses

JSONformat

{
  "RequestId": "2A0CEDF1-06FE-44AC-8E21-21A5BE65****",
  "Code": 200,
  "Data": [
    {
      "EnvironmentId": "env-xxxx",
      "RegionId": "cn-hangzhou",
      "CustomJobName": "job1",
      "ConfigYaml": "Refer to supplementary instructions.",
      "Status": "run",
      "CreationTimestamp": "2022-01-01T10:11:34Z",
      "AddonName": "mysql",
      "AddonReleaseName": "mysql1",
      "AddonVersion": "1.1.0",
      "ScrapeConfigs": [
        {
          "JobName": "custom-sd-demo",
          "ScrapeInterval": "30s",
          "MetricsPath": "/metrics",
          "ScrapeDiscoverys": [
            "static_configs"
          ]
        }
      ]
    }
  ],
  "Message": "success"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history