The identifier of the team the detection is assigned to, if any.
assigned_to
string
The identifier of the user the detection is assigned to, if any.
assignment_source [required]
enum
How the detection's current assignment was determined. Possible values are auto_resolved, manual, reassigned, and cleared.
Allowed enum values: auto_resolved,manual,reassigned,cleared
control_id [required]
string
DEPRECATED: DEPRECATED: mirrors detection_type for backward compatibility; use detection_type
instead.
created_at [required]
date-time
The date and time when the detection was created.
detection_type [required]
string
The type of detection, which determines what condition was detected.
display_name [required]
string
The human-readable name of the detected resource.
exception_at
date-time
The date and time when the detection was marked as an exception, if applicable.
exception_by
string
The identifier of the user who marked the detection as an exception, if applicable.
metadata
Free-form metadata associated with the detection.
mitigate_after
date-time
The date and time after which the detection is scheduled to be mitigated, if applicable.
mitigated_at
date-time
The date and time when the detection was mitigated, if applicable.
priority [required]
int64
The priority of the detection, if set.
resource_id [required]
string
The identifier of the resource the detection applies to.
resource_type [required]
string
The type of resource the detection applies to, for example api_key or dashboard.
state [required]
enum
The current state of the detection. Possible values are active, exception, mitigated, inactive, obsolete, resolved_externally, and mitigation_in_progress.
Allowed enum values: active,exception,mitigated,inactive,obsolete,resolved_externally,mitigation_in_progress
id [required]
string
The unique identifier of the detection.
type [required]
enum
Governance control detection resource type.
Allowed enum values: governance_control_detection
"""
Get a detection returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.governance_console_apiimportGovernanceConsoleApiconfiguration=Configuration()configuration.unstable_operations["get_governance_detection"]=TruewithApiClient(configuration)asapi_client:api_instance=GovernanceConsoleApi(api_client)response=api_instance.get_governance_detection(detection_id="detection_id",)print(response)
# Get a detection returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_governance_detection".to_sym]=trueendapi_instance=DatadogAPIClient::V2::GovernanceConsoleAPI.newpapi_instance.get_governance_detection("detection_id")
// Get a detection returns "OK" responsepackagemainimport("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")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetGovernanceDetection",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewGovernanceConsoleApi(apiClient)resp,r,err:=api.GetGovernanceDetection(ctx,"detection_id")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `GovernanceConsoleApi.GetGovernanceDetection`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `GovernanceConsoleApi.GetGovernanceDetection`:\n%s\n",responseContent)}
// Get a detection returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.GovernanceConsoleApi;importcom.datadog.api.client.v2.model.GovernanceControlDetectionResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getGovernanceDetection",true);GovernanceConsoleApiapiInstance=newGovernanceConsoleApi(defaultClient);try{GovernanceControlDetectionResponseresult=apiInstance.getGovernanceDetection("3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling GovernanceConsoleApi#getGovernanceDetection");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a detection returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_governance_console::GovernanceConsoleAPI;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetGovernanceDetection",true);letapi=GovernanceConsoleAPI::with_config(configuration);letresp=api.get_governance_detection("detection_id".to_string()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get a detection returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getGovernanceDetection"]=true;constapiInstance=newv2.GovernanceConsoleApi(configuration);constparams: v2.GovernanceConsoleApiGetGovernanceDetectionRequest={detectionId:"detection_id",};apiInstance.getGovernanceDetection(params).then((data: v2.GovernanceControlDetectionResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));