ruby-linstor-client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +86 -0
  4. data/LICENSE +21 -0
  5. data/README.md +21 -0
  6. data/Rakefile +10 -0
  7. data/codegen.sh +22 -0
  8. data/generator/custom/one_of_drbd_resource_definition_layer.rb +7 -0
  9. data/generator/custom/one_of_drbd_volume_definition.rb +7 -0
  10. data/generator/custom/one_of_drbd_volume_luks_volume_storage_nvme_volme_writecache_volume.rb +11 -0
  11. data/generator/openapi-generator.yaml +11 -0
  12. data/generator/template/Gemfile.mustache +9 -0
  13. data/generator/template/README.mustache +148 -0
  14. data/generator/template/Rakefile.mustache +10 -0
  15. data/generator/template/api.mustache +209 -0
  16. data/generator/template/api_client.mustache +264 -0
  17. data/generator/template/api_client_faraday_partial.mustache +136 -0
  18. data/generator/template/api_client_spec.mustache +220 -0
  19. data/generator/template/api_client_typhoeus_partial.mustache +153 -0
  20. data/generator/template/api_doc.mustache +118 -0
  21. data/generator/template/api_error.mustache +49 -0
  22. data/generator/template/api_info.mustache +12 -0
  23. data/generator/template/api_test.mustache +47 -0
  24. data/generator/template/base_object.mustache +120 -0
  25. data/generator/template/configuration.mustache +385 -0
  26. data/generator/template/configuration_spec.mustache +34 -0
  27. data/generator/template/configuration_tls_faraday_partial.mustache +29 -0
  28. data/generator/template/configuration_tls_typhoeus_partial.mustache +34 -0
  29. data/generator/template/gem.mustache +53 -0
  30. data/generator/template/gemspec.mustache +35 -0
  31. data/generator/template/git_push.sh.mustache +57 -0
  32. data/generator/template/gitignore.mustache +39 -0
  33. data/generator/template/model.mustache +26 -0
  34. data/generator/template/model_doc.mustache +12 -0
  35. data/generator/template/model_test.mustache +77 -0
  36. data/generator/template/partial_model_enum_class.mustache +20 -0
  37. data/generator/template/partial_model_generic.mustache +371 -0
  38. data/generator/template/partial_model_generic_doc.mustache +28 -0
  39. data/generator/template/partial_oneof_module.mustache +137 -0
  40. data/generator/template/partial_oneof_module_doc.mustache +92 -0
  41. data/generator/template/rspec.mustache +2 -0
  42. data/generator/template/rubocop.mustache +148 -0
  43. data/generator/template/spec_helper.mustache +103 -0
  44. data/generator/template/travis.mustache +14 -0
  45. data/generator/template/version.mustache +7 -0
  46. data/lib/ruby-linstor-client/api/developers_api.rb +5856 -0
  47. data/lib/ruby-linstor-client/api_client.rb +393 -0
  48. data/lib/ruby-linstor-client/api_error.rb +57 -0
  49. data/lib/ruby-linstor-client/configuration.rb +298 -0
  50. data/lib/ruby-linstor-client/models/api_call_rc.rb +293 -0
  51. data/lib/ruby-linstor-client/models/auto_place_request.rb +245 -0
  52. data/lib/ruby-linstor-client/models/auto_select_filter.rb +305 -0
  53. data/lib/ruby-linstor-client/models/candidate.rb +248 -0
  54. data/lib/ruby-linstor-client/models/controller_props_modify.rb +243 -0
  55. data/lib/ruby-linstor-client/models/controller_version.rb +245 -0
  56. data/lib/ruby-linstor-client/models/drbd_proxy_enable.rb +219 -0
  57. data/lib/ruby-linstor-client/models/drbd_proxy_modify.rb +288 -0
  58. data/lib/ruby-linstor-client/models/drbd_resource.rb +276 -0
  59. data/lib/ruby-linstor-client/models/drbd_resource_definition_layer.rb +283 -0
  60. data/lib/ruby-linstor-client/models/drbd_volume.rb +285 -0
  61. data/lib/ruby-linstor-client/models/drbd_volume_definition.rb +236 -0
  62. data/lib/ruby-linstor-client/models/error_report.rb +252 -0
  63. data/lib/ruby-linstor-client/models/key_value_store.rb +231 -0
  64. data/lib/ruby-linstor-client/models/key_value_store_modify.rb +243 -0
  65. data/lib/ruby-linstor-client/models/layer_type.rb +40 -0
  66. data/lib/ruby-linstor-client/models/luks_resource.rb +220 -0
  67. data/lib/ruby-linstor-client/models/luks_volume.rb +275 -0
  68. data/lib/ruby-linstor-client/models/max_volume_sizes.rb +229 -0
  69. data/lib/ruby-linstor-client/models/net_interface.rb +309 -0
  70. data/lib/ruby-linstor-client/models/node.rb +381 -0
  71. data/lib/ruby-linstor-client/models/node_modify.rb +252 -0
  72. data/lib/ruby-linstor-client/models/nvme_resource.rb +220 -0
  73. data/lib/ruby-linstor-client/models/nvme_volume.rb +266 -0
  74. data/lib/ruby-linstor-client/models/one_of_drbd_resource_definition_layer.rb +7 -0
  75. data/lib/ruby-linstor-client/models/one_of_drbd_volume_definition.rb +7 -0
  76. data/lib/ruby-linstor-client/models/one_of_drbd_volume_luks_volume_storage_nvme_volme_writecache_volume.rb +11 -0
  77. data/lib/ruby-linstor-client/models/pass_phrase_create.rb +227 -0
  78. data/lib/ruby-linstor-client/models/physical_storage.rb +238 -0
  79. data/lib/ruby-linstor-client/models/physical_storage_create.rb +337 -0
  80. data/lib/ruby-linstor-client/models/physical_storage_device.rb +245 -0
  81. data/lib/ruby-linstor-client/models/physical_storage_storage_pool_create.rb +232 -0
  82. data/lib/ruby-linstor-client/models/provider_kind.rb +43 -0
  83. data/lib/ruby-linstor-client/models/resource.rb +278 -0
  84. data/lib/ruby-linstor-client/models/resource_connection.rb +261 -0
  85. data/lib/ruby-linstor-client/models/resource_connection_modify.rb +243 -0
  86. data/lib/ruby-linstor-client/models/resource_create.rb +238 -0
  87. data/lib/ruby-linstor-client/models/resource_definition.rb +295 -0
  88. data/lib/ruby-linstor-client/models/resource_definition_create.rb +262 -0
  89. data/lib/ruby-linstor-client/models/resource_definition_layer.rb +228 -0
  90. data/lib/ruby-linstor-client/models/resource_definition_modify.rb +274 -0
  91. data/lib/ruby-linstor-client/models/resource_group.rb +262 -0
  92. data/lib/ruby-linstor-client/models/resource_group_modify.rb +261 -0
  93. data/lib/ruby-linstor-client/models/resource_group_spawn.rb +255 -0
  94. data/lib/ruby-linstor-client/models/resource_layer.rb +283 -0
  95. data/lib/ruby-linstor-client/models/resource_modify.rb +243 -0
  96. data/lib/ruby-linstor-client/models/resource_state.rb +218 -0
  97. data/lib/ruby-linstor-client/models/resource_with_volumes.rb +297 -0
  98. data/lib/ruby-linstor-client/models/resource_with_volumes_all_of.rb +220 -0
  99. data/lib/ruby-linstor-client/models/snapshot.rb +282 -0
  100. data/lib/ruby-linstor-client/models/snapshot_restore.rb +236 -0
  101. data/lib/ruby-linstor-client/models/snapshot_volume_definition.rb +228 -0
  102. data/lib/ruby-linstor-client/models/storage_pool.rb +333 -0
  103. data/lib/ruby-linstor-client/models/storage_pool_definition.rb +230 -0
  104. data/lib/ruby-linstor-client/models/storage_pool_definition_modify.rb +243 -0
  105. data/lib/ruby-linstor-client/models/storage_resource.rb +220 -0
  106. data/lib/ruby-linstor-client/models/storage_volume.rb +256 -0
  107. data/lib/ruby-linstor-client/models/volume.rb +327 -0
  108. data/lib/ruby-linstor-client/models/volume_definition.rb +277 -0
  109. data/lib/ruby-linstor-client/models/volume_definition_create.rb +232 -0
  110. data/lib/ruby-linstor-client/models/volume_definition_layer.rb +233 -0
  111. data/lib/ruby-linstor-client/models/volume_definition_modify.rb +264 -0
  112. data/lib/ruby-linstor-client/models/volume_group.rb +251 -0
  113. data/lib/ruby-linstor-client/models/volume_group_modify.rb +255 -0
  114. data/lib/ruby-linstor-client/models/volume_layer.rb +228 -0
  115. data/lib/ruby-linstor-client/models/volume_modify.rb +243 -0
  116. data/lib/ruby-linstor-client/models/volume_state.rb +218 -0
  117. data/lib/ruby-linstor-client/models/writecache_resource.rb +220 -0
  118. data/lib/ruby-linstor-client/models/writecache_volume.rb +266 -0
  119. data/lib/ruby-linstor-client/version.rb +15 -0
  120. data/lib/ruby-linstor-client.rb +109 -0
  121. data/pkg/ruby-linstor-client-1.0.0.gem +0 -0
  122. data/ruby-linstor-client.gemspec +39 -0
  123. data/spec/api/developers_api_spec.rb +1116 -0
  124. data/spec/api_client_spec.rb +188 -0
  125. data/spec/configuration_spec.rb +42 -0
  126. data/spec/models/api_call_rc_spec.rb +70 -0
  127. data/spec/models/auto_place_request_spec.rb +46 -0
  128. data/spec/models/auto_select_filter_spec.rb +82 -0
  129. data/spec/models/candidate_spec.rb +52 -0
  130. data/spec/models/controller_props_modify_spec.rb +46 -0
  131. data/spec/models/controller_version_spec.rb +52 -0
  132. data/spec/models/drbd_proxy_enable_spec.rb +34 -0
  133. data/spec/models/drbd_proxy_modify_spec.rb +56 -0
  134. data/spec/models/drbd_resource_definition_layer_spec.rb +76 -0
  135. data/spec/models/drbd_resource_spec.rb +70 -0
  136. data/spec/models/drbd_volume_definition_spec.rb +46 -0
  137. data/spec/models/drbd_volume_spec.rb +76 -0
  138. data/spec/models/error_report_spec.rb +52 -0
  139. data/spec/models/key_value_store_modify_spec.rb +46 -0
  140. data/spec/models/key_value_store_spec.rb +40 -0
  141. data/spec/models/layer_type_spec.rb +28 -0
  142. data/spec/models/luks_resource_spec.rb +34 -0
  143. data/spec/models/luks_volume_spec.rb +70 -0
  144. data/spec/models/max_volume_sizes_spec.rb +40 -0
  145. data/spec/models/net_interface_spec.rb +68 -0
  146. data/spec/models/node_modify_spec.rb +52 -0
  147. data/spec/models/node_spec.rb +102 -0
  148. data/spec/models/nvme_resource_spec.rb +34 -0
  149. data/spec/models/nvme_volume_spec.rb +64 -0
  150. data/spec/models/pass_phrase_create_spec.rb +40 -0
  151. data/spec/models/physical_storage_create_spec.rb +80 -0
  152. data/spec/models/physical_storage_device_spec.rb +52 -0
  153. data/spec/models/physical_storage_spec.rb +46 -0
  154. data/spec/models/physical_storage_storage_pool_create_spec.rb +40 -0
  155. data/spec/models/provider_kind_spec.rb +28 -0
  156. data/spec/models/resource_connection_modify_spec.rb +46 -0
  157. data/spec/models/resource_connection_spec.rb +58 -0
  158. data/spec/models/resource_create_spec.rb +46 -0
  159. data/spec/models/resource_definition_create_spec.rb +58 -0
  160. data/spec/models/resource_definition_layer_spec.rb +40 -0
  161. data/spec/models/resource_definition_modify_spec.rb +64 -0
  162. data/spec/models/resource_definition_spec.rb +76 -0
  163. data/spec/models/resource_group_modify_spec.rb +58 -0
  164. data/spec/models/resource_group_spawn_spec.rb +52 -0
  165. data/spec/models/resource_group_spec.rb +58 -0
  166. data/spec/models/resource_layer_spec.rb +76 -0
  167. data/spec/models/resource_modify_spec.rb +46 -0
  168. data/spec/models/resource_spec.rb +70 -0
  169. data/spec/models/resource_state_spec.rb +34 -0
  170. data/spec/models/resource_with_volumes_all_of_spec.rb +34 -0
  171. data/spec/models/resource_with_volumes_spec.rb +76 -0
  172. data/spec/models/snapshot_restore_spec.rb +40 -0
  173. data/spec/models/snapshot_spec.rb +70 -0
  174. data/spec/models/snapshot_volume_definition_spec.rb +40 -0
  175. data/spec/models/storage_pool_definition_modify_spec.rb +46 -0
  176. data/spec/models/storage_pool_definition_spec.rb +40 -0
  177. data/spec/models/storage_pool_spec.rb +94 -0
  178. data/spec/models/storage_resource_spec.rb +34 -0
  179. data/spec/models/storage_volume_spec.rb +58 -0
  180. data/spec/models/volume_definition_create_spec.rb +40 -0
  181. data/spec/models/volume_definition_layer_spec.rb +40 -0
  182. data/spec/models/volume_definition_modify_spec.rb +58 -0
  183. data/spec/models/volume_definition_spec.rb +64 -0
  184. data/spec/models/volume_group_modify_spec.rb +52 -0
  185. data/spec/models/volume_group_spec.rb +52 -0
  186. data/spec/models/volume_layer_spec.rb +40 -0
  187. data/spec/models/volume_modify_spec.rb +46 -0
  188. data/spec/models/volume_spec.rb +100 -0
  189. data/spec/models/volume_state_spec.rb +34 -0
  190. data/spec/models/writecache_resource_spec.rb +34 -0
  191. data/spec/models/writecache_volume_spec.rb +64 -0
  192. data/spec/spec_helper.rb +111 -0
  193. metadata +344 -0
@@ -0,0 +1,228 @@
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.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.0.13
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 VolumeLayer
18
+ attr_accessor :type
19
+
20
+ attr_accessor :data
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'type' => :'type',
26
+ :'data' => :'data'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'type' => :'LayerType',
39
+ :'data' => :'OneOfDrbdVolumeLUKSVolumeStorageVolumeNVMEVolumeWritecacheVolume'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ :'data'
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LinstorClient::VolumeLayer` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LinstorClient::VolumeLayer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'type')
66
+ self.type = attributes[:'type']
67
+ end
68
+
69
+ if attributes.key?(:'data')
70
+ self.data = attributes[:'data']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ type == o.type &&
93
+ data == o.data
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [type, data].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ new.build_from_hash(attributes)
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ elsif type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :Time
144
+ Time.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = LinstorClient.const_get(type)
176
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end
@@ -0,0 +1,243 @@
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.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.0.13
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 VolumeModify
18
+ # A string to string property map.
19
+ attr_accessor :override_props
20
+
21
+ attr_accessor :delete_props
22
+
23
+ attr_accessor :delete_namespaces
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'override_props' => :'override_props',
29
+ :'delete_props' => :'delete_props',
30
+ :'delete_namespaces' => :'delete_namespaces'
31
+ }
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'override_props' => :'Hash<String, String>',
43
+ :'delete_props' => :'Array<String>',
44
+ :'delete_namespaces' => :'Array<String>'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LinstorClient::VolumeModify` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LinstorClient::VolumeModify`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ if attributes.key?(:'override_props')
70
+ if (value = attributes[:'override_props']).is_a?(Hash)
71
+ self.override_props = value
72
+ end
73
+ end
74
+
75
+ if attributes.key?(:'delete_props')
76
+ if (value = attributes[:'delete_props']).is_a?(Array)
77
+ self.delete_props = value
78
+ end
79
+ end
80
+
81
+ if attributes.key?(:'delete_namespaces')
82
+ if (value = attributes[:'delete_namespaces']).is_a?(Array)
83
+ self.delete_namespaces = value
84
+ end
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ override_props == o.override_props &&
107
+ delete_props == o.delete_props &&
108
+ delete_namespaces == o.delete_namespaces
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [override_props, delete_props, delete_namespaces].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.openapi_types.each_pair do |key, type|
136
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
137
+ self.send("#{key}=", nil)
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :Time
159
+ Time.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :Boolean
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ # models (e.g. Pet) or oneOf
190
+ klass = LinstorClient.const_get(type)
191
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+
241
+ end
242
+
243
+ end
@@ -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.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.0.13
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 VolumeState
18
+ attr_accessor :disk_state
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'disk_state' => :'disk_state'
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
+ :'disk_state' => :'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::VolumeState` 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::VolumeState`. 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?(:'disk_state')
61
+ self.disk_state = attributes[:'disk_state']
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
+ disk_state == o.disk_state
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
+ [disk_state].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