Sha256: 20f47f4190f865ebce650e2e8f14069996cdee44e32b385efea7020cff86fa01

Contents?: true

Size: 1.72 KB

Versions: 17

Compression:

Stored size: 1.72 KB

Contents

# Create an API test with UDP subtype returns "OK - Returns the created test details." response

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

body = DatadogAPIClient::V1::SyntheticsAPITest.new({
  config: DatadogAPIClient::V1::SyntheticsAPITestConfig.new({
    assertions: [
      DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
        operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::IS,
        target: "message",
        type: DatadogAPIClient::V1::SyntheticsAssertionType::RECEIVED_MESSAGE,
      }),
      DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
        operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::LESS_THAN,
        target: 2000,
        type: DatadogAPIClient::V1::SyntheticsAssertionType::RESPONSE_TIME,
      }),
    ],
    config_variables: [],
    request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
      host: "https://datadoghq.com",
      message: "message",
      port: 443,
    }),
  }),
  locations: [
    "aws:us-east-2",
  ],
  message: "BDD test payload: synthetics_api_test_udp_payload.json",
  name: "Example-Synthetic",
  options: DatadogAPIClient::V1::SyntheticsTestOptions.new({
    accept_self_signed: false,
    allow_insecure: true,
    follow_redirects: true,
    min_failure_duration: 10,
    min_location_failed: 1,
    monitor_name: "Example-Synthetic",
    monitor_priority: 5,
    _retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({
      count: 3,
      interval: 10,
    }),
    tick_every: 60,
  }),
  subtype: DatadogAPIClient::V1::SyntheticsTestDetailsSubType::UDP,
  tags: [
    "testing:api",
  ],
  type: DatadogAPIClient::V1::SyntheticsAPITestType::API,
})
p api_instance.create_synthetics_api_test(body)

Version data entries

17 entries across 17 versions & 1 rubygems

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