-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document new
resource_collection
and `is_security_command_center_en…
…abled` fields in GCP APIs (#1804) Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
- Loading branch information
1 parent
12e5833
commit e63972a
Showing
24 changed files
with
450 additions
and
28 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
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
28 changes: 28 additions & 0 deletions
28
examples/v2/gcp-integration/CreateGCPSTSAccount_130557025.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,28 @@ | ||
""" | ||
Create a new entry for your service account with resource collection enabled returns "OK" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.gcp_integration_api import GCPIntegrationApi | ||
from datadog_api_client.v2.model.gcp_service_account_type import GCPServiceAccountType | ||
from datadog_api_client.v2.model.gcpsts_service_account_attributes import GCPSTSServiceAccountAttributes | ||
from datadog_api_client.v2.model.gcpsts_service_account_create_request import GCPSTSServiceAccountCreateRequest | ||
from datadog_api_client.v2.model.gcpsts_service_account_data import GCPSTSServiceAccountData | ||
|
||
body = GCPSTSServiceAccountCreateRequest( | ||
data=GCPSTSServiceAccountData( | ||
attributes=GCPSTSServiceAccountAttributes( | ||
resource_collection_enabled=True, | ||
client_email="[email protected]", | ||
host_filters=[], | ||
), | ||
type=GCPServiceAccountType.GCP_SERVICE_ACCOUNT, | ||
), | ||
) | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = GCPIntegrationApi(api_client) | ||
response = api_instance.create_gcpsts_account(body=body) | ||
|
||
print(response) |
28 changes: 28 additions & 0 deletions
28
examples/v2/gcp-integration/CreateGCPSTSAccount_2597004741.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,28 @@ | ||
""" | ||
Create a new entry for your service account with security command center enabled returns "OK" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.gcp_integration_api import GCPIntegrationApi | ||
from datadog_api_client.v2.model.gcp_service_account_type import GCPServiceAccountType | ||
from datadog_api_client.v2.model.gcpsts_service_account_attributes import GCPSTSServiceAccountAttributes | ||
from datadog_api_client.v2.model.gcpsts_service_account_create_request import GCPSTSServiceAccountCreateRequest | ||
from datadog_api_client.v2.model.gcpsts_service_account_data import GCPSTSServiceAccountData | ||
|
||
body = GCPSTSServiceAccountCreateRequest( | ||
data=GCPSTSServiceAccountData( | ||
attributes=GCPSTSServiceAccountAttributes( | ||
is_security_command_center_enabled=True, | ||
client_email="[email protected]", | ||
host_filters=[], | ||
), | ||
type=GCPServiceAccountType.GCP_SERVICE_ACCOUNT, | ||
), | ||
) | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = GCPIntegrationApi(api_client) | ||
response = api_instance.create_gcpsts_account(body=body) | ||
|
||
print(response) |
28 changes: 28 additions & 0 deletions
28
examples/v2/gcp-integration/CreateGCPSTSAccount_4235664992.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,28 @@ | ||
""" | ||
Create a new entry for your service account with cspm enabled returns "OK" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.gcp_integration_api import GCPIntegrationApi | ||
from datadog_api_client.v2.model.gcp_service_account_type import GCPServiceAccountType | ||
from datadog_api_client.v2.model.gcpsts_service_account_attributes import GCPSTSServiceAccountAttributes | ||
from datadog_api_client.v2.model.gcpsts_service_account_create_request import GCPSTSServiceAccountCreateRequest | ||
from datadog_api_client.v2.model.gcpsts_service_account_data import GCPSTSServiceAccountData | ||
|
||
body = GCPSTSServiceAccountCreateRequest( | ||
data=GCPSTSServiceAccountData( | ||
attributes=GCPSTSServiceAccountAttributes( | ||
is_cspm_enabled=True, | ||
client_email="[email protected]", | ||
host_filters=[], | ||
), | ||
type=GCPServiceAccountType.GCP_SERVICE_ACCOUNT, | ||
), | ||
) | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = GCPIntegrationApi(api_client) | ||
response = api_instance.create_gcpsts_account(body=body) | ||
|
||
print(response) |
32 changes: 32 additions & 0 deletions
32
examples/v2/gcp-integration/UpdateGCPSTSAccount_3205636354.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,32 @@ | ||
""" | ||
Update STS Service Account returns "OK" response with enable resource collection turned on | ||
""" | ||
|
||
from os import environ | ||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.gcp_integration_api import GCPIntegrationApi | ||
from datadog_api_client.v2.model.gcp_service_account_type import GCPServiceAccountType | ||
from datadog_api_client.v2.model.gcpsts_service_account_attributes import GCPSTSServiceAccountAttributes | ||
from datadog_api_client.v2.model.gcpsts_service_account_update_request import GCPSTSServiceAccountUpdateRequest | ||
from datadog_api_client.v2.model.gcpsts_service_account_update_request_data import GCPSTSServiceAccountUpdateRequestData | ||
|
||
# there is a valid "gcp_sts_account" in the system | ||
GCP_STS_ACCOUNT_DATA_ID = environ["GCP_STS_ACCOUNT_DATA_ID"] | ||
|
||
body = GCPSTSServiceAccountUpdateRequest( | ||
data=GCPSTSServiceAccountUpdateRequestData( | ||
attributes=GCPSTSServiceAccountAttributes( | ||
client_email="[email protected]", | ||
resource_collection_enabled=True, | ||
), | ||
id=GCP_STS_ACCOUNT_DATA_ID, | ||
type=GCPServiceAccountType.GCP_SERVICE_ACCOUNT, | ||
), | ||
) | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = GCPIntegrationApi(api_client) | ||
response = api_instance.update_gcpsts_account(account_id=GCP_STS_ACCOUNT_DATA_ID, body=body) | ||
|
||
print(response) |
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
Oops, something went wrong.