Backup / Client / create_legal_hold
create_legal_hold#
- Backup.Client.create_legal_hold(**kwargs)#
This action creates a legal hold on a recovery point (backup). A legal hold is a restraint on altering or deleting a backup until an authorized user cancels the legal hold. Any actions to delete or disassociate a recovery point will fail with an error if one or more active legal holds are on the recovery point.
See also: AWS API Documentation
Request Syntax
response = client.create_legal_hold( Title='string', Description='string', IdempotencyToken='string', RecoveryPointSelection={ 'VaultNames': [ 'string', ], 'ResourceIdentifiers': [ 'string', ], 'DateRange': { 'FromDate': datetime(2015, 1, 1), 'ToDate': datetime(2015, 1, 1) } }, Tags={ 'string': 'string' } )
- Parameters:
Title (string) –
[REQUIRED]
This is the string title of the legal hold.
Description (string) –
[REQUIRED]
This is the string description of the legal hold.
IdempotencyToken (string) – This is a user-chosen string used to distinguish between otherwise identical calls. Retrying a successful request with the same idempotency token results in a success message with no action taken.
RecoveryPointSelection (dict) –
This specifies criteria to assign a set of resources, such as resource types or backup vaults.
VaultNames (list) –
These are the names of the vaults in which the selected recovery points are contained.
(string) –
ResourceIdentifiers (list) –
These are the resources included in the resource selection (including type of resources and vaults).
(string) –
DateRange (dict) –
This is a resource filter containing FromDate: DateTime and ToDate: DateTime. Both values are required. Future DateTime values are not permitted.
The date and time are in Unix format and Coordinated Universal Time (UTC), and it is accurate to milliseconds ((milliseconds are optional). For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
FromDate (datetime) – [REQUIRED]
This value is the beginning date, inclusive.
The date and time are in Unix format and Coordinated Universal Time (UTC), and it is accurate to milliseconds (milliseconds are optional).
ToDate (datetime) – [REQUIRED]
This value is the end date, inclusive.
The date and time are in Unix format and Coordinated Universal Time (UTC), and it is accurate to milliseconds (milliseconds are optional).
Tags (dict) –
Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.
(string) –
(string) –
- Return type:
dict
- Returns:
Response Syntax
{ 'Title': 'string', 'Status': 'CREATING'|'ACTIVE'|'CANCELING'|'CANCELED', 'Description': 'string', 'LegalHoldId': 'string', 'LegalHoldArn': 'string', 'CreationDate': datetime(2015, 1, 1), 'RecoveryPointSelection': { 'VaultNames': [ 'string', ], 'ResourceIdentifiers': [ 'string', ], 'DateRange': { 'FromDate': datetime(2015, 1, 1), 'ToDate': datetime(2015, 1, 1) } } }
Response Structure
(dict) –
Title (string) –
This is the string title of the legal hold returned after creating the legal hold.
Status (string) –
This displays the status of the legal hold returned after creating the legal hold. Statuses can be
ACTIVE
,PENDING
,CANCELED
,CANCELING
, orFAILED
.Description (string) –
This is the returned string description of the legal hold.
LegalHoldId (string) –
Legal hold ID returned for the specified legal hold on a recovery point.
LegalHoldArn (string) –
This is the ARN (Amazon Resource Number) of the created legal hold.
CreationDate (datetime) –
Time in number format when legal hold was created.
RecoveryPointSelection (dict) –
This specifies criteria to assign a set of resources, such as resource types or backup vaults.
VaultNames (list) –
These are the names of the vaults in which the selected recovery points are contained.
(string) –
ResourceIdentifiers (list) –
These are the resources included in the resource selection (including type of resources and vaults).
(string) –
DateRange (dict) –
This is a resource filter containing FromDate: DateTime and ToDate: DateTime. Both values are required. Future DateTime values are not permitted.
The date and time are in Unix format and Coordinated Universal Time (UTC), and it is accurate to milliseconds ((milliseconds are optional). For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
FromDate (datetime) –
This value is the beginning date, inclusive.
The date and time are in Unix format and Coordinated Universal Time (UTC), and it is accurate to milliseconds (milliseconds are optional).
ToDate (datetime) –
This value is the end date, inclusive.
The date and time are in Unix format and Coordinated Universal Time (UTC), and it is accurate to milliseconds (milliseconds are optional).
Exceptions
Backup.Client.exceptions.InvalidParameterValueException
Backup.Client.exceptions.MissingParameterValueException
Backup.Client.exceptions.ServiceUnavailableException
Backup.Client.exceptions.LimitExceededException