Skip to content

get_backup_plan_from_json async

get_backup_plan_from_json(
    backup_plan_template_json: string,
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
) -> GetBackupPlanFromJSONOutput

Returns a valid JSON document specifying a backup plan or an error.

Parameters:

  • backup_plan_template_json (string) –

    A customer-supplied backup plan document in JSON format.

Raises:

Source code in docs_src/capo_backup/_services/async_backup.py
async def get_backup_plan_from_json(
    self,
    backup_plan_template_json: "capo_backup.types.string.string",
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
) -> (
    "capo_backup.types.get_backup_plan_from_json_output.GetBackupPlanFromJSONOutput"
):
    """<p>Returns a valid JSON document specifying a backup plan or an error.</p>

    Args:
        backup_plan_template_json: <p>A customer-supplied backup plan document in JSON format.</p>

    Raises:
        capo_backup.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Indicates that something is wrong with a parameter's value. For example, the value is out of range.</p>
        capo_backup.errors.invalid_request_exception.InvalidRequestException: <p>Indicates that something is wrong with the input to the request. For example, a parameter is of the wrong type.</p>
        capo_backup.errors.limit_exceeded_exception.LimitExceededException: <p>A limit in the request has been exceeded; for example, a maximum number of items allowed in a request.</p>
        capo_backup.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Indicates that a required parameter is missing.</p>
        capo_backup.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request failed due to a temporary failure of the server.</p>
        capo_backup.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_backup.types.get_backup_plan_from_json_input.GetBackupPlanFromJSONInput]",
    ) -> AsyncOperationResponse[
        "capo_backup.types.get_backup_plan_from_json_output.GetBackupPlanFromJSONOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.get_backup_plan_from_json

        (
            output,
            http_response,
        ) = await capo_backup._operations.cryo_controller_user_manager.get_backup_plan_from_json.async_get_backup_plan_from_json(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_backup.types.get_backup_plan_from_json_output.GetBackupPlanFromJSONOutput",
    ) -> dict[str, Any]:
        import capo_backup.types.get_backup_plan_from_json_output

        return capo_backup.types.get_backup_plan_from_json_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetBackupPlanFromJSON", redact_output=_redact_output),
    )
    input_: capo_backup.types.get_backup_plan_from_json_input.GetBackupPlanFromJSONInput = {
        "backup_plan_template_json": backup_plan_template_json
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output