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

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

            DescribeReportDefinitionsResponse resp = new DescribeReportDefinitionsResponse();

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

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

                foreach (var obj in resp.ReportDefinitions)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Esempio n. 2
0
        public void CostAndUsageReportDescribeReportDefinitions()
        {
            #region to-retrieve-report-definitions

            var client   = new AmazonCostAndUsageReportClient();
            var response = client.DescribeReportDefinitions(new DescribeReportDefinitionsRequest
            {
                MaxResults = 5
            });

            List <ReportDefinition> reportDefinitions = response.ReportDefinitions;

            #endregion
        }