@Override public Hardware apply(MachineType input) { URI zoneLink = URI.create( input.selfLink().toString().replace("/machineTypes/" + input.name(), "")); Location zone = locationsByUri.get().get(zoneLink); if (zone == null) { throw new IllegalStateException( String.format("zone %s not present in %s", zoneLink, locationsByUri.get().keySet())); } return new HardwareBuilder() .id(input.selfLink().toString()) .providerId(input.id()) .location(zone) .name(input.name()) .hypervisor("kvm") .processor(new Processor(input.guestCpus(), 1.0)) .providerId(input.id()) .ram(input.memoryMb()) .uri(input.selfLink()) .volumes(collectVolumes(input)) .supportsImage(Predicates.<Image>alwaysTrue()) .build(); }
@Override public Hardware apply(MachineType input) { URI zoneLink = URI.create( input.selfLink().toString().replace("/machineTypes/" + input.name(), "")); Location zone = locationsByUri.get().get(zoneLink); if (zone == null) { throw new IllegalStateException( String.format("zone %s not present in %s", zoneLink, locationsByUri.get().keySet())); } return new HardwareBuilder() .id(input.selfLink().toString()) .providerId(input.id()) .location(zone) .name(input.name()) .hypervisor("kvm") .processor(new Processor(input.guestCpus(), 1.0)) .providerId(input.id()) .ram(input.memoryMb()) .uri(input.selfLink()) .volumes(collectVolumes(input)) .supportsImage(Predicates.<Image>alwaysTrue()) .build(); }
@Override public Hardware apply(MachineType input) { URI zoneLink = URI.create( input.selfLink().toString().replace("/machineTypes/" + input.name(), "")); Location zone = locationsByUri.get().get(zoneLink); if (zone == null) { throw new IllegalStateException( String.format("zone %s not present in %s", zoneLink, locationsByUri.get().keySet())); } return new HardwareBuilder() .id(input.selfLink().toString()) .providerId(input.id()) .location(zone) .name(input.name()) .hypervisor("kvm") .processor(new Processor(input.guestCpus(), 1.0)) .providerId(input.id()) .ram(input.memoryMb()) .uri(input.selfLink()) .volumes(collectVolumes(input)) .supportsImage(Predicates.<Image>alwaysTrue()) .build(); }
@Override public Hardware apply(MachineType input) { URI zoneLink = URI.create( input.selfLink().toString().replace("/machineTypes/" + input.name(), "")); Location zone = locationsByUri.get().get(zoneLink); if (zone == null) { throw new IllegalStateException( String.format("zone %s not present in %s", zoneLink, locationsByUri.get().keySet())); } return new HardwareBuilder() .id(input.selfLink().toString()) .providerId(input.id()) .location(zone) .name(input.name()) .hypervisor("kvm") .processor(new Processor(input.guestCpus(), 1.0)) .providerId(input.id()) .ram(input.memoryMb()) .uri(input.selfLink()) .volumes(collectVolumes(input)) .supportsImage(Predicates.<Image>alwaysTrue()) .build(); }