Skip to content

Commit f60ce99

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add new Observability Pipelines components (DataDog#3576)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent e25cc33 commit f60ce99

130 files changed

Lines changed: 8010 additions & 1537 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generator/schemas/v2/openapi.yaml

Lines changed: 1390 additions & 435 deletions
Large diffs are not rendered by default.

api/datadog/configuration.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,12 @@ func NewConfiguration() *Configuration {
765765
"v2.UpdateMonitorUserTemplate": false,
766766
"v2.ValidateExistingMonitorUserTemplate": false,
767767
"v2.ValidateMonitorUserTemplate": false,
768+
"v2.CreatePipeline": false,
769+
"v2.DeletePipeline": false,
770+
"v2.GetPipeline": false,
771+
"v2.ListPipelines": false,
772+
"v2.UpdatePipeline": false,
773+
"v2.ValidatePipeline": false,
768774
"v2.ListRoleTemplates": false,
769775
"v2.CreateConnection": false,
770776
"v2.DeleteConnection": false,
@@ -776,12 +782,6 @@ func NewConfiguration() *Configuration {
776782
"v2.QueryEventFilteredUsers": false,
777783
"v2.QueryUsers": false,
778784
"v2.UpdateConnection": false,
779-
"v2.CreatePipeline": false,
780-
"v2.DeletePipeline": false,
781-
"v2.GetPipeline": false,
782-
"v2.ListPipelines": false,
783-
"v2.UpdatePipeline": false,
784-
"v2.ValidatePipeline": false,
785785
"v2.CreateScorecardOutcomesBatch": false,
786786
"v2.CreateScorecardRule": false,
787787
"v2.DeleteScorecardRule": false,

api/datadogV2/api_observability_pipelines.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (a *ObservabilityPipelinesApi) CreatePipeline(ctx _context.Context, body Ob
4040
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
4141
}
4242

43-
localVarPath := localBasePath + "/api/v2/remote_config/products/obs_pipelines/pipelines"
43+
localVarPath := localBasePath + "/api/v2/obs-pipelines/pipelines"
4444

4545
localVarHeaderParams := make(map[string]string)
4646
localVarQueryParams := _neturl.Values{}
@@ -128,7 +128,7 @@ func (a *ObservabilityPipelinesApi) DeletePipeline(ctx _context.Context, pipelin
128128
return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
129129
}
130130

131-
localVarPath := localBasePath + "/api/v2/remote_config/products/obs_pipelines/pipelines/{pipeline_id}"
131+
localVarPath := localBasePath + "/api/v2/obs-pipelines/pipelines/{pipeline_id}"
132132
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pipeline_id}", _neturl.PathEscape(datadog.ParameterToString(pipelineId, "")))
133133

134134
localVarHeaderParams := make(map[string]string)
@@ -206,7 +206,7 @@ func (a *ObservabilityPipelinesApi) GetPipeline(ctx _context.Context, pipelineId
206206
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
207207
}
208208

209-
localVarPath := localBasePath + "/api/v2/remote_config/products/obs_pipelines/pipelines/{pipeline_id}"
209+
localVarPath := localBasePath + "/api/v2/obs-pipelines/pipelines/{pipeline_id}"
210210
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pipeline_id}", _neturl.PathEscape(datadog.ParameterToString(pipelineId, "")))
211211

212212
localVarHeaderParams := make(map[string]string)
@@ -325,7 +325,7 @@ func (a *ObservabilityPipelinesApi) ListPipelines(ctx _context.Context, o ...Lis
325325
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
326326
}
327327

328-
localVarPath := localBasePath + "/api/v2/remote_config/products/obs_pipelines/pipelines"
328+
localVarPath := localBasePath + "/api/v2/obs-pipelines/pipelines"
329329

330330
localVarHeaderParams := make(map[string]string)
331331
localVarQueryParams := _neturl.Values{}
@@ -417,7 +417,7 @@ func (a *ObservabilityPipelinesApi) UpdatePipeline(ctx _context.Context, pipelin
417417
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
418418
}
419419

420-
localVarPath := localBasePath + "/api/v2/remote_config/products/obs_pipelines/pipelines/{pipeline_id}"
420+
localVarPath := localBasePath + "/api/v2/obs-pipelines/pipelines/{pipeline_id}"
421421
localVarPath = datadog.ReplacePathParameter(localVarPath, "{pipeline_id}", _neturl.PathEscape(datadog.ParameterToString(pipelineId, "")))
422422

423423
localVarHeaderParams := make(map[string]string)
@@ -508,7 +508,7 @@ func (a *ObservabilityPipelinesApi) ValidatePipeline(ctx _context.Context, body
508508
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
509509
}
510510

511-
localVarPath := localBasePath + "/api/v2/remote_config/products/obs_pipelines/pipelines/validate"
511+
localVarPath := localBasePath + "/api/v2/obs-pipelines/pipelines/validate"
512512

513513
localVarHeaderParams := make(map[string]string)
514514
localVarQueryParams := _neturl.Values{}

api/datadogV2/model_azure_storage_destination.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
)
1212

1313
// AzureStorageDestination The `azure_storage` destination forwards logs to an Azure Blob Storage container.
14+
//
15+
// **Supported pipeline types:** logs
1416
type AzureStorageDestination struct {
1517
// Optional prefix for blobs written to the container.
1618
BlobPrefix *string `json:"blob_prefix,omitempty"`

api/datadogV2/model_microsoft_sentinel_destination.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
)
1212

1313
// MicrosoftSentinelDestination The `microsoft_sentinel` destination forwards logs to Microsoft Sentinel.
14+
//
15+
// **Supported pipeline types:** logs
1416
type MicrosoftSentinelDestination struct {
1517
// Azure AD client ID used for authentication.
1618
ClientId string `json:"client_id"`

api/datadogV2/model_observability_pipeline_add_env_vars_processor.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ import (
1111
)
1212

1313
// ObservabilityPipelineAddEnvVarsProcessor The `add_env_vars` processor adds environment variable values to log events.
14+
//
15+
// **Supported pipeline types:** logs
1416
type ObservabilityPipelineAddEnvVarsProcessor struct {
1517
// The display name for a component.
1618
DisplayName *string `json:"display_name,omitempty"`
17-
// Whether this processor is enabled.
19+
// Indicates whether the processor is enabled.
1820
Enabled bool `json:"enabled"`
1921
// The unique identifier for this component. Used to reference this processor in the pipeline.
2022
Id string `json:"id"`

api/datadogV2/model_observability_pipeline_add_fields_processor.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ import (
1111
)
1212

1313
// ObservabilityPipelineAddFieldsProcessor The `add_fields` processor adds static key-value fields to logs.
14+
//
15+
// **Supported pipeline types:** logs
1416
type ObservabilityPipelineAddFieldsProcessor struct {
1517
// The display name for a component.
1618
DisplayName *string `json:"display_name,omitempty"`
17-
// Whether this processor is enabled.
19+
// Indicates whether the processor is enabled.
1820
Enabled bool `json:"enabled"`
1921
// A list of static fields (key-value pairs) that is added to each log event processed by this component.
2022
Fields []ObservabilityPipelineFieldValue `json:"fields"`
21-
// The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the `input` to downstream components).
23+
// 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).
2224
Id string `json:"id"`
2325
// A Datadog search query used to determine which logs this processor targets.
2426
Include string `json:"include"`
Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// ObservabilityPipelineAddHostnameProcessor The `add_hostname` processor adds the hostname to log events.
14+
//
15+
// **Supported pipeline types:** logs
16+
type ObservabilityPipelineAddHostnameProcessor struct {
17+
// The display name for a component.
18+
DisplayName *string `json:"display_name,omitempty"`
19+
// Indicates whether the processor is enabled.
20+
Enabled bool `json:"enabled"`
21+
// 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).
22+
Id string `json:"id"`
23+
// A Datadog search query used to determine which logs this processor targets.
24+
Include string `json:"include"`
25+
// The processor type. The value should always be `add_hostname`.
26+
Type ObservabilityPipelineAddHostnameProcessorType `json:"type"`
27+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
28+
UnparsedObject map[string]interface{} `json:"-"`
29+
AdditionalProperties map[string]interface{} `json:"-"`
30+
}
31+
32+
// NewObservabilityPipelineAddHostnameProcessor instantiates a new ObservabilityPipelineAddHostnameProcessor object.
33+
// This constructor will assign default values to properties that have it defined,
34+
// and makes sure properties required by API are set, but the set of arguments
35+
// will change when the set of required properties is changed.
36+
func NewObservabilityPipelineAddHostnameProcessor(enabled bool, id string, include string, typeVar ObservabilityPipelineAddHostnameProcessorType) *ObservabilityPipelineAddHostnameProcessor {
37+
this := ObservabilityPipelineAddHostnameProcessor{}
38+
this.Enabled = enabled
39+
this.Id = id
40+
this.Include = include
41+
this.Type = typeVar
42+
return &this
43+
}
44+
45+
// NewObservabilityPipelineAddHostnameProcessorWithDefaults instantiates a new ObservabilityPipelineAddHostnameProcessor object.
46+
// This constructor will only assign default values to properties that have it defined,
47+
// but it doesn't guarantee that properties required by API are set.
48+
func NewObservabilityPipelineAddHostnameProcessorWithDefaults() *ObservabilityPipelineAddHostnameProcessor {
49+
this := ObservabilityPipelineAddHostnameProcessor{}
50+
var typeVar ObservabilityPipelineAddHostnameProcessorType = OBSERVABILITYPIPELINEADDHOSTNAMEPROCESSORTYPE_ADD_HOSTNAME
51+
this.Type = typeVar
52+
return &this
53+
}
54+
55+
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
56+
func (o *ObservabilityPipelineAddHostnameProcessor) GetDisplayName() string {
57+
if o == nil || o.DisplayName == nil {
58+
var ret string
59+
return ret
60+
}
61+
return *o.DisplayName
62+
}
63+
64+
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
65+
// and a boolean to check if the value has been set.
66+
func (o *ObservabilityPipelineAddHostnameProcessor) GetDisplayNameOk() (*string, bool) {
67+
if o == nil || o.DisplayName == nil {
68+
return nil, false
69+
}
70+
return o.DisplayName, true
71+
}
72+
73+
// HasDisplayName returns a boolean if a field has been set.
74+
func (o *ObservabilityPipelineAddHostnameProcessor) HasDisplayName() bool {
75+
return o != nil && o.DisplayName != nil
76+
}
77+
78+
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
79+
func (o *ObservabilityPipelineAddHostnameProcessor) SetDisplayName(v string) {
80+
o.DisplayName = &v
81+
}
82+
83+
// GetEnabled returns the Enabled field value.
84+
func (o *ObservabilityPipelineAddHostnameProcessor) GetEnabled() bool {
85+
if o == nil {
86+
var ret bool
87+
return ret
88+
}
89+
return o.Enabled
90+
}
91+
92+
// GetEnabledOk returns a tuple with the Enabled field value
93+
// and a boolean to check if the value has been set.
94+
func (o *ObservabilityPipelineAddHostnameProcessor) GetEnabledOk() (*bool, bool) {
95+
if o == nil {
96+
return nil, false
97+
}
98+
return &o.Enabled, true
99+
}
100+
101+
// SetEnabled sets field value.
102+
func (o *ObservabilityPipelineAddHostnameProcessor) SetEnabled(v bool) {
103+
o.Enabled = v
104+
}
105+
106+
// GetId returns the Id field value.
107+
func (o *ObservabilityPipelineAddHostnameProcessor) GetId() string {
108+
if o == nil {
109+
var ret string
110+
return ret
111+
}
112+
return o.Id
113+
}
114+
115+
// GetIdOk returns a tuple with the Id field value
116+
// and a boolean to check if the value has been set.
117+
func (o *ObservabilityPipelineAddHostnameProcessor) GetIdOk() (*string, bool) {
118+
if o == nil {
119+
return nil, false
120+
}
121+
return &o.Id, true
122+
}
123+
124+
// SetId sets field value.
125+
func (o *ObservabilityPipelineAddHostnameProcessor) SetId(v string) {
126+
o.Id = v
127+
}
128+
129+
// GetInclude returns the Include field value.
130+
func (o *ObservabilityPipelineAddHostnameProcessor) GetInclude() string {
131+
if o == nil {
132+
var ret string
133+
return ret
134+
}
135+
return o.Include
136+
}
137+
138+
// GetIncludeOk returns a tuple with the Include field value
139+
// and a boolean to check if the value has been set.
140+
func (o *ObservabilityPipelineAddHostnameProcessor) GetIncludeOk() (*string, bool) {
141+
if o == nil {
142+
return nil, false
143+
}
144+
return &o.Include, true
145+
}
146+
147+
// SetInclude sets field value.
148+
func (o *ObservabilityPipelineAddHostnameProcessor) SetInclude(v string) {
149+
o.Include = v
150+
}
151+
152+
// GetType returns the Type field value.
153+
func (o *ObservabilityPipelineAddHostnameProcessor) GetType() ObservabilityPipelineAddHostnameProcessorType {
154+
if o == nil {
155+
var ret ObservabilityPipelineAddHostnameProcessorType
156+
return ret
157+
}
158+
return o.Type
159+
}
160+
161+
// GetTypeOk returns a tuple with the Type field value
162+
// and a boolean to check if the value has been set.
163+
func (o *ObservabilityPipelineAddHostnameProcessor) GetTypeOk() (*ObservabilityPipelineAddHostnameProcessorType, bool) {
164+
if o == nil {
165+
return nil, false
166+
}
167+
return &o.Type, true
168+
}
169+
170+
// SetType sets field value.
171+
func (o *ObservabilityPipelineAddHostnameProcessor) SetType(v ObservabilityPipelineAddHostnameProcessorType) {
172+
o.Type = v
173+
}
174+
175+
// MarshalJSON serializes the struct using spec logic.
176+
func (o ObservabilityPipelineAddHostnameProcessor) MarshalJSON() ([]byte, error) {
177+
toSerialize := map[string]interface{}{}
178+
if o.UnparsedObject != nil {
179+
return datadog.Marshal(o.UnparsedObject)
180+
}
181+
if o.DisplayName != nil {
182+
toSerialize["display_name"] = o.DisplayName
183+
}
184+
toSerialize["enabled"] = o.Enabled
185+
toSerialize["id"] = o.Id
186+
toSerialize["include"] = o.Include
187+
toSerialize["type"] = o.Type
188+
189+
for key, value := range o.AdditionalProperties {
190+
toSerialize[key] = value
191+
}
192+
return datadog.Marshal(toSerialize)
193+
}
194+
195+
// UnmarshalJSON deserializes the given payload.
196+
func (o *ObservabilityPipelineAddHostnameProcessor) UnmarshalJSON(bytes []byte) (err error) {
197+
all := struct {
198+
DisplayName *string `json:"display_name,omitempty"`
199+
Enabled *bool `json:"enabled"`
200+
Id *string `json:"id"`
201+
Include *string `json:"include"`
202+
Type *ObservabilityPipelineAddHostnameProcessorType `json:"type"`
203+
}{}
204+
if err = datadog.Unmarshal(bytes, &all); err != nil {
205+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
206+
}
207+
if all.Enabled == nil {
208+
return fmt.Errorf("required field enabled missing")
209+
}
210+
if all.Id == nil {
211+
return fmt.Errorf("required field id missing")
212+
}
213+
if all.Include == nil {
214+
return fmt.Errorf("required field include missing")
215+
}
216+
if all.Type == nil {
217+
return fmt.Errorf("required field type missing")
218+
}
219+
additionalProperties := make(map[string]interface{})
220+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
221+
datadog.DeleteKeys(additionalProperties, &[]string{"display_name", "enabled", "id", "include", "type"})
222+
} else {
223+
return err
224+
}
225+
226+
hasInvalidField := false
227+
o.DisplayName = all.DisplayName
228+
o.Enabled = *all.Enabled
229+
o.Id = *all.Id
230+
o.Include = *all.Include
231+
if !all.Type.IsValid() {
232+
hasInvalidField = true
233+
} else {
234+
o.Type = *all.Type
235+
}
236+
237+
if len(additionalProperties) > 0 {
238+
o.AdditionalProperties = additionalProperties
239+
}
240+
241+
if hasInvalidField {
242+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
243+
}
244+
245+
return nil
246+
}

0 commit comments

Comments
 (0)