Sha256: d40b9b89aae2bedb0009f5d05de32b31a05139b341f922476e1e23add8350d93

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

# Create a global variable returns "OK" response

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

body = DatadogAPIClient::V1::SyntheticsGlobalVariable.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",
    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

6 entries across 6 versions & 1 rubygems

Version Path
datadog_api_client-2.0.2 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.0.1 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.0.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-1.11.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-1.10.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-1.9.0 examples/v1/synthetics/CreateGlobalVariable.rb