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.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/codegen.sh +1 -1
- data/generator/custom/one_of_drbd_volume_luks_volume_storage_nvme_volme_writecache_volume.rb +1 -1
- data/generator/custom/one_of_drbd_volume_luks_volume_storage_nvme_volme_writecache_volume_cache_volume.rb +11 -0
- data/lib/ruby-linstor-client/api/developers_api.rb +923 -103
- data/lib/ruby-linstor-client/api_client.rb +2 -2
- data/lib/ruby-linstor-client/api_error.rb +2 -2
- data/lib/ruby-linstor-client/configuration.rb +2 -2
- data/lib/ruby-linstor-client/models/api_call_rc.rb +2 -2
- data/lib/ruby-linstor-client/models/auto_place_request.rb +2 -2
- data/lib/ruby-linstor-client/models/auto_select_filter.rb +25 -3
- data/lib/ruby-linstor-client/models/cache_resource.rb +220 -0
- data/lib/ruby-linstor-client/models/cache_volume.rb +276 -0
- data/lib/ruby-linstor-client/models/candidate.rb +2 -2
- data/lib/ruby-linstor-client/models/controller_config.rb +272 -0
- data/lib/ruby-linstor-client/models/controller_config_config.rb +218 -0
- data/lib/ruby-linstor-client/models/controller_config_db.rb +263 -0
- data/lib/ruby-linstor-client/models/controller_config_db_etcd.rb +227 -0
- data/lib/ruby-linstor-client/models/controller_config_debug.rb +218 -0
- data/lib/ruby-linstor-client/models/controller_config_http.rb +236 -0
- data/lib/ruby-linstor-client/models/controller_config_https.rb +236 -0
- data/lib/ruby-linstor-client/models/controller_config_ldap.rb +263 -0
- data/lib/ruby-linstor-client/models/controller_config_log.rb +315 -0
- data/lib/ruby-linstor-client/models/controller_props_modify.rb +2 -2
- data/lib/ruby-linstor-client/models/controller_version.rb +2 -2
- data/lib/ruby-linstor-client/models/drbd_connection.rb +262 -0
- data/lib/ruby-linstor-client/models/drbd_proxy_enable.rb +2 -2
- data/lib/ruby-linstor-client/models/drbd_proxy_modify.rb +2 -2
- data/lib/ruby-linstor-client/models/drbd_resource.rb +35 -6
- data/lib/ruby-linstor-client/models/drbd_resource_definition_layer.rb +2 -2
- data/lib/ruby-linstor-client/models/drbd_volume.rb +2 -2
- data/lib/ruby-linstor-client/models/drbd_volume_definition.rb +2 -2
- data/lib/ruby-linstor-client/models/error_report.rb +87 -7
- data/lib/ruby-linstor-client/models/error_report_delete.rb +273 -0
- data/lib/ruby-linstor-client/models/event_may_promote_change.rb +237 -0
- data/lib/ruby-linstor-client/models/key_value_store.rb +2 -2
- data/lib/ruby-linstor-client/models/key_value_store_modify.rb +2 -2
- data/lib/ruby-linstor-client/models/layer_type.rb +4 -2
- data/lib/ruby-linstor-client/models/log_level.rb +40 -0
- data/lib/ruby-linstor-client/models/luks_resource.rb +2 -2
- data/lib/ruby-linstor-client/models/luks_volume.rb +2 -2
- data/lib/ruby-linstor-client/models/max_volume_sizes.rb +2 -2
- data/lib/ruby-linstor-client/models/net_interface.rb +2 -2
- data/lib/ruby-linstor-client/models/node.rb +4 -4
- data/lib/ruby-linstor-client/models/node_modify.rb +2 -2
- data/lib/ruby-linstor-client/models/nvme_resource.rb +2 -2
- data/lib/ruby-linstor-client/models/nvme_volume.rb +2 -2
- data/lib/ruby-linstor-client/models/one_of_drbd_volume_luks_volume_storage_nvme_volme_writecache_volume.rb +1 -1
- data/lib/ruby-linstor-client/models/one_of_drbd_volume_luks_volume_storage_nvme_volme_writecache_volume_cache_volume.rb +11 -0
- data/lib/ruby-linstor-client/models/openflex_resource.rb +229 -0
- data/lib/ruby-linstor-client/models/openflex_resource_definition_layer.rb +227 -0
- data/lib/ruby-linstor-client/models/openflex_volume.rb +256 -0
- data/lib/ruby-linstor-client/models/pass_phrase_create.rb +2 -2
- data/lib/ruby-linstor-client/models/physical_storage.rb +2 -2
- data/lib/ruby-linstor-client/models/physical_storage_create.rb +2 -2
- data/lib/ruby-linstor-client/models/physical_storage_device.rb +2 -2
- data/lib/ruby-linstor-client/models/physical_storage_storage_pool_create.rb +2 -2
- data/lib/ruby-linstor-client/models/provider_kind.rb +3 -2
- data/lib/ruby-linstor-client/models/resource.rb +16 -6
- data/lib/ruby-linstor-client/models/resource_connection.rb +2 -2
- data/lib/ruby-linstor-client/models/resource_connection_modify.rb +2 -2
- data/lib/ruby-linstor-client/models/resource_create.rb +2 -2
- data/lib/ruby-linstor-client/models/resource_definition.rb +2 -2
- data/lib/ruby-linstor-client/models/resource_definition_create.rb +2 -2
- data/lib/ruby-linstor-client/models/resource_definition_layer.rb +3 -3
- data/lib/ruby-linstor-client/models/resource_definition_modify.rb +16 -6
- data/lib/ruby-linstor-client/models/resource_group.rb +2 -2
- data/lib/ruby-linstor-client/models/resource_group_modify.rb +2 -2
- data/lib/ruby-linstor-client/models/resource_group_spawn.rb +22 -3
- data/lib/ruby-linstor-client/models/resource_layer.rb +24 -6
- data/lib/ruby-linstor-client/models/resource_modify.rb +2 -2
- data/lib/ruby-linstor-client/models/resource_state.rb +2 -2
- data/lib/ruby-linstor-client/models/resource_with_volumes.rb +13 -3
- data/lib/ruby-linstor-client/models/resource_with_volumes_all_of.rb +2 -2
- data/lib/ruby-linstor-client/models/satellite_config.rb +272 -0
- data/lib/ruby-linstor-client/models/satellite_config_log.rb +245 -0
- data/lib/ruby-linstor-client/models/satellite_config_net.rb +236 -0
- data/lib/ruby-linstor-client/models/snapshot.rb +17 -6
- data/lib/ruby-linstor-client/models/snapshot_node.rb +261 -0
- data/lib/ruby-linstor-client/models/snapshot_restore.rb +2 -2
- data/lib/ruby-linstor-client/models/snapshot_shipping.rb +259 -0
- data/lib/ruby-linstor-client/models/snapshot_shipping_status.rb +279 -0
- data/lib/ruby-linstor-client/models/snapshot_volume_definition.rb +2 -2
- data/lib/ruby-linstor-client/models/storage_pool.rb +2 -2
- data/lib/ruby-linstor-client/models/storage_pool_definition.rb +2 -2
- data/lib/ruby-linstor-client/models/storage_pool_definition_modify.rb +2 -2
- data/lib/ruby-linstor-client/models/storage_resource.rb +2 -2
- data/lib/ruby-linstor-client/models/storage_volume.rb +2 -2
- data/lib/ruby-linstor-client/models/volume.rb +2 -2
- data/lib/ruby-linstor-client/models/volume_definition.rb +2 -2
- data/lib/ruby-linstor-client/models/volume_definition_create.rb +2 -2
- data/lib/ruby-linstor-client/models/volume_definition_layer.rb +2 -2
- data/lib/ruby-linstor-client/models/volume_definition_modify.rb +2 -2
- data/lib/ruby-linstor-client/models/volume_group.rb +2 -2
- data/lib/ruby-linstor-client/models/volume_group_modify.rb +2 -2
- data/lib/ruby-linstor-client/models/volume_layer.rb +3 -3
- data/lib/ruby-linstor-client/models/volume_modify.rb +2 -2
- data/lib/ruby-linstor-client/models/volume_state.rb +2 -2
- data/lib/ruby-linstor-client/models/writecache_resource.rb +2 -2
- data/lib/ruby-linstor-client/models/writecache_volume.rb +2 -2
- data/lib/ruby-linstor-client/version.rb +3 -3
- data/lib/ruby-linstor-client.rb +26 -2
- data/pkg/ruby-linstor-client-1.0.0.gem +0 -0
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +2 -2
- data/spec/models/cache_resource_spec.rb +34 -0
- data/spec/models/cache_volume_spec.rb +70 -0
- data/spec/models/controller_config_config_spec.rb +34 -0
- data/spec/models/controller_config_db_etcd_spec.rb +40 -0
- data/spec/models/controller_config_db_spec.rb +64 -0
- data/spec/models/controller_config_debug_spec.rb +34 -0
- data/spec/models/controller_config_http_spec.rb +46 -0
- data/spec/models/controller_config_https_spec.rb +46 -0
- data/spec/models/controller_config_ldap_spec.rb +64 -0
- data/spec/models/controller_config_log_spec.rb +80 -0
- data/spec/models/controller_config_spec.rb +70 -0
- data/spec/models/drbd_connection_spec.rb +44 -0
- data/spec/models/error_report_delete_spec.rb +64 -0
- data/spec/models/event_may_promote_change_spec.rb +46 -0
- data/spec/models/log_level_spec.rb +28 -0
- data/spec/models/openflex_resource_definition_layer_spec.rb +40 -0
- data/spec/models/openflex_resource_spec.rb +40 -0
- data/spec/models/openflex_volume_spec.rb +58 -0
- data/spec/models/satellite_config_log_spec.rb +52 -0
- data/spec/models/satellite_config_net_spec.rb +46 -0
- data/spec/models/satellite_config_spec.rb +70 -0
- data/spec/models/snapshot_node_spec.rb +58 -0
- data/spec/models/snapshot_shipping_spec.rb +52 -0
- data/spec/models/snapshot_shipping_status_spec.rb +56 -0
- data/spec/spec_helper.rb +2 -2
- metadata +77 -3
@@ -0,0 +1,236 @@
|
|
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 ControllerConfigHttps
|
18
|
+
attr_accessor :enabled
|
19
|
+
|
20
|
+
attr_accessor :listen_address
|
21
|
+
|
22
|
+
attr_accessor :port
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'enabled' => :'enabled',
|
28
|
+
:'listen_address' => :'listen_address',
|
29
|
+
:'port' => :'port'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.openapi_types
|
40
|
+
{
|
41
|
+
:'enabled' => :'Boolean',
|
42
|
+
:'listen_address' => :'String',
|
43
|
+
:'port' => :'Integer'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# List of attributes with nullable: true
|
48
|
+
def self.openapi_nullable
|
49
|
+
Set.new([
|
50
|
+
])
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
55
|
+
def initialize(attributes = {})
|
56
|
+
if (!attributes.is_a?(Hash))
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `LinstorClient::ControllerConfigHttps` initialize method"
|
58
|
+
end
|
59
|
+
|
60
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `LinstorClient::ControllerConfigHttps`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
64
|
+
end
|
65
|
+
h[k.to_sym] = v
|
66
|
+
}
|
67
|
+
|
68
|
+
if attributes.key?(:'enabled')
|
69
|
+
self.enabled = attributes[:'enabled']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.key?(:'listen_address')
|
73
|
+
self.listen_address = attributes[:'listen_address']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'port')
|
77
|
+
self.port = attributes[:'port']
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
82
|
+
# @return Array for valid properties with the reasons
|
83
|
+
def list_invalid_properties
|
84
|
+
invalid_properties = Array.new
|
85
|
+
invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
true
|
92
|
+
end
|
93
|
+
|
94
|
+
# Checks equality by comparing each attribute.
|
95
|
+
# @param [Object] Object to be compared
|
96
|
+
def ==(o)
|
97
|
+
return true if self.equal?(o)
|
98
|
+
self.class == o.class &&
|
99
|
+
enabled == o.enabled &&
|
100
|
+
listen_address == o.listen_address &&
|
101
|
+
port == o.port
|
102
|
+
end
|
103
|
+
|
104
|
+
# @see the `==` method
|
105
|
+
# @param [Object] Object to be compared
|
106
|
+
def eql?(o)
|
107
|
+
self == o
|
108
|
+
end
|
109
|
+
|
110
|
+
# Calculates hash code according to all attributes.
|
111
|
+
# @return [Integer] Hash code
|
112
|
+
def hash
|
113
|
+
[enabled, listen_address, port].hash
|
114
|
+
end
|
115
|
+
|
116
|
+
# Builds the object from hash
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
+
# @return [Object] Returns the model itself
|
119
|
+
def self.build_from_hash(attributes)
|
120
|
+
new.build_from_hash(attributes)
|
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 build_from_hash(attributes)
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
128
|
+
self.class.openapi_types.each_pair do |key, type|
|
129
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
130
|
+
self.send("#{key}=", nil)
|
131
|
+
elsif type =~ /\AArray<(.*)>/i
|
132
|
+
# check to ensure the input is an array given that the attribute
|
133
|
+
# is documented as an array but the input is not
|
134
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
135
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
136
|
+
end
|
137
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
138
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
self
|
143
|
+
end
|
144
|
+
|
145
|
+
# Deserializes the data based on type
|
146
|
+
# @param string type Data type
|
147
|
+
# @param string value Value to be deserialized
|
148
|
+
# @return [Object] Deserialized data
|
149
|
+
def _deserialize(type, value)
|
150
|
+
case type.to_sym
|
151
|
+
when :Time
|
152
|
+
Time.parse(value)
|
153
|
+
when :Date
|
154
|
+
Date.parse(value)
|
155
|
+
when :String
|
156
|
+
value.to_s
|
157
|
+
when :Integer
|
158
|
+
value.to_i
|
159
|
+
when :Float
|
160
|
+
value.to_f
|
161
|
+
when :Boolean
|
162
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
163
|
+
true
|
164
|
+
else
|
165
|
+
false
|
166
|
+
end
|
167
|
+
when :Object
|
168
|
+
# generic object (usually a Hash), return directly
|
169
|
+
value
|
170
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
171
|
+
inner_type = Regexp.last_match[:inner_type]
|
172
|
+
value.map { |v| _deserialize(inner_type, v) }
|
173
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
174
|
+
k_type = Regexp.last_match[:k_type]
|
175
|
+
v_type = Regexp.last_match[:v_type]
|
176
|
+
{}.tap do |hash|
|
177
|
+
value.each do |k, v|
|
178
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
else # model
|
182
|
+
# models (e.g. Pet) or oneOf
|
183
|
+
klass = LinstorClient.const_get(type)
|
184
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
# Returns the string representation of the object
|
189
|
+
# @return [String] String presentation of the object
|
190
|
+
def to_s
|
191
|
+
to_hash.to_s
|
192
|
+
end
|
193
|
+
|
194
|
+
# to_body is an alias to to_hash (backward compatibility)
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
196
|
+
def to_body
|
197
|
+
to_hash
|
198
|
+
end
|
199
|
+
|
200
|
+
# Returns the object in the form of hash
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
202
|
+
def to_hash
|
203
|
+
hash = {}
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
205
|
+
value = self.send(attr)
|
206
|
+
if value.nil?
|
207
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
208
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
209
|
+
end
|
210
|
+
|
211
|
+
hash[param] = _to_hash(value)
|
212
|
+
end
|
213
|
+
hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Outputs non-array value in the form of hash
|
217
|
+
# For object, use to_hash. Otherwise, just return the value
|
218
|
+
# @param [Object] value Any valid value
|
219
|
+
# @return [Hash] Returns the value in the form of hash
|
220
|
+
def _to_hash(value)
|
221
|
+
if value.is_a?(Array)
|
222
|
+
value.compact.map { |v| _to_hash(v) }
|
223
|
+
elsif value.is_a?(Hash)
|
224
|
+
{}.tap do |hash|
|
225
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
226
|
+
end
|
227
|
+
elsif value.respond_to? :to_hash
|
228
|
+
value.to_hash
|
229
|
+
else
|
230
|
+
value
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
235
|
+
|
236
|
+
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 ControllerConfigLdap
|
18
|
+
attr_accessor :enabled
|
19
|
+
|
20
|
+
attr_accessor :public_access_allowed
|
21
|
+
|
22
|
+
attr_accessor :uri
|
23
|
+
|
24
|
+
attr_accessor :dn
|
25
|
+
|
26
|
+
attr_accessor :search_base
|
27
|
+
|
28
|
+
attr_accessor :search_filter
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'enabled' => :'enabled',
|
34
|
+
:'public_access_allowed' => :'public_access_allowed',
|
35
|
+
:'uri' => :'uri',
|
36
|
+
:'dn' => :'dn',
|
37
|
+
:'search_base' => :'search_base',
|
38
|
+
:'search_filter' => :'search_filter'
|
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
|
+
:'enabled' => :'Boolean',
|
51
|
+
:'public_access_allowed' => :'Boolean',
|
52
|
+
:'uri' => :'String',
|
53
|
+
:'dn' => :'String',
|
54
|
+
:'search_base' => :'String',
|
55
|
+
:'search_filter' => :'String'
|
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::ControllerConfigLdap` 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::ControllerConfigLdap`. 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?(:'enabled')
|
81
|
+
self.enabled = attributes[:'enabled']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'public_access_allowed')
|
85
|
+
self.public_access_allowed = attributes[:'public_access_allowed']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'uri')
|
89
|
+
self.uri = attributes[:'uri']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'dn')
|
93
|
+
self.dn = attributes[:'dn']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'search_base')
|
97
|
+
self.search_base = attributes[:'search_base']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'search_filter')
|
101
|
+
self.search_filter = attributes[:'search_filter']
|
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
|
+
enabled == o.enabled &&
|
124
|
+
public_access_allowed == o.public_access_allowed &&
|
125
|
+
uri == o.uri &&
|
126
|
+
dn == o.dn &&
|
127
|
+
search_base == o.search_base &&
|
128
|
+
search_filter == o.search_filter
|
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
|
+
[enabled, public_access_allowed, uri, dn, search_base, search_filter].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
|