-
Notifications
You must be signed in to change notification settings - Fork 6
Shashank Sahni edited this page Oct 25, 2013
·
18 revisions
Description for Rest API of v0.1.0 Note: Cluster API has been removed for the time being.
{
job:{
name:"my-job",
jar: s3://mybucket/file_mapred.jar,
args: "class_name arg1 arg2"
deadline: "15/06/2013",
input: "s3://bucket or swift://container",
output: "s3://bucket or swift://container",
master:{
flavor: m1.medium,
},
slaves:[
{
flavor: "m1.large",
instances:2,
},
{
flavor: "m1.small",
instances:1,
}
]
}
}
{
cluster:{
name:"test"
master:{
flavor: "m1.medium"
},
slaves:[
{
flavor: "m1.large",
instances:2,
},
{
flavor: "m1.small",
instances:1,
}
],
image-id: "ubuntu-12.04-amd64.img",
nodes: [
<node_object>,
<node_object>,
<node_object>,
<node_object>
]
}
node: {
id: i-000007e7,
private_ip_address: 172.17.12.11
}
GET /v0.1/clusters
Request
GET http://hs/v0.1/clusters
Accept: application/json
Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: XX
clusters:[{
name:"test"
master:{
flavor: "m1.medium"
instances: 1
}
slaves:[
{
flavor: "m1.large"
instances:2
},
{
flavor: "m1.small"
instances:1
}
]
image-id: "ubuntu-12.04-amd64.img"
},
cluster:{
name:"test2"
master:{
flavor: "m1.medium"
instances: 1
}
slaves:[
{
flavor: "m1.large"
instances:3
},
{
flavor: "m1.small"
instances:2
}
]
image-id: "ubuntu-12.04-amd64.img"
}]
POST /v0.1/clusters
Request
POST http://hs/v0.1/clusters
{
cluster:{
name:"test"
master:{
flavor: "m1.medium"
instances: 1
}
slaves:[
{
flavor: "m1.large"
instances:2
}
]
image-id: "ubuntu-12.04-amd64.img"
}
}
Response
HTTP/1.1 202 Accepted
Content-Type: application/json
Content-Length: XX
{
cluster:{
name:"test",
master:{
flavor: "m1.medium"
instances: 1
},
slaves:[
{
flavor: "m1.large"
instances:2
}
],
image-id: "ubuntu-12.04-amd64.img",
status: "creating"
}
}
Request
Add 2 m1.large instances.
POST http://hs/v0.1/clusters/<cluster_id>/add
{
slaves:[
{
flavor: "m1.large"
instances:2
}
]
}
Response
HTTP/1.1 202 Accepted
Content-Type: application/json
Content-Length: XX
{
cluster:{
id: "abcd123",
name:"test",
master:{
flavor: "m1.medium"
instances: 1
},
slaves:[
{
flavor: "m1.small"
instances:2
},
{
flavor: "m1.large"
instances:2
}
],
image-id: "ubuntu-12.04-amd64.img",
status: "creating"
}
}
Remove one m1.large instance
Request
POST http://hs/v0.1/clusters/<cluster_id>/rm
{
slaves:[
{
flavor: "m1.large"
instances:1
}
]
}
Response
HTTP/1.1 202 Accepted
Content-Type: application/json
Content-Length: XX
{
cluster:{
id: "abcd123",
name:"test",
master:{
flavor: "m1.medium"
instances: 1
},
slaves:[
{
flavor: "m1.small"
instances:2
},
{
flavor: "m1.large"
instances:1
}
],
image-id: "ubuntu-12.04-amd64.img",
status: "creating"
}
}