=begin #CLOUD API #An enterprise-grade Infrastructure is provided as a Service (IaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive. The version of the OpenAPI document: 5.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.0.1-SNAPSHOT =end require 'cgi' module Ionoscloud class LabelApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Delete a Label from Data Center # This will remove a label from the data center. # @param datacenter_id [String] The unique ID of the Data Center # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @return [Object] def datacenters_labels_delete(datacenter_id, key, opts = {}) data, _status_code, _headers = datacenters_labels_delete_with_http_info(datacenter_id, key, opts) data end # Delete a Label from Data Center # This will remove a label from the data center. # @param datacenter_id [String] The unique ID of the Data Center # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @return [Array<(Object, Integer, Hash)>] Object data, 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"LabelApi.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: LabelApi#datacenters_labels_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a Label of Data Center # This will retrieve the properties of a associated label to a data center. # @param datacenter_id [String] The unique ID of the Data Center # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 a Label of Data Center # This will retrieve the properties of a associated label to a data center. # @param datacenter_id [String] The unique ID of the Data Center # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#datacenters_labels_find_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List all Data Center Labels # You can retrieve a list of all labels associated with a 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 response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) (default to 0) # @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) (default to 1000) # @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 all Data Center Labels # You can retrieve a list of all labels associated with a 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 response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) # @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) # @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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.datacenters_labels_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling LabelApi.datacenters_labels_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LabelApi.datacenters_labels_get, must be smaller than or equal to 10000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LabelApi.datacenters_labels_get, must be greater than or equal to 1.' 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? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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 => :"LabelApi.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: LabelApi#datacenters_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add a Label to Data Center # This will add a label to the data center. # @param datacenter_id [String] The unique ID of the Data Center # @param label [LabelResource] Label to be added # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 # Add a Label to Data Center # This will add a label to the data center. # @param datacenter_id [String] The unique ID of the Data Center # @param label [LabelResource] Label to be added # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#datacenters_labels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Modify a Label of Data Center # This will modify the value of the label on a data center. # @param datacenter_id [String] The unique ID of the Data Center # @param key [String] The key of the Label # @param label [LabelResource] Modified Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 Label of Data Center # This will modify the value of the label on a data center. # @param datacenter_id [String] The unique ID of the Data Center # @param key [String] The key of the Label # @param label [LabelResource] Modified Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#datacenters_labels_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a Label from Server # This will remove a label from the server. # @param datacenter_id [String] The unique ID of the Datacenter # @param server_id [String] The unique ID of the Server # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @return [Object] def datacenters_servers_labels_delete(datacenter_id, server_id, key, opts = {}) data, _status_code, _headers = datacenters_servers_labels_delete_with_http_info(datacenter_id, server_id, key, opts) data end # Delete a Label from Server # This will remove a label from the server. # @param datacenter_id [String] The unique ID of the Datacenter # @param server_id [String] The unique ID of the Server # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @return [Array<(Object, Integer, Hash)>] Object data, 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"LabelApi.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: LabelApi#datacenters_servers_labels_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a Label of Server # This will retrieve the properties of a associated label to a server. # @param datacenter_id [String] The unique ID of the Datacenter # @param server_id [String] The unique ID of the Server # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 a Label of Server # This will retrieve the properties of a associated label to a server. # @param datacenter_id [String] The unique ID of the Datacenter # @param server_id [String] The unique ID of the Server # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#datacenters_servers_labels_find_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List all Server Labels # You can retrieve a list of all labels associated with a server # @param datacenter_id [String] The unique ID of the Datacenter # @param server_id [String] The unique ID of the Server # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) (default to 0) # @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) (default to 1000) # @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 all Server Labels # You can retrieve a list of all labels associated with a server # @param datacenter_id [String] The unique ID of the Datacenter # @param server_id [String] The unique ID of the Server # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) # @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) # @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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.datacenters_servers_labels_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling LabelApi.datacenters_servers_labels_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LabelApi.datacenters_servers_labels_get, must be smaller than or equal to 10000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LabelApi.datacenters_servers_labels_get, must be greater than or equal to 1.' 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? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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 => :"LabelApi.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: LabelApi#datacenters_servers_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add a Label to Server # This will add a label to the server. # @param datacenter_id [String] The unique ID of the Datacenter # @param server_id [String] The unique ID of the Server # @param label [LabelResource] Label to be added # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 # Add a Label to Server # This will add a label to the server. # @param datacenter_id [String] The unique ID of the Datacenter # @param server_id [String] The unique ID of the Server # @param label [LabelResource] Label to be added # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#datacenters_servers_labels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Modify a Label of Server # This will modify the value of the label on a server. # @param datacenter_id [String] The unique ID of the Datacenter # @param server_id [String] The unique ID of the Server # @param key [String] The key of the Label # @param label [LabelResource] Modified Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 Label of Server # This will modify the value of the label on a server. # @param datacenter_id [String] The unique ID of the Datacenter # @param server_id [String] The unique ID of the Server # @param key [String] The key of the Label # @param label [LabelResource] Modified Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#datacenters_servers_labels_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a Label from Volume # This will remove a label from the volume. # @param datacenter_id [String] The unique ID of the Datacenter # @param volume_id [String] The unique ID of the Volume # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @return [Object] def datacenters_volumes_labels_delete(datacenter_id, volume_id, key, opts = {}) data, _status_code, _headers = datacenters_volumes_labels_delete_with_http_info(datacenter_id, volume_id, key, opts) data end # Delete a Label from Volume # This will remove a label from the volume. # @param datacenter_id [String] The unique ID of the Datacenter # @param volume_id [String] The unique ID of the Volume # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @return [Array<(Object, Integer, Hash)>] Object data, 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"LabelApi.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: LabelApi#datacenters_volumes_labels_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a Label of Volume # This will retrieve the properties of a associated label to a volume. # @param datacenter_id [String] The unique ID of the Datacenter # @param volume_id [String] The unique ID of the Volume # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 a Label of Volume # This will retrieve the properties of a associated label to a volume. # @param datacenter_id [String] The unique ID of the Datacenter # @param volume_id [String] The unique ID of the Volume # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#datacenters_volumes_labels_find_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List all Volume Labels # You can retrieve a list of all labels associated with a volume # @param datacenter_id [String] The unique ID of the Datacenter # @param volume_id [String] The unique ID of the Volume # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) (default to 0) # @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) (default to 1000) # @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 all Volume Labels # You can retrieve a list of all labels associated with a volume # @param datacenter_id [String] The unique ID of the Datacenter # @param volume_id [String] The unique ID of the Volume # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) # @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) # @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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.datacenters_volumes_labels_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling LabelApi.datacenters_volumes_labels_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LabelApi.datacenters_volumes_labels_get, must be smaller than or equal to 10000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LabelApi.datacenters_volumes_labels_get, must be greater than or equal to 1.' 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? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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 => :"LabelApi.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: LabelApi#datacenters_volumes_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add a Label to Volume # This will add a label to the volume. # @param datacenter_id [String] The unique ID of the Datacenter # @param volume_id [String] The unique ID of the Volume # @param label [LabelResource] Label to be added # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 # Add a Label to Volume # This will add a label to the volume. # @param datacenter_id [String] The unique ID of the Datacenter # @param volume_id [String] The unique ID of the Volume # @param label [LabelResource] Label to be added # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#datacenters_volumes_labels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Modify a Label of Volume # This will modify the value of the label on a volume. # @param datacenter_id [String] The unique ID of the Datacenter # @param volume_id [String] The unique ID of the Volume # @param key [String] The key of the Label # @param label [LabelResource] Modified Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 Label of Volume # This will modify the value of the label on a volume. # @param datacenter_id [String] The unique ID of the Datacenter # @param volume_id [String] The unique ID of the Volume # @param key [String] The key of the Label # @param label [LabelResource] Modified Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#datacenters_volumes_labels_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a Label from IP Block # This will remove a label from the Ip Block. # @param ipblock_id [String] The unique ID of the Ip Block # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @return [Object] def ipblocks_labels_delete(ipblock_id, key, opts = {}) data, _status_code, _headers = ipblocks_labels_delete_with_http_info(ipblock_id, key, opts) data end # Delete a Label from IP Block # This will remove a label from the Ip Block. # @param ipblock_id [String] The unique ID of the Ip Block # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @return [Array<(Object, Integer, Hash)>] Object data, 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"LabelApi.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: LabelApi#ipblocks_labels_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a Label of IP Block # This will retrieve the properties of a associated label to a Ip Block. # @param ipblock_id [String] The unique ID of the Ip Block # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 a Label of IP Block # This will retrieve the properties of a associated label to a Ip Block. # @param ipblock_id [String] The unique ID of the Ip Block # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#ipblocks_labels_find_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List all Ip Block Labels # You can retrieve a list of all labels associated with a 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 response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 all Ip Block Labels # You can retrieve a list of all labels associated with a 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 response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#ipblocks_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add a Label to IP Block # This will add a label to the Ip Block. # @param ipblock_id [String] The unique ID of the Ip Block # @param label [LabelResource] Label to be added # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 # Add a Label to IP Block # This will add a label to the Ip Block. # @param ipblock_id [String] The unique ID of the Ip Block # @param label [LabelResource] Label to be added # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#ipblocks_labels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Modify a Label of IP Block # This will modify the value of the label on a Ip Block. # @param ipblock_id [String] The unique ID of the Ip Block # @param key [String] The key of the Label # @param label [LabelResource] Modified Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 Label of IP Block # This will modify the value of the label on a Ip Block. # @param ipblock_id [String] The unique ID of the Ip Block # @param key [String] The key of the Label # @param label [LabelResource] Modified Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#ipblocks_labels_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns the label by its URN. # You can retrieve the details of a specific label using its URN. A URN is for uniqueness of a Label and composed using urn:label::: # @param labelurn [String] The URN representing the unique ID of the label. A URN is for uniqueness of a Label and composed using urn:label:<resource_type>:<resource_uuid>:<key> # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 # Returns the label by its URN. # You can retrieve the details of a specific label using its URN. A URN is for uniqueness of a Label and composed using urn:label:<resource_type>:<resource_uuid>:<key> # @param labelurn [String] The URN representing the unique ID of the label. A URN is for uniqueness of a Label and composed using urn:label:<resource_type>:<resource_uuid>:<key> # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#labels_find_by_urn\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Labels # You can retrieve a complete list of labels that you have access to. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @return [Labels] def labels_get(opts = {}) data, _status_code, _headers = labels_get_with_http_info(opts) data end # List Labels # You can retrieve a complete list of labels that you have access to. # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a Label from Snapshot # This will remove a label from the snapshot. # @param snapshot_id [String] The unique ID of the Snapshot # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @return [Object] def snapshots_labels_delete(snapshot_id, key, opts = {}) data, _status_code, _headers = snapshots_labels_delete_with_http_info(snapshot_id, key, opts) data end # Delete a Label from Snapshot # This will remove a label from the snapshot. # @param snapshot_id [String] The unique ID of the Snapshot # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed # @return [Array<(Object, Integer, Hash)>] Object data, 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"LabelApi.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: LabelApi#snapshots_labels_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a Label of Snapshot # This will retrieve the properties of a associated label to a snapshot. # @param snapshot_id [String] The unique ID of the Snapshot # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 a Label of Snapshot # This will retrieve the properties of a associated label to a snapshot. # @param snapshot_id [String] The unique ID of the Snapshot # @param key [String] The key of the Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#snapshots_labels_find_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List all Snapshot Labels # You can retrieve a list of all labels associated with a snapshot # @param snapshot_id [String] The unique ID of the Snapshot # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 all Snapshot Labels # You can retrieve a list of all labels associated with a snapshot # @param snapshot_id [String] The unique ID of the Snapshot # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#snapshots_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add a Label to Snapshot # This will add a label to the snapshot. # @param snapshot_id [String] The unique ID of the Snapshot # @param label [LabelResource] Label to be added # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 # Add a Label to Snapshot # This will add a label to the snapshot. # @param snapshot_id [String] The unique ID of the Snapshot # @param label [LabelResource] Label to be added # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#snapshots_labels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Modify a Label of Snapshot # This will modify the value of the label on a snapshot. # @param snapshot_id [String] The unique ID of the Snapshot # @param key [String] The key of the Label # @param label [LabelResource] Modified Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 Label of Snapshot # This will modify the value of the label on a snapshot. # @param snapshot_id [String] The unique ID of the Snapshot # @param key [String] The key of the Label # @param label [LabelResource] Modified Label # @param [Hash] opts the optional parameters # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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: LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 LabelApi.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 => :"LabelApi.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: LabelApi#snapshots_labels_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end