Lightsail / Client / check_subdomain_availability
check_subdomain_availability¶
- Lightsail.Client.check_subdomain_availability(**kwargs)¶
Checks whether a Lightsail subdomain is available to create. Optionally, reserves the subdomain for your account for 15 minutes.
If you don’t reserve the subdomain, another account can create it before you do.
See also: AWS API Documentation
Request Syntax
response = client.check_subdomain_availability( subdomainName='string', reserve=True|False )
- Parameters:
subdomainName (string) –
[REQUIRED]
The subdomain to check (for example,
mysiteorblog.mysite).A subdomain can contain one or two labels separated by a period (
.). Each label must start and end with a lowercase letter or a number, and can contain only lowercase letters, numbers, and hyphens (-). The name can be up to 39 characters long, including periods. Labels that start withxn--aren’t supported, and some names are reserved.Specify only the subdomain. A web address, such as
mysite.amazonlightsail.com, isn’t accepted.reserve (boolean) –
Specifies whether to reserve the subdomain for your account if it’s available. A reservation holds the subdomain for 15 minutes so that other accounts can’t create it. Checking the subdomain again doesn’t extend the reservation.
For a nested subdomain, such as
blog.mysite, the top-level subdomain (mysite) is reserved.You can have up to 5 active reservations at a time.
- Return type:
dict
- Returns:
Response Syntax
{ 'available': True|False, 'reservationExpiresAt': datetime(2015, 1, 1), 'subdomainName': 'string' }
Response Structure
(dict) –
available (boolean) –
A Boolean value that indicates whether the subdomain is available to create.
reservationExpiresAt (datetime) –
The timestamp when the reservation of the subdomain expires.
The expiry is returned only when your account holds an active reservation for the subdomain.
subdomainName (string) –
The subdomain that was checked.
Exceptions