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

Returns a new instance of 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 />

Parameters:

  • system_id (Integer)

    **System Id**: The unique system record identifier.

  • request_body (Array<Object>)

    Add POA&amp;M(s) to a system (systemID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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;

Parameters:

  • system_id (Integer)

    **System Id**: The unique system record identifier.

  • request_body (Array<Object>)

    Add POA&amp;M(s) to a system (systemID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PoamResponsePost, Integer, Hash)>)

    PoamResponsePost data, response status code and response headers



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

Parameters:

  • system_id (Integer)

    **System Id**: The unique system record identifier.

  • poam_request_delete_body_inner (Array<PoamRequestDeleteBodyInner>)

    Delete the given POA&amp;M Id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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;

Parameters:

  • system_id (Integer)

    **System Id**: The unique system record identifier.

  • poam_request_delete_body_inner (Array<PoamRequestDeleteBodyInner>)

    Delete the given POA&amp;M Id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PoamResponseDelete, Integer, Hash)>)

    PoamResponseDelete data, response status code and response headers



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.

Parameters:

  • system_id (Integer)

    **System Id**: The unique system record identifier.

  • opts (Hash) (defaults to: {})

    the optional 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)

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

  • :ccis (String)

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

  • :system_only (Boolean)

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

Returns:



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

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.

Parameters:

  • system_id (Integer)

    **System Id**: The unique system record identifier.

  • poam_id (Integer)

    **POA&amp;M Id**: The unique POA&amp;M record identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



254
255
256
257
# File 'lib/emass_client/api/poam_api.rb', line 254

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.

Parameters:

  • system_id (Integer)

    **System Id**: The unique system record identifier.

  • poam_id (Integer)

    **POA&amp;M Id**: The unique POA&amp;M record identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PoamResponseGetPoams, Integer, Hash)>)

    PoamResponseGetPoams data, response status code and response headers



265
266
267
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
# File 'lib/emass_client/api/poam_api.rb', line 265

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.

Parameters:

  • system_id (Integer)

    **System Id**: The unique system record identifier.

  • opts (Hash) (defaults to: {})

    the optional 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)

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

  • :ccis (String)

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

  • :system_only (Boolean)

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

Returns:

  • (Array<(PoamResponseGetSystems, Integer, Hash)>)

    PoamResponseGetSystems data, response status code and response headers



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

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[:'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 delete a milestone through the POA&M PUT the field `isActive` must be set to `false`: `isActive=false`.

Parameters:

  • system_id (Integer)

    **System Id**: The unique system record identifier.

  • request_body (Array<Object>)

    Update an existing control by Id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



323
324
325
326
# File 'lib/emass_client/api/poam_api.rb', line 323

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 delete a milestone through the POA&amp;M PUT the field &#x60;isActive&#x60; must be set to &#x60;false&#x60;: &#x60;isActive&#x3D;false&#x60;.

Parameters:

  • system_id (Integer)

    **System Id**: The unique system record identifier.

  • request_body (Array<Object>)

    Update an existing control by Id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PoamResponsePut, Integer, Hash)>)

    PoamResponsePut data, response status code and response headers



334
335
336
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
# File 'lib/emass_client/api/poam_api.rb', line 334

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