Skip to content

Commit 811dfc9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Clarify Storage Management for cloud inventory syncconfigs OpenAPI (#3285)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent f8e184e commit 811dfc9

16 files changed

Lines changed: 54 additions & 69 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12687,15 +12687,15 @@ components:
1268712687
- GCP
1268812688
- AZURE
1268912689
CloudInventoryCloudProviderRequestType:
12690-
description: JSON:API type for upsert sync configuration requests.
12690+
description: Always `cloud_provider`.
1269112691
enum:
1269212692
- cloud_provider
1269312693
example: cloud_provider
1269412694
type: string
1269512695
x-enum-varnames:
1269612696
- CLOUD_PROVIDER
1269712697
CloudInventorySyncConfigAWSRequestAttributes:
12698-
description: AWS settings for the customer bucket that stores inventory reports.
12698+
description: AWS settings for the S3 bucket Storage Management reads inventory reports from.
1269912699
properties:
1270012700
aws_account_id:
1270112701
description: AWS account ID that owns the inventory bucket.
@@ -12710,7 +12710,7 @@ components:
1271012710
example: us-east-1
1271112711
type: string
1271212712
destination_prefix:
12713-
description: Optional object key prefix for inventory files. Use `/` or omit for the entire bucket.
12713+
description: Object key prefix where inventory reports are written. Omit or set to `/` when reports are written at the bucket root.
1271412714
example: logs/
1271512715
type: string
1271612716
required:
@@ -12719,7 +12719,7 @@ components:
1271912719
- destination_bucket_region
1272012720
type: object
1272112721
CloudInventorySyncConfigAttributes:
12722-
description: Attributes for a cloud inventory sync configuration. Values beyond `id` may be omitted immediately after upsert.
12722+
description: Attributes for a Storage Management configuration. Fields other than `id` may be empty in the response immediately after a create or update; subsequent reads return the full configuration.
1272312723
properties:
1272412724
aws_account_id:
1272512725
description: AWS account ID for the inventory bucket.
@@ -12774,7 +12774,7 @@ components:
1277412774
example: reader@my-gcp-project.iam.gserviceaccount.com
1277512775
type: string
1277612776
prefix:
12777-
description: Object key prefix or `/` when the entire bucket is synced.
12777+
description: Object key prefix where inventory reports are written. Returns `/` when reports are written at the bucket root.
1277812778
example: logs/
1277912779
readOnly: true
1278012780
type: string
@@ -12855,28 +12855,28 @@ components:
1285512855
- service_account_email
1285612856
type: object
1285712857
CloudInventorySyncConfigResourceType:
12858-
description: JSON:API type for sync configuration resources.
12858+
description: Always `sync_configs`.
1285912859
enum:
1286012860
- sync_configs
1286112861
example: sync_configs
1286212862
type: string
1286312863
x-enum-varnames:
1286412864
- SYNC_CONFIGS
1286512865
CloudInventorySyncConfigResponse:
12866-
description: Response containing the upserted sync configuration. Additional read-only fields appear on list and get.
12866+
description: Storage Management configuration returned after a create or update. Additional read-only fields appear on list and get responses.
1286712867
properties:
1286812868
data:
1286912869
$ref: "#/components/schemas/CloudInventorySyncConfigResponseData"
1287012870
required:
1287112871
- data
1287212872
type: object
1287312873
CloudInventorySyncConfigResponseData:
12874-
description: JSON:API data object for a sync configuration.
12874+
description: Storage Management configuration data.
1287512875
properties:
1287612876
attributes:
1287712877
$ref: "#/components/schemas/CloudInventorySyncConfigAttributes"
1287812878
id:
12879-
description: Unique identifier for the recurring sync configuration.
12879+
description: Unique identifier for this Storage Management configuration.
1288012880
example: abc123
1288112881
type: string
1288212882
type:
@@ -81461,7 +81461,7 @@ components:
8146181461
type: object
8146281462
UpsertCloudInventorySyncConfigRequestAttributes:
8146381463
description: |-
81464-
Provider-specific configuration. Include the object that matches `data.id` (`aws`, `gcp`, or `azure`).
81464+
Settings for the cloud provider specified in `data.id`. Include only the matching provider object (`aws`, `gcp`, or `azure`).
8146581465
properties:
8146681466
aws:
8146781467
$ref: "#/components/schemas/CloudInventorySyncConfigAWSRequestAttributes"
@@ -81471,7 +81471,7 @@ components:
8147181471
$ref: "#/components/schemas/CloudInventorySyncConfigGCPRequestAttributes"
8147281472
type: object
8147381473
UpsertCloudInventorySyncConfigRequestData:
81474-
description: JSON:API data envelope for an upsert sync configuration request.
81474+
description: Storage Management configuration data for the create or update request.
8147581475
properties:
8147681476
attributes:
8147781477
$ref: "#/components/schemas/UpsertCloudInventorySyncConfigRequestAttributes"
@@ -94241,8 +94241,7 @@ paths:
9424194241
/api/v2/cloudinventoryservice/syncconfigs:
9424294242
put:
9424394243
description: |-
94244-
Create or update a cloud inventory sync configuration. Specify the cloud provider in `data.id`
94245-
and provider-specific settings under `data.attributes`. This endpoint uses an upsert model.
94244+
Enable Storage Management for an S3 bucket, GCS bucket, or Azure container by registering the destination that holds its inventory reports. Set `data.id` to the cloud provider (`aws`, `gcp`, or `azure`) and provide the matching settings under data.attributes. Calling this endpoint with the same provider replaces the existing configuration.
9424694245
operationId: UpsertSyncConfig
9424794246
requestBody:
9424894247
content:
@@ -94290,17 +94289,14 @@ paths:
9429094289
$ref: "#/components/responses/ForbiddenResponse"
9429194290
"429":
9429294291
$ref: "#/components/responses/TooManyRequestsResponse"
94293-
summary: Create or update a sync configuration
94292+
summary: Enable Storage Management for a bucket
9429494293
tags:
94295-
- Cloud Inventory Sync Configs
94294+
- Storage Management
9429694295
x-codegen-request-body-name: body
9429794296
"x-permission":
9429894297
operator: OR
9429994298
permissions:
9430094299
- aws_configurations_manage
94301-
x-unstable: |-
94302-
**Note**: This endpoint is in preview and is subject to change.
94303-
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
9430494300
/api/v2/code-coverage/branch/summary:
9430594301
post:
9430694302
description: |-
@@ -145968,9 +145964,6 @@ tags:
145968145964
- description: |-
145969145965
The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS, Azure, and Google Cloud. You can query your cost data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products) and the `cloud_cost` data source. For more information, see the [Cloud Cost Management documentation](https://docs.datadoghq.com/cloud_cost_management/).
145970145966
name: Cloud Cost Management
145971-
- description: |-
145972-
Configure cloud inventory file synchronization from your cloud storage to Datadog.
145973-
name: Cloud Inventory Sync Configs
145974145967
- description: |-
145975145968
The Cloud Network Monitoring API allows you to fetch aggregated connections and DNS traffic with their attributes. See the [Cloud Network Monitoring page](https://docs.datadoghq.com/network_monitoring/cloud_network_monitoring/) and [DNS Monitoring page](https://docs.datadoghq.com/network_monitoring/dns/) for more information.
145976145969
name: Cloud Network Monitoring
@@ -146354,6 +146347,9 @@ tags:
146354146347
name: Static Analysis
146355146348
- description: Manage your status pages and communicate service disruptions to stakeholders via Datadog's API. See the [Status Pages documentation](https://docs.datadoghq.com/incident_response/status_pages/) for more information.
146356146349
name: Status Pages
146350+
- description: |-
146351+
Enable Storage Management for S3 buckets, GCS buckets, and Azure containers. Each configuration registers the destination that holds inventory reports for the storage being monitored.
146352+
name: Storage Management
146357146353
- description: |-
146358146354
Synthetic tests use simulated requests and actions so you can monitor the availability and performance of systems and applications. Datadog supports the following types of synthetic tests:
146359146355
- [API tests](https://docs.datadoghq.com/synthetics/api_tests/)

examples/v2/cloud-inventory-sync-configs/UpsertSyncConfig.rb renamed to examples/v2/storage-management/UpsertSyncConfig.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
# Create or update a sync configuration returns "OK" response
1+
# Enable Storage Management for a bucket returns "OK" response
22

33
require "datadog_api_client"
4-
DatadogAPIClient.configure do |config|
5-
config.unstable_operations["v2.upsert_sync_config".to_sym] = true
6-
end
7-
api_instance = DatadogAPIClient::V2::CloudInventorySyncConfigsAPI.new
4+
api_instance = DatadogAPIClient::V2::StorageManagementAPI.new
85

96
body = DatadogAPIClient::V2::UpsertCloudInventorySyncConfigRequest.new({
107
data: DatadogAPIClient::V2::UpsertCloudInventorySyncConfigRequestData.new({
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
@endpoint(cloud-inventory-sync-configs) @endpoint(cloud-inventory-sync-configs-v2)
2-
Feature: Cloud Inventory Sync Configs
3-
Configure cloud inventory file synchronization from your cloud storage to
4-
Datadog.
1+
@endpoint(storage-management) @endpoint(storage-management-v2)
2+
Feature: Storage Management
3+
Enable Storage Management for S3 buckets, GCS buckets, and Azure
4+
containers. Each configuration registers the destination that holds
5+
inventory reports for the storage being monitored.
56

67
Background:
78
Given a valid "apiKeyAuth" key in the system
89
And a valid "appKeyAuth" key in the system
9-
And an instance of "CloudInventorySyncConfigs" API
10-
And operation "UpsertSyncConfig" enabled
10+
And an instance of "StorageManagement" API
1111
And new "UpsertSyncConfig" request
1212
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"}}
1313

1414
@generated @skip @team:DataDog/storage-management
15-
Scenario: Create or update a sync configuration returns "Bad Request" response
15+
Scenario: Enable Storage Management for a bucket returns "Bad Request" response
1616
When the request is sent
1717
Then the response status is 400 Bad Request
1818

1919
@generated @skip @team:DataDog/storage-management
20-
Scenario: Create or update a sync configuration returns "OK" response
20+
Scenario: Enable Storage Management for a bucket returns "OK" response
2121
When the request is sent
2222
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@
12361236
}
12371237
},
12381238
"UpsertSyncConfig": {
1239-
"tag": "Cloud Inventory Sync Configs",
1239+
"tag": "Storage Management",
12401240
"undo": {
12411241
"type": "idempotent"
12421242
}

lib/datadog_api_client/configuration.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ def initialize
290290
"v2.mute_security_findings": false,
291291
"v2.run_historical_job": false,
292292
"v2.search_security_monitoring_histsignals": false,
293-
"v2.upsert_sync_config": false,
294293
"v2.get_code_coverage_branch_summary": false,
295294
"v2.get_code_coverage_commit_summary": false,
296295
"v2.create_dashboard_secure_embed": false,

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6407,7 +6407,6 @@ def overrides
64076407
"v2.ci_visibility_tests_api" => "CIVisibilityTestsAPI",
64086408
"v2.cloud_authentication_api" => "CloudAuthenticationAPI",
64096409
"v2.cloud_cost_management_api" => "CloudCostManagementAPI",
6410-
"v2.cloud_inventory_sync_configs_api" => "CloudInventorySyncConfigsAPI",
64116410
"v2.cloud_network_monitoring_api" => "CloudNetworkMonitoringAPI",
64126411
"v2.cloudflare_integration_api" => "CloudflareIntegrationAPI",
64136412
"v2.code_coverage_api" => "CodeCoverageAPI",
@@ -6489,6 +6488,7 @@ def overrides
64896488
"v2.spans_metrics_api" => "SpansMetricsAPI",
64906489
"v2.static_analysis_api" => "StaticAnalysisAPI",
64916490
"v2.status_pages_api" => "StatusPagesAPI",
6491+
"v2.storage_management_api" => "StorageManagementAPI",
64926492
"v2.synthetics_api" => "SyntheticsAPI",
64936493
"v2.teams_api" => "TeamsAPI",
64946494
"v2.test_optimization_api" => "TestOptimizationAPI",

lib/datadog_api_client/v2/api/cloud_inventory_sync_configs_api.rb renamed to lib/datadog_api_client/v2/api/storage_management_api.rb

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,36 @@
1616
require 'cgi'
1717

1818
module DatadogAPIClient::V2
19-
class CloudInventorySyncConfigsAPI
19+
class StorageManagementAPI
2020
attr_accessor :api_client
2121

2222
def initialize(api_client = DatadogAPIClient::APIClient.default)
2323
@api_client = api_client
2424
end
2525

26-
# Create or update a sync configuration.
26+
# Enable Storage Management for a bucket.
2727
#
2828
# @see #upsert_sync_config_with_http_info
2929
def upsert_sync_config(body, opts = {})
3030
data, _status_code, _headers = upsert_sync_config_with_http_info(body, opts)
3131
data
3232
end
3333

34-
# Create or update a sync configuration.
34+
# Enable Storage Management for a bucket.
3535
#
36-
# Create or update a cloud inventory sync configuration. Specify the cloud provider in `data.id`
37-
# and provider-specific settings under `data.attributes`. This endpoint uses an upsert model.
36+
# Enable Storage Management for an S3 bucket, GCS bucket, or Azure container by registering the destination that holds its inventory reports. Set `data.id` to the cloud provider (`aws`, `gcp`, or `azure`) and provide the matching settings under data.attributes. Calling this endpoint with the same provider replaces the existing configuration.
3837
#
3938
# @param body [UpsertCloudInventorySyncConfigRequest]
4039
# @param opts [Hash] the optional parameters
4140
# @return [Array<(CloudInventorySyncConfigResponse, Integer, Hash)>] CloudInventorySyncConfigResponse data, response status code and response headers
4241
def upsert_sync_config_with_http_info(body, opts = {})
43-
unstable_enabled = @api_client.config.unstable_operations["v2.upsert_sync_config".to_sym]
44-
if unstable_enabled
45-
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.upsert_sync_config")
46-
else
47-
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.upsert_sync_config"))
48-
end
4942

5043
if @api_client.config.debugging
51-
@api_client.config.logger.debug 'Calling API: CloudInventorySyncConfigsAPI.upsert_sync_config ...'
44+
@api_client.config.logger.debug 'Calling API: StorageManagementAPI.upsert_sync_config ...'
5245
end
5346
# verify the required parameter 'body' is set
5447
if @api_client.config.client_side_validation && body.nil?
55-
fail ArgumentError, "Missing the required parameter 'body' when calling CloudInventorySyncConfigsAPI.upsert_sync_config"
48+
fail ArgumentError, "Missing the required parameter 'body' when calling StorageManagementAPI.upsert_sync_config"
5649
end
5750
# resource path
5851
local_var_path = '/api/v2/cloudinventoryservice/syncconfigs'
@@ -92,7 +85,7 @@ def upsert_sync_config_with_http_info(body, opts = {})
9285

9386
data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
9487
if @api_client.config.debugging
95-
@api_client.config.logger.debug "API called: CloudInventorySyncConfigsAPI#upsert_sync_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88+
@api_client.config.logger.debug "API called: StorageManagementAPI#upsert_sync_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
9689
end
9790
return data, status_code, headers
9891
end

lib/datadog_api_client/v2/models/cloud_inventory_cloud_provider_request_type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
require 'time'
1818

1919
module DatadogAPIClient::V2
20-
# JSON:API type for upsert sync configuration requests.
20+
# Always `cloud_provider`.
2121
class CloudInventoryCloudProviderRequestType
2222
include BaseEnumModel
2323

lib/datadog_api_client/v2/models/cloud_inventory_sync_config_attributes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
require 'time'
1818

1919
module DatadogAPIClient::V2
20-
# Attributes for a cloud inventory sync configuration. Values beyond `id` may be omitted immediately after upsert.
20+
# Attributes for a Storage Management configuration. Fields other than `id` may be empty in the response immediately after a create or update; subsequent reads return the full configuration.
2121
class CloudInventorySyncConfigAttributes
2222
include BaseGenericModel
2323

@@ -60,7 +60,7 @@ class CloudInventorySyncConfigAttributes
6060
# Service account email for bucket access.
6161
attr_reader :gcp_service_account_email
6262

63-
# Object key prefix or `/` when the entire bucket is synced.
63+
# Object key prefix where inventory reports are written. Returns `/` when reports are written at the bucket root.
6464
attr_reader :prefix
6565

6666
attr_accessor :additional_properties

lib/datadog_api_client/v2/models/cloud_inventory_sync_config_aws_request_attributes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
require 'time'
1818

1919
module DatadogAPIClient::V2
20-
# AWS settings for the customer bucket that stores inventory reports.
20+
# AWS settings for the S3 bucket Storage Management reads inventory reports from.
2121
class CloudInventorySyncConfigAWSRequestAttributes
2222
include BaseGenericModel
2323

@@ -30,7 +30,7 @@ class CloudInventorySyncConfigAWSRequestAttributes
3030
# AWS Region of the inventory bucket.
3131
attr_reader :destination_bucket_region
3232

33-
# Optional object key prefix for inventory files. Use `/` or omit for the entire bucket.
33+
# Object key prefix where inventory reports are written. Omit or set to `/` when reports are written at the bucket root.
3434
attr_accessor :destination_prefix
3535

3636
attr_accessor :additional_properties

0 commit comments

Comments
 (0)