Class: EmassClient::SystemsApi
- Inherits:
-
Object
- Object
- EmassClient::SystemsApi
- Defined in:
- lib/emass_client/api/systems_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_system(system_id, opts = {}) ⇒ SystemResponse
Get system information for a specific system Returns the system matching provided parameters.
-
#get_system_with_http_info(system_id, opts = {}) ⇒ Array<(SystemResponse, Integer, Hash)>
Get system information for a specific system Returns the system matching provided parameters.
-
#get_systems(opts = {}) ⇒ SystemsResponse
Get system information Returns all system(s) that match the query parameters.
-
#get_systems_with_http_info(opts = {}) ⇒ Array<(SystemsResponse, Integer, Hash)>
Get system information Returns all system(s) that match the query parameters.
-
#initialize(api_client = ApiClient.default) ⇒ SystemsApi
constructor
A new instance of SystemsApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ SystemsApi
Returns a new instance of SystemsApi.
19 20 21 |
# File 'lib/emass_client/api/systems_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/emass_client/api/systems_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_system(system_id, opts = {}) ⇒ SystemResponse
Get system information for a specific system Returns the system matching provided parameters
29 30 31 32 |
# File 'lib/emass_client/api/systems_api.rb', line 29 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 = {}) ⇒ Array<(SystemResponse, Integer, Hash)>
Get system information for a specific system Returns the system matching provided parameters
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/emass_client/api/systems_api.rb', line 41 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 allowable_values = ["diacap", "rmf", "reporting", "unknown_default_open_api"] if @api_client.config.client_side_validation && opts[:'policy'] && !allowable_values.include?(opts[:'policy']) fail ArgumentError, "invalid value for \"policy\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/systems/{systemId}'.sub('{' + 'systemId' + '}', CGI.escape(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[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SystemResponse' # auth_names auth_names = opts[:debug_auth_names] || ['apiKey', 'mockType', 'userId'] = opts.merge( :operation => :"SystemsApi.get_system", :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, ) 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 = {}) ⇒ SystemsResponse
Get system information Returns all system(s) that match the query parameters
107 108 109 110 |
# File 'lib/emass_client/api/systems_api.rb', line 107 def get_systems(opts = {}) data, _status_code, _headers = get_systems_with_http_info(opts) data end |
#get_systems_with_http_info(opts = {}) ⇒ Array<(SystemsResponse, Integer, Hash)>
Get system information Returns all system(s) that match the query parameters
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/emass_client/api/systems_api.rb', line 124 def get_systems_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SystemsApi.get_systems ...' end allowable_values = ["diacap", "rmf", "reporting", "unknown_default_open_api"] if @api_client.config.client_side_validation && opts[:'policy'] && !allowable_values.include?(opts[:'policy']) fail ArgumentError, "invalid value for \"policy\", must be one of #{allowable_values}" 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[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SystemsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['apiKey', 'mockType', 'userId'] = opts.merge( :operation => :"SystemsApi.get_systems", :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, ) 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 |