/
model_v1_rolling_update_deployment.go
164 lines (133 loc) · 5.89 KB
/
model_v1_rolling_update_deployment.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*
Arvancloud PaaS REST API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: v1.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package paas
import (
"encoding/json"
)
// checks if the V1RollingUpdateDeployment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &V1RollingUpdateDeployment{}
// V1RollingUpdateDeployment Spec to control the desired behavior of rolling update.
type V1RollingUpdateDeployment struct {
// The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new ReplicaSet can be scaled up further, ensuring that total number of pods running at any time during the update is at most 130% of desired pods.
MaxSurge *string `json:"maxSurge,omitempty"`
// The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old ReplicaSet can be scaled down further, followed by scaling up the new ReplicaSet, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.
MaxUnavailable *string `json:"maxUnavailable,omitempty"`
}
// NewV1RollingUpdateDeployment instantiates a new V1RollingUpdateDeployment object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewV1RollingUpdateDeployment() *V1RollingUpdateDeployment {
this := V1RollingUpdateDeployment{}
return &this
}
// NewV1RollingUpdateDeploymentWithDefaults instantiates a new V1RollingUpdateDeployment object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewV1RollingUpdateDeploymentWithDefaults() *V1RollingUpdateDeployment {
this := V1RollingUpdateDeployment{}
return &this
}
// GetMaxSurge returns the MaxSurge field value if set, zero value otherwise.
func (o *V1RollingUpdateDeployment) GetMaxSurge() string {
if o == nil || IsNil(o.MaxSurge) {
var ret string
return ret
}
return *o.MaxSurge
}
// GetMaxSurgeOk returns a tuple with the MaxSurge field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1RollingUpdateDeployment) GetMaxSurgeOk() (*string, bool) {
if o == nil || IsNil(o.MaxSurge) {
return nil, false
}
return o.MaxSurge, true
}
// HasMaxSurge returns a boolean if a field has been set.
func (o *V1RollingUpdateDeployment) HasMaxSurge() bool {
if o != nil && !IsNil(o.MaxSurge) {
return true
}
return false
}
// SetMaxSurge gets a reference to the given string and assigns it to the MaxSurge field.
func (o *V1RollingUpdateDeployment) SetMaxSurge(v string) {
o.MaxSurge = &v
}
// GetMaxUnavailable returns the MaxUnavailable field value if set, zero value otherwise.
func (o *V1RollingUpdateDeployment) GetMaxUnavailable() string {
if o == nil || IsNil(o.MaxUnavailable) {
var ret string
return ret
}
return *o.MaxUnavailable
}
// GetMaxUnavailableOk returns a tuple with the MaxUnavailable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1RollingUpdateDeployment) GetMaxUnavailableOk() (*string, bool) {
if o == nil || IsNil(o.MaxUnavailable) {
return nil, false
}
return o.MaxUnavailable, true
}
// HasMaxUnavailable returns a boolean if a field has been set.
func (o *V1RollingUpdateDeployment) HasMaxUnavailable() bool {
if o != nil && !IsNil(o.MaxUnavailable) {
return true
}
return false
}
// SetMaxUnavailable gets a reference to the given string and assigns it to the MaxUnavailable field.
func (o *V1RollingUpdateDeployment) SetMaxUnavailable(v string) {
o.MaxUnavailable = &v
}
func (o V1RollingUpdateDeployment) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o V1RollingUpdateDeployment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.MaxSurge) {
toSerialize["maxSurge"] = o.MaxSurge
}
if !IsNil(o.MaxUnavailable) {
toSerialize["maxUnavailable"] = o.MaxUnavailable
}
return toSerialize, nil
}
type NullableV1RollingUpdateDeployment struct {
value *V1RollingUpdateDeployment
isSet bool
}
func (v NullableV1RollingUpdateDeployment) Get() *V1RollingUpdateDeployment {
return v.value
}
func (v *NullableV1RollingUpdateDeployment) Set(val *V1RollingUpdateDeployment) {
v.value = val
v.isSet = true
}
func (v NullableV1RollingUpdateDeployment) IsSet() bool {
return v.isSet
}
func (v *NullableV1RollingUpdateDeployment) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableV1RollingUpdateDeployment(val *V1RollingUpdateDeployment) *NullableV1RollingUpdateDeployment {
return &NullableV1RollingUpdateDeployment{value: val, isSet: true}
}
func (v NullableV1RollingUpdateDeployment) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableV1RollingUpdateDeployment) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}