netunicorn.base.environment_definitions.RuntimeContext¶
- class RuntimeContext(ports_mapping=<factory>, environment_variables=<factory>, network=None, additional_arguments=<factory>)[source]¶
Bases:
objectStores a runtime context for a Deployment, such as port mapping or environment variables, that would be available during deployment
- Parameters:
ports_mapping (
Dict[int,int], default:<factory>) – map of ports to be mapped to the hostenvironment_variables (
Dict[str,str], default:<factory>) – map of environment variables to be setadditional_arguments (
List[str], default:<factory>) – list of additional arguments to be passed to the runtimenetwork (
Optional[str], default:None)
Attributes
Desired network or interface name
Desired port mapping (for all protocols)
Desired values of environment variables
Additional arguments (could be interpreted by runtimes)
Methods
Creates RuntimeContext from JSON representation.
- classmethod from_json(data)[source]¶
Creates RuntimeContext from JSON representation.
- Parameters:
data (
RuntimeContextRepresentation) – JSON representation of RuntimeContext- Returns:
RuntimeContext– Deserialized RuntimeContext