ae.sys_data_sh

Sihot system data interface

This portion is very old and needs refactoring and much more unit tests.

The sys record data classes provided by this portion are based on client and server components (to communicate with the Sihot PMS system) provided by the ae.sys_core_sh portion of the ae namespace package.

TODO:
  • split into several small modules.

  • enhance type annotation.

  • add much more unit tests.

Module Attributes

SH_CLIENT_MAP

default map for ClientFromSihot.elem_fld_map instance.

SH_RES_MAP

reservation map

Functions

add_sh_options(cae[, client_port, …])

add config/command line options.

client_data(cae, obj_id)

fetch the client data record from Sihot for the client specified by its Sihot object id.

complete_res_data(rec)

complete reservation data row (rec) with default values.

convert_date_from_sh(xml_string)

convert date string sent by the Sihot system into a datetime.date value.

convert_date_onto_sh(date)

convert datetime.date value into a date string in the format of the Sihot system.

date_range_chunks(date_from, date_till, …)

split date range into manageable chunks respecting the passed maximum days length and yield them back.

elem_path_join(elem_names)

convert list of element names to element path.

gds_no_to_ids(cae, hotel_id, gds_no)

determine all reservation ids for a reservation with the passed GDS number.

gds_no_to_obj_id(cae, hotel_id, gds_no)

determine the Sihot object id of a reservation identified by the GDS number.

hotel_and_res_id(shd)

determine hotel and reservation ids.

obj_id_to_res_no(cae, obj_id)

using RESERVATION-GET oc from KERNEL interface (see 7.3 in SIHOT KERNEL interface doc).

pax_count(shd)

determine the number of PAX of the passed reservation record.

print_sh_options(cae)

print the current config options values to the console.

res_no_to_ids(cae, hotel_id, res_id, sub_id)

determine all reservation ids for a reservation with the passed reservation number.

res_no_to_obj_id(cae, hotel_id, res_id, sub_id)

determine the Sihot object id of a reservation identified by their reservation number.

res_search(cae, date_from[, date_till, …])

search reservations with the criteria specified by the parameters.

Classes

BulkFetcherBase(cae[, add_kernel_port])

helper base class for bulk data fetches.

ClientFetch(cae)

build xml and send to the Sihot system to fetch a client record.

ClientFromSihot(cae[, elem_map])

extended xml parser converting client data directly into a sys data Record structure.

ClientSearch(cae)

search client.

ClientToSihot(cae)

extended xml builder class to send/push client data to Sihot.

FldMapXmlBuilder(cae[, use_kernel, elem_map])

extended xml builder base class.

FldMapXmlParser(cae, elem_map)

extended xml parser converting data directly into a sys data Record structure.

GuestBulkFetcher(cae[, add_kernel_port])

WIP/NotUsed/NoTests: the problem is with GUEST-SEARCH is that there is no way to bulk fetch all guests because the search criteria is not providing range search to split in slices.

ResBulkFetcher(cae[, allow_future_arrivals])

reservation bulk fetch.

ResFetch(cae[, use_kernel])

fetch reservation.

ResFromSihot(cae)

extended xml parser converting reservation data directly into a sys data Record structure.

ResSearch(cae[, use_kernel])

search reservation.

ResSender(cae)

helper class to send reservation records to Sihot.

ResToSihot(cae)

extended xml builder to send reservation data to Sihot.

convert_date_from_sh(xml_string)[source]

convert date string sent by the Sihot system into a datetime.date value.

Return type

date

convert_date_onto_sh(date)[source]

convert datetime.date value into a date string in the format of the Sihot system.

Return type

str

SH_CLIENT_MAP = (('OBJID', 'ShId', None, <function <lambda>>), ('MATCHCODE', 'AcuId'), ('T-SALUTATION', 'Salutation'), ('T-TITLE', 'Title'), ('T-GUEST', 'GuestType', '1'), ('NAME-1', 'Surname'), ('NAME-2', 'Forename'), ('STREET', 'Street'), ('PO-BOX', 'POBox'), ('ZIP', 'Postal'), ('CITY', 'City'), ('T-COUNTRY-CODE', 'Country'), ('T-STATE', 'State', None, <function <lambda>>), ('T-LANGUAGE', 'Language'), ('T-NATION', 'Nationality', None, <function <lambda>>), ('COMMENT', 'Comment'), ('COMMUNICATION/', None, None, <function <lambda>>), ('PHONE-1', 'Phone'), ('PHONE-2', 'WorkPhone'), ('FAX-1', 'Fax'), ('EMAIL-1', 'Email'), ('EMAIL-2', 'EmailB'), ('MOBIL-1', 'MobilePhone'), ('MOBIL-2', 'MobilePhoneB'), ('/COMMUNICATION', None, None, <function <lambda>>), ('ADD-DATA/', None, None, <function <lambda>>), ('T-PERSON-GROUP', None, '1A'), ('D-BIRTHDAY', 'DOB', None, None, <function <lambda>>, <function <lambda>>), ('INTERNET-PASSWORD', 'Password'), ('MATCH-ADM', 'RciId'), ('MATCH-SM', 'SfId'), ('/ADD-DATA', None, None, <function <lambda>>))

default map for ClientFromSihot.elem_fld_map instance. as read-only constant by AcuClientToSihot using the SIHOT KERNEL interface because SiHOT WEB V9 has missing fields: initials (CD_INIT1/2) and profession (CD_INDUSTRY1/2).

SH_RES_MAP = (('SIHOT-Document.ID', 'ResHotelId'), ('ARESLIST/',), ('RESERVATION/',), ('RESERVATION.RES-HOTEL', 'ResHotelId'), ('RESERVATION.RES-NR', 'ResId', None, <function <lambda>>), ('RESERVATION.SUB-NR', 'ResSubId', None, <function <lambda>>), ('RESERVATION.OBJID', 'ResObjId', None, <function <lambda>>), ('GDSNO', 'ResGdsNo'), ('RESERVATION.GUEST-ID', 'ShId'), ('RESERVATION.GUEST-OBJID', 'ShId'), ('RESERVATION.MATCHCODE', 'AcuId'), ('RESERVATION.NAME', 'Surname'), ('VOUCHERNUMBER', 'ResVoucherNo', None, <function <lambda>>), ('EXT-KEY', 'ResGroupNo', None, <function <lambda>>), ('FLAGS', None, 'IGNORE-OVERBOOKING'), ('RT', 'ResStatus'), ('CAT', 'ResRoomCat'), ('PCAT', 'ResPriceCat', None, <function <lambda>>), ('ALLOTMENT-EXT-NO', 'ResAllotmentNo', '', <function <lambda>>), ('PAYMENT-INST', 'ResAccount', None, <function <lambda>>), ('SALES-DATE', 'ResBooked', None, <function <lambda>>, <function <lambda>>, <function <lambda>>), ('RATE-SEGMENT', 'ResRateSegment', None, <function <lambda>>, ''), ('RATE/', None, None, <function <lambda>>), ('RATE.R', 'ResBoard', None, <function <lambda>>), ('RATE.ISDEFAULT', None, 'Y', <function <lambda>>), ('/RATE', None, None, <function <lambda>>), ('RATE/', None, None, <function <lambda>>), ('RATE.R', 'ResRateBoard', None, <function <lambda>>), ('RATE.ISDEFAULT', None, 'Y', <function <lambda>>), ('RATE.DAYS/', None, None, <function <lambda>>), ('RATE.DAYS.D', ('ResRates', 0, 'RateDay'), None, <function <lambda>>, <function <lambda>>, <function <lambda>>), ('RATE.DAYS.PRICE', ('ResRates', 0, 'RateAmount'), None, <function <lambda>>), ('RATE./DAYS', None, None, <function <lambda>>), ('/RATE', None, None, <function <lambda>>), ('RATE/', None, None, <function <lambda>>), ('RATE.R', None, 'GSC', <function <lambda>>), ('RATE.ISDEFAULT', None, 'N', <function <lambda>>), ('/RATE', None, None, <function <lambda>>), ('RESCHANNELLIST/', None, None, <function <lambda>>), ('RESCHANNEL/', None, None, <function <lambda>>), ('RESCHANNEL.IDX', None, 1, <function <lambda>>), ('RESCHANNEL.MATCHCODE', None, 'RCI', <function <lambda>>), ('RESCHANNEL.ISPRICEOWNER', None, 1, <function <lambda>>), ('RESCHANNEL.IDX', None, 1, <function <lambda>>), ('RESCHANNEL.MATCHCODE', None, 'MAR01', <function <lambda>>), ('RESCHANNEL.ISPRICEOWNER', None, 1, <function <lambda>>), ('RESCHANNEL.IDX', None, 2, <function <lambda>>), ('RESCHANNEL.MATCHCODE', None, 'TSP', <function <lambda>>), ('RESCHANNEL.ISPRICEOWNER', None, 1, <function <lambda>>), ('/RESCHANNEL', None, None, <function <lambda>>), ('/RESCHANNELLIST', None, None, <function <lambda>>), ('ARR', 'ResArrival', None, None, <function <lambda>>, <function <lambda>>), ('DEP', 'ResDeparture', None, None, <function <lambda>>, <function <lambda>>), ('NOROOMS', None, 1), ('NOPAX', 'ResAdults', None, None, <function <lambda>>, <function <lambda>>), ('NOCHILDS', 'ResChildren', None, <function <lambda>>, <function <lambda>>, <function <lambda>>), ('TEC-COMMENT', 'ResLongNote', None, <function <lambda>>), ('COMMENT', 'ResNote', None, <function <lambda>>), ('MARKETCODE-NO', 'ResMktSegment', None, <function <lambda>>), ('MARKETCODE', 'ResMktSegment'), ('SOURCE', 'ResSource', None, <function <lambda>>), ('NN', 'ResMktGroupNN', None, <function <lambda>>), ('CHANNEL', 'ResMktGroup', None, <function <lambda>>), ('EXT-REFERENCE', 'ResFlightArrComment', None, <function <lambda>>), ('ARR-TIME', 'ResFlightETA'), ('PICKUP-TIME-ARRIVAL', 'ResFlightETA', None, <function <lambda>>), ('PICKUP-TYPE-ARRIVAL', None, 1, <function <lambda>>), ('PERSON/', None, None, <function <lambda>>), ('PERSON.GUEST-ID', ('ResPersons', 0, 'PersShId'), None, <function <lambda>>), ('PERSON.MATCHCODE', ('ResPersons', 0, 'PersAcuId'), None, <function <lambda>>), ('PERSON.NAME', ('ResPersons', 0, 'PersSurname'), None, <function <lambda>>), ('PERSON.NAME2', ('ResPersons', 0, 'PersForename'), None, <function <lambda>>), ('PERSON.AUTO-GENERATED', ('ResPersons', 0, 'AutoGen'), '1', <function <lambda>>), ('PERSON.ROOM-SEQ', ('ResPersons', 0, 'RoomSeq'), None, <function <lambda>>), ('PERSON.ROOM-PERS-SEQ', ('ResPersons', 0, 'RoomPersSeq'), None, <function <lambda>>), ('PERSON.PERS-TYPE', ('ResPersons', 0, 'TypeOfPerson'), None, <function <lambda>>), ('PERSON.RN', ('ResPersons', 0, 'RoomNo'), None, <function <lambda>>), ('PERSON.DOB', ('ResPersons', 0, 'PersDOB'), None, <function <lambda>>, <function <lambda>>, <function <lambda>>), ('PERSON.COUNTRY-CODE', ('ResPersons', 0, 'PersCountry'), None, <function <lambda>>), ('PERSON.EMAIL', ('ResPersons', 0, 'PersEmail'), None, <function <lambda>>), ('PERSON.LANG', ('ResPersons', 0, 'PersLanguage'), None, <function <lambda>>), ('PERSON.PHONE', ('ResPersons', 0, 'PersPhone'), None, <function <lambda>>), ('PERSON.PERS-RATE.R', ('ResPersons', 0, 'Board'), None, <function <lambda>>), ('PERSON.PICKUP-COMMENT-ARRIVAL', ('ResPersons', 0, 'FlightArrComment'), None, <function <lambda>>), ('PERSON.PICKUP-TIME-ARRIVAL', ('ResPersons', 0, 'FlightETA'), None, <function <lambda>>), ('PERSON.PICKUP-COMMENT-DEPARTURE', ('ResPersons', 0, 'FlightDepComment'), None, <function <lambda>>), ('PERSON.PICKUP-TIME-DEPARTURE', ('ResPersons', 0, 'FlightETD'), None, <function <lambda>>), ('/PERSON', None, None, <function <lambda>>), ('/RESERVATION',), ('/ARESLIST',))

reservation map

add_sh_options(cae, client_port=0, add_kernel_port=False, add_maps_and_kernel_usage=False)[source]

add config/command line options.

Parameters
  • cae (ConsoleApp) – app instance.

  • client_port (int) – client port.

  • add_kernel_port (bool) – pass True to add also port option for the kernel interface.

  • add_maps_and_kernel_usage (bool) – pass True to add also options for kernel switch and maps.

print_sh_options(cae)[source]

print the current config options values to the console.

client_data(cae, obj_id)[source]

fetch the client data record from Sihot for the client specified by its Sihot object id.

Parameters
Return type

Record

Returns

client record data structure.

complete_res_data(rec)[source]

complete reservation data row (rec) with default values.

Parameters

rec (Record) – reservation data Record instance.

Return type

Record

Returns

completed reservation data Record instance.

un-changed fields:

ResRoomNo, ResNote, ResLongNote, ResFlightArrComment (flight no…), ResAllotmentNo, ResVoucherNo.

mandatory fields:

ShId or AcuId or Surname (to specify the orderer of the reservation), ResHotelId, ResArrival, ResDeparture, ResRoomCat, ResMktSegment, ResGdsNo, ResAdults, ResChildren.

optional fields:

ResPersons0PersSurname and ResPersons0PersForename (surname and forename) ResPersons1PersSurname and ResPersons1PersForename ( … )

optional auto-populated fields:

see the default values - specified in default_values dict underneath.

elem_path_join(elem_names)[source]

convert list of element names to element path.

Parameters

elem_names (List[str]) – list of element names.

Return type

str

Returns

element path.

hotel_and_res_id(shd)[source]

determine hotel and reservation ids.

Return type

Tuple[Optional[str], Optional[str]]

pax_count(shd)[source]

determine the number of PAX of the passed reservation record.

Return type

int

date_range_chunks(date_from, date_till, fetch_max_days)[source]

split date range into manageable chunks respecting the passed maximum days length and yield them back.

Return type

Iterator[Tuple[date, date]]

gds_no_to_ids(cae, hotel_id, gds_no)[source]

determine all reservation ids for a reservation with the passed GDS number.

Return type

Dict[str, Any]

gds_no_to_obj_id(cae, hotel_id, gds_no)[source]

determine the Sihot object id of a reservation identified by the GDS number.

Return type

str

res_no_to_ids(cae, hotel_id, res_id, sub_id)[source]

determine all reservation ids for a reservation with the passed reservation number.

Return type

Union[str, Dict[str, Any]]

res_no_to_obj_id(cae, hotel_id, res_id, sub_id)[source]

determine the Sihot object id of a reservation identified by their reservation number.

Return type

str

search reservations with the criteria specified by the parameters.

Parameters
  • cae – instance of the application environment specifying searched Sihot server.

  • date_from (date) – date of first day of included arrivals.

  • date_till (Optional[date]) – date of last day of included arrivals.

  • mkt_sources (Optional[List[str]]) – list of market source codes.

  • mkt_groups (Optional[List[str]]) – list of market group codes.

  • max_los (int) – integer with maximum length of stay.

  • search_flags (str) – string with search flag words (separated with semicolon).

  • search_scope (str) – string with search scope words (separated with semicolon).

  • chunk_pause (int) – integer with seconds to pause between fetch of date range chunks.

Return type

Union[str, Records]

Returns

string with error message if error or Records/list of Sihot reservations (Record instances).

obj_id_to_res_no(cae, obj_id)[source]

using RESERVATION-GET oc from KERNEL interface (see 7.3 in SIHOT KERNEL interface doc).

Parameters
  • cae (ConsoleApp) – Console App Environment instance.

  • obj_id (str) – Sihot Reservation Object Id.

Return type

tuple

Returns

reservation ids as tuple of (hotel_id, res_id, sub_id, gds_no) or (None, “error”) if not found

_strip_err_msg(error_msg)[source]
Return type

str

class FldMapXmlParser(cae, elem_map)[source]

Bases: ae.sys_core_sh.SihotXmlParser

extended xml parser converting data directly into a sys data Record structure.

__init__(cae, elem_map)[source]
clear_rec()[source]

clear the record data.

property rec: ae.sys_data.Record

return the record data.

Return type

Record

start(tag, attrib)[source]

process start of new xml element.

Return type

Optional[str]

data(data)[source]

process data of xml element.

Return type

Optional[str]

end(tag)[source]

process end of xml element.

Return type

Optional[str]

class ClientFromSihot(cae, elem_map=(('OBJID', 'ShId', None, <function <lambda>>), ('MATCHCODE', 'AcuId'), ('T-SALUTATION', 'Salutation'), ('T-TITLE', 'Title'), ('T-GUEST', 'GuestType', '1'), ('NAME-1', 'Surname'), ('NAME-2', 'Forename'), ('STREET', 'Street'), ('PO-BOX', 'POBox'), ('ZIP', 'Postal'), ('CITY', 'City'), ('T-COUNTRY-CODE', 'Country'), ('T-STATE', 'State', None, <function <lambda>>), ('T-LANGUAGE', 'Language'), ('T-NATION', 'Nationality', None, <function <lambda>>), ('COMMENT', 'Comment'), ('COMMUNICATION/', None, None, <function <lambda>>), ('PHONE-1', 'Phone'), ('PHONE-2', 'WorkPhone'), ('FAX-1', 'Fax'), ('EMAIL-1', 'Email'), ('EMAIL-2', 'EmailB'), ('MOBIL-1', 'MobilePhone'), ('MOBIL-2', 'MobilePhoneB'), ('/COMMUNICATION', None, None, <function <lambda>>), ('ADD-DATA/', None, None, <function <lambda>>), ('T-PERSON-GROUP', None, '1A'), ('D-BIRTHDAY', 'DOB', None, None, <function <lambda>>, <function <lambda>>), ('INTERNET-PASSWORD', 'Password'), ('MATCH-ADM', 'RciId'), ('MATCH-SM', 'SfId'), ('/ADD-DATA', None, None, <function <lambda>>)))[source]

Bases: ae.sys_data_sh.FldMapXmlParser

extended xml parser converting client data directly into a sys data Record structure.

__init__(cae, elem_map=(('OBJID', 'ShId', None, <function <lambda>>), ('MATCHCODE', 'AcuId'), ('T-SALUTATION', 'Salutation'), ('T-TITLE', 'Title'), ('T-GUEST', 'GuestType', '1'), ('NAME-1', 'Surname'), ('NAME-2', 'Forename'), ('STREET', 'Street'), ('PO-BOX', 'POBox'), ('ZIP', 'Postal'), ('CITY', 'City'), ('T-COUNTRY-CODE', 'Country'), ('T-STATE', 'State', None, <function <lambda>>), ('T-LANGUAGE', 'Language'), ('T-NATION', 'Nationality', None, <function <lambda>>), ('COMMENT', 'Comment'), ('COMMUNICATION/', None, None, <function <lambda>>), ('PHONE-1', 'Phone'), ('PHONE-2', 'WorkPhone'), ('FAX-1', 'Fax'), ('EMAIL-1', 'Email'), ('EMAIL-2', 'EmailB'), ('MOBIL-1', 'MobilePhone'), ('MOBIL-2', 'MobilePhoneB'), ('/COMMUNICATION', None, None, <function <lambda>>), ('ADD-DATA/', None, None, <function <lambda>>), ('T-PERSON-GROUP', None, '1A'), ('D-BIRTHDAY', 'DOB', None, None, <function <lambda>>, <function <lambda>>), ('INTERNET-PASSWORD', 'Password'), ('MATCH-ADM', 'RciId'), ('MATCH-SM', 'SfId'), ('/ADD-DATA', None, None, <function <lambda>>)))[source]
end(tag)[source]

process end of xml element.

Return type

Optional[str]

class ResFromSihot(cae)[source]

Bases: ae.sys_data_sh.FldMapXmlParser

extended xml parser converting reservation data directly into a sys data Record structure.

__init__(cae)[source]
end(tag)[source]

process end of xml element.

Return type

Optional[str]

class ClientFetch(cae)[source]

Bases: ae.sys_core_sh.SihotXmlBuilder

build xml and send to the Sihot system to fetch a client record.

__init__(cae)[source]

create an instance of this class.

Parameters
  • cae (ConsoleApp) – instance of the running ConsoleApp app.

  • use_kernel – pass True to use the Sihot kernel interface (False==use Sihot sxml interface).

fetch_client(obj_id, field_names=())[source]

return Record with guest data OR str with error message in case of error.

Return type

Union[str, Record]

response: Optional[ae.sys_core_sh.SihotXmlParser]
class ClientSearch(cae)[source]

Bases: ae.sys_core_sh.SihotXmlBuilder

search client.

__init__(cae)[source]

create an instance of this class.

Parameters
  • cae – instance of the running ConsoleApp app.

  • use_kernel – pass True to use the Sihot kernel interface (False==use Sihot sxml interface).

search_clients(matchcode='', exact_matchcode=True, name='', forename='', surname='', guest_no='', email='', guest_type='', flags='FIND-ALSO-DELETED-GUESTS', order_by='', limit=0, field_names=('ShId',), **kwargs)[source]

invoke the client search.

Return type

Union[str, list, Records]

client_id_by_matchcode(matchcode)[source]

determine client id for a client identified by its match code.

Return type

Optional[str]

response: Optional[ae.sys_core_sh.SihotXmlParser]
class ResFetch(cae, use_kernel=False)[source]

Bases: ae.sys_core_sh.SihotXmlBuilder

fetch reservation.

fetch_res(ho_id, gds_no='', res_id='', sub_id='', scope='USEISODATE')[source]

invoke request and fetch of reservation data.

Return type

Union[str, Record]

fetch_by_gds_no(ho_id, gds_no, scope='USEISODATE')[source]

fetch reservation identified by their GDS number.

Return type

Union[str, Record]

fetch_by_res_id(ho_id, res_id, sub_id, scope='USEISODATE')[source]

fetch reservation identified by their reservation number and sub-number.

Return type

Union[str, Record]

response: Optional[ae.sys_core_sh.SihotXmlParser]
class ResSearch(cae, use_kernel=False)[source]

Bases: ae.sys_core_sh.SihotXmlBuilder

search reservation.

search_res(hotel_id='', from_date=datetime.date(2021, 8, 27), to_date=datetime.date(2021, 8, 27), matchcode='', name='', gds_no='', flags='', scope='', guest_id='')[source]

invoke search of reservation.

Return type

Union[str, Records]

response: Optional[ae.sys_core_sh.SihotXmlParser]
class FldMapXmlBuilder(cae, use_kernel=False, elem_map=None)[source]

Bases: ae.sys_core_sh.SihotXmlBuilder

extended xml builder base class.

__init__(cae, use_kernel=False, elem_map=None)[source]

create an instance of this class.

Parameters
  • cae (ConsoleApp) – instance of the running ConsoleApp app.

  • use_kernel (bool) – pass True to use the Sihot kernel interface (False==use Sihot sxml interface).

get_warnings()[source]

get warning messages as concatenated string.

Return type

str

wipe_warnings()[source]

wipe all collected warning messages.

prepare_rec(rec)[source]

prepare record to push to Sihot.

prepare_map_xml(rec, include_empty_values=True)[source]

prepare and return xml string.

Return type

str

response: Optional[ae.sys_core_sh.SihotXmlParser]
class ClientToSihot(cae)[source]

Bases: ae.sys_data_sh.FldMapXmlBuilder

extended xml builder class to send/push client data to Sihot.

__init__(cae)[source]

create an instance of this class.

Parameters
  • cae – instance of the running ConsoleApp app.

  • use_kernel – pass True to use the Sihot kernel interface (False==use Sihot sxml interface).

static _complete_client_data(rec)[source]
prepare_rec(rec)[source]

prepare client record for the push to Sihot.

_prepare_guest_xml(rec, fld_name_suffix='')[source]

prepare extra guest data.

prepare guest links.

Return type

str

_send_person_to_sihot(rec, first_person='')[source]

send client data of one person to Sihot, passing AcuId of first person to send 2nd person.

Return type

str

send_client_to_sihot(rec)[source]

send client data to Sihot.

Return type

str

response: Optional[ae.sys_core_sh.SihotXmlParser]
_warning_msgs: List[str]
class ResToSihot(cae)[source]

Bases: ae.sys_data_sh.FldMapXmlBuilder

extended xml builder to send reservation data to Sihot.

__init__(cae)[source]

create an instance of this class.

Parameters
  • cae (ConsoleApp) – instance of the running ConsoleApp app.

  • use_kernel – pass True to use the Sihot kernel interface (False==use Sihot sxml interface).

_add_sihot_configs(rec)[source]
prepare_rec(rec)[source]

prepare reservation data to be sent/pushed to Sihot system.

_prepare_res_xml(rec)[source]
_sending_res_to_sihot(rec)[source]
Return type

str

_handle_error(rec, err_msg)[source]
Return type

str

_ensure_clients_exist_and_updated(rec, ensure_client_mode)[source]
Return type

str

send_res_to_sihot(rec, ensure_client_mode=0)[source]

send reservation to Sihot system.

Return type

str

static res_id_label()[source]

reservation ids log and debug message label.

Return type

str

static res_id_values(rec)[source]

reservation ids log and debug message data.

Return type

str

res_id_desc(rec, err_msg, separator='\\n\\n', indent=8)[source]

extended reservation ids log and debug message data.

Return type

str

wipe_gds_errors()[source]

wipe collected gds errors.

response: Optional[ae.sys_core_sh.SihotXmlParser]
_warning_msgs: List[str]
class BulkFetcherBase(cae, add_kernel_port=True)[source]

Bases: object

helper base class for bulk data fetches.

__init__(cae, add_kernel_port=True)[source]
add_options()[source]

add command line option.

load_options()[source]

load command line option.

print_options()[source]

print command line option to console output.

class GuestBulkFetcher(cae, add_kernel_port=True)[source]

Bases: ae.sys_data_sh.BulkFetcherBase

WIP/NotUsed/NoTests: the problem is with GUEST-SEARCH is that there is no way to bulk fetch all guests because the search criteria is not providing range search to split in slices. Fetching all 600k clients is resulting in a timeout error after 30 minutes (see Sihot interface SDF_SH_TIMEOUT/’shTimeout’ option value)

fetch_all()[source]

fetch and return all found records.

Return type

Records

class ResBulkFetcher(cae, allow_future_arrivals=True)[source]

Bases: ae.sys_data_sh.BulkFetcherBase

reservation bulk fetch.

__init__(cae, allow_future_arrivals=True)[source]
add_options()[source]

add command line options.

load_options()[source]

load command line options.

print_options()[source]

print command line options.

date_range_str()[source]

determine date range as string value.

Return type

str

fetch_all()[source]

fetch bulk reservation data.

Return type

Records

class ResSender(cae)[source]

Bases: ae.sys_data_sh.ResToSihot

helper class to send reservation records to Sihot.

send_rec(rec)[source]

send reservation record.

Return type

Tuple[str, str]

response: Optional[ae.sys_core_sh.SihotXmlParser]
_warning_msgs: List[str]
_gds_errors: Dict[str, Tuple[ae.sys_data.Record, str]]
get_res_no()[source]

determine reservation number of sent reservation.

Return type

tuple