Skip to content

Commit d59e141

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Make datadog agent source address configurable in Observability Pipelines (#3842)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent ae9d402 commit d59e141

2 files changed

Lines changed: 44 additions & 4 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42913,6 +42913,11 @@ components:
4291342913

4291442914
**Supported pipeline types:** logs, metrics'
4291542915
properties:
42916+
address_key:
42917+
description: Name of the environment variable or secret that holds the listen
42918+
address for the Datadog Agent source.
42919+
example: DATADOG_AGENT_ADDRESS
42920+
type: string
4291642921
id:
4291742922
description: The unique identifier for this component. Used in other parts
4291842923
of the pipeline to reference this component (for example, as the `input`

api/datadogV2/model_observability_pipeline_datadog_agent_source.go

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import (
1414
//
1515
// **Supported pipeline types:** logs, metrics
1616
type ObservabilityPipelineDatadogAgentSource struct {
17+
// Name of the environment variable or secret that holds the listen address for the Datadog Agent source.
18+
AddressKey *string `json:"address_key,omitempty"`
1719
// 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).
1820
Id string `json:"id"`
1921
// Configuration for enabling TLS encryption between the pipeline component and external services.
@@ -46,6 +48,34 @@ func NewObservabilityPipelineDatadogAgentSourceWithDefaults() *ObservabilityPipe
4648
return &this
4749
}
4850

51+
// GetAddressKey returns the AddressKey field value if set, zero value otherwise.
52+
func (o *ObservabilityPipelineDatadogAgentSource) GetAddressKey() string {
53+
if o == nil || o.AddressKey == nil {
54+
var ret string
55+
return ret
56+
}
57+
return *o.AddressKey
58+
}
59+
60+
// GetAddressKeyOk returns a tuple with the AddressKey field value if set, nil otherwise
61+
// and a boolean to check if the value has been set.
62+
func (o *ObservabilityPipelineDatadogAgentSource) GetAddressKeyOk() (*string, bool) {
63+
if o == nil || o.AddressKey == nil {
64+
return nil, false
65+
}
66+
return o.AddressKey, true
67+
}
68+
69+
// HasAddressKey returns a boolean if a field has been set.
70+
func (o *ObservabilityPipelineDatadogAgentSource) HasAddressKey() bool {
71+
return o != nil && o.AddressKey != nil
72+
}
73+
74+
// SetAddressKey gets a reference to the given string and assigns it to the AddressKey field.
75+
func (o *ObservabilityPipelineDatadogAgentSource) SetAddressKey(v string) {
76+
o.AddressKey = &v
77+
}
78+
4979
// GetId returns the Id field value.
5080
func (o *ObservabilityPipelineDatadogAgentSource) GetId() string {
5181
if o == nil {
@@ -126,6 +156,9 @@ func (o ObservabilityPipelineDatadogAgentSource) MarshalJSON() ([]byte, error) {
126156
if o.UnparsedObject != nil {
127157
return datadog.Marshal(o.UnparsedObject)
128158
}
159+
if o.AddressKey != nil {
160+
toSerialize["address_key"] = o.AddressKey
161+
}
129162
toSerialize["id"] = o.Id
130163
if o.Tls != nil {
131164
toSerialize["tls"] = o.Tls
@@ -141,9 +174,10 @@ func (o ObservabilityPipelineDatadogAgentSource) MarshalJSON() ([]byte, error) {
141174
// UnmarshalJSON deserializes the given payload.
142175
func (o *ObservabilityPipelineDatadogAgentSource) UnmarshalJSON(bytes []byte) (err error) {
143176
all := struct {
144-
Id *string `json:"id"`
145-
Tls *ObservabilityPipelineTls `json:"tls,omitempty"`
146-
Type *ObservabilityPipelineDatadogAgentSourceType `json:"type"`
177+
AddressKey *string `json:"address_key,omitempty"`
178+
Id *string `json:"id"`
179+
Tls *ObservabilityPipelineTls `json:"tls,omitempty"`
180+
Type *ObservabilityPipelineDatadogAgentSourceType `json:"type"`
147181
}{}
148182
if err = datadog.Unmarshal(bytes, &all); err != nil {
149183
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -156,12 +190,13 @@ func (o *ObservabilityPipelineDatadogAgentSource) UnmarshalJSON(bytes []byte) (e
156190
}
157191
additionalProperties := make(map[string]interface{})
158192
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
159-
datadog.DeleteKeys(additionalProperties, &[]string{"id", "tls", "type"})
193+
datadog.DeleteKeys(additionalProperties, &[]string{"address_key", "id", "tls", "type"})
160194
} else {
161195
return err
162196
}
163197

164198
hasInvalidField := false
199+
o.AddressKey = all.AddressKey
165200
o.Id = *all.Id
166201
if all.Tls != nil && all.Tls.UnparsedObject != nil && o.UnparsedObject == nil {
167202
hasInvalidField = true

0 commit comments

Comments
 (0)