Esempio n. 1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonShieldConfig config = new AmazonShieldConfig();

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

            ListProtectionsResponse resp = new ListProtectionsResponse();

            do
            {
                ListProtectionsRequest req = new ListProtectionsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

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

                foreach (var obj in resp.Protections)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }