REST

REST module.

Reusable functions for working with REST APIs.

codestream.common.rest.call_vra_api(full_url, request_type='GET', response_type='json', content_type='json', header='{}', body='{}', settings=<class 'codestream.common.VRASettings'>)

Call the vRA API.

Raises:
  • requests.exceptions.SSLError – _description_

  • requests.exceptions.RequestException – _description_

  • Exception – _description_

Returns:

HTTP status code string: JSON response from API

Return type:

integer

codestream.common.rest.check_status_code(status_code)

Check status_code.

A generic catch all check for API status codes until specific checks can be created.

Returns:

A boolean for success or failure based on status code.

Return type:

bool