本文整理了Java中org.jclouds.compute.domain.Hardware.getId()
方法的一些代码示例,展示了Hardware.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hardware.getId()
方法的具体详情如下:
包路径:org.jclouds.compute.domain.Hardware
类名称:Hardware
方法名:getId
暂无
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public String apply(Hardware arg0) {
return arg0.getId();
}
代码示例来源:origin: org.apache.jclouds.labs/azurecompute-arm
@Override
public boolean apply(Hardware input) {
return input.getId().equals(slashEncoded);
}
});
代码示例来源:origin: com.amysta.jclouds.provider/digitalocean2
@Override
public boolean apply(Hardware input) {
return input.getId().equals(slug);
}
});
代码示例来源:origin: org.apache.jclouds.provider/digitalocean2
@Override
public boolean apply(Hardware input) {
return input.getId().equals(slug);
}
});
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public boolean apply(Hardware hardware) {
return id.equals(hardware.getId());
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public boolean apply(Hardware input) {
boolean returnVal = true;
if (hardwareId != null) {
returnVal = hardwareId.equals(input.getId());
// match our input params so that the later predicates pass.
if (returnVal) {
fromHardware(input);
}
}
return returnVal;
}
代码示例来源:origin: org.apache.jclouds/jclouds-compute
@Override
public boolean apply(Hardware input) {
boolean returnVal = true;
if (hardwareId != null) {
returnVal = hardwareId.equals(input.getId());
// match our input params so that the later predicates pass.
if (returnVal) {
fromHardware(input);
}
}
return returnVal;
}
代码示例来源:origin: io.cloudsoft.jclouds/jclouds-compute
@Override
public boolean apply(Hardware input) {
boolean returnVal = true;
if (hardwareId != null) {
returnVal = hardwareId.equals(input.getId());
// match our input params so that the later predicates pass.
if (returnVal) {
fromHardware(input);
}
}
return returnVal;
}
代码示例来源:origin: org.apache.jclouds.karaf/commands
protected void printHardwares(ComputeService service, Set<? extends Hardware> hardwares, PrintStream out) {
ShellTable table = shellTableFactory.build("hardware");
table.setDisplayData(hardwares);
table.display(out, true, true);
for (Hardware hardware : hardwares) {
for (String cacheKey : ServiceHelper.findCacheKeysForService(service)) {
cacheProvider.getProviderCacheForType(Constants.HARDWARE_CACHE).put(cacheKey, hardware.getId());
}
}
}
代码示例来源:origin: jclouds/legacy-jclouds
public void testHardwareId() {
Hardware first = Iterables.get(computeService.listHardwareProfiles(), 0);
assert HardwarePredicates.idEquals(first.getId()).apply(first);
Hardware second = Iterables.get(computeService.listHardwareProfiles(), 1);
assert !HardwarePredicates.idEquals(first.getId()).apply(second);
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-locations-jclouds
@Test(groups={"Live", "Live-sanity"})
public void testJcloudsCreateWithHardwareIdLongForm() throws Exception {
obtainMachine(ImmutableMap.of(JcloudsLocation.HARDWARE_ID, N1_STANDARD_1_HARDWARE_ID_LONG_FORM));
assertEquals(template.getHardware().getId(), N1_STANDARD_1_HARDWARE_ID_LONG_FORM, "template="+template);
}
代码示例来源:origin: jclouds/legacy-jclouds
@Test
public void testTemplateChoiceForInstanceByCChardwareId() throws Exception {
Template template = newTemplateBuilder().fastest().build();
assert template != null : "The returned template was null, but it should have a value.";
assert CC1_4XLARGE.equals(template.getHardware()) : format(
"Incorrect image determined by the template. Expected: %s. Found: %s.", CC1_4XLARGE.getId(), template
.getHardware().getId());
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-locations-jclouds
@Test(groups={"Live", "Live-sanity"})
public void testJcloudsCreateWithHardwareIdShortFormWithNoRegionInLocationSpec() throws Exception {
replaceJcloudsLocation(GCE_PROVIDER);
obtainMachine(ImmutableMap.of(
JcloudsLocation.CLOUD_REGION_ID, GCE_USCENTRAL_REGION_NAME,
JcloudsLocation.HARDWARE_ID, N1_STANDARD_1_HARDWARE_ID));
assertEquals(template.getHardware().getId(), N1_STANDARD_1_HARDWARE_ID_LONG_FORM, "template="+template);
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-locations-jclouds
@Test(groups={"Live", "Live-sanity"})
public void testJcloudsCreateWithHardwareIdLongFormWithNoRegion() throws Exception {
// Expect it to default to GCE_USCENTRAL_REGION_NAME -
// but is that only because that region is hard-coded in the long hardwareId?!
replaceJcloudsLocation(GCE_PROVIDER);
obtainMachine(ImmutableMap.of(JcloudsLocation.HARDWARE_ID, N1_STANDARD_1_HARDWARE_ID_LONG_FORM));
assertEquals(template.getHardware().getId(), N1_STANDARD_1_HARDWARE_ID_LONG_FORM, "template="+template);
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-locations-jclouds
@Test(groups={"Live", "Live-sanity"})
public void testJcloudsCreateWithHardwareIdLongFormWithNoRegionInLocationSpec() throws Exception {
// region will be passed in the obtain() call
replaceJcloudsLocation(GCE_PROVIDER);
obtainMachine(ImmutableMap.of(
JcloudsLocation.CLOUD_REGION_ID, GCE_USCENTRAL_REGION_NAME,
JcloudsLocation.HARDWARE_ID, N1_STANDARD_1_HARDWARE_ID_LONG_FORM));
assertEquals(template.getHardware().getId(), N1_STANDARD_1_HARDWARE_ID_LONG_FORM, "template="+template);
}
代码示例来源: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
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: 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: 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: 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());
}
}
内容来源于网络,如有侵权,请联系作者删除!