@Path(value="api/v1beta1")
@Produces(value="application/json")
@Consumes(value="application/json")
public interface Kubernetes
| Modifier and Type | Method and Description |
|---|---|
String |
createPod(Pod entity)
Create a new pod.
|
String |
createReplicationController(ReplicationController entity)
Create a new controller.
|
String |
createService(Service 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
|
Endpoints |
endpointsForService(String serviceId,
String namespace)
List all endpoints for a service
|
EndpointsList |
getEndpoints()
List all service endpoints on this cluster
|
MinionList |
getMinions()
List all the minions on this cluster
|
Pod |
getPod(String podId)
Get a specific pod
|
PodList |
getPods()
List all pods on this cluster
|
ReplicationController |
getReplicationController(String controllerId)
Get a specific controller
|
ReplicationControllerList |
getReplicationControllers()
List all replicationControllers on this cluster
|
Service |
getService(String serviceId)
Get a specific service
|
ServiceList |
getServices()
List all services on this cluster
|
Minion |
minion(String minionId)
List all endpoints for a service
|
String |
updatePod(String podId,
Pod entity)
Update a pod
|
String |
updateReplicationController(String controllerId,
ReplicationController entity)
Update a controller
|
String |
updateService(String serviceId,
Service entity)
Update a service
|
@GET @Path(value="pods") PodList getPods()
@POST @Path(value="pods") @Consumes(value="application/json") String createPod(Pod 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}")
Pod 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,
Pod 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") ServiceList getServices()
@Path(value="services") @POST @Consumes(value="application/json") String createService(Service 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")
Service 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,
Service 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") ReplicationControllerList getReplicationControllers()
@Path(value="replicationControllers") @POST @Consumes(value="application/json") String createReplicationController(ReplicationController 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")
ReplicationController 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,
ReplicationController 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@GET @Path(value="endpoints") EndpointsList getEndpoints()
@GET
@Path(value="endpoints/{serviceId}")
Endpoints endpointsForService(@PathParam(value="serviceId")@NotNull
String serviceId,
@QueryParam(value="namespace")
String namespace)
@GET @Path(value="minions") MinionList getMinions()
Copyright © 2011–2015 Red Hat. All rights reserved.