"""
Get a list of entities returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.software_catalog_apiimportSoftwareCatalogApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=SoftwareCatalogApi(api_client)response=api_instance.list_catalog_entity()print(response)
# Get a list of entities returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::SoftwareCatalogAPI.newpapi_instance.list_catalog_entity()
// Get a list of entities 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.NewSoftwareCatalogApi(apiClient)resp,r,err:=api.ListCatalogEntity(ctx,*datadogV2.NewListCatalogEntityOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `SoftwareCatalogApi.ListCatalogEntity`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `SoftwareCatalogApi.ListCatalogEntity`:\n%s\n",responseContent)}
// Get a list of entities returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.SoftwareCatalogApi;importcom.datadog.api.client.v2.model.ListEntityCatalogResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();SoftwareCatalogApiapiInstance=newSoftwareCatalogApi(defaultClient);try{ListEntityCatalogResponseresult=apiInstance.listCatalogEntity();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling SoftwareCatalogApi#listCatalogEntity");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a list of entities returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_software_catalog::ListCatalogEntityOptionalParams;usedatadog_api_client::datadogV2::api_software_catalog::SoftwareCatalogAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=SoftwareCatalogAPI::with_config(configuration);letresp=api.list_catalog_entity(ListCatalogEntityOptionalParams::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="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get a list of entities returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.SoftwareCatalogApi(configuration);apiInstance.listCatalogEntity().then((data: v2.ListEntityCatalogResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create or update software catalog entity using schema v3 returns "ACCEPTED" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.SoftwareCatalogApi(configuration);constparams: v2.SoftwareCatalogApiUpsertCatalogEntityRequest={body:{apiVersion:"v3",datadog:{codeLocations:[{paths:[],},],events:[{}],logs:[{}],performanceData:{tags:[],},pipelines:{fingerprints:[],},},integrations:{opsgenie:{serviceUrl:"https://www.opsgenie.com/service/shopping-cart",},pagerduty:{serviceUrl:"https://www.pagerduty.com/service-directory/Pshopping-cart",},},kind:"service",metadata:{additionalOwners:[],contacts:[{contact:"https://slack/",type:"slack",},],id:"4b163705-23c0-4573-b2fb-f6cea2163fcb",inheritFrom:"application:default/myapp",links:[{name:"mylink",type:"link",url:"https://mylink",},],name:"service-examplesoftwarecatalog",tags:["this:tag","that:tag"],},spec:{dependsOn:[],languages:[],},},};apiInstance.upsertCatalogEntity(params).then((data: v2.UpsertCatalogEntityResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete a single entity returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.software_catalog_apiimportSoftwareCatalogApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=SoftwareCatalogApi(api_client)api_instance.delete_catalog_entity(entity_id="service:myservice",)
# Delete a single entity returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::SoftwareCatalogAPI.newapi_instance.delete_catalog_entity("service:myservice")
// Delete a single entity returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_software_catalog::SoftwareCatalogAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=SoftwareCatalogAPI::with_config(configuration);letresp=api.delete_catalog_entity("service:myservice".to_string()).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="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete a single entity returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.SoftwareCatalogApi(configuration);constparams: v2.SoftwareCatalogApiDeleteCatalogEntityRequest={entityId:"service:myservice",};apiInstance.deleteCatalogEntity(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));