コード例 #1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonRoute53Config config = new AmazonRoute53Config();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonRoute53Client client = new AmazonRoute53Client(creds, config);

            ListHostedZonesResponse resp = new ListHostedZonesResponse();

            do
            {
                ListHostedZonesRequest req = new ListHostedZonesRequest
                {
                    Marker = resp.NextMarker
                    ,
                    MaxItems = maxItems.ToString()
                };

                resp = client.ListHostedZones(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.HostedZones)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextMarker));
        }
コード例 #2
0
        public static ListHostedZonesResponse GetHostedZones(IAmazonRoute53 r53Client)
        {
            var request = new ListHostedZonesRequest {
                MaxItems = "100"
            };
            var response = r53Client.ListHostedZones(request);

            return(response);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: tphillips/route53
        public static void ListZones()
        {
            var listHostedZonesRequest  = new ListHostedZonesRequest();
            var listHostedZonesResponse = c.ListHostedZonesAsync(listHostedZonesRequest).Result;

            foreach (var z in listHostedZonesResponse.HostedZones)
            {
                Console.WriteLine($"{z.Name}");
            }
        }
コード例 #4
0
        private async Task <ListHostedZonesResponse> listAwsHostedZonesAsync()
        {
            logger.LogInformation($"Getting List of hosted zones...");

            ListHostedZonesRequest request = new ListHostedZonesRequest {
            };

            ListHostedZonesResponse zone = await TheRoute53Client().ListHostedZonesAsync(request);

            return(zone);
        }
コード例 #5
0
        /// <summary>
        /// Retrieve a list of your hosted zones.
        /// </summary>
        /// <param name="settings">The <see cref="Route53Settings"/> required to connect to Route53.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        public async Task <IList <HostedZone> > GetHostedZones(Route53Settings settings, CancellationToken cancellationToken = default(CancellationToken))
        {
            ListHostedZonesRequest request = new ListHostedZonesRequest();

            AmazonRoute53Client     client   = this.GetClient(settings);
            ListHostedZonesResponse response = await client.ListHostedZonesAsync(request);

            if (response.HttpStatusCode == HttpStatusCode.OK)
            {
                _Log.Verbose("Listing hosted zones");
                return(response.HostedZones);
            }
            else
            {
                _Log.Error("Could not list hosted zones");
                return(null);
            }
        }
コード例 #6
0
 public virtual Task <ListHostedZonesResponse> ListHostedZonesAsync(ListHostedZonesRequest request, CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotImplementedException();
 }