Skip to content

Document force_delete_dependencies for synthetics test deletion #2016

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

Merged
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-07-02 18:17:59.207116",
"spec_repo_commit": "464f0cec"
"regenerated": "2024-07-02 18:50:20.936980",
"spec_repo_commit": "fae9d797"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-02 18:17:59.224176",
"spec_repo_commit": "464f0cec"
"regenerated": "2024-07-02 18:50:20.953928",
"spec_repo_commit": "fae9d797"
}
}
}
7 changes: 7 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14944,6 +14944,13 @@ components:

to delete.'
properties:
force_delete_dependencies:
description: 'Delete the Synthetic test even if it''s referenced by other
resources

(for example, SLOs and composite monitors).'
example: false
type: boolean
public_ids:
description: An array of Synthetic test IDs you want to delete.
example: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,34 @@ class SyntheticsDeleteTestsPayload(ModelNormal):
@cached_property
def openapi_types(_):
return {
"force_delete_dependencies": (bool,),
"public_ids": ([str],),
}

attribute_map = {
"force_delete_dependencies": "force_delete_dependencies",
"public_ids": "public_ids",
}

def __init__(self_, public_ids: Union[List[str], UnsetType] = unset, **kwargs):
def __init__(
self_,
force_delete_dependencies: Union[bool, UnsetType] = unset,
public_ids: Union[List[str], UnsetType] = unset,
**kwargs,
):
"""
A JSON list of the ID or IDs of the Synthetic tests that you want
to delete.

:param force_delete_dependencies: Delete the Synthetic test even if it's referenced by other resources
(for example, SLOs and composite monitors).
:type force_delete_dependencies: bool, optional

:param public_ids: An array of Synthetic test IDs you want to delete.
:type public_ids: [str], optional
"""
if force_delete_dependencies is not unset:
kwargs["force_delete_dependencies"] = force_delete_dependencies
if public_ids is not unset:
kwargs["public_ids"] = public_ids
super().__init__(kwargs)
4 changes: 2 additions & 2 deletions tests/v1/features/synthetics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,14 @@ Feature: Synthetics
@generated @skip @team:DataDog/synthetics-ct
Scenario: Delete tests returns "- JSON format is wrong" response
Given new "DeleteTests" request
And body with value {"public_ids": []}
And body with value {"force_delete_dependencies": false, "public_ids": []}
When the request is sent
Then the response status is 400 - JSON format is wrong

@generated @skip @team:DataDog/synthetics-ct
Scenario: Delete tests returns "- Tests to be deleted can't be found" response
Given new "DeleteTests" request
And body with value {"public_ids": []}
And body with value {"force_delete_dependencies": false, "public_ids": []}
When the request is sent
Then the response status is 404 - Tests to be deleted can't be found

Expand Down
Loading