ska_pst.lmc.validation

This package is for validation of requests.

class ska_pst.lmc.validation.PstConfigValidator(*args: Any, **kwargs: Any)[source]

A validator class that ensures the config request sent to PST is correct.

This extends the SKA TANGO Base class ArgumentValidator. It ensures that only the common and pst scan configuration parts.

This does not proxy the requests down to subordinate devices or the core apps as that should be done in the component manager as that can take some time.

validate(*args: Any, **kwargs: Any) tuple[tuple[Any, ...], dict]

Validate input and return the scan request.

class ska_pst.lmc.validation.PstScanValidator(*args: Any, **kwargs: Any)[source]

A class used to validate scan requests for PST.

validate(*args: Any, **kwargs: Any) tuple[tuple[Any, ...], dict]

Validate scan command request.

A legacy of PST is that it was assumed that the request for a Scan would be just a string version of an int (e.g. “123”) but the request should be a stringified JSON request with scan_id as a key. This validator will try to validate it against being a JSON request and fall back to bring stringified number.

Checks that there is only one positional argument and no keyword arguments; unpacks the positional argument from JSON into a dictionary; and validate against the provided JSON schema.

Parameters
  • args – positional args to the command

  • kwargs – keyword args to the command

Returns

validated args and kwargs

exception ska_pst.lmc.validation.ValidationError(message: str, *args: Any)[source]

Exception representing a validation exception.