Lightsail / Client / get_subdomains
get_subdomains¶
- Lightsail.Client.get_subdomains(**kwargs)¶
Returns information about one or more of your Lightsail subdomains.
When you don’t specify a subdomain, the response lists your top-level subdomains, and each top-level subdomain includes its nested subdomains.
The results are paginated. To get the next page of results, use the
pageTokenparameter.See also: AWS API Documentation
Request Syntax
response = client.get_subdomains( subdomainName='string', pageToken='string' )
- Parameters:
subdomainName (string) –
The subdomain for which to return information (for example,
mysiteorblog.mysite), not its web address.When omitted, the response includes all of your subdomains.
You can’t specify this parameter together with the
pageTokenparameter.pageToken (string) –
The token to advance to the next page of results from your request.
To get a page token, perform an initial
GetSubdomainsrequest. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.
- Return type:
dict
- Returns:
Response Syntax
{ 'subdomains': [ { 'subdomainName': 'string', 'arn': 'string', 'fqdn': 'string', 'depth': 123, 'state': 'CREATING'|'CREATE_FAILED'|'UNATTACHED'|'ATTACHING'|'ATTACHED'|'DETACHING'|'TRANSFERRING'|'IMPLICIT', 'attachedResource': { 'arn': 'string', 'name': 'string', 'attachedAt': datetime(2015, 1, 1) }, 'attachingResource': { 'arn': 'string', 'name': 'string', 'attachedAt': 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'|'eu-north-1'|'eu-south-2'|'ca-central-1'|'ap-east-1'|'ap-south-1'|'ap-southeast-1'|'ap-southeast-2'|'ap-northeast-1'|'ap-northeast-2'|'ap-southeast-3'|'ap-southeast-5'|'sa-east-1' }, 'createdAt': datetime(2015, 1, 1), 'parentFqdn': 'string', 'children': {'... recursive ...'}, 'tags': [ { 'key': 'string', 'value': 'string' }, ] }, ], 'nextPageToken': 'string' }
Response Structure
(dict) –
subdomains (list) –
An array of objects that describe your subdomains.
(dict) –
Describes a Lightsail subdomain. A subdomain is the name that you choose, such as
mysiteorblog.mysite. Its web address is the subdomain followed byamazonlightsail.com, such asblog.mysite.amazonlightsail.com. You can associate a subdomain with a Lightsail resource to make the resource reachable at the web address.subdomainName (string) –
The subdomain (for example,
mysiteorblog.mysite). To get the web address, use thefqdnparameter.arn (string) –
The Amazon Resource Name (ARN) of the subdomain.
If you create a subdomain with a depth of 2, such as
blog.mysite, without first creating the subdomain with a depth of 1 (mysite), Lightsail holdsmysitefor your account in theIMPLICITstate. It doesn’t have an ARN until you create a subdomain with that name.fqdn (string) –
The web address of the subdomain, which is the subdomain followed by
amazonlightsail.com(for example,blog.mysite.amazonlightsail.com).depth (integer) –
The number of labels in the subdomain. A top-level subdomain, such as
mysite, has a depth of1. A nested subdomain, such asblog.mysite, has a depth of2.state (string) –
The state of the subdomain.
The following states are possible:
CREATING– The subdomain is being created.CREATE_FAILED– The subdomain couldn’t be created. Delete the subdomain, and then create it again if the name is still available.UNATTACHED– The subdomain is ready, and isn’t associated with a resource.ATTACHING– The subdomain is being associated with a resource.ATTACHED– The subdomain is associated with a resource, and routes traffic to it.DETACHING– The subdomain is being disassociated from a resource.TRANSFERRING– The subdomain is being moved from one resource to another resource.IMPLICIT– The subdomain is the parent of one or more nested subdomains that you created, but you didn’t create the parent subdomain itself. You can’t associate or delete a subdomain in this state. To use it, create it with theCreateSubdomainaction.
attachedResource (dict) –
An object that describes the resource that the subdomain is associated with.
When the subdomain is in the
TRANSFERRINGstate, this is the resource that the subdomain is being moved from.arn (string) –
The Amazon Resource Name (ARN) of the resource.
name (string) –
The name of the resource.
attachedAt (datetime) –
The timestamp when the subdomain was associated with the resource.
attachingResource (dict) –
An object that describes the resource that the subdomain is being associated with.
This parameter is returned only when the subdomain is in the
ATTACHINGorTRANSFERRINGstate.arn (string) –
The Amazon Resource Name (ARN) of the resource.
name (string) –
The name of the resource.
attachedAt (datetime) –
The timestamp when the subdomain was associated with the resource.
location (dict) –
An object that describes the location of the subdomain, such as the AWS Region.
availabilityZone (string) –
The Availability Zone. Follows the format
us-east-2a(case-sensitive).regionName (string) –
The Amazon Web Services Region name.
createdAt (datetime) –
The timestamp when the subdomain was created.
parentFqdn (string) –
The web address of the parent subdomain (for example,
mysite.amazonlightsail.comforblog.mysite).This parameter isn’t returned for a subdomain with a depth of 1.
children (list) –
An array of objects that describe the nested subdomains of the subdomain.
This parameter is returned only by the
GetSubdomainsaction when you don’t specify a subdomain.tags (list) –
The tag keys and optional values for the subdomain. For more information about tags in Lightsail, see the Lightsail Developer Guide.
This parameter is returned only by the
GetSubdomainsaction when you specify a subdomain.(dict) –
Describes a tag key and optional value assigned to an Amazon Lightsail resource.
For more information about tags in Lightsail, see the Amazon Lightsail Developer 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: + - = . _ : / @
nextPageToken (string) –
The token to advance to the next page of results from your request.
A next page token is not returned if there are no more results to display.
To get the next page of results, perform another
GetSubdomainsrequest and specify the next page token using thepageTokenparameter.
Exceptions