Sha256: 3b141b433f9188fe10863225b58aeab0362821575cdf8631f4ff89a3cef07043

Contents?: true

Size: 1.09 KB

Versions: 5

Compression:

Stored size: 1.09 KB

Contents

# Edit 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.edit_global_variable("variable_id", body)

Version data entries

5 entries across 5 versions & 1 rubygems

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