7. Reference Guide¶
7.1. Proxies¶
# ===========================================================================
# Interface between the ION and Python. Provides Proxy object to connect
# to ION.
#
# Author: Marc Sanchez Net
# Date: 04/17/2019
# Copyright (c) 2019, California Institute of Technology (“Caltech”).
# U.S. Government sponsorship acknowledged.
# ===========================================================================
- pyion.proxies.get_bp_proxy(node_nbr)[source]¶
Returns a BpProxy for a given node number. If it already exists, it gives you the already instantiated copy.
- Param:
Node number
- Returns:
BpProxy object
- pyion.proxies.get_cfdp_proxy(peer_entity_nbr)[source]¶
Returns a CfdpProxy for a given peer entity number. If it already exists, it gives you the already instantiated copy.
- Param:
Peer entity number
- Returns:
CfdpProxy object
- pyion.proxies.get_ltp_proxy(client_id)[source]¶
Returns an LtpProxy for a given client application. If it already exists, it gives you the already instantiated copy.
- Param:
Client id (number)
- Returns:
LtpProxy object
7.2. Bundle Protocol¶
7.3. Licklider Transmission Protocol¶
# =========================================================================== # Interface between the ION’s implementation of the CCSDS LTP and Python. # Internally, all classes call the C Extension _ltp. # # Author: Marc Sanchez Net # Date: 05/30/2019 # Copyright (c) 2019, California Institute of Technology (“Caltech”). # U.S. Government sponsorship acknowledged. # ===========================================================================
7.4. CCSDS File Delivery Protocol¶
# =========================================================================== # Interface between the ION’s implementation of the CCSDS CFDP and Python. # Internally, all classes call the C Extension _cfdp. # # Author: Marc Sanchez Net # Date: 04/17/2019 # Copyright (c) 2019, California Institute of Technology (“Caltech”). # U.S. Government sponsorship acknowledged. # ===========================================================================
- class pyion.cfdp.Entity(proxy, peer_entity_nbr, param_addr, endpoint, mode, closure_latency, seg_metadata)[source]¶
Bases:
objectClass to represent a CFDP entity.
- add_filestore_request(action, file1, file2=None)[source]¶
Add a user message to all CFDP PDUs in the next transaction
- Parameters:
action – See
pyion.CFDP_CREATE_FILE, etc.file1 – String or Path-object
file2 – None, string or Path-object.
- add_usr_message(msg)[source]¶
Add a user message to all CFDP PDUs in the next transaction
- Parameters:
str – User message to add
- cfdp_report()[source]¶
Request issuance on the transmission/reception progress of the current CFDP transaction.
- cfdp_request(source_file, dest_file=None, mode=None, closure_lat=None, seg_metadata=None)[source]¶
Request a file to be sent to this node using CFDP
- Parameters:
source_file – str or Path of file to request
dest_file – str or Path. Name of file at this node once it is received. Defaults to
source_file**kwargs –
See
proxy.cfdp_send
- cfdp_send(source_file, dest_file=None, mode=None, closure_lat=None, seg_metadata=None)[source]¶
Send a file using CFDP to the peer engine for this entity
- Parameters:
source_file – str or Path of file to send
dest_file – str or Path. Name of file at receiving engine. It defaults to source_file
**kwargs –
See
proxy.cfdp_send
- property is_open¶
Returns True if entity is opened
- register_event_handler(event, func)[source]¶
Register and event handler for this entity
- Parameters:
event – See
pyion.constants.CFDP_CREATE_FILE, etc.func – Function handle with the following signature
def ev_handler(params), where params is a dictionary with contents that depend on the type of event (see CCSDS CFDP spec, section 3.5.6)
7.5. ION Memory/Storage Functions¶
# =========================================================================== # Defines proxies to ION’s SDR and PSM so that you can monitor them. # # Author: Marc Sanchez Net # Date: 08/12/2019 # Copyright (c) 2019, California Institute of Technology (“Caltech”). # U.S. Government sponsorship acknowledged. # ===========================================================================
7.6. ION Management Functions¶
# =========================================================================== # Defines management ION functions. # # Author: Marc Sanchez Net # Date: 08/21/2019 # Copyright (c) 2019, California Institute of Technology (“Caltech”). # U.S. Government sponsorship acknowledged. # ===========================================================================
- pyion.mgmt.bp_endpoint_exists(eid)[source]¶
Check if an endpoint has been defined in ION.
- Parameters:
eid (str) – E.g., ipn:1.1.
- Return bool:
True if endpoint is defined in ION
- pyion.mgmt.cgr_add_contact(orig, dest, tstart, tend, rate, region_nbr=1, confidence=1.0, announce=True)[source]¶
Add a contact to ION’s contact plan
- Parameters:
orig (int) – Node number of the contact origin
dest (int) – Node number of the contact destination
tstart (str) – Contact start time. Format is
yyyy/mm/dd-hh:MM:ssor+0tend (str) – Contact end time. Format is
yyyy/mm/dd-hh:MM:ssor+0rate (float) – Contact data rate in [bits/sec].
region_nbr (int) – Region index. Defaults to 1.
confidence (float) – Contact confidence. Defaults to 1.
announce (bool) – If True, the information of this contact will be multicasted to all nodes in the region. Default is True
Warning
The contact data rate gets transformed to bytes/sec and rounded internally
- pyion.mgmt.cgr_add_range(orig, dest, tstart, tend, owlt=0.0, announce=True)[source]¶
Add a range to ION’s contact plan
- Parameters:
orig (int) – Node number of the contact origin
dest (int) – Node number of the contact destination
tstart (str) – Contact start time. Format is
yyyy/mm/dd-hh:MM:sstend (str) – Contact end time. Format is
yyyy/mm/dd-hh:MM:ssowlt (float) – Range in light seconds.
announce (bool) – If True, the information of this contact will be multicasted to all nodes in the region. Default is True
Warning
The owlt gets rounded internally
- pyion.mgmt.cgr_delete_contact(orig, dest, tstart=None, region_nbr=1, announce=True)[source]¶
Delete a contact from ION’s contact plan
- Parameters:
orig (int) – Node number of the contact origin
dest (int) – Node number of the contact destination.
tstart (str) – Contact start time. If None, all contacts between orig and dest are deleted. Format is
yyyy/mm/dd-hh:MM:ssregion_nbr (int) – Region number for this node. Defaults to 1
announce (bool) – If True, the information of this contact will be multicasted to all nodes in the region. Default is True
- pyion.mgmt.cgr_delete_range(orig, dest, tstart=None)[source]¶
Delete a range from ION’s contact plan
- pyion.mgmt.cgr_list_contacts()[source]¶
List all contacts in ION’s contact plan.
- Return List[Dict]:
Each dict is a contact defined as: {orig:, dest:, tstart:, tend:, rate:, confidence:, }
Tip
The data rate is returned in [bits/sec]
- pyion.mgmt.cgr_list_ranges()[source]¶
List all ranges in ION’s contact_plan
- Return List[Dict]:
Each dict is a range defined as: {orig:, dest:, tstart:, tend:, owlt:}
7.7. Constants¶
# =========================================================================== # This file constains all the constants used in pyion # # Author: Marc Sanchez Net # Date: 04/17/2019 # Copyright (c) 2019, California Institute of Technology (“Caltech”). # U.S. Government sponsorship acknowledged. # ===========================================================================
- class pyion.constants.BpAckReqEnum(value)[source]¶
Bases:
IntEnumBP application acknowledgement enumeration. See
help(BpAckReqEnum)
- class pyion.constants.BpCustodyEnum(value)[source]¶
Bases:
IntEnumBP custody switch enumeration. See
help(CustodyEnum)
- class pyion.constants.BpEcsEnumeration(value)[source]¶
Bases:
IntEnumBP extended class-of-service enumeration. See
help(BpEcsEnumeration)BP_MINIMUM_LATENCY: Forward bundle on all routes
BP_BEST_EFFORT: Send using an unreliable convergence layer
BP_RELIABLE: Send using a reliable convergence layer
BP_RELIABLE_STREAMING: BP_BEST_EFFORT | BP_RELIABLE
- class pyion.constants.BpPriorityEnum(value)[source]¶
Bases:
IntEnumBP priority enumeration. See
help(BpPriorityEnum)
- class pyion.constants.BpReportsEnum(value)[source]¶
Bases:
IntEnumBP reports enumeration. See
help(BpReportsEnum)
- class pyion.constants.CfdpClosure(value)[source]¶
Bases:
IntEnumLength of time following transmission of the EOF PDU within which a responding Transaction Finish PDU is expected. If no Finish PDU is requested, this parameter value should be zero.
Tip
If you need a number of seconds not specified as an option in this enumeration, simply pass it directly.
- class pyion.constants.CfdpConditionEnum(value)[source]¶
Bases:
IntEnumCFDP condition types. See
help(CfdpConditionEnum)
- class pyion.constants.CfdpDeliverCodeEnum(value)[source]¶
Bases:
IntEnumCFDP delivery code enumeration. See
help(CfdpDeliverCodeEnum)
- class pyion.constants.CfdpEventEnum(value)[source]¶
Bases:
IntEnumCFDP event types. See
help(CfdpEventEnum)and Section 3.5.6 of CCSDS CFDP
- class pyion.constants.CfdpFileStatusEnum(value)[source]¶
Bases:
IntEnumCFDP file status enumeration. See
help(CfdpFileStatusEnum)
- class pyion.constants.CfdpFileStoreEnum(value)[source]¶
Bases:
IntEnumCFDP file store actions. See
help(CfdpFileStoreEnum)
7.8. Utilities¶
# =========================================================================== # Module with utility functions and classes for pyion # # Author: Marc Sanchez Net # Date: 04/17/2019 # Copyright (c) 2019, California Institute of Technology (“Caltech”). # U.S. Government sponsorship acknowledged. # ===========================================================================
- pyion.utils.check_ion_env_vars(ION_NODE_LIST_DIR)[source]¶
Check the ION environment variables to ensure they are consistent (e.g., the paths set are valid and exist in the host).
Host environment variables are only utilized if the module variables
pyion.ION_PWDandpyion.ION_NODE_LIST_DIRare None.