-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a catalog info and openapi schema
- Loading branch information
Rose Yemelyanova
committed
May 11, 2023
1 parent
a0ca2c0
commit 633283f
Showing
10 changed files
with
490 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: bluesky-worker | ||
title: bluesky-worker | ||
description: Lightweight wrapper around bluesky services | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:vid18871 # TODO: owner: DAQ-Core | ||
# system: Athena # TODO: Define Athena system: presumably same location as DAQ-Core/DAQ? | ||
providesApis: | ||
- blueapi | ||
- blueskydocument-to-scanmessage | ||
|
||
--- | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: API | ||
metadata: | ||
name: blueapi | ||
title: blueapi | ||
description: REST API for getting plans/devices from the worker (and running tasks) | ||
spec: | ||
type: openapi | ||
lifecycle: production | ||
owner: user:vid18871 | ||
definition: | ||
$text: ./openapi.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,323 @@ | ||
{ | ||
"openapi": "3.0.2", | ||
"info": { | ||
"title": "FastAPI", | ||
"version": "0.1.0" | ||
}, | ||
"paths": { | ||
"/plans": { | ||
"get": { | ||
"summary": "Get Plans", | ||
"operationId": "get_plans_plans_get", | ||
"responses": { | ||
"200": { | ||
"description": "Successful Response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/PlanResponse" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/plan/{name}": { | ||
"get": { | ||
"summary": "Get Plan By Name", | ||
"operationId": "get_plan_by_name_plan__name__get", | ||
"parameters": [ | ||
{ | ||
"required": true, | ||
"schema": { | ||
"title": "Name", | ||
"type": "string" | ||
}, | ||
"name": "name", | ||
"in": "path" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Successful Response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/PlanModel" | ||
} | ||
} | ||
} | ||
}, | ||
"422": { | ||
"description": "Validation Error", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/HTTPValidationError" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/devices": { | ||
"get": { | ||
"summary": "Get Devices", | ||
"operationId": "get_devices_devices_get", | ||
"responses": { | ||
"200": { | ||
"description": "Successful Response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/DeviceResponse" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/device/{name}": { | ||
"get": { | ||
"summary": "Get Device By Name", | ||
"operationId": "get_device_by_name_device__name__get", | ||
"parameters": [ | ||
{ | ||
"required": true, | ||
"schema": { | ||
"title": "Name", | ||
"type": "string" | ||
}, | ||
"name": "name", | ||
"in": "path" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Successful Response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/DeviceModel" | ||
} | ||
} | ||
} | ||
}, | ||
"422": { | ||
"description": "Validation Error", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/HTTPValidationError" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/task/{name}": { | ||
"put": { | ||
"summary": "Execute Task", | ||
"operationId": "execute_task_task__name__put", | ||
"parameters": [ | ||
{ | ||
"required": true, | ||
"schema": { | ||
"title": "Name", | ||
"type": "string" | ||
}, | ||
"name": "name", | ||
"in": "path" | ||
} | ||
], | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/RunPlan" | ||
}, | ||
"example": { | ||
"name": "count", | ||
"params": { | ||
"detectors": [ | ||
"x" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"required": true | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Successful Response", | ||
"content": { | ||
"application/json": { | ||
"schema": {} | ||
} | ||
} | ||
}, | ||
"422": { | ||
"description": "Validation Error", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/HTTPValidationError" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"DeviceModel": { | ||
"title": "DeviceModel", | ||
"required": [ | ||
"name", | ||
"protocols" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "Name", | ||
"type": "string", | ||
"description": "Name of the device" | ||
}, | ||
"protocols": { | ||
"title": "Protocols", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "Protocols that a device conforms to, indicating its capabilities" | ||
} | ||
}, | ||
"description": "Representation of a device" | ||
}, | ||
"DeviceResponse": { | ||
"title": "DeviceResponse", | ||
"required": [ | ||
"devices" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"devices": { | ||
"title": "Devices", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/DeviceModel" | ||
}, | ||
"description": "Devices available to use in plans" | ||
} | ||
}, | ||
"description": "Response to a query for devices" | ||
}, | ||
"HTTPValidationError": { | ||
"title": "HTTPValidationError", | ||
"type": "object", | ||
"properties": { | ||
"detail": { | ||
"title": "Detail", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/ValidationError" | ||
} | ||
} | ||
} | ||
}, | ||
"PlanModel": { | ||
"title": "PlanModel", | ||
"required": [ | ||
"name" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "Name", | ||
"type": "string", | ||
"description": "Name of the plan" | ||
} | ||
}, | ||
"description": "Representation of a plan" | ||
}, | ||
"PlanResponse": { | ||
"title": "PlanResponse", | ||
"required": [ | ||
"plans" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"plans": { | ||
"title": "Plans", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/PlanModel" | ||
}, | ||
"description": "Plans available to use by a worker" | ||
} | ||
}, | ||
"description": "Response to a query for plans" | ||
}, | ||
"RunPlan": { | ||
"title": "RunPlan", | ||
"required": [ | ||
"name" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "Name", | ||
"type": "string", | ||
"description": "Name of plan to run" | ||
}, | ||
"params": { | ||
"title": "Params", | ||
"type": "object", | ||
"description": "Values for parameters to plan, if any" | ||
} | ||
}, | ||
"description": "Task that will run a plan" | ||
}, | ||
"ValidationError": { | ||
"title": "ValidationError", | ||
"required": [ | ||
"loc", | ||
"msg", | ||
"type" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"loc": { | ||
"title": "Location", | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"type": "integer" | ||
} | ||
] | ||
} | ||
}, | ||
"msg": { | ||
"title": "Message", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"title": "Error Type", | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.