openstack4j
// V2 authentication
OSClientV2 os = OSFactory.builderV2()
.endpoint("http://127.0.0.1:5000/v2.0")
.credentials("admin","secret")
.tenantName("admin")
.authenticate(); // V3 authentication
OSClientV3 os = OSFactory.builderV3()
.endpoint("http://127.0.0.1:5000/v3")
.credentials("admin", "secret", Identifier.byName("Default"))
.scopeToProject(Identifier.byName("admin"))
.authenticate();
// Create a Server Model Object
Server server = Builders.server()
.name("Ubuntu 2")
.flavor("large")
.image("imageId")
.build(); // Boot the Server
Server server = os.compute().servers().boot(server); // Create a Snapshot
os.compute().servers().createSnapshot("id", "name");
// Create an Image
Image image = os.images().create(Builders.image()
.name("Cirros 0.3.0 x64")
.isPublic(true)
.containerFormat(ContainerFormat.BARE)
.diskFormat(DiskFormat.QCOW2)
.build()
), Payloads.create(new File("cirros.img")));
// Create a Port
Port port = os.networking().port()
.create(Builders.port()
.name("port1")
.networkId("networkId")
.fixedIp("52.51.1.253", "subnetId")
.build());
openstack4j的更多相关文章
- Openstack4j 在 Maven 中的构建
什么是 Openstack4j ? OpenStack的官方SDK是基于Python语言的,对于Java程序猿来说,将Python翻译过来未免麻烦.在Openstack官方的Wiki中(戳我直达),我 ...
- openstack4j接口调试
//import java.util.List;////import org.openstack4j.api.OSClient.OSClientV3;//import org.openstack4j. ...
- OpenStack-API开发
介绍两种OpenStack-API(Java版)--jcoulds && openstack4j Jclouds 1.介绍 jclouds -该API提供云计算环境的可移植抽象层以及云 ...
- 收集整理的openstack java封装 api的第三方实现的选择
Apache jclouds 地址:http://jclouds.apache.org/guides/openstack/ 一个开源库,java实现,支持cloudstack,openstack以及各 ...
- jar包冲突时怎么办
因为项目中会依赖许多jar包,免不得就会有冲突,那怎么解决呢? 使用 mvn dependency:tree 可以看到各个包的依赖关系 [INFO] | +- commons-cli:commons- ...
随机推荐
- What is a Windows USB device path and how is it formatted?
http://community.silabs.com/t5/Interface-Knowledge-Base/Windows-USB-Device-Path/ta-p/114059 Windows ...
- ASP.NET MVC 基础(01)
[ASP.NET MVC ]系列文章大致会包含这样一些内容: 1.ASP.NET MVC 的一些高级知识点: 2.ASP.NET MVC 的一些最新技术: 3.ASP.NET MVC 网站安全方面的知 ...
- 单点登录filter根据redis中的key判断是否退出
package com.ailk.biapp.ci.localization.cntv.filter; import java.io.IOException; import java.util.Has ...
- PLSQL_性能优化系列12_Oracle Index Anaylsis索引分析
2014-10-04 Created By BaoXinjian
- java版的YUI3 combine服务-Combo Handler
YUI3中,为了避免js文件过大,各个功能模块是拆分的.它有一个“种子”的概念:先下载一个小的核心的js文件到浏览器端,再通过这个小的js文件去加载其它所需的模块. 这种按需加载虽然解决了单个js过大 ...
- 启动mongoDB 以及常用操作命令
nonsql 关系数据库 集合 表 文档 行 启动mongoDB之前首先手动创建存放MongoDB数据文件的目录,如e:\mongo_data 执行命令 mongod --dbpath=e: ...
- 容易导致outofmemoryException内存泄漏异常的编码问题
1.System.Drawing方面的类使用问题 System.Drawing用到了很多系统的资源和非托管代码,所以使用的时候要特别小心,注意内存泄漏(Memory Leak) 2.new byte[ ...
- iPhone播放音乐
来源:http://blog.csdn.net/htttw/article/details/7842295 iPhone播放音乐 今天我们简要介绍如何在iPhone中播放音乐: 强烈建议你参考官方文档 ...
- Performance plugin离线安装
Upload安装plugin Upload安装plugin方式,需要手动下载plugin,然后在Jenkins界面中upload plugin,从而实现安装plugin的目的. 进入Jenkins界面 ...
- protoc的protoc-gen-grpc-java插件
编译 protoc-gen-grpc-java插件 的文档在: https://github.com/grpc/grpc-java/tree/master/compiler 编译的步骤: Chang ...