Get the current ownership inference for a resource for a specific owner type.
This endpoint supports ETag-based caching. Pass the previously returned ETag value in the If-None-Match request header to receive a 304 Not Modified response when the inference has not changed.
Arguments
Path Parameters
Name
Type
Description
resource_id [required]
string
The identifier of the resource to retrieve the ownership inference for.
owner_type [required]
string
The owner type of the inference to retrieve.
Header Parameters
Name
Type
Description
If-None-Match
string
A previously returned ETag value. When supplied and the resource has not changed, the endpoint returns 304 Not Modified.
"""
Get an ownership inference by owner type returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.csm_ownership_apiimportCSMOwnershipApifromdatadog_api_client.v2.model.ownership_owner_typeimportOwnershipOwnerTypeconfiguration=Configuration()configuration.unstable_operations["get_ownership_inference"]=TruewithApiClient(configuration)asapi_client:api_instance=CSMOwnershipApi(api_client)response=api_instance.get_ownership_inference(resource_id="test-resource",owner_type=OwnershipOwnerType.TEAM,)print(response)
# Get an ownership inference by owner type returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_ownership_inference".to_sym]=trueendapi_instance=DatadogAPIClient::V2::CSMOwnershipAPI.newpapi_instance.get_ownership_inference("test-resource",OwnershipOwnerType::TEAM)
// Get an ownership inference by owner type 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()configuration.SetUnstableOperationEnabled("v2.GetOwnershipInference",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCSMOwnershipApi(apiClient)resp,r,err:=api.GetOwnershipInference(ctx,"test-resource",datadogV2.OWNERSHIPOWNERTYPE_TEAM,*datadogV2.NewGetOwnershipInferenceOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CSMOwnershipApi.GetOwnershipInference`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CSMOwnershipApi.GetOwnershipInference`:\n%s\n",responseContent)}
// Get an ownership inference by owner type returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.CsmOwnershipApi;importcom.datadog.api.client.v2.model.OwnershipInferenceResponse;importcom.datadog.api.client.v2.model.OwnershipOwnerType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getOwnershipInference",true);CsmOwnershipApiapiInstance=newCsmOwnershipApi(defaultClient);try{OwnershipInferenceResponseresult=apiInstance.getOwnershipInference("test-resource",OwnershipOwnerType.TEAM);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CsmOwnershipApi#getOwnershipInference");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get an ownership inference by owner type returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_csm_ownership::CSMOwnershipAPI;usedatadog_api_client::datadogV2::api_csm_ownership::GetOwnershipInferenceOptionalParams;usedatadog_api_client::datadogV2::model::OwnershipOwnerType;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetOwnershipInference",true);letapi=CSMOwnershipAPI::with_config(configuration);letresp=api.get_ownership_inference("test-resource".to_string(),OwnershipOwnerType::TEAM,GetOwnershipInferenceOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get an ownership inference by owner type returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getOwnershipInference"]=true;constapiInstance=newv2.CSMOwnershipApi(configuration);constparams: v2.CSMOwnershipApiGetOwnershipInferenceRequest={resourceId:"test-resource",ownerType:"team",};apiInstance.getOwnershipInference(params).then((data: v2.OwnershipInferenceResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));