當前位置: 首頁>>代碼示例>>Java>>正文


Java DeleteSecurityGroupResult類代碼示例

本文整理匯總了Java中com.amazonaws.services.ec2.model.DeleteSecurityGroupResult的典型用法代碼示例。如果您正苦於以下問題:Java DeleteSecurityGroupResult類的具體用法?Java DeleteSecurityGroupResult怎麽用?Java DeleteSecurityGroupResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DeleteSecurityGroupResult類屬於com.amazonaws.services.ec2.model包,在下文中一共展示了DeleteSecurityGroupResult類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import com.amazonaws.services.ec2.model.DeleteSecurityGroupResult; //導入依賴的package包/類
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);
}
 
開發者ID:awsdocs,項目名稱:aws-doc-sdk-examples,代碼行數:24,代碼來源:DeleteSecurityGroup.java

示例2: deleteSecurityGroupAsync

import com.amazonaws.services.ec2.model.DeleteSecurityGroupResult; //導入依賴的package包/類
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);
}
 
開發者ID:vmware,項目名稱:photon-model,代碼行數:14,代碼來源:AWSSecurityGroupClient.java

示例3: deleteSecurityGroup

import com.amazonaws.services.ec2.model.DeleteSecurityGroupResult; //導入依賴的package包/類
/**
 * 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;
}
 
開發者ID:treelogic-swe,項目名稱:aws-mock,代碼行數:21,代碼來源:BaseTest.java


注:本文中的com.amazonaws.services.ec2.model.DeleteSecurityGroupResult類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。