Java 类com.amazonaws.services.ec2.model.DeleteSecurityGroupResult 实例源码

项目:aws-doc-sdk-examples    文件:DeleteSecurityGroup.java   
public static void main(String[] args)
{
    final String USAGE =
        "To run this example, supply a security group id\n" +
        "Ex: DeleteSecurityGroup <security-group-id>\n";

    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }

    String group_id = args[0];

    final AmazonEC2 ec2 = AmazonEC2ClientBuilder.defaultClient();

    DeleteSecurityGroupRequest request = new DeleteSecurityGroupRequest()
        .withGroupId(group_id);

    DeleteSecurityGroupResult response = ec2.deleteSecurityGroup(request);

    System.out.printf(
        "Successfully deleted security group with id %s", group_id);
}
项目:photon-model    文件:AWSSecurityGroupClient.java   
public DeferredResult<Void> deleteSecurityGroupAsync(String securityGroupId) {
    DeleteSecurityGroupRequest req = new DeleteSecurityGroupRequest()
            .withGroupId(securityGroupId);
    String message = "Delete AWS Security Group with id [" + securityGroupId + "].";

    AWSDeferredResultAsyncHandler<DeleteSecurityGroupRequest, DeleteSecurityGroupResult>
            handler = new AWSDeferredResultAsyncHandler<>(this.service, message);

    this.client.deleteSecurityGroupAsync(req, handler);

    return handler.toDeferredResult()
            .thenApply(result -> (Void) null);
}
项目:aws-mock    文件:BaseTest.java   
/**
 * Delete SecurityGroup.
 *
 * @param groupId the group id
 * @return true if deleted, otherwise false.
 */
protected final boolean deleteSecurityGroup(final String groupId) {
    DeleteSecurityGroupRequest req = new DeleteSecurityGroupRequest();
    req.setGroupId(groupId);
    DeleteSecurityGroupResult result = amazonEC2Client.deleteSecurityGroup(req);
    if (result != null) {
        return true;
    }

    /*CreateSecurityGroupRequest createSecurityGroupRequest = new CreateSecurityGroupRequest();
    AuthorizeSecurityGroupEgressRequest authorizeSecurityGroupEgressRequest = new AuthorizeSecurityGroupEgressRequest();
    authorizeSecurityGroupEgressRequest.setIpProtocol(ipProtocol);
    CreateSecurityGroupResult result = amazonEC2Client.authorizeSecurityGroupEgress(authorizeSecurityGroupEgressRequest);*/
    return false;
}