Querying the Table List
Function
This API is used to query the table list.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/workspaces/{workspace_id}/siem/tables
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID, which is used to specify the project that a resource belongs to. You can query the resources of a project by project ID. You can obtain the project ID from the API or console. Obtaining the Project ID Constraints N/A Range N/A Default Value N/A |
|
workspace_id |
Yes |
String |
Workspace ID. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
category |
No |
String |
Definition Directory type. Constraints N/A Range Default Value N/A |
|
table_id |
No |
String |
Table ID. |
|
table_alias |
No |
String |
Table alias. |
|
table_name |
No |
String |
Table name. |
|
offset |
No |
Long |
Definition Offset. Range 0-1000000 Default Value 0 |
|
limit |
No |
Long |
Definition Data query limit. Range 0-1000 Default Value N/A |
|
sort_key |
No |
String |
Sorting by attribute. |
|
sort_dir |
No |
String |
Sorting order. The value can be ASC or DESC. |
|
exists |
No |
Boolean |
Exist or not. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. You can obtain it by calling the IAM API for obtaining a user token. The user token is the value of X-Subject-Token in the response header. Obtaining a User Token Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
count |
Long |
Tables. |
|
records |
Array of IsapTable objects |
Table details. |
|
Parameter |
Type |
Description |
|---|---|---|
|
project_id |
String |
Project ID. |
|
workspace_id |
String |
Workspace ID. |
|
table_id |
String |
UUID |
|
pipe_id |
String |
UUID |
|
table_name |
String |
Table name. |
|
table_alias |
String |
Table alias. |
|
description |
String |
Description. |
|
directory |
String |
Directory group. |
|
category |
String |
Definition Directory type. Constraints N/A Range Default Value N/A |
|
lock_status |
String |
Definition Table lock status. Constraints N/A Range Default Value N/A |
|
process_status |
String |
Definition Handling status. Constraints N/A Range Default Value N/A |
|
process_error |
String |
Definition Table processing error.
Constraints N/A Range Default Value N/A |
|
format |
String |
Definition Table format. -DEBEZIUM_JSON: Debezium JSON Constraints N/A Range Default Value N/A |
|
rw_type |
String |
Definition Table read/write type. Constraints N/A Range Default Value N/A |
|
owner_type |
String |
Definition Owner type. Constraints N/A Range Default Value N/A |
|
data_layering |
String |
Definition Data layers. Constraints N/A Range Default Value N/A |
|
data_classification |
String |
Definition Data classification. Constraints N/A Range Default Value N/A |
|
schema |
IsapTableSchema object |
Table structure. |
|
storage_setting |
TableStorageSetting object |
Table storage settings. |
|
display_setting |
TableDisplaySetting object |
Table display settings. |
|
create_time |
Integer |
Timestamp, in ms. |
|
update_time |
Integer |
Timestamp, in ms. |
|
delete_time |
Integer |
Timestamp, in ms. |
|
Parameter |
Type |
Description |
|---|---|---|
|
columns |
Array of IsapTableColumn objects |
Table column list. |
|
primary_key |
Array of strings |
Table primary key list. |
|
partition |
Array of strings |
Table partition list. |
|
watermark_column |
String |
Table watermark column element. |
|
watermark_interval |
Float |
Table watermark delay interval. |
|
time_filter |
String |
Table time filter column. |
|
Parameter |
Type |
Description |
|---|---|---|
|
column_name |
String |
Table column name. |
|
column_type |
String |
Definition Column field type. Constraints N/A Range Default Value N/A |
|
column_type_setting |
String |
Table column type settings. |
|
column_data_type |
String |
Definition Column data type. Constraints N/A Range Default Value N/A |
|
column_data_type_setting |
String |
Table column data type setting |
|
nullable |
Boolean |
Empty or not. |
|
array |
Boolean |
Array or not. |
|
depth |
Integer |
Depth. |
|
parent_name |
String |
Parent-level name. |
|
own_name |
String |
Name. |
|
column_display_setting |
ColumnDisplaySetting object |
Table column display settings. |
|
column_sequence_number |
Integer |
Column No. |
|
Parameter |
Type |
Description |
|---|---|---|
|
mapping_required |
Boolean |
Whether the mapping is mandatory. |
|
group_sequence_number |
Integer |
Group sequence number. |
|
intra_group_sequence_number |
Integer |
Group sequence number. |
|
value_type |
String |
Value type. |
|
value_qualified |
String |
Valid value. |
|
display_name |
String |
Display name. |
|
display_description |
String |
Display description. |
|
group_name |
String |
Group name. |
|
Parameter |
Type |
Description |
|---|---|---|
|
application_index |
String |
Application index. |
|
application_topic |
String |
Application theme. |
|
application_data_class_id |
String |
Application data class ID. |
|
streaming_bandwidth |
Number |
Streaming bandwidth (MB/s). |
|
streaming_partition |
Integer |
Streaming partition. |
|
streaming_retention_size |
Integer |
Streaming capacity. |
|
streaming_dataspace_id |
String |
Streaming data space ID. |
|
index_storage_period |
Integer |
Index storage period. |
|
index_storage_size |
Integer |
Index storage size. |
|
index_shards |
Integer |
Number of index shards. |
|
index_replicas |
Integer |
Number of index replicas. |
|
lake_storage_period |
Long |
Data lake storage period. |
|
lake_partition_setting |
String |
Definition Time unit. Constraints N/A Range Default Value N/A |
|
lake_expiration_status |
String |
Definition Data lake expiration status. Constraints N/A Range Default Value N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
columns |
Array of TableColumnDisplaySetting objects |
Table column display list. |
|
format |
String |
Definition Table display settings. Constraints N/A Range Default Value N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
column_name |
String |
Table column name. |
|
column_alias |
String |
Table column alias. |
|
display_by_default |
Boolean |
Whether to use default display settings. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Example Requests
None
Example Responses
Status code: 200
Successful.
{
"count" : 1,
"records" : [ {
"category" : "INDEX",
"create_time" : 1709610477056,
"data_classification" : "FACTUAL_DATA",
"delete_time" : 0,
"description" : "test",
"directory" : "test",
"format" : "JSON",
"lock_status" : "UNLOCKED",
"owner_type" : "SYSTEM",
"pipe_id" : "8660f159-932b-4b76-831c-4882850e4c18",
"process_error" : "NONE",
"process_status" : "COMPLETED",
"project_id" : "c796dfc5f1644915ae072b7642a2cd93",
"rw_type" : "READ_WRITE",
"schema" : {
"columns" : [ {
"array" : false,
"column_data_type" : "TIMESTAMP_LTZ",
"column_data_type_setting" : "3",
"column_name" : "__time",
"column_sequence_number" : 0,
"column_type" : "PHYSICAL",
"depth" : 0,
"nullable" : true,
"own_name" : "__time",
"parent_name" : ""
}, {
"array" : false,
"column_data_type" : "ROW",
"column_name" : "dest_asset",
"column_sequence_number" : 0,
"column_type" : "PHYSICAL",
"depth" : 0,
"nullable" : true,
"own_name" : "dest_asset",
"parent_name" : ""
} ],
"partition" : [ ],
"primary_key" : [ ],
"time_filter" : "__time",
"watermark_column" : "__time",
"watermark_interval" : 0
},
"storage_setting" : {
"index_replicas" : 1,
"index_shards" : 1,
"index_storage_period" : 7,
"index_storage_size" : 500
},
"table_alias" : "test_alias",
"table_id" : "96c0b2f1-57db-4ba6-8039-24ab39717aaf",
"table_name" : "i_sec_waf_access",
"update_time" : 1709610480592,
"workspace_id" : "5317af6c-aea0-4bd2-bd6b-08de5fd3b155"
} ]
}
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 48 |
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 ListTablesSolution { 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(); ListTablesRequest request = new ListTablesRequest(); request.withWorkspaceId("{workspace_id}"); try { ListTablesResponse response = client.listTables(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 |
# 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 = ListTablesRequest() request.workspace_id = "{workspace_id}" response = client.list_tables(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 |
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.ListTablesRequest{} request.WorkspaceId = "{workspace_id}" response, err := client.ListTables(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 |
Successful. |
|
400 |
Error response. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot