class Apcera::ServicesAndBindingsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = nil) click to toggle source
# File lib/apcera/api/services_and_bindings_api.rb, line 7
def initialize(api_client = nil)
  @api_client = api_client || Configuration.api_client
end

Public Instance Methods

bindings_post(binding, opts = {}) click to toggle source

Creates a new binding between a job and a service, or between two jobs (a job link).

@param binding An object that defines the properties of the new binding. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [Binding]

# File lib/apcera/api/services_and_bindings_api.rb, line 17
def bindings_post(binding, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: ServicesAndBindingsApi#bindings_post ..."
  end
  
  
  # verify the required parameter 'binding' is set
  fail "Missing the required parameter 'binding' when calling bindings_post" if binding.nil?
  
  # resource path
  path = "/bindings".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(binding)
  

  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 => 'Binding')
  if Configuration.debugging
    Configuration.logger.debug "API called: ServicesAndBindingsApi#bindings_post. Result: #{result.inspect}"
  end
  return result
end
services_get(opts = {}) click to toggle source

Lists available services.

@param [Hash] opts the optional parameters @option opts [String] :authorization @option opts [String] :fqn FQN of service to return. @return [Array<Service>]

# File lib/apcera/api/services_and_bindings_api.rb, line 72
def services_get(opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: ServicesAndBindingsApi#services_get ..."
  end
  
  
  # resource path
  path = "/services".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'fqn'] = opts[:'fqn'] if opts[:'fqn']

  # 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<Service>')
  if Configuration.debugging
    Configuration.logger.debug "API called: ServicesAndBindingsApi#services_get. Result: #{result.inspect}"
  end
  return result
end
services_post(opts = {}) click to toggle source

Creates a new service.

@param [Hash] opts the optional parameters @option opts [String] :authorization @option opts [ServiceRequestObject] :service_request Describes the service to create. @return [Service]

# File lib/apcera/api/services_and_bindings_api.rb, line 125
def services_post(opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: ServicesAndBindingsApi#services_post ..."
  end
  
  
  # resource path
  path = "/services".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(opts[:'service_request'])
  

  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 => 'Service')
  if Configuration.debugging
    Configuration.logger.debug "API called: ServicesAndBindingsApi#services_post. Result: #{result.inspect}"
  end
  return result
end
services_uuid_delete(uuid, opts = {}) click to toggle source

Deletes the specified service.

@param uuid UUID of the service. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [nil]

# File lib/apcera/api/services_and_bindings_api.rb, line 177
def services_uuid_delete(uuid, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: ServicesAndBindingsApi#services_uuid_delete ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling services_uuid_delete" if uuid.nil?
  
  # resource path
  path = "/services/{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: ServicesAndBindingsApi#services_uuid_delete"
  end
  return nil
end
unbind_post(job, opts = {}) click to toggle source

Removes a service binding from a job. Removes a service binding from a job. @param job An object that specifies the job and service to unbind. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [nil]

# File lib/apcera/api/services_and_bindings_api.rb, line 231
def unbind_post(job, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: ServicesAndBindingsApi#unbind_post ..."
  end
  
  
  # verify the required parameter 'job' is set
  fail "Missing the required parameter 'job' when calling unbind_post" if job.nil?
  
  # resource path
  path = "/unbind".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(job)
  

  auth_names = ['authorization']
  @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)
  if Configuration.debugging
    Configuration.logger.debug "API called: ServicesAndBindingsApi#unbind_post"
  end
  return nil
end