def get_global_operation(self, project_id, operation_id):
"""Get the Operations Status
Args:
project_id (str): The project id.
operation_id (str): The operation id.
Returns:
dict: Global Operation status and info.
https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
Raises:
ApiNotEnabledError: Returns if the api is not enabled.
ApiExecutionError: Returns if the api is not executable.
"""
try:
return self.repository.global_operations.get(
project_id, operation_id)
except (errors.HttpError, HttpLib2Error) as e:
api_not_enabled, details = _api_not_enabled(e)
if api_not_enabled:
raise api_errors.ApiNotEnabledError(details, e)
raise api_errors.ApiExecutionError(project_id, e)
评论列表
文章目录