ruby-linstor-client 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -4
  3. data/codegen.sh +1 -1
  4. data/generator/custom/one_of_drbd_volume_luks_volume_storage_nvme_volme_writecache_volume.rb +1 -1
  5. data/generator/custom/one_of_drbd_volume_luks_volume_storage_nvme_volme_writecache_volume_cache_volume.rb +11 -0
  6. data/lib/ruby-linstor-client/api/developers_api.rb +923 -103
  7. data/lib/ruby-linstor-client/api_client.rb +2 -2
  8. data/lib/ruby-linstor-client/api_error.rb +2 -2
  9. data/lib/ruby-linstor-client/configuration.rb +2 -2
  10. data/lib/ruby-linstor-client/models/api_call_rc.rb +2 -2
  11. data/lib/ruby-linstor-client/models/auto_place_request.rb +2 -2
  12. data/lib/ruby-linstor-client/models/auto_select_filter.rb +25 -3
  13. data/lib/ruby-linstor-client/models/cache_resource.rb +220 -0
  14. data/lib/ruby-linstor-client/models/cache_volume.rb +276 -0
  15. data/lib/ruby-linstor-client/models/candidate.rb +2 -2
  16. data/lib/ruby-linstor-client/models/controller_config.rb +272 -0
  17. data/lib/ruby-linstor-client/models/controller_config_config.rb +218 -0
  18. data/lib/ruby-linstor-client/models/controller_config_db.rb +263 -0
  19. data/lib/ruby-linstor-client/models/controller_config_db_etcd.rb +227 -0
  20. data/lib/ruby-linstor-client/models/controller_config_debug.rb +218 -0
  21. data/lib/ruby-linstor-client/models/controller_config_http.rb +236 -0
  22. data/lib/ruby-linstor-client/models/controller_config_https.rb +236 -0
  23. data/lib/ruby-linstor-client/models/controller_config_ldap.rb +263 -0
  24. data/lib/ruby-linstor-client/models/controller_config_log.rb +315 -0
  25. data/lib/ruby-linstor-client/models/controller_props_modify.rb +2 -2
  26. data/lib/ruby-linstor-client/models/controller_version.rb +2 -2
  27. data/lib/ruby-linstor-client/models/drbd_connection.rb +262 -0
  28. data/lib/ruby-linstor-client/models/drbd_proxy_enable.rb +2 -2
  29. data/lib/ruby-linstor-client/models/drbd_proxy_modify.rb +2 -2
  30. data/lib/ruby-linstor-client/models/drbd_resource.rb +35 -6
  31. data/lib/ruby-linstor-client/models/drbd_resource_definition_layer.rb +2 -2
  32. data/lib/ruby-linstor-client/models/drbd_volume.rb +2 -2
  33. data/lib/ruby-linstor-client/models/drbd_volume_definition.rb +2 -2
  34. data/lib/ruby-linstor-client/models/error_report.rb +87 -7
  35. data/lib/ruby-linstor-client/models/error_report_delete.rb +273 -0
  36. data/lib/ruby-linstor-client/models/event_may_promote_change.rb +237 -0
  37. data/lib/ruby-linstor-client/models/key_value_store.rb +2 -2
  38. data/lib/ruby-linstor-client/models/key_value_store_modify.rb +2 -2
  39. data/lib/ruby-linstor-client/models/layer_type.rb +4 -2
  40. data/lib/ruby-linstor-client/models/log_level.rb +40 -0
  41. data/lib/ruby-linstor-client/models/luks_resource.rb +2 -2
  42. data/lib/ruby-linstor-client/models/luks_volume.rb +2 -2
  43. data/lib/ruby-linstor-client/models/max_volume_sizes.rb +2 -2
  44. data/lib/ruby-linstor-client/models/net_interface.rb +2 -2
  45. data/lib/ruby-linstor-client/models/node.rb +4 -4
  46. data/lib/ruby-linstor-client/models/node_modify.rb +2 -2
  47. data/lib/ruby-linstor-client/models/nvme_resource.rb +2 -2
  48. data/lib/ruby-linstor-client/models/nvme_volume.rb +2 -2
  49. data/lib/ruby-linstor-client/models/one_of_drbd_volume_luks_volume_storage_nvme_volme_writecache_volume.rb +1 -1
  50. data/lib/ruby-linstor-client/models/one_of_drbd_volume_luks_volume_storage_nvme_volme_writecache_volume_cache_volume.rb +11 -0
  51. data/lib/ruby-linstor-client/models/openflex_resource.rb +229 -0
  52. data/lib/ruby-linstor-client/models/openflex_resource_definition_layer.rb +227 -0
  53. data/lib/ruby-linstor-client/models/openflex_volume.rb +256 -0
  54. data/lib/ruby-linstor-client/models/pass_phrase_create.rb +2 -2
  55. data/lib/ruby-linstor-client/models/physical_storage.rb +2 -2
  56. data/lib/ruby-linstor-client/models/physical_storage_create.rb +2 -2
  57. data/lib/ruby-linstor-client/models/physical_storage_device.rb +2 -2
  58. data/lib/ruby-linstor-client/models/physical_storage_storage_pool_create.rb +2 -2
  59. data/lib/ruby-linstor-client/models/provider_kind.rb +3 -2
  60. data/lib/ruby-linstor-client/models/resource.rb +16 -6
  61. data/lib/ruby-linstor-client/models/resource_connection.rb +2 -2
  62. data/lib/ruby-linstor-client/models/resource_connection_modify.rb +2 -2
  63. data/lib/ruby-linstor-client/models/resource_create.rb +2 -2
  64. data/lib/ruby-linstor-client/models/resource_definition.rb +2 -2
  65. data/lib/ruby-linstor-client/models/resource_definition_create.rb +2 -2
  66. data/lib/ruby-linstor-client/models/resource_definition_layer.rb +3 -3
  67. data/lib/ruby-linstor-client/models/resource_definition_modify.rb +16 -6
  68. data/lib/ruby-linstor-client/models/resource_group.rb +2 -2
  69. data/lib/ruby-linstor-client/models/resource_group_modify.rb +2 -2
  70. data/lib/ruby-linstor-client/models/resource_group_spawn.rb +22 -3
  71. data/lib/ruby-linstor-client/models/resource_layer.rb +24 -6
  72. data/lib/ruby-linstor-client/models/resource_modify.rb +2 -2
  73. data/lib/ruby-linstor-client/models/resource_state.rb +2 -2
  74. data/lib/ruby-linstor-client/models/resource_with_volumes.rb +13 -3
  75. data/lib/ruby-linstor-client/models/resource_with_volumes_all_of.rb +2 -2
  76. data/lib/ruby-linstor-client/models/satellite_config.rb +272 -0
  77. data/lib/ruby-linstor-client/models/satellite_config_log.rb +245 -0
  78. data/lib/ruby-linstor-client/models/satellite_config_net.rb +236 -0
  79. data/lib/ruby-linstor-client/models/snapshot.rb +17 -6
  80. data/lib/ruby-linstor-client/models/snapshot_node.rb +261 -0
  81. data/lib/ruby-linstor-client/models/snapshot_restore.rb +2 -2
  82. data/lib/ruby-linstor-client/models/snapshot_shipping.rb +259 -0
  83. data/lib/ruby-linstor-client/models/snapshot_shipping_status.rb +279 -0
  84. data/lib/ruby-linstor-client/models/snapshot_volume_definition.rb +2 -2
  85. data/lib/ruby-linstor-client/models/storage_pool.rb +2 -2
  86. data/lib/ruby-linstor-client/models/storage_pool_definition.rb +2 -2
  87. data/lib/ruby-linstor-client/models/storage_pool_definition_modify.rb +2 -2
  88. data/lib/ruby-linstor-client/models/storage_resource.rb +2 -2
  89. data/lib/ruby-linstor-client/models/storage_volume.rb +2 -2
  90. data/lib/ruby-linstor-client/models/volume.rb +2 -2
  91. data/lib/ruby-linstor-client/models/volume_definition.rb +2 -2
  92. data/lib/ruby-linstor-client/models/volume_definition_create.rb +2 -2
  93. data/lib/ruby-linstor-client/models/volume_definition_layer.rb +2 -2
  94. data/lib/ruby-linstor-client/models/volume_definition_modify.rb +2 -2
  95. data/lib/ruby-linstor-client/models/volume_group.rb +2 -2
  96. data/lib/ruby-linstor-client/models/volume_group_modify.rb +2 -2
  97. data/lib/ruby-linstor-client/models/volume_layer.rb +3 -3
  98. data/lib/ruby-linstor-client/models/volume_modify.rb +2 -2
  99. data/lib/ruby-linstor-client/models/volume_state.rb +2 -2
  100. data/lib/ruby-linstor-client/models/writecache_resource.rb +2 -2
  101. data/lib/ruby-linstor-client/models/writecache_volume.rb +2 -2
  102. data/lib/ruby-linstor-client/version.rb +3 -3
  103. data/lib/ruby-linstor-client.rb +26 -2
  104. data/pkg/ruby-linstor-client-1.0.0.gem +0 -0
  105. data/spec/api_client_spec.rb +2 -2
  106. data/spec/configuration_spec.rb +2 -2
  107. data/spec/models/cache_resource_spec.rb +34 -0
  108. data/spec/models/cache_volume_spec.rb +70 -0
  109. data/spec/models/controller_config_config_spec.rb +34 -0
  110. data/spec/models/controller_config_db_etcd_spec.rb +40 -0
  111. data/spec/models/controller_config_db_spec.rb +64 -0
  112. data/spec/models/controller_config_debug_spec.rb +34 -0
  113. data/spec/models/controller_config_http_spec.rb +46 -0
  114. data/spec/models/controller_config_https_spec.rb +46 -0
  115. data/spec/models/controller_config_ldap_spec.rb +64 -0
  116. data/spec/models/controller_config_log_spec.rb +80 -0
  117. data/spec/models/controller_config_spec.rb +70 -0
  118. data/spec/models/drbd_connection_spec.rb +44 -0
  119. data/spec/models/error_report_delete_spec.rb +64 -0
  120. data/spec/models/event_may_promote_change_spec.rb +46 -0
  121. data/spec/models/log_level_spec.rb +28 -0
  122. data/spec/models/openflex_resource_definition_layer_spec.rb +40 -0
  123. data/spec/models/openflex_resource_spec.rb +40 -0
  124. data/spec/models/openflex_volume_spec.rb +58 -0
  125. data/spec/models/satellite_config_log_spec.rb +52 -0
  126. data/spec/models/satellite_config_net_spec.rb +46 -0
  127. data/spec/models/satellite_config_spec.rb +70 -0
  128. data/spec/models/snapshot_node_spec.rb +58 -0
  129. data/spec/models/snapshot_shipping_spec.rb +52 -0
  130. data/spec/models/snapshot_shipping_status_spec.rb +56 -0
  131. data/spec/spec_helper.rb +2 -2
  132. metadata +77 -3
@@ -0,0 +1,218 @@
1
+ =begin
2
+ #Linstor REST API
3
+
4
+ #Linstor REST API V1 The V1 rest api of Linstor should stay compatible and only additions are made to the API, If there are breaking changes or redesigned a new major REST API version will be issued. Server runs per default on port `3370` on `::` ipv6 and ipv4. To change the bind address or port you can use the following linstor client commands: ``` linstor controller set-property REST/bindAddress 127.0.0.1 linstor controller set-property REST/port 8080 ``` After setting this properties restart the controller and the new values should be used. Changelog: * 1.5.0 - Added etcd.prefix to ControllerConfigDbEtcd parameters * 1.4.0 - Added promotion_score and may_promote to DrbdResource object - Added /v1/error-reports DELETE method, to delete a range of error reports or single ones - Added SSE (Server Sent Events) url /v1/events/drbd/promotion * 1.3.0 - Added /v1/view/snapshot-shippings * 1.2.0 - Added optional AutoSelectFilter to resource-group/spawn - Added /v1/nodes/{node}/config, that allows you to get and set the satellite config - Added /v1/sos-report to create bug reports you can send to linbit - Added new fields to the ErrorReport object - Added /v1/resource-definitions/{resource}/snapshot-shipping - Allow to modify the resource group in Resource definitions - Added createTimestamp to Resource and Snapshot - Added default value (null) for AutoPlaceRequest's layer_list * 1.1.0 - Added /v1/view/snapshots for a faster all in one snapshot list - Filter lists by properties: - /v1/nodes - /v1/resource-definitions - /v1/resource-groups - /v1/view/storage-pools - /v1/view/resources * 1.0.16 - Added CacheResource and CacheVolume schemas - AutSelectFilter arrays are now null per default * 1.0.15 - Added connections map to the DRBD resource layer data - Added support for Openflex * 1.0.14 - Added /v1/controller/config, that gives you the controller config information * 1.0.13 - Fixed broken volume definition modify `flags` handling - Added flags to volume groups (create/modify) * 1.0.12 - Added WritecacheResource and WritecacheVolume schemas. - Removed support for swordfish - Added `with_storage_pool` to PhysicalStorageCreate post request, allowing to create linstor storage pools too - Added `gross` flag for volume-definition size - Added flags to VolumeDefinitionModify (so that `gross` flag can be changed) - Added query-max-volume-size to resource-groups * 1.0.11 - Added /v1/physical-storage endpoint, that lets you query and create lvm/zfs pools - Extended Node with list of supported providers and layers as well as lists of reasons for unsupported providers and layers * 1.0.10 - Added `reports` array field to Volume object, contains ApiCallRcs for problems - Changed `ResourceDefinitions` can now include `VolumeDefinitions` in `volume_definitions` field - Added various filter query parameters * 1.0.9 - Added supports_snapshots to StoragePool * 1.0.8 - Added /v1/resource-groups - Added /v1/resource-groups/{rscgrp}/volume-groups - Moved AutoSelectFilter::place_count default indirectly to create resource implementation - Added diskless_on_remaining to AutoSelectFilter - Changed /v1/view/resources return type to ResourceWithVolumes ResourceWithVolumes is now a child type of Resource (removed volumes from Resource) * 1.0.7 - Added ext_meta_stor_pool to DrbdVolume - Added is_active field to the NetInterface type * 1.0.6 - Added /v1/resource-definitions/{rscName}/resources/{nodeName}/volumes/{vlmnr} PUT * 1.0.5 - Added `reports` field to StoragePool object * 1.0.4 - Added /v1/view/storage-pools overview path - Added uuid fields for objects * 1.0.3 - Added /v1/view/resources overview path - documentation schema extraction * 1.0.2 - Added /v1/storage-pool-definitions object path - added NVME layer object type * 1.0.1 - Documentation review and updates - no functional changes * 1.0.0 - Initial REST API v1
5
+
6
+ The version of the OpenAPI document: 1.5.0
7
+ Contact: rene.peinthor@linbit.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module LinstorClient
17
+ class ControllerConfigConfig
18
+ attr_accessor :dir
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'dir' => :'dir'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'dir' => :'String'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LinstorClient::ControllerConfigConfig` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LinstorClient::ControllerConfigConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'dir')
61
+ self.dir = attributes[:'dir']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ dir == o.dir
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [dir].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.openapi_types.each_pair do |key, type|
111
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
+ self.send("#{key}=", nil)
113
+ elsif type =~ /\AArray<(.*)>/i
114
+ # check to ensure the input is an array given that the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
118
+ end
119
+ elsif !attributes[self.class.attribute_map[key]].nil?
120
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
+ end
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :Time
134
+ Time.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :Boolean
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ # models (e.g. Pet) or oneOf
165
+ klass = LinstorClient.const_get(type)
166
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
167
+ end
168
+ end
169
+
170
+ # Returns the string representation of the object
171
+ # @return [String] String presentation of the object
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_hash (backward compatibility)
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_body
179
+ to_hash
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map { |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+
216
+ end
217
+
218
+ end
@@ -0,0 +1,263 @@
1
+ =begin
2
+ #Linstor REST API
3
+
4
+ #Linstor REST API V1 The V1 rest api of Linstor should stay compatible and only additions are made to the API, If there are breaking changes or redesigned a new major REST API version will be issued. Server runs per default on port `3370` on `::` ipv6 and ipv4. To change the bind address or port you can use the following linstor client commands: ``` linstor controller set-property REST/bindAddress 127.0.0.1 linstor controller set-property REST/port 8080 ``` After setting this properties restart the controller and the new values should be used. Changelog: * 1.5.0 - Added etcd.prefix to ControllerConfigDbEtcd parameters * 1.4.0 - Added promotion_score and may_promote to DrbdResource object - Added /v1/error-reports DELETE method, to delete a range of error reports or single ones - Added SSE (Server Sent Events) url /v1/events/drbd/promotion * 1.3.0 - Added /v1/view/snapshot-shippings * 1.2.0 - Added optional AutoSelectFilter to resource-group/spawn - Added /v1/nodes/{node}/config, that allows you to get and set the satellite config - Added /v1/sos-report to create bug reports you can send to linbit - Added new fields to the ErrorReport object - Added /v1/resource-definitions/{resource}/snapshot-shipping - Allow to modify the resource group in Resource definitions - Added createTimestamp to Resource and Snapshot - Added default value (null) for AutoPlaceRequest's layer_list * 1.1.0 - Added /v1/view/snapshots for a faster all in one snapshot list - Filter lists by properties: - /v1/nodes - /v1/resource-definitions - /v1/resource-groups - /v1/view/storage-pools - /v1/view/resources * 1.0.16 - Added CacheResource and CacheVolume schemas - AutSelectFilter arrays are now null per default * 1.0.15 - Added connections map to the DRBD resource layer data - Added support for Openflex * 1.0.14 - Added /v1/controller/config, that gives you the controller config information * 1.0.13 - Fixed broken volume definition modify `flags` handling - Added flags to volume groups (create/modify) * 1.0.12 - Added WritecacheResource and WritecacheVolume schemas. - Removed support for swordfish - Added `with_storage_pool` to PhysicalStorageCreate post request, allowing to create linstor storage pools too - Added `gross` flag for volume-definition size - Added flags to VolumeDefinitionModify (so that `gross` flag can be changed) - Added query-max-volume-size to resource-groups * 1.0.11 - Added /v1/physical-storage endpoint, that lets you query and create lvm/zfs pools - Extended Node with list of supported providers and layers as well as lists of reasons for unsupported providers and layers * 1.0.10 - Added `reports` array field to Volume object, contains ApiCallRcs for problems - Changed `ResourceDefinitions` can now include `VolumeDefinitions` in `volume_definitions` field - Added various filter query parameters * 1.0.9 - Added supports_snapshots to StoragePool * 1.0.8 - Added /v1/resource-groups - Added /v1/resource-groups/{rscgrp}/volume-groups - Moved AutoSelectFilter::place_count default indirectly to create resource implementation - Added diskless_on_remaining to AutoSelectFilter - Changed /v1/view/resources return type to ResourceWithVolumes ResourceWithVolumes is now a child type of Resource (removed volumes from Resource) * 1.0.7 - Added ext_meta_stor_pool to DrbdVolume - Added is_active field to the NetInterface type * 1.0.6 - Added /v1/resource-definitions/{rscName}/resources/{nodeName}/volumes/{vlmnr} PUT * 1.0.5 - Added `reports` field to StoragePool object * 1.0.4 - Added /v1/view/storage-pools overview path - Added uuid fields for objects * 1.0.3 - Added /v1/view/resources overview path - documentation schema extraction * 1.0.2 - Added /v1/storage-pool-definitions object path - added NVME layer object type * 1.0.1 - Documentation review and updates - no functional changes * 1.0.0 - Initial REST API v1
5
+
6
+ The version of the OpenAPI document: 1.5.0
7
+ Contact: rene.peinthor@linbit.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module LinstorClient
17
+ class ControllerConfigDb
18
+ attr_accessor :connection_url
19
+
20
+ attr_accessor :ca_certificate
21
+
22
+ attr_accessor :client_certificate
23
+
24
+ attr_accessor :in_memory
25
+
26
+ attr_accessor :version_check_disabled
27
+
28
+ attr_accessor :etcd
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'connection_url' => :'connection_url',
34
+ :'ca_certificate' => :'ca_certificate',
35
+ :'client_certificate' => :'client_certificate',
36
+ :'in_memory' => :'in_memory',
37
+ :'version_check_disabled' => :'version_check_disabled',
38
+ :'etcd' => :'etcd'
39
+ }
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'connection_url' => :'String',
51
+ :'ca_certificate' => :'String',
52
+ :'client_certificate' => :'String',
53
+ :'in_memory' => :'String',
54
+ :'version_check_disabled' => :'Boolean',
55
+ :'etcd' => :'ControllerConfigDbEtcd'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LinstorClient::ControllerConfigDb` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LinstorClient::ControllerConfigDb`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'connection_url')
81
+ self.connection_url = attributes[:'connection_url']
82
+ end
83
+
84
+ if attributes.key?(:'ca_certificate')
85
+ self.ca_certificate = attributes[:'ca_certificate']
86
+ end
87
+
88
+ if attributes.key?(:'client_certificate')
89
+ self.client_certificate = attributes[:'client_certificate']
90
+ end
91
+
92
+ if attributes.key?(:'in_memory')
93
+ self.in_memory = attributes[:'in_memory']
94
+ end
95
+
96
+ if attributes.key?(:'version_check_disabled')
97
+ self.version_check_disabled = attributes[:'version_check_disabled']
98
+ end
99
+
100
+ if attributes.key?(:'etcd')
101
+ self.etcd = attributes[:'etcd']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ connection_url == o.connection_url &&
124
+ ca_certificate == o.ca_certificate &&
125
+ client_certificate == o.client_certificate &&
126
+ in_memory == o.in_memory &&
127
+ version_check_disabled == o.version_check_disabled &&
128
+ etcd == o.etcd
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [connection_url, ca_certificate, client_certificate, in_memory, version_check_disabled, etcd].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ new.build_from_hash(attributes)
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ self.class.openapi_types.each_pair do |key, type|
156
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
157
+ self.send("#{key}=", nil)
158
+ elsif type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
162
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
163
+ end
164
+ elsif !attributes[self.class.attribute_map[key]].nil?
165
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
+ end
167
+ end
168
+
169
+ self
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def _deserialize(type, value)
177
+ case type.to_sym
178
+ when :Time
179
+ Time.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :Boolean
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ # models (e.g. Pet) or oneOf
210
+ klass = LinstorClient.const_get(type)
211
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end
260
+
261
+ end
262
+
263
+ end