"""
List all AWS Logs integrations returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.aws_logs_integration_apiimportAWSLogsIntegrationApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=AWSLogsIntegrationApi(api_client)response=api_instance.list_aws_logs_integrations()print(response)
# List all AWS Logs integrations returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::AWSLogsIntegrationAPI.newpapi_instance.list_aws_logs_integrations()
// List all AWS Logs integrations returns "OK" response
packagemainimport("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.NewAWSLogsIntegrationApi(apiClient)resp,r,err:=api.ListAWSLogsIntegrations(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `AWSLogsIntegrationApi.ListAWSLogsIntegrations`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `AWSLogsIntegrationApi.ListAWSLogsIntegrations`:\n%s\n",responseContent)}
/**
* List all AWS Logs integrations returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSLogsIntegrationApi(configuration);apiInstance.listAWSLogsIntegrations().then((data: v1.AWSLogsListResponse[])=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Get the list of current AWS services that Datadog offers automatic log collection. Use returned service IDs with the services parameter for the Enable an AWS service log collection API endpoint.
"""
Get list of AWS log ready services returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.aws_logs_integration_apiimportAWSLogsIntegrationApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=AWSLogsIntegrationApi(api_client)response=api_instance.list_aws_logs_services()print(response)
# Get list of AWS log ready services returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::AWSLogsIntegrationAPI.newpapi_instance.list_aws_logs_services()
// Get list of AWS log ready services returns "OK" response
packagemainimport("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.NewAWSLogsIntegrationApi(apiClient)resp,r,err:=api.ListAWSLogsServices(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `AWSLogsIntegrationApi.ListAWSLogsServices`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `AWSLogsIntegrationApi.ListAWSLogsServices`:\n%s\n",responseContent)}
// Get list of AWS log ready services returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.AwsLogsIntegrationApi;importcom.datadog.api.client.v1.model.AWSLogsListServicesResponse;importjava.util.List;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();AwsLogsIntegrationApiapiInstance=newAwsLogsIntegrationApi(defaultClient);try{List<AWSLogsListServicesResponse>result=apiInstance.listAWSLogsServices();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling AwsLogsIntegrationApi#listAWSLogsServices");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
/**
* Get list of AWS log ready services returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSLogsIntegrationApi(configuration);apiInstance.listAWSLogsServices().then((data: v1.AWSLogsListServicesResponse[])=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Array of services IDs set to enable automatic log collection. Discover the list of available services with the get list of AWS log ready services API endpoint.
Test if permissions are present to add log-forwarding triggers for the
given services and AWS account. Input is the same as for EnableAWSLogServices.
Done async, so can be repeatedly polled in a non-blocking fashion until
the async request completes.
Returns a status of created when it’s checking if the permissions exists
in the AWS account.
Returns a status of waiting while checking.
Returns a status of checked and ok if the Lambda exists.
Returns a status of error if the Lambda does not exist.
Array of services IDs set to enable automatic log collection. Discover the list of available services with the get list of AWS log ready services API endpoint.
Test if permissions are present to add a log-forwarding triggers for the given services and AWS account. The input
is the same as for Enable an AWS service log collection. Subsequent requests will always repeat the above, so this
endpoint can be polled intermittently instead of blocking.
Returns a status of ‘created’ when it’s checking if the Lambda exists in the account.
Returns a status of ‘waiting’ while checking.
Returns a status of ‘checked and ok’ if the Lambda exists.
Returns a status of ’error’ if the Lambda does not exist.
"""
Check that an AWS Lambda Function exists returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.aws_logs_integration_apiimportAWSLogsIntegrationApifromdatadog_api_client.v1.model.aws_account_and_lambda_requestimportAWSAccountAndLambdaRequestbody=AWSAccountAndLambdaRequest(account_id="1234567",lambda_arn="arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest",)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=AWSLogsIntegrationApi(api_client)response=api_instance.check_aws_logs_lambda_async(body=body)print(response)
# Check that an AWS Lambda Function exists returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::AWSLogsIntegrationAPI.newbody=DatadogAPIClient::V1::AWSAccountAndLambdaRequest.new({account_id:"1234567",lambda_arn:"arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest",})papi_instance.check_aws_logs_lambda_async(body)
// Check that an AWS Lambda Function exists returns "OK" response
packagemainimport("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(){body:=datadogV1.AWSAccountAndLambdaRequest{AccountId:"1234567",LambdaArn:"arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest",}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewAWSLogsIntegrationApi(apiClient)resp,r,err:=api.CheckAWSLogsLambdaAsync(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `AWSLogsIntegrationApi.CheckAWSLogsLambdaAsync`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `AWSLogsIntegrationApi.CheckAWSLogsLambdaAsync`:\n%s\n",responseContent)}
// Check that an AWS Lambda Function exists returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.AwsLogsIntegrationApi;importcom.datadog.api.client.v1.model.AWSAccountAndLambdaRequest;importcom.datadog.api.client.v1.model.AWSLogsAsyncResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();AwsLogsIntegrationApiapiInstance=newAwsLogsIntegrationApi(defaultClient);AWSAccountAndLambdaRequestbody=newAWSAccountAndLambdaRequest().accountId("1234567").lambdaArn("arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest");try{AWSLogsAsyncResponseresult=apiInstance.checkAWSLogsLambdaAsync(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling AwsLogsIntegrationApi#checkAWSLogsLambdaAsync");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
/**
* Check that an AWS Lambda Function exists returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.AWSLogsIntegrationApi(configuration);constparams: v1.AWSLogsIntegrationApiCheckAWSLogsLambdaAsyncRequest={body:{accountId:"1234567",lambdaArn:"arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest",},};apiInstance.checkAWSLogsLambdaAsync(params).then((data: v1.AWSLogsAsyncResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));