本文整理汇总了Java中com.amazonaws.services.ec2.model.RevokeSecurityGroupEgressRequest类的典型用法代码示例。如果您正苦于以下问题:Java RevokeSecurityGroupEgressRequest类的具体用法?Java RevokeSecurityGroupEgressRequest怎么用?Java RevokeSecurityGroupEgressRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RevokeSecurityGroupEgressRequest类属于com.amazonaws.services.ec2.model包,在下文中一共展示了RevokeSecurityGroupEgressRequest类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeEgressRules
import com.amazonaws.services.ec2.model.RevokeSecurityGroupEgressRequest; //导入依赖的package包/类
public DeferredResult<Void> removeEgressRules(String groupId, List<IpPermission> rules) {
if (CollectionUtils.isNotEmpty(rules)) {
RevokeSecurityGroupEgressRequest req = new RevokeSecurityGroupEgressRequest()
.withGroupId(groupId).withIpPermissions(rules);
String message = "Remove Egress Rules from AWS Security Group with id [" + groupId +
"].";
AWSDeferredResultAsyncHandler<RevokeSecurityGroupEgressRequest,
RevokeSecurityGroupEgressResult>
handler = new AWSDeferredResultAsyncHandler<RevokeSecurityGroupEgressRequest,
RevokeSecurityGroupEgressResult>(this.service, message) {
@Override
protected Exception consumeError(Exception e) {
if (e instanceof AmazonEC2Exception &&
((AmazonEC2Exception)e).getErrorCode().equals
(SECURITY_GROUP_RULE_NOT_FOUND)) {
Utils.log(AWSUtils.class, AWSUtils.class.getSimpleName(),
Level.WARNING, () -> String
.format("Egress rules cannot be removed because "
+ "they do not exist: %s",
Utils.toString(e)));
return null;
} else {
return e;
}
}
};
this.client.revokeSecurityGroupEgressAsync(req, handler);
return handler.toDeferredResult()
.thenApply(r -> (Void)null);
} else {
return DeferredResult.completed(null);
}
}
示例2: revokeSecurityGroupEgress
import com.amazonaws.services.ec2.model.RevokeSecurityGroupEgressRequest; //导入依赖的package包/类
@Override
public void revokeSecurityGroupEgress(RevokeSecurityGroupEgressRequest revokeSecurityGroupEgressRequest) throws AmazonServiceException, AmazonClientException {
throw new UnsupportedOperationException("Not supported in mock");
}
示例3: revokeEgress
import com.amazonaws.services.ec2.model.RevokeSecurityGroupEgressRequest; //导入依赖的package包/类
@Override
public void revokeEgress(RevokeSecurityGroupEgressRequest request) {
revokeEgress(request, null);
}
示例4: revokeEgress
import com.amazonaws.services.ec2.model.RevokeSecurityGroupEgressRequest; //导入依赖的package包/类
/**
* Performs the <code>RevokeEgress</code> action.
*
* <p>
* The following request parameters will be populated from the data of this
* <code>SecurityGroup</code> resource, and any conflicting parameter value
* set in the request will be overridden:
* <ul>
* <li>
* <b><code>GroupId</code></b>
* - mapped from the <code>Id</code> identifier.
* </li>
* </ul>
*
* <p>
*
* @see RevokeSecurityGroupEgressRequest
*/
void revokeEgress(RevokeSecurityGroupEgressRequest request);