bexchange.client package

Submodules

bexchange.client.cfgcmd module

class bexchange.client.cfgcmd.Command[source]

Bases: object

command-line client command interface

abstract execute(opts, args)[source]

execute this command

Parameters:
  • opts – options passed from command line

  • args – arguments passed from command line

classmethod get_commands()[source]
classmethod get_implementation_by_name(name)[source]

get an implementing class by name

the implementing class is looked up from ‘bexchange.config.commands’ entry point.

Raise:

LookupError if not found

abstract update_optionparser(parser)[source]
class bexchange.client.cfgcmd.CreateKeys[source]

Bases: Command

create_crypto_key(opts)[source]
create_keyczar_keys(opts)[source]
createdir(d)[source]
execute(opts, args)[source]

execute this command

Parameters:
  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
class bexchange.client.cfgcmd.CreatePublication[source]

Bases: Command

execute(opts, args)[source]

execute this command

Parameters:
  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
class bexchange.client.cfgcmd.CreateSubscription[source]

Bases: Command

README(nodename)[source]
execute(opts, args)[source]

execute this command

Parameters:
  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
exception bexchange.client.cfgcmd.ExecutionError[source]

Bases: RuntimeError

class bexchange.client.cfgcmd.SendDexFile[source]

Bases: Command

execute(opts, args)[source]

execute this command

Parameters:
  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
class bexchange.client.cfgcmd.SendDexKey[source]

Bases: Command

execute(opts, args)[source]

execute this command

Parameters:
  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
class bexchange.client.cfgcmd.TestFilter[source]

Bases: Command

execute(opts, args)[source]

execute this command

Parameters:
  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
bexchange.client.cfgcmd.read_config(conffile)[source]

bexchange.client.cmd module

class bexchange.client.cmd.BatchTest[source]

Bases: Command

SRC_MAPPING = {'seang': 'WMO:02606,RAD:SE50,PLC:Ängelholm,CMT:seang,NOD:seang', 'seatv': 'WMO:02570,RAD:SE48,PLC:Åtvidaberg,CMT:seatv,NOD:seatv', 'sebaa': 'WMO:00000,RAD:SE52,PLC:Bålsta,CMT:sebaa,NOD:sebaa', 'sehem': 'WMO:02588,RAD:SE47,PLC:Hemse,CMT:sehem,NOD:sehem', 'sehuv': 'WMO:02334,RAD:SE44,PLC:Hudiksvall,CMT:sehuv,NOD:sehuv', 'sekaa': 'WMO:02666,RAD:SE51,PLC:Karlskrona,CMT:sekaa,NOD:sekaa', 'sekrn': 'WMO:02032,RAD:SE40,PLC:Kiruna,CMT:sekrn,NOD:sekrn', 'selek': 'WMO:02430,RAD:SE45,PLC:Leksand,CMT:selek,NOD:selek', 'sella': 'WMO:02092,RAD:SE41,PLC:Luleå,CMT:sella,NOD:sella', 'seoer': 'WMO:02262,RAD:SE43,PLC:Örnsköldsvik,CMT:seoer,NOD:seoer', 'seosd': 'WMO:02200,RAD:SE42,PLC:Östersund,CMT:seosd,NOD:seosd', 'sevax': 'WMO:02600,RAD:SE49,PLC:Vara,CMT:sevax,NOD:sevax'}
execute(server, opts, args)[source]

execute this command

Parameters:
  • database – a database instance to operate on

  • opts – options passed from command line

  • args – arguments passed from command line

get_closest_time(interval)[source]
parse_datetime_str(dtstr, interval)[source]
update_optionparser(parser)[source]
class bexchange.client.cmd.Command[source]

Bases: object

command-line client command interface

abstract execute(database, opts, args)[source]

execute this command

Parameters:
  • database – a database instance to operate on

  • opts – options passed from command line

  • args – arguments passed from command line

classmethod get_commands()[source]
classmethod get_implementation_by_name(name)[source]

get an implementing class by name

the implementing class is looked up from ‘baltrad.bdbclient.commands’ entry point.

Raise:

LookupError if not found

abstract update_optionparser(parser)[source]
exception bexchange.client.cmd.ExecutionError[source]

Bases: RuntimeError

class bexchange.client.cmd.FileArrival[source]

Bases: Command

execute(server, opts, args)[source]

execute this command

Parameters:
  • database – a database instance to operate on

  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
class bexchange.client.cmd.GetStatistics[source]

Bases: Command

execute(server, opts, args)[source]

execute this command

Parameters:
  • database – a database instance to operate on

  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
class bexchange.client.cmd.ListStatisticIds[source]

Bases: Command

execute(server, opts, args)[source]

execute this command

Parameters:
  • database – a database instance to operate on

  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
class bexchange.client.cmd.PostJsonMessage[source]

Bases: Command

execute(server, opts, args)[source]

execute this command

Parameters:
  • database – a database instance to operate on

  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
class bexchange.client.cmd.ServerInfo[source]

Bases: Command

execute(server, opts, args)[source]

execute this command

Parameters:
  • database – a database instance to operate on

  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
class bexchange.client.cmd.StoreFile[source]

Bases: Command

execute(server, opts, args)[source]

execute this command

Parameters:
  • database – a database instance to operate on

  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]
class bexchange.client.cmd.Supervise[source]

Bases: Command

execute(server, opts, args)[source]

execute this command

Parameters:
  • database – a database instance to operate on

  • opts – options passed from command line

  • args – arguments passed from command line

update_optionparser(parser)[source]

bexchange.client.rest module

class bexchange.client.rest.Auth[source]

Bases: object

abstract add_credentials(req)[source]

add authorization credentials to the request

Parameters:

req – a Request to update

class bexchange.client.rest.CryptoAuth(signer, nodename)[source]

Bases: Auth

authenicate by signing messages with internal crypto-functionality

add_credentials(req)[source]

add authorization credentials to the request

Parameters:

req – a Request to update

class bexchange.client.rest.NoAuth[source]

Bases: Auth

no authentication

add_credentials(req)[source]

add authorization credentials to the request

Parameters:

req – a Request to update

class bexchange.client.rest.Request(method, path, data=None, headers={})[source]

Bases: object

class bexchange.client.rest.RestfulServer(server_url, auth)[source]

Bases: object

Access database over the RESTful interface

execute_request(req)[source]

Exececutes the actual rest request over http or https. Will also add credentials to the request :param req: The REST request

file_arrival(source, object_type, limit)[source]

posts a json message to the exchange server. :param data: The data

get_server_info(subcommand, **kwargs)[source]

posts a json message to the exchange server. :param data: The data

get_statistics(spid, sources, totals=False, qmethod=None, qfilter=None, object_type=None, origins=None)[source]

posts a json message to the exchange server. :param data: The data

list_statistics()[source]

posts a json message to the exchange server. :param data: The data

post_json_message(json_message)[source]

posts a json message to the exchange server. :param data: The data

server_url()[source]
store(data)[source]

stores the data in the exchange server. :param data: The data

supervise(infotype, source, origins, object_type, limit, entrylimit, delay, count)[source]

posts a json message to the exchange server. :param data: The data

class bexchange.client.rest.TinkAuth(key_path, key_name=None)[source]

Bases: Auth

authenicate by signing messages with Tink

add_credentials(req)[source]

add authorization credentials to the request

Parameters:

req – a Request to update

bexchange.client.rest.create_signable_string(req)[source]

construct a signable string from a Request

See Crypto authentication provider for details.

Module contents