Sha256: 050d7b97021e4d4ae523fbdf03e814ffddab9316be6c5da716d766665300dfde

Contents?: true

Size: 1.88 KB

Versions: 18

Compression:

Stored size: 1.88 KB

Contents

# Create an API test with WEBSOCKET 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({
      url: "ws://datadoghq.com",
      message: "message",
    }),
  }),
  locations: [
    "aws:us-east-2",
  ],
  message: "BDD test payload: synthetics_api_test_websocket_payload.json",
  name: "Example-Create_an_API_test_with_WEBSOCKET_subtype_returns_OK_Returns_the_created_test_details_response",
  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-Create_an_API_test_with_WEBSOCKET_subtype_returns_OK_Returns_the_created_test_details_response",
    monitor_priority: 5,
    _retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({
      count: 3,
      interval: 10,
    }),
    tick_every: 60,
  }),
  subtype: DatadogAPIClient::V1::SyntheticsTestDetailsSubType::WEBSOCKET,
  tags: [
    "testing:api",
  ],
  type: DatadogAPIClient::V1::SyntheticsAPITestType::API,
})
p api_instance.create_synthetics_api_test(body)

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
datadog_api_client-2.9.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-2.8.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-2.7.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-2.6.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-2.5.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-2.4.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-2.3.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-2.2.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-2.1.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-2.0.2 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-2.0.1 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-2.0.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-1.11.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-1.10.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-1.9.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-1.8.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-1.7.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb
datadog_api_client-1.6.0 examples/v1/synthetics/CreateSyntheticsAPITest_2472747642.rb