Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 27 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[![License](license-apache-2.svg)](https://github.com/AVGTechnologies/lab_manager/blob/master/LICENSE)

Lab Manager
===========
# Lab Manager
Service providing REST API for various cloud providers.

Web Application providing uniform API to several cloud providers (Vsphere, Azure, ovirt, ...)
## Status
The solution is currently in development.

Endpoints
---------
The only supported cloud provider at the moment is _vmWare vSphere_.

## Endpoints
```
GET /computes
POST /computes
Expand All @@ -23,46 +24,32 @@ GET /computes/:id/snapshots/:id
POST /computes/:id/snapshots/:id/revert
```

Status
------
## Development

**This app is in develomplent - Not production ready**

Development
-----------

##setup

#create/modify config/database.yml
#create/modify config/lab_manager.yml
rake db:setup


##run app

rerun rackup
### Setup environment
* you will need Linux dev machine with Ruby 2.2.2
* create file `config/database.yml` based on adjusted `config/database.yml.example`
* create file `config/lab_manager.yml` based on adjusted `config/lab_manager.yml.example`
* run `rake db:setup`

### Run app
* please run command `rerun rackup`
(you can install reran globally by: `rvm @global do gem install rerun`)

### Example usage
#### Create & poweron virtual machine (compute unit)
`curl -i -H 'Content-Type: application/json' --data '{"provider_name":"v_sphere","image":"TA_8x64"}' localhost:21000/computes/`
It returns id of the created compute.

##example usage
```
#create & poweron virtual machine (compute unit)
curl -i -H 'Content-Type: application/json' --data '{"provider_name":"v_sphere","image":"TA_8x64"}' localhost:21000/computes/
#it returns id of the created compute

#destroy compute with id 1
curl -i -X DELETE localhost:21000/computes/9

#create & poweron virtual machine with custom name
curl -i -H 'Content-Type: application/json' --data '{"provider_name":"v_sphere","image":"TA_8x64", "create_vm_options": {"name":"fooooooooo"}}' localhost:21000/computes/
#### Destroy compute with id 1
`curl -i -X DELETE localhost:21000/computes/1`

#create & poweron virtual machine in custom folder it must exist in advance
curl -i -H 'Content-Type: application/json' --data '{"provider_name":"v_sphere","image":"TA_8x64", "create_vm_options": {"dest_folder":"foo/bar/baz"}}' localhost:21000/computes/
#### Create & power on virtual machine with custom name
`curl -i -H 'Content-Type: application/json' --data '{"provider_name":"v_sphere","image":"TA_8x64", "create_vm_options": {"name":"fooooooooo"}}' localhost:21000/computes/`

#create & poweron full clone
curl -i -H 'Content-Type: application/json' --data '{"provider_name":"v_sphere","image":"TA_8x64", "create_vm_options": {"linked_clone":false}}' localhost:21000/computes/
#### Create & power on virtual machine in custom folder
The folder must exist in advance!
`curl -i -H 'Content-Type: application/json' --data '{"provider_name":"v_sphere","image":"TA_8x64", "create_vm_options": {"dest_folder":"foo/bar/baz"}}' localhost:21000/computes/`



```
#### Create & power on full clone
`curl -i -H 'Content-Type: application/json' --data '{"provider_name":"v_sphere","image":"TA_8x64", "create_vm_options": {"linked_clone":false}}' localhost:21000/computes/`