-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit cce07864 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Feb 15, 2023
1 parent
4e71319
commit 836c70c
Showing
30 changed files
with
1,129 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
examples/v2/restriction-policies/DeleteRestrictionPolicy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
Delete a restriction policy returns "No Content" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.restriction_policies_api import RestrictionPoliciesApi | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = RestrictionPoliciesApi(api_client) | ||
api_instance.delete_restriction_policy( | ||
resource_id="dashboard:abc-def-ghi", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Get a restriction policy returns "OK" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.restriction_policies_api import RestrictionPoliciesApi | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = RestrictionPoliciesApi(api_client) | ||
response = api_instance.get_restriction_policy( | ||
resource_id="dashboard:abc-def-ghi", | ||
) | ||
|
||
print(response) |
39 changes: 39 additions & 0 deletions
39
examples/v2/restriction-policies/UpdateRestrictionPolicy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
""" | ||
Update a restriction policy returns "OK" response | ||
""" | ||
|
||
from os import environ | ||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.restriction_policies_api import RestrictionPoliciesApi | ||
from datadog_api_client.v2.model.restriction_policy import RestrictionPolicy | ||
from datadog_api_client.v2.model.restriction_policy_attributes import RestrictionPolicyAttributes | ||
from datadog_api_client.v2.model.restriction_policy_binding import RestrictionPolicyBinding | ||
from datadog_api_client.v2.model.restriction_policy_type import RestrictionPolicyType | ||
from datadog_api_client.v2.model.restriction_policy_update_request import RestrictionPolicyUpdateRequest | ||
|
||
# there is a valid "user" in the system | ||
USER_DATA_RELATIONSHIPS_ORG_DATA_ID = environ["USER_DATA_RELATIONSHIPS_ORG_DATA_ID"] | ||
|
||
body = RestrictionPolicyUpdateRequest( | ||
data=RestrictionPolicy( | ||
id="dashboard:abc-def-ghi", | ||
type=RestrictionPolicyType.RESTRICTION_POLICY, | ||
attributes=RestrictionPolicyAttributes( | ||
bindings=[ | ||
RestrictionPolicyBinding( | ||
relation="editor", | ||
principals=[ | ||
"org:00000000-0000-beef-0000-000000000000", | ||
], | ||
), | ||
], | ||
), | ||
), | ||
) | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = RestrictionPoliciesApi(api_client) | ||
response = api_instance.update_restriction_policy(resource_id="dashboard:abc-def-ghi", body=body) | ||
|
||
print(response) |
Oops, something went wrong.