mxcubecore.HardwareObjects.ISPyBRestClient#

A client for ISPyB Webservices.

Classes

ISPyBRestClient(name)

RESTful Web-service client for EXI.

class mxcubecore.HardwareObjects.ISPyBRestClient.ISPyBRestClient(name)[source]#

Bases: HardwareObject

RESTful Web-service client for EXI.

authenticate(user, password)[source]#

Authenticate with RESTfull services, updates the authentication token, username and password used internally by this object.

Parameters:
  • user (str) – Username

  • password (str) – Password

Returns:

None

Get the LIMS link the data collection with id <id>.

Parameters:

did (str) – Data collection ID

Returns:

The link to the data collection

get_bl_sample(bl_sample_id)[source]#

Fetch the BLSample entry with the id bl_sample_id

Parameters:

bl_sample_id (int) –

Returns:

A BLSampleWSValue, defined in the wsdl.

Return type:

BLSampleWSValue

get_dc(dc_id)[source]#

Get data collection with id <dc_id>

Parameters:

dc_id (int) – The collection id

Returns:

Data collection dict

get_dc_image(image_id)[source]#

Get the image data for image with id <image_id>

Parameters:

image_id (int) – The image id

Returns:

tuple on the form (file name, base64 encoded data)

get_dc_list()[source]#

Get the list of data collections for the current session belonging to the current proposal. (Given by the session object)

Returns:

A list of LIMS DataCollection Objects

get_dc_thumbnail(image_id)[source]#

Get the image data for image with id <image_id>

Parameters:

image_id (int) – The image id

Returns:

tuple on the form (file name, base64 encoded data)

get_proposals_by_user(user_name)[source]#
Descript.gets all proposals for selected user

at first all proposals for user are obtained then for each proposal all sessions are obtained TODO: also user and laboratory should be obtained

get_quality_indicator_plot(collection_id)[source]#

Get the imagequliaty indicator plot for collection with collection id <collection_id>

Parameters:

collection_id (int) – The collection id

Returns:

tuple on the form (file name, base64 encoded data)

get_rest_token()[source]#

Get the LIMS rest_token

Returns:

REST token

get_session_local_contact(session_id)[source]#
Descript.Retrieves the person entry associated with the session

id <session_id>

Args : param session_id (ype session_id: int) Return : Person object as dict (type: dict)

get_session_samples(proposal_id, session_id, sample_refs)[source]#

Retrives the list of samples associated with the session <session_id>. The samples from ISPyB is cross checked with the ones that are currently in the sample changer.

The datamatrix code read by the sample changer is used in case of conflict.

Parameters:
  • proposal_id (int) – ISPyB proposal id.

  • session_id (int) – ISPyB session id to retreive samples for.

  • sample_refs (list (of sample_ref objects).) – The list of samples currently in the sample changer. As a list of sample_ref objects

Returns:

A list with sample_ref objects.

Return type:

list

init()[source]#

Hardware object init.

Get the LIMS link to sample information

Returns:

Link to sample information

store_beamline_setup(session_id, bl_config)[source]#

Stores the beamline setup dict <bl_config>.

Parameters:
  • session_id (int) – The session id that the bl_config should be associated with.

  • bl_config (dict) – The dictonary with beamline settings.

Returns beamline_setup_id:

The database id of the beamline setup.

Return type:

str

store_data_collection(mx_collection, bl_config=None)[source]#

Stores the data collection mx_collection, and the beamline setup if provided.

Parameters:
  • mx_collection (dict) – The data collection parameters.

  • bl_config (dict) – The beamline setup.

Returns:

None

store_data_collection_group(mx_collection)[source]#

Stores or updates a DataCollectionGroup object. The entry is updated of the group_id in the mx_collection dictionary is set to an exisitng DataCollectionGroup id.

Parameters:

mx_collection (dict) – The dictionary of values to create the object from.

Returns:

DataCollectionGroup id

Return type:

int

store_image(image_dict)[source]#

Stores the image (image parameters) <image_dict>

Parameters:

image_dict (dict) – A dictonary with image pramaters.

Returns:

None

translate(code, what)[source]#

Given a proposal code, returns the correct code to use in the GUI, or what to send to LDAP, user office database, or the ISPyB database.

update_data_collection(mx_collection, wait=False)[source]#

Updates the datacollction mx_collection, this requires that the collectionId attribute is set and exists in the database.

Parameters:

mx_collection (dict) – The dictionary with collections parameters.

Returns:

None