Object containing information about the private location to create.
Expand All
Campo
Type
Descripción
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
# Path parameters exportlocation_id="CHANGE_ME" # Use a Personal Access Token or Service Access Token exportDD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
"""
Get a private location returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.synthetics_apiimportSyntheticsApiconfiguration=Configuration()configuration.access_token=environ["DD_BEARER_TOKEN"]withApiClient(configuration)asapi_client:api_instance=SyntheticsApi(api_client)response=api_instance.get_private_location(location_id="location_id",)print(response)
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"python3"example.py"
# Get a private location returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.access_token=ENV["DD_BEARER_TOKEN"]endapi_instance=DatadogAPIClient::V1::SyntheticsAPI.newpapi_instance.get_private_location("location_id")
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"rb"example.rb"
// 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())ctx=context.WithValue(ctx,datadog.ContextAccessToken,os.Getenv("DD_BEARER_TOKEN"))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)}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"go run"main.go"
// Get a private location returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.SyntheticsApi;importcom.datadog.api.client.v1.model.SyntheticsPrivateLocation;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));SyntheticsApiapiInstance=newSyntheticsApi(defaultClient);try{SyntheticsPrivateLocationresult=apiInstance.getPrivateLocation("location_id");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling SyntheticsApi#getPrivateLocation");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"java"Example.java"
// 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.comuk1.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({authMethods:{AuthZ:{accessToken: process.env.DD_BEARER_TOKENasstring,},},});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));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"tsc"example.ts"
Solicite una demostración personalizada
Comience con Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.