Skip to content

jguiditta/tim

 
 

Repository files navigation

Tim

Running Tests

Tests are run from the project root directory. But are run in the context of the dummy app located under test/dummy. In order to run the tests you must first setup dummy app database.

rake db:setup; rake -f test/dummy/Rakefile test:prepare

Once you have done this cd to the project root and run the following:

rake spec

Running the Dummy app

This will allow you to runn the commands below to test out the engine in isolation (if mounted in another application, the main difference will just be where the engine gets mounted, so adjust your url accordingly).

cd test/dummy; rails s

API Reference

Base Images

Create Base Image

Request

curl -X POST --header "Accept: application/xml" --header \
"Content-Type: application/xml" http://localhost:3000/tim/base_images --data \
"<base_image>
  <name>MyFirstBaseImage</name>
  <description>This is my very first base image</description>
</base_image>"

Response

Code: 201

Body:

<base_image href='http://localhost:3000/tim/base_images/1' id='1'>
  <name>MyFirstBaseImage</name>
  <description>This is my very first base image</description>
</base_image>

Show Base Image

Request

curl --header "Accept: application/xml" http://localhost:3000/tim/base_images/1

Response

Code: 200

Body:

<base_image href='http://localhost:3000/tim/base_images/1' id='1'>
  <name>MyFirstBaseImage</name>
  <description>This is my very first base image</description>
  <image_versions>
  </image_versions>
</base_image>

List Base Images

Request

curl --header "Accept: application/xml" http://localhost:3000/tim/base_images

Response

Code: 200

Body:

<base_images>
  <base_image href='http://localhost:3000/tim/base_images/1' id='1'></base_image>
  <base_image href='http://localhost:3000/tim/base_images/2' id='2'></base_image>
  <base_image href='http://localhost:3000/tim/base_images/3' id='3'></base_image>
</base_images>

Delete Base Image

Request

curl -X DELETE--header "Accept: application/xml" http://localhost:3000/tim/base_images/1

Response

Code: 204

Body:

Image Versions

Create Image Version

Request

curl -X POST --header "Accept: application/xml" --header \
"Content-Type: application/xml" http://localhost:3000/tim/image_versions --data \
"<image_version>
  <base_image id='1'></base_image>
</image_version>"

Response

Code: 201

Body:

<image_version href='http://localhost:3000/tim/image_versions/5' id='5'>
  <base_image href='http://localhost:3000/tim/base_images/1' id='1'></base_image>
  <target_images>
  </target_images>
</image_version>

Show Image Version

Request

curl --header "Accept: application/xml" http://localhost:3000/tim/image_versions/1

Response

Code: 200

Body:

<image_version href='http://localhost:3000/tim/image_versions/1' id='1'>
  <base_image href='http://localhost:3000/tim/base_images/1' id='1'></base_image>
  <target_images>
  </target_images>
</image_version>

List Image Versions

Request

curl --header "Accept: application/xml" http://localhost:3000/tim/image_versions

Response

Code: 200

Body:

<image_versions>
  <image_version href='http://localhost:3000/tim/image_versions/1' id='1'></image_version>
  <image_version href='http://localhost:3000/tim/image_versions/2' id='2'></image_version>
  <image_version href='http://localhost:3000/tim/image_versions/3' id='3'></image_version>
</image_versions>

Delete Image Version

Request

curl -X DELETE--header "Accept: application/xml" http://localhost:3000/tim/image_versions/1

Response

Code: 204

Body:

Update Image Version

Request

curl -X PUT --header "Accept: application/xml" --header \
"Content-Type: application/xml" http://localhost:3000/tim/image_versions/1 --data \
"<image_version>
  <base_image id='2'></base_image>
</image_version>"

Response

Code: 200

body:

<image_version href='http://localhost:3000/tim/image_versions/1' id='1'>
  <base_image href='http://localhost:3000/tim/base_images/2' id='2'></base_image>
  <target_images>
  </target_images>
</image_version>

Create Target Image

Request

curl -X POST --header "Accept: application/xml" --header \
"Content-Type: application/xml" http://localhost:3000/tim/target_images --data \
"<target_image>
  <image_version id='2' />
</target_image>"

Response

Code: 201

Body:

<target_image href=‘localhost:3000/tim/target_images/1’ id=‘1’>

<target>EC2</target>
<status>BUILDING</status>
<status_detail></status_detail>
<progress>0</progress>
<image_version href='http://localhost:3000/tim/image_versions/2' id='2'></image_version>
<provider_images></provider_images>

</target_image>

Show Target Image

Request

curl --header "Accept: application/xml" http://localhost:3000/tim/target_images/1

Response

Code: 200

Body:

<target_image href='http://localhost:3000/tim/target_images/1' id='1'>
  <target>EC2</target>
  <status>COMPLETE</status>
  <status_detail></status_detail>
  <progress>100</progress>
  <image_version href='http://localhost:3000/tim/image_versions/2' id='2'></image_version>
  <provider_images></provider_images>
</target_image>

List Target Image

Request

curl --header "Accept: application/xml" http://localhost:3000/tim/target_images

Response

Code: 200

Body:

<target_images>
  <target_image href='http://localhost:3000/tim/target_images/1' id='1'></target_image>
  <target_image href='http://localhost:3000/tim/target_images/2' id='2'></target_image>
  <target_image href='http://localhost:3000/tim/target_images/3' id='3'></target_image>
</target_images>

Delete Target Image

Request

curl -X DELETE --header "Accept: application/xml" http://localhost:3000/tim/target_images/1

Response

Code: 204

Body:

Update Target Image

Request

curl -X PUT --header "Accept: application/xml" --header \
"Content-Type: application/xml" http://localhost:3000/tim/target_images/2 --data \
"<target_image>
  <image_version id='3'></image_version>
</target_image>"

Response

Code: 204

Create Provider Image

Request

curl -X POST --header "Accept: application/xml" --header \
"Content-Type: application/xml" http://localhost:3000/tim/provider_images --data \
"<provider_image>
  <target_image id='1' />
</provider_image>"

Response

Code: 201

Body:

<provider_image href='http://localhost:3000/tim/provider_images/85' id='85'>
  <provider>Amazon EC2</provider>
  <external_image_id>ami-123456</external_image_id>
  <snapshot>false</snapshot>
  <status>NEW</status>
  <status_detail></status_detail>
  <progress>0</progress>
  <target_image href='http://localhost:3000/tim/target_images/1' id='1'></target_image>
</provider_image>

Show Provider Image

Request

curl --header "Accept: application/xml" http://localhost:3000/tim/provider_images/1

Response

Code: 200

Body:

<provider_image href='http://localhost:3000/tim/provider_images/85' id='85'>
  <provider>Amazon EC2</provider>
  <external_image_id>ami-123456</external_image_id>
  <snapshot>false</snapshot>
  <status>NEW</status>
  <status_detail></status_detail>
  <progress>0</progress>
  <target_image href='http://localhost:3000/tim/target_images/1' id='1'></target_image>
</provider_image>

List Provider Images

Request

curl --header "Accept: application/xml" http://localhost:3000/tim/provider_images

Response

Code: 200

Body:

<provider_images>
  <provider_image href='http://localhost:3000/tim/provider_images/1' id='1'></provider_image>
  <provider_image href='http://localhost:3000/tim/provider_images/2' id='2'></provider_image>
  <provider_image href='http://localhost:3000/tim/provider_images/3' id='3'></provider_image>
</provider_image>

Delete Target Image

Request

curl -X DELETE --header "Accept: application/xml" http://localhost:3000/tim/provider_images/1

Response

Code: 204

Body:

Update Target Image

Request

curl -X PUT --header "Accept: application/xml" --header \
"Content-Type: application/xml" http://localhost:3000/tim/provider_images/2 --data \
"<provider_image>
  <target_image id='3'></target_image>
</provider_image>"

Response

Code: 204

Body:

<provider_image href='http://localhost:3000/tim/provider_images/84' id='84'>
  <provider></provider>
  <external_image_id></external_image_id>
  <snapshot></snapshot>
  <status></status>
  <status_detail></status_detail>
  <progress></progress>
  <target_image href='http://localhost:3000/tim/target_images/3' id='3'></target_image>
</provider_image>

License

Image Management Engine is released under the MIT license.

About

Web application for managing virtual images to be deployed in the cloud

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 98.6%
  • JavaScript 1.4%