API interfaces
The PyPSSE REST API interface enables users to run PyPSSE on a server machine. The interface enables orchestration of multiple simualtion runs in parallel. Future extenions will support
- User management
- Result retrival during simulation runs using web socket implementation
- Ability to upload existing PyPSSE project to the server machine
FastAPI 0.1.0
Endpoints
PUT /simulator/
Put Psse
Request body
application/json
{
"uuid": "string",
"command": "run_simulation",
"parameters": null
}
Schema of the request body
{
"properties": {
"uuid": {
"type": "string",
"format": "uuid4",
"title": "Uuid"
},
"command": {
"$ref": "#/components/schemas/ApiCommands"
},
"parameters": {
"anyOf": [
{
"$ref": "#/components/schemas/ApiAssetQuery"
},
{
"type": "null"
}
]
}
},
"type": "object",
"required": [
"uuid",
"command"
],
"title": "ApiPssePutRequest"
}
Response 200 OK
application/json
Schema of the response body
Response 422 Unprocessable Entity
application/json
{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string"
}
]
}
Schema of the response body
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
POST /simulator/
Post Psse
Description Create UUID and intialize and push to queue
Request body
application/json
{
"project_name": "string"
}
Schema of the request body
{
"properties": {
"project_name": {
"type": "string",
"title": "Project Name",
"default": "static_example"
}
},
"type": "object",
"title": "ApiPssePostRequest"
}
Response 200 OK
application/json
Schema of the response body
Response 422 Unprocessable Entity
application/json
{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string"
}
]
}
Schema of the response body
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
DELETE /simulator/uuid/{uuid}
Delete Psse
Description Delete an instance of simulation
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
uuid | path | string | No |
Response 200 OK
application/json
Schema of the response body
Response 422 Unprocessable Entity
application/json
{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string"
}
]
}
Schema of the response body
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
GET /simulator/uuids
Get Instance Uuids
Description Get all running simulation uuids
Response 200 OK
application/json
Schema of the response body
GET /simulator/status/uuid/{uuid}
Get Instance Status
Description Get status of the current provided simuation instance
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
uuid | path | string | No |
Response 200 OK
application/json
Schema of the response body
Response 422 Unprocessable Entity
application/json
{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string"
}
]
}
Schema of the response body
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
GET /simulator/results/uuid/{uuid}
Get Download Results
Description Download results from a simulation instance
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
uuid | path | string | No |
Response 200 OK
application/json
Schema of the response body
Response 422 Unprocessable Entity
application/json
{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string"
}
]
}
Schema of the response body
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
GET /simulator/log/uuid/{uuid}
Get Download Logs
Description Download logs from a simulation instance
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
uuid | path | string | No |
Response 200 OK
application/json
Schema of the response body
Response 422 Unprocessable Entity
application/json
{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string"
}
]
}
Schema of the response body
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
GET /
Get Main Page
Description Method to handle service info route.
Response 200 OK
application/json
Schema of the response body
POST /upload
Post Upload Zipped Project
Description Upload a new zipped project to the server
Request body
multipart/form-data
{
"file": "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQ="
}
Schema of the request body
{
"properties": {
"file": {
"type": "string",
"format": "binary",
"title": "File"
}
},
"type": "object",
"required": [
"file"
],
"title": "Body_post_upload_zipped_project_upload_post"
}
Response 200 OK
application/json
Schema of the response body
Response 422 Unprocessable Entity
application/json
{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string"
}
]
}
Schema of the response body
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
GET /projects
Get List Projects
Response 200 OK
application/json
Schema of the response body
Schemas
ApiAssetQuery
Name | Type |
---|---|
asset_id | |
asset_property | |
asset_type | ModelTypes |
ApiCommands
Type: string
ApiPssePostRequest
Name | Type |
---|---|
project_name | string |
ApiPssePutRequest
Name | Type |
---|---|
command | ApiCommands |
parameters | |
uuid | string(uuid4) |
AreaProperties
Type: string
Body_post_upload_zipped_project_upload_post
Name | Type |
---|---|
file | string(binary) |
BranchProperties
Type: string
BusProperties
Type: string
DCLineProperties
Type: string
FixedShuntProperties
Type: string
HTTPValidationError
Name | Type |
---|---|
detail | Array<ValidationError> |
InductionGeneratorProperties
Type: string
LoadProperties
Type: string
MachinesProperties
Type: string
ModelTypes
Type: string
StationProperties
Type: string
SwitchedShuntProperties
Type: string
TransformerProperties
Type: string
ValidationError
Name | Type |
---|---|
loc | Array<> |
msg | string |
type | string |
ZoneProperties
Type: string