Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trigger synthetics tests endpoint #642

Merged
merged 2 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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.5.1.dev2",
"regenerated": "2021-11-12 17:10:50.325911",
"spec_repo_commit": "a5c075c"
"regenerated": "2021-11-12 17:41:16.183755",
"spec_repo_commit": "2b850b7"
},
"v2": {
"apigentools_version": "1.5.1.dev2",
"regenerated": "2021-11-12 17:10:50.917456",
"spec_repo_commit": "a5c075c"
"regenerated": "2021-11-12 17:41:16.779177",
"spec_repo_commit": "2b850b7"
}
}
}
53 changes: 53 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11075,6 +11075,17 @@ components:
format: double
type: number
type: object
SyntheticsTriggerBody:
description: Object describing the synthetics tests to trigger.
properties:
tests:
description: Individual synthetics test.
items:
$ref: '#/components/schemas/SyntheticsTriggerTest'
type: array
required:
- tests
type: object
SyntheticsTriggerCITestLocation:
description: Synthetics location.
properties:
Expand Down Expand Up @@ -11125,6 +11136,18 @@ components:
type: string
type: array
type: object
SyntheticsTriggerTest:
description: Test configuration for Synthetics
properties:
metadata:
$ref: '#/components/schemas/SyntheticsCIBatchMetadata'
public_id:
description: The public ID of the Synthetics test to trigger.
example: aaa-aaa-aaa
type: string
required:
- public_id
type: object
SyntheticsUpdateTestPauseStatusPayload:
description: Object to start or pause an existing Synthetic test.
properties:
Expand Down Expand Up @@ -22683,6 +22706,36 @@ paths:
x-menu-order: 14
x-undo:
type: idempotent
/api/v1/synthetics/tests/trigger:
post:
description: Trigger a set of Synthetics tests.
operationId: TriggerTests
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsTriggerBody'
description: The identifiers of the tests to trigger.
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsTriggerCITestsResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
summary: Trigger some Synthetics tests
tags:
- Synthetics
x-codegen-request-body-name: body
x-undo:
type: safe
/api/v1/synthetics/tests/trigger/ci:
post:
description: Trigger a set of Synthetics tests for continuous integration.
Expand Down
3 changes: 3 additions & 0 deletions docs/v1/README.md

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

85 changes: 85 additions & 0 deletions docs/v1/SyntheticsApi.md

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

12 changes: 12 additions & 0 deletions docs/v1/SyntheticsTriggerBody.md

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

13 changes: 13 additions & 0 deletions docs/v1/SyntheticsTriggerTest.md

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

20 changes: 20 additions & 0 deletions examples/v1/synthetics/TriggerTests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Trigger some Synthetics tests returns "OK" response
"""

from os import environ
from datadog_api_client.v1 import ApiClient, Configuration
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
from datadog_api_client.v1.model.synthetics_trigger_body import SyntheticsTriggerBody
from datadog_api_client.v1.model.synthetics_trigger_test import SyntheticsTriggerTest

# there is a valid "synthetics_api_test" in the system
SYNTHETICS_API_TEST_PUBLIC_ID = environ["SYNTHETICS_API_TEST_PUBLIC_ID"]

body = SyntheticsTriggerBody(tests=[SyntheticsTriggerTest(public_id=SYNTHETICS_API_TEST_PUBLIC_ID)])

with ApiClient(Configuration()) as api_client:
api_instance = SyntheticsApi(api_client)
response = api_instance.trigger_tests(body=body)

print(response)
80 changes: 80 additions & 0 deletions src/datadog_api_client/v1/api/synthetics_api.py

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

Loading