Coder Social home page Coder Social logo

sirocco-cimi-client's Introduction

Sirocco DMTF CIMI Java SDK and commmand-line tools

Can be used with any CIMI compliant provider.

Java Client example

// machine creation

CimiClient cimiClient = CimiClient.login(cimiEndpointUrl, login,password);
MachineCreate machineCreate = new MachineCreate();
MachineTemplate machineTemplate = new MachineTemplate();
machineTemplate.setMachineConfigRef(configId);
machineTemplate.setMachineImageRef(imageId);
machineTemplate.setCredentialRef(credId);
machineCreate.setMachineTemplate(machineTemplate);
machineCreate.setName("myMachine");
machineCreate.setDescription("a test machine");
CreateResult<Machine> result = Machine.createMachine(cimiClient,machineCreate);
String machineId=result.getResource().getId();
System.out.println("Creating machine "+machineId);
result.getJob().waitForCompletion(60, TimeUnit.SECONDS);
			
Machine machine=Machine.getMachineByReference(cimiClient, machineId);
			
for(MachineNetworkInterface nic: machine.getNetworkInterfaces()) {
   System.out.println("IP address: "+nic.getAddresses().get(0));
}

Command-line tools example

cimiclient machineconfig-list -select name,cpu,memory
+-------------------------------------------+--------+---+------+
|id                                         |name    |cpu|memory|
+-------------------------------------------+--------+---+------+
|http://myprovider.com/cimi/machineConfigs/1|micro   |1  |630 MB|
|http://myprovider.com/cimi/machineConfigs/2|tiny    |1  |512 MB|
|http://myprovider.com/cimi/machineConfigs/3|small   |2  |2 GB  |
+-------------------------------------------+--------+---+------+

cimiclient  machineimage-list -select id,description -first 1 -last 4
+------------------------------------------+-----------------------------------+
|id                                        |description                        |
+------------------------------------------+-----------------------------------+
|http://myprovider.com/cimi/machineImages/1|Ubuntu Oneiric 11.10 Server 64 bits|
|http://myprovider.com/cimi/machineImages/2|Ubuntu 11.04 server 64bits         |
|http://myprovider.com/cimi/machineImages/3|Debian 5.0 32 bits                 |
|http://myprovider.com/cimi/machineImages/4|LAMP stack on Debian 5.0           |
+------------------------------------------+-----------------------------------+

More info

sirocco-cimi-client's People

Contributors

fdangtran avatar glejeune avatar rubykri avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.