Returns the description of a specific Amazon FSx backup, if a BackupIds value is provided for that backup. Otherwise, it returns all backups owned by your Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling.
When retrieving all backups, you can optionally specify the MaxResults parameter to limit the number of backups in a response. If more backups remain, Amazon FSx returns a NextToken value in the response. In this case, send a later request with the NextToken request parameter set to the value of the NextToken value from the last response.
This operation is used in an iterative process to retrieve a list of your backups. DescribeBackups is called first without a NextToken value. Then the operation continues to be called with the NextToken parameter set to the value of the last NextToken value until a response has no NextToken value.
When using this operation, keep the following in mind:
-
The operation might return fewer than the MaxResults value of backup descriptions while still including a NextToken value.
-
The order of the backups returned in the response of one DescribeBackups call and the order of the backups returned across the responses of a multi-call iteration is unspecified.
Parameters:
-
backup_ids
(Optional[BackupIds], default:
None
)
–
The IDs of the backups that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a BackupNotFound error occurs.
-
filters
(Optional[Filters], default:
None
)
–
The filters structure. The supported names are file-system-id, backup-type, file-system-type, and volume-id.
-
max_results
(Optional[MaxResults], default:
None
)
–
Maximum number of backups to return in the response. This parameter value must be greater than 0. The number of items that Amazon FSx returns is the minimum of the MaxResults parameter specified in the request and the service's internal maximum number of items per page.
-
next_token
(Optional[NextToken], default:
None
)
–
An opaque pagination token returned from a previous DescribeBackups operation. If a token is present, the operation continues the list from where the returning call left off.
Raises:
-
BackupNotFound
–
No Amazon FSx backups were found based upon the supplied parameters.
-
BadRequest
–
A generic error indicating a failure with a client request.
-
FileSystemNotFound
–
No Amazon FSx file systems were found based upon supplied parameters.
-
InternalServerError
–
A generic error indicating a server-side failure.
-
VolumeNotFound
–
No Amazon FSx volumes were found based upon the supplied parameters.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_fsx/_services/async_f_sx.py
| async def describe_backups(
self,
*,
config_overrides: Optional[AsyncFSxClientConfig] = None,
backup_ids: Optional["capo_fsx.types.backup_ids.BackupIds"] = None,
filters: Optional["capo_fsx.types.filters.Filters"] = None,
max_results: Optional["capo_fsx.types.max_results.MaxResults"] = None,
next_token: Optional["capo_fsx.types.next_token.NextToken"] = None,
) -> "capo_fsx.types.describe_backups_response.DescribeBackupsResponse":
"""<p>Returns the description of a specific Amazon FSx backup, if a <code>BackupIds</code> value is provided for that backup. Otherwise, it returns all backups owned by your Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling.</p> <p>When retrieving all backups, you can optionally specify the <code>MaxResults</code> parameter to limit the number of backups in a response. If more backups remain, Amazon FSx returns a <code>NextToken</code> value in the response. In this case, send a later request with the <code>NextToken</code> request parameter set to the value of the <code>NextToken</code> value from the last response.</p> <p>This operation is used in an iterative process to retrieve a list of your backups. <code>DescribeBackups</code> is called first without a <code>NextToken</code> value. Then the operation continues to be called with the <code>NextToken</code> parameter set to the value of the last <code>NextToken</code> value until a response has no <code>NextToken</code> value.</p> <p>When using this operation, keep the following in mind:</p> <ul> <li> <p>The operation might return fewer than the <code>MaxResults</code> value of backup descriptions while still including a <code>NextToken</code> value.</p> </li> <li> <p>The order of the backups returned in the response of one <code>DescribeBackups</code> call and the order of the backups returned across the responses of a multi-call iteration is unspecified.</p> </li> </ul>
Args:
backup_ids: <p>The IDs of the backups that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>BackupNotFound</code> error occurs.</p>
filters: <p>The filters structure. The supported names are <code>file-system-id</code>, <code>backup-type</code>, <code>file-system-type</code>, and <code>volume-id</code>.</p>
max_results: <p>Maximum number of backups to return in the response. This parameter value must be greater than 0. The number of items that Amazon FSx returns is the minimum of the <code>MaxResults</code> parameter specified in the request and the service's internal maximum number of items per page.</p>
next_token: <p>An opaque pagination token returned from a previous <code>DescribeBackups</code> operation. If a token is present, the operation continues the list from where the returning call left off.</p>
Raises:
capo_fsx.errors.backup_not_found.BackupNotFound: <p>No Amazon FSx backups were found based upon the supplied parameters.</p>
capo_fsx.errors.bad_request.BadRequest: <p>A generic error indicating a failure with a client request.</p>
capo_fsx.errors.file_system_not_found.FileSystemNotFound: <p>No Amazon FSx file systems were found based upon supplied parameters.</p>
capo_fsx.errors.internal_server_error.InternalServerError: <p>A generic error indicating a server-side failure.</p>
capo_fsx.errors.volume_not_found.VolumeNotFound: <p>No Amazon FSx volumes were found based upon the supplied parameters.</p>
capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_fsx.types.describe_backups_request.DescribeBackupsRequest]",
) -> AsyncOperationResponse[
"capo_fsx.types.describe_backups_response.DescribeBackupsResponse"
]:
import capo_fsx._operations.aws_simba_api_service_v20180301.describe_backups
(
output,
http_response,
) = await capo_fsx._operations.aws_simba_api_service_v20180301.describe_backups.async_describe_backups(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_fsx.types.describe_backups_response.DescribeBackupsResponse",
) -> dict[str, Any]:
import capo_fsx.types.describe_backups_response
return capo_fsx.types.describe_backups_response.redact_sensitive(output)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("DescribeBackups", redact_output=_redact_output),
)
input_: capo_fsx.types.describe_backups_request.DescribeBackupsRequest = {}
if backup_ids is not None:
input_["backup_ids"] = backup_ids
if filters is not None:
input_["filters"] = filters
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|