Sha256: 7c210b6a1f627b4372ba394cd905bf3941db701f4ebb27164ce6870619ed8d4d

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

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

Version data entries

6 entries across 6 versions & 1 rubygems

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