Querying the Associated Data Object List
Function
Querying the Associated Data Object List
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/workspaces/{workspace_id}/soc/{dataclass_type}/{data_object_id}/{related_dataclass_type}/search
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. Minimum: 32 Maximum: 36 |
workspace_id |
Yes |
String |
Workspace ID Minimum: 32 Maximum: 36 |
dataclass_type |
Yes |
String |
Data class to which the associated subject data object belongs. The value is plural in lowercase, for example, "alerts" and "incidents". Minimum: 1 Maximum: 64 |
data_object_id |
Yes |
String |
ID of the associated data object. Minimum: 32 Maximum: 36 |
related_dataclass_type |
Yes |
String |
Data class to which the associated subject data object belongs. The value is plural in lowercase, for example, "alerts" and "incidents". Minimum: 1 Maximum: 64 |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token. Minimum: 0 Maximum: 2097152 |
content-type |
Yes |
String |
Content type. Default: application/json;charset=UTF-8 Minimum: 0 Maximum: 64 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
limit |
No |
Integer |
Number of records displayed on each page. Minimum: 0 Maximum: 1000 |
offset |
No |
Integer |
Offset Minimum: 0 Maximum: 1000 |
sort_by |
No |
String |
Sorting field -- create_time | update_time Minimum: 0 Maximum: 1000 |
order |
No |
String |
Sort by -- DESC | ASC Minimum: 0 Maximum: 1000 Enumeration values:
|
from_date |
No |
String |
Search start time, for example, 2023-02-20T00:00:00.000Z Minimum: 0 Maximum: 64 |
to_date |
No |
String |
Search end time, for example, 2023-02-27T23:59:59.999Z Minimum: 0 Maximum: 64 |
condition |
No |
condition object |
Search condition expression. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
conditions |
No |
Array of conditions objects |
Expression list. Array Length: 0 - 999 |
logics |
No |
Array of strings |
Expression logic. Minimum: 0 Maximum: 100 Array Length: 0 - 999 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
X-request-id |
String |
Request ID, in the format request_uuid-timestamp-hostname. |
Parameter |
Type |
Description |
---|---|---|
code |
String |
Error code Minimum: 0 Maximum: 64 |
message |
String |
Error Message Minimum: 0 Maximum: 1024 |
total |
Integer |
Total number of alerts. Minimum: 0 Maximum: 10000 |
limit |
Integer |
Number of records displayed on each page. Minimum: 0 Maximum: 10000 |
offset |
Integer |
Offset Minimum: 0 Maximum: 10000 |
success |
Boolean |
Successful or not. |
data |
Array of DataObjectDetail objects |
Alert list. Array Length: 0 - 10000 |
Parameter |
Type |
Description |
---|---|---|
create_time |
String |
Recording time. The format is ISO 8601- YYYY-MM-DDTHH:mm:ss.ms+Timezone. Time zone where the incident occurred. If this parameter cannot be parsed, the default time zone GMT+8 is used. Minimum: 0 Maximum: 30 |
data_object |
DataObject object |
Alert entity information. |
dataclass_ref |
dataclass_ref object |
Data class object. |
format_version |
Integer |
Format version. Minimum: 0 Maximum: 999 |
id |
String |
Unique identifier of an incident. The value is in UUID format and can contain a maximum of 36 characters. Minimum: 0 Maximum: 36 |
project_id |
String |
ID of the current project. Minimum: 0 Maximum: 64 |
update_time |
String |
Update time. The format is ISO 8601 -- YYYY-MM-DDTHH:mm:ss.ms+Timezone. Time zone where the incident occurred. If this parameter cannot be parsed, the default time zone GMT+8 is used. Minimum: 0 Maximum: 30 |
version |
Integer |
Version. Minimum: 0 Maximum: 999 |
workspace_id |
String |
ID of the current workspace. Minimum: 0 Maximum: 36 |
Parameter |
Type |
Description |
---|---|---|
version |
String |
Version of the data source of the alert. The value must be one officially released by the Huawei Cloud SSA service. Minimum: 0 Maximum: 64 |
id |
String |
Unique identifier of an incident. The value is in UUID format and can contain a maximum of 36 characters. Minimum: 0 Maximum: 36 |
domain_id |
String |
ID of the account (domain_id) to whom the data is delivered and hosted. Minimum: 0 Maximum: 36 |
region_id |
String |
ID of the region where the account to whom the data is delivered and hosted belongs to. Minimum: 0 Maximum: 36 |
workspace_id |
String |
ID of the current workspace. Minimum: 0 Maximum: 36 |
environment |
environment object |
Coordinates of the environment where the alert was generated. |
datasource |
datasource object |
Source the data is first reported. |
first_observed_time |
String |
First discovery time. The format is ISO 8601- YYYY-MM-DDTHH:mm:ss.ms+Time zone. Time zone where the incident occurred. If this parameter cannot be parsed, the default time zone GMT+8 is used. Minimum: 0 Maximum: 30 |
last_observed_time |
String |
First discovery time. The format is ISO 8601- YYYY-MM-DDTHH:mm:ss.ms+Time zone. Time zone where the incident occurred. If this parameter cannot be parsed, the default time zone GMT+8 is used. Minimum: 0 Maximum: 30 |
create_time |
String |
Recording time. The format is ISO 8601- YYYY-MM-DDTHH:mm:ss.ms+Timezone. Time zone where the incident occurred. If this parameter cannot be parsed, the default time zone GMT+8 is used. Minimum: 0 Maximum: 30 |
arrive_time |
String |
Data receiving time. The format is ISO 8601- YYYY-MM-DDTHH:mm:ss.ms+Time zone. Time zone where the incident occurred. If this parameter cannot be parsed, the default time zone GMT+8 is used. Minimum: 0 Maximum: 30 |
title |
String |
Alert title. Minimum: 0 Maximum: 255 |
description |
String |
Alert description. Minimum: 0 Maximum: 1024 |
source_url |
String |
Alert URL, which points to the page of the current incident description in the data source product. Minimum: 0 Maximum: 1024 |
count |
Integer |
Incident occurrences Minimum: 0 Maximum: 999 |
confidence |
Integer |
Incident confidence. Confidence is used to illustrate the accuracy of an identified behavior or incident. Value range -- 0-100. 0 indicates that the confidence is 0%, and 100 indicates that the confidence is 100%. Minimum: 0 Maximum: 100 |
severity |
String |
Severity level. Value range: Tips | Low | Medium | High | Fatal Description:
Minimum: 3 Maximum: 6 Enumeration values:
|
criticality |
Integer |
Criticality, which specifies the importance level of the resources involved in an incident. Value range -- 0 to 100. The value 0 indicates that the resource is not critical, and 100 indicates that the resource is critical. Minimum: 0 Maximum: 100 |
alert_type |
alert_type object |
Alert classification. For details, see the Alert Type Definition. |
network_list |
Array of network_list objects |
Network Information Array Length: 0 - 999 |
resource_list |
Array of resource_list objects |
Affected resources. Array Length: 0 - 999 |
remediation |
remediation object |
Remedy measure. |
verification_state |
String |
Verification status, which identifies the accuracy of an incident. The options are as follows: – Unknown – True_Positive – False_Positive Enter Unknown by default. Minimum: 32 Maximum: 64 Enumeration values:
|
handle_status |
String |
Incident handling status. The options are as follows:
Minimum: 4 Maximum: 5 Enumeration values:
|
sla |
Integer |
Risk close time -- Set the acceptable risk duration. Unit -- Hour Minimum: 0 Maximum: 999 |
update_time |
String |
Update time. The format is ISO 8601 -- YYYY-MM-DDTHH:mm:ss.ms+Timezone. Time zone where the alert occurred. If this parameter cannot be parsed, the default time zone GMT+8 is used. Minimum: 0 Maximum: 30 |
close_time |
String |
Closing time. The format is ISO 8601 -- YYYY-MM-DDTHH:mm:ss.ms+Timezone. Time zone where the incident occurred. If this parameter cannot be parsed, the default time zone GMT+8 is used. Minimum: 0 Maximum: 30 |
ipdrr_phase |
String |
Period/Handling phase No. Prepartion|Detection and Analysis|Containm, Eradication& Recovery|Post-Incident-Activity Minimum: 0 Maximum: 64 Enumeration values:
|
simulation |
String |
Debugging field. Minimum: 0 Maximum: 64 |
actor |
String |
Alert investigator. Minimum: 0 Maximum: 64 |
owner |
String |
Owner and service owner. Minimum: 0 Maximum: 64 |
creator |
String |
Creator Minimum: 0 Maximum: 64 |
close_reason |
String |
Close reason.
Minimum: 0 Maximum: 64 Enumeration values:
|
close_comment |
String |
Whether to close comment. Minimum: 0 Maximum: 1024 |
malware |
malware object |
Malware |
system_info |
Object |
System information. |
process |
Array of process objects |
Process information. Array Length: 0 - 999 |
user_info |
Array of user_info objects |
User Details Array Length: 0 - 999 |
file_info |
Array of file_info objects |
File Information Array Length: 0 - 999 |
Parameter |
Type |
Description |
---|---|---|
vendor_type |
String |
Environment provider. The value can be HWCP, HWC, AWS, Azure, or GCP. Minimum: 0 Maximum: 64 |
domain_id |
String |
Tenant ID. Minimum: 0 Maximum: 64 |
region_id |
String |
Region ID. global is returned for global services. Minimum: 0 Maximum: 64 |
cross_workspace_id |
String |
ID of the source workspace for the data delivery. If the source workspace ID is null, then the destination workspace account ID is used. Minimum: 0 Maximum: 64 |
project_id |
String |
Project ID. The default value is null for global services. Minimum: 0 Maximum: 64 |
Parameter |
Type |
Description |
---|---|---|
source_type |
Integer |
Data source type. The options are as follows-- 1- Huawei Cloud product 2- Third-party product 3- Tenant product Minimum: 1 Maximum: 3 Enumeration values:
|
domain_id |
String |
Account ID to which the data source product belongs. Minimum: 0 Maximum: 36 |
project_id |
String |
ID of the project to which the data source product belongs. Minimum: 0 Maximum: 64 |
region_id |
String |
Region where the data source is located, for example, cn-north1. For details about the value range, see Regions and Endpoints. Minimum: 0 Maximum: 64 |
company_name |
String |
Name of the company to which a data source belongs. Minimum: 0 Maximum: 16 |
product_name |
String |
Name of the data source. Minimum: 0 Maximum: 24 |
product_feature |
String |
Name of the feature of the product that detects the incident. Minimum: 0 Maximum: 24 |
product_module |
String |
Threat detection module list. Minimum: 0 Maximum: 1024 |
Parameter |
Type |
Description |
---|---|---|
category |
String |
Type Minimum: 0 Maximum: 1024 |
alert_type |
String |
Alert type. Minimum: 0 Maximum: 1024 |
Parameter |
Type |
Description |
---|---|---|
direction |
String |
Direction. The value can be IN or OUT. Minimum: 0 Maximum: 3 Enumeration values:
|
protocol |
String |
Protocol, including Layer 7 and Layer 4 protocols. For details, see IANA registered name. https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml. Minimum: 0 Maximum: 64 |
src_ip |
String |
Source IP address Minimum: 0 Maximum: 64 |
src_port |
Integer |
Source port. The value ranges from 0 to 65535. Minimum: 0 Maximum: 65535 |
src_domain |
String |
Source domain name. Minimum: 0 Maximum: 128 |
src_geo |
src_geo object |
Geographical location of the source IP address. |
dest_ip |
String |
Destination IP address Minimum: 32 Maximum: 64 |
dest_port |
String |
Destination port. The value ranges from 0 to 65535. Minimum: 0 Maximum: 65535 |
dest_domain |
String |
Destination domain name Minimum: 0 Maximum: 128 |
dest_geo |
dest_geo object |
Geographical location of the destination IP address. |
Parameter |
Type |
Description |
---|---|---|
latitude |
Number |
Latitude Minimum: 0 Maximum: 90 |
longitude |
Number |
Longitude Minimum: 0 Maximum: 180 |
city_code |
String |
City code. For example, Beijing or Shanghai. Minimum: 0 Maximum: 64 |
country_code |
String |
Country code. For details, see ISO 3166-1 alpha-2. For example, CN | US | DE | IT | SG. Minimum: 0 Maximum: 64 |
Parameter |
Type |
Description |
---|---|---|
latitude |
Number |
Latitude Minimum: 0 Maximum: 90 |
longitude |
Number |
Longitude Minimum: 0 Maximum: 180 |
city_code |
String |
City code. For example, Beijing or Shanghai. Minimum: 0 Maximum: 64 |
country_code |
String |
Country code. For details, see ISO 3166-1 alpha-2. For example, CN | US | DE | IT | SG. Minimum: 0 Maximum: 64 |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Cloud service resource ID. Minimum: 0 Maximum: 36 |
name |
String |
Resource name. Minimum: 0 Maximum: 255 |
type |
String |
Resource type. This parameter references the value of RMS type on Huawei Cloud. Minimum: 0 Maximum: 64 |
provider |
String |
Cloud service name, which is the same as the provider field in the RMS service. Minimum: 0 Maximum: 64 |
region_id |
String |
Region ID in Huawei Cloud, for example, cn-north-1. Minimum: 0 Maximum: 36 |
domain_id |
String |
ID of the account to which the resource belongs, in UUID format. Minimum: 0 Maximum: 36 |
project_id |
String |
ID of the account to which the resource belongs, in UUID format. Minimum: 0 Maximum: 36 |
ep_id |
String |
Specifies the enterprise project ID. Minimum: 0 Maximum: 128 |
ep_name |
String |
Enterprise Project Name Minimum: 0 Maximum: 128 |
tags |
String |
Resource tag.
Minimum: 0 Maximum: 2048 |
Parameter |
Type |
Description |
---|---|---|
recommendation |
String |
Recommended solution. Minimum: 0 Maximum: 128 |
url |
String |
Link to the general fix information for the incident. The URL must be accessible from the public network with no credentials required. Minimum: 0 Maximum: 2048 |
Parameter |
Type |
Description |
---|---|---|
malware_family |
String |
Malicious family. Minimum: 0 Maximum: 64 |
malware_class |
String |
Malware category. Minimum: 0 Maximum: 64 |
Parameter |
Type |
Description |
---|---|---|
process_name |
String |
Process name. Minimum: 0 Maximum: 64 |
process_path |
String |
Process execution file path. Minimum: 0 Maximum: 512 |
process_pid |
Integer |
Process ID. Minimum: 0 Maximum: 65535 |
process_uid |
Integer |
Process user ID. Minimum: 0 Maximum: 655350 |
process_cmdline |
String |
Process command line. Minimum: 0 Maximum: 128 |
process_parent_name |
String |
Parent process name. Minimum: 0 Maximum: 64 |
process_parent_path |
String |
Parent process execution file path. Minimum: 0 Maximum: 512 |
process_parent_pid |
Integer |
Parent process ID. Minimum: 0 Maximum: 65535 |
process_parent_uid |
Integer |
Parent process user ID. Minimum: 0 Maximum: 655350 |
process_parent_cmdline |
String |
Parent process command line. Minimum: 0 Maximum: 128 |
process_child_name |
String |
Subprocess name. Minimum: 0 Maximum: 64 |
process_child_path |
String |
Subprocess execution file path. Minimum: 0 Maximum: 512 |
process_child_pid |
Integer |
Subprocess ID. Minimum: 0 Maximum: 65535 |
process_child_uid |
Integer |
Subprocess user ID. Minimum: 0 Maximum: 655350 |
process_child_cmdline |
String |
Subprocess command line Minimum: 0 Maximum: 128 |
process_launche_time |
String |
Incident start time. The format is ISO 8601 -- YYYY-MM-DDTHH:mm:ss.ms+Time zone. Time zone where the incident occurred. If this parameter cannot be parsed, the default time zone GMT+8 is used. Minimum: 0 Maximum: 30 |
process_terminate_time |
String |
Process end time. The format is ISO 8601 -- YYYY-MM-DDTHH:mm:ss.ms+Time zone. Time zone where the incident occurred. If this parameter cannot be parsed, the default time zone GMT+8 is used. Minimum: 0 Maximum: 30 |
Parameter |
Type |
Description |
---|---|---|
user_id |
String |
User UID Minimum: 0 Maximum: 36 |
user_name |
String |
Username Minimum: 32 Maximum: 64 |
Parameter |
Type |
Description |
---|---|---|
file_path |
String |
File path/name. Minimum: 0 Maximum: 128 |
file_content |
String |
File path/name. Minimum: 0 Maximum: 1024 |
file_new_path |
String |
New file path/name. Minimum: 32 Maximum: 64 |
file_hash |
String |
File Hash Minimum: 0 Maximum: 128 |
file_md5 |
String |
File MD5 Minimum: 0 Maximum: 128 |
file_sha256 |
String |
File SHA256 Minimum: 0 Maximum: 128 |
file_attr |
String |
File attribute. Minimum: 0 Maximum: 1024 |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Unique identifier of a data class. The value is in UUID format and can contain a maximum of 36 characters. Minimum: 0 Maximum: 36 |
name |
String |
Data class name. Minimum: 0 Maximum: 36 |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
X-request-id |
String |
Request ID, in the format request_uuid-timestamp-hostname. |
Parameter |
Type |
Description |
---|---|---|
code |
String |
Error Code Minimum: 0 Maximum: 64 |
message |
String |
Error Description Minimum: 0 Maximum: 1024 |
Example Requests
Query the data object relationship list. The offset is 10, and three alerts are queried.
{ "limit" : 3, "offset" : 10 }
Example Responses
Status code: 200
Response body for querying associating data objects.
{ "code" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "message" : "Error message", "total" : 41, "limit" : 3, "offset" : 10, "data" : null }
SDK Sample Code
The SDK sample code is as follows.
Query the data object relationship list. The offset is 10, and three alerts are queried.
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 ListDataobjectRelationsSolution { 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); SecMasterClient client = SecMasterClient.newBuilder() .withCredential(auth) .withRegion(SecMasterRegion.valueOf("<YOUR REGION>")) .build(); ListDataobjectRelationsRequest request = new ListDataobjectRelationsRequest(); DataobjectSearch body = new DataobjectSearch(); body.withOffset(10); body.withLimit(3); request.withBody(body); try { ListDataobjectRelationsResponse response = client.listDataobjectRelations(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()); } } } |
Query the data object relationship list. The offset is 10, and three alerts are queried.
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 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"] credentials = BasicCredentials(ak, sk) client = SecMasterClient.new_builder() \ .with_credentials(credentials) \ .with_region(SecMasterRegion.value_of("<YOUR REGION>")) \ .build() try: request = ListDataobjectRelationsRequest() request.body = DataobjectSearch( offset=10, limit=3 ) response = client.list_dataobject_relations(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
Query the data object relationship list. The offset is 10, and three alerts are queried.
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 |
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") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := secmaster.NewSecMasterClient( secmaster.SecMasterClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ListDataobjectRelationsRequest{} offsetDataobjectSearch:= int32(10) limitDataobjectSearch:= int32(3) request.Body = &model.DataobjectSearch{ Offset: &offsetDataobjectSearch, Limit: &limitDataobjectSearch, } response, err := client.ListDataobjectRelations(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 |
Response body for querying associating data objects. |
400 |
Response body for failed requests for querying associating data objects. |
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