public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonIdentityManagementServiceConfig config = new AmazonIdentityManagementServiceConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonIdentityManagementServiceClient client = new AmazonIdentityManagementServiceClient(creds, config); ListServerCertificatesResponse resp = new ListServerCertificatesResponse(); do { ListServerCertificatesRequest req = new ListServerCertificatesRequest { Marker = resp.Marker , MaxItems = maxItems }; resp = client.ListServerCertificates(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.ServerCertificateMetadataList) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.Marker)); }
public static void ListCertificates() { try { var iamClient = new AmazonIdentityManagementServiceClient(); var request = new ListServerCertificatesRequest(); var response = iamClient.ListServerCertificates(request); foreach (KeyValuePair <string, string> kvp in response.ResponseMetadata.Metadata) { Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value); } } catch (Exception e) { Console.WriteLine(e.Message); } }
public static IEnumerable <ServerCertificateMetadata> GetServerCertificates(AwsCommonParams commonParams) { using (var client = new AmazonIdentityManagementServiceClient( commonParams.ResolveCredentials(), commonParams.RegionEndpoint)) { var iamRequ = new ListServerCertificatesRequest(); do { var iamResp = client.ListServerCertificates(iamRequ); foreach (var r in iamResp.ServerCertificateMetadataList) { yield return(r); } iamRequ.Marker = iamResp.Marker; if (!iamResp.IsTruncated) { iamRequ = null; } } while (iamRequ != null); } }
public Task <ListServerCertificatesResponse> ListServerCertificatesAsync(ListServerCertificatesRequest request, CancellationToken cancellationToken = new CancellationToken()) { throw new System.NotImplementedException(); }