更改表详情 - UpdateTable
功能介绍
更改表详情
调用方法
请参见如何调用API。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限,具体权限要求请参见权限和授权项。
URI
PUT /v2/{project_id}/workspaces/{workspace_id}/siem/tables/{table_id}
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
参数解释: 项目ID,用于明确项目归属,配置后可通过该ID查询项目下资产,可以通过调用API获取,也可以从控制台获取。获取项目ID 约束限制: 不涉及 取值范围: 不涉及 默认取值: 不涉及 |
|
workspace_id |
是 |
String |
工作空间ID |
|
table_id |
是 |
String |
表ID |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
是 |
String |
参数解释: 用户Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。获取用户Token 约束限制: 不涉及 取值范围: 不涉及 默认取值: 不涉及 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
table_alias |
否 |
String |
表别名 |
|
table_alias_en |
否 |
String |
表别名 |
|
table_alias_fr |
否 |
String |
表别名 |
|
description |
否 |
String |
表相关描述 |
|
description_en |
否 |
String |
表相关描述 |
|
description_fr |
否 |
String |
表相关描述 |
|
directory |
否 |
String |
目录分组 |
|
directory_en |
否 |
String |
目录分组 |
|
directory_fr |
否 |
String |
目录分组 |
|
storage_setting |
否 |
IsapTableStorageSettingDto object |
表存储设置数据传输对象 |
|
display_setting |
否 |
IsapTableDisplaySettingDto object |
表展示设置数据传输对象 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
application_index |
否 |
String |
应用索引 |
|
application_topic |
否 |
String |
应用主题 |
|
application_data_class_id |
否 |
String |
应用数据类ID |
|
streaming_bandwidth |
否 |
Number |
流式带宽 MB/s |
|
streaming_partition |
否 |
Integer |
流式分区 |
|
streaming_dataspace_id |
否 |
String |
流式数据空间ID |
|
index_storage_period |
否 |
Integer |
索引存储周期 |
|
index_storage_size |
否 |
Integer |
索引存储大小 |
|
index_shards |
否 |
Integer |
索引分片数 |
|
lake_storage_period |
否 |
Long |
数据湖存储周期 |
|
lake_partition_setting |
否 |
String |
参数解释: 数据湖定时分区设置 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
columns |
否 |
Array of IsapTableColumnDisplaySettingDto objects |
表格列展示列表 |
|
format |
否 |
String |
参数解释: 表展示设置 约束限制 不涉及 取值范围: 默认值 不涉及 |
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
project_id |
String |
项目ID |
|
workspace_id |
String |
工作空间ID |
|
table_id |
String |
UUID |
|
pipe_id |
String |
UUID |
|
table_name |
String |
表名称 |
|
table_alias |
String |
表别名 |
|
description |
String |
相关描述 |
|
directory |
String |
directory 目录分组 |
|
category |
String |
参数解释: 目录类型 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
lock_status |
String |
参数解释: 表锁状态 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
process_status |
String |
参数解释: 处理状态 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
process_error |
String |
参数解释: 表处理错误 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
format |
String |
参数解释: 表格式 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
rw_type |
String |
参数解释: 表读写类型 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
owner_type |
String |
参数解释: 拥有者类型 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
data_layering |
String |
参数解释: 数据分层 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
data_classification |
String |
参数解释: 数据分类 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
schema |
IsapTableSchema object |
表架构 |
|
storage_setting |
TableStorageSetting object |
表存储设置 |
|
display_setting |
TableDisplaySetting object |
表展示设置 |
|
create_time |
Integer |
毫秒时间戳 |
|
update_time |
Integer |
毫秒时间戳 |
|
delete_time |
Integer |
毫秒时间戳 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
columns |
Array of IsapTableColumn objects |
表格列列表 |
|
primary_key |
Array of strings |
表主键列表 |
|
partition |
Array of strings |
表分区列表 |
|
watermark_column |
String |
表水位列元素 |
|
watermark_interval |
Float |
表水位延迟间隔 |
|
time_filter |
String |
表时间过滤列 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
column_name |
String |
表格列名称 |
|
column_type |
String |
参数解释: 列字段类型 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
column_type_setting |
String |
表格列类型设置 |
|
column_data_type |
String |
参数解释: 列字段数据类型 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
column_data_type_setting |
String |
表格列数据类型设置 |
|
nullable |
Boolean |
是否为空 |
|
array |
Boolean |
是否为数组 |
|
depth |
Integer |
深度 |
|
parent_name |
String |
父级名称 |
|
own_name |
String |
所属名称 |
|
column_display_setting |
ColumnDisplaySetting object |
表格列展示设置 |
|
column_sequence_number |
Integer |
列序号 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
mapping_required |
Boolean |
映射是否必填 |
|
group_sequence_number |
Integer |
组顺序编号 |
|
intra_group_sequence_number |
Integer |
组内顺序编号 |
|
value_type |
String |
值类型 |
|
value_qualified |
String |
合法值 |
|
display_name |
String |
显示名称 |
|
display_description |
String |
显示描述 |
|
group_name |
String |
组名 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
application_index |
String |
应用索引 |
|
application_topic |
String |
应用主题 |
|
application_data_class_id |
String |
应用数据类ID |
|
streaming_bandwidth |
Number |
流式带宽 MB/s |
|
streaming_partition |
Integer |
流式分区 |
|
streaming_retention_size |
Integer |
流式容量大小 |
|
streaming_dataspace_id |
String |
流式数据空间ID |
|
index_storage_period |
Integer |
索引存储周期 |
|
index_storage_size |
Integer |
索引存储大小 |
|
index_shards |
Integer |
索引分片数 |
|
index_replicas |
Integer |
索引副本数 |
|
lake_storage_period |
Long |
数据湖存储周期 |
|
lake_partition_setting |
String |
参数解释: 时间单位 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
lake_expiration_status |
String |
参数解释: 数据湖过期状态 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
columns |
Array of TableColumnDisplaySetting objects |
表格列展示列表 |
|
format |
String |
参数解释: 表展示设置 约束限制 不涉及 取值范围: 默认值 不涉及 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
column_name |
String |
表格列名称 |
|
column_alias |
String |
表格列别名 |
|
display_by_default |
Boolean |
是否默认展示 |
状态码:400
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码 |
|
error_msg |
String |
错误描述 |
请求示例
表详情新增描述"add_description"
https://{endpoint}/v2/{project_id}/workspaces/{workspace_id}/siem/tables/{table_id}
{
"description" : "add_description"
}
响应示例
状态码:200
成功
{
"category" : "STREAMING",
"create_time" : 1767941191174,
"data_classification" : "FACTUAL_DATA",
"data_layering" : "ODS",
"delete_time" : 0,
"description" : "add_description",
"directory" : "",
"display_setting" : {
"columns" : [ {
"column_alias" : "",
"column_name" : "test_update",
"display_by_default" : true
}, {
"column_alias" : "",
"column_name" : "test_timestamp",
"display_by_default" : true
}, {
"column_alias" : "",
"column_name" : "test_add_column",
"display_by_default" : true
} ],
"format" : "TABLE"
},
"format" : "JSON",
"lock_status" : "UNLOCKED",
"owner_type" : "USER",
"process_error" : "NONE",
"process_status" : "COMPLETED",
"project_id" : "f69081793d9e4ea8a2f479dcef961989",
"rw_type" : "READ_WRITE",
"schema" : {
"columns" : [ {
"array" : false,
"column_data_type" : "INT",
"column_data_type_setting" : "",
"column_name" : "test_update",
"column_sequence_number" : 0,
"column_type" : "PHYSICAL",
"column_type_setting" : "",
"depth" : 0,
"nullable" : true,
"own_name" : "test_update",
"parent_name" : ""
}, {
"array" : false,
"column_data_type" : "TIMESTAMP",
"column_data_type_setting" : "3",
"column_name" : "test_timestamp",
"column_sequence_number" : 0,
"column_type" : "PHYSICAL",
"column_type_setting" : "",
"depth" : 0,
"nullable" : false,
"own_name" : "test_timestamp",
"parent_name" : ""
}, {
"array" : false,
"column_data_type" : "STRING",
"column_data_type_setting" : "",
"column_name" : "test_add_column",
"column_sequence_number" : 0,
"column_type" : "PHYSICAL",
"column_type_setting" : "",
"depth" : 0,
"nullable" : false,
"own_name" : "test_add_column",
"parent_name" : ""
} ],
"partition" : [ ],
"primary_key" : [ ],
"time_filter" : "test_timestamp",
"watermark_column" : "test_timestamp",
"watermark_interval" : 6.0
},
"storage_setting" : {
"streaming_bandwidth" : 5.0,
"streaming_dataspace_id" : "153e3cb7-b8eb-40bc-a21a-11a8fe86afd7",
"streaming_partition" : 1,
"streaming_retention_size" : 1024
},
"table_alias" : "123",
"table_id" : "5fd42918-2ff1-4b2b-be2a-4eb3077230e0",
"table_name" : "s_test_update",
"update_time" : 1767943009375,
"workspace_id" : "885f11d0-256b-4f62-b494-1c1f8822a705"
}
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.secmaster.v2.region.SecMasterRegion; import com.huaweicloud.sdk.secmaster.v2.*; import com.huaweicloud.sdk.secmaster.v2.model.*; public class UpdateTableSolution { 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); SecMasterClient client = SecMasterClient.newBuilder() .withCredential(auth) .withRegion(SecMasterRegion.valueOf("<YOUR REGION>")) .build(); UpdateTableRequest request = new UpdateTableRequest(); request.withWorkspaceId("{workspace_id}"); request.withTableId("{table_id}"); try { UpdateTableResponse response = client.updateTable(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 huaweicloudsdksecmaster.v2.region.secmaster_region import SecMasterRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdksecmaster.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.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = SecMasterClient.new_builder() \ .with_credentials(credentials) \ .with_region(SecMasterRegion.value_of("<YOUR REGION>")) \ .build() try: request = UpdateTableRequest() request.workspace_id = "{workspace_id}" request.table_id = "{table_id}" response = client.update_table(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" secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/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") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := secmaster.NewSecMasterClient( secmaster.SecMasterClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.UpdateTableRequest{} request.WorkspaceId = "{workspace_id}" request.TableId = "{table_id}" response, err := client.UpdateTable(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
成功 |
|
400 |
错误响应 |
错误码
请参见错误码。