Sha256: f5887501bd977ca2defd6f433ca1e6804383beb4998ed1c14fb1862f077c7127

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

# Create a global variable returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::SyntheticsAPI.new

body = DatadogAPIClient::V1::SyntheticsGlobalVariableRequest.new({
  attributes: DatadogAPIClient::V1::SyntheticsGlobalVariableAttributes.new({
    restricted_roles: [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    ],
  }),
  description: "Example description",
  name: "MY_VARIABLE",
  parse_test_options: DatadogAPIClient::V1::SyntheticsGlobalVariableParseTestOptions.new({
    field: "content-type",
    local_variable_name: "LOCAL_VARIABLE",
    parser: DatadogAPIClient::V1::SyntheticsVariableParser.new({
      type: DatadogAPIClient::V1::SyntheticsGlobalVariableParserType::REGEX,
      value: ".*",
    }),
    type: DatadogAPIClient::V1::SyntheticsGlobalVariableParseTestOptionsType::HTTP_BODY,
  }),
  parse_test_public_id: "abc-def-123",
  tags: [
    "team:front",
    "test:workflow-1",
  ],
  value: DatadogAPIClient::V1::SyntheticsGlobalVariableValue.new({
    secure: true,
    value: "value",
  }),
})
p api_instance.create_global_variable(body)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.27.1 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.26.1 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.26.0 examples/v1/synthetics/CreateGlobalVariable.rb