Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19275,6 +19275,9 @@ components:
description: Unique identifier of the global variable.
readOnly: true
type: string
is_email:
description: Whether this global variable is a persistent email variable with an email address generated by Datadog.
type: boolean
is_fido:
description: Determines if the global variable is a FIDO variable.
type: boolean
Expand Down Expand Up @@ -19377,6 +19380,9 @@ components:
description: Unique identifier of the global variable.
readOnly: true
type: string
is_email:
description: Whether this global variable is a persistent email variable. Set this when creating the variable and omit `value`; Datadog generates an immutable email address. The variable cannot be converted to or from a persistent email variable.
type: boolean
is_fido:
description: Determines if the global variable is a FIDO variable.
type: boolean
Expand Down
32 changes: 32 additions & 0 deletions examples/v1/synthetics/CreateGlobalVariable_2215516655.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Create a persistent email global variable returns a generated address
*/

import { client, v1 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v1.SyntheticsApi(configuration);

const params: v1.SyntheticsApiCreateGlobalVariableRequest = {
body: {
name: "PERSISTENT_EMAIL_EXAMPLESYNTHETIC",
description: "Persistent email variable",
tags: [],
isEmail: true,
},
};

apiInstance
.createGlobalVariable(params)
.then((data: v1.SyntheticsGlobalVariable) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
10 changes: 10 additions & 0 deletions features/v1/synthetics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,16 @@ Feature: Synthetics
When the request is sent
Then the response status is 200 OK

@integration-only @team:DataDog/synthetics-orchestrating-managing
Scenario: Create a persistent email global variable returns a generated address
Given new "CreateGlobalVariable" request
And body with value {"name": "PERSISTENT_EMAIL_{{ unique_upper_alnum }}", "description": "Persistent email variable", "tags": [], "is_email": true}
When the request is sent
Then the response status is 200 OK
And the response "is_email" is equal to true
And the response "value.secure" is equal to false
And the response "value" has field "value"

@replay-only @team:DataDog/synthetics-orchestrating-managing
Scenario: Create a private location returns "OK" response
Given there is a valid "role" in the system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export class SyntheticsGlobalVariable {
* Unique identifier of the global variable.
*/
"id"?: string;
/**
* Whether this global variable is a persistent email variable with an email address generated by Datadog.
*/
"isEmail"?: boolean;
/**
* Determines if the global variable is a FIDO variable.
*/
Expand Down Expand Up @@ -83,6 +87,10 @@ export class SyntheticsGlobalVariable {
baseName: "id",
type: "string",
},
isEmail: {
baseName: "is_email",
type: "boolean",
},
isFido: {
baseName: "is_fido",
type: "boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export class SyntheticsGlobalVariableRequest {
* Unique identifier of the global variable.
*/
"id"?: string;
/**
* Whether this global variable is a persistent email variable. Set this when creating the variable and omit `value`; Datadog generates an immutable email address. The variable cannot be converted to or from a persistent email variable.
*/
"isEmail"?: boolean;
/**
* Determines if the global variable is a FIDO variable.
*/
Expand Down Expand Up @@ -83,6 +87,10 @@ export class SyntheticsGlobalVariableRequest {
baseName: "id",
type: "string",
},
isEmail: {
baseName: "is_email",
type: "boolean",
},
isFido: {
baseName: "is_fido",
type: "boolean",
Expand Down
Loading