All Products
Search
Document Center

Managed Service for Prometheus:ListEnvironmentKubeResources

Last Updated:Jul 16, 2025

Queries the Kubernetes resources of an environment.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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:ListEnvironmentKubeResourcesnone
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
EnvironmentIdstringYes

The environment ID.

env-xxx
RegionIdstringNo

The region ID.

cn-hangzhou
KindstringYes

The resource type. Valid values: Pod, Deployment, and Service.

Pod
NamespacestringNo

The namespace.

default
LabelSelectorsobjectNo

The tags.

stringNo

The tags.

{"app":"mysql"}

Response parameters

ParameterTypeDescriptionExample
object

response

RequestIdstring

The request ID.

C21AB7CF-B7AF-410F-BD61-82D1567F****
Codeinteger

The status code. The status code 200 indicates that the request was successful. Other status codes indicate that the request failed.

200
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
Messagestring

The returned message.

message
Dataarray<object>

The returned struct.

dataobject

The returned struct.

ApiVersionstring

The version number of the API.

v1
Kindstring

The resource type.

Pod
Metadataobject

The metadata.

Annotationsobject

The annotations.

string

The annotations.

{ "kubernetes.io/psp": "ack.privileged", "k8s.aliyun.com/pod-ips": "172.16.0.188" }
Labelsobject

The tags.

string

The tags.

{ "app": "arms-prometheus-ack-arms-prometheus", "releaseRevision": "1", "release": "arms-prometheus", "pod-template-hash": "c577b6cc8", "heritage": "Helm", "chart": "ack-arms-prometheus-1.1.17" }
Namestring

The resource name.

arms-prometheus-ack-arms-prometheus-c577b6cc8-mvdwd
Namespacestring

The namespace.

arms-prom
Specany

The resource specifications.

{ "dnsPolicy": "ClusterFirst", "nodeName": "cn-hangzhou.172.16.0.60", "terminationGracePeriodSeconds": 30, "enableServiceLinks": true, "serviceAccountName": "arms-prom-operator", "volumes": [ { "name": "certs", "secret": { "secretName": "arms-prometheus-ack-arms-prometheus-cert", "defaultMode": 420 } }
Statusany

The status of the resource.

run

Examples

Sample success responses

JSONformat

{
  "RequestId": "C21AB7CF-B7AF-410F-BD61-82D1567F****",
  "Code": 200,
  "Success": true,
  "Message": "message",
  "Data": [
    {
      "ApiVersion": "v1",
      "Kind": "Pod",
      "Metadata": {
        "Annotations": {
          "key": {
            "kubernetes.io/psp": "ack.privileged",
            "k8s.aliyun.com/pod-ips": "172.16.0.188"
          }
        },
        "Labels": {
          "key": {
            "app": "arms-prometheus-ack-arms-prometheus",
            "releaseRevision": 1,
            "release": "arms-prometheus",
            "pod-template-hash": "c577b6cc8",
            "heritage": "Helm",
            "chart": "ack-arms-prometheus-1.1.17"
          }
        },
        "Name": "arms-prometheus-ack-arms-prometheus-c577b6cc8-mvdwd",
        "Namespace": "arms-prom"
      },
      "Spec": "{\n        \"dnsPolicy\": \"ClusterFirst\",\n        \"nodeName\": \"cn-hangzhou.172.16.0.60\",\n        \"terminationGracePeriodSeconds\": 30,\n        \"enableServiceLinks\": true,\n        \"serviceAccountName\": \"arms-prom-operator\",\n        \"volumes\": [\n          {\n            \"name\": \"certs\",\n            \"secret\": {\n              \"secretName\": \"arms-prometheus-ack-arms-prometheus-cert\",\n              \"defaultMode\": 420\n            }\n          }\n",
      "Status": "run"
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history