Sequence
The qaskx-cli rediops sequence command generates a Sequence Diagram of the APIs defined or
used by the project as defined in the “devops.json” file.
Purpose
The purpose of the sequence command is to generate a draft sequence diagram that uses the information in the devops.json file to include as participants. The draft sequence diagram can then be enhanced to include more detail.
The sequence diagram includes dependencies defined in the rediOps (devops.json) file. Without dependencies including databases, the sequence diagram is simple.
If you do use just an OpenAPIAsyncAPI specification file the definition does not include any dependency services.
The command help is shown below.
Usage: qaskx-cli rediops sequence [-d=<Devops file path> | -s=<openAPI file> ] -t=<template> [-o=<output file>] [--overwrite] [--refresh] [-v | --vv | --vvv | --silent] [-c=<conf file>] [--colourCLI] [--offline] [--env=<environment file>]
The rediOps sequence command is for creating a sequence diagram based
on the dependencies. This is a default diagram only intended to be used
as a template or base.
The sequence dependencies are for services and not build or deploy tools.
The base file can be copied or altered to represent actual data flows.
The formats supported can be listed with command --template *list
For more details see the documentation at https://docs.qaskx.one/qaskx-cli/cmd/rediops/sequence/ .
Options:
-d, --devops rediOps (devops.json) file path
-s, --spec OpenAPI/AsyncAPI file to parse for sequence generation
-o, --output Output file name (default "CONSOLE")
--overwrite Overwrite existing content
--refresh Force refresh of templates
-t, --template Template name to use for sequence diagram. Use *list to list available names (env $QASKX_TEMPLATE_FOLDER)
-v, --verbose Verbose logging
--vv Verbose logging level 3
--vvv Verbose logging level 5
--silent Silent running
--colourCLI Colour terminal and command line (env $QASKX_COLOUR_CLI)
-c, --conf Configuration file (env $QASKX_CONFIG_FILE)
--offline Offline mode (env $QASKX_OFFLINE)
--env Environment file to use (default ".env")
Details
The template to use for creating the sequence diagram can be specified. The template will produce different outputs and you can change templates or specify new templates to create the results you require.
The input data for the template is based on the specification and the dependencies fetched from the rediOps definition. The input data structure for the template cannot be modified.
Lists
Using the command qaskx-cli rediops sequence --template *list you can list available sequence
templates. The output will look something like this.
______ ___ _______. __ ___ ___ ___
/ __ \ / \ / || |/ / \ \ / /
| | | | / ^ \ | (----`| ' / \ V /
| | | | / /_\ \ \ \ | < > <
| `--' '--. / _____ \ .----) | | . \ / . \
\_____\_____\/__/ \__\ |_______/ |__|\__\ /__/ \__\
qaskx-cli - command line tool
version - 0.0.5
url - https://docs.qaskx.one/qaskx-cli/
copyright - 2023 qaskx.one, usage license limited
QX>>> 2024/03/24 20:59:44 Main policy data missing from https://qaskx.one/policy/e8e4c58a-cdc9-4b7c-b2ec-991c736b0eb1/main_policy.json
QX>>> 2024/03/24 20:59:44 error with listing templates: failed to create policy handler. Error: failed to fetch policy signature from 'https://qaskx.one/api/signature/e8e4c58a-cdc9-4b7c-b2ec-991c736b0eb1/main_policy'
Example
The following is a sample generated sequence diagram from the “devops.json” file for the qaskx-cli project, which includes two servers:
- Standard web pages (
qaskxCommand Line Web) - Policy server (
qaskxPolicy)
As the generator cannot know the actual implementation details, it can only create a simplistic model which can then be manually enhanced to provide a more accurate representation.
%% QASKX CLI service sequence
sequenceDiagram
participant consumer as Consumer
participant gateway as Gateway
participant QSDA1 as Qaskx Command Line Web
participant QSDA2 as Qaskx Policy
participant rediops as Svc rediOps
participant teagit as Svc Gitea server OpenAPI
participant authz as Svc Authorisation
participant featureflag as Svc Feature switch
participant logger as Svc Logger
rect rgb(191, 223, 255)
consumer->>+gateway: APoint
note right of gateway: Authentication check at GW
gateway->>+authz: Validate requestor
authz-->>-gateway: 200 or 401/403 status
gateway->>+QSDA1: start
QSDA1->>+authz: Fine grained authz
note right of authz: Authorise to function, data
authz-->>-QSDA1: 200 or 401/403 status
QSDA1->>+featureflag: Check feature switch
featureflag-->>-QSDA1: 200 or 401/403 status
QSDA1->>logger: log request/response
QSDA1->>QSDA1: business logic
note right of QSDA1: Explanation of what happens
QSDA1->>+rediops: function call
rediops-->>- QSDA1: result, 200 or 4xx status
QSDA1->>+teagit: function call
teagit-->>- QSDA1: result, 200 or 4xx status
QSDA1->>+authz: function call
authz-->>- QSDA1: result, 200 or 4xx status
QSDA1->>+featureflag: function call
featureflag-->>- QSDA1: result, 200 or 4xx status
QSDA1->>+logger: function call
logger-->>- QSDA1: result, 200 or 4xx status
QSDA1->>QSDA1: business logic
note right of QSDA1: Explanation of what happens
QSDA1-->>-gateway: 200 OK response
gateway-->>-consumer: 200 OK response
end
rect rgb(191, 223, 255)
consumer->>+gateway: APoint
note right of gateway: Authentication check at GW
gateway->>+authz: Validate requestor
authz-->>-gateway: 200 or 401/403 status
gateway->>+QSDA2: start
QSDA2->>+authz: Fine grained authz
note right of authz: Authorise to function, data
authz-->>-QSDA2: 200 or 401/403 status
QSDA2->>+featureflag: Check feature switch
featureflag-->>-QSDA2: 200 or 401/403 status
QSDA2->>logger: log request/response
QSDA2->>QSDA2: business logic
note right of QSDA2: Explanation of what happens
QSDA2->>+rediops: function call
rediops-->>- QSDA2: result, 200 or 4xx status
QSDA2->>+teagit: function call
teagit-->>- QSDA2: result, 200 or 4xx status
QSDA2->>+authz: function call
authz-->>- QSDA2: result, 200 or 4xx status
QSDA2->>+featureflag: function call
featureflag-->>- QSDA2: result, 200 or 4xx status
QSDA2->>+logger: function call
logger-->>- QSDA2: result, 200 or 4xx status
QSDA2->>QSDA2: business logic
note right of QSDA2: Explanation of what happens
QSDA2-->>-gateway: 200 OK response
gateway-->>-consumer: 200 OK response
end