ska_tmc_centralnode.input_validator module
Input Validator class for central node
- class ska_tmc_centralnode.input_validator.AssignResourceValidator(subarray_list, receptor_list, dish_leaf_node_prefix, logger=<Logger ska_tmc_centralnode.input_validator (WARNING)>, mkt_extension_id='MKE')
Bases:
objectClass to validate the input string of AssignResources command of Central Node
- loads(input_string)
Validates the input string received as an argument of AssignResources command. If the request is correct, returns the deserialized JSON object. The ska-tmc-cdm is used to validate the JSON.
- Parameters:
input_string (str) – A JSON string
- Returns:
Deserialized JSON object if successful.
- Return type:
dict
- Raises:
InvalidJSONError – When the JSON string is not formatted properly.
SubarrayNotPresentError – If the subarray is not present.
ResourceNotPresentError – When a receptor in the receptor_id_list is not present.
- class ska_tmc_centralnode.input_validator.ReleaseResourceValidator(logger=<Logger ska_tmc_centralnode.input_validator (WARNING)>)
Bases:
objectClass to validate the input string of ReleaseResources command of Central Node
- loads(input_string)
Validates the input string received as an argument of ReleaseResources command. If the request is correct, returns the deserialized JSON object. The ska-tmc-cdm is used to validate the JSON.
- Parameters:
input_string (str) – A JSON string
- Returns:
Deserialized JSON object if successful.
- Return type:
dict
- Raises:
InvalidJSONError – When the JSON string is not formatted properly.
SubarrayNotPresentError – If the subarray is not present.
ResourceNotPresentError – When a receptor in the receptor_id_list is not present.