swagger: '2.0' info: title: Service Manager API version: 0.1.0 basePath: /api schemes: - https produces: - application/json consumes: - application/json paths: /api/services: post: security: - ApiKeyHeader: [] tags: - services summary: Create a new service operationId: createService parameters: - in: body name: body description: Service to be created required: true schema: $ref: '#/definitions/ServicePostRequest' responses: '201': description: Created service schema: $ref: '#/definitions/ServiceStatus' '400': description: Validation Error schema: type: array items: $ref: '#/definitions/ValidationError' '406': description: Invalid Content schema: type: array items: $ref: '#/definitions/ValidationError' get: security: - ApiKeyHeader: [] tags: - services summary: Read all services operationId: getServices responses: '200': description: Array of services schema: type: array items: $ref: '#/definitions/Service' /api/services/status: get: security: - ApiKeyHeader: [] tags: - services summary: Get status of all services operationId: getServicesStatus responses: '200': description: Map of service statuses schema: type: object '/api/services/{id}': get: security: - ApiKeyHeader: [] tags: - services summary: Get a specific service operationId: getService parameters: - name: id in: path description: Id of service type: string required: true responses: '200': description: Service schema: $ref: '#/definitions/Service' '400': description: Invalid request '404': description: Service not found put: security: - ApiKeyHeader: [] tags: - services summary: Update an existing service operationId: updateService parameters: - in: path description: Id of service name: id required: true type: string - in: body name: body description: Data required for updating a service required: true schema: $ref: '#/definitions/UpdateServiceRequest' responses: '200': description: OK schema: $ref: '#/definitions/Service' '400': description: Validation Error schema: type: array items: $ref: '#/definitions/ValidationError' '404': description: Service not found delete: security: - ApiKeyHeader: [] tags: - services summary: Delete an existing service operationId: deleteService parameters: - name: id in: path description: Id of service type: string required: true responses: '200': description: OK schema: type: object properties: id: type: string description: The id of the deleted service '404': description: Service not found '/api/services/{id}/status': get: security: - ApiKeyHeader: [] tags: - services summary: Get a specific service status operationId: getServiceStatus parameters: - name: id in: path description: Id of service type: string required: true responses: '200': description: Service schema: $ref: '#/definitions/ServiceStatus' '400': description: Invalid request '404': description: Service not found /api/services/ingress-routes: get: security: - ApiKeyHeader: [] tags: - services summary: Get all ingress routes operationId: getIngressRoutes responses: '200': description: Ingress routes schema: type: array items: $ref: '#/definitions/IngressRoute' '400': description: Invalid request /api/services/links: get: security: - ApiKeyHeader: [] tags: - links summary: 'Get all Cybus::Link routes' operationId: getLinks responses: '200': description: Links schema: type: array items: $ref: '#/definitions/Link' '400': description: Invalid request '/api/services/{id}/operation': put: security: - ApiKeyHeader: [] tags: - services summary: Perform an operation on a service operationId: execute parameters: - name: id in: path description: Id of service type: string required: true - name: body in: body description: Operation to perform required: true schema: $ref: '#/definitions/ServiceOperationRequest' responses: '200': description: Service schema: $ref: '#/definitions/ServiceStatus' '400': description: Invalid request '404': description: Service not found securityDefinitions: ApiKeyHeader: type: apiKey in: header name: Authorization definitions: Service: type: object properties: id: type: string commissioningData: type: object resources: type: object targetState: type: string currentState: type: string ServiceStatus: type: object properties: id: type: string description: Unique identifier representing a specific service. targetState: type: string description: Target state of the service (user's wish). currentState: type: string description: Current state of the service. ServicePostRequest: type: object required: - id - commissioningFile properties: id: type: string minLength: 4 commissioningFile: type: buffer description: >- The commissioning file of this service as base64 encoded content of a buffer parameters: type: object description: The parameter values of this service as a JSON object targetState: type: string enum: - disabled - enabled UpdateServiceRequest: type: object properties: version: type: string metadata: type: object parameters: type: object definitions: type: object resources: type: object ServiceOperationRequest: type: object properties: operation: type: string description: Disable and enable IngressRoute: type: object properties: id: type: string containerHost: type: string containerPort: type: integer containerPrefixRewrite: type: string ingressPort: type: integer ingressUrlPrefix: type: string type: type: string Link: type: object properties: id: type: string ingressRoute: type: string name: type: string href: type: string ValidationError: type: object properties: message: type: string