Sha256: 4a920d6309b81c772d71ce1c0f44d07832fe017847aa361eef3c5393b4a8814d

Contents?: true

Size: 1.1 KB

Versions: 15

Compression:

Stored size: 1.1 KB

Contents

# Create a global variable from test returns "OK" response

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

# there is a valid "synthetics_api_test_multi_step" in the system
SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID = ENV["SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID"]

body = DatadogAPIClient::V1::SyntheticsGlobalVariable.new({
  description: "",
  name: "GLOBAL_VARIABLE_PAYLOAD_EXAMPLESYNTHETIC",
  tags: [],
  value: DatadogAPIClient::V1::SyntheticsGlobalVariableValue.new({
    secure: false,
    value: "",
    options: DatadogAPIClient::V1::SyntheticsGlobalVariableOptions.new({
      totp_parameters: DatadogAPIClient::V1::SyntheticsGlobalVariableTOTPParameters.new({
        digits: 6,
        refresh_interval: 30,
      }),
    }),
  }),
  parse_test_public_id: SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID,
  parse_test_options: DatadogAPIClient::V1::SyntheticsGlobalVariableParseTestOptions.new({
    type: DatadogAPIClient::V1::SyntheticsGlobalVariableParseTestOptionsType::LOCAL_VARIABLE,
    local_variable_name: "EXTRACTED_VALUE",
  }),
})
p api_instance.create_global_variable(body)

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
datadog_api_client-2.25.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.24.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.22.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.21.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.20.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.19.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.18.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.17.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.16.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.15.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.14.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.13.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.12.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.11.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.10.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb