=begin #CLOUD API #IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. The version of the OpenAPI document: 6.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.2.1-SNAPSHOT =end require 'cgi' module Ionoscloud class LabelsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Delete data center labels # Delete the specified data center label. # @param datacenter_id [String] The unique ID of the data center. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [nil] def datacenters_labels_delete(datacenter_id, key, opts = {}) datacenters_labels_delete_with_http_info(datacenter_id, key, opts) nil end # Delete data center labels # Delete the specified data center label. # @param datacenter_id [String] The unique ID of the data center. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers 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 # Retrieve data center labels # Retrieve the properties of the specified data center label. # @param datacenter_id [String] The unique ID of the data center. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Retrieve data center labels # Retrieve the properties of the specified data center label. # @param datacenter_id [String] The unique ID of the data center. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # List data center labels # List all the the labels for the specified data center. # @param datacenter_id [String] The unique ID of the data center. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResources] def datacenters_labels_get(datacenter_id, opts = {}) data, _status_code, _headers = datacenters_labels_get_with_http_info(datacenter_id, opts) data end # List data center labels # List all the the labels for the specified data center. # @param datacenter_id [String] The unique ID of the data center. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResources, Integer, Hash)>] LabelResources data, response status code and response headers 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 # Create a Data Center Label # Adds a new label to the specified data center. # @param datacenter_id [String] The unique ID of the data center. # @param label [LabelResource] The label to create. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] def datacenters_labels_post(datacenter_id, label, opts = {}) data, _status_code, _headers = datacenters_labels_post_with_http_info(datacenter_id, label, opts) data end # Create a Data Center Label # Adds a new label to the specified data center. # @param datacenter_id [String] The unique ID of the data center. # @param label [LabelResource] The label to create. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # Modify a Data Center Label by Key # Modifies the specified data center label. # @param datacenter_id [String] The unique ID of the data center. # @param key [String] The label key # @param label [LabelResource] The modified label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Modify a Data Center Label by Key # Modifies the specified data center label. # @param datacenter_id [String] The unique ID of the data center. # @param key [String] The label key # @param label [LabelResource] The modified label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # Delete server labels # Delete the specified server label. # @param datacenter_id [String] The unique ID of the data center. # @param server_id [String] The unique ID of the server. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [nil] 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 # Delete server labels # Delete the specified server label. # @param datacenter_id [String] The unique ID of the data center. # @param server_id [String] The unique ID of the server. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers 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 # Retrieve server labels # Retrieve the properties of the specified server label. # @param datacenter_id [String] The unique ID of the data center. # @param server_id [String] The unique ID of the server. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Retrieve server labels # Retrieve the properties of the specified server label. # @param datacenter_id [String] The unique ID of the data center. # @param server_id [String] The unique ID of the server. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # List server labels # List all the the labels for the specified server. # @param datacenter_id [String] The unique ID of the data center. # @param server_id [String] The unique ID of the server. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResources] 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 # List server labels # List all the the labels for the specified server. # @param datacenter_id [String] The unique ID of the data center. # @param server_id [String] The unique ID of the server. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResources, Integer, Hash)>] LabelResources data, response status code and response headers 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 # Create a Server Label # Adds a new label to the specified server. # @param datacenter_id [String] The unique ID of the data center. # @param server_id [String] The unique ID of the server. # @param label [LabelResource] The label to create. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Create a Server Label # Adds a new label to the specified server. # @param datacenter_id [String] The unique ID of the data center. # @param server_id [String] The unique ID of the server. # @param label [LabelResource] The label to create. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # Modify a Server Label # Modifies the specified server label. # @param datacenter_id [String] The unique ID of the data center. # @param server_id [String] The unique ID of the server. # @param key [String] The label key # @param label [LabelResource] The modified label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Modify a Server Label # Modifies the specified server label. # @param datacenter_id [String] The unique ID of the data center. # @param server_id [String] The unique ID of the server. # @param key [String] The label key # @param label [LabelResource] The modified label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # Delete volume labels # Delete the specified volume label. # @param datacenter_id [String] The unique ID of the data center. # @param volume_id [String] The unique ID of the volume. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [nil] 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 # Delete volume labels # Delete the specified volume label. # @param datacenter_id [String] The unique ID of the data center. # @param volume_id [String] The unique ID of the volume. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers 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 # Retrieve volume labels # Retrieve the properties of the specified volume label. # @param datacenter_id [String] The unique ID of the data center. # @param volume_id [String] The unique ID of the volume. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Retrieve volume labels # Retrieve the properties of the specified volume label. # @param datacenter_id [String] The unique ID of the data center. # @param volume_id [String] The unique ID of the volume. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # List volume labels # List all the the labels for the specified volume. # @param datacenter_id [String] The unique ID of the data center. # @param volume_id [String] The unique ID of the volume. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResources] 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 # List volume labels # List all the the labels for the specified volume. # @param datacenter_id [String] The unique ID of the data center. # @param volume_id [String] The unique ID of the volume. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResources, Integer, Hash)>] LabelResources data, response status code and response headers 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 # Create a Volume Label # Adds a new label to the specified volume. # @param datacenter_id [String] The unique ID of the data center. # @param volume_id [String] The unique ID of the volume. # @param label [LabelResource] The label to create. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Create a Volume Label # Adds a new label to the specified volume. # @param datacenter_id [String] The unique ID of the data center. # @param volume_id [String] The unique ID of the volume. # @param label [LabelResource] The label to create. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # Modify a Volume Label # Modifies the specified volume label. # @param datacenter_id [String] The unique ID of the data center. # @param volume_id [String] The unique ID of the volume. # @param key [String] The label key # @param label [LabelResource] The modified label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Modify a Volume Label # Modifies the specified volume label. # @param datacenter_id [String] The unique ID of the data center. # @param volume_id [String] The unique ID of the volume. # @param key [String] The label key # @param label [LabelResource] The modified label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # Delete IP block labels # Delete the specified IP block label. # @param ipblock_id [String] The unique ID of the IP block. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [nil] def ipblocks_labels_delete(ipblock_id, key, opts = {}) ipblocks_labels_delete_with_http_info(ipblock_id, key, opts) nil end # Delete IP block labels # Delete the specified IP block label. # @param ipblock_id [String] The unique ID of the IP block. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers 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 # Retrieve IP block labels # Retrieve the properties of the specified IP block label. # @param ipblock_id [String] The unique ID of the IP block. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Retrieve IP block labels # Retrieve the properties of the specified IP block label. # @param ipblock_id [String] The unique ID of the IP block. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # List IP block labels # List all the the labels for the specified IP block. # @param ipblock_id [String] The unique ID of the IP block. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResources] def ipblocks_labels_get(ipblock_id, opts = {}) data, _status_code, _headers = ipblocks_labels_get_with_http_info(ipblock_id, opts) data end # List IP block labels # List all the the labels for the specified IP block. # @param ipblock_id [String] The unique ID of the IP block. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResources, Integer, Hash)>] LabelResources data, response status code and response headers 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 # Create IP block labels # Add a new label to the specified IP block. # @param ipblock_id [String] The unique ID of the IP block. # @param label [LabelResource] The label to create. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] def ipblocks_labels_post(ipblock_id, label, opts = {}) data, _status_code, _headers = ipblocks_labels_post_with_http_info(ipblock_id, label, opts) data end # Create IP block labels # Add a new label to the specified IP block. # @param ipblock_id [String] The unique ID of the IP block. # @param label [LabelResource] The label to create. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # Modify a IP Block Label by ID # Modifies the specified IP block label. # @param ipblock_id [String] The unique ID of the IP block. # @param key [String] The label key # @param label [LabelResource] The modified label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Modify a IP Block Label by ID # Modifies the specified IP block label. # @param ipblock_id [String] The unique ID of the IP block. # @param key [String] The label key # @param label [LabelResource] The modified label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # Retrieve labels by URN # Retrieve a label by label URN. The URN is unique for each label, and consists of: urn:label::: # @param labelurn [String] The label URN; URN is unique for each label, and consists of: urn:label:<resource_type>:<resource_uuid>:<key><key> # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Label] def labels_find_by_urn(labelurn, opts = {}) data, _status_code, _headers = labels_find_by_urn_with_http_info(labelurn, opts) data end # 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> # @param labelurn [String] The label URN; URN is unique for each label, and consists of: urn:label:<resource_type>:<resource_uuid>:<key><key> # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(Label, Integer, Hash)>] Label data, response status code and response headers 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 # List labels # List all available labels. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Labels] def labels_get(opts = {}) data, _status_code, _headers = labels_get_with_http_info(opts) data end # List labels # List all available labels. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(Labels, Integer, Hash)>] Labels data, response status code and response headers 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 # Delete snapshot labels # Delete the specified snapshot label. # @param snapshot_id [String] The unique ID of the snapshot. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [nil] def snapshots_labels_delete(snapshot_id, key, opts = {}) snapshots_labels_delete_with_http_info(snapshot_id, key, opts) nil end # Delete snapshot labels # Delete the specified snapshot label. # @param snapshot_id [String] The unique ID of the snapshot. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers 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 # Retrieve snapshot labels # Retrieve the properties of the specified snapshot label. # @param snapshot_id [String] The unique ID of the snapshot. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Retrieve snapshot labels # Retrieve the properties of the specified snapshot label. # @param snapshot_id [String] The unique ID of the snapshot. # @param key [String] The label key # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # List snapshot labels # List all the the labels for the specified snapshot. # @param snapshot_id [String] The unique ID of the snapshot. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResources] def snapshots_labels_get(snapshot_id, opts = {}) data, _status_code, _headers = snapshots_labels_get_with_http_info(snapshot_id, opts) data end # List snapshot labels # List all the the labels for the specified snapshot. # @param snapshot_id [String] The unique ID of the snapshot. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResources, Integer, Hash)>] LabelResources data, response status code and response headers 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 # Create a Snapshot Label # Adds a new label to the specified snapshot. # @param snapshot_id [String] The unique ID of the snapshot. # @param label [LabelResource] The label to create. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] def snapshots_labels_post(snapshot_id, label, opts = {}) data, _status_code, _headers = snapshots_labels_post_with_http_info(snapshot_id, label, opts) data end # Create a Snapshot Label # Adds a new label to the specified snapshot. # @param snapshot_id [String] The unique ID of the snapshot. # @param label [LabelResource] The label to create. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 # Modify a Snapshot Label by ID # Modifies the specified snapshot label. # @param snapshot_id [String] The unique ID of the snapshot. # @param key [String] The label key # @param label [LabelResource] The modified label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). (default to true) # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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) # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [LabelResource] 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 # Modify a Snapshot Label by ID # Modifies the specified snapshot label. # @param snapshot_id [String] The unique ID of the snapshot. # @param key [String] The label key # @param label [LabelResource] The modified label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether the response is pretty-printed (with indentations and new lines). # @option opts [Integer] :depth Controls the detail depth of the response objects. GET /datacenters/[ID] - 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 # @option opts [Integer] :x_contract_number Users with multiple contracts must provide the contract number, for which all API requests are to be executed. # @return [Array<(LabelResource, Integer, Hash)>] LabelResource data, response status code and response headers 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 end end