Class: Kubevirt::K8sIoApimachineryPkgApisMetaV1ObjectMeta
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Kubevirt::K8sIoApimachineryPkgApisMetaV1ObjectMeta
- Defined in:
- lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb
Overview
ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
Instance Attribute Summary collapse
-
#annotations ⇒ Object
Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata.
-
#deletion_grace_period_seconds ⇒ Object
Number of seconds allowed for this object to gracefully terminate before it will be removed from the system.
-
#deletion_timestamp ⇒ Object
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON.
-
#finalizers ⇒ Object
Must be empty before the object is deleted from the registry.
-
#generate_name ⇒ Object
GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided.
-
#generation ⇒ Object
A sequence number representing a specific generation of the desired state.
-
#labels ⇒ Object
Map of string keys and values that can be used to organize and categorize (scope and select) objects.
-
#managed_fields ⇒ Object
ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow.
-
#name ⇒ Object
Name must be unique within a namespace.
-
#namespace ⇒ Object
Namespace defines the space within which each name must be unique.
-
#owner_references ⇒ Object
List of objects depended by this object.
-
#resource_version ⇒ Object
An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed.
-
#self_link ⇒ Object
Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.
-
#uid ⇒ Object
UID is the unique in time and space value for this object.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ K8sIoApimachineryPkgApisMetaV1ObjectMeta
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ K8sIoApimachineryPkgApisMetaV1ObjectMeta
Initializes the object
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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 119 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Kubevirt::K8sIoApimachineryPkgApisMetaV1ObjectMeta` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Kubevirt::K8sIoApimachineryPkgApisMetaV1ObjectMeta`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'annotations') if (value = attributes[:'annotations']).is_a?(Hash) self.annotations = value end end if attributes.key?(:'deletion_grace_period_seconds') self.deletion_grace_period_seconds = attributes[:'deletion_grace_period_seconds'] end if attributes.key?(:'deletion_timestamp') self. = attributes[:'deletion_timestamp'] end if attributes.key?(:'finalizers') if (value = attributes[:'finalizers']).is_a?(Array) self.finalizers = value end end if attributes.key?(:'generate_name') self.generate_name = attributes[:'generate_name'] end if attributes.key?(:'generation') self.generation = attributes[:'generation'] end if attributes.key?(:'labels') if (value = attributes[:'labels']).is_a?(Hash) self.labels = value end end if attributes.key?(:'managed_fields') if (value = attributes[:'managed_fields']).is_a?(Array) self.managed_fields = value end end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'namespace') self.namespace = attributes[:'namespace'] end if attributes.key?(:'owner_references') if (value = attributes[:'owner_references']).is_a?(Array) self.owner_references = value end end if attributes.key?(:'resource_version') self.resource_version = attributes[:'resource_version'] end if attributes.key?(:'self_link') self.self_link = attributes[:'self_link'] end if attributes.key?(:'uid') self.uid = attributes[:'uid'] end end |
Instance Attribute Details
#annotations ⇒ Object
Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: kubernetes.io/docs/concepts/overview/working-with-objects/annotations
20 21 22 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 20 def annotations @annotations end |
#deletion_grace_period_seconds ⇒ Object
Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.
23 24 25 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 23 def deletion_grace_period_seconds @deletion_grace_period_seconds end |
#deletion_timestamp ⇒ Object
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.
26 27 28 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 26 def end |
#finalizers ⇒ Object
Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.
29 30 31 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 29 def finalizers @finalizers end |
#generate_name ⇒ Object
GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. If this field is specified and the generated name exists, the server will return a 409. Applied only if Name is not specified. More info: git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency
32 33 34 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 32 def generate_name @generate_name end |
#generation ⇒ Object
A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.
35 36 37 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 35 def generation @generation end |
#labels ⇒ Object
Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: kubernetes.io/docs/concepts/overview/working-with-objects/labels
38 39 40 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 38 def labels @labels end |
#managed_fields ⇒ Object
ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn’t need to set or understand this field. A workflow can be the user’s name, a controller’s name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object.
41 42 43 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 41 def managed_fields @managed_fields end |
#name ⇒ Object
Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: kubernetes.io/docs/concepts/overview/working-with-objects/names#names
44 45 46 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 44 def name @name end |
#namespace ⇒ Object
Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: kubernetes.io/docs/concepts/overview/working-with-objects/namespaces
47 48 49 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 47 def namespace @namespace end |
#owner_references ⇒ Object
List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.
50 51 52 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 50 def owner_references @owner_references end |
#resource_version ⇒ Object
An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
53 54 55 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 53 def resource_version @resource_version end |
#self_link ⇒ Object
Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.
56 57 58 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 56 def self_link @self_link end |
#uid ⇒ Object
UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. Populated by the system. Read-only. More info: kubernetes.io/docs/concepts/overview/working-with-objects/names#uids
59 60 61 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 59 def uid @uid end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
82 83 84 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 82 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
87 88 89 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 87 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 62 def self.attribute_map { :'annotations' => :'annotations', :'deletion_grace_period_seconds' => :'deletionGracePeriodSeconds', :'deletion_timestamp' => :'deletionTimestamp', :'finalizers' => :'finalizers', :'generate_name' => :'generateName', :'generation' => :'generation', :'labels' => :'labels', :'managed_fields' => :'managedFields', :'name' => :'name', :'namespace' => :'namespace', :'owner_references' => :'ownerReferences', :'resource_version' => :'resourceVersion', :'self_link' => :'selfLink', :'uid' => :'uid' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 251 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif 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[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
112 113 114 115 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 112 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 92 def self.openapi_types { :'annotations' => :'Hash<String, String>', :'deletion_grace_period_seconds' => :'Integer', :'deletion_timestamp' => :'Time', :'finalizers' => :'Array<String>', :'generate_name' => :'String', :'generation' => :'Integer', :'labels' => :'Hash<String, String>', :'managed_fields' => :'Array<K8sIoApimachineryPkgApisMetaV1ManagedFieldsEntry>', :'name' => :'String', :'namespace' => :'String', :'owner_references' => :'Array<K8sIoApimachineryPkgApisMetaV1OwnerReference>', :'resource_version' => :'String', :'self_link' => :'String', :'uid' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 217 def ==(o) return true if self.equal?(o) self.class == o.class && annotations == o.annotations && deletion_grace_period_seconds == o.deletion_grace_period_seconds && == o. && finalizers == o.finalizers && generate_name == o.generate_name && generation == o.generation && labels == o.labels && managed_fields == o.managed_fields && name == o.name && namespace == o.namespace && owner_references == o.owner_references && resource_version == o.resource_version && self_link == o.self_link && uid == o.uid end |
#eql?(o) ⇒ Boolean
238 239 240 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 238 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
244 245 246 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 244 def hash [annotations, deletion_grace_period_seconds, , finalizers, generate_name, generation, labels, managed_fields, name, namespace, owner_references, resource_version, self_link, uid].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
202 203 204 205 206 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 202 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 273 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
210 211 212 213 |
# File 'lib/kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_object_meta.rb', line 210 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |