本文整理了Java中org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneAndId.getId()
方法的一些代码示例,展示了ZoneAndId.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneAndId.getId()
方法的具体详情如下:
包路径:org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneAndId
类名称:ZoneAndId
方法名:getId
暂无
代码示例来源:origin: org.jclouds.api/openstack-nova
@Override
public boolean apply(FloatingIP input) {
return key.getId().equals(input.getInstanceId());
}
});
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public boolean apply(FloatingIP input) {
return key.getId().equals(input.getInstanceId());
}
});
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
@Override
public boolean apply(FloatingIP input) {
return key.getId().equals(input.getInstanceId());
}
});
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public void suspendNode(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
if (novaApi.getServerAdminExtensionForZone(zoneAndId.getZone()).isPresent()) {
novaApi.getServerAdminExtensionForZone(zoneAndId.getZone()).get().suspend(zoneAndId.getId());
}
throw new UnsupportedOperationException("suspend requires installation of the Admin Actions extension");
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public void resumeNode(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
if (novaApi.getServerAdminExtensionForZone(zoneAndId.getZone()).isPresent()) {
novaApi.getServerAdminExtensionForZone(zoneAndId.getZone()).get().resume(zoneAndId.getId());
}
throw new UnsupportedOperationException("resume requires installation of the Admin Actions extension");
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
@Override
public void resumeNode(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
if (novaApi.getServerAdminExtensionForZone(zoneAndId.getZone()).isPresent()) {
novaApi.getServerAdminExtensionForZone(zoneAndId.getZone()).get().resume(zoneAndId.getId());
}
throw new UnsupportedOperationException("resume requires installation of the Admin Actions extension");
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public ZoneAndId apply(ZoneAndId id) {
FloatingIPApi floatingIpApi = novaApi.getFloatingIPExtensionForZone(id.getZone()).get();
for (FloatingIP ip : floatingIpCache.getUnchecked(id)) {
logger.debug(">> removing floatingIp(%s) from node(%s)", ip, id);
floatingIpApi.removeFromServer(ip.getIp(), id.getId());
logger.debug(">> deallocating floatingIp(%s)", ip);
floatingIpApi.delete(ip.getId());
}
floatingIpCache.invalidate(id);
return id;
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public void rebootNode(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
novaApi.getServerApiForZone(zoneAndId.getZone()).reboot(zoneAndId.getId(), RebootType.HARD);
}
代码示例来源:origin: org.jclouds.api/openstack-nova
@Override
public boolean deleteImage(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
try {
this.novaApi.getImageApiForZone(zoneAndId.getZone()).delete(zoneAndId.getId());
} catch (Exception e) {
return false;
}
return true;
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public boolean deleteImage(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
try {
this.novaApi.getImageApiForZone(zoneAndId.getZone()).delete(zoneAndId.getId());
} catch (Exception e) {
return false;
}
return true;
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
@Override
public void rebootNode(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
novaApi.getServerApiForZone(zoneAndId.getZone()).reboot(zoneAndId.getId(), RebootType.HARD);
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public void destroyNode(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
if (novaApi.getFloatingIPExtensionForZone(zoneAndId.getZone()).isPresent()) {
try {
removeFloatingIpFromNodeAndDeallocate.apply(zoneAndId);
} catch (RuntimeException e) {
logger.warn(e, "<< error removing and deallocating ip from node(%s): %s", id, e.getMessage());
}
}
novaApi.getServerApiForZone(zoneAndId.getZone()).delete(zoneAndId.getId());
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
@Override
public void destroyNode(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
if (novaApi.getFloatingIPExtensionForZone(zoneAndId.getZone()).isPresent()) {
try {
removeFloatingIpFromNodeAndDeallocate.apply(zoneAndId);
} catch (RuntimeException e) {
logger.warn(e, "<< error removing and deallocating ip from node(%s): %s", id, e.getMessage());
}
}
novaApi.getServerApiForZone(zoneAndId.getZone()).delete(zoneAndId.getId());
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public ImageTemplate buildImageTemplateFromNode(String name, final String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
Server server = novaApi.getServerApiForZone(zoneAndId.getZone()).get(zoneAndId.getId());
if (server == null)
throw new NoSuchElementException("Cannot find server with id: " + zoneAndId);
CloneImageTemplate template = new ImageTemplateBuilder.CloneImageTemplateBuilder().nodeId(id).name(name).build();
return template;
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
@Override
public ImageTemplate buildImageTemplateFromNode(String name, final String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
Server server = novaApi.getServerApiForZone(zoneAndId.getZone()).get(zoneAndId.getId());
if (server == null)
throw new NoSuchElementException("Cannot find server with id: " + zoneAndId);
CloneImageTemplate template = new ImageTemplateBuilder.CloneImageTemplateBuilder().nodeId(id).name(name).build();
return template;
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public ServerInZone getNode(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
Server server = novaApi.getServerApiForZone(zoneAndId.getZone()).get(zoneAndId.getId());
return server == null ? null : new ServerInZone(server, zoneAndId.getZone());
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public ImageInZone getImage(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
Image image = novaApi.getImageApiForZone(zoneAndId.getZone()).get(zoneAndId.getId());
return image == null ? null : new ImageInZone(image, zoneAndId.getZone());
}
代码示例来源:origin: org.jclouds.api/openstack-nova
@Override
public ServerInZone getNode(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
Server server = novaApi.getServerApiForZone(zoneAndId.getZone()).get(zoneAndId.getId());
return server == null ? null : new ServerInZone(server, zoneAndId.getZone());
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
@Override
public ServerInZone getNode(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
Server server = novaApi.getServerApiForZone(zoneAndId.getZone()).get(zoneAndId.getId());
return server == null ? null : new ServerInZone(server, zoneAndId.getZone());
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
@Override
public ImageInZone getImage(String id) {
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
Image image = novaApi.getImageApiForZone(zoneAndId.getZone()).get(zoneAndId.getId());
return image == null ? null : new ImageInZone(image, zoneAndId.getZone());
}
内容来源于网络,如有侵权,请联系作者删除!