Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-04 19:22:31.282078",
"spec_repo_commit": "fd06108d"
"regenerated": "2024-04-05 17:05:05.529697",
"spec_repo_commit": "9b7c8967"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-04 19:22:31.300867",
"spec_repo_commit": "fd06108d"
"regenerated": "2024-04-05 17:05:05.547209",
"spec_repo_commit": "9b7c8967"
}
}
}
35 changes: 35 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15871,6 +15871,11 @@ components:
maximum: 65535
minimum: 1
type: integer
files:
description: Files to be used as part of the request in the test.
items:
$ref: '#/components/schemas/SyntheticsTestRequestBodyFile'
type: array
follow_redirects:
description: Specifies whether or not the request follows redirects.
type: boolean
Expand Down Expand Up @@ -15937,6 +15942,32 @@ components:
example: https://example.com
type: string
type: object
SyntheticsTestRequestBodyFile:
description: Object describing a file to be used as part of the request in the
test.
properties:
bucketKey:
description: Bucket key of the file.
type: string
content:
description: Content of the file.
maxLength: 3145728
type: string
name:
description: Name of the file.
maxLength: 1500
type: string
size:
description: Size of the file.
format: int64
maximum: 3145728
minimum: 1
type: integer
type:
description: Type of the file.
maxLength: 1500
type: string
type: object
SyntheticsTestRequestBodyType:
description: Type of the request body.
enum:
Expand All @@ -15946,6 +15977,8 @@ components:
- text/html
- application/x-www-form-urlencoded
- graphql
- application/octet-stream
- multipart/form-data
example: text/plain
type: string
x-enum-varnames:
Expand All @@ -15955,6 +15988,8 @@ components:
- TEXT_HTML
- APPLICATION_X_WWW_FORM_URLENCODED
- GRAPHQL
- APPLICATION_OCTET_STREAM
- MULTIPART_FORM_DATA
SyntheticsTestRequestCertificate:
description: Client certificate to use when performing the test request.
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-04-02T15:35:39.188Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

118 changes: 118 additions & 0 deletions examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Create an API test with a file payload 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,
property: "{{ PROPERTY }}",
target: "text/html",
type: DatadogAPIClient::V1::SyntheticsAssertionType::HEADER,
}),
DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::LESS_THAN,
target: 2000,
type: DatadogAPIClient::V1::SyntheticsAssertionType::RESPONSE_TIME,
timings_scope: DatadogAPIClient::V1::SyntheticsAssertionTimingsScope::WITHOUT_DNS,
}),
DatadogAPIClient::V1::SyntheticsAssertionJSONPathTarget.new({
operator: DatadogAPIClient::V1::SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
target: DatadogAPIClient::V1::SyntheticsAssertionJSONPathTargetTarget.new({
json_path: "topKey",
operator: "isNot",
target_value: "0",
}),
type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY,
}),
DatadogAPIClient::V1::SyntheticsAssertionXPathTarget.new({
operator: DatadogAPIClient::V1::SyntheticsAssertionXPathOperator::VALIDATES_X_PATH,
target: DatadogAPIClient::V1::SyntheticsAssertionXPathTargetTarget.new({
x_path: "target-xpath",
target_value: "0",
operator: "contains",
}),
type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY,
}),
],
config_variables: [
DatadogAPIClient::V1::SyntheticsConfigVariable.new({
example: "content-type",
name: "PROPERTY",
pattern: "content-type",
type: DatadogAPIClient::V1::SyntheticsConfigVariableType::TEXT,
}),
],
request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
certificate: DatadogAPIClient::V1::SyntheticsTestRequestCertificate.new({
cert: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({
content: "cert-content",
filename: "cert-filename",
updated_at: "2020-10-16T09:23:24.857Z",
}),
key: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({
content: "key-content",
filename: "key-filename",
updated_at: "2020-10-16T09:23:24.857Z",
}),
}),
headers: {
unique: "examplesynthetic",
},
method: "GET",
timeout: 10,
url: "https://datadoghq.com",
proxy: DatadogAPIClient::V1::SyntheticsTestRequestProxy.new({
url: "https://datadoghq.com",
headers: {},
}),
body_type: DatadogAPIClient::V1::SyntheticsTestRequestBodyType::APPLICATION_OCTET_STREAM,
files: [
DatadogAPIClient::V1::SyntheticsTestRequestBodyFile.new({
name: "file name",
content: "file content",
type: "file type",
}),
],
basic_auth: DatadogAPIClient::V1::SyntheticsBasicAuthOauthClient.new({
access_token_url: "https://datadog-token.com",
audience: "audience",
client_id: "client-id",
client_secret: "client-secret",
resource: "resource",
scope: "yoyo",
token_api_authentication: DatadogAPIClient::V1::SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
type: DatadogAPIClient::V1::SyntheticsBasicAuthOauthClientType::OAUTH_CLIENT,
}),
persist_cookies: true,
}),
}),
locations: [
"aws:us-east-2",
],
message: "BDD test payload: synthetics_api_http_test_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,
http_version: DatadogAPIClient::V1::SyntheticsTestOptionsHTTPVersion::HTTP2,
}),
subtype: DatadogAPIClient::V1::SyntheticsTestDetailsSubType::HTTP,
tags: [
"testing:api",
],
type: DatadogAPIClient::V1::SyntheticsAPITestType::API,
})
p api_instance.create_synthetics_api_test(body)
3 changes: 3 additions & 0 deletions examples/v1/synthetics/UpdateBrowserTest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
key: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({}),
}),
certificate_domains: [],
files: [
DatadogAPIClient::V1::SyntheticsTestRequestBodyFile.new({}),
],
http_version: DatadogAPIClient::V1::SyntheticsTestOptionsHTTPVersion::HTTP1,
proxy: DatadogAPIClient::V1::SyntheticsTestRequestProxy.new({
url: "https://example.com",
Expand Down
Loading