trigger
Usage
prism create trigger is used to create and update the triggers YML configuration file.
Usage: prism create trigger [OPTIONS]
Create a triggers YML file at the TRIGGERS_YML_PATH in prism_project.py.
Examples:
โข prism create trigger
โข prism create trigger -v TRIGGERS_YML_PATH=/Users/.prism/triggers.yml
โข prism create trigger --context '{"TRIGGERS_YML_PATH": "/Users/.prism/triggers.yml"}'
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --type -t [function] Trigger type. Default is function โ
โ --log-level -l [info|warn|error|debug] Set the log level โ
โ --full-tb Show the full traceback when an error occurs โ
โ --vars -v TEXT Variables as key value pairs. These overwrite variables in prism_project.py. All values โ
โ are intepreted as strings. โ
โ --context TEXT Context as a dictionary. Must be a valid JSON. These overwrite variables in โ
โ prism_project.py โ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏHere's what prism create trigger does under the hood:
Parses the
prism_project.pyfile and gets theTRIGGERS_YML_PATHvalue. If this value isn't specified, then it defaults to the project directory.It checks to see if
TRIGGERS_YML_PATHexistsIf it doesn't, it creates a file at
TRIGGERS_YML_PATHand populates it with a trigger of type--typeIf it does, it then adds a profile of type
--typeto the existing file
Example
Here's what the output will look like in Terminal (if there are no errors in the project):
Here's what the triggers.yml file looks like after running the above command:
Required arguments
Here are the required arguments you must specify with trigger:
--type: Trigger type. As of now, only typefunctionis supported.
Optional arguments
Here are the optional arguments you can run with trigger:
--full-tb: Display full traceback if errors arise at any stage of the pipeline--log-level: Log level, one ofinfo,warn,error, orcritical.--vars: Prism variables as key-value pairskey=value. These overwrite any variable definitions inprism_project.py. All values are read as strings.--context: Prism variables as JSON. Cannot co-exist with--vars. These overwrite any variable definitions inprism_project.py.
Last updated