Skip to content

Commit 6f54e98

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 8cd544c of spec repo (#4158)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 0efbcba commit 6f54e98

10 files changed

Lines changed: 905 additions & 2 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 111 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
@@ -55624,6 +55632,7 @@ components:
5562455632
- $ref: "#/components/schemas/ObservabilityPipelineSyslogNgDestination"
5562555633
- $ref: "#/components/schemas/ObservabilityPipelineDatabricksZerobusDestination"
5562655634
- $ref: "#/components/schemas/ObservabilityPipelineDatadogMetricsDestination"
55635+
- $ref: "#/components/schemas/ObservabilityPipelineSplunkHecMetricsDestination"
5562755636
ObservabilityPipelineConfigPipelineType:
5562855637
default: logs
5562955638
description: The type of data being ingested. Defaults to `logs` if not specified.
@@ -59745,6 +59754,81 @@ components:
5974559754
type: string
5974659755
x-enum-varnames:
5974759756
- SPLUNK_HEC
59757+
ObservabilityPipelineSplunkHecMetricsDestination:
59758+
description: |-
59759+
The `splunk_hec_metrics` destination forwards metrics to Splunk using the HTTP Event Collector (HEC).
59760+
59761+
**Supported pipeline types:** metrics
59762+
properties:
59763+
buffer:
59764+
$ref: "#/components/schemas/ObservabilityPipelineBufferOptions"
59765+
compression:
59766+
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecMetricsDestinationCompression"
59767+
default_namespace:
59768+
description: Optional default namespace for metrics sent to Splunk HEC.
59769+
example: "custom_namespace"
59770+
type: string
59771+
endpoint_url_key:
59772+
description: Name of the environment variable or secret that holds the Splunk HEC endpoint URL.
59773+
example: SPLUNK_HEC_ENDPOINT_URL
59774+
type: string
59775+
id:
59776+
description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components).
59777+
example: splunk-hec-metrics-destination
59778+
type: string
59779+
index:
59780+
description: Optional name of the Splunk index where metrics are written.
59781+
example: "metrics"
59782+
type: string
59783+
inputs:
59784+
description: A list of component IDs whose output is used as the `input` for this component.
59785+
example: ["metrics-filter-processor"]
59786+
items:
59787+
description: The ID of a component whose output is used as input for this destination.
59788+
type: string
59789+
type: array
59790+
source:
59791+
description: The Splunk source field value for metric events.
59792+
example: "observability_pipelines"
59793+
type: string
59794+
sourcetype:
59795+
description: The Splunk sourcetype to assign to metric events.
59796+
example: "custom_sourcetype"
59797+
type: string
59798+
tls:
59799+
$ref: "#/components/schemas/ObservabilityPipelineTls"
59800+
token_key:
59801+
description: Name of the environment variable or secret that holds the Splunk HEC token.
59802+
example: SPLUNK_HEC_TOKEN
59803+
type: string
59804+
type:
59805+
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecMetricsDestinationType"
59806+
required:
59807+
- id
59808+
- type
59809+
- inputs
59810+
type: object
59811+
x-pipeline-types: [metrics]
59812+
ObservabilityPipelineSplunkHecMetricsDestinationCompression:
59813+
default: none
59814+
description: Compression algorithm applied when sending metrics to Splunk HEC.
59815+
enum:
59816+
- none
59817+
- gzip
59818+
example: none
59819+
type: string
59820+
x-enum-varnames:
59821+
- NONE
59822+
- GZIP
59823+
ObservabilityPipelineSplunkHecMetricsDestinationType:
59824+
default: splunk_hec_metrics
59825+
description: The destination type. Always `splunk_hec_metrics`.
59826+
enum:
59827+
- splunk_hec_metrics
59828+
example: splunk_hec_metrics
59829+
type: string
59830+
x-enum-varnames:
59831+
- SPLUNK_HEC_METRICS
5974859832
ObservabilityPipelineSplunkHecSource:
5974959833
description: |-
5975059834
The `splunk_hec` source implements the Splunk HTTP Event Collector (HEC) API.
@@ -107705,6 +107789,33 @@ paths:
107705107789
operator: OR
107706107790
permissions:
107707107791
- aws_configurations_manage
107792+
/api/v2/cloudinventoryservice/syncconfigs/{id}:
107793+
delete:
107794+
description: |-
107795+
Delete a Storage Management configuration by its unique identifier. Deleting a configuration stops inventory file synchronization for the associated cloud account.
107796+
operationId: DeleteSyncConfig
107797+
parameters:
107798+
- $ref: "#/components/parameters/CloudInventorySyncConfigID"
107799+
responses:
107800+
"204":
107801+
description: No Content
107802+
"403":
107803+
$ref: "#/components/responses/ForbiddenResponse"
107804+
"404":
107805+
content:
107806+
application/json:
107807+
schema:
107808+
$ref: "#/components/schemas/JSONAPIErrorResponse"
107809+
description: Not Found
107810+
"429":
107811+
$ref: "#/components/responses/TooManyRequestsResponse"
107812+
summary: Delete a Storage Management configuration
107813+
tags:
107814+
- Storage Management
107815+
"x-permission":
107816+
operator: OR
107817+
permissions:
107818+
- aws_configurations_manage
107708107819
/api/v2/code-coverage/branch/summary:
107709107820
post:
107710107821
description: |-

api/datadogV2/api_storage_management.go

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,83 @@ import (
1515
// StorageManagementApi service type
1616
type StorageManagementApi datadog.Service
1717

18+
// DeleteSyncConfig Delete a Storage Management configuration.
19+
// Delete a Storage Management configuration by its unique identifier. Deleting a configuration stops inventory file synchronization for the associated cloud account.
20+
func (a *StorageManagementApi) DeleteSyncConfig(ctx _context.Context, id string) (*_nethttp.Response, error) {
21+
var (
22+
localVarHTTPMethod = _nethttp.MethodDelete
23+
localVarPostBody interface{}
24+
)
25+
26+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StorageManagementApi.DeleteSyncConfig")
27+
if err != nil {
28+
return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
29+
}
30+
31+
localVarPath := localBasePath + "/api/v2/cloudinventoryservice/syncconfigs/{id}"
32+
localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, "")))
33+
34+
localVarHeaderParams := make(map[string]string)
35+
localVarQueryParams := _neturl.Values{}
36+
localVarFormParams := _neturl.Values{}
37+
localVarHeaderParams["Accept"] = "*/*"
38+
39+
if a.Client.Cfg.DelegatedTokenConfig != nil {
40+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
41+
if err != nil {
42+
return nil, err
43+
}
44+
} else {
45+
datadog.SetAuthKeys(
46+
ctx,
47+
&localVarHeaderParams,
48+
[2]string{"apiKeyAuth", "DD-API-KEY"},
49+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
50+
)
51+
}
52+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
53+
if err != nil {
54+
return nil, err
55+
}
56+
57+
localVarHTTPResponse, err := a.Client.CallAPI(req)
58+
if err != nil || localVarHTTPResponse == nil {
59+
return localVarHTTPResponse, err
60+
}
61+
62+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
63+
if err != nil {
64+
return localVarHTTPResponse, err
65+
}
66+
67+
if localVarHTTPResponse.StatusCode >= 300 {
68+
newErr := datadog.GenericOpenAPIError{
69+
ErrorBody: localVarBody,
70+
ErrorMessage: localVarHTTPResponse.Status,
71+
}
72+
if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 {
73+
var v APIErrorResponse
74+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
75+
if err != nil {
76+
return localVarHTTPResponse, newErr
77+
}
78+
newErr.ErrorModel = v
79+
return localVarHTTPResponse, newErr
80+
}
81+
if localVarHTTPResponse.StatusCode == 404 {
82+
var v JSONAPIErrorResponse
83+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
84+
if err != nil {
85+
return localVarHTTPResponse, newErr
86+
}
87+
newErr.ErrorModel = v
88+
}
89+
return localVarHTTPResponse, newErr
90+
}
91+
92+
return localVarHTTPResponse, nil
93+
}
94+
1895
// UpsertSyncConfig Enable Storage Management for a bucket.
1996
// 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.
2097
func (a *StorageManagementApi) UpsertSyncConfig(ctx _context.Context, body UpsertCloudInventorySyncConfigRequest) (CloudInventorySyncConfigResponse, *_nethttp.Response, error) {

api/datadogV2/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,7 @@
10821082
// - [StatusPagesApi.UpdateDegradation]
10831083
// - [StatusPagesApi.UpdateMaintenance]
10841084
// - [StatusPagesApi.UpdateStatusPage]
1085+
// - [StorageManagementApi.DeleteSyncConfig]
10851086
// - [StorageManagementApi.UpsertSyncConfig]
10861087
// - [SyntheticsApi.AbortTestFileMultipartUpload]
10871088
// - [SyntheticsApi.AddTestToSyntheticsDowntime]

api/datadogV2/model_observability_pipeline_config_destination_item.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type ObservabilityPipelineConfigDestinationItem struct {
3535
ObservabilityPipelineSyslogNgDestination *ObservabilityPipelineSyslogNgDestination
3636
ObservabilityPipelineDatabricksZerobusDestination *ObservabilityPipelineDatabricksZerobusDestination
3737
ObservabilityPipelineDatadogMetricsDestination *ObservabilityPipelineDatadogMetricsDestination
38+
ObservabilityPipelineSplunkHecMetricsDestination *ObservabilityPipelineSplunkHecMetricsDestination
3839

3940
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
4041
UnparsedObject interface{}
@@ -165,6 +166,11 @@ func ObservabilityPipelineDatadogMetricsDestinationAsObservabilityPipelineConfig
165166
return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineDatadogMetricsDestination: v}
166167
}
167168

169+
// ObservabilityPipelineSplunkHecMetricsDestinationAsObservabilityPipelineConfigDestinationItem is a convenience function that returns ObservabilityPipelineSplunkHecMetricsDestination wrapped in ObservabilityPipelineConfigDestinationItem.
170+
func ObservabilityPipelineSplunkHecMetricsDestinationAsObservabilityPipelineConfigDestinationItem(v *ObservabilityPipelineSplunkHecMetricsDestination) ObservabilityPipelineConfigDestinationItem {
171+
return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineSplunkHecMetricsDestination: v}
172+
}
173+
168174
// UnmarshalJSON turns data into one of the pointers in the struct.
169175
func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte) error {
170176
var err error
@@ -594,6 +600,23 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte
594600
obj.ObservabilityPipelineDatadogMetricsDestination = nil
595601
}
596602

603+
// try to unmarshal data into ObservabilityPipelineSplunkHecMetricsDestination
604+
err = datadog.Unmarshal(data, &obj.ObservabilityPipelineSplunkHecMetricsDestination)
605+
if err == nil {
606+
if obj.ObservabilityPipelineSplunkHecMetricsDestination != nil && obj.ObservabilityPipelineSplunkHecMetricsDestination.UnparsedObject == nil {
607+
jsonObservabilityPipelineSplunkHecMetricsDestination, _ := datadog.Marshal(obj.ObservabilityPipelineSplunkHecMetricsDestination)
608+
if string(jsonObservabilityPipelineSplunkHecMetricsDestination) == "{}" { // empty struct
609+
obj.ObservabilityPipelineSplunkHecMetricsDestination = nil
610+
} else {
611+
match++
612+
}
613+
} else {
614+
obj.ObservabilityPipelineSplunkHecMetricsDestination = nil
615+
}
616+
} else {
617+
obj.ObservabilityPipelineSplunkHecMetricsDestination = nil
618+
}
619+
597620
if match != 1 { // more than 1 match
598621
// reset to nil
599622
obj.ObservabilityPipelineElasticsearchDestination = nil
@@ -621,6 +644,7 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte
621644
obj.ObservabilityPipelineSyslogNgDestination = nil
622645
obj.ObservabilityPipelineDatabricksZerobusDestination = nil
623646
obj.ObservabilityPipelineDatadogMetricsDestination = nil
647+
obj.ObservabilityPipelineSplunkHecMetricsDestination = nil
624648
return datadog.Unmarshal(data, &obj.UnparsedObject)
625649
}
626650
return nil // exactly one match
@@ -728,6 +752,10 @@ func (obj ObservabilityPipelineConfigDestinationItem) MarshalJSON() ([]byte, err
728752
return datadog.Marshal(&obj.ObservabilityPipelineDatadogMetricsDestination)
729753
}
730754

755+
if obj.ObservabilityPipelineSplunkHecMetricsDestination != nil {
756+
return datadog.Marshal(&obj.ObservabilityPipelineSplunkHecMetricsDestination)
757+
}
758+
731759
if obj.UnparsedObject != nil {
732760
return datadog.Marshal(obj.UnparsedObject)
733761
}
@@ -836,6 +864,10 @@ func (obj *ObservabilityPipelineConfigDestinationItem) GetActualInstance() inter
836864
return obj.ObservabilityPipelineDatadogMetricsDestination
837865
}
838866

867+
if obj.ObservabilityPipelineSplunkHecMetricsDestination != nil {
868+
return obj.ObservabilityPipelineSplunkHecMetricsDestination
869+
}
870+
839871
// all schemas are nil
840872
return nil
841873
}

0 commit comments

Comments
 (0)