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. All calls use the function to ensure rate limiting and retries are handled across all API requests.
- 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.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.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.