-
Notifications
You must be signed in to change notification settings - Fork 23
Custom Scripts using jans cli
jans-cli provides options to perform CRUD (Create, Read, Update and Delete) operations on the custom scripts. To perform the custom script related operations select option 13 from the main menu.
-
There is an option to get the tabular list of all the custom scripts. This table displays a selection number, scriptType, Name, enabled (true/ false) and inum of all scripts. To display all the details of script input the script number (from first column) in the selection choice.
-
Next option is to add a new script. On selection of this option the cli will sequentially prompt (one at a time) for around 17 mandatory and optional data related to the script. inum is the extensible resource identifier (XRI) i-number, which is the identifier to uniquely identify a script.
- dn
- Inum
- aliases (optional)
- Description
- script Code: input _file </script/file/path/filename.py>
- scriptType: Input a valid script type in upper case
- programmingLanguage: input PYTHON/ JAVASCRIPT
- Add SimpleCustomProperty? : Choices are y/n. It will further prompt for following three sub fields on pressing y.
- value1: location_type
- value2: ldap
- description: (optional)
- Add another SimpleCustomProperty? (y/n)
- Add SimpleExtendedCustomProperty? (y/n). On pressing y, it will prompt for following four sub fields.
- value1: path
- value2: /opt/jans/config.txt
- description: path of config file
- hide [false]:
- Add another SimpleExtendedCustomProperty? (y/n)
- script level: (1 to 100)
- revision number:
- enabled (true is script enabled) [false]:
- Data for object scriptError. Possible errors associated with the script. It has following two sub fields:
- raisedAt:
- stackTrace:
- modified [false]:
- internal [false]:
-
After getting all the details jans-cli displays the input data and asks for user confirmation to continue with these data. On pressing y it will save the script and display all saved details.
-
Update script option also works in a similar style. Using inum it retrieves the script first then all existing values will be displayed as default value on the prompt. User has the option to update the values. Besides updating these values the update script choice also gives users to add new simple and simple extended properties. Since it is an update option there will not be any default value of revision. The scriptError field and its sub-fields will be populated with error (if any) in the execution of the script.
-
Delete script option will delete script using its inum. It will prompt for inum of the script to delete it and then gets the user's confirmation to delete the script.
-
Click here for further details on using jans-cli.