Response object that includes a list of AWS on demand tasks.
Expand All
Field
Type
Description
data
[object]
A list of on demand tasks.
attributes
object
Attributes for the AWS on demand task.
arn
string
The arn of the resource to scan.
assigned_at
string
Specifies the assignment timestamp if the task has been already assigned to a scanner.
created_at
string
The task submission timestamp.
status
string
Indicates the status of the task.
QUEUED: the task has been submitted successfully and the resource has not been assigned to a scanner yet.
ASSIGNED: the task has been assigned.
ABORTED: the scan has been aborted after a period of time due to technical reasons, such as resource not found, insufficient permissions, or the absence of a configured scanner.
id
string
The UUID of the task.
type
enum
The type of the on demand task. The value should always be aws_resource.
Allowed enum values: aws_resource
"""
List AWS on demand tasks returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.agentless_scanning_apiimportAgentlessScanningApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=AgentlessScanningApi(api_client)response=api_instance.list_aws_on_demand_tasks()print(response)
# List AWS on demand tasks returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::AgentlessScanningAPI.newpapi_instance.list_aws_on_demand_tasks()
// List AWS on demand tasks 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.NewAgentlessScanningApi(apiClient)resp,r,err:=api.ListAwsOnDemandTasks(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `AgentlessScanningApi.ListAwsOnDemandTasks`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `AgentlessScanningApi.ListAwsOnDemandTasks`:\n%s\n",responseContent)}
// List AWS on demand tasks returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_agentless_scanning::AgentlessScanningAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=AgentlessScanningAPI::with_config(configuration);letresp=api.list_aws_on_demand_tasks().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
/**
* List AWS on demand tasks returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.AgentlessScanningApi(configuration);apiInstance.listAwsOnDemandTasks().then((data: v2.AwsOnDemandListResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));