class EmassClient::SystemsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/emass_client/api/systems_api.rb, line 16
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_system(system_id, opts = {}) click to toggle source

Get system information for a specific system Returns the system matching provided parameters @param system_id **System Id**: The unique system record identifier. @param [Hash] opts the optional parameters @option opts [BOOLEAN] :include_package **Include Package**: Indicates if additional packages information is retrieved for queried system. (default to true) @option opts [String] :policy **System Policy**: Filter query by system policy. If no value is specified and more than one policy is available, the default return is the RMF policy information. (default to rmf) @return [SystemResponse]

# File lib/emass_client/api/systems_api.rb, line 26
def get_system(system_id, opts = {})
  data, _status_code, _headers = get_system_with_http_info(system_id, opts)
  data
end
get_system_with_http_info(system_id, opts = {}) click to toggle source

Get system information for a specific system Returns the system matching provided parameters @param system_id **System Id**: The unique system record identifier. @param [Hash] opts the optional parameters @option opts [BOOLEAN] :include_package **Include Package**: Indicates if additional packages information is retrieved for queried system. @option opts [String] :policy **System Policy**: Filter query by system policy. If no value is specified and more than one policy is available, the default return is the RMF policy information. @return [Array<(SystemResponse, Integer, Hash)>] SystemResponse data, response status code and response headers

# File lib/emass_client/api/systems_api.rb, line 38
def get_system_with_http_info(system_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SystemsApi.get_system ...'
  end
  # verify the required parameter 'system_id' is set
  if @api_client.config.client_side_validation && system_id.nil?
    fail ArgumentError, "Missing the required parameter 'system_id' when calling SystemsApi.get_system"
  end
  if @api_client.config.client_side_validation && opts[:'policy'] && !['diacap', 'rmf', 'reporting'].include?(opts[:'policy'])
    fail ArgumentError, 'invalid value for "policy", must be one of diacap, rmf, reporting'
  end
  # resource path
  local_var_path = '/api/systems/{systemId}'.sub('{' + 'systemId' + '}', system_id.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'includePackage'] = opts[:'include_package'] if !opts[:'include_package'].nil?
  query_params[:'policy'] = opts[:'policy'] if !opts[:'policy'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'SystemResponse' 

  auth_names = opts[:auth_names] || ['apikey', 'mockType', 'userid']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SystemsApi#get_system\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_systems(opts = {}) click to toggle source

Get system information Returns all system(s) that match the query parameters @param [Hash] opts the optional parameters @option opts [BOOLEAN] :include_package **Include Package**: Indicates if additional packages information is retrieved for queried system. (default to true) @option opts [String] :registration_type **Registration Type**: Filter record by selected registration type (single value or comma delimited values). *Available values:* assessAndAuthorize, assessOnly, guest, regular, functional, cloudServiceProvider, commonControlProvider (default to regular) @option opts [String] :ditpr_id **DITPR ID**: Filter query by DoD Information Technology (IT) Portfolio Repository (DITPR). @option opts [String] :coams_id **COAMS ID**: Filter query by Cyber Operational Attributes Management System (COAMS). @option opts [String] :policy **System Policy**: Filter query by system policy. If no value is specified and more than one policy is available, the default return is the RMF policy information. (default to rmf) @option opts [BOOLEAN] :include_ditpr_metrics **Include DITPR**: Indicates if DITPR metrics are retrieved. This query string parameter can only be used in conjunction with the following parameters:&lt;br&gt; &lt;ul&gt; &lt;li&gt;registrationType&lt;/li&gt; &lt;li&gt;policy&lt;/li&gt; &lt;/ul&gt; (default to false) @option opts [BOOLEAN] :include_decommissioned **Include Decommissioned Systems**: Indicates if decommissioned systems are retrieved. If no value is specified, the default returns true to include decommissioned systems. (default to true) @option opts [BOOLEAN] :reports_for_scorecard **DoD Cyber Hygiene Scorecard**: Indicates if the system reports to the DoD Cyber Hygiene Scorecard. (default to true) @return [SystemResponse]

# File lib/emass_client/api/systems_api.rb, line 96
def get_systems(opts = {})
  data, _status_code, _headers = get_systems_with_http_info(opts)
  data
end
get_systems_with_http_info(opts = {}) click to toggle source

Get system information Returns all system(s) that match the query parameters @param [Hash] opts the optional parameters @option opts [BOOLEAN] :include_package **Include Package**: Indicates if additional packages information is retrieved for queried system. @option opts [String] :registration_type **Registration Type**: Filter record by selected registration type (single value or comma delimited values). *Available values:* assessAndAuthorize, assessOnly, guest, regular, functional, cloudServiceProvider, commonControlProvider

@option opts [String] :ditpr_id **DITPR ID**: Filter query by DoD Information Technology (IT) Portfolio Repository (DITPR). @option opts [String] :coams_id **COAMS ID**: Filter query by Cyber Operational Attributes Management System (COAMS). @option opts [String] :policy **System Policy**: Filter query by system policy. If no value is specified and more than one policy is available, the default return is the RMF policy information. @option opts [BOOLEAN] :include_ditpr_metrics **Include DITPR**: Indicates if DITPR metrics are retrieved. This query string parameter can only be used in conjunction with the following parameters:&lt;br&gt; &lt;ul&gt; &lt;li&gt;registrationType&lt;/li&gt; &lt;li&gt;policy&lt;/li&gt; &lt;/ul&gt; @option opts [BOOLEAN] :include_decommissioned **Include Decommissioned Systems**: Indicates if decommissioned systems are retrieved. If no value is specified, the default returns true to include decommissioned systems. @option opts [BOOLEAN] :reports_for_scorecard **DoD Cyber Hygiene Scorecard**: Indicates if the system reports to the DoD Cyber Hygiene Scorecard. @return [Array<(SystemResponse, Integer, Hash)>] SystemResponse data, response status code and response headers

# File lib/emass_client/api/systems_api.rb, line 113
def get_systems_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SystemsApi.get_systems ...'
  end
  if @api_client.config.client_side_validation && opts[:'policy'] && !['diacap', 'rmf', 'reporting'].include?(opts[:'policy'])
    fail ArgumentError, 'invalid value for "policy", must be one of diacap, rmf, reporting'
  end
  # resource path
  local_var_path = '/api/systems'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'includePackage'] = opts[:'include_package'] if !opts[:'include_package'].nil?
  query_params[:'registrationType'] = opts[:'registration_type'] if !opts[:'registration_type'].nil?
  query_params[:'ditprId'] = opts[:'ditpr_id'] if !opts[:'ditpr_id'].nil?
  query_params[:'coamsId'] = opts[:'coams_id'] if !opts[:'coams_id'].nil?
  query_params[:'policy'] = opts[:'policy'] if !opts[:'policy'].nil?
  query_params[:'includeDitprMetrics'] = opts[:'include_ditpr_metrics'] if !opts[:'include_ditpr_metrics'].nil?
  query_params[:'includeDecommissioned'] = opts[:'include_decommissioned'] if !opts[:'include_decommissioned'].nil?
  query_params[:'reportsForScorecard'] = opts[:'reports_for_scorecard'] if !opts[:'reports_for_scorecard'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'SystemResponse' 

  auth_names = opts[:auth_names] || ['apikey', 'mockType', 'userid']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SystemsApi#get_systems\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end