org.jclouds.compute.domain.Hardware.getProviderId()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(9.8k)|赞(0)|评价(0)|浏览(107)

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

Hardware.getProviderId介绍

暂无

代码示例

代码示例来源:origin: jclouds/legacy-jclouds

@Override
 public boolean apply(Hardware input) {
   return input.getProviderId().equals(instance.getFlavorId() + "");
 }
}

代码示例来源:origin: org.jclouds.api/cloudservers

@Override
 public boolean apply(Hardware input) {
   return input.getProviderId().equals(instance.getFlavorId() + "");
 }
}

代码示例来源:origin: org.apache.jclouds.api/cloudservers

@Override
 public boolean apply(Hardware input) {
   return input.getProviderId().equals(instance.getFlavorId() + "");
 }
}

代码示例来源:origin: org.jclouds/jclouds-antcontrib

private void listHardwares(ComputeService computeService) {
 log("list hardwares");
 for (Hardware hardware : computeService.listHardwareProfiles()) {// TODO
   log(String.format("   hardware id=%s, cores=%s, ram=%s, volumes=%s", hardware.getProviderId(), getCores(hardware), hardware
       .getRam(), hardware.getVolumes()));
 }
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
public NodeAndInitialCredentials<Server>  createNodeWithGroupEncodedIntoName(String tag, String name, Template template) {
 // create the backend object using parameters from the template.
 Server from = client.createServerInDC(template.getLocation().getId(), name,
    Integer.parseInt(template.getImage().getProviderId()),
    Integer.parseInt(template.getHardware().getProviderId()));
 return new NodeAndInitialCredentials<Server>(from, from.id + "", LoginCredentials.builder().user(from.loginUser)
    .password(from.password).build());
}

代码示例来源:origin: org.apache.jclouds/jclouds-compute

@Override
public AtomicReference<NodeMetadata> call() throws Exception {
  NodeMetadata node = null;
  logger.debug(">> adding node location(%s) name(%s) image(%s) hardware(%s)", template.getLocation().getId(),
     name, MoreObjects.firstNonNull(template.getImage().getProviderId(), template.getImage().getId()),
     MoreObjects.firstNonNull(template.getHardware().getProviderId(), template.getHardware().getId()));
  node = addNodeWithGroupStrategy.createNodeWithGroupEncodedIntoName(group, name, template);
  logger.debug("<< %s node(%s)", formatStatus(node), node.getId());
  return new AtomicReference<NodeMetadata>(node);
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
public AtomicReference<NodeMetadata> call() throws Exception {
  NodeMetadata node = null;
  logger.debug(">> adding node location(%s) name(%s) image(%s) hardware(%s)", template.getLocation().getId(),
      name, template.getImage().getProviderId(), template.getHardware().getProviderId());
  node = addNodeWithGroupStrategy.createNodeWithGroupEncodedIntoName(group, name, template);
  logger.debug("<< %s node(%s)", formatStatus(node), node.getId());
  return new AtomicReference<NodeMetadata>(node);
}

代码示例来源:origin: jclouds/legacy-jclouds

public void testListSizes() throws Exception {
 for (Hardware hardware : client.listHardwareProfiles()) {
   assert hardware.getProviderId() != null : hardware;
   assert getCores(hardware) > 0 : hardware;
   assert hardware.getVolumes().size() >= 0 : hardware;
   assert hardware.getRam() > 0 : hardware;
   assertEquals(hardware.getType(), ComputeType.HARDWARE);
 }
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
public NodeAndInitialCredentials<Server> createNodeWithGroupEncodedIntoName(String group, String name,
    Template template) {
 Server server = client
      .createServer(name, Integer.parseInt(template.getImage().getProviderId()), Integer.parseInt(template
          .getHardware().getProviderId()), withMetadata(metadataAndTagsAsCommaDelimitedValue(template.getOptions())));
 return new NodeAndInitialCredentials<Server>(server, server.getId() + "", LoginCredentials.builder().password(
      server.getAdminPass()).build());
}

代码示例来源:origin: io.cloudsoft.jclouds/jclouds-compute

@Override
public AtomicReference<NodeMetadata> call() throws Exception {
  NodeMetadata node = null;
  logger.debug(">> adding node location(%s) name(%s) image(%s) hardware(%s)", template.getLocation().getId(),
      name, template.getImage().getProviderId(), template.getHardware().getProviderId());
  node = addNodeWithGroupStrategy.createNodeWithGroupEncodedIntoName(group, name, template);
  logger.debug("<< %s node(%s)", formatStatus(node), node.getId());
  return new AtomicReference<NodeMetadata>(node);
}

代码示例来源:origin: org.jclouds.api/cloudservers

@Override
public NodeAndInitialCredentials<Server> createNodeWithGroupEncodedIntoName(String group, String name,
    Template template) {
 Server server = client
      .createServer(name, Integer.parseInt(template.getImage().getProviderId()), Integer.parseInt(template
          .getHardware().getProviderId()), withMetadata(metadataAndTagsAsCommaDelimitedValue(template.getOptions())));
 return new NodeAndInitialCredentials<Server>(server, server.getId() + "", LoginCredentials.builder().password(
      server.getAdminPass()).build());
}

代码示例来源:origin: jclouds/legacy-jclouds

private void checkTemplate(Template defaultTemplate) {
 assertEquals(defaultTemplate.getImage().getId(), "RegionOne/15");
 assertEquals(defaultTemplate.getImage().getProviderId(), "15");
 assertEquals(defaultTemplate.getHardware().getId(), "RegionOne/1");
 assertEquals(defaultTemplate.getHardware().getProviderId(), "1");
 assertEquals(defaultTemplate.getLocation().getId(), "RegionOne");
 assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
}

代码示例来源:origin: org.jclouds.provider/rimuhosting

@Override
public NodeAndInitialCredentials<Server> createNodeWithGroupEncodedIntoName(String group, String name,
    Template template) {
 NewServerResponse server = client.createServer(name,
      checkNotNull(template.getImage().getProviderId(), "imageId"), checkNotNull(template.getHardware()
          .getProviderId(), "hardwareId"));
 return new NodeAndInitialCredentials<Server>(server.getServer(), server.getServer().getId() + "",
      LoginCredentials.builder().password(server.getNewInstanceRequest().getCreateOptions().getPassword())
          .build());
}

代码示例来源:origin: org.apache.jclouds.api/cloudservers

@Override
public NodeAndInitialCredentials<Server> createNodeWithGroupEncodedIntoName(String group, String name,
    Template template) {
 template.getOptions().userMetadata(ComputeServiceConstants.NODE_GROUP_KEY, group);
 Server server = client
      .createServer(name, Integer.parseInt(template.getImage().getProviderId()), Integer.parseInt(template
          .getHardware().getProviderId()), withMetadata(metadataAndTagsAsCommaDelimitedValue(template.getOptions())));
 return new NodeAndInitialCredentials<Server>(server, server.getId() + "", LoginCredentials.builder().password(
      server.getAdminPass()).build());
}

代码示例来源:origin: apache/jclouds

public void testListSizes() throws Exception {
 for (Hardware hardware : client.listHardwareProfiles()) {
   assert hardware.getProviderId() != null : hardware;
   assert getCores(hardware) > 0 : hardware;
   assert hardware.getRam() > 0 : hardware;
   assertEquals(hardware.getType(), ComputeType.HARDWARE);
   checkVolumes(hardware);
 }
}

代码示例来源:origin: apache/jclouds

@Test
public void testFastestTemplateBuilder() throws IOException {
 Template fastestTemplate = view.getComputeService().templateBuilder().fastest().osFamily(AMZN_LINUX).build();
 assert fastestTemplate.getImage().getProviderId().startsWith("ami-") : fastestTemplate;
 assertEquals(fastestTemplate.getHardware().getProviderId(), InstanceType.C4_8XLARGE);
 assertEquals(fastestTemplate.getImage().getOperatingSystem().is64Bit(), true);
 assertEquals(fastestTemplate.getImage().getOperatingSystem().getFamily(), AMZN_LINUX);
 assertEquals(fastestTemplate.getImage().getUserMetadata().get("rootDeviceType"), "ebs");
 assertEquals(fastestTemplate.getLocation().getId(), "us-east-1");
 assertEquals(getCores(fastestTemplate.getHardware()), 36.0d);
 assertEquals(fastestTemplate.getImage().getOperatingSystem().getArch(), "hvm");
}

代码示例来源:origin: io.cloudsoft.jclouds/jclouds-compute

@SuppressWarnings("unchecked")
  public static HardwareBuilder fromHardware(Hardware in) {
   return new HardwareBuilder().id(in.getId()).providerId(in.getProviderId()).location(in.getLocation()).name(
        in.getName()).uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()).processors(
        List.class.cast(in.getProcessors())).ram(in.getRam()).volumes(List.class.cast(in.getVolumes()))
        .supportsImage(in.supportsImage()).hypervisor(in.getHypervisor());
  }
}

代码示例来源:origin: jclouds/legacy-jclouds

@SuppressWarnings("unchecked")
  public static HardwareBuilder fromHardware(Hardware in) {
   return new HardwareBuilder().id(in.getId()).providerId(in.getProviderId()).location(in.getLocation()).name(
        in.getName()).uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()).processors(
        List.class.cast(in.getProcessors())).ram(in.getRam()).volumes(List.class.cast(in.getVolumes()))
        .supportsImage(in.supportsImage()).hypervisor(in.getHypervisor());
  }
}

代码示例来源:origin: org.apache.jclouds/jclouds-compute

@SuppressWarnings("unchecked")
  public static HardwareBuilder fromHardware(Hardware in) {
   return new HardwareBuilder().id(in.getId()).providerId(in.getProviderId()).location(in.getLocation()).name(
        in.getName()).uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()).processors(
        List.class.cast(in.getProcessors())).ram(in.getRam()).volumes(List.class.cast(in.getVolumes()))
        .supportsImage(in.supportsImage()).hypervisor(in.getHypervisor());
  }
}

代码示例来源:origin: apache/jclouds

@SuppressWarnings("unchecked")
  public static HardwareBuilder fromHardware(Hardware in) {
   return new HardwareBuilder().id(in.getId()).providerId(in.getProviderId()).location(in.getLocation()).name(
        in.getName()).uri(in.getUri()).userMetadata(in.getUserMetadata()).tags(in.getTags()).processors(
        List.class.cast(in.getProcessors())).ram(in.getRam()).volumes(List.class.cast(in.getVolumes()))
        .supportsImage(in.supportsImage()).hypervisor(in.getHypervisor());
  }
}

相关文章