Amazon.Route53.AmazonRoute53Client.ListResourceRecordSetsAsync C# (CSharp) Method

ListResourceRecordSetsAsync() public method

Initiates the asynchronous execution of the ListResourceRecordSets operation.
public ListResourceRecordSetsAsync ( ListResourceRecordSetsRequest request, System cancellationToken = default(CancellationToken) ) : Task
request ListResourceRecordSetsRequest Container for the necessary parameters to execute the ListResourceRecordSets operation.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
return Task
        public Task<ListResourceRecordSetsResponse> ListResourceRecordSetsAsync(ListResourceRecordSetsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ListResourceRecordSetsRequestMarshaller();
            var unmarshaller = ListResourceRecordSetsResponseUnmarshaller.Instance;

            return InvokeAsync<ListResourceRecordSetsRequest,ListResourceRecordSetsResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }

Usage Example

Example #1
0
        // public string DnsRecordName { get; set; }

        // public string DnsRecordType { get; set; }

        // public string DnsRecordValue { get; set; }

        /// <summary>
        /// Returns all records up to 100 at a time, starting with the
        /// one with the optional name and/or type, sorted in lexical
        /// order by name (with labels reversed) then by type.
        /// </summary>
        public async Task <ListResourceRecordSetsResponse> GetRecords(
            string startingDnsName, string startingDnsType = null)
        {
#pragma warning disable 618 // "'StoredProfileCredentials' is obsolete..."
            var crd = StoredProfileCredentials.GetProfile(AwsProfileName);
#pragma warning restore 618
            var cfg = new AmazonRoute53Config
            {
                RegionEndpoint = RegionEndpoint.USEast1,
            };

            var reg = RegionEndpoint.GetBySystemName(AwsRegion);
            using (var r53 = new Amazon.Route53.AmazonRoute53Client(crd, cfg))
            {
                var rrRequ = new Amazon.Route53.Model.ListResourceRecordSetsRequest
                {
                    HostedZoneId    = HostedZoneId,
                    StartRecordName = startingDnsName,
                    StartRecordType = startingDnsType,
                };

                var rrResp = await r53.ListResourceRecordSetsAsync(rrRequ);

                return(rrResp);
            }
        }
AmazonRoute53Client