Class: ArgoWorkflows::IoK8sApiCoreV1PersistentVolumeClaimStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb

Overview

PersistentVolumeClaimStatus is the current status of a persistent volume claim.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ IoK8sApiCoreV1PersistentVolumeClaimStatus

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 72

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'accessModes')
    if (value = attributes[:'accessModes']).is_a?(Array)
      self.access_modes = value
    end
  end

  if attributes.has_key?(:'allocatedResourceStatuses')
    if (value = attributes[:'allocatedResourceStatuses']).is_a?(Hash)
      self.allocated_resource_statuses = value
    end
  end

  if attributes.has_key?(:'allocatedResources')
    if (value = attributes[:'allocatedResources']).is_a?(Hash)
      self.allocated_resources = value
    end
  end

  if attributes.has_key?(:'capacity')
    if (value = attributes[:'capacity']).is_a?(Hash)
      self.capacity = value
    end
  end

  if attributes.has_key?(:'conditions')
    if (value = attributes[:'conditions']).is_a?(Array)
      self.conditions = value
    end
  end

  if attributes.has_key?(:'currentVolumeAttributesClassName')
    self.current_volume_attributes_class_name = attributes[:'currentVolumeAttributesClassName']
  end

  if attributes.has_key?(:'modifyVolumeStatus')
    self.modify_volume_status = attributes[:'modifyVolumeStatus']
  end

  if attributes.has_key?(:'phase')
    self.phase = attributes[:'phase']
  end
end

Instance Attribute Details

#access_modesObject

accessModes contains the actual access modes the volume backing the PVC has. More info: kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1



19
20
21
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 19

def access_modes
  @access_modes
end

#allocated_resource_statusesObject

allocatedResourceStatuses stores status of resource being resized for the given PVC. Key names follow standard Kubernetes label syntax. Valid values are either: * Un-prefixed keys: - storage - the capacity of the volume. * Custom resources must use implementation-defined prefixed names such as "example.com/my-custom-resource" Apart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used. ClaimResourceStatus can be in any of following states: - ControllerResizeInProgress: State set when resize controller starts resizing the volume in control-plane. - ControllerResizeFailed: State set when resize has failed in resize controller with a terminal error. - NodeResizePending: State set when resize controller has finished resizing the volume but further resizing of volume is needed on the node. - NodeResizeInProgress: State set when kubelet starts resizing the volume. - NodeResizeFailed: State set when resizing has failed in kubelet with a terminal error. Transient errors don’t set NodeResizeFailed. For example: if expanding a PVC for more capacity - this field can be one of the following states: - pvc.status.allocatedResourceStatus = "ControllerResizeInProgress" - pvc.status.allocatedResourceStatus = "ControllerResizeFailed" - pvc.status.allocatedResourceStatus = "NodeResizePending" - pvc.status.allocatedResourceStatus = "NodeResizeInProgress" - pvc.status.allocatedResourceStatus = "NodeResizeFailed" When this field is not set, it means that no resize operation is in progress for the given PVC. A controller that receives PVC update with previously unknown resourceName or ClaimResourceStatus should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.



22
23
24
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 22

def allocated_resource_statuses
  @allocated_resource_statuses
end

#allocated_resourcesObject

allocatedResources tracks the resources allocated to a PVC including its capacity. Key names follow standard Kubernetes label syntax. Valid values are either: * Un-prefixed keys: - storage - the capacity of the volume. * Custom resources must use implementation-defined prefixed names such as "example.com/my-custom-resource" Apart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used. Capacity reported here may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity. A controller that receives PVC update with previously unknown resourceName should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.



25
26
27
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 25

def allocated_resources
  @allocated_resources
end

#capacityObject

capacity represents the actual resources of the underlying volume.



28
29
30
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 28

def capacity
  @capacity
end

#conditionsObject

conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to ‘Resizing’.



31
32
33
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 31

def conditions
  @conditions
end

#current_volume_attributes_class_nameObject

currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is a beta field and requires enabling VolumeAttributesClass feature (off by default).



34
35
36
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 34

def current_volume_attributes_class_name
  @current_volume_attributes_class_name
end

#modify_volume_statusObject

ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is a beta field and requires enabling VolumeAttributesClass feature (off by default).



37
38
39
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 37

def modify_volume_status
  @modify_volume_status
end

#phaseObject

phase represents the current phase of PersistentVolumeClaim.



40
41
42
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 40

def phase
  @phase
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 43

def self.attribute_map
  {
    :'access_modes' => :'accessModes',
    :'allocated_resource_statuses' => :'allocatedResourceStatuses',
    :'allocated_resources' => :'allocatedResources',
    :'capacity' => :'capacity',
    :'conditions' => :'conditions',
    :'current_volume_attributes_class_name' => :'currentVolumeAttributesClassName',
    :'modify_volume_status' => :'modifyVolumeStatus',
    :'phase' => :'phase'
  }
end

.swagger_typesObject

Attribute type mapping.



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 57

def self.swagger_types
  {
    :'access_modes' => :'Array<String>',
    :'allocated_resource_statuses' => :'Hash<String, String>',
    :'allocated_resources' => :'Hash<String, IoK8sApimachineryPkgApiResourceQuantity>',
    :'capacity' => :'Hash<String, IoK8sApimachineryPkgApiResourceQuantity>',
    :'conditions' => :'Array<IoK8sApiCoreV1PersistentVolumeClaimCondition>',
    :'current_volume_attributes_class_name' => :'String',
    :'modify_volume_status' => :'IoK8sApiCoreV1ModifyVolumeStatus',
    :'phase' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 136

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      access_modes == o.access_modes &&
      allocated_resource_statuses == o.allocated_resource_statuses &&
      allocated_resources == o.allocated_resources &&
      capacity == o.capacity &&
      conditions == o.conditions &&
      current_volume_attributes_class_name == o.current_volume_attributes_class_name &&
      modify_volume_status == o.modify_volume_status &&
      phase == o.phase
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 185

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = ArgoWorkflows.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 251

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 164

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


151
152
153
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 151

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



157
158
159
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 157

def hash
  [access_modes, allocated_resource_statuses, allocated_resources, capacity, conditions, current_volume_attributes_class_name, modify_volume_status, phase].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



123
124
125
126
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 123

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



231
232
233
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 231

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



237
238
239
240
241
242
243
244
245
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 237

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



225
226
227
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 225

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



130
131
132
# File 'lib/argo_workflows/models/io_k8s_api_core_v1_persistent_volume_claim_status.rb', line 130

def valid?
  true
end