listHostedZonesByVPC method
Lists all the private hosted zones that a specified VPC is associated
with, regardless of which Amazon Web Services account or Amazon Web
Services service owns the hosted zones. The HostedZoneOwner
structure in the response contains one of the following values:
-
An
OwningAccountelement, which contains the account number of either the current Amazon Web Services account or another Amazon Web Services account. Some services, such as Cloud Map, create hosted zones using the current account. -
An
OwningServiceelement, which identifies the Amazon Web Services service that created and owns the hosted zone. For example, if a hosted zone was created by Amazon Elastic File System (Amazon EFS), the value ofOwnerisefs.amazonaws.com.
ListHostedZonesByVPC returns the hosted zones associated with
the specified VPC and does not reflect the hosted zone associations to
VPCs via Route 53 Profiles. To get the associations to a Profile, call the
ListProfileResourceAssociations
API.
May throw InvalidInput.
May throw InvalidPaginationToken.
Parameter vPCId :
The ID of the Amazon VPC that you want to list hosted zones for.
Parameter vPCRegion :
For the Amazon VPC that you specified for VPCId, the Amazon
Web Services Region that you created the VPC in.
Parameter maxItems :
(Optional) The maximum number of hosted zones that you want Amazon Route
53 to return. If the specified VPC is associated with more than
MaxItems hosted zones, the response includes a
NextToken element. NextToken contains an
encrypted token that identifies the first hosted zone that Route 53 will
return if you submit another request.
Parameter nextToken :
If the previous response included a NextToken element, the
specified VPC is associated with more hosted zones. To get more hosted
zones, submit another ListHostedZonesByVPC request.
For the value of NextToken, specify the value of
NextToken from the previous response.
If the previous response didn't include a NextToken element,
there are no more hosted zones to get.
Implementation
Future<ListHostedZonesByVPCResponse> listHostedZonesByVPC({
required String vPCId,
required VPCRegion vPCRegion,
int? maxItems,
String? nextToken,
}) async {
final $query = <String, List<String>>{
'vpcid': [vPCId],
'vpcregion': [vPCRegion.value],
if (maxItems != null) 'maxitems': [maxItems.toString()],
if (nextToken != null) 'nexttoken': [nextToken],
};
final $result = await _protocol.send(
method: 'GET',
requestUri: '/2013-04-01/hostedzonesbyvpc',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListHostedZonesByVPCResponse.fromXml($result.body);
}