OpenShiftV3 -- Draft API documentation version alpha
http://server/broker/rest
Overview
The 3.x model attempts to expose underlying Docker and Google models as accurately as possible, with a focus on easy composition of applications by a developer (install Ruby, push code, add MySQL). Unlike 2.x, more flexibility of configuration is exposed after creation in all aspects of the model. Terminology is still being weighed, but the concept of an application as a separate object is being removed in favor of more flexible composition of "services" - allowing two web containers to reuse a DB, or expose a DB directly to the edge of the network. The existing API will continue to be supported through 3.x, with concepts mapped as closely as possible to the new model.
/projects
List all projects for your account.
Projects are a similar concept to v2 domains. A project is a grouping of services with shared access control and resource limits. Applications can be assembled from services in a project by linking them together via service endpoints.
Create a new project
get /projects
List all projects for your account.
Projects are a similar concept to v2 domains. A project is a grouping of services with shared access control and resource limits. Applications can be assembled from services in a project by linking them together via service endpoints.
HTTP status code 200
Body
Type: application/json
Example:
{
"data":
[
{
"id": "53c4249f076573c0f4000001",
"suffix": "dev.rhcloud.com",
"name": "mydomain",
"members": [
{
"login": "adminuser",
"role": "admin",
"type": "user",
"owner": true
}
]
},
{
"id": "54c4259f076573c0f4000023",
"suffix": "dev.rhcloud.com",
"name": "appdomain",
"members": [
{
"login": "adminuser",
"role": "admin",
"type": "user",
"owner": true
}
]
}
]
}
post /projects
Create a new project
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"suffix": "dev.rhcloud.com",
"name": "myproject",
"members": [
{
"login": "adminuser",
"role": "admin",
"type": "user",
"owner": true
}
]
}
}
/project/{projectID}
Get a specific project
Update a project
Delete a project
Instantiate a template in the given project
get /project/{projectID}
Get a specific project
URI Parameters
- projectID: required (string)
HTTP status code 200
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"suffix": "dev.rhcloud.com",
"name": "myproject",
"members": [
{
"login": "adminuser",
"role": "admin",
"type": "user",
"owner": true
}
]
}
}
put /project/{projectID}
Update a project
URI Parameters
- projectID: required (string)
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"name": "newproject-name"
}
}
post /project/{projectID}
Instantiate a template in the given project
URI Parameters
- projectID: required (string)
Body
Type: application/json
Example:
{
"templateId": "the-template-id"
}
/imageRepositories
Lists all image repositories.
An image repository is a collection of images that share the same metadata. It may reference a Docker image repository on a Docker registry, but this is optional. An image repository also contains a mapping of tags to images.
Create a new image repository
get /imageRepositories
Lists all image repositories.
An image repository is a collection of images that share the same metadata. It may reference a Docker image repository on a Docker registry, but this is optional. An image repository also contains a mapping of tags to images.
HTTP status code 200
Body
Type: application/json
Example:
{
"apiVersion": "v1beta1",
"creationTimestamp": null,
"items": [
{
"creationTimestamp": "2014-09-10T12:23:01-04:00",
"dockerImageRepository": "localhost:5000/someproject/somerepo",
"id": "somerepo",
"resourceVersion": 17,
"tags": {
"c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b": "c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"latest": "c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b"
}
},
{
"creationTimestamp": "2014-09-10T09:33:42-04:00",
"dockerImageRepository": "openshift/ruby-19-centos",
"id": "test",
"labels": {
"color": "blue"
},
"resourceVersion": 14,
"tags": {
"latest": "120e218dd395ec314e7b6249f39d2853911b3d6def6ea164ae05722649f34b16"
}
}
],
"kind": "ImageRepositoryList",
"resourceVersion": 22
}
post /imageRepositories
Create a new image repository
Body
Type: application/json
Example:
{
"apiVersion": "v1beta1",
"dockerImageRepository": "openshift/ruby-19-centos",
"id": "test",
"kind": "ImageRepository",
"labels": {
"color": "blue"
},
"tags": {
"latest": "120e218dd395ec314e7b6249f39d2853911b3d6def6ea164ae05722649f34b16"
}
}
/imageRepositories/{repositoryID}
Get information about an image repository
Update an image repository
Delete an image repository
get /imageRepositories/{repositoryID}
Get information about an image repository
URI Parameters
- repositoryID: required (string)
Body
Type: application/json
Example:
{
"apiVersion": "v1beta1",
"creationTimestamp": "2014-09-10T09:33:42-04:00",
"dockerImageRepository": "openshift/ruby-19-centos",
"id": "test",
"kind": "ImageRepository",
"labels": {
"color": "blue"
},
"resourceVersion": 14,
"tags": {
"latest": "120e218dd395ec314e7b6249f39d2853911b3d6def6ea164ae05722649f34b16"
}
}
put /imageRepositories/{repositoryID}
Update an image repository
URI Parameters
- repositoryID: required (string)
Body
Type: application/json
Example:
{
"apiVersion": "v1beta1",
"creationTimestamp": "2014-09-10T09:33:42-04:00",
"dockerImageRepository": "openshift/ruby-19-centos",
"id": "test",
"kind": "ImageRepository",
"labels": {
"color": "blue"
},
"resourceVersion": 14,
"tags": {
"latest": "120e218dd395ec314e7b6249f39d2853911b3d6def6ea164ae05722649f34b16"
}
}
/images
Lists all images.
An image is a reference to an image in a Docker image repository on a Docker registry, plus a set of metadata. The metadata that Openshift stores for an image will augment the metadata that has already been specified in the image through its Dockerfile.
Create a new image definition
get /images
Lists all images.
An image is a reference to an image in a Docker image repository on a Docker registry, plus a set of metadata. The metadata that Openshift stores for an image will augment the metadata that has already been specified in the image through its Dockerfile.
HTTP status code 200
Body
Type: application/json
Example:
{
"apiVersion": "v1beta1",
"creationTimestamp": null,
"items": [
{
"creationTimestamp": "2014-09-10T09:33:43-04:00",
"dockerImageReference": "openshift/ruby-19-centos:latest",
"id": "abcd1234",
"metadata": {
"Size": 0,
"containerconfig": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": null,
"CpuShares": 0,
"Dns": null,
"Domainname": "",
"Entrypoint": null,
"Env": null,
"ExposedPorts": null,
"Hostname": "",
"Image": "",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": false,
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "",
"Volumes": null,
"VolumesFrom": "",
"WorkingDir": ""
},
"created": "0001-01-01T00:00:00Z",
"id": ""
},
"resourceVersion": 15
},
{
"creationTimestamp": "2014-09-10T12:23:24-04:00",
"dockerImageReference": "localhost:5000/someproject/somerepo:c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"id": "c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"metadata": {
"Size": 0,
"architecture": "amd64",
"config": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": null,
"CpuShares": 0,
"Dns": null,
"Domainname": "",
"Entrypoint": null,
"Env": null,
"ExposedPorts": null,
"Hostname": "",
"Image": "",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": false,
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "",
"Volumes": null,
"VolumesFrom": "",
"WorkingDir": ""
},
"container": "6b03c2dda0f8cbfa6186d96557e35e35c61915a70e4217a465f92f26c2d9290b",
"containerconfig": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": null,
"CpuShares": 0,
"Dns": null,
"Domainname": "",
"Entrypoint": null,
"Env": null,
"ExposedPorts": null,
"Hostname": "",
"Image": "",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": false,
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "",
"Volumes": null,
"VolumesFrom": "",
"WorkingDir": ""
},
"created": "0001-01-01T00:00:00Z",
"id": "c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"parent": "32730be9f383719ce6308329c8ee5aac189ece9e41928dc10b8bc0fc35e9d1d5"
},
"resourceVersion": 18
}
],
"kind": "ImageList",
"resourceVersion": 22
}
post /images
Create a new image definition
Body
Type: application/json
Example:
{
"apiVersion": "v1beta1",
"dockerImageReference": "localhost:5000/someproject/somerepo:c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"id": "c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"kind": "Image",
"metadata": {
"Size": 0,
"architecture": "amd64",
"config": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": null,
"CpuShares": 0,
"Dns": null,
"Domainname": "",
"Entrypoint": null,
"Env": null,
"ExposedPorts": null,
"Hostname": "",
"Image": "",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": false,
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "",
"Volumes": null,
"VolumesFrom": "",
"WorkingDir": ""
},
"container": "6b03c2dda0f8cbfa6186d96557e35e35c61915a70e4217a465f92f26c2d9290b",
"containerconfig": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": null,
"CpuShares": 0,
"Dns": null,
"Domainname": "",
"Entrypoint": null,
"Env": null,
"ExposedPorts": null,
"Hostname": "",
"Image": "",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": false,
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "",
"Volumes": null,
"VolumesFrom": "",
"WorkingDir": ""
},
"created": "0001-01-01T00:00:00Z",
"id": "c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"parent": "32730be9f383719ce6308329c8ee5aac189ece9e41928dc10b8bc0fc35e9d1d5"
},
}
/images/{imageID}
Get image definition
Delete an image
get /images/{imageID}
Get image definition
URI Parameters
- imageID: required (string)
Body
Type: application/json
Example:
{
"apiVersion": "v1beta1",
"creationTimestamp": "2014-09-10T12:23:24-04:00",
"dockerImageReference": "localhost:5000/someproject/somerepo:c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"id": "c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"kind": "Image",
"metadata": {
"Size": 0,
"architecture": "amd64",
"config": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": null,
"CpuShares": 0,
"Dns": null,
"Domainname": "",
"Entrypoint": null,
"Env": null,
"ExposedPorts": null,
"Hostname": "",
"Image": "",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": false,
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "",
"Volumes": null,
"VolumesFrom": "",
"WorkingDir": ""
},
"container": "6b03c2dda0f8cbfa6186d96557e35e35c61915a70e4217a465f92f26c2d9290b",
"containerconfig": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": null,
"CpuShares": 0,
"Dns": null,
"Domainname": "",
"Entrypoint": null,
"Env": null,
"ExposedPorts": null,
"Hostname": "",
"Image": "",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": false,
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "",
"Volumes": null,
"VolumesFrom": "",
"WorkingDir": ""
},
"created": "0001-01-01T00:00:00Z",
"id": "c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"parent": "32730be9f383719ce6308329c8ee5aac189ece9e41928dc10b8bc0fc35e9d1d5"
},
"resourceVersion": 18
}
/imageRepositoryMappings
Creates an image and updates an image repository.
This is designed as a webhook that a Docker registry can invoke when a new tag is created. The image repository mapping contains a reference to the repository, the image's metadata, and the name of the new tag. Upon execution, a new image is created if it doesn't already exist, and the image repository is updated with the new tag.
post /imageRepositoryMappings
Creates an image and updates an image repository.
This is designed as a webhook that a Docker registry can invoke when a new tag is created. The image repository mapping contains a reference to the repository, the image's metadata, and the name of the new tag. Upon execution, a new image is created if it doesn't already exist, and the image repository is updated with the new tag.
Body
Type: application/json
Example:
{
"dockerImageRepository": "localhost:5000/someproject/somerepo",
"image": {
"dockerImageReference": "localhost:5000/someproject/somerepo:c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"id": "c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"metadata": {
"Size": 0,
"architecture": "amd64",
"config": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": [
"/bin/sh"
],
"CpuShares": 0,
"Cpuset": "",
"Domainname": "",
"Entrypoint": null,
"Env": [
"c=e",
"b=2",
"a=1",
"HOME=/",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"ExposedPorts": null,
"Hostname": "",
"Image": "",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": false,
"OnBuild": null,
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "",
"Volumes": null,
"WorkingDir": ""
},
"container": "6b03c2dda0f8cbfa6186d96557e35e35c61915a70e4217a465f92f26c2d9290b",
"container_config": {
"AttachStderr": true,
"AttachStdin": false,
"AttachStdout": true,
"Cmd": [
"/bin/sh"
],
"CpuShares": 0,
"Cpuset": "",
"Domainname": "",
"Entrypoint": null,
"Env": [
"c=e",
"b=2",
"a=1",
"HOME=/",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"ExposedPorts": null,
"Hostname": "6b03c2dda0f8",
"Image": "localhost:5000/someproject/somerepo",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": false,
"OnBuild": null,
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "",
"Volumes": null,
"WorkingDir": ""
},
"created": "2014-09-04T17:43:39.863545902Z",
"docker_version": "1.1.2",
"id": "c115fca463efa744a5492ca580ef24b20ed5ef2155c624cc5b1262aefc14797b",
"os": "linux",
"parent": "32730be9f383719ce6308329c8ee5aac189ece9e41928dc10b8bc0fc35e9d1d5"
}
},
"kind": "ImageRepositoryMapping",
"tag": "latest",
"version": "v1beta1"
}
/services
Lists all services that your account has access to
Services can be public or owned by a project. They contain a template of a pod and reference image repositories that supply the images for those templates. A service may be configured to react to an image being pushed to an image repository by initiating a deployment. Deployments are associated with a service and make use of Kubernetes replication controllers to manage pods in a cluster. For deployments, a service contains a policy that constrains how deployments can occur. For example, it may require that there exist at least 2 operational pods at all times. A deployment needs to operate under those constraints when making changes.
Create a new service
get /services
Lists all services that your account has access to
Services can be public or owned by a project. They contain a template of a pod and reference image repositories that supply the images for those templates. A service may be configured to react to an image being pushed to an image repository by initiating a deployment. Deployments are associated with a service and make use of Kubernetes replication controllers to manage pods in a cluster. For deployments, a service contains a policy that constrains how deployments can occur. For example, it may require that there exist at least 2 operational pods at all times. A deployment needs to operate under those constraints when making changes.
Query Parameters
- projectId: (string)
filter the services owned by a particular project
HTTP status code 200
Body
Type: application/json
Example:
{
"list":
[
{
"id": "53c4249f076573c0f4000001",
"name": "service-name",
"domain": "domain-id",
"desiredState":
{
"replicas": 3,
"replicaSelector": { "name": "service-name" },
"replicaPolicy": {
"atLeast": 2
},
"activeDeployment": "a_deployment_id",
"podTemplate":
{
"desiredState":
{
"image": "server/domain/name",
"network-ports": [
{
"hostPort": 8080,
"containerPort": 80
}
],
"owner": true
},
"labels": {
"name": "service-name"
}
}
}
]
}
}
post /services
Create a new service
Body
Type: application/json
Example:
{
"data":
{
"name": "service-name",
"desiredState":
{
"replicas": 3,
"replicaPolicy": {
"atLeast": 2
},
"podTemplate":
{
"desiredState":
{
"image": "server/domain/name",
"network-ports": [
{
"hostPort": 8080,
"containerPort": 80
}
]
}
}
}
}
}
/service/{serviceID}
Get a specific service definition
Update a service
Delete a service
get /service/{serviceID}
Get a specific service definition
URI Parameters
- serviceID: required (string)
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"name": "service-name",
"domain": "domain-id",
"desiredState":
{
"replicas": 3,
"replicaSelector": { "name": "service-name" },
"replicaPolicy": {
"atLeast": 2
},
"activeDeployment": "a_deployment_id",
"podTemplate":
{
"desiredState":
{
"image": "server/domain/name",
"network-ports": [
{
"hostPort": 8080,
"containerPort": 80
}
],
"owner": true
},
"labels": {
"name": "service-name"
}
}
}
}
}
put /service/{serviceID}
Update a service
URI Parameters
- serviceID: required (string)
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"name": "service-name",
"domain": "domain-id",
"desiredState":
{
"replicas": 3,
"replicaSelector": { "name": "service-name" },
"replicaPolicy": {
"atLeast": 2
},
"activeDeployment": "a_deployment_id",
"podTemplate":
{
"desiredState":
{
"image": "server/domain/name",
"network-ports": [
{
"hostPort": 8080,
"containerPort": 80
}
],
"owner": true
},
"labels": {
"name": "service-name"
}
}
}
}
}
Environment variables associated with this service
Create/update environment variables
post /service/{serviceID}/environment-variables
Create/update environment variables
URI Parameters
- serviceID: required (string)
Body
Type: application/json
Example:
{
"data":
[
{ "name": "var1", "value": "value1" },
{ "name": "var2", "value": "value2" }
]
}
Get environment variable
Update an environment variable's value
Delete an environment variable
get /service/{serviceID}/environment-variables/{variableName}
Get environment variable
URI Parameters
- serviceID: required (string)
- variableName: required (string)
Body
Type: application/json
Example:
{
"data": { "name": "var1", "value": "value1" }
}
put /service/{serviceID}/environment-variables/{variableName}
Update an environment variable's value
URI Parameters
- serviceID: required (string)
- variableName: required (string)
Body
Type: application/json
Example:
{
"data": { "name": "var1", "value": "value1" }
}
delete /service/{serviceID}/environment-variables/{variableName}
/deployments
Lists active deployments in the current project
Deployments effect change in a service such as scaling up, down, updating the current image, etc. Deployments may use different policies for carrying out the change. For example, a rolling update with a single pod change at a time, or a batch update, etc. Deployments make use of Kubernetes replicationControllers to bring about the changes.
Create a new deployment
get /deployments
Lists active deployments in the current project
Deployments effect change in a service such as scaling up, down, updating the current image, etc. Deployments may use different policies for carrying out the change. For example, a rolling update with a single pod change at a time, or a batch update, etc. Deployments make use of Kubernetes replicationControllers to bring about the changes.
HTTP status code 200
Body
Type: application/json
Example:
{
"list": [
{
"id": "1234235172374",
"serviceId": "the-service-id",
"replicationControllers": [
"replication-controller-id1",
"replication-controller-id2",
"replication-controller-id3"
],
"currentState": {
"replicas": 1,
"replicaSelector": {
"name": "nginx"
},
"containers": [{
"image": "dockerfile/nginx",
"ports": [{"containerPort": 80, "hostPort": 8080}]
}],
},
"desiredState": {
"replicas": 2,
"replicaSelector": {
"name": "nginx"
},
"containers": [{
"image": "dockerfile/nginx/v2tag",
"ports": [{"containerPort": 80, "hostPort": 8080}]
}],
},
"status": "active"
}
]
}
post /deployments
Create a new deployment
Body
Type: application/json
Example:
{
"object": {
"id": "1234235172374",
"serviceId": "the-service-id",
"desiredState": {
"replicas": 2,
"replicaSelector": {
"name": "nginx"
},
"containers": [{
"image": "dockerfile/nginx/v2tag",
"ports": [{"containerPort": 80, "hostPort": 8080}]
}]
}
}
}
/deployment/{deploymentID}
Get deployment details
get /deployment/{deploymentID}
Get deployment details
URI Parameters
- deploymentID: required (string)
Body
Type: application/json
Example:
{
"object": {
"id": "1234235172374",
"serviceId": "the-service-id",
"replicationControllers": [
"replication-controller-id1",
"replication-controller-id2",
"replication-controller-id3"
],
"currentState": {
"replicas": 1,
"replicaSelector": {
"name": "nginx"
},
"containers": [{
"image": "dockerfile/nginx",
"ports": [{"containerPort": 80, "hostPort": 8080}]
}],
},
"desiredState": {
"replicas": 2,
"replicaSelector": {
"name": "nginx"
},
"containers": [{
"image": "dockerfile/nginx/v2tag",
"ports": [{"containerPort": 80, "hostPort": 8080}]
}],
},
"status": "active"
}
}
/links
List of links between services in your account
Unlike a Docker link, a Link in OpenShift defines a relationship between services which may be composed by multiple Docker images. A link may include additional metadata about the relationship such as the algorithm to use to distribute requests.
Create a new link between this service and a different service
get /links
List of links between services in your account
Unlike a Docker link, a Link in OpenShift defines a relationship between services which may be composed by multiple Docker images. A link may include additional metadata about the relationship such as the algorithm to use to distribute requests.
Query Parameters
- projectId: (string)
filter the links owned by a particular project
- serviceId: (string)
filter the links attached to a particular service
HTTP status code 200
Body
Type: application/json
Example:
{
"list":
[
{
"id": "53c4249f076573c0f4000001",
"projectId": "myproject-1234123132",
"source": {
"serviceId": "nginx-1893747912737"
},
"destination": {
"serviceId": "ruby1.9-1237471273",
"port": 8080
}
"policy": "round-robin"
}
]
}
post /links
Create a new link between this service and a different service
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"projectId": "myproject-1234123132",
"source": {
"serviceId": "nginx-1893747912737"
},
"destination": {
"serviceId": "ruby1.9-1237471273",
"port": 8080
}
"policy": "round-robin"
}
}
/link/{linkID}
Get link details
Update a link
Delete a link
get /link/{linkID}
Get link details
URI Parameters
- linkID: required (string)
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"projectId": "myproject-1234123132",
"source": {
"serviceId": "nginx-1893747912737"
},
"destination": {
"serviceId": "ruby1.9-1237471273",
"port": 8080
}
"policy": "round-robin"
}
}
put /link/{linkID}
Update a link
URI Parameters
- linkID: required (string)
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"projectId": "myproject-1234123132",
"source": {
"serviceId": "nginx-1893747912737"
},
"destination": {
"serviceId": "ruby1.9-1237471273",
"port": 8080
}
"policy": "round-robin"
}
}
/aliases
List all aliases visible to you
Aliases in v3 perform the same function as aliases in v2. The main difference is that in v3 an alias is associated with a service, not an application.
Create an alias for this service
get /aliases
List all aliases visible to you
Aliases in v3 perform the same function as aliases in v2. The main difference is that in v3 an alias is associated with a service, not an application.
Query Parameters
- serviceId: (string)
filter aliases by associated service
HTTP status code 200
Body
Type: application/json
Example:
{
"list":
[
{
"id": "myalias",
"ssl_certificate": "-----BEGIN CERTIFICATE-----\nMIIDoDCCAogCCQDzF8AJCHnrbjANBgkqhkiG9w0BAQUFADCBkTELMAkGA1UEBhMC\nVVMxCzAJBgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxDzANBgNVBAoMBnJl\nZGhhdDESMBAGA1UECwwJb3BlbnNoaWZ0MRIwEAYDVQQDDAlvcGVuc2hpZnQxKDAm\nBgkqhkiG9w0BCQEWGWluZm9Ab3BlbnNoaWZ0LnJlZGhhdC5jb20wHhcNMTMwMjE5\nMjExMTQ4WhcNMTQwMjE5MjExMTQ4WjCBkTELMAkGA1UEBhMCVVMxCzAJBgNVBAgM\nAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxDzANBgNVBAoMBnJlZGhhdDESMBAGA1UE\nCwwJb3BlbnNoaWZ0MRIwEAYDVQQDDAlvcGVuc2hpZnQxKDAmBgkqhkiG9w0BCQEW\nGWluZm9Ab3BlbnNoaWZ0LnJlZGhhdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB\nDwAwggEKAoIBAQDAEbH4MCi3iIDP1HS+/Xwu8SjdSc5WJX6htV7hJpmFZ8HohV/8\nba0v6aM9IJIIt+sIe2J62t/9G3leOdIHBxeACN4fV2l/iA/fvxvlnFKeD7sHm9Oc\nYj1H6YYJ57sIOf/oLDpJl6l3Rw8VC3+3W0/lzlVpA8qt7fpkiW7XQJCPplUSrdVC\n3okQ2T5NAod5+wVIOqELgE5bLX1LRs5VPsjytHkJ7rKXs55FHR3kpsoImn5xD0Ky\n6lRn8cIMolQoyN5HIGr8f5P+07hrHibve8jje/DKTssb5yEUAEmh6iGHQsRAnsUW\nQoIEUOLqQCu9re2No4G52Kl2xQIjyJF7rCfxAgMBAAEwDQYJKoZIhvcNAQEFBQAD\nggEBAGHrya/ZkiAje2kHsOajXMlO2+y1iLfUDcRLuEWpUa8sI5EM4YtemQrsupFp\n8lVYG5C4Vh8476oF9t8Wex5eH3ocwbSvPIUqE07hdmrubiMq4wxFVRYq7g9lHAnx\nl+bABuN/orbAcPcGAGg7AkXVoAc3Fza/ZcgMcw7NOtDTEss70V9OdgCfQUJL0KdO\nhCO8bQ1EaEiq6zEh8RpZe8mu+f/GYATX1I+eJUc6F6cn83oJjE9bqAVzk7TzTHeK\nEBKN50C14wWtXeG7n2+ugaVO+0xnvHeUrQBLHSRyOHqxXrQQ5XmzcaBiyI0f2IQM\nHst1BVXyX0n/L/ZoYYsv5juJmDo=\n-----END CERTIFICATE-----",
"private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEAwBGx+DAot4iAz9R0vv18LvEo3UnOViV+obVe4SaZhWfB6IVf\n/G2tL+mjPSCSCLfrCHtietrf/Rt5XjnSBwcXgAjeH1dpf4gP378b5ZxSng+7B5vT\nnGI9R+mGCee7CDn/6Cw6SZepd0cPFQt/t1tP5c5VaQPKre36ZIlu10CQj6ZVEq3V\nQt6JENk+TQKHefsFSDqhC4BOWy19S0bOVT7I8rR5Ce6yl7OeRR0d5KbKCJp+cQ9C\nsupUZ/HCDKJUKMjeRyBq/H+T/tO4ax4m73vI43vwyk7LG+chFABJoeohh0LEQJ7F\nFkKCBFDi6kArva3tjaOBudipdsUCI8iRe6wn8QIDAQABAoIBAG/on4JVRRQSw8LU\nLiWt+jI7ryyoOUH2XL8JtzuGSwLwvomlVJT2rmbxQXx3Qr8zsgziHzIn30RRQrkF\nBXu0xRuDjzBBtSVqeJ1Mc4uoNncEAVxgjb5bewswZDnXPCGB8bosMtX4OPRXgdEo\nPwTtfjMOsrMaU3hd5Xu4m81tQA2BvwOlx8aYDyH0jeTnervc5uRGbeTBQG4Bu40E\nrWNmXvgNq2EzTAwbbN6Ma97gw9KgXnM4Nlh29Fxb5TBeUU9lkzuTZAZIDXKIm7AG\nUwMbj/A038yAumYQtThTE/3e4W3rn7F2Vko900bC4aAC1KQOAzjIeQqzqkVxWTWq\n4SUFQAECgYEA/ODwifOTuI6hdZK6JRgc4wp6Rc0fkqHuxLzABXoIGuSVlWyimqIN\nZySAkpo5EW6DNraRJxNCOBmWeGPEhHGrea+JPiPEwCK0F7SxvSmg3jzNzw3Es31T\necET7eDwuSOY9v4XDzLyiXXkEUUReD7Ng2hEYL+HaQrl5jWj4lxgq/ECgYEAwnCb\nKrz7FwX8AqtFAEi6uUrc12k1xYKQfrwSxbfdK2vBBUpgB71Iq/fqP+1BittEljDG\n8f4jEtMBFfEPhLzGIHaI3UiHUHXS4GetA77TRgR8lnKKpj1FcMIY2iKU479707O5\nQ08pgWRUDQ8BVg2ePgbo5QjLMc/rv7UF3AHvPAECgYB/auAIwqDGN6gHU/1TP4ke\npWLi1O55tfpXSzv+BnUbB96PQgPUop7aP7xBIlBrBiI7aVZOOBf/qHT3CF421geu\n8tHWa7NxlIrl/vgn9lfGYyDYmXlpb1amXLEsBVGGF/e1TGZWFDe9J5fZU9HvosVu\n1xTNIvSZ6xHYI2MGZcGYIQKBgEYeebaV5C7PV6xWu1F46O19U9rS9DM//H/XryVi\nQv4vo7IWuj7QQe7SPsXC98ntfPR0rqoCLf/R3ChfgGsr8H8wf/bc+v9HHj8S5E/f\ndy1e3Nccg2ej3PDm7jNsGSlwmmUkAQGHAL7KwYzcBm1UB+bycvZ1j2FtS+UckPpg\nMDgBAoGALD8PkxHb4U4DtbNFSYRrUdvS9heav/yph3lTMfifNkOir36io6v8RPgb\nD2bHKKZgmYlTgJrxD45Er9agC5jclJO35QRU/OfGf3GcnABkBI7vlvUKADAo65Sq\nweZkdJnbrIadcvLOHOzkKC9m+rxFTC9VoN1dwK2zwYvUXfa1VJA=\n-----END RSA PRIVATE KEY-----",
"pass_phrase": "abcd"
}
]
}
post /aliases
Create an alias for this service
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"suffix": "dev.rhcloud.com",
"name": "mydomain",
"members": [
{
"login": "adminuser",
"role": "admin",
"type": "user",
"owner": true
}
]
}
}
/alias/{aliasID}
Get alias
Update an alias
Delete an alias
get /alias/{aliasID}
Get alias
URI Parameters
- aliasID: required (string)
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"suffix": "dev.rhcloud.com",
"name": "mydomain",
"members": [
{
"login": "adminuser",
"role": "admin",
"type": "user",
"owner": true
}
]
}
}
put /alias/{aliasID}
Update an alias
URI Parameters
- aliasID: required (string)
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"suffix": "dev.rhcloud.com",
"name": "mydomain",
"members": [
{
"login": "adminuser",
"role": "admin",
"type": "user",
"owner": true
}
]
}
}
/builds
Retrieves a list of builds visible to you
A build is associated with an image repository and can be triggered by a webhook on Github. It can either be a Docker build or a source build based on a specified image. When a build completes, it posts a new image to the image repository that it's associated with.
Create a new build
get /builds
Retrieves a list of builds visible to you
A build is associated with an image repository and can be triggered by a webhook on Github. It can either be a Docker build or a source build based on a specified image. When a build completes, it posts a new image to the image repository that it's associated with.
HTTP status code 200
Body
Type: application/json
Example:
{
"list":
[
{
"id": "53c4249f076573c0f4000002",
"imageStream": "server/name",
"type": "source-build",
"repository": "openshift/myapp"
"builderImageStream": "myserver/builderimage"
}
]
}
post /builds
Create a new build
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"imageStream": "server/name",
"type": "docker-build",
"repository": "openshift/dockerrepo"
}
}
/build/{buildId}
Retrieve a single build definition
Update a build definition
Delete a build definition
Launch a build
get /build/{buildId}
put /build/{buildId}
Update a build definition
URI Parameters
- buildId: required (string)
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"imageStream": "server/name",
"type": "docker-build",
"repository": "openshift/dockerrepo"
}
}
post /build/{buildId}
Launch a build
URI Parameters
- buildId: required (string)
Body
Type: application/json
Example:
{
"data":
{
"archiveUrl": "http://url/to/my/archive"
}
}
Retrieves list of build results
get /build/{buildId}/results
Retrieves list of build results
URI Parameters
- buildId: required (string)
HTTP status code 200
Body
Type: application/json
Example:
{
"list":
[
{
"id": "53c4249f076573c0f4000001",
"startTime": "2014-07-15T03:58:40Z",
"endTime": "2014-07-15T03:59:40Z",
"result": "SUCCESS",
"logs": "http://url/to/build/logs"
},
{
"id": "53c4249f076573c0f4000002",
"startTime": "2014-07-15T04:58:40Z",
"endTime": "2014-07-15T04:59:40Z",
"result": "FAILURE",
"logs": "http://url/to/build/logs"
}
]
}
/buildConfigHooks/{buildId}/{secret}/{plugin}
Webhook on push event from external repository
buildId specifies which build to trigger, whereas plugin defines source of the request, this might be github, bitbucket or others.
post /buildConfigHooks/{buildId}/{secret}/{plugin}
Webhook on push event from external repository
buildId specifies which build to trigger, whereas plugin defines source of the request, this might be github, bitbucket or others.
URI Parameters
- buildId: required (string)
- secret: required (string)
- plugin: required (string)
HTTP status code 204
No content
/templates
Lists all templates that your account has access to
A template defines 0..n services and 0..m links. When it is applied to an existing project, those services and links are instantiated for that project.
Create a new template
get /templates
Lists all templates that your account has access to
A template defines 0..n services and 0..m links. When it is applied to an existing project, those services and links are instantiated for that project.
HTTP status code 200
Body
Type: application/json
Example:
{
"list":
[
{
"services": [
{
"name": "service-name",
"domain": "domain-id",
"desiredState":
{
"replicas": 3,
"replicaSelector": { "name": "service-name" },
"replicaPolicy": {
"atLeast": 2
},
"activeDeployment": "a_deployment_id",
"podTemplate":
{
"desiredState":
{
"image": "server/domain/name",
"network-ports": [
{
"hostPort": 8080,
"containerPort": 80
}
],
"owner": true
},
"labels": {
"name": "service-name"
}
}
}
}
],
"links": [
{
"id": "53c4249f076573c0f4000001",
"projectId": "myproject-1234123132",
"source": {
"serviceId": "nginx-1893747912737"
},
"destination": {
"serviceId": "ruby1.9-1237471273",
"port": 8080
}
"policy": "round-robin"
}
]
}
]
}
post /templates
Create a new template
Body
Type: application/json
Example:
{
"data":
{
"services": [
{
"name": "service-name",
"domain": "domain-id",
"desiredState":
{
"replicas": 3,
"replicaSelector": { "name": "service-name" },
"replicaPolicy": {
"atLeast": 2
},
"activeDeployment": "a_deployment_id",
"podTemplate":
{
"desiredState":
{
"image": "server/domain/name",
"network-ports": [
{
"hostPort": 8080,
"containerPort": 80
}
],
"owner": true
},
"labels": {
"name": "service-name"
}
}
}
}
],
"links": [
{
"id": "53c4249f076573c0f4000001",
"projectId": "myproject-1234123132",
"source": {
"serviceId": "nginx-1893747912737"
},
"destination": {
"serviceId": "ruby1.9-1237471273",
"port": 8080
}
"policy": "round-robin"
}
]
}
}
/template/{templateID}
Get a specific template
Update a template
Delete a template
get /template/{templateID}
Get a specific template
URI Parameters
- templateID: required (string)
Body
Type: application/json
Example:
{
"data":
{
"services": [
{
"name": "service-name",
"domain": "domain-id",
"desiredState":
{
"replicas": 3,
"replicaSelector": { "name": "service-name" },
"replicaPolicy": {
"atLeast": 2
},
"activeDeployment": "a_deployment_id",
"podTemplate":
{
"desiredState":
{
"image": "server/domain/name",
"network-ports": [
{
"hostPort": 8080,
"containerPort": 80
}
],
"owner": true
},
"labels": {
"name": "service-name"
}
}
}
}
],
"links": [
{
"id": "53c4249f076573c0f4000001",
"projectId": "myproject-1234123132",
"source": {
"serviceId": "nginx-1893747912737"
},
"destination": {
"serviceId": "ruby1.9-1237471273",
"port": 8080
}
"policy": "round-robin"
}
]
}
}
put /template/{templateID}
Update a template
URI Parameters
- templateID: required (string)
Body
Type: application/json
Example:
{
"data":
{
"services": [
{
"name": "service-name",
"domain": "domain-id",
"desiredState":
{
"replicas": 3,
"replicaSelector": { "name": "service-name" },
"replicaPolicy": {
"atLeast": 2
},
"activeDeployment": "a_deployment_id",
"podTemplate":
{
"desiredState":
{
"image": "server/domain/name",
"network-ports": [
{
"hostPort": 8080,
"containerPort": 80
}
],
"owner": true
},
"labels": {
"name": "service-name"
}
}
}
}
],
"links": [
{
"id": "53c4249f076573c0f4000001",
"projectId": "myproject-1234123132",
"source": {
"serviceId": "nginx-1893747912737"
},
"destination": {
"serviceId": "ruby1.9-1237471273",
"port": 8080
}
"policy": "round-robin"
}
]
}
}
/pods
List all pods on this cluster
Create a new pod. currentState is ignored if present.
get /pods
List all pods on this cluster
HTTP status code 200
Body
Type: application/json
Example:
{
"items": [
{
"id": "my-pod-1",
"labels": {
"name": "testRun",
"replicationController": "testRun"
},
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "my-pod-1",
"containers": [{
"image": "dockerfile/nginx",
"ports": [{
"hostPort": 8080,
"containerPort": 80
}]
}
}
},
"currentState": {
"host": "host-1"
}
},
{
"id": "my-pod-2",
"labels": {
"name": "testRun",
"replicationController": "testRun"
},
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "my-pod-2",
"containers": [{
"image": "dockerfile/nginx",
"ports": [{
"hostPort": 8080,
"containerPort": 80
}]
}
}
},
"currentState": {
"host": "host-2"
}
}
]
}
post /pods
Create a new pod. currentState is ignored if present.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-03/schema",
"type": "object",
"required": false,
"description": "Pod resource. A pod corresponds to a co-located group of [Docker containers](http://docker.io).",
"properties": {
"kind": {
"type": "string",
"required": false
},
"id": {
"type": "string",
"required": false
},
"creationTimestamp": {
"type": "string",
"required": false
},
"selfLink": {
"type": "string",
"required": false
},
"desiredState": {
"type": "object",
"required": false,
"description": "The desired configuration of the pod",
"properties": {
"manifest": {
"type": "object",
"required": false,
"description": "Manifest describing group of [Docker containers](http://docker.io); compatible with format used by [Google Cloud Platform's container-vm images](https://developers.google.com/compute/docs/containers)"
},
"status": {
"type": "string",
"required": false,
"description": ""
},
"host": {
"type": "string",
"required": false,
"description": ""
},
"hostIP": {
"type": "string",
"required": false,
"description": ""
},
"info": {
"type": "object",
"required": false,
"description": ""
}
}
},
"currentState": {
"type": "object",
"required": false,
"description": "The current configuration and status of the pod. Fields in common with desiredState have the same meaning.",
"properties": {
"manifest": {
"type": "object",
"required": false
},
"status": {
"type": "string",
"required": false
},
"host": {
"type": "string",
"required": false
},
"hostIP": {
"type": "string",
"required": false
},
"info": {
"type": "object",
"required": false
}
}
},
"labels": {
"type": "object",
"required": false
}
}
}
Example:
{
"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"
}
}
Get a specific pod
Update a pod
Delete a specific pod
get /pods/{podId}
Get a specific pod
URI Parameters
- podId: required (string)
HTTP status code 200
Body
Type: application/json
Example:
{
"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"
}
}
put /pods/{podId}
Update a pod
URI Parameters
- podId: required (string)
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-03/schema",
"type": "object",
"required": false,
"description": "Pod resource. A pod corresponds to a co-located group of [Docker containers](http://docker.io).",
"properties": {
"kind": {
"type": "string",
"required": false
},
"id": {
"type": "string",
"required": false
},
"creationTimestamp": {
"type": "string",
"required": false
},
"selfLink": {
"type": "string",
"required": false
},
"desiredState": {
"type": "object",
"required": false,
"description": "The desired configuration of the pod",
"properties": {
"manifest": {
"type": "object",
"required": false,
"description": "Manifest describing group of [Docker containers](http://docker.io); compatible with format used by [Google Cloud Platform's container-vm images](https://developers.google.com/compute/docs/containers)"
},
"status": {
"type": "string",
"required": false,
"description": ""
},
"host": {
"type": "string",
"required": false,
"description": ""
},
"hostIP": {
"type": "string",
"required": false,
"description": ""
},
"info": {
"type": "object",
"required": false,
"description": ""
}
}
},
"currentState": {
"type": "object",
"required": false,
"description": "The current configuration and status of the pod. Fields in common with desiredState have the same meaning.",
"properties": {
"manifest": {
"type": "object",
"required": false
},
"status": {
"type": "string",
"required": false
},
"host": {
"type": "string",
"required": false
},
"hostIP": {
"type": "string",
"required": false
},
"info": {
"type": "object",
"required": false
}
}
},
"labels": {
"type": "object",
"required": false
}
}
}
Example:
{
"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"
}
}
/replicationControllers
List all replicationControllers on this cluster
Create a new controller. currentState is ignored if present.
get /replicationControllers
List all replicationControllers on this cluster
HTTP status code 200
Body
Type: application/json
Example:
{
"items": [
{
"id": "testRun",
"desiredState": {
"replicas": 2,
"replicaSelector": {
"name": "testRun"
},
"podTemplate": {
"desiredState": {
"image": "dockerfile/nginx",
"networkPorts": [
{
"hostPort": 8080,
"containerPort": 80
}
]
},
"labels": {
"name": "testRun"
}
}
},
"labels": {
"name": "testRun"
}
}
]
}post /replicationControllers
Create a new controller. currentState is ignored if present.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-03/schema",
"type": "object",
"required": false,
"description": "A replicationController resource. A replicationController helps to create and manage a set of pods. It acts as a factory to create new pods based on a template. It ensures that there are a specific number of pods running. If fewer pods are running than `replicas` then the needed pods are generated using `podTemplate`. If more pods are running than `replicas`, then excess pods are deleted.",
"properties": {
"kind": {
"type": "string",
"required": false
},
"id": {
"type": "string",
"required": false
},
"creationTimestamp": {
"type": "string",
"required": false
},
"selfLink": {
"type": "string",
"required": false
},
"desiredState": {
"type": "object",
"required": false,
"description": "The desired configuration of the replicationController",
"properties": {
"replicas": {
"type": "number",
"required": false,
"description": "Number of pods desired in the set"
},
"replicaSelector": {
"type": "object",
"required": false,
"description": "Required labels used to identify pods in the set"
},
"podTemplate": {
"type": "object",
"required": false,
"description": "Template from which to create new pods, as necessary. Identical to pod schema."
}
}
},
"labels": {
"type": "object",
"required": false
}
}
}
Example:
{
"id": "nginxController",
"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"}
}
Get a specific controller
Update a controller
Delete a specific controller
get /replicationControllers/{controllerId}
Get a specific controller
URI Parameters
- controllerId: required (string)
HTTP status code 200
Body
Type: application/json
Example:
{
"id": "nginxController",
"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"}
}
put /replicationControllers/{controllerId}
Update a controller
URI Parameters
- controllerId: required (string)
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-03/schema",
"type": "object",
"required": false,
"description": "A replicationController resource. A replicationController helps to create and manage a set of pods. It acts as a factory to create new pods based on a template. It ensures that there are a specific number of pods running. If fewer pods are running than `replicas` then the needed pods are generated using `podTemplate`. If more pods are running than `replicas`, then excess pods are deleted.",
"properties": {
"kind": {
"type": "string",
"required": false
},
"id": {
"type": "string",
"required": false
},
"creationTimestamp": {
"type": "string",
"required": false
},
"selfLink": {
"type": "string",
"required": false
},
"desiredState": {
"type": "object",
"required": false,
"description": "The desired configuration of the replicationController",
"properties": {
"replicas": {
"type": "number",
"required": false,
"description": "Number of pods desired in the set"
},
"replicaSelector": {
"type": "object",
"required": false,
"description": "Required labels used to identify pods in the set"
},
"podTemplate": {
"type": "object",
"required": false,
"description": "Template from which to create new pods, as necessary. Identical to pod schema."
}
}
},
"labels": {
"type": "object",
"required": false
}
}
}
Example:
{
"id": "nginxController",
"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"}
}
/lbservices
List all services on this cluster
Create a new service
get /lbservices
List all services on this cluster
HTTP status code 200
Body
Type: application/json
Example:
{
"items": [
{
"id": "example1",
"port": 8000,
"labels": {
"name": "nginx"
}
"selector": {
"name": "nginx"
}
},
{
"id": "example2",
"port": 8080,
"labels": {
"env": "prod",
"name": "jetty"
}
"selector": {
"env": "prod",
"name": "jetty"
}
}
]
}
post /lbservices
Create a new service
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-03/schema",
"type": "object",
"required": false,
"description": "A service resource.",
"properties": {
"kind": {
"type": "string",
"required": false
},
"id": {
"type": "string",
"required": false
},
"creationTimestamp": {
"type": "string",
"required": false
},
"selfLink": {
"type": "string",
"required": false
},
"name": {
"type": "string",
"required": false
},
"port": {
"type": "number",
"required": false
},
"labels": {
"type": "object",
"required": false
},
"selector": {
"type": "object",
"required": false
}
}
}
Example:
{
"id": "example",
"port": 8000,
"labels": {
"name": "nginx"
},
"selector": {
"name": "nginx"
}
}
Get a specific service
Update a service
Delete a specific service
get /lbservices/{serviceId}
Get a specific service
URI Parameters
- serviceId: required (string)
HTTP status code 200
Body
Type: application/json
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"name": "service-name",
"domain": "domain-id",
"desiredState":
{
"replicas": 3,
"replicaSelector": { "name": "service-name" },
"replicaPolicy": {
"atLeast": 2
},
"activeDeployment": "a_deployment_id",
"podTemplate":
{
"desiredState":
{
"image": "server/domain/name",
"network-ports": [
{
"hostPort": 8080,
"containerPort": 80
}
],
"owner": true
},
"labels": {
"name": "service-name"
}
}
}
}
}
put /lbservices/{serviceId}
Update a service
URI Parameters
- serviceId: required (string)
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-03/schema",
"type": "object",
"required": false,
"description": "A service resource.",
"properties": {
"kind": {
"type": "string",
"required": false
},
"id": {
"type": "string",
"required": false
},
"creationTimestamp": {
"type": "string",
"required": false
},
"selfLink": {
"type": "string",
"required": false
},
"name": {
"type": "string",
"required": false
},
"port": {
"type": "number",
"required": false
},
"labels": {
"type": "object",
"required": false
},
"selector": {
"type": "object",
"required": false
}
}
}
Example:
{
"data":
{
"id": "53c4249f076573c0f4000001",
"name": "service-name",
"domain": "domain-id",
"desiredState":
{
"replicas": 3,
"replicaSelector": { "name": "service-name" },
"replicaPolicy": {
"atLeast": 2
},
"activeDeployment": "a_deployment_id",
"podTemplate":
{
"desiredState":
{
"image": "server/domain/name",
"network-ports": [
{
"hostPort": 8080,
"containerPort": 80
}
],
"owner": true
},
"labels": {
"name": "service-name"
}
}
}
}
}