Class: Ionoscloud::LabelsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ionoscloud/api/labels_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LabelsApi

Returns a new instance of LabelsApi.



19
20
21
# File 'lib/ionoscloud/api/labels_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/ionoscloud/api/labels_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#datacenters_labels_delete(datacenter_id, key, opts = {}) ⇒ nil

Delete data center labels Delete the specified data center label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (nil)


31
32
33
34
# File 'lib/ionoscloud/api/labels_api.rb', line 31

def datacenters_labels_delete(datacenter_id, key, opts = {})
  datacenters_labels_delete_with_http_info(datacenter_id, key, opts)
  nil
end

#datacenters_labels_delete_with_http_info(datacenter_id, key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete data center labels Delete the specified data center label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/ionoscloud/api/labels_api.rb', line 45

def datacenters_labels_delete_with_http_info(datacenter_id, key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_labels_delete ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_labels_delete"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.datacenters_labels_delete"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_labels_delete, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_labels_delete, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/labels/{key}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_labels_delete",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_labels_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_labels_find_by_key(datacenter_id, key, opts = {}) ⇒ LabelResource

Retrieve data center labels Retrieve the properties of the specified data center label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



117
118
119
120
# File 'lib/ionoscloud/api/labels_api.rb', line 117

def datacenters_labels_find_by_key(datacenter_id, key, opts = {})
  data, _status_code, _headers = datacenters_labels_find_by_key_with_http_info(datacenter_id, key, opts)
  data
end

#datacenters_labels_find_by_key_with_http_info(datacenter_id, key, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Retrieve data center labels Retrieve the properties of the specified data center label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/ionoscloud/api/labels_api.rb', line 131

def datacenters_labels_find_by_key_with_http_info(datacenter_id, key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_labels_find_by_key ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_labels_find_by_key"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.datacenters_labels_find_by_key"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_labels_find_by_key, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_labels_find_by_key, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/labels/{key}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_labels_find_by_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_labels_find_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_labels_get(datacenter_id, opts = {}) ⇒ LabelResources

List data center labels List all the the labels for the specified data center.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



202
203
204
205
# File 'lib/ionoscloud/api/labels_api.rb', line 202

def datacenters_labels_get(datacenter_id, opts = {})
  data, _status_code, _headers = datacenters_labels_get_with_http_info(datacenter_id, opts)
  data
end

#datacenters_labels_get_with_http_info(datacenter_id, opts = {}) ⇒ Array<(LabelResources, Integer, Hash)>

List data center labels List all the the labels for the specified data center.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResources, Integer, Hash)>)

    LabelResources data, response status code and response headers



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/ionoscloud/api/labels_api.rb', line 215

def datacenters_labels_get_with_http_info(datacenter_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_labels_get ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_labels_get"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_labels_get, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_labels_get, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/labels'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResources'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_labels_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_labels_post(datacenter_id, label, opts = {}) ⇒ LabelResource

Create data center labels Add a new label to the specified data center.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • label (LabelResource)

    The label to create.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



283
284
285
286
# File 'lib/ionoscloud/api/labels_api.rb', line 283

def datacenters_labels_post(datacenter_id, label, opts = {})
  data, _status_code, _headers = datacenters_labels_post_with_http_info(datacenter_id, label, opts)
  data
end

#datacenters_labels_post_with_http_info(datacenter_id, label, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Create data center labels Add a new label to the specified data center.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • label (LabelResource)

    The label to create.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/ionoscloud/api/labels_api.rb', line 297

def datacenters_labels_post_with_http_info(datacenter_id, label, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_labels_post ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_labels_post"
  end
  # verify the required parameter 'label' is set
  if @api_client.config.client_side_validation && label.nil?
    fail ArgumentError, "Missing the required parameter 'label' when calling LabelsApi.datacenters_labels_post"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_labels_post, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_labels_post, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/labels'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(label)

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_labels_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_labels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_labels_put(datacenter_id, key, label, opts = {}) ⇒ LabelResource

Modify data center labels Modify the specified data center label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • key (String)

    The label key

  • label (LabelResource)

    The modified label

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



372
373
374
375
# File 'lib/ionoscloud/api/labels_api.rb', line 372

def datacenters_labels_put(datacenter_id, key, label, opts = {})
  data, _status_code, _headers = datacenters_labels_put_with_http_info(datacenter_id, key, label, opts)
  data
end

#datacenters_labels_put_with_http_info(datacenter_id, key, label, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Modify data center labels Modify the specified data center label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • key (String)

    The label key

  • label (LabelResource)

    The modified label

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/ionoscloud/api/labels_api.rb', line 387

def datacenters_labels_put_with_http_info(datacenter_id, key, label, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_labels_put ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_labels_put"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.datacenters_labels_put"
  end
  # verify the required parameter 'label' is set
  if @api_client.config.client_side_validation && label.nil?
    fail ArgumentError, "Missing the required parameter 'label' when calling LabelsApi.datacenters_labels_put"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_labels_put, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_labels_put, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/labels/{key}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(label)

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_labels_put",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_labels_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_servers_labels_delete(datacenter_id, server_id, key, opts = {}) ⇒ nil

Delete server labels Delete the specified server label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • server_id (String)

    The unique ID of the server.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (nil)


466
467
468
469
# File 'lib/ionoscloud/api/labels_api.rb', line 466

def datacenters_servers_labels_delete(datacenter_id, server_id, key, opts = {})
  datacenters_servers_labels_delete_with_http_info(datacenter_id, server_id, key, opts)
  nil
end

#datacenters_servers_labels_delete_with_http_info(datacenter_id, server_id, key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete server labels Delete the specified server label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • server_id (String)

    The unique ID of the server.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/ionoscloud/api/labels_api.rb', line 481

def datacenters_servers_labels_delete_with_http_info(datacenter_id, server_id, key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_servers_labels_delete ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_servers_labels_delete"
  end
  # verify the required parameter 'server_id' is set
  if @api_client.config.client_side_validation && server_id.nil?
    fail ArgumentError, "Missing the required parameter 'server_id' when calling LabelsApi.datacenters_servers_labels_delete"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.datacenters_servers_labels_delete"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_servers_labels_delete, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_servers_labels_delete, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/labels/{key}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_servers_labels_delete",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_servers_labels_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_servers_labels_find_by_key(datacenter_id, server_id, key, opts = {}) ⇒ LabelResource

Retrieve server labels Retrieve the properties of the specified server label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • server_id (String)

    The unique ID of the server.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



558
559
560
561
# File 'lib/ionoscloud/api/labels_api.rb', line 558

def datacenters_servers_labels_find_by_key(datacenter_id, server_id, key, opts = {})
  data, _status_code, _headers = datacenters_servers_labels_find_by_key_with_http_info(datacenter_id, server_id, key, opts)
  data
end

#datacenters_servers_labels_find_by_key_with_http_info(datacenter_id, server_id, key, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Retrieve server labels Retrieve the properties of the specified server label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • server_id (String)

    The unique ID of the server.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
# File 'lib/ionoscloud/api/labels_api.rb', line 573

def datacenters_servers_labels_find_by_key_with_http_info(datacenter_id, server_id, key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_servers_labels_find_by_key ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_servers_labels_find_by_key"
  end
  # verify the required parameter 'server_id' is set
  if @api_client.config.client_side_validation && server_id.nil?
    fail ArgumentError, "Missing the required parameter 'server_id' when calling LabelsApi.datacenters_servers_labels_find_by_key"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.datacenters_servers_labels_find_by_key"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_servers_labels_find_by_key, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_servers_labels_find_by_key, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/labels/{key}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_servers_labels_find_by_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_servers_labels_find_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_servers_labels_get(datacenter_id, server_id, opts = {}) ⇒ LabelResources

List server labels List all the the labels for the specified server.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • server_id (String)

    The unique ID of the server.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



649
650
651
652
# File 'lib/ionoscloud/api/labels_api.rb', line 649

def datacenters_servers_labels_get(datacenter_id, server_id, opts = {})
  data, _status_code, _headers = datacenters_servers_labels_get_with_http_info(datacenter_id, server_id, opts)
  data
end

#datacenters_servers_labels_get_with_http_info(datacenter_id, server_id, opts = {}) ⇒ Array<(LabelResources, Integer, Hash)>

List server labels List all the the labels for the specified server.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • server_id (String)

    The unique ID of the server.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResources, Integer, Hash)>)

    LabelResources data, response status code and response headers



663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
# File 'lib/ionoscloud/api/labels_api.rb', line 663

def datacenters_servers_labels_get_with_http_info(datacenter_id, server_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_servers_labels_get ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_servers_labels_get"
  end
  # verify the required parameter 'server_id' is set
  if @api_client.config.client_side_validation && server_id.nil?
    fail ArgumentError, "Missing the required parameter 'server_id' when calling LabelsApi.datacenters_servers_labels_get"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_servers_labels_get, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_servers_labels_get, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/labels'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResources'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_servers_labels_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_servers_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_servers_labels_post(datacenter_id, server_id, label, opts = {}) ⇒ LabelResource

Create server labels Add a new label to the specified server.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • server_id (String)

    The unique ID of the server.

  • label (LabelResource)

    The label to create.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



736
737
738
739
# File 'lib/ionoscloud/api/labels_api.rb', line 736

def datacenters_servers_labels_post(datacenter_id, server_id, label, opts = {})
  data, _status_code, _headers = datacenters_servers_labels_post_with_http_info(datacenter_id, server_id, label, opts)
  data
end

#datacenters_servers_labels_post_with_http_info(datacenter_id, server_id, label, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Create server labels Add a new label to the specified server.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • server_id (String)

    The unique ID of the server.

  • label (LabelResource)

    The label to create.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
# File 'lib/ionoscloud/api/labels_api.rb', line 751

def datacenters_servers_labels_post_with_http_info(datacenter_id, server_id, label, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_servers_labels_post ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_servers_labels_post"
  end
  # verify the required parameter 'server_id' is set
  if @api_client.config.client_side_validation && server_id.nil?
    fail ArgumentError, "Missing the required parameter 'server_id' when calling LabelsApi.datacenters_servers_labels_post"
  end
  # verify the required parameter 'label' is set
  if @api_client.config.client_side_validation && label.nil?
    fail ArgumentError, "Missing the required parameter 'label' when calling LabelsApi.datacenters_servers_labels_post"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_servers_labels_post, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_servers_labels_post, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/labels'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(label)

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_servers_labels_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_servers_labels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_servers_labels_put(datacenter_id, server_id, key, label, opts = {}) ⇒ LabelResource

Modify server labels Modify the specified server label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • server_id (String)

    The unique ID of the server.

  • key (String)

    The label key

  • label (LabelResource)

    The modified label

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



831
832
833
834
# File 'lib/ionoscloud/api/labels_api.rb', line 831

def datacenters_servers_labels_put(datacenter_id, server_id, key, label, opts = {})
  data, _status_code, _headers = datacenters_servers_labels_put_with_http_info(datacenter_id, server_id, key, label, opts)
  data
end

#datacenters_servers_labels_put_with_http_info(datacenter_id, server_id, key, label, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Modify server labels Modify the specified server label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • server_id (String)

    The unique ID of the server.

  • key (String)

    The label key

  • label (LabelResource)

    The modified label

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
# File 'lib/ionoscloud/api/labels_api.rb', line 847

def datacenters_servers_labels_put_with_http_info(datacenter_id, server_id, key, label, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_servers_labels_put ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_servers_labels_put"
  end
  # verify the required parameter 'server_id' is set
  if @api_client.config.client_side_validation && server_id.nil?
    fail ArgumentError, "Missing the required parameter 'server_id' when calling LabelsApi.datacenters_servers_labels_put"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.datacenters_servers_labels_put"
  end
  # verify the required parameter 'label' is set
  if @api_client.config.client_side_validation && label.nil?
    fail ArgumentError, "Missing the required parameter 'label' when calling LabelsApi.datacenters_servers_labels_put"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_servers_labels_put, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_servers_labels_put, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/labels/{key}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(label)

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_servers_labels_put",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_servers_labels_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_volumes_labels_delete(datacenter_id, volume_id, key, opts = {}) ⇒ nil

Delete volume labels Delete the specified volume label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • volume_id (String)

    The unique ID of the volume.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (nil)


930
931
932
933
# File 'lib/ionoscloud/api/labels_api.rb', line 930

def datacenters_volumes_labels_delete(datacenter_id, volume_id, key, opts = {})
  datacenters_volumes_labels_delete_with_http_info(datacenter_id, volume_id, key, opts)
  nil
end

#datacenters_volumes_labels_delete_with_http_info(datacenter_id, volume_id, key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete volume labels Delete the specified volume label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • volume_id (String)

    The unique ID of the volume.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
# File 'lib/ionoscloud/api/labels_api.rb', line 945

def datacenters_volumes_labels_delete_with_http_info(datacenter_id, volume_id, key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_volumes_labels_delete ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_volumes_labels_delete"
  end
  # verify the required parameter 'volume_id' is set
  if @api_client.config.client_side_validation && volume_id.nil?
    fail ArgumentError, "Missing the required parameter 'volume_id' when calling LabelsApi.datacenters_volumes_labels_delete"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.datacenters_volumes_labels_delete"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_volumes_labels_delete, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_volumes_labels_delete, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_volumes_labels_delete",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_volumes_labels_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_volumes_labels_find_by_key(datacenter_id, volume_id, key, opts = {}) ⇒ LabelResource

Retrieve volume labels Retrieve the properties of the specified volume label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • volume_id (String)

    The unique ID of the volume.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



1022
1023
1024
1025
# File 'lib/ionoscloud/api/labels_api.rb', line 1022

def datacenters_volumes_labels_find_by_key(datacenter_id, volume_id, key, opts = {})
  data, _status_code, _headers = datacenters_volumes_labels_find_by_key_with_http_info(datacenter_id, volume_id, key, opts)
  data
end

#datacenters_volumes_labels_find_by_key_with_http_info(datacenter_id, volume_id, key, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Retrieve volume labels Retrieve the properties of the specified volume label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • volume_id (String)

    The unique ID of the volume.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
# File 'lib/ionoscloud/api/labels_api.rb', line 1037

def datacenters_volumes_labels_find_by_key_with_http_info(datacenter_id, volume_id, key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_volumes_labels_find_by_key ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_volumes_labels_find_by_key"
  end
  # verify the required parameter 'volume_id' is set
  if @api_client.config.client_side_validation && volume_id.nil?
    fail ArgumentError, "Missing the required parameter 'volume_id' when calling LabelsApi.datacenters_volumes_labels_find_by_key"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.datacenters_volumes_labels_find_by_key"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_volumes_labels_find_by_key, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_volumes_labels_find_by_key, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_volumes_labels_find_by_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_volumes_labels_find_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_volumes_labels_get(datacenter_id, volume_id, opts = {}) ⇒ LabelResources

List volume labels List all the the labels for the specified volume.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • volume_id (String)

    The unique ID of the volume.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



1113
1114
1115
1116
# File 'lib/ionoscloud/api/labels_api.rb', line 1113

def datacenters_volumes_labels_get(datacenter_id, volume_id, opts = {})
  data, _status_code, _headers = datacenters_volumes_labels_get_with_http_info(datacenter_id, volume_id, opts)
  data
end

#datacenters_volumes_labels_get_with_http_info(datacenter_id, volume_id, opts = {}) ⇒ Array<(LabelResources, Integer, Hash)>

List volume labels List all the the labels for the specified volume.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • volume_id (String)

    The unique ID of the volume.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResources, Integer, Hash)>)

    LabelResources data, response status code and response headers



1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
# File 'lib/ionoscloud/api/labels_api.rb', line 1127

def datacenters_volumes_labels_get_with_http_info(datacenter_id, volume_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_volumes_labels_get ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_volumes_labels_get"
  end
  # verify the required parameter 'volume_id' is set
  if @api_client.config.client_side_validation && volume_id.nil?
    fail ArgumentError, "Missing the required parameter 'volume_id' when calling LabelsApi.datacenters_volumes_labels_get"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_volumes_labels_get, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_volumes_labels_get, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/volumes/{volumeId}/labels'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResources'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_volumes_labels_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_volumes_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_volumes_labels_post(datacenter_id, volume_id, label, opts = {}) ⇒ LabelResource

Create volume labels Add a new label to the specified volume.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • volume_id (String)

    The unique ID of the volume.

  • label (LabelResource)

    The label to create.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



1200
1201
1202
1203
# File 'lib/ionoscloud/api/labels_api.rb', line 1200

def datacenters_volumes_labels_post(datacenter_id, volume_id, label, opts = {})
  data, _status_code, _headers = datacenters_volumes_labels_post_with_http_info(datacenter_id, volume_id, label, opts)
  data
end

#datacenters_volumes_labels_post_with_http_info(datacenter_id, volume_id, label, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Create volume labels Add a new label to the specified volume.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • volume_id (String)

    The unique ID of the volume.

  • label (LabelResource)

    The label to create.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
# File 'lib/ionoscloud/api/labels_api.rb', line 1215

def datacenters_volumes_labels_post_with_http_info(datacenter_id, volume_id, label, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_volumes_labels_post ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_volumes_labels_post"
  end
  # verify the required parameter 'volume_id' is set
  if @api_client.config.client_side_validation && volume_id.nil?
    fail ArgumentError, "Missing the required parameter 'volume_id' when calling LabelsApi.datacenters_volumes_labels_post"
  end
  # verify the required parameter 'label' is set
  if @api_client.config.client_side_validation && label.nil?
    fail ArgumentError, "Missing the required parameter 'label' when calling LabelsApi.datacenters_volumes_labels_post"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_volumes_labels_post, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_volumes_labels_post, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/volumes/{volumeId}/labels'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(label)

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_volumes_labels_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_volumes_labels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#datacenters_volumes_labels_put(datacenter_id, volume_id, key, label, opts = {}) ⇒ LabelResource

Modify volume labels Modify the specified volume label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • volume_id (String)

    The unique ID of the volume.

  • key (String)

    The label key

  • label (LabelResource)

    The modified label

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



1295
1296
1297
1298
# File 'lib/ionoscloud/api/labels_api.rb', line 1295

def datacenters_volumes_labels_put(datacenter_id, volume_id, key, label, opts = {})
  data, _status_code, _headers = datacenters_volumes_labels_put_with_http_info(datacenter_id, volume_id, key, label, opts)
  data
end

#datacenters_volumes_labels_put_with_http_info(datacenter_id, volume_id, key, label, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Modify volume labels Modify the specified volume label.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • volume_id (String)

    The unique ID of the volume.

  • key (String)

    The label key

  • label (LabelResource)

    The modified label

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
# File 'lib/ionoscloud/api/labels_api.rb', line 1311

def datacenters_volumes_labels_put_with_http_info(datacenter_id, volume_id, key, label, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.datacenters_volumes_labels_put ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling LabelsApi.datacenters_volumes_labels_put"
  end
  # verify the required parameter 'volume_id' is set
  if @api_client.config.client_side_validation && volume_id.nil?
    fail ArgumentError, "Missing the required parameter 'volume_id' when calling LabelsApi.datacenters_volumes_labels_put"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.datacenters_volumes_labels_put"
  end
  # verify the required parameter 'label' is set
  if @api_client.config.client_side_validation && label.nil?
    fail ArgumentError, "Missing the required parameter 'label' when calling LabelsApi.datacenters_volumes_labels_put"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_volumes_labels_put, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.datacenters_volumes_labels_put, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(label)

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.datacenters_volumes_labels_put",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#datacenters_volumes_labels_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ipblocks_labels_delete(ipblock_id, key, opts = {}) ⇒ nil

Delete IP block labels Delete the specified IP block label.

Parameters:

  • ipblock_id (String)

    The unique ID of the IP block.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (nil)


1393
1394
1395
1396
# File 'lib/ionoscloud/api/labels_api.rb', line 1393

def ipblocks_labels_delete(ipblock_id, key, opts = {})
  ipblocks_labels_delete_with_http_info(ipblock_id, key, opts)
  nil
end

#ipblocks_labels_delete_with_http_info(ipblock_id, key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete IP block labels Delete the specified IP block label.

Parameters:

  • ipblock_id (String)

    The unique ID of the IP block.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
# File 'lib/ionoscloud/api/labels_api.rb', line 1407

def ipblocks_labels_delete_with_http_info(ipblock_id, key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.ipblocks_labels_delete ...'
  end
  # verify the required parameter 'ipblock_id' is set
  if @api_client.config.client_side_validation && ipblock_id.nil?
    fail ArgumentError, "Missing the required parameter 'ipblock_id' when calling LabelsApi.ipblocks_labels_delete"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.ipblocks_labels_delete"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.ipblocks_labels_delete, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.ipblocks_labels_delete, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/ipblocks/{ipblockId}/labels/{key}'.sub('{' + 'ipblockId' + '}', CGI.escape(ipblock_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.ipblocks_labels_delete",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#ipblocks_labels_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ipblocks_labels_find_by_key(ipblock_id, key, opts = {}) ⇒ LabelResource

Retrieve IP block labels Retrieve the properties of the specified IP block label.

Parameters:

  • ipblock_id (String)

    The unique ID of the IP block.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



1479
1480
1481
1482
# File 'lib/ionoscloud/api/labels_api.rb', line 1479

def ipblocks_labels_find_by_key(ipblock_id, key, opts = {})
  data, _status_code, _headers = ipblocks_labels_find_by_key_with_http_info(ipblock_id, key, opts)
  data
end

#ipblocks_labels_find_by_key_with_http_info(ipblock_id, key, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Retrieve IP block labels Retrieve the properties of the specified IP block label.

Parameters:

  • ipblock_id (String)

    The unique ID of the IP block.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
# File 'lib/ionoscloud/api/labels_api.rb', line 1493

def ipblocks_labels_find_by_key_with_http_info(ipblock_id, key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.ipblocks_labels_find_by_key ...'
  end
  # verify the required parameter 'ipblock_id' is set
  if @api_client.config.client_side_validation && ipblock_id.nil?
    fail ArgumentError, "Missing the required parameter 'ipblock_id' when calling LabelsApi.ipblocks_labels_find_by_key"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.ipblocks_labels_find_by_key"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.ipblocks_labels_find_by_key, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.ipblocks_labels_find_by_key, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/ipblocks/{ipblockId}/labels/{key}'.sub('{' + 'ipblockId' + '}', CGI.escape(ipblock_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.ipblocks_labels_find_by_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#ipblocks_labels_find_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ipblocks_labels_get(ipblock_id, opts = {}) ⇒ LabelResources

List IP block labels List all the the labels for the specified IP block.

Parameters:

  • ipblock_id (String)

    The unique ID of the IP block.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



1564
1565
1566
1567
# File 'lib/ionoscloud/api/labels_api.rb', line 1564

def ipblocks_labels_get(ipblock_id, opts = {})
  data, _status_code, _headers = ipblocks_labels_get_with_http_info(ipblock_id, opts)
  data
end

#ipblocks_labels_get_with_http_info(ipblock_id, opts = {}) ⇒ Array<(LabelResources, Integer, Hash)>

List IP block labels List all the the labels for the specified IP block.

Parameters:

  • ipblock_id (String)

    The unique ID of the IP block.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResources, Integer, Hash)>)

    LabelResources data, response status code and response headers



1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
# File 'lib/ionoscloud/api/labels_api.rb', line 1577

def ipblocks_labels_get_with_http_info(ipblock_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.ipblocks_labels_get ...'
  end
  # verify the required parameter 'ipblock_id' is set
  if @api_client.config.client_side_validation && ipblock_id.nil?
    fail ArgumentError, "Missing the required parameter 'ipblock_id' when calling LabelsApi.ipblocks_labels_get"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.ipblocks_labels_get, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.ipblocks_labels_get, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/ipblocks/{ipblockId}/labels'.sub('{' + 'ipblockId' + '}', CGI.escape(ipblock_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResources'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.ipblocks_labels_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#ipblocks_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ipblocks_labels_post(ipblock_id, label, opts = {}) ⇒ LabelResource

Create IP block labels Add a new label to the specified IP block.

Parameters:

  • ipblock_id (String)

    The unique ID of the IP block.

  • label (LabelResource)

    The label to create.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



1645
1646
1647
1648
# File 'lib/ionoscloud/api/labels_api.rb', line 1645

def ipblocks_labels_post(ipblock_id, label, opts = {})
  data, _status_code, _headers = ipblocks_labels_post_with_http_info(ipblock_id, label, opts)
  data
end

#ipblocks_labels_post_with_http_info(ipblock_id, label, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Create IP block labels Add a new label to the specified IP block.

Parameters:

  • ipblock_id (String)

    The unique ID of the IP block.

  • label (LabelResource)

    The label to create.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
# File 'lib/ionoscloud/api/labels_api.rb', line 1659

def ipblocks_labels_post_with_http_info(ipblock_id, label, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.ipblocks_labels_post ...'
  end
  # verify the required parameter 'ipblock_id' is set
  if @api_client.config.client_side_validation && ipblock_id.nil?
    fail ArgumentError, "Missing the required parameter 'ipblock_id' when calling LabelsApi.ipblocks_labels_post"
  end
  # verify the required parameter 'label' is set
  if @api_client.config.client_side_validation && label.nil?
    fail ArgumentError, "Missing the required parameter 'label' when calling LabelsApi.ipblocks_labels_post"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.ipblocks_labels_post, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.ipblocks_labels_post, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/ipblocks/{ipblockId}/labels'.sub('{' + 'ipblockId' + '}', CGI.escape(ipblock_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(label)

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.ipblocks_labels_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#ipblocks_labels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ipblocks_labels_put(ipblock_id, key, label, opts = {}) ⇒ LabelResource

Modify IP block labels Modify the specified IP block label.

Parameters:

  • ipblock_id (String)

    The unique ID of the IP block.

  • key (String)

    The label key

  • label (LabelResource)

    The modified label

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



1734
1735
1736
1737
# File 'lib/ionoscloud/api/labels_api.rb', line 1734

def ipblocks_labels_put(ipblock_id, key, label, opts = {})
  data, _status_code, _headers = ipblocks_labels_put_with_http_info(ipblock_id, key, label, opts)
  data
end

#ipblocks_labels_put_with_http_info(ipblock_id, key, label, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Modify IP block labels Modify the specified IP block label.

Parameters:

  • ipblock_id (String)

    The unique ID of the IP block.

  • key (String)

    The label key

  • label (LabelResource)

    The modified label

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
# File 'lib/ionoscloud/api/labels_api.rb', line 1749

def ipblocks_labels_put_with_http_info(ipblock_id, key, label, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.ipblocks_labels_put ...'
  end
  # verify the required parameter 'ipblock_id' is set
  if @api_client.config.client_side_validation && ipblock_id.nil?
    fail ArgumentError, "Missing the required parameter 'ipblock_id' when calling LabelsApi.ipblocks_labels_put"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.ipblocks_labels_put"
  end
  # verify the required parameter 'label' is set
  if @api_client.config.client_side_validation && label.nil?
    fail ArgumentError, "Missing the required parameter 'label' when calling LabelsApi.ipblocks_labels_put"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.ipblocks_labels_put, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.ipblocks_labels_put, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/ipblocks/{ipblockId}/labels/{key}'.sub('{' + 'ipblockId' + '}', CGI.escape(ipblock_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(label)

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.ipblocks_labels_put",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#ipblocks_labels_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#labels_find_by_urn(labelurn, opts = {}) ⇒ Label

Retrieve labels by URN Retrieve a label by label URN. The URN is unique for each label, and consists of: urn:label:<resource_type>:<resource_uuid>:<key>

Parameters:

  • labelurn (String)

    The label URN; URN is unique for each label, and consists of: urn:label:&lt;resource_type&gt;:&lt;resource_uuid&gt;:&lt;key&gt;&lt;key&gt;

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



1826
1827
1828
1829
# File 'lib/ionoscloud/api/labels_api.rb', line 1826

def labels_find_by_urn(labelurn, opts = {})
  data, _status_code, _headers = labels_find_by_urn_with_http_info(labelurn, opts)
  data
end

#labels_find_by_urn_with_http_info(labelurn, opts = {}) ⇒ Array<(Label, Integer, Hash)>

Retrieve labels by URN Retrieve a label by label URN. The URN is unique for each label, and consists of: urn:label:&lt;resource_type&gt;:&lt;resource_uuid&gt;:&lt;key&gt;

Parameters:

  • labelurn (String)

    The label URN; URN is unique for each label, and consists of: urn:label:&lt;resource_type&gt;:&lt;resource_uuid&gt;:&lt;key&gt;&lt;key&gt;

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(Label, Integer, Hash)>)

    Label data, response status code and response headers



1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
# File 'lib/ionoscloud/api/labels_api.rb', line 1839

def labels_find_by_urn_with_http_info(labelurn, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.labels_find_by_urn ...'
  end
  # verify the required parameter 'labelurn' is set
  if @api_client.config.client_side_validation && labelurn.nil?
    fail ArgumentError, "Missing the required parameter 'labelurn' when calling LabelsApi.labels_find_by_urn"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.labels_find_by_urn, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.labels_find_by_urn, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/labels/{labelurn}'.sub('{' + 'labelurn' + '}', CGI.escape(labelurn.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Label'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.labels_find_by_urn",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#labels_find_by_urn\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#labels_get(opts = {}) ⇒ Labels

List labels List all available labels.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



1905
1906
1907
1908
# File 'lib/ionoscloud/api/labels_api.rb', line 1905

def labels_get(opts = {})
  data, _status_code, _headers = labels_get_with_http_info(opts)
  data
end

#labels_get_with_http_info(opts = {}) ⇒ Array<(Labels, Integer, Hash)>

List labels List all available labels.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(Labels, Integer, Hash)>)

    Labels data, response status code and response headers



1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
# File 'lib/ionoscloud/api/labels_api.rb', line 1917

def labels_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.labels_get ...'
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.labels_get, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.labels_get, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/labels'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Labels'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.labels_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#snapshots_labels_delete(snapshot_id, key, opts = {}) ⇒ nil

Delete snapshot labels Delete the specified snapshot label.

Parameters:

  • snapshot_id (String)

    The unique ID of the snapshot.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (nil)


1981
1982
1983
1984
# File 'lib/ionoscloud/api/labels_api.rb', line 1981

def snapshots_labels_delete(snapshot_id, key, opts = {})
  snapshots_labels_delete_with_http_info(snapshot_id, key, opts)
  nil
end

#snapshots_labels_delete_with_http_info(snapshot_id, key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete snapshot labels Delete the specified snapshot label.

Parameters:

  • snapshot_id (String)

    The unique ID of the snapshot.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
# File 'lib/ionoscloud/api/labels_api.rb', line 1995

def snapshots_labels_delete_with_http_info(snapshot_id, key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.snapshots_labels_delete ...'
  end
  # verify the required parameter 'snapshot_id' is set
  if @api_client.config.client_side_validation && snapshot_id.nil?
    fail ArgumentError, "Missing the required parameter 'snapshot_id' when calling LabelsApi.snapshots_labels_delete"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.snapshots_labels_delete"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.snapshots_labels_delete, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.snapshots_labels_delete, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/snapshots/{snapshotId}/labels/{key}'.sub('{' + 'snapshotId' + '}', CGI.escape(snapshot_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.snapshots_labels_delete",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#snapshots_labels_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#snapshots_labels_find_by_key(snapshot_id, key, opts = {}) ⇒ LabelResource

Retrieve snapshot labels Retrieve the properties of the specified snapshot label.

Parameters:

  • snapshot_id (String)

    The unique ID of the snapshot.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



2067
2068
2069
2070
# File 'lib/ionoscloud/api/labels_api.rb', line 2067

def snapshots_labels_find_by_key(snapshot_id, key, opts = {})
  data, _status_code, _headers = snapshots_labels_find_by_key_with_http_info(snapshot_id, key, opts)
  data
end

#snapshots_labels_find_by_key_with_http_info(snapshot_id, key, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Retrieve snapshot labels Retrieve the properties of the specified snapshot label.

Parameters:

  • snapshot_id (String)

    The unique ID of the snapshot.

  • key (String)

    The label key

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
# File 'lib/ionoscloud/api/labels_api.rb', line 2081

def snapshots_labels_find_by_key_with_http_info(snapshot_id, key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.snapshots_labels_find_by_key ...'
  end
  # verify the required parameter 'snapshot_id' is set
  if @api_client.config.client_side_validation && snapshot_id.nil?
    fail ArgumentError, "Missing the required parameter 'snapshot_id' when calling LabelsApi.snapshots_labels_find_by_key"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.snapshots_labels_find_by_key"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.snapshots_labels_find_by_key, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.snapshots_labels_find_by_key, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/snapshots/{snapshotId}/labels/{key}'.sub('{' + 'snapshotId' + '}', CGI.escape(snapshot_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.snapshots_labels_find_by_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#snapshots_labels_find_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#snapshots_labels_get(snapshot_id, opts = {}) ⇒ LabelResources

List snapshot labels List all the the labels for the specified snapshot.

Parameters:

  • snapshot_id (String)

    The unique ID of the snapshot.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



2152
2153
2154
2155
# File 'lib/ionoscloud/api/labels_api.rb', line 2152

def snapshots_labels_get(snapshot_id, opts = {})
  data, _status_code, _headers = snapshots_labels_get_with_http_info(snapshot_id, opts)
  data
end

#snapshots_labels_get_with_http_info(snapshot_id, opts = {}) ⇒ Array<(LabelResources, Integer, Hash)>

List snapshot labels List all the the labels for the specified snapshot.

Parameters:

  • snapshot_id (String)

    The unique ID of the snapshot.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResources, Integer, Hash)>)

    LabelResources data, response status code and response headers



2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
# File 'lib/ionoscloud/api/labels_api.rb', line 2165

def snapshots_labels_get_with_http_info(snapshot_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.snapshots_labels_get ...'
  end
  # verify the required parameter 'snapshot_id' is set
  if @api_client.config.client_side_validation && snapshot_id.nil?
    fail ArgumentError, "Missing the required parameter 'snapshot_id' when calling LabelsApi.snapshots_labels_get"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.snapshots_labels_get, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.snapshots_labels_get, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/snapshots/{snapshotId}/labels'.sub('{' + 'snapshotId' + '}', CGI.escape(snapshot_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResources'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.snapshots_labels_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#snapshots_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#snapshots_labels_post(snapshot_id, label, opts = {}) ⇒ LabelResource

Create snapshot labels Add a new label to the specified snapshot.

Parameters:

  • snapshot_id (String)

    The unique ID of the snapshot.

  • label (LabelResource)

    The label to create.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



2233
2234
2235
2236
# File 'lib/ionoscloud/api/labels_api.rb', line 2233

def snapshots_labels_post(snapshot_id, label, opts = {})
  data, _status_code, _headers = snapshots_labels_post_with_http_info(snapshot_id, label, opts)
  data
end

#snapshots_labels_post_with_http_info(snapshot_id, label, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Create snapshot labels Add a new label to the specified snapshot.

Parameters:

  • snapshot_id (String)

    The unique ID of the snapshot.

  • label (LabelResource)

    The label to create.

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
# File 'lib/ionoscloud/api/labels_api.rb', line 2247

def snapshots_labels_post_with_http_info(snapshot_id, label, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.snapshots_labels_post ...'
  end
  # verify the required parameter 'snapshot_id' is set
  if @api_client.config.client_side_validation && snapshot_id.nil?
    fail ArgumentError, "Missing the required parameter 'snapshot_id' when calling LabelsApi.snapshots_labels_post"
  end
  # verify the required parameter 'label' is set
  if @api_client.config.client_side_validation && label.nil?
    fail ArgumentError, "Missing the required parameter 'label' when calling LabelsApi.snapshots_labels_post"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.snapshots_labels_post, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.snapshots_labels_post, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/snapshots/{snapshotId}/labels'.sub('{' + 'snapshotId' + '}', CGI.escape(snapshot_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(label)

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.snapshots_labels_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#snapshots_labels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#snapshots_labels_put(snapshot_id, key, label, opts = {}) ⇒ LabelResource

Modify snapshot labels Modify the specified snapshot label.

Parameters:

  • snapshot_id (String)

    The unique ID of the snapshot.

  • key (String)

    The label key

  • label (LabelResource)

    The modified label

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines). (default to true)

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on (default to 0)

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:



2322
2323
2324
2325
# File 'lib/ionoscloud/api/labels_api.rb', line 2322

def snapshots_labels_put(snapshot_id, key, label, opts = {})
  data, _status_code, _headers = snapshots_labels_put_with_http_info(snapshot_id, key, label, opts)
  data
end

#snapshots_labels_put_with_http_info(snapshot_id, key, label, opts = {}) ⇒ Array<(LabelResource, Integer, Hash)>

Modify snapshot labels Modify the specified snapshot label.

Parameters:

  • snapshot_id (String)

    The unique ID of the snapshot.

  • key (String)

    The label key

  • label (LabelResource)

    The modified label

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

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(LabelResource, Integer, Hash)>)

    LabelResource data, response status code and response headers



2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
# File 'lib/ionoscloud/api/labels_api.rb', line 2337

def snapshots_labels_put_with_http_info(snapshot_id, key, label, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LabelsApi.snapshots_labels_put ...'
  end
  # verify the required parameter 'snapshot_id' is set
  if @api_client.config.client_side_validation && snapshot_id.nil?
    fail ArgumentError, "Missing the required parameter 'snapshot_id' when calling LabelsApi.snapshots_labels_put"
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling LabelsApi.snapshots_labels_put"
  end
  # verify the required parameter 'label' is set
  if @api_client.config.client_side_validation && label.nil?
    fail ArgumentError, "Missing the required parameter 'label' when calling LabelsApi.snapshots_labels_put"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.snapshots_labels_put, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling LabelsApi.snapshots_labels_put, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/snapshots/{snapshotId}/labels/{key}'.sub('{' + 'snapshotId' + '}', CGI.escape(snapshot_id.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(label)

  # return_type
  return_type = opts[:debug_return_type] || 'LabelResource'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"LabelsApi.snapshots_labels_put",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LabelsApi#snapshots_labels_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end