Skip to content

get_backup_plan

get_backup_plan(
    backup_plan_id: string,
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    version_id: Optional[string] = None,
    max_scheduled_runs_preview: Optional[MaxScheduledRunsPreview] = None,
) -> GetBackupPlanOutput

Returns BackupPlan details for the specified BackupPlanId. The details are the body of a backup plan in JSON format, in addition to plan metadata.

Parameters:

  • backup_plan_id (string) –

    Uniquely identifies a backup plan.

  • version_id (Optional[string], default: None ) –

    Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version IDs cannot be edited.

  • max_scheduled_runs_preview (Optional[MaxScheduledRunsPreview], default: None ) –

    Number of future scheduled backup runs to preview. When set to 0 (default), no scheduled runs preview is included in the response. Valid range is 0-10.

Raises:

Source code in docs_src/capo_backup/_services/backup.py
def get_backup_plan(
    self,
    backup_plan_id: "capo_backup.types.string.string",
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    version_id: Optional["capo_backup.types.string.string"] = None,
    max_scheduled_runs_preview: Optional[
        "capo_backup.types.max_scheduled_runs_preview.MaxScheduledRunsPreview"
    ] = None,
) -> "capo_backup.types.get_backup_plan_output.GetBackupPlanOutput":
    """<p>Returns <code>BackupPlan</code> details for the specified <code>BackupPlanId</code>. The details are the body of a backup plan in JSON format, in addition to plan metadata.</p>

    Args:
        backup_plan_id: <p>Uniquely identifies a backup plan.</p>
        version_id: <p>Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version IDs cannot be edited.</p>
        max_scheduled_runs_preview: <p>Number of future scheduled backup runs to preview. When set to 0 (default), no scheduled runs preview is included in the response. Valid range is 0-10.</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.missing_parameter_value_exception.MissingParameterValueException: <p>Indicates that a required parameter is missing.</p>
        capo_backup.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource that is required for the action doesn't exist.</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.
    """

    def _handler(
        req: "OperationRequest[capo_backup.types.get_backup_plan_input.GetBackupPlanInput]",
    ) -> OperationResponse[
        "capo_backup.types.get_backup_plan_output.GetBackupPlanOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.get_backup_plan

        output, http_response = (
            capo_backup._operations.cryo_controller_user_manager.get_backup_plan.get_backup_plan(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_backup.types.get_backup_plan_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetBackupPlan", redact_output=_redact_output),
    )
    input_: capo_backup.types.get_backup_plan_input.GetBackupPlanInput = {
        "backup_plan_id": backup_plan_id
    }
    if version_id is not None:
        input_["version_id"] = version_id
    if max_scheduled_runs_preview is not None:
        input_["max_scheduled_runs_preview"] = max_scheduled_runs_preview

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output