2020/01/02 - Amazon Lightsail - 3 updated api methods
Changes Update lightsail client to latest version
{'relationalDatabase': {'caCertificateIdentifier': 'string'}}
Returns information about a specific database in Amazon Lightsail.
See also: AWS API Documentation
Request Syntax
client.get_relational_database( relationalDatabaseName='string' )
string
[REQUIRED]
The name of the database that you are looking up.
dict
Response Syntax
{ 'relationalDatabase': { 'name': 'string', 'arn': 'string', 'supportCode': 'string', 'createdAt': datetime(2015, 1, 1), 'location': { 'availabilityZone': 'string', 'regionName': 'us-east-1'|'us-east-2'|'us-west-1'|'us-west-2'|'eu-west-1'|'eu-west-2'|'eu-west-3'|'eu-central-1'|'ca-central-1'|'ap-south-1'|'ap-southeast-1'|'ap-southeast-2'|'ap-northeast-1'|'ap-northeast-2' }, 'resourceType': 'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord', 'tags': [ { 'key': 'string', 'value': 'string' }, ], 'relationalDatabaseBlueprintId': 'string', 'relationalDatabaseBundleId': 'string', 'masterDatabaseName': 'string', 'hardware': { 'cpuCount': 123, 'diskSizeInGb': 123, 'ramSizeInGb': ... }, 'state': 'string', 'secondaryAvailabilityZone': 'string', 'backupRetentionEnabled': True|False, 'pendingModifiedValues': { 'masterUserPassword': 'string', 'engineVersion': 'string', 'backupRetentionEnabled': True|False }, 'engine': 'string', 'engineVersion': 'string', 'latestRestorableTime': datetime(2015, 1, 1), 'masterUsername': 'string', 'parameterApplyStatus': 'string', 'preferredBackupWindow': 'string', 'preferredMaintenanceWindow': 'string', 'publiclyAccessible': True|False, 'masterEndpoint': { 'port': 123, 'address': 'string' }, 'pendingMaintenanceActions': [ { 'action': 'string', 'description': 'string', 'currentApplyDate': datetime(2015, 1, 1) }, ], 'caCertificateIdentifier': 'string' } }
Response Structure
(dict) --
relationalDatabase (dict) --
An object describing the specified database.
name (string) --
The unique name of the database resource in Lightsail.
arn (string) --
The Amazon Resource Name (ARN) of the database.
supportCode (string) --
The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
createdAt (datetime) --
The timestamp when the database was created. Formatted in Unix time.
location (dict) --
The Region name and Availability Zone where the database is located.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a (case-sensitive).
regionName (string) --
The AWS Region name.
resourceType (string) --
The Lightsail resource type for the database (for example, RelationalDatabase).
tags (list) --
The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Lightsail Dev Guide.
(dict) --
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Lightsail Dev Guide.
key (string) --
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
value (string) --
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
relationalDatabaseBlueprintId (string) --
The blueprint ID for the database. A blueprint describes the major engine version of a database.
relationalDatabaseBundleId (string) --
The bundle ID for the database. A bundle describes the performance specifications for your database.
masterDatabaseName (string) --
The name of the master database created when the Lightsail database resource is created.
hardware (dict) --
Describes the hardware of the database.
cpuCount (integer) --
The number of vCPUs for the database.
diskSizeInGb (integer) --
The size of the disk for the database.
ramSizeInGb (float) --
The amount of RAM in GB for the database.
state (string) --
Describes the current state of the database.
secondaryAvailabilityZone (string) --
Describes the secondary Availability Zone of a high availability database.
The secondary database is used for failover support of a high availability database.
backupRetentionEnabled (boolean) --
A Boolean value indicating whether automated backup retention is enabled for the database.
pendingModifiedValues (dict) --
Describes pending database value modifications.
masterUserPassword (string) --
The password for the master user of the database.
engineVersion (string) --
The database engine version.
backupRetentionEnabled (boolean) --
A Boolean value indicating whether automated backup retention is enabled.
engine (string) --
The database software (for example, MySQL).
engineVersion (string) --
The database engine version (for example, 5.7.23).
latestRestorableTime (datetime) --
The latest point in time to which the database can be restored. Formatted in Unix time.
masterUsername (string) --
The master user name of the database.
parameterApplyStatus (string) --
The status of parameter updates for the database.
preferredBackupWindow (string) --
The daily time range during which automated backups are created for the database (for example, 16:00-16:30).
preferredMaintenanceWindow (string) --
The weekly time range during which system maintenance can occur on the database.
In the format ddd:hh24:mi-ddd:hh24:mi. For example, Tue:17:00-Tue:17:30.
publiclyAccessible (boolean) --
A Boolean value indicating whether the database is publicly accessible.
masterEndpoint (dict) --
The master endpoint for the database.
port (integer) --
Specifies the port that the database is listening on.
address (string) --
Specifies the DNS address of the database.
pendingMaintenanceActions (list) --
Describes the pending maintenance actions for the database.
(dict) --
Describes a pending database maintenance action.
action (string) --
The type of pending database maintenance action.
description (string) --
Additional detail about the pending database maintenance action.
currentApplyDate (datetime) --
The effective date of the pending database maintenance action.
caCertificateIdentifier (string) --
The certificate associated with the database.
{'relationalDatabases': {'caCertificateIdentifier': 'string'}}
Returns information about all of your databases in Amazon Lightsail.
See also: AWS API Documentation
Request Syntax
client.get_relational_databases( pageToken='string' )
string
A token used for advancing to a specific page of results for your get relational database request.
dict
Response Syntax
{ 'relationalDatabases': [ { 'name': 'string', 'arn': 'string', 'supportCode': 'string', 'createdAt': datetime(2015, 1, 1), 'location': { 'availabilityZone': 'string', 'regionName': 'us-east-1'|'us-east-2'|'us-west-1'|'us-west-2'|'eu-west-1'|'eu-west-2'|'eu-west-3'|'eu-central-1'|'ca-central-1'|'ap-south-1'|'ap-southeast-1'|'ap-southeast-2'|'ap-northeast-1'|'ap-northeast-2' }, 'resourceType': 'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord', 'tags': [ { 'key': 'string', 'value': 'string' }, ], 'relationalDatabaseBlueprintId': 'string', 'relationalDatabaseBundleId': 'string', 'masterDatabaseName': 'string', 'hardware': { 'cpuCount': 123, 'diskSizeInGb': 123, 'ramSizeInGb': ... }, 'state': 'string', 'secondaryAvailabilityZone': 'string', 'backupRetentionEnabled': True|False, 'pendingModifiedValues': { 'masterUserPassword': 'string', 'engineVersion': 'string', 'backupRetentionEnabled': True|False }, 'engine': 'string', 'engineVersion': 'string', 'latestRestorableTime': datetime(2015, 1, 1), 'masterUsername': 'string', 'parameterApplyStatus': 'string', 'preferredBackupWindow': 'string', 'preferredMaintenanceWindow': 'string', 'publiclyAccessible': True|False, 'masterEndpoint': { 'port': 123, 'address': 'string' }, 'pendingMaintenanceActions': [ { 'action': 'string', 'description': 'string', 'currentApplyDate': datetime(2015, 1, 1) }, ], 'caCertificateIdentifier': 'string' }, ], 'nextPageToken': 'string' }
Response Structure
(dict) --
relationalDatabases (list) --
An object describing the result of your get relational databases request.
(dict) --
Describes a database.
name (string) --
The unique name of the database resource in Lightsail.
arn (string) --
The Amazon Resource Name (ARN) of the database.
supportCode (string) --
The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
createdAt (datetime) --
The timestamp when the database was created. Formatted in Unix time.
location (dict) --
The Region name and Availability Zone where the database is located.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a (case-sensitive).
regionName (string) --
The AWS Region name.
resourceType (string) --
The Lightsail resource type for the database (for example, RelationalDatabase).
tags (list) --
The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Lightsail Dev Guide.
(dict) --
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Lightsail Dev Guide.
key (string) --
The key of the tag.
Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
value (string) --
The value of the tag.
Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
relationalDatabaseBlueprintId (string) --
The blueprint ID for the database. A blueprint describes the major engine version of a database.
relationalDatabaseBundleId (string) --
The bundle ID for the database. A bundle describes the performance specifications for your database.
masterDatabaseName (string) --
The name of the master database created when the Lightsail database resource is created.
hardware (dict) --
Describes the hardware of the database.
cpuCount (integer) --
The number of vCPUs for the database.
diskSizeInGb (integer) --
The size of the disk for the database.
ramSizeInGb (float) --
The amount of RAM in GB for the database.
state (string) --
Describes the current state of the database.
secondaryAvailabilityZone (string) --
Describes the secondary Availability Zone of a high availability database.
The secondary database is used for failover support of a high availability database.
backupRetentionEnabled (boolean) --
A Boolean value indicating whether automated backup retention is enabled for the database.
pendingModifiedValues (dict) --
Describes pending database value modifications.
masterUserPassword (string) --
The password for the master user of the database.
engineVersion (string) --
The database engine version.
backupRetentionEnabled (boolean) --
A Boolean value indicating whether automated backup retention is enabled.
engine (string) --
The database software (for example, MySQL).
engineVersion (string) --
The database engine version (for example, 5.7.23).
latestRestorableTime (datetime) --
The latest point in time to which the database can be restored. Formatted in Unix time.
masterUsername (string) --
The master user name of the database.
parameterApplyStatus (string) --
The status of parameter updates for the database.
preferredBackupWindow (string) --
The daily time range during which automated backups are created for the database (for example, 16:00-16:30).
preferredMaintenanceWindow (string) --
The weekly time range during which system maintenance can occur on the database.
In the format ddd:hh24:mi-ddd:hh24:mi. For example, Tue:17:00-Tue:17:30.
publiclyAccessible (boolean) --
A Boolean value indicating whether the database is publicly accessible.
masterEndpoint (dict) --
The master endpoint for the database.
port (integer) --
Specifies the port that the database is listening on.
address (string) --
Specifies the DNS address of the database.
pendingMaintenanceActions (list) --
Describes the pending maintenance actions for the database.
(dict) --
Describes a pending database maintenance action.
action (string) --
The type of pending database maintenance action.
description (string) --
Additional detail about the pending database maintenance action.
currentApplyDate (datetime) --
The effective date of the pending database maintenance action.
caCertificateIdentifier (string) --
The certificate associated with the database.
nextPageToken (string) --
A token used for advancing to the next page of results from your get relational databases request.
{'caCertificateIdentifier': 'string'}
Allows the update of one or more attributes of a database in Amazon Lightsail.
Updates are applied immediately, or in cases where the updates could result in an outage, are applied during the database's predefined maintenance window.
The update relational database operation supports tag-based access control via resource tags applied to the resource identified by relationalDatabaseName. For more information, see the Lightsail Dev Guide.
See also: AWS API Documentation
Request Syntax
client.update_relational_database( relationalDatabaseName='string', masterUserPassword='string', rotateMasterUserPassword=True|False, preferredBackupWindow='string', preferredMaintenanceWindow='string', enableBackupRetention=True|False, disableBackupRetention=True|False, publiclyAccessible=True|False, applyImmediately=True|False, caCertificateIdentifier='string' )
string
[REQUIRED]
The name of your database to update.
string
The password for the master user of your database. The password can include any printable ASCII character except "/", """, or "@".
Constraints: Must contain 8 to 41 characters.
boolean
When true, the master user password is changed to a new strong password generated by Lightsail.
Use the get relational database master user password operation to get the new password.
string
The daily time range during which automated backups are created for your database if automated backups are enabled.
Constraints:
Must be in the hh24:mi-hh24:mi format. Example: 16:00-16:30
Specified in Coordinated Universal Time (UTC).
Must not conflict with the preferred maintenance window.
Must be at least 30 minutes.
string
The weekly time range during which system maintenance can occur on your database.
The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week.
Constraints:
Must be in the ddd:hh24:mi-ddd:hh24:mi format.
Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
Must be at least 30 minutes.
Specified in Coordinated Universal Time (UTC).
Example: Tue:17:00-Tue:17:30
boolean
When true, enables automated backup retention for your database.
Updates are applied during the next maintenance window because this can result in an outage.
boolean
When true, disables automated backup retention for your database.
Disabling backup retention deletes all automated database backups. Before disabling this, you may want to create a snapshot of your database using the create relational database snapshot operation.
Updates are applied during the next maintenance window because this can result in an outage.
boolean
Specifies the accessibility options for your database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database.
boolean
When true, applies changes immediately. When false, applies changes during the preferred maintenance window. Some changes may cause an outage.
Default: false
string
Indicates the certificate that needs to be associated with the database.
dict
Response Syntax
{ 'operations': [ { 'id': 'string', 'resourceName': 'string', 'resourceType': 'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord', 'createdAt': datetime(2015, 1, 1), 'location': { 'availabilityZone': 'string', 'regionName': 'us-east-1'|'us-east-2'|'us-west-1'|'us-west-2'|'eu-west-1'|'eu-west-2'|'eu-west-3'|'eu-central-1'|'ca-central-1'|'ap-south-1'|'ap-southeast-1'|'ap-southeast-2'|'ap-northeast-1'|'ap-northeast-2' }, 'isTerminal': True|False, 'operationDetails': 'string', 'operationType': 'DeleteKnownHostKeys'|'DeleteInstance'|'CreateInstance'|'StopInstance'|'StartInstance'|'RebootInstance'|'OpenInstancePublicPorts'|'PutInstancePublicPorts'|'CloseInstancePublicPorts'|'AllocateStaticIp'|'ReleaseStaticIp'|'AttachStaticIp'|'DetachStaticIp'|'UpdateDomainEntry'|'DeleteDomainEntry'|'CreateDomain'|'DeleteDomain'|'CreateInstanceSnapshot'|'DeleteInstanceSnapshot'|'CreateInstancesFromSnapshot'|'CreateLoadBalancer'|'DeleteLoadBalancer'|'AttachInstancesToLoadBalancer'|'DetachInstancesFromLoadBalancer'|'UpdateLoadBalancerAttribute'|'CreateLoadBalancerTlsCertificate'|'DeleteLoadBalancerTlsCertificate'|'AttachLoadBalancerTlsCertificate'|'CreateDisk'|'DeleteDisk'|'AttachDisk'|'DetachDisk'|'CreateDiskSnapshot'|'DeleteDiskSnapshot'|'CreateDiskFromSnapshot'|'CreateRelationalDatabase'|'UpdateRelationalDatabase'|'DeleteRelationalDatabase'|'CreateRelationalDatabaseFromSnapshot'|'CreateRelationalDatabaseSnapshot'|'DeleteRelationalDatabaseSnapshot'|'UpdateRelationalDatabaseParameters'|'StartRelationalDatabase'|'RebootRelationalDatabase'|'StopRelationalDatabase'|'EnableAddOn'|'DisableAddOn', 'status': 'NotStarted'|'Started'|'Failed'|'Completed'|'Succeeded', 'statusChangedAt': datetime(2015, 1, 1), 'errorCode': 'string', 'errorDetails': 'string' }, ] }
Response Structure
(dict) --
operations (list) --
An object describing the result of your update relational database request.
(dict) --
Describes the API operation.
id (string) --
The ID of the operation.
resourceName (string) --
The resource name.
resourceType (string) --
The resource type.
createdAt (datetime) --
The timestamp when the operation was initialized (e.g., 1479816991.349).
location (dict) --
The AWS Region and Availability Zone.
availabilityZone (string) --
The Availability Zone. Follows the format us-east-2a (case-sensitive).
regionName (string) --
The AWS Region name.
isTerminal (boolean) --
A Boolean value indicating whether the operation is terminal.
operationDetails (string) --
Details about the operation (e.g., Debian-1GB-Ohio-1).
operationType (string) --
The type of operation.
status (string) --
The status of the operation.
statusChangedAt (datetime) --
The timestamp when the status was changed (e.g., 1479816991.349).
errorCode (string) --
The error code.
errorDetails (string) --
The error details.