class Apcera::RulesApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

rules_get(opts = {}) click to toggle source

Lists all policy rules.

@param [Hash] opts the optional parameters @option opts [String] :authorization @return [nil]

# File lib/apcera/api/rules_api.rb, line 16
def rules_get(opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: RulesApi#rules_get ..."
  end
  
  
  # resource path
  path = "/rules".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 = []
  @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)
  if Configuration.debugging
    Configuration.logger.debug "API called: RulesApi#rules_get"
  end
  return nil
end
rules_post(rule, opts = {}) click to toggle source

Creates a new semantic pipeline rule for governing a given provider's behavior.

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

# File lib/apcera/api/rules_api.rb, line 67
def rules_post(rule, opts = {})

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

  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: RulesApi#rules_post"
  end
  return nil
end
rules_uuid_delete(uuid, opts = {}) click to toggle source

Deletes a policy event rule.

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

# File lib/apcera/api/rules_api.rb, line 176
def rules_uuid_delete(uuid, opts = {})

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

Returns information about a rule that that controls the behavior of semantic pipelines. Returns information about a rule that that controls the behavior of semantic pipelines. @param uuid UUID of the rule. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [Rule]

# File lib/apcera/api/rules_api.rb, line 121
def rules_uuid_get(uuid, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: RulesApi#rules_uuid_get ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling rules_uuid_get" if uuid.nil?
  
  # resource path
  path = "/rules/{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 => 'Rule')
  if Configuration.debugging
    Configuration.logger.debug "API called: RulesApi#rules_uuid_get. Result: #{result.inspect}"
  end
  return result
end