class Apcera::VirtualNetworksApi
Attributes
Public Class Methods
# File lib/apcera/api/virtual_networks_api.rb, line 7 def initialize(api_client = nil) @api_client = api_client || Configuration.api_client end
Public Instance Methods
Returns a list of virtual networks. Returns a list of virtual networks. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [Array<VirtualNetwork>]
# File lib/apcera/api/virtual_networks_api.rb, line 16 def networks_get(opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: VirtualNetworksApi#networks_get ..." end # resource path path = "/networks".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = [] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization'] # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['authorization'] result = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<VirtualNetwork>') if Configuration.debugging Configuration.logger.debug "API called: VirtualNetworksApi#networks_get. Result: #{result.inspect}" end return result end
Creates a new virtual network. Creates a new virtual network. @param network An object that defines the properties of the new network. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [Array<VirtualNetwork>]
# File lib/apcera/api/virtual_networks_api.rb, line 68 def networks_post(network, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: VirtualNetworksApi#networks_post ..." end # verify the required parameter 'network' is set fail "Missing the required parameter 'network' when calling networks_post" if network.nil? # resource path path = "/networks".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = [] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization'] # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(network) auth_names = ['authorization'] result = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<VirtualNetwork>') if Configuration.debugging Configuration.logger.debug "API called: VirtualNetworksApi#networks_post. Result: #{result.inspect}" end return result end
Deletes the specified virtual network. Deletes the specified virtual network. @param uuid UUID of the virtual network to delete. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [nil]
# File lib/apcera/api/virtual_networks_api.rb, line 178 def networks_uuid_delete(uuid, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: VirtualNetworksApi#networks_uuid_delete ..." end # verify the required parameter 'uuid' is set fail "Missing the required parameter 'uuid' when calling networks_uuid_delete" if uuid.nil? # resource path path = "/networks/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = [] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization'] # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['authorization'] @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if Configuration.debugging Configuration.logger.debug "API called: VirtualNetworksApi#networks_uuid_delete" end return nil end
Returns information about the specified virtual network. Returns information for the specified virtual network. @param uuid UUID of the virtual network to describe. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [Array<VirtualNetwork>]
# File lib/apcera/api/virtual_networks_api.rb, line 123 def networks_uuid_get(uuid, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: VirtualNetworksApi#networks_uuid_get ..." end # verify the required parameter 'uuid' is set fail "Missing the required parameter 'uuid' when calling networks_uuid_get" if uuid.nil? # resource path path = "/networks/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = [] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization'] # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['authorization'] result = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<VirtualNetwork>') if Configuration.debugging Configuration.logger.debug "API called: VirtualNetworksApi#networks_uuid_get. Result: #{result.inspect}" end return result end