Shared Utility Functions and Metadata

class shr.DeviceMetadata

Metadata describing the Alpaca Device/Server

class shr.ImageArrayResponse(value, req: ~falcon.request.Request, err=<exceptions.Success object>)

JSON response for an Alpaca Property (GET) Request

Initialize an ImageArrayResponse object. This is a subclass of PropertyResponse

Parameters:
  • value – The value of the requested property, or None if there was an exception.

  • req – The Falcon Request property that was provided to the responder.

  • err – An Alpaca exception class as defined in the exceptions or defaults to Success

Notes

  • Bumps the ServerTransactionID value and returns it in sequence

class shr.MethodResponse(req: ~falcon.request.Request, err=<exceptions.Success object>, value=None)

JSON response for an Alpaca Method (PUT) Request

Initialize a MethodResponse object.

Parameters:
  • req – The Falcon Request property that was provided to the responder.

  • err – An Alpaca exception class as defined in the exceptions or defaults to Success

  • value – If method returns a value, or defaults to None

Notes

  • Bumps the ServerTransactionID value and returns it in sequence

property json: str

Return the JSON for the Method Response

class shr.PreProcessRequest(maxdev)

Decorator for responders that quality-checks an incoming request

If there is a problem, this causes a 400 Bad Request to be returned to the client, and logs the problem.

maxdev

Initialize a PreProcessRequest decorator object.

Parameters:

maxdev – The maximun device number. If multiple instances of this device type are supported, this will be > 0.

Notes

  • Bumps the ServerTransactionID value and returns it in sequence

class shr.PropertyResponse(value, req: ~falcon.request.Request, err=<exceptions.Success object>)

JSON response for an Alpaca Property (GET) Request

Initialize a PropertyResponse object.

Parameters:
  • value – The value of the requested property, or None if there was an exception.

  • req – The Falcon Request property that was provided to the responder.

  • err – An Alpaca exception class as defined in the exceptions or defaults to Success

Notes

  • Bumps the ServerTransactionID value and returns it in sequence

property json: str

Return the JSON for the Property Response