Help Center/ DataArts Studio/ API Reference/ DataArts DataService APIs/ Cluster Management/ Querying the List of Cluster Overview Information
Updated on 2024-11-06 GMT+08:00

Querying the List of Cluster Overview Information

Function

This API is used to query the cluster overview information list.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/service/instances/overview

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Project ID and Account ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Maximum number of records that can be queried.

offset

No

Integer

Start coordinate of the query.

name

No

String

Cluster name. This parameter supports fuzzy match.

create_user

No

String

Creator name.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. This parameter is mandatory when token authentication is used. You can obtain it from the value of X-Subject-Token in the response message header returned by the "Obtaining a User Token" API of the IAM service.

workspace

Yes

String

Workspace ID. For details about how to obtain the workspace ID, see Instance ID and Workspace ID.

Dlm-Type

No

String

Specifies the version type of the data service. The value can be SHARED or EXCLUSIVE.

Content-Type

No

String

Type (format) of the message body. This parameter is mandatory if the message body exists. If the message body does not exist, leave this parameter blank. If the request body contains Chinese characters, use charset=utf8 to specify the Chinese character set, for example, application/json;charset=utf8.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Integer

Number of clusters

scale_down

Boolean

Specifies whether scale-in is supported.

scale_out

Boolean

Specifies whether capacity expansion is supported.

instances

Array of InstanceOverviewDTO objects

Cluster overview information.

Table 5 InstanceOverviewDTO

Parameter

Type

Description

id

String

Cluster ID

name

String

Cluster name

description

String

Provides supplementary information about the cluster.

external_address

String

External IP address.

intranet_address

String

Internal IPv4 address.

intranet_address_ipv6

String

Internal IPv6 address.

public_zone_id

String

Public zone ID.

public_zone_name

String

Specifies the public zone name.

private_zone_id

String

Specifies the private zone ID.

private_zone_name

String

Specifies the private zone name.

enterprise_project_id

String

Enterprise project ID

create_time

Long

Time when the bandwidth was specified.

create_user

String

Creator.

current_namespace_publish_api_num

Integer

Number of APIs that have been published in the current workspace.

all_namespace_publish_api_num

Integer

Number of APIs that have been published in all workspaces.

api_publishable_num

Integer

Specifies the total API quota of a cluster.

deletable

Boolean

Specifies whether a cluster can be deleted.

charge_status

String

Charging status of a cluster. The options are as follows: NO_CHARGE: not charged; CHARGED: charged; GRACE: grace period; RETENTION: retention period.

order_id

String

Order ID

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Query the list of cluster overview information.

/v1/0833a5737480d53b2f250010d01a7b88/service/instances/overview

Example Responses

Status code: 200

The request is successful.

{
  "total" : 1,
  "scale_down" : false,
  "scale_out" : false,
  "instances" : [ {
    "id" : "c830776ec23fdffe237a44845f871180",
    "name" : "dlm_HCS_20240205",
    "description" : "",
    "external_address" : "100.85.122.140",
    "intranet_address" : "192.168.0.157",
    "intranet_address_ipv6" : "2407:c080:11f0:535:8b8f:1825:a0d8:669",
    "private_zone_id" : null,
    "private_zone_name" : null,
    "public_zone_id" : null,
    "public_zone_name" : null,
    "enterprise_project_id" : "0",
    "create_time" : 1708400912000,
    "create_user" : "user",
    "current_namespace_publish_api_num" : 1,
    "all_namespace_publish_api_num" : 1,
    "api_publishable_num" : 500,
    "deletable" : true,
    "charge_status" : "CHARGED",
    "order_id" : "c0c3fd9770a54baa8a430ef82218732f"
  } ]
}

SDK Sample Code

The SDK sample code is as follows.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.dataartsstudio.v1.region.DataArtsStudioRegion;
import com.huaweicloud.sdk.dataartsstudio.v1.*;
import com.huaweicloud.sdk.dataartsstudio.v1.model.*;


public class ListDataServiceInstancesOverviewSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        String projectId = "{project_id}";

        ICredential auth = new BasicCredentials()
                .withProjectId(projectId)
                .withAk(ak)
                .withSk(sk);

        DataArtsStudioClient client = DataArtsStudioClient.newBuilder()
                .withCredential(auth)
                .withRegion(DataArtsStudioRegion.valueOf("<YOUR REGION>"))
                .build();
        ListDataServiceInstancesOverviewRequest request = new ListDataServiceInstancesOverviewRequest();
        try {
            ListDataServiceInstancesOverviewResponse response = client.listDataServiceInstancesOverview(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkdataartsstudio.v1.region.dataartsstudio_region import DataArtsStudioRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkdataartsstudio.v1 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]
    projectId = "{project_id}"

    credentials = BasicCredentials(ak, sk, projectId)

    client = DataArtsStudioClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(DataArtsStudioRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ListDataServiceInstancesOverviewRequest()
        response = client.list_data_service_instances_overview(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    dataartsstudio "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    projectId := "{project_id}"

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        Build()

    client := dataartsstudio.NewDataArtsStudioClient(
        dataartsstudio.DataArtsStudioClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ListDataServiceInstancesOverviewRequest{}
	response, err := client.ListDataServiceInstancesOverview(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

The request is successful.

400

Bad request