查询StarRocks实例
功能介绍
查询StarRocks实例。
调用方法
请参见如何调用API。
URI
GET /v3/{project_id}/instances/{instance_id}/starrocks/{starrocks_instance_id}
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
参数解释: 租户在某一Region下的project ID。 获取方法请参见获取项目ID。 约束限制: 不涉及。 取值范围: 只能由英文字母、数字组成,且长度为32个字符。 默认取值: 不涉及。 |
instance_id |
是 |
String |
参数解释: 实例ID,此参数是实例的唯一标识。 约束限制: 不涉及。 取值范围: 只能由英文字母、数字组成,后缀为in07,长度为36个字符。 默认取值: 不涉及。 |
starrocks_instance_id |
是 |
String |
参数解释: StarRocks实例ID,严格匹配UUID规则。 约束限制: 不涉及。 取值范围: 只能由英文字母、数字组成,后缀为in17,且长度为36个字符。 默认取值: 不涉及。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
参数解释: 用户Token。 通过调用IAM服务获取用户Token接口获取。 请求响应成功后在响应消息头中包含的“X-Subject-Token”的值即为Token值。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
Content-Type |
是 |
String |
参数解释: 内容类型。 约束限制: 不涉及。 取值范围: application/json。 默认取值: application/json。 |
X-Language |
否 |
String |
参数解释: 请求语言类型。 约束限制: 不涉及。 取值范围:
默认取值: en-us。 |
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
instances |
Array of instances objects |
参数解释: StarRocks实例信息。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
参数解释: StarRocks实例ID,严格匹配UUID规则。 取值范围: 只能由英文字母、数字组成,后缀为in17,且长度为36个字符。 |
name |
String |
参数解释: StarRocks实例名称。 取值范围: 不涉及。 |
project_id |
String |
参数解释: 租户在某一Region下的project ID。 取值范围: 不涉及。 |
public_ip |
String |
参数解释: 公网访问IP。 取值范围: 不涉及。 |
data_vip |
String |
参数解释: StarRocks FE节点类型数据IP(多个IP使用逗号分隔)。 取值范围: 不涉及。 |
can_enable_public_access |
Boolean |
参数解释: 是否可公网访问。 取值范围:
|
current_backup_node_id |
String |
参数解释: 备份节点ID。 取值范围: 不涉及。 |
cluster_mode |
String |
参数解释: 部署模式。 取值范围: 不涉及。 |
status |
String |
参数解释: 实例状态。 取值范围: 不涉及。 |
is_frozen |
Integer |
参数解释: 是否冻结。 取值范围: 不涉及。 |
frozen_time |
Long |
参数解释: 冻结时间。 取值范围: 不涉及。 |
db_user |
String |
参数解释: 默认用户名。 取值范围: 不涉及。 |
bak_period |
String |
参数解释: 备份周期。 取值范围: 不涉及。 |
bak_keep_day |
Integer |
参数解释: 备份保存天数。 取值范围: 不涉及。 |
bak_expected_start_time |
Long |
参数解释: 备份预计开始时间。 取值范围: 不涉及。 |
data_store_version_id |
String |
参数解释: 数据库版本ID。 取值范围: 不涉及。 |
data_store_version |
String |
参数解释: 数据库版本。 取值范围: 不涉及。 |
data_store_type |
String |
参数解释: 数据库引擎。 取值范围: 不涉及。 |
create_at |
Long |
参数解释: 实例创建时间。 取值范围: 不涉及。 |
update_at |
Long |
参数解释: 实例更新时间。 取值范围: 不涉及。 |
delete_at |
Long |
参数解释: 实例删除时间。 取值范围: 不涉及。 |
db_port |
String |
参数解释: 数据库端口号。 取值范围: 不涉及。 |
param_group |
String |
参数解释: 参数组。 取值范围: 不涉及。 |
actions |
Array of QueryAction objects |
参数解释: 实例动作。 |
create_fail_error_code |
String |
参数解释: 实例创建失败错误码。 取值范围: 不涉及。 |
groups |
Array of groups objects |
参数解释: 实例分组。 |
ops_window |
ops_window object |
参数解释: 实例操作时间窗。 取值范围: 不涉及。 |
tags_info |
tags_info object |
参数解释: 实例标签。 |
time_zone |
String |
参数解释: 时区。 取值范围: 不涉及。 |
backup_used_space |
String |
参数解释: 备份使用空间。 取值范围: 不涉及。 |
az_mode |
String |
参数解释: 可用区模式。 取值范围:
|
enterprise_project_id |
String |
参数解释: 企业项目ID。 取值范围: 不涉及。 |
port_info |
port_info object |
参数解释: 端口信息。 |
fe_node_volume_code |
String |
参数解释: FE节点磁盘类型。 取值范围: 不涉及。 |
be_node_volume_code |
String |
参数解释: BE节点磁盘类型。 取值范围: 不涉及。 |
fe_node_volume_size |
String |
参数解释: FE节点磁盘大小。 取值范围: 不涉及。 |
be_node_volume_size |
String |
参数解释: BE节点磁盘大小。 取值范围: 不涉及。 |
support_data_replication |
Boolean |
参数解释: 是否支持数据同步。 取值范围:
|
new_version_available |
Boolean |
参数解释: 是否有数据库新版本。 取值范围: 不涉及。 |
ssl_option |
Boolean |
参数解释: SSL开关。 取值范围: 不涉及。 |
dedicated_resource_id |
String |
参数解释: 专属资源池ID,只有数据库实例属于专属资源池才会返回该参数。 取值范围: 不涉及。 |
pay_model |
String |
参数解释: 支付模式。 取值范围: 不涉及。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
参数解释: 分组ID。 取值范围: 不涉及。 |
name |
String |
参数解释: 分组名。 取值范围: 不涉及。 |
nodes |
Array of nodes objects |
参数解释: 实例节点。 取值范围: 不涉及。 |
group_type_name |
String |
参数解释: 实例分组类型名。 取值范围: 不涉及。 |
group_node_type |
String |
参数解释: 实例分组节点类型。 取值范围: 不涉及。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
参数解释: 实例节点ID。 取值范围: 不涉及。 |
name |
String |
参数解释: 实例节点名。 取值范围: 不涉及。 |
type |
String |
参数解释: 实例节点类型。 取值范围: 不涉及。 |
status |
String |
参数解释: 节点状态。 取值范围:
|
period |
String |
参数解释: 实例节点包周期。1代表包周期。 取值范围: 不涉及。 |
volume |
volume object |
参数解释: 实例节点存储信息。 取值范围: 不涉及。 |
cpu |
String |
参数解释: 实例节点CPU数量。 取值范围: 不涉及。 |
mem |
String |
参数解释: 实例节点内存大小(GB)。 取值范围: 不涉及。 |
datastore |
datastore object |
参数解释: 数据库信息。 取值范围: 不涉及。 |
actions |
Array of QueryAction objects |
参数解释: 节点动作。 取值范围: 不涉及。 |
priority |
Integer |
参数解释: 节点优先级。 取值范围: 不涉及。 |
frozen_flag |
Integer |
参数解释: 冻结标志。 取值范围: 不涉及。 |
db_port |
Integer |
参数解释: 数据库端口号。默认3306。 取值范围: 不涉及。 |
pay_model |
String |
参数解释: 支付模式。 取值范围: 不涉及。 |
order_id |
String |
参数解释: 订单号。 取值范围: 不涉及。 |
traffic_ip |
String |
参数解释: 数据IP。 取值范围: 不涉及。 |
traffic_ipv6 |
String |
参数解释: 数据IPV6。 取值范围: 不涉及。 |
az_code |
String |
参数解释: 可用区代码。 取值范围: 不涉及。 |
az_description |
String |
参数解释: 可用区描述。 取值范围: 不涉及。 |
az_type |
String |
参数解释: 可用区类型。 取值范围: 不涉及。 |
region_code |
String |
参数解释: 实例所在区域。 取值范围: 不涉及。 |
create_at |
Long |
参数解释: 节点创建时间。 取值范围: 不涉及。 |
update_at |
Long |
参数解释: 节点更新时间。 取值范围: 不涉及。 |
flavor_id |
String |
参数解释: 节点规格ID。 取值范围: 不涉及。 |
flavor_ref |
String |
参数解释: 节点规格码。 取值范围: 不涉及。 |
iass_flavor_ref |
String |
参数解释: IAAS规格码。 取值范围: 不涉及。 |
max_connections |
String |
参数解释: 公网最大连接数。 取值范围: 不涉及。 |
vpc_id |
String |
参数解释: 虚拟私有云ID。 取值范围: 不涉及。 |
subnet_id |
String |
参数解释: 子网ID。 取值范围: 不涉及。 |
need_restart |
Boolean |
参数解释: 参数更新是否需要重启。 取值范围:
|
sg_id |
String |
参数解释: 安全组。 取值范围: 不涉及。 |
param_group |
Map<String,ParamGroup> |
参数解释: 参数组信息。 取值范围: 不涉及。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
参数解释: 数据库ID。 取值范围: 不涉及。 |
type |
String |
参数解释: 数据库类型。 取值范围: 不涉及。 |
version |
String |
参数解释: 数据库版本。 取值范围: 不涉及。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
参数解释: 实例或节点动作ID。 取值范围: 不涉及。 |
action |
String |
参数解释: 实例或节点动作名称。 取值范围: 不涉及。 |
object_id |
String |
参数解释: 实例或节点动作对象ID。 取值范围: 不涉及。 |
type |
String |
参数解释: 实例或节点动作类型。 取值范围: 不涉及。 |
job_id |
String |
参数解释: 实例或节点动作任务ID。 取值范围: 不涉及。 |
status |
String |
参数解释: 实例或节点动作状态。 取值范围: 不涉及。 |
created_at |
Long |
参数解释: 实例或节点动作创建时间。 取值范围: 不涉及。 |
updated_at |
Long |
参数解释: 实例或节点动作更新时间。 取值范围: 不涉及。 |
参数 |
参数类型 |
描述 |
---|---|---|
period |
String |
参数解释: 时间窗周期。 取值范围: 不涉及。 |
start_time |
String |
参数解释: 时间窗开始时间。 取值范围: 不涉及。 |
end_time |
String |
参数解释: 时间窗结束时间。 取值范围: 不涉及。 |
参数 |
参数类型 |
描述 |
---|---|---|
tags |
Array of tags objects |
参数解释: 用户标签。 |
sys_tags |
Array of sys_tags objects |
参数解释: 系统标签。 |
参数 |
参数类型 |
描述 |
---|---|---|
key |
String |
参数解释: 标签键。 取值范围: 1-128个字符。key不能为空或者空字符串,不能为空格。 字符集:A-Z,a-z ,0-9,‘-’,‘_’,UNICODE字符(\u4E00-\u9FFF)。 |
value |
String |
参数解释: 标签值。 取值范围: 0-255个unicode字符。可以为空字符串。 字符集:A-Z,a-z ,0-9,‘.’,‘-’,‘_’,UNICODE字符(\u4E00-\u9FFF)。 |
参数 |
参数类型 |
描述 |
---|---|---|
key |
String |
参数解释: 标签键。 取值范围: 1-128个unicode字符。key不能为空或者空字符串,不能为空格。 字符集:A-Z,a-z ,0-9,‘-’,‘_’,UNICODE字符(\u4E00-\u9FFF)。 |
value |
String |
参数解释: 标签值。 取值范围: 0-255个unicode字符。可以为空字符串。 字符集:A-Z,a-z ,0-9,‘.’,‘-’,‘_’,UNICODE字符(\u4E00-\u9FFF)。 |
状态码:400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
参数解释: 错误码。 取值范围: 不涉及。 |
error_msg |
String |
参数解释: 错误消息。 取值范围: 不涉及。 |
状态码:500
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
参数解释: 错误码。 取值范围: 不涉及。 |
error_msg |
String |
参数解释: 错误消息。 取值范围: 不涉及。 |
请求示例
查询某个StarRocks实例。
GET https://{endpoint}/v3/23a50154cf494ec9ad6883979a12db0a/instances/fb632d1d531a4107804f0f082581810fin07/starrocks/b6280c323ce449f2ad02af74e21f3dc5in17
响应示例
状态码:200
Success.
{ "instances" : [ { "id" : "914481def3574d5189baee926a26512din17", "name" : "htap-5d98", "project_id" : "23a50154cf494ec9ad6883979a12db0a", "public_ip" : "", "data_vip" : "192.168.8.4", "can_enable_public_access" : false, "current_backup_node_id" : null, "cluster_mode" : "Single", "status" : "normal", "is_frozen" : 0, "frozen_time" : null, "db_user" : "root", "bak_period" : null, "bak_keep_day" : null, "bak_expected_start_time" : null, "data_store_version_id" : "717b683b-9d89-3e3b-9100-7893bee47d95", "data_store_version" : "3.1.11.0", "data_store_type" : "star-rocks", "create_at" : 1716344516418, "update_at" : 1716347522157, "delete_at" : null, "db_port" : "3306", "param_group" : null, "actions" : [ ], "create_fail_error_code" : "500000", "groups" : [ { "id" : "8d9d63263ece41619ba819f8d85c5cafgr17", "name" : "htap-5d98_fe_shard01", "nodes" : [ { "id" : "7739bfbc4e244a8bac0662d63683c808no17", "name" : "htap-5d98_fe_shard01_node01", "type" : "fe-leader", "status" : "normal", "period" : "null", "volume" : { "type" : "SSD", "size" : "50000000000" }, "cpu" : "4", "mem" : "16", "datastore" : { "id" : "717b683b-9d89-3e3b-9100-7893bee47d95", "type" : "star-rocks", "version" : "3.1.11.0" }, "actions" : [ ], "priority" : 1, "frozen_flag" : 0, "db_port" : 3306, "pay_model" : "0", "order_id" : null, "traffic_ip" : "192.168.8.4", "traffic_ipv6" : "", "az_code" : "cn-southwest-244d", "az_description" : "az4", "az_type" : "Center", "region_code" : "cn-southwest-244", "create_at" : 1716344516418, "update_at" : 1716361751849, "flavor_id" : "afef3bfd-ac7c-32e1-ba44-c388acbb196a", "flavor_ref" : "gaussdb.sr-fe.xlarge.x86.4", "iass_flavor_ref" : "c6.xlarge.4", "max_connections" : "0", "vpc_id" : "f7876b94-3696-419b-a609-161de4b42d59", "subnet_id" : "09249318-4a97-4e48-b314-ffaab86d4295", "need_restart" : false, "sg_id" : "", "param_group" : null } ], "group_type_name" : "starrocks", "group_node_type" : "fe" }, { "id" : "fc416acdc4c1439e85100e9a7c161932gr17", "name" : "htap-5d98_be_shard01", "nodes" : [ { "id" : "ccab0ba176e642c69d598f2f3c0f06efno17", "name" : "htap-5d98_be_shard01_node01", "type" : "be", "status" : "normal", "period" : "null", "volume" : { "type" : "SSD", "size" : "50000000000" }, "cpu" : "4", "mem" : "16", "datastore" : { "id" : "717b683b-9d89-3e3b-9100-7893bee47d95", "type" : "star-rocks", "version" : "3.1.11.0" }, "actions" : [ ], "priority" : 1, "frozen_flag" : 0, "db_port" : 3306, "pay_model" : "0", "order_id" : null, "traffic_ip" : "192.168.8.194", "traffic_ipv6" : "", "az_code" : "cn-southwest-244d", "az_description" : "az4", "az_type" : "Center", "region_code" : "cn-southwest-244", "create_at" : 1716344516418, "update_at" : 1716358866767, "flavor_id" : "de565db8-0a96-37ea-9388-61167624712c", "flavor_ref" : "gaussdb.sr-be.xlarge.x86.4", "iass_flavor_ref" : "c6.xlarge.4", "max_connections" : "0", "vpc_id" : "f7876b94-3696-419b-a609-161de4b42d59", "subnet_id" : "09249318-4a97-4e48-b314-ffaab86d4295", "need_restart" : false, "sg_id" : "", "param_group" : null } ], "group_type_name" : "starrocks", "group_node_type" : "be" } ], "ops_window" : { "period" : null, "start_time" : "18:00", "end_time" : "22:00" }, "tags_info" : { "tags" : [ ], "sys_tags" : [ { "key" : "_sys_enterprise_project_id", "value" : "0" } ] }, "time_zone" : "UTC+08:00", "backup_used_space" : null, "az_mode" : "single", "enterprise_project_id" : "0", "port_info" : { "mysql_port" : 3306 }, "fe_node_volume_code" : "gaussdb.sr.evs.ultrahighio", "be_node_volume_code" : "gaussdb.sr.evs.ultrahighio", "fe_node_volume_size" : "50000000000", "be_node_volume_size" : "50000000000", "support_data_replication" : true, "new_version_available" : false, "ssl_option" : false, "dedicated_resource_id" : null, "pay_model" : "0" } ] }
SDK代码示例
SDK代码示例如下。
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 |
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.gaussdb.v3.region.GaussDBRegion; import com.huaweicloud.sdk.gaussdb.v3.*; import com.huaweicloud.sdk.gaussdb.v3.model.*; public class ListStarrocksInstanceInfoSolution { 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); GaussDBClient client = GaussDBClient.newBuilder() .withCredential(auth) .withRegion(GaussDBRegion.valueOf("<YOUR REGION>")) .build(); ListStarrocksInstanceInfoRequest request = new ListStarrocksInstanceInfoRequest(); request.withInstanceId("{instance_id}"); request.withStarrocksInstanceId("{starrocks_instance_id}"); try { ListStarrocksInstanceInfoResponse response = client.listStarrocksInstanceInfo(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 |
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkgaussdb.v3.region.gaussdb_region import GaussDBRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkgaussdb.v3 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 = GaussDBClient.new_builder() \ .with_credentials(credentials) \ .with_region(GaussDBRegion.value_of("<YOUR REGION>")) \ .build() try: request = ListStarrocksInstanceInfoRequest() request.instance_id = "{instance_id}" request.starrocks_instance_id = "{starrocks_instance_id}" response = client.list_starrocks_instance_info(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 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" gaussdb "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/gaussdb/v3" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/gaussdb/v3/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/gaussdb/v3/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 := gaussdb.NewGaussDBClient( gaussdb.GaussDBClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ListStarrocksInstanceInfoRequest{} request.InstanceId = "{instance_id}" request.StarrocksInstanceId = "{starrocks_instance_id}" response, err := client.ListStarrocksInstanceInfo(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
Success. |
400 |
Client error. |
500 |
Server error. |
错误码
请参见错误码。