Update security signal triage state or assignee
https://api.datadoghq.com/api/v2/security_monitoring/signals/{signal_id}/updatehttps://api.us3.datadoghq.com/api/v2/security_monitoring/signals/{signal_id}/updatehttps://api.us5.datadoghq.com/api/v2/security_monitoring/signals/{signal_id}/updatehttps://api.datadoghq.eu/api/v2/security_monitoring/signals/{signal_id}/updatehttps://api.ap1.datadoghq.com/api/v2/security_monitoring/signals/{signal_id}/updatehttps://api.ap2.datadoghq.com/api/v2/security_monitoring/signals/{signal_id}/updatehttps://api.uk1.datadoghq.com/api/v2/security_monitoring/signals/{signal_id}/updatehttps://api.ddog-gov.com/api/v2/security_monitoring/signals/{signal_id}/updatehttps://api.us2.ddog-gov.com/api/v2/security_monitoring/signals/{signal_id}/updateDescripción general
Update the triage state or assignee of a security signal.
Argumentos
Parámetros de ruta
signal_id [required]The ID of the signal.
Solicitud
Body Data (required)
Attributes describing the signal triage state or assignee update.
data [required]Data containing the triage state or assignee update for a security signal.
attributes [required]Attributes for updating the triage state or assignee of a security signal.
archive_commentOptional comment to display on archived signals.
archive_reasonReason a signal is archived.
none, false_positive, testing_or_maintenance, remediated, investigated_case_opened, true_positive_benign, true_positive_malicious, otherassigneeObject representing a given user entity.
handleThe handle for this user account.
idNumerical ID assigned by Datadog to this user account.
nameThe name for this user account.
uuid [required]UUID assigned by Datadog to this user account.
stateThe new triage state of the signal.
open, archived, under_reviewversionVersion of the updated signal. If server side version is higher, update will be rejected.
typeThe type of event.
signal_metadatasignal_metadata{
"data": {
"attributes": {
"archive_reason": "none",
"state": "archived"
},
"type": "signal_metadata"
}
}Respuesta
OK
The response returned after all triage operations, containing the updated signal triage data.
data [required]Data containing the updated triage attributes of the signal.
attributesAttributes describing a triage state update operation over a security signal.
archive_commentOptional comment to display on archived signals.
archive_comment_timestampTimestamp of the last edit to the comment.
archive_comment_userObject representing a given user entity.
handleThe handle for this user account.
iconGravatar icon associated to the user.
idNumerical ID assigned by Datadog to this user account.
nameThe name for this user account.
uuid [required]UUID assigned by Datadog to this user account.
archive_reasonReason a signal is archived.
none, false_positive, testing_or_maintenance, remediated, investigated_case_opened, true_positive_benign, true_positive_malicious, otherassignee [required]Object representing a given user entity.
handleThe handle for this user account.
iconGravatar icon associated to the user.
idNumerical ID assigned by Datadog to this user account.
nameThe name for this user account.
uuid [required]UUID assigned by Datadog to this user account.
incident_ids [required]Array of incidents that are associated with this signal.
state [required]The new triage state of the signal.
open, archived, under_reviewstate_update_timestampTimestamp of the last update to the signal state.
state_update_userObject representing a given user entity.
handleThe handle for this user account.
iconGravatar icon associated to the user.
idNumerical ID assigned by Datadog to this user account.
nameThe name for this user account.
uuid [required]UUID assigned by Datadog to this user account.
idThe unique ID of the security signal.
typeThe type of event.
signal_metadatasignal_metadata{
"data": {
"attributes": {
"archive_comment": "string",
"archive_comment_timestamp": "integer",
"archive_comment_user": {
"handle": "string",
"icon": "/path/to/matching/gravatar/icon",
"id": "integer",
"name": "string",
"uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"
},
"archive_reason": "string",
"assignee": {
"handle": "string",
"icon": "/path/to/matching/gravatar/icon",
"id": "integer",
"name": "string",
"uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"
},
"incident_ids": [
2066
],
"state": "open",
"state_update_timestamp": "integer",
"state_update_user": {
"handle": "string",
"icon": "/path/to/matching/gravatar/icon",
"id": "integer",
"name": "string",
"uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"
}
},
"id": "string",
"type": "signal_metadata"
}
}Bad Request
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Forbidden
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Not Found
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Ejemplo de código
# Path parameters
export signal_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/signals/${signal_id}/update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"archive_reason": "none",
"state": "archived"
},
"type": "signal_metadata"
}
}
EOF# Path parameters
export signal_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/signals/${signal_id}/update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"archive_reason": "none",
"state": "archived"
},
"type": "signal_metadata"
}
}
EOF# Path parameters
export signal_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/signals/${signal_id}/update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"archive_reason": "none",
"state": "archived"
},
"type": "signal_metadata"
}
}
EOF# Path parameters
export signal_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/signals/${signal_id}/update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"archive_reason": "none",
"state": "archived"
},
"type": "signal_metadata"
}
}
EOF# Path parameters
export signal_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/signals/${signal_id}/update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"archive_reason": "none",
"state": "archived"
},
"type": "signal_metadata"
}
}
EOF# Path parameters
export signal_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/signals/${signal_id}/update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"archive_reason": "none",
"state": "archived"
},
"type": "signal_metadata"
}
}
EOF# Path parameters
export signal_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/signals/${signal_id}/update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"archive_reason": "none",
"state": "archived"
},
"type": "signal_metadata"
}
}
EOF# Path parameters
export signal_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/signals/${signal_id}/update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"archive_reason": "none",
"state": "archived"
},
"type": "signal_metadata"
}
}
EOF# Path parameters
export signal_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/signals/${signal_id}/update" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"archive_reason": "none",
"state": "archived"
},
"type": "signal_metadata"
}
}
EOF// Update security signal triage state or assignee returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.SecurityMonitoringSignalUpdateRequest{
Data: datadogV2.SecurityMonitoringSignalUpdateData{
Attributes: datadogV2.SecurityMonitoringSignalUpdateAttributes{
ArchiveReason: datadogV2.SECURITYMONITORINGSIGNALARCHIVEREASON_NONE.Ptr(),
Assignee: &datadogV2.SecurityMonitoringTriageUser{
Uuid: "773b045d-ccf8-4808-bd3b-955ef6a8c940",
},
State: datadogV2.SECURITYMONITORINGSIGNALSTATE_OPEN.Ptr(),
},
Type: datadogV2.SECURITYMONITORINGSIGNALMETADATATYPE_SIGNAL_METADATA.Ptr(),
},
}
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewSecurityMonitoringApi(apiClient)
resp, r, err := api.EditSecurityMonitoringSignal(ctx, "signal_id", body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.EditSecurityMonitoringSignal`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.EditSecurityMonitoringSignal`:\n%s\n", responseContent)
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// Update security signal triage state or assignee returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
import com.datadog.api.client.v2.model.SecurityMonitoringSignalArchiveReason;
import com.datadog.api.client.v2.model.SecurityMonitoringSignalMetadataType;
import com.datadog.api.client.v2.model.SecurityMonitoringSignalState;
import com.datadog.api.client.v2.model.SecurityMonitoringSignalTriageUpdateResponse;
import com.datadog.api.client.v2.model.SecurityMonitoringSignalUpdateAttributes;
import com.datadog.api.client.v2.model.SecurityMonitoringSignalUpdateData;
import com.datadog.api.client.v2.model.SecurityMonitoringSignalUpdateRequest;
import com.datadog.api.client.v2.model.SecurityMonitoringTriageUser;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
SecurityMonitoringSignalUpdateRequest body =
new SecurityMonitoringSignalUpdateRequest()
.data(
new SecurityMonitoringSignalUpdateData()
.attributes(
new SecurityMonitoringSignalUpdateAttributes()
.archiveReason(SecurityMonitoringSignalArchiveReason.NONE)
.assignee(
new SecurityMonitoringTriageUser()
.uuid("773b045d-ccf8-4808-bd3b-955ef6a8c940"))
.state(SecurityMonitoringSignalState.OPEN))
.type(SecurityMonitoringSignalMetadataType.SIGNAL_METADATA));
try {
SecurityMonitoringSignalTriageUpdateResponse result =
apiInstance.editSecurityMonitoringSignal("signal_id", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling SecurityMonitoringApi#editSecurityMonitoringSignal");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
Update security signal triage state or assignee returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi
from datadog_api_client.v2.model.security_monitoring_signal_archive_reason import SecurityMonitoringSignalArchiveReason
from datadog_api_client.v2.model.security_monitoring_signal_metadata_type import SecurityMonitoringSignalMetadataType
from datadog_api_client.v2.model.security_monitoring_signal_state import SecurityMonitoringSignalState
from datadog_api_client.v2.model.security_monitoring_signal_update_attributes import (
SecurityMonitoringSignalUpdateAttributes,
)
from datadog_api_client.v2.model.security_monitoring_signal_update_data import SecurityMonitoringSignalUpdateData
from datadog_api_client.v2.model.security_monitoring_signal_update_request import SecurityMonitoringSignalUpdateRequest
from datadog_api_client.v2.model.security_monitoring_triage_user import SecurityMonitoringTriageUser
body = SecurityMonitoringSignalUpdateRequest(
data=SecurityMonitoringSignalUpdateData(
attributes=SecurityMonitoringSignalUpdateAttributes(
archive_reason=SecurityMonitoringSignalArchiveReason.NONE,
assignee=SecurityMonitoringTriageUser(
uuid="773b045d-ccf8-4808-bd3b-955ef6a8c940",
),
state=SecurityMonitoringSignalState.OPEN,
),
type=SecurityMonitoringSignalMetadataType.SIGNAL_METADATA,
),
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = SecurityMonitoringApi(api_client)
response = api_instance.edit_security_monitoring_signal(signal_id="signal_id", body=body)
print(response)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# Update security signal triage state or assignee returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
body = DatadogAPIClient::V2::SecurityMonitoringSignalUpdateRequest.new({
data: DatadogAPIClient::V2::SecurityMonitoringSignalUpdateData.new({
attributes: DatadogAPIClient::V2::SecurityMonitoringSignalUpdateAttributes.new({
archive_reason: DatadogAPIClient::V2::SecurityMonitoringSignalArchiveReason::NONE,
assignee: DatadogAPIClient::V2::SecurityMonitoringTriageUser.new({
uuid: "773b045d-ccf8-4808-bd3b-955ef6a8c940",
}),
state: DatadogAPIClient::V2::SecurityMonitoringSignalState::OPEN,
}),
type: DatadogAPIClient::V2::SecurityMonitoringSignalMetadataType::SIGNAL_METADATA,
}),
})
p api_instance.edit_security_monitoring_signal("signal_id", body)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// Update security signal triage state or assignee returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
use datadog_api_client::datadogV2::model::SecurityMonitoringSignalArchiveReason;
use datadog_api_client::datadogV2::model::SecurityMonitoringSignalMetadataType;
use datadog_api_client::datadogV2::model::SecurityMonitoringSignalState;
use datadog_api_client::datadogV2::model::SecurityMonitoringSignalUpdateAttributes;
use datadog_api_client::datadogV2::model::SecurityMonitoringSignalUpdateData;
use datadog_api_client::datadogV2::model::SecurityMonitoringSignalUpdateRequest;
use datadog_api_client::datadogV2::model::SecurityMonitoringTriageUser;
#[tokio::main]
async fn main() {
let body = SecurityMonitoringSignalUpdateRequest::new(
SecurityMonitoringSignalUpdateData::new(
SecurityMonitoringSignalUpdateAttributes::new()
.archive_reason(SecurityMonitoringSignalArchiveReason::NONE)
.assignee(SecurityMonitoringTriageUser::new(
"773b045d-ccf8-4808-bd3b-955ef6a8c940".to_string(),
))
.state(SecurityMonitoringSignalState::OPEN),
)
.type_(SecurityMonitoringSignalMetadataType::SIGNAL_METADATA),
);
let configuration = datadog::Configuration::new();
let api = SecurityMonitoringAPI::with_config(configuration);
let resp = api
.edit_security_monitoring_signal("signal_id".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run/**
* Update security signal triage state or assignee returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.SecurityMonitoringApi(configuration);
const params: v2.SecurityMonitoringApiEditSecurityMonitoringSignalRequest = {
body: {
data: {
attributes: {
archiveReason: "none",
assignee: {
uuid: "773b045d-ccf8-4808-bd3b-955ef6a8c940",
},
state: "open",
},
type: "signal_metadata",
},
},
signalId: "signal_id",
};
apiInstance
.editSecurityMonitoringSignal(params)
.then((data: v2.SecurityMonitoringSignalTriageUpdateResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"