com.amazonaws.services.ec2.model.Instance.getSecurityGroups()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中com.amazonaws.services.ec2.model.Instance.getSecurityGroups()方法的一些代码示例,展示了Instance.getSecurityGroups()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.getSecurityGroups()方法的具体详情如下:
包路径:com.amazonaws.services.ec2.model.Instance
类名称:Instance
方法名:getSecurityGroups

Instance.getSecurityGroups介绍

[英]One or more security groups for the instance.
[中]实例的一个或多个安全组。

代码示例

代码示例来源:origin: aws/aws-sdk-java

if (getRootDeviceType() != null)
  sb.append("RootDeviceType: ").append(getRootDeviceType()).append(",");
if (getSecurityGroups() != null)
  sb.append("SecurityGroups: ").append(getSecurityGroups()).append(",");
if (getSourceDestCheck() != null)
  sb.append("SourceDestCheck: ").append(getSourceDestCheck()).append(",");

代码示例来源:origin: aws/aws-sdk-java

hashCode = prime * hashCode + ((getRootDeviceName() == null) ? 0 : getRootDeviceName().hashCode());
hashCode = prime * hashCode + ((getRootDeviceType() == null) ? 0 : getRootDeviceType().hashCode());
hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode());
hashCode = prime * hashCode + ((getSourceDestCheck() == null) ? 0 : getSourceDestCheck().hashCode());
hashCode = prime * hashCode + ((getSpotInstanceRequestId() == null) ? 0 : getSpotInstanceRequestId().hashCode());

代码示例来源:origin: aws-amplify/aws-sdk-android

/**
 * One or more security groups for the instance.
 * <p>
 * Returns a reference to this object so that method calls can be chained together.
 *
 * @param securityGroups One or more security groups for the instance.
 *
 * @return A reference to this updated object so that method calls can be chained
 *         together.
 */
public Instance withSecurityGroups(GroupIdentifier... securityGroups) {
  if (getSecurityGroups() == null) setSecurityGroups(new java.util.ArrayList<GroupIdentifier>(securityGroups.length));
  for (GroupIdentifier value : securityGroups) {
    getSecurityGroups().add(value);
  }
  return this;
}

代码示例来源:origin: aws/aws-sdk-java

if (other.getRootDeviceType() != null && other.getRootDeviceType().equals(this.getRootDeviceType()) == false)
  return false;
if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null)
  return false;
if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == false)
  return false;
if (other.getSourceDestCheck() == null ^ this.getSourceDestCheck() == null)

代码示例来源:origin: aws-amplify/aws-sdk-android

if (getClientToken() != null) sb.append("ClientToken: " + getClientToken() + ",");
if (getTags() != null) sb.append("Tags: " + getTags() + ",");
if (getSecurityGroups() != null) sb.append("SecurityGroups: " + getSecurityGroups() + ",");
if (isSourceDestCheck() != null) sb.append("SourceDestCheck: " + isSourceDestCheck() + ",");
if (getHypervisor() != null) sb.append("Hypervisor: " + getHypervisor() + ",");

代码示例来源:origin: aws-amplify/aws-sdk-android

hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); 
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); 
hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode()); 
hashCode = prime * hashCode + ((isSourceDestCheck() == null) ? 0 : isSourceDestCheck().hashCode()); 
hashCode = prime * hashCode + ((getHypervisor() == null) ? 0 : getHypervisor().hashCode());

代码示例来源:origin: aws-amplify/aws-sdk-android

if (other.getTags() == null ^ this.getTags() == null) return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; 
if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null) return false;
if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == false) return false; 
if (other.isSourceDestCheck() == null ^ this.isSourceDestCheck() == null) return false;
if (other.isSourceDestCheck() != null && other.isSourceDestCheck().equals(this.isSourceDestCheck()) == false) return false;

代码示例来源:origin: UrbanCode/terraform

private boolean verifySecurityGroups(Instance instance) {
  boolean result = false;
  List<String> expectedIds = new ArrayList<String>();
  for (SecurityGroupRefTask group : getSecurityGroupRefs()) {
    expectedIds.add(group.fetchSecurityGroup().getId());
  }
  List<String> foundIds = new ArrayList<String>();
  List<GroupIdentifier> gids = instance.getSecurityGroups();
  if (gids != null && !gids.isEmpty()) {
    for (GroupIdentifier gid : gids) {
      foundIds.add(gid.getGroupId());
    }
  }
  return result;
}

代码示例来源:origin: electronicarts/gatling-aws-maven-plugin

public Map<String, Instance> findExistingInstances(final String instanceType) {
  final Map<String, Instance> instances = new HashMap<>();
  final DescribeInstancesResult describeInstancesResult = this.ec2client.describeInstances(new DescribeInstancesRequest()
      .withFilters(this.getInstanceFilters(instanceType)));
  // Check for existing EC2 instances that fit the filter criteria and use those.
  for (final Reservation reservation : describeInstancesResult.getReservations()) {
    for (final Instance instance : reservation.getInstances()) {
      // If we found any existing EC2 instances put them into the instances variable.
      System.out.format("Reservations %s (%s): %s%n", instance.getInstanceId(), instance.getState().getName(), instance.getSecurityGroups().get(0).getGroupName());
      instances.put(instance.getInstanceId(), instance);
    }
  }
  return instances;
}

代码示例来源:origin: LendingClub/mercator

.withTargetValues(instance.getSecurityGroups().stream()
    .map(sg -> createEc2Arn("security-group", sg.getGroupId()))
    .collect(Collectors.toList()));

代码示例来源:origin: com.amazonaws/aws-java-sdk-ec2

if (getRootDeviceType() != null)
  sb.append("RootDeviceType: ").append(getRootDeviceType()).append(",");
if (getSecurityGroups() != null)
  sb.append("SecurityGroups: ").append(getSecurityGroups()).append(",");
if (getSourceDestCheck() != null)
  sb.append("SourceDestCheck: ").append(getSourceDestCheck()).append(",");

代码示例来源:origin: zalando-stups/fullstop

instance.getSecurityGroups().stream().map(GroupIdentifier::getGroupId).collect(toList()),
account,
getRegion(fromName(region)));

代码示例来源:origin: aws-amplify/aws-sdk-android

instance.getSecurityGroups().add(GroupIdentifierStaxUnmarshaller.getInstance().unmarshall(context));
continue;

代码示例来源:origin: com.amazonaws/aws-java-sdk-ec2

hashCode = prime * hashCode + ((getRootDeviceName() == null) ? 0 : getRootDeviceName().hashCode());
hashCode = prime * hashCode + ((getRootDeviceType() == null) ? 0 : getRootDeviceType().hashCode());
hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode());
hashCode = prime * hashCode + ((getSourceDestCheck() == null) ? 0 : getSourceDestCheck().hashCode());
hashCode = prime * hashCode + ((getSpotInstanceRequestId() == null) ? 0 : getSpotInstanceRequestId().hashCode());

代码示例来源:origin: org.apache.airavata/gfac-core

for (GroupIdentifier g : this.instance.getSecurityGroups()) {
  IpPermission ip = new IpPermission();
  ip.setIpProtocol("tcp");

代码示例来源:origin: org.elasticsearch/elasticsearch-cloud-aws

List<GroupIdentifier> instanceSecurityGroups = instance.getSecurityGroups();
ArrayList<String> securityGroupNames = new ArrayList<String>();
ArrayList<String> securityGroupIds = new ArrayList<String>();

代码示例来源:origin: airbnb/billow

for (GroupIdentifier identifier : instance.getSecurityGroups()) {
  this.securityGroups.add(new SecurityGroup(identifier));

代码示例来源:origin: com.amazonaws/aws-java-sdk-ec2

if (other.getRootDeviceType() != null && other.getRootDeviceType().equals(this.getRootDeviceType()) == false)
  return false;
if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null)
  return false;
if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == false)
  return false;
if (other.getSourceDestCheck() == null ^ this.getSourceDestCheck() == null)

相关文章

Instance类方法