2012-06-23 11:36:50 -04:00
|
|
|
LINKS_FORMAT = [{
|
|
|
|
'href' => String,
|
|
|
|
'rel' => String
|
|
|
|
}]
|
|
|
|
|
2012-07-04 14:51:25 -04:00
|
|
|
FLAVOR_FORMAT = {
|
|
|
|
'id' => Integer,
|
|
|
|
'name' => String,
|
|
|
|
'ram' => Integer,
|
|
|
|
'links' => LINKS_FORMAT
|
|
|
|
}
|
|
|
|
|
2012-06-23 11:36:50 -04:00
|
|
|
GET_FLAVOR_FORMAT = {
|
2012-07-04 14:51:25 -04:00
|
|
|
'flavor' => FLAVOR_FORMAT
|
2012-06-23 11:36:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
LIST_FLAVORS_FORMAT = {
|
2012-07-04 14:51:25 -04:00
|
|
|
'flavors' => [FLAVOR_FORMAT]
|
2012-06-23 11:36:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
INSTANCE_FORMAT = {
|
|
|
|
'id' => String,
|
|
|
|
'name' => String,
|
|
|
|
'status' => String,
|
|
|
|
'links' => LINKS_FORMAT,
|
|
|
|
'flavor' => {
|
|
|
|
'id' => String,
|
|
|
|
'links' => LINKS_FORMAT
|
|
|
|
},
|
|
|
|
'volume' => {
|
|
|
|
'size' => Integer
|
|
|
|
}
|
2012-07-04 14:51:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
INSTANCE_DETAILS_FORMAT = INSTANCE_FORMAT.merge({
|
|
|
|
'created' => String,
|
|
|
|
'updated' => String,
|
|
|
|
'hostname' => String,
|
2012-06-23 11:36:50 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
CREATE_INSTANCE_FORMAT = {
|
|
|
|
'instance' => INSTANCE_DETAILS_FORMAT
|
|
|
|
}
|
|
|
|
|
|
|
|
GET_INSTANCE_FORMAT = {
|
|
|
|
'instance' => INSTANCE_DETAILS_FORMAT.merge({
|
|
|
|
'volume' => {
|
|
|
|
'size' => Integer,
|
|
|
|
'used' => Float
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
LIST_INSTANCES_FORMAT = {
|
|
|
|
'instances' => [
|
|
|
|
INSTANCE_FORMAT
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
CHECK_ROOT_USER_FORMAT = {
|
|
|
|
'rootEnabled' => Fog::Boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
ENABLE_ROOT_USER_FORMAT = {
|
|
|
|
'user' => {
|
|
|
|
'name' => String,
|
|
|
|
'password' => String
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LIST_DATABASES_FORMAT = {
|
|
|
|
'databases' => [{
|
|
|
|
'name' => String
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
|
|
|
LIST_USERS_FORMAT = {
|
|
|
|
'users' => [{
|
|
|
|
'name' => String,
|
|
|
|
'databases' => [{
|
|
|
|
'name' => String
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
}
|