program_queue

Summary

program_queue
Version:

1.1.0

Description:

program_queue

Maintainers:
  • Devon Ash <dash AT clearpathrobotics DOT com>
Licenses:
  • BSD
Urls:
Authors:
  • Austin Hendrix
BuildDepends:
BuildtoolDepends:
 
BuildExportDepends:
 
ExecDepends:

Types

Message types

program_queue/Program
Field:
ProgramInfo info
string code
program_queue/ProgramInfo
Field:
  • id (uint64) –
  • name (string) –
  • type (int8) –
  • owner (string) –
Constant:
  • PYTHON (int8):1
  • PUPPET (int8):2
  • SLIDER (int8):3
uint64 id
string name
int8 type
int8 PYTHON=1
int8 PUPPET=2
int8 SLIDER=3
string owner
program_queue/Output
Field:
Header header
string output

Service types

program_queue/QueueProgram
Field (Request):
 
  • token (uint64) –
  • program_id (uint64) –
Field (Response):
 
  • queue_position (uint64) –

Put a program in the queue. If the program is already in the queue, this does nothing

# Put a program in the queue. If the program is already in the queue, this does nothing
uint64 token
uint64 program_id
---
# return the position in the queue. might be useful, might not.
uint64 queue_position
program_queue/CreateUser
Field (Request):
 
  • name (string) –
  • password (string) –
Field (Response):
 
  • token (uint64) –
Create a new user. Will fail if a user with the same name already exists
on success, creates a login token for the new user
# Create a new user. Will fail if a user with the same name already exists
#  on success, creates a login token for the new user
string name
string password
---
uint64 token
program_queue/Login
Field (Request):
 
  • name (string) –
  • password (string) –
Field (Response):
 
  • token (uint64) –
  • is_admin (bool) –

get a login token for a user

# get a login token for a user
string name
string password
---
uint64 token
bool is_admin
program_queue/GetProgram
Field (Request):
 
  • id (uint64) –
Field (Response):
 

Get the full program associated with id

# Get the full program associated with id
uint64 id
---
Program program
program_queue/GetQueue
Field (Response):
 

Get the current program queue. The first program is at the top of the queue

# Get the current program queue. The first program is at the top of the queue
---
ProgramInfo[] programs
program_queue/GetPrograms
Field (Response):
 

Get the metadata for all programs in the system

# Get the metadata for all programs in the system
---
ProgramInfo[] programs
program_queue/UpdateProgram
Field (Request):
 

Update a program. The program_id must be owned by the user with this token, or the token must be an admin token.

# Update a program. The program_id must be owned by the user with this token, or the token must be an admin token.
uint64 token
Program program
---
program_queue/GetOutput
Field (Request):
 
  • token (uint64) –
  • program_id (uint64) –
  • limit (uint64) –
Field (Response):
 

Get the output from the most recent N runs of program_id

# Get the output from the most recent N runs of program_id
uint64 token
uint64 program_id
# limit on number of outputs, or 0 for all
uint64 limit
---
Output[] output
program_queue/DequeueProgram
Field (Request):
 
  • token (uint64) –
  • id (uint64) –

Removed a program from the queue; can only be called with an admin token

# Removed a program from the queue; can only be called with an admin token
uint64 token
uint64 id
---
program_queue/CallProgram
Field (Request):
 
  • code (string) –
Field (Response):
 
  • ret (int8) –
  • output (string) –

The serialized program as it is saved to a file

# The serialized program as it is saved to a file
string code
---
# The return code
int8 ret
# Any program output
string output
program_queue/RunProgram
Field (Request):
 
  • token (uint64) –
  • id (uint64) –

Run program id. If it is on the queue, it will be removed. Can only be called with an admin token

# Run program id. If it is on the queue, it will be removed. Can only be called with an admin token
uint64 token
uint64 id
---
program_queue/CreateProgram
Field (Request):
 
  • token (uint64) –
Field (Response):
 
  • id (uint64) –

create a new program and get the ID associated with it

# create a new program and get the ID associated with it
uint64 token
---
uint64 id
program_queue/Logout
Field (Request):
 
  • token (uint64) –

Invalidate this login token.

# Invalidate this login token. 
uint64 token
---
program_queue/GetMyPrograms
Field (Request):
 
  • token (uint64) –
Field (Response):
 

Get the metadata for the programs associated with the current user

# Get the metadata for the programs associated with the current user
uint64 token
---
ProgramInfo[] programs
program_queue/ClearQueue
Field (Request):
 
  • token (uint64) –

clear the queue. Must be called with a token associated with an admin

# clear the queue. Must be called with a token associated with an admin
uint64 token
---