schrodinger.application.licensing.licserver.entitlement_status module¶
- class schrodinger.application.licensing.licserver.entitlement_status.ClientUsage(user: str, jobid: str, hostname: str, version: str, pid: int, count: int)¶
Bases:
object
Client usage information.
- user: str¶
- jobid: str¶
- hostname: str¶
- version: str¶
- pid: int¶
- count: int¶
- __init__(user: str, jobid: str, hostname: str, version: str, pid: int, count: int) None ¶
- class schrodinger.application.licensing.licserver.entitlement_status.EntitlementFeature(name: str, issued: int, used: int, start_date: str, end_date: str, library: bool, total_client_usages: int, usages: List[ClientUsage])¶
Bases:
object
License entitlement feature.
- name: str¶
- issued: int¶
- used: int¶
- start_date: str¶
- end_date: str¶
- library: bool¶
- total_client_usages: int¶
- usages: List[ClientUsage]¶
- __init__(name: str, issued: int, used: int, start_date: str, end_date: str, library: bool, total_client_usages: int, usages: List[ClientUsage]) None ¶
- class schrodinger.application.licensing.licserver.entitlement_status.EntitlementStatus(server: str, version: str, license_dir: str, license_files: List[str], active_entitlements: List[EntitlementFeature], future_entitlements: List[EntitlementFeature], expired_entitlements: List[EntitlementFeature])¶
Bases:
object
Entitlement status of a server.
- server: str¶
- version: str¶
- license_dir: str¶
- license_files: List[str]¶
- active_entitlements: List[EntitlementFeature]¶
- future_entitlements: List[EntitlementFeature]¶
- expired_entitlements: List[EntitlementFeature]¶
- __init__(server: str, version: str, license_dir: str, license_files: List[str], active_entitlements: List[EntitlementFeature], future_entitlements: List[EntitlementFeature], expired_entitlements: List[EntitlementFeature]) None ¶
- schrodinger.application.licensing.licserver.entitlement_status.get_entitlement_status(hostport: Optional[str] = None, show_all_entitlements: bool = False, merge_library_tokens: bool = False, user: Optional[str] = None, jobid: Optional[str] = None, hostname: Optional[str] = None, regex_host: bool = False, omit_client_usage=False) List[EntitlementStatus] ¶
Get entitlement status from license servers.
This function uses the ‘lictool entitlement-status’ command to get the entitlement status from license servers. An optional hostport can be provided to get the status. Otherwise this will use the value of LICSEVERD_HOSTPORT environment variable or discover the license servers from standard search path or SCHRODINGER_LICENSE_SERVERS environment variable.
By default the statuses of the tokens that are active are returned, and the usage of library tokens are separated from standalone tokens. To combine usage of library tokens with standalone tokens, pass merge_library_tokens to True. To return details of all entitlements including future and expired ones, pass show_all_entitlements as True.
When omit_client_usage is set to True, the client usage details are omitted from the filtered entitlements. NOTE: When no filter is provided, the total_client_usages in the EntitlementFeature will list out the total used entitlements across all clients. Otherwise, it will list out the total used entitlements for the filtered client usages.
- Parameters:
hostport – License server hostport.
show_all_entitlements – Show all entitlements including non-active ones.
merge_library_tokens – Merge usage of library tokens with standalone tokens.
user – User to filter entitlements
jobid – Job ID to filter entitlements
regex_host – Treat hostname as a regular expression for filtering. Default is fixed string.
omit_client_usage – Omit client usage details from the filtered entitlements.
- Params hostname:
Client hostname to filter entitlements
- Returns:
List of EntitlementStatus
- Raises:
RuntimeError if the command to get entitlement status fails.
- Raises:
json.JSONDecodeError if the JSON data obtained from server is invalid.
- Raises:
KeyError if the JSON data obtained from server is missing required fields.