All Products
Search
Document Center

Managed Service for Prometheus:ListEnvironmentKubeResources

Last Updated:May 29, 2026

Queries the Kubernetes resources of an environment.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

arms:ListEnvironmentKubeResources

none

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

EnvironmentId

string

Yes

The environment ID.

env-xxx

RegionId

string

No

The region ID.

cn-hangzhou

Kind

string

Yes

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

Pod

Namespace

string

No

The namespace.

default

LabelSelectors

object

No

The tags.

string

No

The tags.

{"app":"mysql"}

Response elements

Element

Type

Description

Example

object

response

RequestId

string

The request ID.

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

Code

integer

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

200

Success

boolean

Indicates whether the request was successful. Valid values:

  • true

  • false

true

Message

string

The returned message.

message

Data

array<object>

The returned struct.

array<object>

The returned struct.

ApiVersion

string

The version number of the API.

v1

Kind

string

The resource type.

Pod

Metadata

object

The metadata.

Annotations

object

The annotations.

string

The annotations.

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

Labels

object

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" }

Name

string

The resource name.

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

Namespace

string

The namespace.

arms-prom

Spec

any

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 } }

Status

any

The status of the resource.

run

Examples

Success response

JSON format

{
  "RequestId": "C21AB7CF-B7AF-410F-BD61-82D1567F****",
  "Code": 200,
  "Success": true,
  "Message": "message",
  "Data": [
    {
      "ApiVersion": "v1",
      "Kind": "Pod",
      "Metadata": {
        "Annotations": {
          "key": " {\n          \"kubernetes.io/psp\": \"ack.privileged\",\n          \"k8s.aliyun.com/pod-ips\": \"172.16.0.188\"\n        }"
        },
        "Labels": {
          "key": "{\n          \"app\": \"arms-prometheus-ack-arms-prometheus\",\n          \"releaseRevision\": \"1\",\n          \"release\": \"arms-prometheus\",\n          \"pod-template-hash\": \"c577b6cc8\",\n          \"heritage\": \"Helm\",\n          \"chart\": \"ack-arms-prometheus-1.1.17\"\n        }"
        },
        "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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.