Skip to content

Commit eb64754

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Adding all Observability Pipeline new hec_token related features into the api (#3943)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent f58f355 commit eb64754

19 files changed

Lines changed: 1055 additions & 28 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44467,6 +44467,40 @@ components:
4446744467
type: string
4446844468
x-enum-varnames:
4446944469
- ELASTICSEARCH
44470+
ObservabilityPipelineEnrichmentTableFieldEventLookup:
44471+
description: Looks up a value from a field path in the log event.
44472+
properties:
44473+
event:
44474+
description: The path to the field in the log event to use as the lookup key.
44475+
example: log.user.id
44476+
type: string
44477+
required:
44478+
- event
44479+
type: object
44480+
ObservabilityPipelineEnrichmentTableFieldSecretLookup:
44481+
description: Looks up a value stored as a pipeline secret.
44482+
properties:
44483+
secret:
44484+
description: The name of the secret containing the lookup key value.
44485+
example: MY_LOOKUP_SECRET
44486+
type: string
44487+
required:
44488+
- secret
44489+
type: object
44490+
ObservabilityPipelineEnrichmentTableFieldStringPath:
44491+
description: A plain field path in the log event, used as the lookup key.
44492+
example: log.user.id
44493+
type: string
44494+
ObservabilityPipelineEnrichmentTableFieldVrlLookup:
44495+
description: Evaluates a VRL expression to produce the lookup key.
44496+
properties:
44497+
vrl:
44498+
description: A VRL expression that returns the value to use as the lookup key.
44499+
example: .log.user.id
44500+
type: string
44501+
required:
44502+
- vrl
44503+
type: object
4447044504
ObservabilityPipelineEnrichmentTableFile:
4447144505
description: Defines a static enrichment table loaded from a CSV file.
4447244506
properties:
@@ -44517,6 +44551,16 @@ components:
4451744551
type: string
4451844552
x-enum-varnames:
4451944553
- CSV
44554+
ObservabilityPipelineEnrichmentTableFileKeyItemField:
44555+
description: |-
44556+
Specifies the source of the key value used for enrichment table lookups.
44557+
Can be a plain field path string or an object specifying `event`, `vrl`, or `secret`.
44558+
example: log.user.id
44559+
oneOf:
44560+
- $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFieldStringPath"
44561+
- $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFieldEventLookup"
44562+
- $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFieldVrlLookup"
44563+
- $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFieldSecretLookup"
4452044564
ObservabilityPipelineEnrichmentTableFileKeyItems:
4452144565
description: Defines how to map log fields to enrichment table columns during lookups.
4452244566
properties:
@@ -44527,9 +44571,7 @@ components:
4452744571
comparison:
4452844572
$ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFileKeyItemsComparison"
4452944573
field:
44530-
description: The `items` `field`.
44531-
example: log.user.id
44532-
type: string
44574+
$ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFileKeyItemField"
4453344575
required:
4453444576
- column
4453544577
- comparison
@@ -47550,6 +47592,8 @@ components:
4755047592
description: Name of the environment variable or secret that holds the Splunk HEC token.
4755147593
example: SPLUNK_HEC_TOKEN
4755247594
type: string
47595+
token_strategy:
47596+
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecDestinationTokenStrategy"
4755347597
type:
4755447598
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecDestinationType"
4755547599
required:
@@ -47568,6 +47612,16 @@ components:
4756847612
x-enum-varnames:
4756947613
- JSON
4757047614
- RAW_MESSAGE
47615+
ObservabilityPipelineSplunkHecDestinationTokenStrategy:
47616+
description: Controls how the Splunk HEC token is supplied. Use `custom` to provide a token with `token_key`, or `from_source` to forward the token received from an upstream Splunk HEC source.
47617+
enum:
47618+
- custom
47619+
- from_source
47620+
example: custom
47621+
type: string
47622+
x-enum-varnames:
47623+
- CUSTOM
47624+
- FROM_SOURCE
4757147625
ObservabilityPipelineSplunkHecDestinationType:
4757247626
default: splunk_hec
4757347627
description: The destination type. Always `splunk_hec`.
@@ -47591,6 +47645,12 @@ components:
4759147645
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).
4759247646
example: splunk-hec-source
4759347647
type: string
47648+
store_hec_token:
47649+
description: |-
47650+
When `true`, the Splunk HEC token from the incoming request is stored in the event metadata.
47651+
This allows downstream components to forward the token to other Splunk HEC destinations.
47652+
example: true
47653+
type: boolean
4759447654
tls:
4759547655
$ref: "#/components/schemas/ObservabilityPipelineTls"
4759647656
type:
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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+
// ObservabilityPipelineEnrichmentTableFieldEventLookup Looks up a value from a field path in the log event.
14+
type ObservabilityPipelineEnrichmentTableFieldEventLookup struct {
15+
// The path to the field in the log event to use as the lookup key.
16+
Event string `json:"event"`
17+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
18+
UnparsedObject map[string]interface{} `json:"-"`
19+
AdditionalProperties map[string]interface{} `json:"-"`
20+
}
21+
22+
// NewObservabilityPipelineEnrichmentTableFieldEventLookup instantiates a new ObservabilityPipelineEnrichmentTableFieldEventLookup object.
23+
// This constructor will assign default values to properties that have it defined,
24+
// and makes sure properties required by API are set, but the set of arguments
25+
// will change when the set of required properties is changed.
26+
func NewObservabilityPipelineEnrichmentTableFieldEventLookup(event string) *ObservabilityPipelineEnrichmentTableFieldEventLookup {
27+
this := ObservabilityPipelineEnrichmentTableFieldEventLookup{}
28+
this.Event = event
29+
return &this
30+
}
31+
32+
// NewObservabilityPipelineEnrichmentTableFieldEventLookupWithDefaults instantiates a new ObservabilityPipelineEnrichmentTableFieldEventLookup object.
33+
// This constructor will only assign default values to properties that have it defined,
34+
// but it doesn't guarantee that properties required by API are set.
35+
func NewObservabilityPipelineEnrichmentTableFieldEventLookupWithDefaults() *ObservabilityPipelineEnrichmentTableFieldEventLookup {
36+
this := ObservabilityPipelineEnrichmentTableFieldEventLookup{}
37+
return &this
38+
}
39+
40+
// GetEvent returns the Event field value.
41+
func (o *ObservabilityPipelineEnrichmentTableFieldEventLookup) GetEvent() string {
42+
if o == nil {
43+
var ret string
44+
return ret
45+
}
46+
return o.Event
47+
}
48+
49+
// GetEventOk returns a tuple with the Event field value
50+
// and a boolean to check if the value has been set.
51+
func (o *ObservabilityPipelineEnrichmentTableFieldEventLookup) GetEventOk() (*string, bool) {
52+
if o == nil {
53+
return nil, false
54+
}
55+
return &o.Event, true
56+
}
57+
58+
// SetEvent sets field value.
59+
func (o *ObservabilityPipelineEnrichmentTableFieldEventLookup) SetEvent(v string) {
60+
o.Event = v
61+
}
62+
63+
// MarshalJSON serializes the struct using spec logic.
64+
func (o ObservabilityPipelineEnrichmentTableFieldEventLookup) MarshalJSON() ([]byte, error) {
65+
toSerialize := map[string]interface{}{}
66+
if o.UnparsedObject != nil {
67+
return datadog.Marshal(o.UnparsedObject)
68+
}
69+
toSerialize["event"] = o.Event
70+
71+
for key, value := range o.AdditionalProperties {
72+
toSerialize[key] = value
73+
}
74+
return datadog.Marshal(toSerialize)
75+
}
76+
77+
// UnmarshalJSON deserializes the given payload.
78+
func (o *ObservabilityPipelineEnrichmentTableFieldEventLookup) UnmarshalJSON(bytes []byte) (err error) {
79+
all := struct {
80+
Event *string `json:"event"`
81+
}{}
82+
if err = datadog.Unmarshal(bytes, &all); err != nil {
83+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
84+
}
85+
if all.Event == nil {
86+
return fmt.Errorf("required field event missing")
87+
}
88+
additionalProperties := make(map[string]interface{})
89+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
90+
datadog.DeleteKeys(additionalProperties, &[]string{"event"})
91+
} else {
92+
return err
93+
}
94+
o.Event = *all.Event
95+
96+
if len(additionalProperties) > 0 {
97+
o.AdditionalProperties = additionalProperties
98+
}
99+
100+
return nil
101+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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+
// ObservabilityPipelineEnrichmentTableFieldSecretLookup Looks up a value stored as a pipeline secret.
14+
type ObservabilityPipelineEnrichmentTableFieldSecretLookup struct {
15+
// The name of the secret containing the lookup key value.
16+
Secret string `json:"secret"`
17+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
18+
UnparsedObject map[string]interface{} `json:"-"`
19+
AdditionalProperties map[string]interface{} `json:"-"`
20+
}
21+
22+
// NewObservabilityPipelineEnrichmentTableFieldSecretLookup instantiates a new ObservabilityPipelineEnrichmentTableFieldSecretLookup object.
23+
// This constructor will assign default values to properties that have it defined,
24+
// and makes sure properties required by API are set, but the set of arguments
25+
// will change when the set of required properties is changed.
26+
func NewObservabilityPipelineEnrichmentTableFieldSecretLookup(secret string) *ObservabilityPipelineEnrichmentTableFieldSecretLookup {
27+
this := ObservabilityPipelineEnrichmentTableFieldSecretLookup{}
28+
this.Secret = secret
29+
return &this
30+
}
31+
32+
// NewObservabilityPipelineEnrichmentTableFieldSecretLookupWithDefaults instantiates a new ObservabilityPipelineEnrichmentTableFieldSecretLookup object.
33+
// This constructor will only assign default values to properties that have it defined,
34+
// but it doesn't guarantee that properties required by API are set.
35+
func NewObservabilityPipelineEnrichmentTableFieldSecretLookupWithDefaults() *ObservabilityPipelineEnrichmentTableFieldSecretLookup {
36+
this := ObservabilityPipelineEnrichmentTableFieldSecretLookup{}
37+
return &this
38+
}
39+
40+
// GetSecret returns the Secret field value.
41+
func (o *ObservabilityPipelineEnrichmentTableFieldSecretLookup) GetSecret() string {
42+
if o == nil {
43+
var ret string
44+
return ret
45+
}
46+
return o.Secret
47+
}
48+
49+
// GetSecretOk returns a tuple with the Secret field value
50+
// and a boolean to check if the value has been set.
51+
func (o *ObservabilityPipelineEnrichmentTableFieldSecretLookup) GetSecretOk() (*string, bool) {
52+
if o == nil {
53+
return nil, false
54+
}
55+
return &o.Secret, true
56+
}
57+
58+
// SetSecret sets field value.
59+
func (o *ObservabilityPipelineEnrichmentTableFieldSecretLookup) SetSecret(v string) {
60+
o.Secret = v
61+
}
62+
63+
// MarshalJSON serializes the struct using spec logic.
64+
func (o ObservabilityPipelineEnrichmentTableFieldSecretLookup) MarshalJSON() ([]byte, error) {
65+
toSerialize := map[string]interface{}{}
66+
if o.UnparsedObject != nil {
67+
return datadog.Marshal(o.UnparsedObject)
68+
}
69+
toSerialize["secret"] = o.Secret
70+
71+
for key, value := range o.AdditionalProperties {
72+
toSerialize[key] = value
73+
}
74+
return datadog.Marshal(toSerialize)
75+
}
76+
77+
// UnmarshalJSON deserializes the given payload.
78+
func (o *ObservabilityPipelineEnrichmentTableFieldSecretLookup) UnmarshalJSON(bytes []byte) (err error) {
79+
all := struct {
80+
Secret *string `json:"secret"`
81+
}{}
82+
if err = datadog.Unmarshal(bytes, &all); err != nil {
83+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
84+
}
85+
if all.Secret == nil {
86+
return fmt.Errorf("required field secret missing")
87+
}
88+
additionalProperties := make(map[string]interface{})
89+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
90+
datadog.DeleteKeys(additionalProperties, &[]string{"secret"})
91+
} else {
92+
return err
93+
}
94+
o.Secret = *all.Secret
95+
96+
if len(additionalProperties) > 0 {
97+
o.AdditionalProperties = additionalProperties
98+
}
99+
100+
return nil
101+
}

0 commit comments

Comments
 (0)