Skip to content

Commit 3390fcb

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit add9414 of spec repo
1 parent df8b4ad commit 3390fcb

5 files changed

Lines changed: 112 additions & 2 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,14 @@ components:
296296
schema:
297297
format: int64
298298
type: integer
299+
CloudInventorySyncConfigID:
300+
description: Unique identifier of the Storage Management configuration.
301+
example: abc123
302+
in: path
303+
name: id
304+
required: true
305+
schema:
306+
type: string
299307
CloudWorkloadSecurityAgentRuleID:
300308
description: "The ID of the Agent rule"
301309
example: 3b5-v82-ns6
@@ -107666,6 +107674,33 @@ paths:
107666107674
operator: OR
107667107675
permissions:
107668107676
- aws_configurations_manage
107677+
/api/v2/cloudinventoryservice/syncconfigs/{id}:
107678+
delete:
107679+
description: |-
107680+
Delete a Storage Management configuration by its unique identifier. This stops inventory file synchronization for the associated cloud account.
107681+
operationId: DeleteSyncConfig
107682+
parameters:
107683+
- $ref: "#/components/parameters/CloudInventorySyncConfigID"
107684+
responses:
107685+
"204":
107686+
description: No Content
107687+
"403":
107688+
$ref: "#/components/responses/ForbiddenResponse"
107689+
"404":
107690+
content:
107691+
application/json:
107692+
schema:
107693+
$ref: "#/components/schemas/JSONAPIErrorResponse"
107694+
description: Not Found
107695+
"429":
107696+
$ref: "#/components/responses/TooManyRequestsResponse"
107697+
summary: Delete a Storage Management configuration
107698+
tags:
107699+
- Storage Management
107700+
"x-permission":
107701+
operator: OR
107702+
permissions:
107703+
- aws_configurations_manage
107669107704
/api/v2/code-coverage/branch/summary:
107670107705
post:
107671107706
description: |-
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Delete a Storage Management configuration returns "No Content" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.storage_management_api import StorageManagementApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = StorageManagementApi(api_client)
11+
api_instance.delete_sync_config(
12+
id="id",
13+
)

src/datadog_api_client/v2/api/storage_management_api.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,29 @@ def __init__(self, api_client=None):
2121
api_client = ApiClient(Configuration())
2222
self.api_client = api_client
2323

24+
self._delete_sync_config_endpoint = _Endpoint(
25+
settings={
26+
"response_type": None,
27+
"auth": ["apiKeyAuth", "appKeyAuth"],
28+
"endpoint_path": "/api/v2/cloudinventoryservice/syncconfigs/{id}",
29+
"operation_id": "delete_sync_config",
30+
"http_method": "DELETE",
31+
"version": "v2",
32+
},
33+
params_map={
34+
"id": {
35+
"required": True,
36+
"openapi_types": (str,),
37+
"attribute": "id",
38+
"location": "path",
39+
},
40+
},
41+
headers_map={
42+
"accept": ["*/*"],
43+
},
44+
api_client=api_client,
45+
)
46+
2447
self._upsert_sync_config_endpoint = _Endpoint(
2548
settings={
2649
"response_type": (CloudInventorySyncConfigResponse,),
@@ -41,6 +64,23 @@ def __init__(self, api_client=None):
4164
api_client=api_client,
4265
)
4366

67+
def delete_sync_config(
68+
self,
69+
id: str,
70+
) -> None:
71+
"""Delete a Storage Management configuration.
72+
73+
Delete a Storage Management configuration by its unique identifier. This stops inventory file synchronization for the associated cloud account.
74+
75+
:param id: Unique identifier of the Storage Management configuration.
76+
:type id: str
77+
:rtype: None
78+
"""
79+
kwargs: Dict[str, Any] = {}
80+
kwargs["id"] = id
81+
82+
return self._delete_sync_config_endpoint.call_with_http_info(**kwargs)
83+
4484
def upsert_sync_config(
4585
self,
4686
body: UpsertCloudInventorySyncConfigRequest,

tests/v2/features/storage_management.feature

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,31 @@ Feature: Storage Management
88
Given a valid "apiKeyAuth" key in the system
99
And a valid "appKeyAuth" key in the system
1010
And an instance of "StorageManagement" API
11-
And new "UpsertSyncConfig" request
12-
And body with value {"data": {"attributes": {"aws": {"aws_account_id": "123456789012", "destination_bucket_name": "my-inventory-bucket", "destination_bucket_region": "us-east-1", "destination_prefix": "logs/"}, "azure": {"client_id": "11111111-1111-1111-1111-111111111111", "container": "inventory-container", "resource_group": "my-resource-group", "storage_account": "mystorageaccount", "subscription_id": "33333333-3333-3333-3333-333333333333", "tenant_id": "22222222-2222-2222-2222-222222222222"}, "gcp": {"destination_bucket_name": "my-inventory-reports", "project_id": "my-gcp-project", "service_account_email": "reader@my-gcp-project.iam.gserviceaccount.com", "source_bucket_name": "my-monitored-bucket"}}, "id": "aws", "type": "cloud_provider"}}
11+
12+
@generated @skip @team:DataDog/storage-management
13+
Scenario: Delete a Storage Management configuration returns "No Content" response
14+
Given new "DeleteSyncConfig" request
15+
And request contains "id" parameter from "REPLACE.ME"
16+
When the request is sent
17+
Then the response status is 204 No Content
18+
19+
@generated @skip @team:DataDog/storage-management
20+
Scenario: Delete a Storage Management configuration returns "Not Found" response
21+
Given new "DeleteSyncConfig" request
22+
And request contains "id" parameter from "REPLACE.ME"
23+
When the request is sent
24+
Then the response status is 404 Not Found
1325

1426
@generated @skip @team:DataDog/storage-management
1527
Scenario: Enable Storage Management for a bucket returns "Bad Request" response
28+
Given new "UpsertSyncConfig" request
29+
And body with value {"data": {"attributes": {"aws": {"aws_account_id": "123456789012", "destination_bucket_name": "my-inventory-bucket", "destination_bucket_region": "us-east-1", "destination_prefix": "logs/"}, "azure": {"client_id": "11111111-1111-1111-1111-111111111111", "container": "inventory-container", "resource_group": "my-resource-group", "storage_account": "mystorageaccount", "subscription_id": "33333333-3333-3333-3333-333333333333", "tenant_id": "22222222-2222-2222-2222-222222222222"}, "gcp": {"destination_bucket_name": "my-inventory-reports", "project_id": "my-gcp-project", "service_account_email": "reader@my-gcp-project.iam.gserviceaccount.com", "source_bucket_name": "my-monitored-bucket"}}, "id": "aws", "type": "cloud_provider"}}
1630
When the request is sent
1731
Then the response status is 400 Bad Request
1832

1933
@generated @skip @team:DataDog/storage-management
2034
Scenario: Enable Storage Management for a bucket returns "OK" response
35+
Given new "UpsertSyncConfig" request
36+
And body with value {"data": {"attributes": {"aws": {"aws_account_id": "123456789012", "destination_bucket_name": "my-inventory-bucket", "destination_bucket_region": "us-east-1", "destination_prefix": "logs/"}, "azure": {"client_id": "11111111-1111-1111-1111-111111111111", "container": "inventory-container", "resource_group": "my-resource-group", "storage_account": "mystorageaccount", "subscription_id": "33333333-3333-3333-3333-333333333333", "tenant_id": "22222222-2222-2222-2222-222222222222"}, "gcp": {"destination_bucket_name": "my-inventory-reports", "project_id": "my-gcp-project", "service_account_email": "reader@my-gcp-project.iam.gserviceaccount.com", "source_bucket_name": "my-monitored-bucket"}}, "id": "aws", "type": "cloud_provider"}}
2137
When the request is sent
2238
Then the response status is 200 OK

tests/v2/features/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,6 +1561,12 @@
15611561
"type": "idempotent"
15621562
}
15631563
},
1564+
"DeleteSyncConfig": {
1565+
"tag": "Storage Management",
1566+
"undo": {
1567+
"type": "idempotent"
1568+
}
1569+
},
15641570
"GetCodeCoverageBranchSummary": {
15651571
"tag": "Code Coverage",
15661572
"undo": {

0 commit comments

Comments
 (0)