Draft REST API
This is a first pass at a set of REST APIs that support the following workflows. For actor definitions, see NDS Labs Use Cases.
- Cluster admin can manage the "service library" (collection of definitions of available services, similar to the Charm store)
- Cluster admin can manage "projects" (a project is a namespace and set of storage/computation quotas)
- Project admin can view all available site services and storage resources.
- Project admin can manage deployed services (add/remove), associate services where necessary, and assign volumes to services.
A few definitions:
- Service: This is the logical service offered by NDSLabs. For example, Clowder or MongoDB. One NDSLabs service may related to multiple Kubernetes services or Docker images.
- Service library: Collection of service definitions available to NDSLabs users.
- Project: Defines a specific project allocation including access and quotas (storage and compute)
- Service instance: A project-specific configuration of a services. For example, my instance of Clowder.
- Volume: An initialized/mounted volume of a specific size that affects the project storage quota and is attached to one or more services.
Base path: /api/{version}/
Path | Action | Project Admin | Cluster Admin | Notes |
---|---|---|---|---|
/services | List, add site-wide services | GET | PUT | |
/services/{service-id} | Get, update, delete site-wide services | GET | PUT, DELETE | |
/projects | List, add projects | GET, PUT | ||
/projects/{project-id} | Get, update, delete project | GET, PUT | DELETE | |
/projects/{project-id}/serviceInstances | List, add project services | GET, PUT | ||
/projects/{project-id}/serviceInstances/{instance-id} | Get, update, delete project service | GET, PUT, DELETE | ||
/projects/{project-id}/serviceInstances/{instance-id}/status | Get, update, delete project services status | GET, PUT, DELETE | ||
/projects/{project-id}/volumes | List, add project volumes | GET, PUT | ||
/projects/{project-id}/volumes/{volume-id} | Get, update, delete project volumes | GET, PUT, DELETE |
A first draft of the spec is available via git on the NDS-108 branch
https://github.com/nds-org/nds-labs/blob/NDS-108/apiserver/api/swagger-spec/ndslabs.yaml
This can be opened using the Swagger editor demo http://editor.swagger.io/, if desired.
API Server (prototype)
The prototype NDSLabs API Server will be used by the CLI and GUI applications.
Design
To facilitate rapid development, we'll use the Swagger editor and codegen with Java bindings:
- Use Swagger editor to define API (running on some dev VM)
- Use Swagger codegen to generate JAX-RS server bindings and ? client bindings
- API server will run under Jetty (default)
Components
We envision the following components:
- CLI
- API Server (essentially a webapp running under Jetty)
- etcd (configuration storage)
- Kubernetes API client (for interaction with Kubernetes services, etc).
- Openstack client to handle volume allocation/initialization tasks