Datadog Cloud Security Management (CSM) delivers real-time threat detection
and continuous configuration audits across your entire cloud infrastructure,
all in a unified view for seamless collaboration and faster remediation.
Go to https://docs.datadoghq.com/security/cloud_security_management to learn more
"""
Get all CSM Agents returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.csm_agents_apiimportCSMAgentsApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=CSMAgentsApi(api_client)response=api_instance.list_all_csm_agents()print(response)
# Get all CSM Agents returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CSMAgentsAPI.newpapi_instance.list_all_csm_agents()
// Get all CSM Agents 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/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCSMAgentsApi(apiClient)resp,r,err:=api.ListAllCSMAgents(ctx,*datadogV2.NewListAllCSMAgentsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CSMAgentsApi.ListAllCSMAgents`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CSMAgentsApi.ListAllCSMAgents`:\n%s\n",responseContent)}
// Get all CSM Agents returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_csm_agents::CSMAgentsAPI;usedatadog_api_client::datadogV2::api_csm_agents::ListAllCSMAgentsOptionalParams;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=CSMAgentsAPI::with_config(configuration);letresp=api.list_all_csm_agents(ListAllCSMAgentsOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get all CSM Agents returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CSMAgentsApi(configuration);apiInstance.listAllCSMAgents().then((data: v2.CsmAgentsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get all CSM Serverless Agents returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.csm_agents_apiimportCSMAgentsApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=CSMAgentsApi(api_client)response=api_instance.list_all_csm_serverless_agents()print(response)
# Get all CSM Serverless Agents returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CSMAgentsAPI.newpapi_instance.list_all_csm_serverless_agents()
// Get all CSM Serverless Agents 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/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCSMAgentsApi(apiClient)resp,r,err:=api.ListAllCSMServerlessAgents(ctx,*datadogV2.NewListAllCSMServerlessAgentsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CSMAgentsApi.ListAllCSMServerlessAgents`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CSMAgentsApi.ListAllCSMServerlessAgents`:\n%s\n",responseContent)}
// Get all CSM Serverless Agents returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_csm_agents::CSMAgentsAPI;usedatadog_api_client::datadogV2::api_csm_agents::ListAllCSMServerlessAgentsOptionalParams;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=CSMAgentsAPI::with_config(configuration);letresp=api.list_all_csm_serverless_agents(ListAllCSMServerlessAgentsOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get all CSM Serverless Agents returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CSMAgentsApi(configuration);apiInstance.listAllCSMServerlessAgents().then((data: v2.CsmAgentsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));