common_util

boomi_cicd.util.common_util.atomsphere_request(*, method, resource_path, payload=None, accept_header='application/json', pass_error=False)[source]

Perform a request to the Atomsphere API.

Parameters:
  • method (str) – The HTTP method for the request. Accepted values: get, post, put, delete.

  • resource_path (str) – The resource path for the API endpoint.

  • payload (dict or str, optional) – The payload to be sent in the request body.

  • accept_header (str, defaults to "application/json") – The HTTP Accept Header for the request.

  • pass_error – Determine if an error should be passed. If False, an non-2xx response with throw an error. If True, the errow will be passed to the calling function.

Returns:

The response object containing the response data.

Return type:

requests.Response

Raises:

requests.HTTPError – If the request fails (non-2xx response). A 503 response will be retried up to 3 times.

boomi_cicd.util.common_util.check_limit()[source]

Empty function to limit the number of calls to the Atomsphere API.

This function is used as a decorator to enforce a rate limit on API calls. It ensures that the decorated function is called within the specified rate limit.

Returns:

None

boomi_cicd.util.common_util.open_json_file(file_path)[source]

Open a JSON file and return the parsed data. Function used to sanatize the file path and check if the file exists. :param file_path: :return: JSON data from file path. :rtype: dict

boomi_cicd.util.common_util.parse_args()[source]

Will parse arguments from the command line. Looks for a release file with a -r or –release argument.

boomi_cicd.util.common_util.parse_json(file_path)[source]

Parse a JSON file and return the parsed data.

Parameters:

file_path (str) – The path to the JSON file.

Returns:

The parsed data from the JSON file.

Return type:

dict or list

boomi_cicd.util.common_util.parse_release(file_path)[source]

Parse a release file and return the parsed data.

Parameters:

file_path (str) – The path to the release file.

Returns:

The parsed data from the release file.

Return type:

dict

boomi_cicd.util.common_util.requests_delete(resource_path)[source]

DEPRECIATED. Perform a DELETE request to the Atomsphere API.

Parameters:

resource_path (str) – The resource path for the API endpoint.

Returns:

The response object containing the JSON response data.

Return type:

requests.Response

Raises:

requests.HTTPError – If the DELETE request fails (non-2xx response). A 503 response will be retried up to 3 times.

boomi_cicd.util.common_util.requests_get(resource_path)[source]

DEPRECIATED. Perform a GET request to the Atomsphere API and retrieve JSON data.

Parameters:

resource_path (str) – The resource path for the API endpoint.

Returns:

The response object containing the JSON data.

Return type:

requests.Response

Raises:

requests.HTTPError – If the GET request fails (non-2xx response). A 503 response will be retried up to 3 times.

boomi_cicd.util.common_util.requests_get_xml(resource_path)[source]

DEPRECIATED. Perform a GET request to the Atomsphere API and retrieve XML data.

Parameters:

resource_path (str) – The resource path for the API endpoint.

Returns:

The response object containing the XML data.

Return type:

requests.Response

Raises:

requests.HTTPError – If the GET request fails (non-2xx response). A 503 response will be retried up to 3 times.

boomi_cicd.util.common_util.requests_post(resource_path, payload)[source]

DEPRECIATED. Perform a POST request to the Atomsphere API with the specified payload.

Parameters:
  • resource_path (str) – The resource path for the API endpoint.

  • payload (dict) – The payload to be sent in the request body (as JSON).

Returns:

The response object containing the JSON response data.

Return type:

requests.Response

Raises:

requests.HTTPError – If the POST request fails (non-2xx response). A 503 response will be retried up to 3 times.

boomi_cicd.util.common_util.requests_post_xml(resource_path, payload)[source]

DEPRECIATED. Perform a POST request to the Atomsphere API with the specified payload.

Parameters:
  • resource_path (str) – The resource path for the API endpoint.

  • payload (str) – The payload to be sent in the request body as XML.

Returns:

The response object containing the JSON response data.

Return type:

requests.Response

Raises:

requests.HTTPError – If the POST request fails (non-2xx response). A 503 response will be retried up to 3 times.

boomi_cicd.util.common_util.set_env_release()[source]

Set the environment extensions release data based on the BOOMI_ENV_RELEASE_FILE environment variable.

This function retrieves the environment extensions release file.

Returns:

The environment extensions release data as a dictionary.

boomi_cicd.util.common_util.set_release()[source]

Set the release data based on command-line arguments or environment variable.

This function retrieves the release data from either the command-line argument or the default configuration. If the –release argument is provided, it reads the JSON data from the specified file path. Otherwise, it reads the JSON data from the default release file path.

Returns:

The release data as a dictionary.