Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): removed Agama Developer Studio reference #5874

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
314 changes: 166 additions & 148 deletions docs/admin/config-guide/agama-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,154 @@ tags:
---
> Prerequisite: Know how to use the Janssen CLI in [command-line mode](config-tools/jans-cli/README.md)

# Agama Developer Studio
# Agama

In Janssen, You can deploy and customize agama project using commandline. To get the details of Janssen commandline feature of Agama Developer Studio, you can run this command as below:
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 AgamaDeveloperStudio
/opt/jans/jans-cli/config-cli.py --info Agama
```

It will show you the details of available operation-id for Agama developer studio.
It will show you the details of available operation-id for Agama.

## View Agama Developer Studio Project
```
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]
```

<!-- Table to be added later

|Operation-id | url-suffix | endpoint-args | Description | Example |
|--- |--- |--- |--- |--- |
| `get-agama-prj` | NA | `start`,`count` | | |
| `post-agama-prj` | `name` | NA | | |
| | | | | |

-->

## 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-dev-studio-prj-by-name --url-suffix name:"agama-project-name"
/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-dev-studio-prj-by-name --url-suffix name:testAuth
/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",
Expand Down Expand Up @@ -55,177 +182,68 @@ Please wait while retrieving data ...
}
```

## Post Agama Developer Studio Project in Janssen
## 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-dev-studio-prj --url-suffix name:"agama-project-name"
/opt/jans/jans-cli/config-cli.py --operation-id post-agama-prj --endpoint-args name:agama-project-name
```

## Retrieve Agama Project Configuration

# Agama Flow Configuration

If you already deployed agama projects successfully in your janssen server through [above](#agama-developer-studio) operations, you can check those agama flow status with these below operations:
To retrieve agama project configuration:

```
/opt/jans/jans-cli/config-cli.py --info AgamaConfiguration
/opt/jans/jans-cli/config-cli.py --operation-id get-agama-prj-configs --endpoint-args name:agama-project-name
```

Operation ID: get-agama-flows
Description: Fetches all agama flow.
Parameters:
pattern: Search pattern [string]
limit: Search size - max size of the results to return [integer]
startIndex: The 1-based index of the first query result [integer]
sortBy: Attribute whose value will be used to order the returned response [string]
sortOrder: Order in which the sortBy param is applied. Allowed values are "ascending" and "descending" [string]
includeSource: Boolean flag to indicate agama source is to be included [boolean]
Operation ID: post-agama-flow
Description: Create a new agama flow
Schema: Flow
Operation ID: get-agama-flow
Description: Gets an agama flow based on Qname.
Parameters:
qname: Agama Flow name [string]
includeSource: Boolean flag to indicate agama source is to be included [boolean]
Operation ID: post-agama-flow-from-source
Description: Create a new agama flow from source.
Parameters:
qname: Agama Flow name [string]
## 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
```

## Get Agama Flow

To get details of all the agama flows:
## Delete Agama Project

To delete agama project by its name:
```
/opt/jans/jans-cli/config-cli.py --operation-id get-agama-flows
Please wait while retrieving data ...
{
"start": 0,
"totalEntriesCount": 2,
"entriesCount": 2,
"entries": [
{
"dn": "agFlowQname=imShakil.co.basicAuth,ou=flows,ou=agama,o=jans",
"qname": "imShakil.co.basicAuth",
"revision": 0,
"enabled": true,
"metadata": {
"funcName": "_imShakil_co_basicAuth",
"author": "imShakil",
"timestamp": 1688453467147
},
"baseDn": "agFlowQname=imShakil.co.basicAuth,ou=flows,ou=agama,o=jans"
},
{
"dn": "agFlowQname=mmrraju.test2.agama,ou=flows,ou=agama,o=jans",
"qname": "mmrraju.test2.agama",
"revision": 0,
"enabled": true,
"metadata": {
"funcName": "_mmrraju_test2_agama",
"author": "mmrraju",
"timestamp": 1688451217241
},
"baseDn": "agFlowQname=mmrraju.test2.agama,ou=flows,ou=agama,o=jans"
}
]
}
/opt/jans/jans-cli/config-cli.py --operation-id delete-agama-prj --endpoint-args name:agama-project-name
```

It will display the total number of agama flows that are enabled and their list. You can get detail of an enabled agama flow by its `qname`.

To get details through the `qname` of a agama flow:
# Agama Flow Configuration

```
/opt/jans/jans-cli/config-cli.py --operation-id get-agama-flow --url-suffix qname:"name"
```
`qname` stands for Qualified Name. You can grab that from above operation. In my case, qname for the first one of the above list is: `imShakil.co.basicAuth`
If you already deployed agama projects successfully in your janssen server through [above](#agama) operations, you can check those agama flow status with these below operations:

**Example**:
```
/opt/jans/jans-cli/config-cli.py --operation-id get-agama-flow --url-suffix qname:"imShakil.co.basicAuth"
/opt/jans/jans-cli/config-cli.py --info AgamaConfiguration

Please wait while retrieving data ...
{
"dn": "agFlowQname=imShakil.co.basicAuth,ou=flows,ou=agama,o=jans",
"qname": "imShakil.co.basicAuth",
"revision": 0,
"enabled": true,
"metadata": {
"funcName": "_imShakil_co_basicAuth",
"author": "imShakil",
"timestamp": 1688453467147
},
"baseDn": "agFlowQname=imShakil.co.basicAuth,ou=flows,ou=agama,o=jans"
}
Operation ID: agama-syntax-check
Description: Determine if the text passed is valid Agama code
Parameters:
qname: Agama Flow name [string]
```

## Create Agama Flow

To create an agama flow in janssen server, let's get the schema first as below:
## Agama Flow Syntax

```
/opt/jans/jans-cli/config-cli.py --schema Flow > /tmp/flow.json
/opt/jans/jans-cli/config-cli.py --operation-id agama-syntax-check --url-suffix qname:
```

Schema should be look like this:
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:
{
"dn": "string",
"qname": "string",
"transHash": "string",
"revision": 133,
"enabled": true,
"metadata": {
"funcName": {
"type": "string"
},
"inputs": {
"type": "array",
"items": {
"type": "string"
}
},
"timeout": {
"type": "integer",
"format": "int32"
},
"displayName": {
"type": "string"
},
"author": {
"type": "string"
},
"timestamp": {
"type": "integer",
"format": "int64"
},
"description": {
"type": "string"
},
"properties": {
"type": "object",
"additionalProperties": {
"type": "object"
}
}
},
"source": "string",
"transpiled": "string",
"codeError": "string",
"baseDn": "string"
"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"
}
```

To post agama flow after modification, run this below commandline:

```
/opt/jans/jans-cli/config-cli.py --operation-id post-agama-flow --data /tmp/flow.json
```

It will display the server response.