Table of Contents
BackupGateway.
Client
¶A low-level client representing AWS Backup Gateway
Backup gateway connects Backup to your hypervisor, so you can create, store, and restore backups of your virtual machines (VMs) anywhere, whether on-premises or in the VMware Cloud (VMC) on Amazon Web Services.
Add on-premises resources by connecting to a hypervisor through a gateway. Backup will automatically discover the resources in your hypervisor.
Use Backup to assign virtual or on-premises resources to a backup plan, or run on-demand backups. Once you have backed up your resources, you can view them and restore them like any resource supported by Backup.
To download the Amazon Web Services software to get started, navigate to the Backup console, choose Gateways , then choose Create gateway .
import boto3
client = boto3.client('backup-gateway')
These are the available methods:
associate_gateway_to_server()
can_paginate()
close()
create_gateway()
delete_gateway()
delete_hypervisor()
disassociate_gateway_from_server()
get_gateway()
get_paginator()
get_waiter()
import_hypervisor_configuration()
list_gateways()
list_hypervisors()
list_tags_for_resource()
list_virtual_machines()
put_maintenance_start_time()
tag_resource()
test_hypervisor_configuration()
untag_resource()
update_gateway_information()
update_gateway_software_now()
update_hypervisor()
associate_gateway_to_server
(**kwargs)¶Associates a backup gateway with your server. After you complete the association process, you can back up and restore your VMs through the gateway.
See also: AWS API Documentation
Request Syntax
response = client.associate_gateway_to_server(
GatewayArn='string',
ServerArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the gateway. Use the ListGateways
operation to return a list of gateways for your account and Amazon Web Services Region.
[REQUIRED]
The Amazon Resource Name (ARN) of the server that hosts your virtual machines.
dict
Response Syntax
{
'GatewayArn': 'string'
}
Response Structure
(dict) --
GatewayArn (string) --
The Amazon Resource Name (ARN) of a gateway.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.ConflictException
BackupGateway.Client.exceptions.InternalServerException
can_paginate
(operation_name)¶Check if an operation can be paginated.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.True
if the operation can be paginated,
False
otherwise.close
()¶Closes underlying endpoint connections.
create_gateway
(**kwargs)¶Creates a backup gateway. After you create a gateway, you can associate it with a server using the AssociateGatewayToServer
operation.
See also: AWS API Documentation
Request Syntax
response = client.create_gateway(
ActivationKey='string',
GatewayDisplayName='string',
GatewayType='BACKUP_VM',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The activation key of the created gateway.
[REQUIRED]
The display name of the created gateway.
[REQUIRED]
The type of created gateway.
A list of up to 50 tags to assign to the gateway. Each tag is a key-value pair.
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: + - = . _ : /.
The key part of a tag's key-value pair. The key can't start with aws:
.
The value part of a tag's key-value pair.
dict
Response Syntax
{
'GatewayArn': 'string'
}
Response Structure
(dict) --
GatewayArn (string) --
The Amazon Resource Name (ARN) of the gateway you create.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
delete_gateway
(**kwargs)¶Deletes a backup gateway.
See also: AWS API Documentation
Request Syntax
response = client.delete_gateway(
GatewayArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the gateway to delete.
{
'GatewayArn': 'string'
}
Response Structure
The Amazon Resource Name (ARN) of the gateway you deleted.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.ResourceNotFoundException
delete_hypervisor
(**kwargs)¶Deletes a hypervisor.
See also: AWS API Documentation
Request Syntax
response = client.delete_hypervisor(
HypervisorArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the hypervisor to delete.
{
'HypervisorArn': 'string'
}
Response Structure
The Amazon Resource Name (ARN) of the hypervisor you deleted.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.AccessDeniedException
BackupGateway.Client.exceptions.ResourceNotFoundException
disassociate_gateway_from_server
(**kwargs)¶Disassociates a backup gateway from the specified server. After the disassociation process finishes, the gateway can no longer access the virtual machines on the server.
See also: AWS API Documentation
Request Syntax
response = client.disassociate_gateway_from_server(
GatewayArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the gateway to disassociate.
{
'GatewayArn': 'string'
}
Response Structure
The Amazon Resource Name (ARN) of the gateway you disassociated.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.ConflictException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.ResourceNotFoundException
get_gateway
(**kwargs)¶By providing the ARN (Amazon Resource Name), this API returns the gateway.
See also: AWS API Documentation
Request Syntax
response = client.get_gateway(
GatewayArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the gateway.
{
'Gateway': {
'GatewayArn': 'string',
'GatewayDisplayName': 'string',
'GatewayType': 'BACKUP_VM',
'HypervisorId': 'string',
'LastSeenTime': datetime(2015, 1, 1),
'NextUpdateAvailabilityTime': datetime(2015, 1, 1),
'VpcEndpoint': 'string'
}
}
Response Structure
By providing the ARN (Amazon Resource Name), this API returns the gateway.
The Amazon Resource Name (ARN) of the gateway. Use the ListGateways
operation to return a list of gateways for your account and Amazon Web Services Region.
The display name of the gateway.
The type of the gateway type.
The hypervisor ID of the gateway.
Details showing the last time Backup gateway communicated with the cloud, in Unix format and UTC time.
Details showing the next update availability time of the gateway.
The DNS name for the virtual private cloud (VPC) endpoint the gateway uses to connect to the cloud for backup gateway.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.ResourceNotFoundException
get_paginator
(operation_name)¶Create a paginator for an operation.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.client.can_paginate
method to
check if an operation is pageable.get_waiter
(waiter_name)¶Returns an object that can wait for some condition.
import_hypervisor_configuration
(**kwargs)¶Connect to a hypervisor by importing its configuration.
See also: AWS API Documentation
Request Syntax
response = client.import_hypervisor_configuration(
Host='string',
KmsKeyArn='string',
Name='string',
Password='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
],
Username='string'
)
[REQUIRED]
The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
[REQUIRED]
The name of the hypervisor.
The tags of the hypervisor configuration to import.
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: + - = . _ : /.
The key part of a tag's key-value pair. The key can't start with aws:
.
The value part of a tag's key-value pair.
dict
Response Syntax
{
'HypervisorArn': 'string'
}
Response Structure
(dict) --
HypervisorArn (string) --
The Amazon Resource Name (ARN) of the hypervisor you disassociated.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.AccessDeniedException
list_gateways
(**kwargs)¶Lists backup gateways owned by an Amazon Web Services account in an Amazon Web Services Region. The returned list is ordered by gateway Amazon Resource Name (ARN).
See also: AWS API Documentation
Request Syntax
response = client.list_gateways(
MaxResults=123,
NextToken='string'
)
MaxResults
number of resources, NextToken
allows you to return more items in your list starting at the location pointed to by the next token.dict
Response Syntax
{
'Gateways': [
{
'GatewayArn': 'string',
'GatewayDisplayName': 'string',
'GatewayType': 'BACKUP_VM',
'HypervisorId': 'string',
'LastSeenTime': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Gateways (list) --
A list of your gateways.
(dict) --
A gateway is an Backup Gateway appliance that runs on the customer's network to provide seamless connectivity to backup storage in the Amazon Web Services Cloud.
GatewayArn (string) --
The Amazon Resource Name (ARN) of the gateway. Use the ListGateways
operation to return a list of gateways for your account and Amazon Web Services Region.
GatewayDisplayName (string) --
The display name of the gateway.
GatewayType (string) --
The type of the gateway.
HypervisorId (string) --
The hypervisor ID of the gateway.
LastSeenTime (datetime) --
The last time Backup gateway communicated with the gateway, in Unix format and UTC time.
NextToken (string) --
The next item following a partial list of returned resources. For example, if a request is made to return maxResults
number of resources, NextToken
allows you to return more items in your list starting at the location pointed to by the next token.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
list_hypervisors
(**kwargs)¶Lists your hypervisors.
See also: AWS API Documentation
Request Syntax
response = client.list_hypervisors(
MaxResults=123,
NextToken='string'
)
maxResults
number of resources, NextToken
allows you to return more items in your list starting at the location pointed to by the next token.dict
Response Syntax
{
'Hypervisors': [
{
'Host': 'string',
'HypervisorArn': 'string',
'KmsKeyArn': 'string',
'Name': 'string',
'State': 'PENDING'|'ONLINE'|'OFFLINE'|'ERROR'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Hypervisors (list) --
A list of your Hypervisor
objects, ordered by their Amazon Resource Names (ARNs).
(dict) --
Represents the hypervisor's permissions to which the gateway will connect.
A hypervisor is hardware, software, or firmware that creates and manages virtual machines, and allocates resources to them.
Host (string) --
The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
HypervisorArn (string) --
The Amazon Resource Name (ARN) of the hypervisor.
KmsKeyArn (string) --
The Amazon Resource Name (ARN) of the Key Management Service used to encrypt the hypervisor.
Name (string) --
The name of the hypervisor.
State (string) --
The state of the hypervisor.
NextToken (string) --
The next item following a partial list of returned resources. For example, if a request is made to return maxResults
number of resources, NextToken
allows you to return more items in your list starting at the location pointed to by the next token.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
Lists the tags applied to the resource identified by its Amazon Resource Name (ARN).
See also: AWS API Documentation
Request Syntax
response = client.list_tags_for_resource(
ResourceArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the resource's tags to list.
{
'ResourceArn': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
The Amazon Resource Name (ARN) of the resource's tags that you listed.
A list of the resource's tags.
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: + - = . _ : /.
The key part of a tag's key-value pair. The key can't start with aws:
.
The value part of a tag's key-value pair.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.ResourceNotFoundException
list_virtual_machines
(**kwargs)¶Lists your virtual machines.
See also: AWS API Documentation
Request Syntax
response = client.list_virtual_machines(
MaxResults=123,
NextToken='string'
)
maxResults
number of resources, NextToken
allows you to return more items in your list starting at the location pointed to by the next token.dict
Response Syntax
{
'NextToken': 'string',
'VirtualMachines': [
{
'HostName': 'string',
'HypervisorId': 'string',
'LastBackupDate': datetime(2015, 1, 1),
'Name': 'string',
'Path': 'string',
'ResourceArn': 'string'
},
]
}
Response Structure
(dict) --
NextToken (string) --
The next item following a partial list of returned resources. For example, if a request is made to return maxResults
number of resources, NextToken
allows you to return more items in your list starting at the location pointed to by the next token.
VirtualMachines (list) --
A list of your VirtualMachine
objects, ordered by their Amazon Resource Names (ARNs).
(dict) --
A virtual machine that is on a hypervisor.
HostName (string) --
The host name of the virtual machine.
HypervisorId (string) --
The ID of the virtual machine's hypervisor.
LastBackupDate (datetime) --
The most recent date a virtual machine was backed up, in Unix format and UTC time.
Name (string) --
The name of the virtual machine.
Path (string) --
The path of the virtual machine.
ResourceArn (string) --
The Amazon Resource Name (ARN) of the virtual machine. For example, arn:aws:backup-gateway:us-west-1:0000000000000:vm/vm-0000ABCDEFGIJKL
.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
put_maintenance_start_time
(**kwargs)¶Set the maintenance start time for a gateway.
See also: AWS API Documentation
Request Syntax
response = client.put_maintenance_start_time(
DayOfMonth=123,
DayOfWeek=123,
GatewayArn='string',
HourOfDay=123,
MinuteOfHour=123
)
The day of the month start maintenance on a gateway.
Valid values range from Sunday
to Saturday
.
[REQUIRED]
The Amazon Resource Name (ARN) for the gateway, used to specify its maintenance start time.
[REQUIRED]
The hour of the day to start maintenance on a gateway.
[REQUIRED]
The minute of the hour to start maintenance on a gateway.
dict
Response Syntax
{
'GatewayArn': 'string'
}
Response Structure
(dict) --
GatewayArn (string) --
The Amazon Resource Name (ARN) of a gateway for which you set the maintenance start time.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.ConflictException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.ResourceNotFoundException
tag_resource
(**kwargs)¶Tag the resource.
See also: AWS API Documentation
Request Syntax
response = client.tag_resource(
ResourceARN='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The Amazon Resource Name (ARN) of the resource to tag.
[REQUIRED]
A list of tags to assign to the resource.
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: + - = . _ : /.
The key part of a tag's key-value pair. The key can't start with aws:
.
The value part of a tag's key-value pair.
dict
Response Syntax
{
'ResourceARN': 'string'
}
Response Structure
(dict) --
ResourceARN (string) --
The Amazon Resource Name (ARN) of the resource you tagged.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.ResourceNotFoundException
test_hypervisor_configuration
(**kwargs)¶Tests your hypervisor configuration to validate that backup gateway can connect with the hypervisor and its resources.
See also: AWS API Documentation
Request Syntax
response = client.test_hypervisor_configuration(
GatewayArn='string',
Host='string',
Password='string',
Username='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the gateway to the hypervisor to test.
[REQUIRED]
The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
dict
Response Syntax
{}
Response Structure
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.ConflictException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.ResourceNotFoundException
untag_resource
(**kwargs)¶Removes tags from the resource.
See also: AWS API Documentation
Request Syntax
response = client.untag_resource(
ResourceARN='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The Amazon Resource Name (ARN) of the resource from which to remove tags.
[REQUIRED]
The list of tag keys specifying which tags to remove.
dict
Response Syntax
{
'ResourceARN': 'string'
}
Response Structure
(dict) --
ResourceARN (string) --
The Amazon Resource Name (ARN) of the resource from which you removed tags.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.ResourceNotFoundException
update_gateway_information
(**kwargs)¶Updates a gateway's name. Specify which gateway to update using the Amazon Resource Name (ARN) of the gateway in your request.
See also: AWS API Documentation
Request Syntax
response = client.update_gateway_information(
GatewayArn='string',
GatewayDisplayName='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the gateway to update.
dict
Response Syntax
{
'GatewayArn': 'string'
}
Response Structure
(dict) --
GatewayArn (string) --
The Amazon Resource Name (ARN) of the gateway you updated.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.ConflictException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.ResourceNotFoundException
update_gateway_software_now
(**kwargs)¶Updates the gateway virtual machine (VM) software. The request immediately triggers the software update.
Note
When you make this request, you get a 200 OK
success response immediately. However, it might take some time for the update to complete.
See also: AWS API Documentation
Request Syntax
response = client.update_gateway_software_now(
GatewayArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the gateway to be updated.
{
'GatewayArn': 'string'
}
Response Structure
The Amazon Resource Name (ARN) of the gateway you updated.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.ResourceNotFoundException
update_hypervisor
(**kwargs)¶Updates a hypervisor metadata, including its host, username, and password. Specify which hypervisor to update using the Amazon Resource Name (ARN) of the hypervisor in your request.
See also: AWS API Documentation
Request Syntax
response = client.update_hypervisor(
Host='string',
HypervisorArn='string',
Name='string',
Password='string',
Username='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the hypervisor to update.
dict
Response Syntax
{
'HypervisorArn': 'string'
}
Response Structure
(dict) --
HypervisorArn (string) --
The Amazon Resource Name (ARN) of the hypervisor you updated.
Exceptions
BackupGateway.Client.exceptions.ValidationException
BackupGateway.Client.exceptions.InternalServerException
BackupGateway.Client.exceptions.AccessDeniedException
BackupGateway.Client.exceptions.ResourceNotFoundException
The available paginators are:
BackupGateway.Paginator.ListGateways
BackupGateway.Paginator.ListHypervisors
BackupGateway.Paginator.ListVirtualMachines
BackupGateway.Paginator.
ListGateways
¶paginator = client.get_paginator('list_gateways')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from BackupGateway.Client.list_gateways()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
{
'Gateways': [
{
'GatewayArn': 'string',
'GatewayDisplayName': 'string',
'GatewayType': 'BACKUP_VM',
'HypervisorId': 'string',
'LastSeenTime': datetime(2015, 1, 1)
},
],
}
Response Structure
A list of your gateways.
A gateway is an Backup Gateway appliance that runs on the customer's network to provide seamless connectivity to backup storage in the Amazon Web Services Cloud.
The Amazon Resource Name (ARN) of the gateway. Use the ListGateways
operation to return a list of gateways for your account and Amazon Web Services Region.
The display name of the gateway.
The type of the gateway.
The hypervisor ID of the gateway.
The last time Backup gateway communicated with the gateway, in Unix format and UTC time.
BackupGateway.Paginator.
ListHypervisors
¶paginator = client.get_paginator('list_hypervisors')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from BackupGateway.Client.list_hypervisors()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
{
'Hypervisors': [
{
'Host': 'string',
'HypervisorArn': 'string',
'KmsKeyArn': 'string',
'Name': 'string',
'State': 'PENDING'|'ONLINE'|'OFFLINE'|'ERROR'
},
],
}
Response Structure
A list of your Hypervisor
objects, ordered by their Amazon Resource Names (ARNs).
Represents the hypervisor's permissions to which the gateway will connect.
A hypervisor is hardware, software, or firmware that creates and manages virtual machines, and allocates resources to them.
The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
The Amazon Resource Name (ARN) of the hypervisor.
The Amazon Resource Name (ARN) of the Key Management Service used to encrypt the hypervisor.
The name of the hypervisor.
The state of the hypervisor.
BackupGateway.Paginator.
ListVirtualMachines
¶paginator = client.get_paginator('list_virtual_machines')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from BackupGateway.Client.list_virtual_machines()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
{
'VirtualMachines': [
{
'HostName': 'string',
'HypervisorId': 'string',
'LastBackupDate': datetime(2015, 1, 1),
'Name': 'string',
'Path': 'string',
'ResourceArn': 'string'
},
]
}
Response Structure
A list of your VirtualMachine
objects, ordered by their Amazon Resource Names (ARNs).
A virtual machine that is on a hypervisor.
The host name of the virtual machine.
The ID of the virtual machine's hypervisor.
The most recent date a virtual machine was backed up, in Unix format and UTC time.
The name of the virtual machine.
The path of the virtual machine.
The Amazon Resource Name (ARN) of the virtual machine. For example, arn:aws:backup-gateway:us-west-1:0000000000000:vm/vm-0000ABCDEFGIJKL
.