Table of Contents
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:
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
Check if an operation can be paginated.
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 key part of a value'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
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
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
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
Create a paginator for an operation.
Returns an object that can wait for some condition.
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 key part of a value'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
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'
)
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
Lists your hypervisors.
See also: AWS API Documentation
Request Syntax
response = client.list_hypervisors(
MaxResults=123,
NextToken='string'
)
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
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 key part of a value's key-value pair.
Exceptions
Lists your virtual machines.
See also: AWS API Documentation
Request Syntax
response = client.list_virtual_machines(
MaxResults=123,
NextToken='string'
)
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.
Exceptions
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
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 key part of a value'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
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
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
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
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',
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
The available paginators are:
paginator = client.get_paginator('list_gateways')
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.
paginator = client.get_paginator('list_hypervisors')
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.
paginator = client.get_paginator('list_virtual_machines')
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.