Sha256: 1c0c54d919a750f2c860c1215f10dd0ab8a4173b394574c0d7e3c64a3f58d771

Contents?: true

Size: 938 Bytes

Versions: 4

Compression:

Stored size: 938 Bytes

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_EXAMPLECREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE",
  tags: [],
  value: DatadogAPIClient::V1::SyntheticsGlobalVariableValue.new({
    secure: false,
    value: "",
  }),
  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

4 entries across 4 versions & 1 rubygems

Version Path
datadog_api_client-2.5.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.4.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.3.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb
datadog_api_client-2.2.0 examples/v1/synthetics/CreateGlobalVariable_1068962881.rb