"""
Get an event returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.events_apiimportEventsApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=EventsApi(api_client)response=api_instance.get_event(event_id="AZeF-nTCAABzkAgGXzYPtgAA",)print(response)
# Get an event returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::EventsAPI.newpapi_instance.get_event("AZeF-nTCAABzkAgGXzYPtgAA")
// Get an event 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()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewEventsApi(apiClient)resp,r,err:=api.GetEvent(ctx,"AZeF-nTCAABzkAgGXzYPtgAA")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `EventsApi.GetEvent`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `EventsApi.GetEvent`:\n%s\n",responseContent)}
// Get an event returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.EventsApi;importcom.datadog.api.client.v2.model.V2EventResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();EventsApiapiInstance=newEventsApi(defaultClient);try{V2EventResponseresult=apiInstance.getEvent("AZeF-nTCAABzkAgGXzYPtgAA");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling EventsApi#getEvent");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get an event returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_events::EventsAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=EventsAPI::with_config(configuration);letresp=api.get_event("AZeF-nTCAABzkAgGXzYPtgAA".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.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get an event returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.EventsApi(configuration);constparams: v2.EventsApiGetEventRequest={eventId:"AZeF-nTCAABzkAgGXzYPtgAA",};apiInstance.getEvent(params).then((data: v2.V2EventResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
If an alert event is enabled, set its type.
For example, error, warning, info, success, user_update,
recommendation, and snapshot.
Allowed enum values: error,warning,info,success,user_update,recommendation,snapshot
date_happened
int64
POSIX timestamp of the event. Must be sent as an integer (that is no quotes).
Limited to events up to 18 hours in the past and two hours in the future.
device_name
string
A device name.
host
string
Host name to associate with the event.
Any tags associated with the host are also applied to this event.
id
int64
Integer ID of the event.
id_str
string
Handling IDs as large 64-bit numbers can cause loss of accuracy issues with some programming languages.
Instead, use the string representation of the Event ID to avoid losing accuracy.
payload
string
Payload of the event.
priority
enum
The priority of the event. For example, normal or low.
Allowed enum values: normal,low
source_type_name
string
The type of event being posted. Option examples include nagios, hudson, jenkins, my_apps, chef, puppet, git, bitbucket, etc.
The list of standard source attribute values available here.
tags
[string]
A list of tags to apply to the event.
text
string
The body of the event. Limited to 4000 characters. The text supports markdown.
To use markdown in the event text, start the text block with %%% \n and end the text block with \n %%%.
Use msg_text with the Datadog Ruby library.
title
string
The event title.
url
string
URL of the event.
status
string
A status.
{"event":{"alert_type":"info","date_happened":"integer","device_name":"string","host":"string","id":"integer","id_str":"string","payload":"{}","priority":"normal","source_type_name":"string","tags":["environment:test"],"text":"Oh boy!","title":"Did you hear the news today?","url":"string"},"status":"string"}
"""
Get an event returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.events_apiimportEventsApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=EventsApi(api_client)response=api_instance.get_event(event_id=9223372036854775807,)print(response)
# Get an event returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::EventsAPI.newpapi_instance.get_event(9223372036854775807)
// Get an event 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/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewEventsApi(apiClient)resp,r,err:=api.GetEvent(ctx,9223372036854775807)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `EventsApi.GetEvent`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `EventsApi.GetEvent`:\n%s\n",responseContent)}
// Get an event returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.EventsApi;importcom.datadog.api.client.v1.model.EventResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();EventsApiapiInstance=newEventsApi(defaultClient);try{EventResponseresult=apiInstance.getEvent(9223372036854775807L);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling EventsApi#getEvent");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get an event returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_events::EventsAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=EventsAPI::with_config(configuration);letresp=api.get_event(9223372036854775807).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get an event returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.EventsApi(configuration);constparams: v1.EventsApiGetEventRequest={eventId: 9223372036854775807,};apiInstance.getEvent(params).then((data: v1.EventResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));