Sha256: 7a0ccd86305b67db9cff2cc4a037eff3980866b37563b6d5d8ee29825ca693e4

Contents?: true

Size: 1.18 KB

Versions: 3

Compression:

Stored size: 1.18 KB

Contents

# Create an API SSL test 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_IN_MORE_DAYS_THAN,
        target: 10,
        type: DatadogAPIClient::V1::SyntheticsAssertionType::CERTIFICATE,
      }),
    ],
    request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
      host: "datadoghq.com",
      port: "{{ DATADOG_PORT }}",
    }),
  }),
  locations: [
    "aws:us-east-2",
  ],
  message: "BDD test payload: synthetics_api_ssl_test_payload.json",
  name: "Example-Synthetic",
  options: DatadogAPIClient::V1::SyntheticsTestOptions.new({
    accept_self_signed: true,
    check_certificate_revocation: true,
    tick_every: 60,
  }),
  subtype: DatadogAPIClient::V1::SyntheticsTestDetailsSubType::SSL,
  tags: [
    "testing:api",
  ],
  type: DatadogAPIClient::V1::SyntheticsAPITestType::API,
})
p api_instance.create_synthetics_api_test(body)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
datadog_api_client-2.29.1 examples/v1/synthetics/CreateSyntheticsAPITest_1072503741.rb
datadog_api_client-2.28.1 examples/v1/synthetics/CreateSyntheticsAPITest_1072503741.rb
datadog_api_client-2.27.1 examples/v1/synthetics/CreateSyntheticsAPITest_1072503741.rb