Search in sources :

Example 1 with UpdateServerCertificateRequest

use of com.amazonaws.services.identitymanagement.model.UpdateServerCertificateRequest in project aws-doc-sdk-examples by awsdocs.

the class UpdateServerCertificate method main.

public static void main(String[] args) {
    final String USAGE = "To run this example, supply the current certificate name and\n" + "a new name. Ex:\n\n" + "UpdateServerCertificate <current-name> <new-name>\n";
    if (args.length != 2) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String cur_name = args[0];
    String new_name = args[1];
    final AmazonIdentityManagement iam = AmazonIdentityManagementClientBuilder.defaultClient();
    UpdateServerCertificateRequest request = new UpdateServerCertificateRequest().withServerCertificateName(cur_name).withNewServerCertificateName(new_name);
    UpdateServerCertificateResult response = iam.updateServerCertificate(request);
    System.out.printf("Successfully updated server certificate to name %s", new_name);
}
Also used : UpdateServerCertificateResult(com.amazonaws.services.identitymanagement.model.UpdateServerCertificateResult) AmazonIdentityManagement(com.amazonaws.services.identitymanagement.AmazonIdentityManagement) UpdateServerCertificateRequest(com.amazonaws.services.identitymanagement.model.UpdateServerCertificateRequest)

Aggregations

AmazonIdentityManagement (com.amazonaws.services.identitymanagement.AmazonIdentityManagement)1 UpdateServerCertificateRequest (com.amazonaws.services.identitymanagement.model.UpdateServerCertificateRequest)1 UpdateServerCertificateResult (com.amazonaws.services.identitymanagement.model.UpdateServerCertificateResult)1