public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonMQConfig config = new AmazonMQConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonMQClient client = new AmazonMQClient(creds, config); ListBrokersResponse resp = new ListBrokersResponse(); do { ListBrokersRequest req = new ListBrokersRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListBrokers(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.BrokerSummaries) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
public static async Task<IEnumerable<string>> FindQueueUrls() { using (var client = new AmazonMQClient(ConfigManager.ConfigSettings.AccessKey, ConfigManager.ConfigSettings.Secret, Amazon.RegionEndpoint.USWest2)) { var response = await client.ListQueuesAsync(new ListQueuesRequest()); return response.QueueUrls; } }
protected IAmazonMQ CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonMQConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonMQClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }