@Path(value="api/v1beta1")
@Produces(value="application/json")
@Consumes(value="application/json")
public interface Kubernetes
Modifier and Type | Method and Description |
---|---|
String |
createPod(PodSchema entity)
Create a new pod.
|
String |
createReplicationController(ReplicationControllerSchema entity)
Create a new controller.
|
String |
createService(ServiceSchema entity)
Create a new service
|
String |
deletePod(String podId)
Delete a specific pod
|
String |
deleteReplicationController(String controllerId)
Delete a specific controller
|
String |
deleteService(String serviceId)
Delete a specific service
|
PodSchema |
getPod(String podId)
Get a specific pod
|
PodListSchema |
getPods()
List all pods on this cluster
|
ReplicationControllerSchema |
getReplicationController(String controllerId)
Get a specific controller
|
ReplicationControllerListSchema |
getReplicationControllers()
List all replicationControllers on this cluster
|
ServiceSchema |
getService(String serviceId)
Get a specific service
|
ServiceListSchema |
getServices()
List all services on this cluster
|
String |
updatePod(String podId,
PodSchema entity)
Update a pod
|
String |
updateReplicationController(String controllerId,
ReplicationControllerSchema entity)
Update a controller
|
String |
updateService(String serviceId,
ServiceSchema entity)
Update a service
|
@GET @Path(value="pods") PodListSchema getPods()
@POST @Path(value="pods") @Consumes(value="application/json") String createPod(PodSchema entity) throws Exception
entity
- e.g. {
"kind": "Pod",
"apiVersion": "v1beta1",
"id": "php",
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "php",
"containers": [{
"name": "nginx",
"image": "dockerfile/nginx",
"ports": [{
"containerPort": 80,
"hostPort": 8080
}],
"livenessProbe": {
"enabled": true,
"type": "http",
"initialDelaySeconds": 30,
"httpGet": {
"path": "/index.html",
"port": "8080"
}
}
}]
}
},
"labels": {
"name": "foo"
}
}Exception
@GET @Path(value="pods/{podId}") PodSchema getPod(@PathParam(value="podId")@NotNull String podId)
podId
- @PUT @Path(value="pods/{podId}") @Consumes(value="application/json") String updatePod(@PathParam(value="podId")@NotNull String podId, PodSchema entity) throws Exception
entity
- e.g. {
"kind": "Pod",
"apiVersion": "v1beta1",
"id": "php",
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "php",
"containers": [{
"name": "nginx",
"image": "dockerfile/nginx",
"ports": [{
"containerPort": 80,
"hostPort": 8080
}],
"livenessProbe": {
"enabled": true,
"type": "http",
"initialDelaySeconds": 30,
"httpGet": {
"path": "/index.html",
"port": "8080"
}
}
}]
}
},
"labels": {
"name": "foo"
}
}podId
- Exception
@DELETE @Path(value="pods/{podId}") @Consumes(value="text/plain") String deletePod(@PathParam(value="podId")@NotNull String podId) throws Exception
podId
- Exception
@Path(value="services") @GET @Produces(value="application/json") ServiceListSchema getServices()
@Path(value="services") @POST @Consumes(value="application/json") String createService(ServiceSchema entity) throws Exception
entity
- e.g. {
"kind": "Service",
"apiVersion": "v1beta1",
"id": "example",
"port": 8000,
"labels": {
"name": "nginx"
},
"selector": {
"name": "nginx"
}
}Exception
@GET @Path(value="services/{serviceId}") @Produces(value="application/json") ServiceSchema getService(@PathParam(value="serviceId")@NotNull String serviceId)
serviceId
- @PUT @Path(value="services/{serviceId}") @Consumes(value="application/json") String updateService(@PathParam(value="serviceId")@NotNull String serviceId, ServiceSchema entity) throws Exception
serviceId
- entity
- e.g. {
"kind": "Service",
"apiVersion": "v1beta1",
"id": "example",
"port": 8000,
"labels": {
"name": "nginx"
},
"selector": {
"name": "nginx"
}
}Exception
@DELETE @Path(value="services/{serviceId}") @Produces(value="application/json") @Consumes(value="text/plain") String deleteService(@PathParam(value="serviceId")@NotNull String serviceId) throws Exception
serviceId
- Exception
@Path(value="replicationControllers") @GET @Produces(value="application/json") ReplicationControllerListSchema getReplicationControllers()
@Path(value="replicationControllers") @POST @Consumes(value="application/json") String createReplicationController(ReplicationControllerSchema entity) throws Exception
entity
- e.g. {
"id": "nginxController",
"apiVersion": "v1beta1",
"kind": "ReplicationController",
"desiredState": {
"replicas": 2,
"replicaSelector": {"name": "nginx"},
"podTemplate": {
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "nginxController",
"containers": [{
"name": "nginx",
"image": "dockerfile/nginx",
"ports": [{"containerPort": 80, "hostPort": 8080}]
}]
}
},
"labels": {"name": "nginx"}
}},
"labels": {"name": "nginx"}
}Exception
@GET @Path(value="replicationControllers/{controllerId}") @Produces(value="application/json") ReplicationControllerSchema getReplicationController(@PathParam(value="controllerId")@NotNull String controllerId)
controllerId
- @PUT @Path(value="replicationControllers/{controllerId}") @Consumes(value="application/json") String updateReplicationController(@PathParam(value="controllerId")@NotNull String controllerId, ReplicationControllerSchema entity) throws Exception
controllerId
- entity
- e.g. {
"id": "nginxController",
"apiVersion": "v1beta1",
"kind": "ReplicationController",
"desiredState": {
"replicas": 2,
"replicaSelector": {"name": "nginx"},
"podTemplate": {
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "nginxController",
"containers": [{
"name": "nginx",
"image": "dockerfile/nginx",
"ports": [{"containerPort": 80, "hostPort": 8080}]
}]
}
},
"labels": {"name": "nginx"}
}},
"labels": {"name": "nginx"}
}Exception
@DELETE @Path(value="replicationControllers/{controllerId}") @Produces(value="application/json") @Consumes(value="text/plain") String deleteReplicationController(@PathParam(value="controllerId")@NotNull String controllerId) throws Exception
controllerId
- Exception
Copyright © 2011–2014 Red Hat. All rights reserved.