Querying the Collection Channel List
Function
This API is used to query the list of collection channels.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/workspaces/{workspace_id}/collector/channels
|
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 Value Range N/A Default value N/A |
|
workspace_id |
Yes |
String |
Workspace ID. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
title |
No |
String |
Related title. |
|
connection_module_id |
No |
String |
Associated module ID. |
|
parser_id |
No |
String |
Parser ID. |
|
group_id |
No |
String |
Group ID. |
|
offset |
No |
Integer |
Page number. |
|
limit |
No |
Integer |
Number of records on each page. |
|
sort_key |
No |
String |
Sorting field. |
|
sort_dir |
No |
String |
Definition Directory sorting. Constraints N/A Range Default Value N/A |
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 |
Integer |
Count. |
|
records |
Array of Channel objects |
Description. |
|
Parameter |
Type |
Description |
|---|---|---|
|
action |
String |
Definition Node running status monitoring. Constraints N/A Range Default Value N/A |
|
channel_id |
String |
UUID |
|
config_status |
String |
Definition Configuration status of the collection channel. Constraints N/A Range Default Value N/A |
|
create_by |
String |
IAM user ID. |
|
create_by_user |
String |
IAM username. |
|
description |
String |
Description. |
|
error_type |
String |
Definition Collection channel failure type. Constraints N/A Range Default Value N/A |
|
health_status |
String |
Definition Monitoring status of the collection channel. Constraints N/A Range Default Value N/A |
|
input_id |
String |
UUID |
|
input_name |
String |
Tenant name. |
|
install_status |
String |
Definition Collection channel delivery. Constraints N/A Range Default Value N/A |
|
install_time |
Integer |
Millisecond timestamp. |
|
node_refer_count |
Long |
Number of associated nodes. |
|
operation_status |
String |
Definition Deployment progress of the collection channel. Constraints N/A Range Default Value N/A |
|
output_id |
String |
UUID |
|
output_name |
String |
Tenant name. |
|
parser_id |
String |
UUID |
|
parser_name |
String |
Tenant name. |
|
read_write |
ReadWrite object |
Read and write records. |
|
title |
String |
Related title. |
|
update_time |
Integer |
Millisecond timestamp. |
|
Parameter |
Type |
Description |
|---|---|---|
|
accept_count |
Long |
Numerical value. |
|
accept_rate |
Long |
Numerical value. |
|
channel_id |
String |
UUID |
|
channel_instance_count |
Integer |
Number of collection channel instances. |
|
heart_beat |
String |
Definition Whether the node can successfully receive the heartbeat signal. Constraints N/A Range Default Value N/A |
|
heart_beat_time |
Integer |
Time when the last heartbeat signal was received. |
|
latest_transmission_time |
String |
Last transmission time. |
|
minion_id |
String |
UUID |
|
send_count |
Long |
Numerical value. |
|
send_rate |
Long |
Numerical value. |
Example Requests
https://{endpoint}/v1/{project_id}/workspaces/{workspace_id}/collector/channels
Example Responses
Status code: 200
Successful.
{
"count" : 11,
"records" : [ {
"action" : "REMOVE",
"channel_id" : "dc15b7fa-6dd0-4f12-8e35-4146d129a2c6",
"config_status" : "OK",
"create_by" : "w3_sec_ops_02:w3_ops:y*****54",
"create_by_user" : "w3_sso_secmaster_ops_02",
"description" : "",
"error_type" : "SUCCESS",
"health_status" : "SUCCESS_ALL",
"input_id" : "ccec32f9-bcb1-4f9c-91c6-09a3cb73d036",
"input_name" : "udp-test",
"install_status" : "READY",
"install_time" : 0,
"node_refer_count" : 1,
"operation_status" : "START",
"output_id" : "4e1f7633-4444-461e-ac5a-51a78e2d8f5e",
"output_name" : "tianjingle",
"parser_id" : "a009aa99-3521-4ec0-8827-811e277515b1",
"parser_name" : "quick",
"read_write" : {
"accept_count" : 0,
"accept_rate" : 0,
"channel_instance_count" : 0,
"heart_beat" : "OFFLINE",
"heart_beat_time" : 0,
"send_count" : 0,
"send_rate" : 0
},
"title" : "test02",
"update_time" : 1761202170896
} ]
}
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.v1.region.SecMasterRegion; import com.huaweicloud.sdk.secmaster.v1.*; import com.huaweicloud.sdk.secmaster.v1.model.*; public class ListCollectorChannelsSolution { 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(); ListCollectorChannelsRequest request = new ListCollectorChannelsRequest(); request.withWorkspaceId("{workspace_id}"); try { ListCollectorChannelsResponse response = client.listCollectorChannels(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.v1.region.secmaster_region import SecMasterRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdksecmaster.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 = SecMasterClient.new_builder() \ .with_credentials(credentials) \ .with_region(SecMasterRegion.value_of("<YOUR REGION>")) \ .build() try: request = ListCollectorChannelsRequest() request.workspace_id = "{workspace_id}" response = client.list_collector_channels(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/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/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 := secmaster.NewSecMasterClient( secmaster.SecMasterClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ListCollectorChannelsRequest{} request.WorkspaceId = "{workspace_id}" response, err := client.ListCollectorChannels(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. |
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