Query Plug-ins

Function

This API is used to list plug-in instances.

URI

GET /v2/{project_id}/pools/{pool_name}/plugins

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

pool_name

Yes

String

Resource pool name.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

apiVersion

String

API version. Options:

  • v2

kind

String

Resource type. Options:

  • NodePoolList: node list

items

Array of Plugin objects

Node pool list.

Table 3 Plugin

Parameter

Type

Description

apiVersion

String

API version. Options:

  • v2

kind

String

Type of the plug-in instance.

metadata

PluginMetadata object

Metadata of the plug-in instance.

spec

PluginSpec object

Plug-in instance details.

status

PluginStatus object

Plug-in instance status.

Table 4 PluginMetadata

Parameter

Type

Description

name

String

Name of the plug-in instance.

creationTimestamp

String

Creation time.

Table 5 PluginSpec

Parameter

Type

Description

template

Template object

Template information of the plug-in instances.

Table 6 Template

Parameter

Type

Description

name

String

Name of the plug-in template to be installed, for example, log-agent.

version

String

Version of the plug-in to be installed or upgraded.

inputs

Map<String,Object>

Plug-in template installation parameters (varying depending on the plug-in). During the plug-in upgrade, you need to specify all the installation parameters. If the parameters are not specified, the default values in the plug-in template are used. The current plug-in installation parameters can be obtained through the API for querying plug-in instances.

Table 7 PluginStatus

Parameter

Type

Description

phase

String

Plug-in instance status. Options:

  • Pending: The plug-in is being installed.

  • Running: All of the plug-in instances are running. This specifies that the plug-in runs properly.

  • Updating: The plug-in is being updated.

  • Abnormal: The plug-in instances are abnormal and the plug-in cannot be used. You can click the status to view the failure cause.

  • Deleting: The plug-in is being deleted.

version

String

Version of the plug-in instances.

reason

String

Details about the plug-in instance installation failure.

values

String

Installation parameters of the plug-in instances. The parameters vary depending on the plug-in.

resources

Array of PluginResources objects

Resources used by the plug-in instances.

Table 8 PluginResources

Parameter

Type

Description

involvedObject

ObjectReference object

Resource objects referenced by the plug-in.

replicas

Integer

Number of replicas of the resource object.

limits

Map<String,String>

Limit on requested resources.

requests

Map<String,String>

Requested resources.

Table 9 ObjectReference

Parameter

Type

Description

kind

String

API type of the resource object, for example, DaemonSet and Deployment.

apiVersion

String

API version of the resource object.

namespace

String

Namespace of the resource object.

name

String

Name of the resource object.

uid

String

Unique ID of the resource object.

resourceVersion

String

Current version of the resource object.

Example Requests

This API is used to list plug-in instances.

GET https://{endpoint}/v2/{project_id}/pools/{pool_name}/plugins

{
  "kind" : "PluginList",
  "apiVersion" : "v2",
  "items" : [ {
    "kind" : "Plugin",
    "apiVersion" : "v2",
    "metadata" : {
      "name" : "lite-cluster-ac7339d4-4858-11ec-9d-0200b0b-gpu-beta",
      "creationTimestamp" : "2025-01-22T03:01:53Z"
    },
    "spec" : {
      "template" : {
        "name" : "gpu-beta"
      }
    },
    "status" : {
      "phase" : "Running",
      "version" : "1.2.15",
      "reason" : "Upgrade complete"
    }
  }, {
    "kind" : "Plugin",
    "apiVersion" : "v2",
    "metadata" : {
      "name" : "lite-cluster-ac7339d4-4858-11ec-a79d-0255ac100b0b-os-node-agent",
      "creationTimestamp" : "2025-01-22T03:01:53Z"
    },
    "spec" : {
      "template" : {
        "name" : "os-node-agent",
        "version" : "6.8.0-20250219120620",
        "inputs" : {
          "configs" : {
            "metric_config" : {
              "backNodeUp" : true,
              "enable" : true,
              "exporter" : {
                "enable" : false,
                "port" : "10120"
              },
              "namespaces" : [ "monitoring" ],
              "prometheus" : {
                "accessCode" : "",
                "prometheusId" : ""
              },
              "uplink" : "both"
            }
          }
        }
      }
    },
    "status" : {
      "phase" : "Running",
      "version" : "6.8.0-20250219120620",
      "reason" : "Upgrade complete"
    }
  } ]
}

Example Responses

Status code: 200

Request succeeded.

{
  "kind" : "PluginList",
  "apiVersion" : "v2",
  "items" : [ {
    "kind" : "Plugin",
    "apiVersion" : "v2",
    "metadata" : {
      "name" : "lite-cluster-ac7339d4-4858-11ec-9d-0200b0b-gpu-beta",
      "creationTimestamp" : "2025-01-22T03:01:53Z"
    },
    "spec" : {
      "template" : {
        "name" : "gpu-beta"
      }
    },
    "status" : {
      "phase" : "Running",
      "version" : "1.2.15",
      "reason" : "Upgrade complete"
    }
  }, {
    "kind" : "Plugin",
    "apiVersion" : "v2",
    "metadata" : {
      "name" : "lite-cluster-ac7339d4-4858-11ec-a79d-0255ac100b0b-os-node-agent",
      "creationTimestamp" : "2025-01-22T03:01:53Z"
    },
    "spec" : {
      "template" : {
        "name" : "os-node-agent",
        "version" : "6.8.0-20250219120620",
        "inputs" : {
          "configs" : {
            "metric_config" : {
              "backNodeUp" : true,
              "enable" : true,
              "exporter" : {
                "enable" : false,
                "port" : "10120"
              },
              "namespaces" : [ "monitoring" ],
              "prometheus" : {
                "accessCode" : "",
                "prometheusId" : ""
              },
              "uplink" : "both"
            }
          }
        }
      }
    },
    "status" : {
      "phase" : "Running",
      "version" : "6.8.0-20250219120620",
      "reason" : "Upgrade complete"
    }
  } ]
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.