Object containing information about the private location to create.
Expand All
Field
Type
Description
description [required]
string
Description of the private location.
id
string
Unique identifier of the private location.
metadata
object
Object containing metadata about the private location.
restricted_roles
[string]
DEPRECATED: A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. This field is deprecated. Use the restriction policies API to manage permissions.
name [required]
string
Name of the private location.
secrets
object
Secrets for the private location. Only present in the response when creating the private location.
authentication
object
Authentication part of the secrets.
id
string
Access key for the private location.
key
string
Secret access key for the private location.
config_decryption
object
Private key for the private location.
key
string
Private key for the private location.
tags [required]
[string]
Array of tags attached to the private location.
{"description":"Description of private location","id":"string","metadata":{"restricted_roles":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]},"name":"New private location","secrets":{"authentication":{"id":"string","key":"string"},"config_decryption":{"key":"string"}},"tags":["team:front"]}
- Synthetic private locations are not activated for the user
- Private location does not exist
"""
Get a private location returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.synthetics_apiimportSyntheticsApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=SyntheticsApi(api_client)response=api_instance.get_private_location(location_id="location_id",)print(response)
# Get a private location returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::SyntheticsAPI.newpapi_instance.get_private_location("location_id")
// Get a private location 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/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewSyntheticsApi(apiClient)resp,r,err:=api.GetPrivateLocation(ctx,"location_id")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `SyntheticsApi.GetPrivateLocation`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `SyntheticsApi.GetPrivateLocation`:\n%s\n",responseContent)}
// Get a private location returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=SyntheticsAPI::with_config(configuration);letresp=api.get_private_location("location_id".to_string()).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
/**
* Get a private location returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.SyntheticsApi(configuration);constparams: v1.SyntheticsApiGetPrivateLocationRequest={locationId:"location_id",};apiInstance.getPrivateLocation(params).then((data: v1.SyntheticsPrivateLocation)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));