Class: EmassClient::POAMApi

Inherits:
Object
  • Object
show all
Defined in:
lib/emass_client/api/poam_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ POAMApi



19
20
21
# File 'lib/emass_client/api/poam_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/emass_client/api/poam_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_poam_by_system_id(system_id, request_body, opts = {}) ⇒ PoamResponsePost

Add one or many POA&M items in a system Add a POA&M for given ‘systemId`
**Request Body Required Fields** - `status` - `vulnerabilityDescription` - `sourceIdentVuln` - `pocOrganization` - `resources` Note<br /> If a POC email is supplied, the application will attempt to locate a user already registered within the application and pre-populate any information not explicitly supplied in the request. If no such user is found, these fields are required within the request.
`pocFirstName`, `pocLastName`, `pocPhoneNumber`<br />



28
29
30
31
# File 'lib/emass_client/api/poam_api.rb', line 28

def add_poam_by_system_id(system_id, request_body, opts = {})
  data, _status_code, _headers = add_poam_by_system_id_with_http_info(system_id, request_body, opts)
  data
end

#add_poam_by_system_id_with_http_info(system_id, request_body, opts = {}) ⇒ Array<(PoamResponsePost, Integer, Hash)>

Add one or many POA&amp;M items in a system Add a POA&amp;M for given &#x60;systemId&#x60;&lt;br&gt; **Request Body Required Fields** - &#x60;status&#x60; - &#x60;vulnerabilityDescription&#x60; - &#x60;sourceIdentVuln&#x60; - &#x60;pocOrganization&#x60; - &#x60;resources&#x60; Note&lt;br /&gt; If a POC email is supplied, the application will attempt to locate a user already registered within the application and pre-populate any information not explicitly supplied in the request. If no such user is found, these fields are required within the request.&lt;br&gt; &#x60;pocFirstName&#x60;, &#x60;pocLastName&#x60;, &#x60;pocPhoneNumber&#x60;&lt;br /&gt;



39
40
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
94
# File 'lib/emass_client/api/poam_api.rb', line 39

def add_poam_by_system_id_with_http_info(system_id, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: POAMApi.add_poam_by_system_id ...'
  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 POAMApi.add_poam_by_system_id"
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling POAMApi.add_poam_by_system_id"
  end
  # resource path
  local_var_path = '/api/systems/{systemId}/poams'.sub('{' + 'systemId' + '}', CGI.escape(system_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)

  # return_type
  return_type = opts[:debug_return_type] || 'PoamResponsePost'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKey', 'mockType', 'userId']

  new_options = opts.merge(
    :operation => :"POAMApi.add_poam_by_system_id",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: POAMApi#add_poam_by_system_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_poam(system_id, poam_request_delete_body_inner, opts = {}) ⇒ PoamResponseDelete

Remove one or many POA&M items in a system Remove the POA&M matching ‘systemId` path parameter and `poamId` Request Body



102
103
104
105
# File 'lib/emass_client/api/poam_api.rb', line 102

def delete_poam(system_id, poam_request_delete_body_inner, opts = {})
  data, _status_code, _headers = delete_poam_with_http_info(system_id, poam_request_delete_body_inner, opts)
  data
end

#delete_poam_with_http_info(system_id, poam_request_delete_body_inner, opts = {}) ⇒ Array<(PoamResponseDelete, Integer, Hash)>

Remove one or many POA&amp;M items in a system Remove the POA&amp;M matching &#x60;systemId&#x60; path parameter and &#x60;poamId&#x60; Request Body&lt;br&gt;



113
114
115
116
117
118
119
120
121
122
123
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
# File 'lib/emass_client/api/poam_api.rb', line 113

def delete_poam_with_http_info(system_id, poam_request_delete_body_inner, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: POAMApi.delete_poam ...'
  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 POAMApi.delete_poam"
  end
  # verify the required parameter 'poam_request_delete_body_inner' is set
  if @api_client.config.client_side_validation && poam_request_delete_body_inner.nil?
    fail ArgumentError, "Missing the required parameter 'poam_request_delete_body_inner' when calling POAMApi.delete_poam"
  end
  # resource path
  local_var_path = '/api/systems/{systemId}/poams'.sub('{' + 'systemId' + '}', CGI.escape(system_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(poam_request_delete_body_inner)

  # return_type
  return_type = opts[:debug_return_type] || 'PoamResponseDelete'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKey', 'mockType', 'userId']

  new_options = opts.merge(
    :operation => :"POAMApi.delete_poam",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: POAMApi#delete_poam\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_system_poams(system_id, opts = {}) ⇒ PoamResponseGetSystems

Get one or many POA&M items in a system Returns system(s) containing POA&M items for matching parameters.

Options Hash (opts):

  • :scheduled_completion_date_start (String)

    **Date Started**: Filter query by the scheduled completion start date (Unix date format).

  • :scheduled_completion_date_end (String)

    **Date Ended**: Filter query by the scheduled completion start date (Unix date format).

  • :control_acronyms (String)

    **Control Acronym**: Filter query by given system acronym (single value or comma separated).

  • :assessment_procedures (String)

    **Assessment Procedure**: Filter query by given Security Control Assessment Procedure (single value or comma separated).

  • :ccis (String)

    **CCI System**: Filter query by Control Correlation Identifiers (CCIs) (single value or comma separated).

  • :system_only (Boolean)

    **Systems Only**: Indicates that only system(s) information is retrieved. (default to true)



181
182
183
184
# File 'lib/emass_client/api/poam_api.rb', line 181

def get_system_poams(system_id, opts = {})
  data, _status_code, _headers = get_system_poams_with_http_info(system_id, opts)
  data
end

#get_system_poams_by_poam_id(system_id, poam_id, opts = {}) ⇒ PoamResponseGetPoams

Get POA&M item by ID in a system Returns system(s) containing POA&M items for matching parameters.



257
258
259
260
# File 'lib/emass_client/api/poam_api.rb', line 257

def get_system_poams_by_poam_id(system_id, poam_id, opts = {})
  data, _status_code, _headers = get_system_poams_by_poam_id_with_http_info(system_id, poam_id, opts)
  data
end

#get_system_poams_by_poam_id_with_http_info(system_id, poam_id, opts = {}) ⇒ Array<(PoamResponseGetPoams, Integer, Hash)>

Get POA&amp;M item by ID in a system Returns system(s) containing POA&amp;M items for matching parameters.



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/emass_client/api/poam_api.rb', line 268

def get_system_poams_by_poam_id_with_http_info(system_id, poam_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: POAMApi.get_system_poams_by_poam_id ...'
  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 POAMApi.get_system_poams_by_poam_id"
  end
  # verify the required parameter 'poam_id' is set
  if @api_client.config.client_side_validation && poam_id.nil?
    fail ArgumentError, "Missing the required parameter 'poam_id' when calling POAMApi.get_system_poams_by_poam_id"
  end
  # resource path
  local_var_path = '/api/systems/{systemId}/poams/{poamId}'.sub('{' + 'systemId' + '}', CGI.escape(system_id.to_s)).sub('{' + 'poamId' + '}', CGI.escape(poam_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # 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] || 'PoamResponseGetPoams'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKey', 'mockType', 'userId']

  new_options = opts.merge(
    :operation => :"POAMApi.get_system_poams_by_poam_id",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: POAMApi#get_system_poams_by_poam_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_system_poams_with_http_info(system_id, opts = {}) ⇒ Array<(PoamResponseGetSystems, Integer, Hash)>

Get one or many POA&amp;M items in a system Returns system(s) containing POA&amp;M items for matching parameters.

Options Hash (opts):

  • :scheduled_completion_date_start (String)

    **Date Started**: Filter query by the scheduled completion start date (Unix date format).

  • :scheduled_completion_date_end (String)

    **Date Ended**: Filter query by the scheduled completion start date (Unix date format).

  • :control_acronyms (String)

    **Control Acronym**: Filter query by given system acronym (single value or comma separated).

  • :assessment_procedures (String)

    **Assessment Procedure**: Filter query by given Security Control Assessment Procedure (single value or comma separated).

  • :ccis (String)

    **CCI System**: Filter query by Control Correlation Identifiers (CCIs) (single value or comma separated).

  • :system_only (Boolean)

    **Systems Only**: Indicates that only system(s) information is retrieved. (default to true)



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/emass_client/api/poam_api.rb', line 197

def get_system_poams_with_http_info(system_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: POAMApi.get_system_poams ...'
  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 POAMApi.get_system_poams"
  end
  # resource path
  local_var_path = '/api/systems/{systemId}/poams'.sub('{' + 'systemId' + '}', CGI.escape(system_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'scheduledCompletionDateStart'] = opts[:'scheduled_completion_date_start'] if !opts[:'scheduled_completion_date_start'].nil?
  query_params[:'scheduledCompletionDateEnd'] = opts[:'scheduled_completion_date_end'] if !opts[:'scheduled_completion_date_end'].nil?
  query_params[:'controlAcronyms'] = opts[:'control_acronyms'] if !opts[:'control_acronyms'].nil?
  query_params[:'assessmentProcedures'] = opts[:'assessment_procedures'] if !opts[:'assessment_procedures'].nil?
  query_params[:'ccis'] = opts[:'ccis'] if !opts[:'ccis'].nil?
  query_params[:'systemOnly'] = opts[:'system_only'] if !opts[:'system_only'].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] || 'PoamResponseGetSystems'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKey', 'mockType', 'userId']

  new_options = opts.merge(
    :operation => :"POAMApi.get_system_poams",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: POAMApi#get_system_poams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_poam_by_system_id(system_id, request_body, opts = {}) ⇒ PoamResponsePut

Update one or many POA&M items in a system Update a POA&M for given ‘systemId`
**Request Body Required Fields** - `poamId` - `displayPoamId` - `status` - `vulnerabilityDescription` - `sourceIdentVuln` - `pocOrganization` - `reviewStatus` Notes - If a POC email is supplied, the application will attempt to locate a user already registered within the application and pre-populate any information not explicitly supplied in the request. If no such user is found, these fields are required within the request.
`pocOrganization`, `pocFirstName`, `pocLastName`, `pocEmail`, `pocPhoneNumber`<br /> - To prevent uploading duplicate/undesired milestones through the POA&M PUT we must include an `isActive` field for the milestone and set it to equal to false `(isActive=false)`.



326
327
328
329
# File 'lib/emass_client/api/poam_api.rb', line 326

def update_poam_by_system_id(system_id, request_body, opts = {})
  data, _status_code, _headers = update_poam_by_system_id_with_http_info(system_id, request_body, opts)
  data
end

#update_poam_by_system_id_with_http_info(system_id, request_body, opts = {}) ⇒ Array<(PoamResponsePut, Integer, Hash)>

Update one or many POA&amp;M items in a system Update a POA&amp;M for given &#x60;systemId&#x60;&lt;br&gt; **Request Body Required Fields** - &#x60;poamId&#x60; - &#x60;displayPoamId&#x60; - &#x60;status&#x60; - &#x60;vulnerabilityDescription&#x60; - &#x60;sourceIdentVuln&#x60; - &#x60;pocOrganization&#x60; - &#x60;reviewStatus&#x60; Notes - If a POC email is supplied, the application will attempt to locate a user already registered within the application and pre-populate any information not explicitly supplied in the request. If no such user is found, these fields are required within the request.&lt;br&gt; &#x60;pocOrganization&#x60;, &#x60;pocFirstName&#x60;, &#x60;pocLastName&#x60;, &#x60;pocEmail&#x60;, &#x60;pocPhoneNumber&#x60;&lt;br /&gt; - To prevent uploading duplicate/undesired milestones through the POA&amp;M PUT we must include an &#x60;isActive&#x60; field for the milestone and set it to equal to false &#x60;(isActive&#x3D;false)&#x60;.



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/emass_client/api/poam_api.rb', line 337

def update_poam_by_system_id_with_http_info(system_id, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: POAMApi.update_poam_by_system_id ...'
  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 POAMApi.update_poam_by_system_id"
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling POAMApi.update_poam_by_system_id"
  end
  # resource path
  local_var_path = '/api/systems/{systemId}/poams'.sub('{' + 'systemId' + '}', CGI.escape(system_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)

  # return_type
  return_type = opts[:debug_return_type] || 'PoamResponsePut'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKey', 'mockType', 'userId']

  new_options = opts.merge(
    :operation => :"POAMApi.update_poam_by_system_id",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: POAMApi#update_poam_by_system_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end