Sha256: 66e96947f497872dbe9262fd950c5740f8b333163a2f4a00ac75383bff552dd0

Contents?: true

Size: 1.07 KB

Versions: 24

Compression:

Stored size: 1.07 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",
    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

24 entries across 24 versions & 1 rubygems

Version Path
datadog_api_client-2.25.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.24.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.22.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.21.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.20.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.19.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.18.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.17.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.16.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.15.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.14.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.13.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.12.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.11.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.10.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.9.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.8.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.7.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.6.0 examples/v1/synthetics/CreateGlobalVariable.rb
datadog_api_client-2.5.0 examples/v1/synthetics/CreateGlobalVariable.rb