Skip to content

Commit 9b3f2ec

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[FA] Add fleet deployments/upgrade endpoint (#3445)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 0f313c8 commit 9b3f2ec

File tree

48 files changed

+6528
-52
lines changed

Some content is hidden

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

48 files changed

+6528
-52
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 1062 additions & 18 deletions
Large diffs are not rendered by default.

api/datadog/configuration.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,16 @@ func NewConfiguration() *Configuration {
602602
unstableOperations: map[string]bool{
603603
"v2.CancelFleetDeployment": false,
604604
"v2.CreateFleetDeploymentConfigure": false,
605+
"v2.CreateFleetDeploymentUpgrade": false,
606+
"v2.CreateFleetSchedule": false,
607+
"v2.DeleteFleetSchedule": false,
605608
"v2.GetFleetDeployment": false,
609+
"v2.GetFleetSchedule": false,
610+
"v2.ListFleetAgentVersions": false,
606611
"v2.ListFleetDeployments": false,
612+
"v2.ListFleetSchedules": false,
613+
"v2.TriggerFleetSchedule": false,
614+
"v2.UpdateFleetSchedule": false,
607615
"v2.CreateOpenAPI": false,
608616
"v2.DeleteOpenAPI": false,
609617
"v2.GetOpenAPI": false,

api/datadogV2/api_fleet_automation.go

Lines changed: 840 additions & 12 deletions
Large diffs are not rendered by default.

api/datadogV2/doc.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,16 @@
250250
// - [FastlyIntegrationApi.UpdateFastlyService]
251251
// - [FleetAutomationApi.CancelFleetDeployment]
252252
// - [FleetAutomationApi.CreateFleetDeploymentConfigure]
253+
// - [FleetAutomationApi.CreateFleetDeploymentUpgrade]
254+
// - [FleetAutomationApi.CreateFleetSchedule]
255+
// - [FleetAutomationApi.DeleteFleetSchedule]
253256
// - [FleetAutomationApi.GetFleetDeployment]
257+
// - [FleetAutomationApi.GetFleetSchedule]
258+
// - [FleetAutomationApi.ListFleetAgentVersions]
254259
// - [FleetAutomationApi.ListFleetDeployments]
260+
// - [FleetAutomationApi.ListFleetSchedules]
261+
// - [FleetAutomationApi.TriggerFleetSchedule]
262+
// - [FleetAutomationApi.UpdateFleetSchedule]
255263
// - [GCPIntegrationApi.CreateGCPSTSAccount]
256264
// - [GCPIntegrationApi.DeleteGCPSTSAccount]
257265
// - [GCPIntegrationApi.GetGCPSTSDelegate]
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
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+
// FleetAgentVersion Represents an available Datadog Agent version.
14+
type FleetAgentVersion struct {
15+
//
16+
Attributes *FleetAgentVersionAttributes `json:"attributes,omitempty"`
17+
// Unique identifier for the Agent version (same as version).
18+
Id string `json:"id"`
19+
// The type of Agent version resource.
20+
Type FleetAgentVersionResourceType `json:"type"`
21+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
22+
UnparsedObject map[string]interface{} `json:"-"`
23+
AdditionalProperties map[string]interface{} `json:"-"`
24+
}
25+
26+
// NewFleetAgentVersion instantiates a new FleetAgentVersion object.
27+
// This constructor will assign default values to properties that have it defined,
28+
// and makes sure properties required by API are set, but the set of arguments
29+
// will change when the set of required properties is changed.
30+
func NewFleetAgentVersion(id string, typeVar FleetAgentVersionResourceType) *FleetAgentVersion {
31+
this := FleetAgentVersion{}
32+
this.Id = id
33+
this.Type = typeVar
34+
return &this
35+
}
36+
37+
// NewFleetAgentVersionWithDefaults instantiates a new FleetAgentVersion object.
38+
// This constructor will only assign default values to properties that have it defined,
39+
// but it doesn't guarantee that properties required by API are set.
40+
func NewFleetAgentVersionWithDefaults() *FleetAgentVersion {
41+
this := FleetAgentVersion{}
42+
var typeVar FleetAgentVersionResourceType = FLEETAGENTVERSIONRESOURCETYPE_AGENT_VERSION
43+
this.Type = typeVar
44+
return &this
45+
}
46+
47+
// GetAttributes returns the Attributes field value if set, zero value otherwise.
48+
func (o *FleetAgentVersion) GetAttributes() FleetAgentVersionAttributes {
49+
if o == nil || o.Attributes == nil {
50+
var ret FleetAgentVersionAttributes
51+
return ret
52+
}
53+
return *o.Attributes
54+
}
55+
56+
// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
57+
// and a boolean to check if the value has been set.
58+
func (o *FleetAgentVersion) GetAttributesOk() (*FleetAgentVersionAttributes, bool) {
59+
if o == nil || o.Attributes == nil {
60+
return nil, false
61+
}
62+
return o.Attributes, true
63+
}
64+
65+
// HasAttributes returns a boolean if a field has been set.
66+
func (o *FleetAgentVersion) HasAttributes() bool {
67+
return o != nil && o.Attributes != nil
68+
}
69+
70+
// SetAttributes gets a reference to the given FleetAgentVersionAttributes and assigns it to the Attributes field.
71+
func (o *FleetAgentVersion) SetAttributes(v FleetAgentVersionAttributes) {
72+
o.Attributes = &v
73+
}
74+
75+
// GetId returns the Id field value.
76+
func (o *FleetAgentVersion) GetId() string {
77+
if o == nil {
78+
var ret string
79+
return ret
80+
}
81+
return o.Id
82+
}
83+
84+
// GetIdOk returns a tuple with the Id field value
85+
// and a boolean to check if the value has been set.
86+
func (o *FleetAgentVersion) GetIdOk() (*string, bool) {
87+
if o == nil {
88+
return nil, false
89+
}
90+
return &o.Id, true
91+
}
92+
93+
// SetId sets field value.
94+
func (o *FleetAgentVersion) SetId(v string) {
95+
o.Id = v
96+
}
97+
98+
// GetType returns the Type field value.
99+
func (o *FleetAgentVersion) GetType() FleetAgentVersionResourceType {
100+
if o == nil {
101+
var ret FleetAgentVersionResourceType
102+
return ret
103+
}
104+
return o.Type
105+
}
106+
107+
// GetTypeOk returns a tuple with the Type field value
108+
// and a boolean to check if the value has been set.
109+
func (o *FleetAgentVersion) GetTypeOk() (*FleetAgentVersionResourceType, bool) {
110+
if o == nil {
111+
return nil, false
112+
}
113+
return &o.Type, true
114+
}
115+
116+
// SetType sets field value.
117+
func (o *FleetAgentVersion) SetType(v FleetAgentVersionResourceType) {
118+
o.Type = v
119+
}
120+
121+
// MarshalJSON serializes the struct using spec logic.
122+
func (o FleetAgentVersion) MarshalJSON() ([]byte, error) {
123+
toSerialize := map[string]interface{}{}
124+
if o.UnparsedObject != nil {
125+
return datadog.Marshal(o.UnparsedObject)
126+
}
127+
if o.Attributes != nil {
128+
toSerialize["attributes"] = o.Attributes
129+
}
130+
toSerialize["id"] = o.Id
131+
toSerialize["type"] = o.Type
132+
133+
for key, value := range o.AdditionalProperties {
134+
toSerialize[key] = value
135+
}
136+
return datadog.Marshal(toSerialize)
137+
}
138+
139+
// UnmarshalJSON deserializes the given payload.
140+
func (o *FleetAgentVersion) UnmarshalJSON(bytes []byte) (err error) {
141+
all := struct {
142+
Attributes *FleetAgentVersionAttributes `json:"attributes,omitempty"`
143+
Id *string `json:"id"`
144+
Type *FleetAgentVersionResourceType `json:"type"`
145+
}{}
146+
if err = datadog.Unmarshal(bytes, &all); err != nil {
147+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
148+
}
149+
if all.Id == nil {
150+
return fmt.Errorf("required field id missing")
151+
}
152+
if all.Type == nil {
153+
return fmt.Errorf("required field type missing")
154+
}
155+
additionalProperties := make(map[string]interface{})
156+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
157+
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"})
158+
} else {
159+
return err
160+
}
161+
162+
hasInvalidField := false
163+
if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
164+
hasInvalidField = true
165+
}
166+
o.Attributes = all.Attributes
167+
o.Id = *all.Id
168+
if !all.Type.IsValid() {
169+
hasInvalidField = true
170+
} else {
171+
o.Type = *all.Type
172+
}
173+
174+
if len(additionalProperties) > 0 {
175+
o.AdditionalProperties = additionalProperties
176+
}
177+
178+
if hasInvalidField {
179+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
180+
}
181+
182+
return nil
183+
}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
9+
)
10+
11+
// FleetAgentVersionAttributes
12+
type FleetAgentVersionAttributes struct {
13+
// The Agent version string.
14+
Version *string `json:"version,omitempty"`
15+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
16+
UnparsedObject map[string]interface{} `json:"-"`
17+
AdditionalProperties map[string]interface{} `json:"-"`
18+
}
19+
20+
// NewFleetAgentVersionAttributes instantiates a new FleetAgentVersionAttributes object.
21+
// This constructor will assign default values to properties that have it defined,
22+
// and makes sure properties required by API are set, but the set of arguments
23+
// will change when the set of required properties is changed.
24+
func NewFleetAgentVersionAttributes() *FleetAgentVersionAttributes {
25+
this := FleetAgentVersionAttributes{}
26+
return &this
27+
}
28+
29+
// NewFleetAgentVersionAttributesWithDefaults instantiates a new FleetAgentVersionAttributes object.
30+
// This constructor will only assign default values to properties that have it defined,
31+
// but it doesn't guarantee that properties required by API are set.
32+
func NewFleetAgentVersionAttributesWithDefaults() *FleetAgentVersionAttributes {
33+
this := FleetAgentVersionAttributes{}
34+
return &this
35+
}
36+
37+
// GetVersion returns the Version field value if set, zero value otherwise.
38+
func (o *FleetAgentVersionAttributes) GetVersion() string {
39+
if o == nil || o.Version == nil {
40+
var ret string
41+
return ret
42+
}
43+
return *o.Version
44+
}
45+
46+
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
47+
// and a boolean to check if the value has been set.
48+
func (o *FleetAgentVersionAttributes) GetVersionOk() (*string, bool) {
49+
if o == nil || o.Version == nil {
50+
return nil, false
51+
}
52+
return o.Version, true
53+
}
54+
55+
// HasVersion returns a boolean if a field has been set.
56+
func (o *FleetAgentVersionAttributes) HasVersion() bool {
57+
return o != nil && o.Version != nil
58+
}
59+
60+
// SetVersion gets a reference to the given string and assigns it to the Version field.
61+
func (o *FleetAgentVersionAttributes) SetVersion(v string) {
62+
o.Version = &v
63+
}
64+
65+
// MarshalJSON serializes the struct using spec logic.
66+
func (o FleetAgentVersionAttributes) MarshalJSON() ([]byte, error) {
67+
toSerialize := map[string]interface{}{}
68+
if o.UnparsedObject != nil {
69+
return datadog.Marshal(o.UnparsedObject)
70+
}
71+
if o.Version != nil {
72+
toSerialize["version"] = o.Version
73+
}
74+
75+
for key, value := range o.AdditionalProperties {
76+
toSerialize[key] = value
77+
}
78+
return datadog.Marshal(toSerialize)
79+
}
80+
81+
// UnmarshalJSON deserializes the given payload.
82+
func (o *FleetAgentVersionAttributes) UnmarshalJSON(bytes []byte) (err error) {
83+
all := struct {
84+
Version *string `json:"version,omitempty"`
85+
}{}
86+
if err = datadog.Unmarshal(bytes, &all); err != nil {
87+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
88+
}
89+
additionalProperties := make(map[string]interface{})
90+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
91+
datadog.DeleteKeys(additionalProperties, &[]string{"version"})
92+
} else {
93+
return err
94+
}
95+
o.Version = all.Version
96+
97+
if len(additionalProperties) > 0 {
98+
o.AdditionalProperties = additionalProperties
99+
}
100+
101+
return nil
102+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
// FleetAgentVersionResourceType The type of Agent version resource.
14+
type FleetAgentVersionResourceType string
15+
16+
// List of FleetAgentVersionResourceType.
17+
const (
18+
FLEETAGENTVERSIONRESOURCETYPE_AGENT_VERSION FleetAgentVersionResourceType = "agent_version"
19+
)
20+
21+
var allowedFleetAgentVersionResourceTypeEnumValues = []FleetAgentVersionResourceType{
22+
FLEETAGENTVERSIONRESOURCETYPE_AGENT_VERSION,
23+
}
24+
25+
// GetAllowedValues reeturns the list of possible values.
26+
func (v *FleetAgentVersionResourceType) GetAllowedValues() []FleetAgentVersionResourceType {
27+
return allowedFleetAgentVersionResourceTypeEnumValues
28+
}
29+
30+
// UnmarshalJSON deserializes the given payload.
31+
func (v *FleetAgentVersionResourceType) UnmarshalJSON(src []byte) error {
32+
var value string
33+
err := datadog.Unmarshal(src, &value)
34+
if err != nil {
35+
return err
36+
}
37+
*v = FleetAgentVersionResourceType(value)
38+
return nil
39+
}
40+
41+
// NewFleetAgentVersionResourceTypeFromValue returns a pointer to a valid FleetAgentVersionResourceType
42+
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
43+
func NewFleetAgentVersionResourceTypeFromValue(v string) (*FleetAgentVersionResourceType, error) {
44+
ev := FleetAgentVersionResourceType(v)
45+
if ev.IsValid() {
46+
return &ev, nil
47+
}
48+
return nil, fmt.Errorf("invalid value '%v' for FleetAgentVersionResourceType: valid values are %v", v, allowedFleetAgentVersionResourceTypeEnumValues)
49+
}
50+
51+
// IsValid return true if the value is valid for the enum, false otherwise.
52+
func (v FleetAgentVersionResourceType) IsValid() bool {
53+
for _, existing := range allowedFleetAgentVersionResourceTypeEnumValues {
54+
if existing == v {
55+
return true
56+
}
57+
}
58+
return false
59+
}
60+
61+
// Ptr returns reference to FleetAgentVersionResourceType value.
62+
func (v FleetAgentVersionResourceType) Ptr() *FleetAgentVersionResourceType {
63+
return &v
64+
}

0 commit comments

Comments
 (0)