This resource represents the information necessary for hardware virtualized resources to create a Machine Instance; it contains configuration data such as startup instructions, including possible combinations of the following items, depending on the 'type' of Machine Image created: the software image, installation software, both a disk image and a set of software and parameters.
A Machine Image Collection resource represents the collection of Machine Image resources within a Provider.
Note the 'add' URI of the Machine Image Collection resource in the example response below. This is the URI that is used for creating a new Machine Image (adding to the Machine Image Collection). This URI is also returned when dereferencing a Machine resource, as the href attribute of the 'capture' operation (when this is possible for the given Machine on the particular Cloud Provider).
Example request:
GET /cimi/machine_images HTTP/1.1 Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk User-Agent: curl/7.24.0 (i686-redhat-linux-gnu) Host: localhost:3001 Accept: application/xml
Server response:
HTTP/1.1 200 OK Content-Type: application/xml CIMI-Specification-Version: 1.0.1 Content-Length: 1195 ETag: e2f73ed48eb2abeae77322eea56dfc5d Cache-Control: max-age=0, private, must-revalidate Date: Fri, 28 Dec 2012 14:23:35 GMT Connection: keep-alive Server: thin 1.5.0 codename Knife <Collection xmlns="http://schemas.dmtf.org/cimi/1" resourceURI="http://schemas.dmtf.org/cimi/1/MachineImageCollection"> <id>http://localhost:3001/cimi/machine_images</id> <count>3</count> <MachineImage> <id>http://localhost:3001/cimi/machine_images/img1</id> <name>img1</name> <description>Fedora 10</description> <created>2012-12-28T16:23:35+02:00</created> <state>AVAILABLE</state> <type>IMAGE</type> <imageLocation>mock://img1</imageLocation> </MachineImage> <MachineImage> <id>http://localhost:3001/cimi/machine_images/img2</id> <name>img2</name> <description>Fedora 10</description> <created>2012-12-28T16:23:35+02:00</created> <state>AVAILABLE</state> <type>IMAGE</type> <imageLocation>mock://img2</imageLocation> </MachineImage> <MachineImage> <id>http://localhost:3001/cimi/machine_images/img3</id> <name>img3</name> <description>JBoss</description> <created>2012-12-28T16:23:35+02:00</created> <state>AVAILABLE</state> <type>IMAGE</type> <imageLocation>mock://img3</imageLocation> </MachineImage> <operation rel="add" href="http://localhost:3001/cimi/machine_images" /> </Collection>
Example request:
GET /cimi/machine_images/img1 HTTP/1.1 Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk User-Agent: curl/7.24.0 (i686-redhat-linux-gnu) Host: localhost:3001 Accept: application/xml
Server response:
HTTP/1.1 200 OK Content-Type: application/xml CIMI-Specification-Version: 1.0.1 Content-Length: 385 ETag: 130f8e9592138afc544d65d73039e540 Cache-Control: max-age=0, private, must-revalidate Date: Fri, 28 Dec 2012 14:55:42 GMT Connection: keep-alive Server: thin 1.5.0 codename Knife <MachineImage xmlns="http://schemas.dmtf.org/cimi/1" resourceURI="http://schemas.dmtf.org/cimi/1/MachineImage"> <id>http://localhost:3001/cimi/machine_images/img1</id> <name>img1</name> <description>Fedora 10</description> <created>2012-12-28T16:55:42+02:00</created> <state>AVAILABLE</state> <type>IMAGE</type> <imageLocation>mock://img1</imageLocation> </MachineImage>
The example below shows the creation of a new Machine Image resource from an existing Machine resource. When supported by the Machine and the given Cloud Provider, the href attribute of the serialized Machine resource's 'capture' operation provides the URI to which the request body should be sent with HTTP POST in order to create the new Machine Image. The message body is the representation of the to be created Machine Image resource, with the 'imageLocation' attribute referring to the Machine resource from which the Machine Image is to be created, as shown in the example below:
Example request:
POST /cimi/machine_images HTTP/1.1 Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk User-Agent: curl/7.24.0 (i686-redhat-linux-gnu) Host: localhost:3001 Content-Type: application/xml Accept: application/xml Content-Length: 188 <MachineImage> <name>some_name</name> <description>my new machine_image</description> <type>IMAGE</type> <imageLocation>http://localhost:3001/cimi/machines/inst1</imageLocation> </MachineImage>
Server response:
HTTP/1.1 201 Created Content-Type: application/xml Location: http://localhost:3001/cimi/machine_images/some_name CIMI-Specification-Version: 1.0.1 Content-Length: 411 ETag: c929191a65da6564f9f69301d38eb6fc Cache-Control: max-age=0, private, must-revalidate Date: Fri, 28 Dec 2012 15:10:12 GMT Connection: keep-alive Server: thin 1.5.0 codename Knife <MachineImage xmlns="http://schemas.dmtf.org/cimi/1" resourceURI="http://schemas.dmtf.org/cimi/1/MachineImage"> <id>http://localhost:3001/cimi/machine_images/some_name</id> <name>some_name</name> <description>my new machine image</description> <created>2012-12-28T17:10:12+02:00</created> <state>AVAILABLE</state> <type>IMAGE</type> <imageLocation>mock://some_name</imageLocation> </MachineImage>
Example request:
DELETE /cimi/machine_images/some_name HTTP/1.1 Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk User-Agent: curl/7.24.0 (i686-redhat-linux-gnu) Host: localhost:3001 Accept: application/xml
Server response:
HTTP/1.1 200 OK X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Content-Type: text/html;charset=utf-8 CIMI-Specification-Version: 1.0.1 Content-Length: 0 Date: Fri, 28 Dec 2012 15:21:14 GMT Connection: keep-alive Server: thin 1.5.0 codename Knife