El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Querying Redistribution Details

Function

This API is used to view monitoring information about the current cluster, such as the redistribution mode, redistribution progress, and redistribution details. Only GaussDB(DWS) 2.0, 8.1.1.200, and later versions support the function of viewing redistribution details. Only GaussDB(DWS) 2.0, 8.2.1, and later versions support the function of viewing redistribution progress details.

Call Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/clusters/{cluster_id}/redistribution
Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the ID, see Obtaining Project ID.

cluster_id

Yes

String

Cluster ID. For details about how to obtain the ID, see Obtaining the Cluster ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Size of each page to be queried

offset

No

Integer

Offset for the pagination query

db_name

No

String

Database name

table_name

No

String

Table name

type

No

String

Type.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameter

Parameter

Type

Description

redis_info

RdsRedisInfo object

Redistribution information

schedule_mode

Boolean

Scheduling mode

pause_enable

Boolean

Whether suspension is allowed

recover_enable

Boolean

Whether resuming is allowed

retry_enable

Boolean

Whether retry is allowed

update_enable

Boolean

Whether update is allowed

control_enable

Boolean

Whether control is allowed

Table 4 RdsRedisInfo

Parameter

Type

Description

id

String

ID.

cluster_id

String

Cluster ID.

start_time

String

Start time

end_time

String

End time

status

String

Running status

redis_conf

RedisConf object

Redistribution configuration

redis_progress

RedisProgress object

Redistribution progress

redis_table_detail

RedisTableDetail object

Redistribution table information

Table 5 RedisConf

Parameter

Type

Description

redis_mode

String

Redistribution mode

schedule_conf

ScheduleConf object

Scheduling configuration information

parallel_jobs

Integer

Number of parallel jobs

parallel_job

Integer

Number of parallel jobs

Table 6 ScheduleConf

Parameter

Type

Description

schedule_start

String

Scheduling start time

schedule_end

String

Scheduling end time

schedule_type

String

Scheduling type

schedule_date

Array of integers

Scheduling date

schedule_time

Array of strings

Scheduling time list

Table 7 RedisProgress

Parameter

Type

Description

bytes_done

Long

Number of completed bytes

byte_left

Long

Number of remaining bytes

tables_done

Integer

Completed tables

tables_left

Integer

Remaining tables

table_progress

Integer

Table redistribution progress

total_progress

Integer

Overall progress

redis_rate

String

Redistribution ratio

estimated_time

String

Estimated time

completed

Boolean

Completed or not

initialed

Boolean

Initialized or not

fail_count

Integer

Total number of failures

redistributing

Boolean

cm_ctl result

status

String

Running status

pause_by_user

Boolean

Whether it is suspended by the user

Table 8 RedisTableDetail

Parameter

Type

Description

data

Array of RedisTable objects

Detailed data

total

Integer

Total records

Table 9 RedisTable

Parameter

Type

Description

table_name

String

Table name

id

Integer

Unique ID of a table

schema_name

String

Schema name

logical_cluster_name

String

Logical cluster name

size

Long

Table size

status

String

Redistribution Status

  • i: Redistribution is in progress.
  • y: Redistribution is complete.
  • n: Redistribution is not started.

Example Request

GET https://{Endpoint}/v2/89cd04f168b84af6be287f71730fdb4b/clusters/e59d6b86-9072-46eb-a996-13f8b44994c1/redistribution

{
  "redis_mode" : "online",
  "parallel_jobs" : 3
}

Example Response

Status code: 200

The redistribution details are queried.

{
  "redis_info" : {
    "id" : "8e4cc873-577a-4ca0-8a8c-723ef84581a9",
    "cluster_id" : "f2175f2e-8379-4158-b521-6a961a952eb3",
    "start_time" : "2023-01-11 09:21",
    "end_time" : "2023-01-12 06:47",
    "status" : "SUCCESS",
    "redis_conf" : {
      "redis_mode" : "online",
      "schedule_conf" : {
        "schedule_start" : "2023/01/11 16:41:27",
        "schedule_end" : "2023/01/11 17:41:27",
        "schedule_type" : "timeRange",
        "schedule_date" : null,
        "schedule_time" : null
      },
      "parallel_jobs" : 4,
      "parallel_job" : 4
    },
    "redis_progress" : {
      "bytes_done" : 191746048,
      "byte_left" : 0,
      "tables_done" : 163,
      "tables_left" : 0,
      "table_progress" : 100,
      "total_progress" : 100,
      "redis_rate" : null,
      "estimated_time" : null,
      "completed" : true,
      "initialed" : true,
      "fail_count" : 0,
      "redistributing" : true,
      "status" : "SUCCESS",
      "pause_by_user" : false
    },
    "redis_table_detail" : null
  },
  "schedule_mode" : true,
  "pause_enable" : true,
  "recover_enable" : true,
  "retry_enable" : true,
  "update_enable" : true,
  "control_enable" : true
}

SDK Sample Code

The 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
48
49
50
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.dws.v2.region.DwsRegion;
import com.huaweicloud.sdk.dws.v2.*;
import com.huaweicloud.sdk.dws.v2.model.*;


public class ShowClusterRedistributionSolution {

    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");

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

        DwsClient client = DwsClient.newBuilder()
                .withCredential(auth)
                .withRegion(DwsRegion.valueOf("cn-north-4"))
                .build();
        ShowClusterRedistributionRequest request = new ShowClusterRedistributionRequest();
        request.withLimit(<limit>);
        request.withOffset(<offset>);
        request.withDbName("<db_name>");
        request.withTableName("<table_name>");
        request.withType("<type>");
        try {
            ShowClusterRedistributionResponse response = client.showClusterRedistribution(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
32
33
34
# coding: utf-8

from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkdws.v2.region.dws_region import DwsRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkdws.v2 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.getenv("CLOUD_SDK_AK")
    sk = os.getenv("CLOUD_SDK_SK")

    credentials = BasicCredentials(ak, sk) \

    client = DwsClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(DwsRegion.value_of("cn-north-4")) \
        .build()

    try:
        request = ShowClusterRedistributionRequest()
        request.limit = <limit>
        request.offset = <offset>
        request.db_name = "<db_name>"
        request.table_name = "<table_name>"
        request.type = "<type>"
        response = client.show_cluster_redistribution(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
38
39
40
41
42
43
44
45
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    dws "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dws/v2"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dws/v2/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dws/v2/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")

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

    client := dws.NewDwsClient(
        dws.DwsClientBuilder().
            WithRegion(region.ValueOf("cn-north-4")).
            WithCredential(auth).
            Build())

    request := &model.ShowClusterRedistributionRequest{}
	limitRequest:= int32(<limit>)
	request.Limit = &limitRequest
	offsetRequest:= int32(<offset>)
	request.Offset = &offsetRequest
	dbNameRequest:= "<db_name>"
	request.DbName = &dbNameRequest
	tableNameRequest:= "<table_name>"
	request.TableName = &tableNameRequest
	typeRequest:= "<type>"
	request.Type = &typeRequest
	response, err := client.ShowClusterRedistribution(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For more SDK sample codes of programming languages, visit API Explorer and click the Sample Code tab. Example codes can be automatically generated.

 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
48
49
50
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.dws.v2.region.DwsRegion;
import com.huaweicloud.sdk.dws.v2.*;
import com.huaweicloud.sdk.dws.v2.model.*;


public class ShowClusterRedistributionSolution {

    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");

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

        DwsClient client = DwsClient.newBuilder()
                .withCredential(auth)
                .withRegion(DwsRegion.valueOf("cn-north-4"))
                .build();
        ShowClusterRedistributionRequest request = new ShowClusterRedistributionRequest();
        request.withLimit(<limit>);
        request.withOffset(<offset>);
        request.withDbName("<db_name>");
        request.withTableName("<table_name>");
        request.withType("<type>");
        try {
            ShowClusterRedistributionResponse response = client.showClusterRedistribution(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
32
33
34
# coding: utf-8

from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkdws.v2.region.dws_region import DwsRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkdws.v2 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.getenv("CLOUD_SDK_AK")
    sk = os.getenv("CLOUD_SDK_SK")

    credentials = BasicCredentials(ak, sk) \

    client = DwsClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(DwsRegion.value_of("cn-north-4")) \
        .build()

    try:
        request = ShowClusterRedistributionRequest()
        request.limit = <limit>
        request.offset = <offset>
        request.db_name = "<db_name>"
        request.table_name = "<table_name>"
        request.type = "<type>"
        response = client.show_cluster_redistribution(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
38
39
40
41
42
43
44
45
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    dws "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dws/v2"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dws/v2/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dws/v2/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")

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

    client := dws.NewDwsClient(
        dws.DwsClientBuilder().
            WithRegion(region.ValueOf("cn-north-4")).
            WithCredential(auth).
            Build())

    request := &model.ShowClusterRedistributionRequest{}
	limitRequest:= int32(<limit>)
	request.Limit = &limitRequest
	offsetRequest:= int32(<offset>)
	request.Offset = &offsetRequest
	dbNameRequest:= "<db_name>"
	request.DbName = &dbNameRequest
	tableNameRequest:= "<table_name>"
	request.TableName = &tableNameRequest
	typeRequest:= "<type>"
	request.Type = &typeRequest
	response, err := client.ShowClusterRedistribution(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For more SDK sample codes of programming languages, visit API Explorer and click the Sample Code tab. Example codes can be automatically generated.

Status Code

Status Code

Description

200

The redistribution details are queried.

400

Request error.

401

Authentication failed.

403

You do not have required permissions.

404

No resources found.

500

Internal server error.

503

The service was unavailable.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback