Prerequisite: Know how to use the Janssen CLI in command-line mode
Agama#
In Janssen, You can deploy and customize agama project using commandline. To get the details of Janssen commandline feature of Agama, you can run this command as below:
/opt/jans/jans-cli/config-cli.py --info Agama
It will show you the details of available operation-id for Agama.
Operation ID: get-agama-prj-by-name
Description: Fetches deployed Agama project based on name.
Parameters:
name: Agama project name [string]
Operation ID: post-agama-prj
Description: Deploy an Agama project.
Parameters:
name: Agama project name [string]
Operation ID: delete-agama-prj
Description: Delete a deployed Agama project.
Parameters:
name: Agama project name [string]
Operation ID: get-agama-prj-configs
Description: Retrieve the list of configs based on name.
Parameters:
name: Agama project name [string]
Operation ID: put-agama-prj
Description: Update an Agama project.
Parameters:
name: Agama project name [string]
Parameters:
type: Description not found for this property
additionalProperties: Description not found for this property
Operation ID: get-agama-prj
Description: Retrieve the list of projects deployed currently.
Parameters:
start: No description is provided for this parameter [integer]
count: No description is provided for this parameter [integer]
List of Deployed Projects#
To retrieve the list of deployed agama projects:
/opt/jans/jans-cli/config-cli.py --operation-id get-agama-prj
To get details of all the agama flows:
/opt/jans/jans-cli/config-cli.py --operation-id get-agama-prj
Please wait while retrieving data ...
{
"start": 0,
"totalEntriesCount": 1,
"entriesCount": 1,
"entries": [
{
"dn": "jansId=46546e9a-fed6-34d0-ba63-b615233b2115,ou=deployments,ou=agama,o=jans",
"id": "46546e9a-fed6-34d0-ba63-b615233b2115",
"createdAt": "2023-08-13T14:45:27",
"taskActive": false,
"finishedAt": "2023-08-13T14:45:43",
"details": {
"error": "There were problems processing one or more flows",
"flowsError": {
"mmrraju.np.test.me": null,
"mmrraju.test2.agama": null,
"mmrraju.u2f.me": "Syntax error: mismatched input '<EOF>' expecting {'|', 'Log', 'Trigger', 'Call', 'RRF', 'When', 'Repeat', 'Iterate over', 'Match', 'Finish', 'RFAC', ALPHANUM, QNAME, DOTEXPR, DOTIDXEXPR, WS}\nSymbol: [@9,43:42='<EOF>',<-1>,2:23]\nLine: 2\nColumn: 24"
},
"projectMetadata": {
"projectName": "user_pass_auth",
"author": "mmrraju",
"type": "community",
"description": "This is password based authentication",
"version": "1.0.34",
"configs": null
}
},
"baseDn": "jansId=46546e9a-fed6-34d0-ba63-b615233b2115,ou=deployments,ou=agama,o=jans"
}
]
}
It will display the total number of agama flows that are enabled and their list. You can get modified list using supported parameters.
Endpoint Arguments#
start
: Should be an integer value. It's an index value of starting point of the list.
count
: Should be an integer value. Total entries number you want to display.
Example:
/opt/jans/jans-cli/config-cli.py --operation-id get-agama-prj --endpoint-args start:1,count:1
Please wait while retrieving data ...
{
"start": 1,
"totalEntriesCount": 3,
"entriesCount": 1,
"entries": [
{
"dn": "jansId=3a0e91a4-b79b-37c2-9df7-122247e8ed9c,ou=deployments,ou=agama,o=jans",
"id": "3a0e91a4-b79b-37c2-9df7-122247e8ed9c",
"createdAt": "2023-08-15T05:56:19",
"taskActive": false,
"finishedAt": "2023-08-15T05:56:42",
"details": {
"error": "Archive missing web and/or code subdirectories",
"flowsError": null,
"projectMetadata": {
"projectName": "testAuth",
"configs": null
}
},
"baseDn": "jansId=3a0e91a4-b79b-37c2-9df7-122247e8ed9c,ou=deployments,ou=agama,o=jans"
}
]
}
View Agama Project By Name#
You can get the details of an Agama project deployed in Janssen by the project name. Commandline for this operation as below:
/opt/jans/jans-cli/config-cli.py --operation-id get-agama-prj-by-name --endpoint-args name:"agama-project-name"
Example:
/opt/jans/jans-cli/config-cli.py --operation-id get-agama-prj-by-name --endpoint-args name:testAuth
Please wait while retrieving data ...
{
"dn": "jansId=3a0e91a4-b79b-37c2-9df7-122247e8ed9c,ou=deployments,ou=agama,o=jans",
"id": "3a0e91a4-b79b-37c2-9df7-122247e8ed9c",
"createdAt": 1687247278717,
"taskActive": false,
"finishedAt": 1687247288646,
"assets": null,
"details": {
"folders": null,
"libs": [],
"flowsError": {
"imShakil.co.basicAuth": null
},
"error": null,
"projectMetadata": {
"projectName": "testAuth",
"author": "imShakil",
"type": "community",
"description": "testing authentication with janssen server",
"version": "1.0.0",
"configs": null
}
},
"baseDn": "jansId=3a0e91a4-b79b-37c2-9df7-122247e8ed9c,ou=deployments,ou=agama,o=jans"
}
Post Agama Project in Janssen#
Also, You can deploy agama project in Janssen through commandline.
/opt/jans/jans-cli/config-cli.py --operation-id post-agama-prj --endpoint-args name:agama-project-name
Retrieve Agama Project Configuration#
To retrieve agama project configuration:
/opt/jans/jans-cli/config-cli.py --operation-id get-agama-prj-configs --endpoint-args name:agama-project-name
Update Agama Project#
To update existing agama project:
/optjans/jans-cli/config-cli.py --operation-id put-agama-prj --endpoint-args name:agama-project-name
Delete Agama Project#
To delete agama project by its name:
/opt/jans/jans-cli/config-cli.py --operation-id delete-agama-prj --endpoint-args name:agama-project-name
Agama Flow Configuration#
If you already deployed agama projects successfully in your janssen server through above operations, you can check those agama flow status with these below operations:
/opt/jans/jans-cli/config-cli.py --info AgamaConfiguration
Operation ID: agama-syntax-check
Description: Determine if the text passed is valid Agama code
Parameters:
qname: Agama Flow name [string]
Agama Flow Syntax#
/opt/jans/jans-cli/config-cli.py --operation-id agama-syntax-check --url-suffix qname:
You can do some syntax check with this operation-id. It will help to find out syntax error in agama low code projects.
Example:
/opt/jans/jans-cli/config-cli.py --operation-id agama-syntax-check --url-suffix qname:"imShakil.co.test"
Server Response:
{
"error": "mismatched input 'newline' expecting 'Flow'",
"symbol": "[@0,0:-1='newline',<9>,1:0]",
"line": 1,
"column": 0,
"message": "Syntax error: mismatched input 'newline' expecting 'Flow'\nSymbol: [@0,0:-1='newline',<9>,1:0]\nLine: 1\nColumn: 1"
}
Created: 2023-07-05