Skip to content

Commit e1e5d71

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 03fe362e of spec repo
1 parent 2d4253c commit e1e5d71

9 files changed

+107
-12
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2023-09-28 19:18:56.822567",
8-
"spec_repo_commit": "4b2bab38"
7+
"regenerated": "2023-09-29 12:47:09.375463",
8+
"spec_repo_commit": "03fe362e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-09-28 19:18:56.909324",
13-
"spec_repo_commit": "4b2bab38"
12+
"regenerated": "2023-09-29 12:47:09.388850",
13+
"spec_repo_commit": "03fe362e"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5399,6 +5399,13 @@ components:
53995399
GCPSTSServiceAccountAttributes:
54005400
description: Attributes associated with your service account.
54015401
properties:
5402+
account_tags:
5403+
description: Tags to be associated with GCP metrics and service checks from
5404+
your account.
5405+
items:
5406+
description: Account Level Tag
5407+
type: string
5408+
type: array
54025409
automute:
54035410
description: Silence monitors for expected GCE instance shutdowns.
54045411
type: boolean
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""
2+
Create a new entry for your service account with account_tags returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.gcp_integration_api import GCPIntegrationApi
7+
from datadog_api_client.v2.model.gcp_service_account_type import GCPServiceAccountType
8+
from datadog_api_client.v2.model.gcpsts_service_account_attributes import GCPSTSServiceAccountAttributes
9+
from datadog_api_client.v2.model.gcpsts_service_account_create_request import GCPSTSServiceAccountCreateRequest
10+
from datadog_api_client.v2.model.gcpsts_service_account_data import GCPSTSServiceAccountData
11+
12+
body = GCPSTSServiceAccountCreateRequest(
13+
data=GCPSTSServiceAccountData(
14+
attributes=GCPSTSServiceAccountAttributes(
15+
account_tags=[
16+
"lorem",
17+
"ipsum",
18+
],
19+
client_email="[email protected]",
20+
host_filters=[],
21+
),
22+
type=GCPServiceAccountType.GCP_SERVICE_ACCOUNT,
23+
),
24+
)
25+
26+
configuration = Configuration()
27+
with ApiClient(configuration) as api_client:
28+
api_instance = GCPIntegrationApi(api_client)
29+
response = api_instance.create_gcpsts_account(body=body)
30+
31+
print(response)

src/datadog_api_client/v2/model/gcpsts_service_account_attributes.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ class GCPSTSServiceAccountAttributes(ModelNormal):
1717
@cached_property
1818
def openapi_types(_):
1919
return {
20+
"account_tags": ([str],),
2021
"automute": (bool,),
2122
"client_email": (str,),
2223
"host_filters": ([str],),
2324
"is_cspm_enabled": (bool,),
2425
}
2526

2627
attribute_map = {
28+
"account_tags": "account_tags",
2729
"automute": "automute",
2830
"client_email": "client_email",
2931
"host_filters": "host_filters",
@@ -32,6 +34,7 @@ def openapi_types(_):
3234

3335
def __init__(
3436
self_,
37+
account_tags: Union[List[str], UnsetType] = unset,
3538
automute: Union[bool, UnsetType] = unset,
3639
client_email: Union[str, UnsetType] = unset,
3740
host_filters: Union[List[str], UnsetType] = unset,
@@ -41,6 +44,9 @@ def __init__(
4144
"""
4245
Attributes associated with your service account.
4346
47+
:param account_tags: Tags to be associated with GCP metrics and service checks from your account.
48+
:type account_tags: [str], optional
49+
4450
:param automute: Silence monitors for expected GCE instance shutdowns.
4551
:type automute: bool, optional
4652
@@ -53,6 +59,8 @@ def __init__(
5359
:param is_cspm_enabled: When enabled, Datadog performs configuration checks across your Google Cloud environment by continuously scanning every resource.
5460
:type is_cspm_enabled: bool, optional
5561
"""
62+
if account_tags is not unset:
63+
kwargs["account_tags"] = account_tags
5664
if automute is not unset:
5765
kwargs["automute"] = automute
5866
if client_email is not unset:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-06-16T14:05:25.134Z
1+
2023-09-29T12:39:55.710Z

tests/v2/cassettes/test_scenarios/test_create_a_new_entry_for_your_service_account_returns_ok_response.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"client_email":"47cdd79b4a719ac2@test-project.iam.gserviceaccount.com","host_filters":[]},"type":"gcp_service_account"}}'
3+
body: '{"data":{"attributes":{"client_email":"80e3f00106389e6e@test-project.iam.gserviceaccount.com","host_filters":[]},"type":"gcp_service_account"}}'
44
headers:
55
accept:
66
- application/json
@@ -10,7 +10,7 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/integration/gcp/accounts
1111
response:
1212
body:
13-
string: '{"data":{"type":"gcp_service_account","attributes":{"host_filters":[],"client_email":"47cdd79b4a719ac2@test-project.iam.gserviceaccount.com","is_cspm_enabled":false,"automute":false},"id":"3aa3ec77-9646-4f6a-bcd0-01e5124e2ad1"}}
13+
string: '{"data":{"type":"gcp_service_account","id":"d6c68645-2b52-43e9-838c-9b7fdb809a8d","attributes":{"host_filters":[],"account_tags":[],"client_email":"80e3f00106389e6e@test-project.iam.gserviceaccount.com","is_cspm_enabled":false,"automute":false}}}
1414
1515
'
1616
headers:
@@ -25,7 +25,7 @@ interactions:
2525
accept:
2626
- '*/*'
2727
method: DELETE
28-
uri: https://api.datadoghq.com/api/v2/integration/gcp/accounts/3aa3ec77-9646-4f6a-bcd0-01e5124e2ad1
28+
uri: https://api.datadoghq.com/api/v2/integration/gcp/accounts/d6c68645-2b52-43e9-838c-9b7fdb809a8d
2929
response:
3030
body:
3131
string: ''
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-09-27T14:45:59.771Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
interactions:
2+
- request:
3+
body: '{"data":{"attributes":{"account_tags":["lorem","ipsum"],"client_email":"[email protected]","host_filters":[]},"type":"gcp_service_account"}}'
4+
headers:
5+
accept:
6+
- application/json
7+
content-type:
8+
- application/json
9+
method: POST
10+
uri: https://api.datadoghq.com/api/v2/integration/gcp/accounts
11+
response:
12+
body:
13+
string: '{"data":{"type":"gcp_service_account","attributes":{"host_filters":[],"client_email":"[email protected]","is_cspm_enabled":false,"automute":false,"account_tags":["lorem","ipsum"]},"id":"1cdedba8-a0a3-4036-82b0-ad8088dd0c02"}}
14+
15+
'
16+
headers:
17+
content-type:
18+
- application/json
19+
status:
20+
code: 201
21+
message: Created
22+
- request:
23+
body: null
24+
headers:
25+
accept:
26+
- '*/*'
27+
method: DELETE
28+
uri: https://api.datadoghq.com/api/v2/integration/gcp/accounts/1cdedba8-a0a3-4036-82b0-ad8088dd0c02
29+
response:
30+
body:
31+
string: ''
32+
headers:
33+
content-type:
34+
- text/html; charset=utf-8
35+
status:
36+
code: 204
37+
message: No Content
38+
version: 1

tests/v2/features/gcp_integration.feature

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ Feature: GCP Integration
3434
@generated @skip @team:DataDog/gcp-integrations
3535
Scenario: Create a new entry for your service account returns "Bad Request" response
3636
Given new "CreateGCPSTSAccount" request
37-
And body with value {"data": {"attributes": {"client_email": "[email protected]", "host_filters": []}, "type": "gcp_service_account"}}
37+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "host_filters": []}, "type": "gcp_service_account"}}
3838
When the request is sent
3939
Then the response status is 400 Bad Request
4040

4141
@generated @skip @team:DataDog/gcp-integrations
4242
Scenario: Create a new entry for your service account returns "Conflict" response
4343
Given new "CreateGCPSTSAccount" request
44-
And body with value {"data": {"attributes": {"client_email": "[email protected]", "host_filters": []}, "type": "gcp_service_account"}}
44+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "host_filters": []}, "type": "gcp_service_account"}}
4545
When the request is sent
4646
Then the response status is 409 Conflict
4747

@@ -54,6 +54,16 @@ Feature: GCP Integration
5454
And the response "data.type" is equal to "gcp_service_account"
5555
And the response "data.attributes.client_email" is equal to "{{ unique_hash }}@test-project.iam.gserviceaccount.com"
5656

57+
@team:DataDog/gcp-integrations
58+
Scenario: Create a new entry for your service account with account_tags returns "OK" response
59+
Given new "CreateGCPSTSAccount" request
60+
And body with value {"data": {"attributes": {"account_tags": ["lorem", "ipsum"], "client_email": "{{ unique_hash }}@test-project.iam.gserviceaccount.com", "host_filters": []}, "type": "gcp_service_account"}}
61+
When the request is sent
62+
Then the response status is 201 OK
63+
And the response "data.type" is equal to "gcp_service_account"
64+
And the response "data.attributes.client_email" is equal to "{{ unique_hash }}@test-project.iam.gserviceaccount.com"
65+
And the response "data.attributes.account_tags" is equal to ["lorem", "ipsum"]
66+
5767
@generated @skip @team:DataDog/gcp-integrations
5868
Scenario: Delete an STS enabled GCP Account returns "Bad Request" response
5969
Given new "DeleteGCPSTSAccount" request
@@ -93,15 +103,15 @@ Feature: GCP Integration
93103
Scenario: Update STS Service Account returns "Bad Request" response
94104
Given new "UpdateGCPSTSAccount" request
95105
And request contains "account_id" parameter from "REPLACE.ME"
96-
And body with value {"data": {"attributes": {"client_email": "[email protected]", "host_filters": []}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
106+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "host_filters": []}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
97107
When the request is sent
98108
Then the response status is 400 Bad Request
99109

100110
@generated @skip @team:DataDog/gcp-integrations
101111
Scenario: Update STS Service Account returns "Not Found" response
102112
Given new "UpdateGCPSTSAccount" request
103113
And request contains "account_id" parameter from "REPLACE.ME"
104-
And body with value {"data": {"attributes": {"client_email": "[email protected]", "host_filters": []}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
114+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "host_filters": []}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
105115
When the request is sent
106116
Then the response status is 404 Not Found
107117

0 commit comments

Comments
 (0)