ListK8sResource

更新时间:
复制 MD 格式

Lists k8s resources.

Operation description

Add the enhancement plugin

Add the enhancement plugin to your pom.xml file to extend the Executor's capabilities.

Note: Place this plugin above the xxl-job-core dependency in your pom.xml file.

For more information: Plugin version release notes

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

GET  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

The Cluster ID.

xxljob-b6ec1xxxx

K8sClusterId

string

No

The ID of the Kubernetes cluster used for synchronizing namespaces. The cluster is added to the service mesh specified by ServiceMeshId. This parameter is required when you query a k8s namespace or a k8s service.

cadb451ed7af04b0297f4be396a2196fc

K8sNamespace

string

No

The name of the namespace in the k8s cluster. This parameter is required when you query a k8s service.

default

ResourceType

string

Yes

The resource type.

cluster

VpcId

string

No

The VPC ID. This parameter is required if ResourceType is set to 'cluster'.

vpc-aa1a18236n90rqhuhhnhh

Response elements

Element

Type

Description

Example

object

The response object.

RequestId

string

The Request ID.

2ECA6FC9-7557-5576-AF5F-FC3E7BCC9C21

Code

integer

The response code.

200

Message

string

The error message.

Parameter error: content is null.

Success

boolean

Indicates whether the request was successful.

  • true: The request was successful.

  • false: The request failed.

true

Data

array<object>

  • An array of k8s resources.

object

ResourceName

string

The name of the k8s resource.

q_ecs_enterprise_spot_c

ResourceId

string

The ID of the k8s resource.

xxljob-01632622cda2f

Examples

Success response

JSON format

{
  "RequestId": "2ECA6FC9-7557-5576-AF5F-FC3E7BCC9C21",
  "Code": 200,
  "Message": "Parameter error: content is null.",
  "Success": true,
  "Data": [
    {
      "ResourceName": "q_ecs_enterprise_spot_c",
      "ResourceId": "xxljob-01632622cda2f"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter Parameter error: %s. Parameter error: %s
401 IllegalRequest IllegalRequest: %s. Illegal request:%s
500 InternalError InternalError: %s. System Internal Error: %s
403 NoPermission No permission to perform this operation: %s. No permission to perform this operation: %s
404 NotFound Not found: %s. The resource does not exist: %s

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.