本文整理了Java中org.jclouds.compute.domain.Hardware.getUri()
方法的一些代码示例,展示了Hardware.getUri()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hardware.getUri()
方法的具体详情如下:
包路径:org.jclouds.compute.domain.Hardware
类名称:Hardware
方法名:getUri
暂无
代码示例来源:origin: apache/jclouds
@Override public Map<URI, Hardware> get() {
ImmutableMap.Builder<URI, Hardware> result = ImmutableMap.builder();
for (Hardware hardware : hardwareSupplier.get()) {
result.put(hardware.getUri(), hardware);
}
return result.build();
}
}, seconds, SECONDS);
代码示例来源:origin: com.amysta.jclouds.provider/google-compute-engine
@Override public Map<URI, Hardware> get() {
ImmutableMap.Builder<URI, Hardware> result = ImmutableMap.builder();
for (Hardware hardware : hardwareSupplier.get()) {
result.put(hardware.getUri(), hardware);
}
return result.build();
}
}, seconds, SECONDS);
代码示例来源:origin: org.apache.jclouds.labs/google-compute-engine
@Override public Map<URI, Hardware> get() {
ImmutableMap.Builder<URI, Hardware> result = ImmutableMap.builder();
for (Hardware hardware : hardwareSupplier.get()) {
result.put(hardware.getUri(), hardware);
}
return result.build();
}
}, seconds, SECONDS);
代码示例来源:origin: org.apache.jclouds.provider/google-compute-engine
@Override public Map<URI, Hardware> get() {
ImmutableMap.Builder<URI, Hardware> result = ImmutableMap.builder();
for (Hardware hardware : hardwareSupplier.get()) {
result.put(hardware.getUri(), hardware);
}
return result.build();
}
}, seconds, SECONDS);
代码示例来源:origin: org.jclouds.api/nova
@Override
public boolean apply(Hardware input) {
return input.getUri().toString().equals(instance.getFlavorRef() + "");
}
}
代码示例来源:origin: org.jclouds.api/deltacloud
@Override
public boolean apply(Hardware input) {
return input.getUri().equals(instance.getHardwareProfile());
}
}
代码示例来源:origin: apache/jclouds
@Override
public URI apply(final Hardware input) {
return input.getUri();
}
}));
代码示例来源:origin: apache/jclouds
@Test
public void machineTypeParserTest() {
URI uri = URI.create("https://www.googleapis.com/compute/v1/projects/jclouds-dev/zones/asia-east1-a/machineTypes/custom-1-1024");
Hardware hardware = machineTypeURIToCustomHardware(uri);
assertThat(hardware.getRam()).isEqualTo(1024);
assertThat(hardware.getProcessors().get(0).getCores()).isEqualTo(1);
assertThat(hardware.getUri())
.isEqualTo(URI.create("https://www.googleapis.com/compute/v1/projects/jclouds-dev/zones/asia-east1-a/machineTypes/custom-1-1024"));
assertThat(hardware.getId())
.isEqualTo("https://www.googleapis.com/compute/v1/projects/jclouds-dev/zones/asia-east1-a/machineTypes/custom-1-1024");
}
代码示例来源:origin: apache/jclouds
@Test
public void testAutoGeneratedHardwareFromIdTest(){
Supplier<Set<? extends Location>> locations = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet.of(region));
Supplier<Set<? extends Image>> images = Suppliers.<Set<? extends Image>> ofInstance(ImmutableSet.of(image));
Supplier<Set<? extends Hardware>> hardwares = Suppliers.<Set<? extends Hardware>> ofInstance(ImmutableSet
.<Hardware> of(hardware));
Provider<TemplateOptions> optionsProvider = createMock(Provider.class);
Provider<TemplateBuilder> templateBuilderProvider = createMock(Provider.class);
TemplateBuilder defaultTemplate = createMock(TemplateBuilder.class);
GetImageStrategy getImageStrategy = createMock(GetImageStrategy.class);
expect(optionsProvider.get()).andReturn(new TemplateOptions());
expect(getImageStrategy.getImage(anyObject(String.class))).andReturn(null);
replay(defaultTemplate, optionsProvider, templateBuilderProvider, getImageStrategy);
TemplateBuilderImpl templateBuilder =
new GoogleComputeEngineArbitraryCpuRamTemplateBuilderImpl(locations, new ImageCacheSupplier(images, 60,
Atomics.<AuthorizationException>newReference(), Providers.of(getImageStrategy)), hardwares,
Suppliers.ofInstance(region),
optionsProvider, templateBuilderProvider);
Hardware hardware = templateBuilder.hardwareId("automatic:cores=2;ram=1024").build().getHardware();
assertThat(hardware.getRam()).isEqualTo(1024);
assertThat(hardware.getProcessors()).extracting("cores").containsExactly(2.0);
assertThat(hardware.getUri()).isEqualTo(URI.create("http://localhost/projects/party/zones/us-east-1/machineTypes/custom-2-1024"));
assertThat(hardware.getId()).isEqualTo("http://localhost/projects/party/zones/us-east-1/machineTypes/custom-2-1024");
}
代码示例来源:origin: apache/jclouds
@Override
@Test(dataProvider = "onlyIfAutomaticHardwareSupported", groups = {"integration", "live"})
public void testAutoGeneratedHardwareFromId() {
Template template = view.getComputeService().templateBuilder()
.hardwareId("automatic:cores=2;ram=1024").build();
assertThat(template.getHardware().getId()).isEqualTo(template.getLocation()
.getDescription() + "/machineTypes/custom-2-1024");
assertThat(template.getHardware().getRam()).isEqualTo(1024);
assertThat(template.getHardware().getProcessors().get(0).getCores()).isEqualTo(2);
assertThat(template.getHardware().getUri()).isEqualTo(URI.create(template.getLocation()
.getDescription() + "/machineTypes/custom-2-1024"));
}
代码示例来源:origin: org.apache.stratos/gce
Hardware hardware = checkNotNull(template.getHardware(), "hardware must be set");
checkNotNull(hardware.getUri(), "hardware must have a URI");
checkNotNull(template.getImage().getUri(), "image URI is null");
.forMachineType(hardware.getUri());
代码示例来源:origin: io.cloudsoft.jclouds.labs/google-compute-engine
Hardware hardware = checkNotNull(template.getHardware(), "hardware must be set");
checkNotNull(hardware.getUri(), "hardware must have a URI");
checkNotNull(template.getImage().getUri(), "image URI is null");
.forMachineType(hardware.getUri());
代码示例来源:origin: com.amysta.jclouds.provider/google-compute-engine
checkNotNull(template.getHardware().getUri(), "hardware must have a URI");
checkNotNull(template.getImage().getUri(), "image URI is null");
template.getHardware().getUri(), // machineType
network,
disks)
代码示例来源:origin: org.apache.jclouds.labs/google-compute-engine
GoogleComputeEngineTemplateOptions options = GoogleComputeEngineTemplateOptions.class.cast(template.getOptions());
checkNotNull(options.network(), "template options must specify a network");
checkNotNull(template.getHardware().getUri(), "hardware must have a URI");
checkNotNull(template.getImage().getUri(), "image URI is null");
template.getHardware().getUri(), // machineType
代码示例来源:origin: apache/jclouds
checkNotNull(template.getHardware().getUri(), "hardware must have a URI");
checkNotNull(template.getImage().getUri(), "image URI is null");
template.getHardware().getUri(), // machineType
networks,
disks)
代码示例来源:origin: org.apache.jclouds.provider/google-compute-engine
checkNotNull(template.getHardware().getUri(), "hardware must have a URI");
checkNotNull(template.getImage().getUri(), "image URI is null");
template.getHardware().getUri(), // machineType
networks,
disks)
代码示例来源: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());
}
}
代码示例来源: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());
}
}
内容来源于网络,如有侵权,请联系作者删除!