Skip to content

Latest commit

 

History

History
231 lines (179 loc) · 7.89 KB

EdgeApplicationSDK_FuncSpec_APIInitialize.adoc

File metadata and controls

231 lines (179 loc) · 7.89 KB

Edge Application SDK
Console API Initialize
Functional Specifications

1. Change history

Date What/Why

2023/01/30

Initial draft.

2023/05/26

Fixed the notation of tool names and parentheses.
Some environments do not render AsciiDoc’s Mermaid diagrams, so modified to rendered image references.
Added alternate text to images.

2. Terms/Abbreviations

Terms/Abbreviations Meaning

"Console REST API"

REST API provided by "Console for AITRIOS"

"Console Access Library"

Libraries for using the features of the "Console REST API". There is one for Python and another for TypeScript, but for the purposes of this document, it is meant for Python.

4. Expected use case

  • Use "Console for AITRIOS" through API

    • Example: Import AI models and "Edge Application" into "Console for AITRIOS" and deploy them to edge AI devices through API

  • Authenticate to use the API

5. Functional overview/Algorithm

Functional overview

  • SDK provides the notebook for system client authentication to "Console for AITRIOS"

flowchart TD;
    %% definition
    classDef object fill:#FFE699, stroke:#FFD700
    style legend fill:#FFFFFF, stroke:#000000

    %% impl
    subgraph legend["Legend"]
        process(Processing/User behavior)
    end
Loading
  • Flow overview

    flowchart TD
        start((Start)) --> id1(1.Get connection information)
        id1 --> id2(2.Create and edit the configuration file)
        id2 --> id3(3.Run the notebook)
        id3 --> finish(((Finish)))
    Loading
    1. Get connection information

      • Get credentials needed to connect to AITRIOS

    2. Create and edit the configuration file

      • Create the configuration file and set the information gotten in 1

    3. Run the notebook

      • Run the notebook to authenticate to AITRIOS

  • See next chapter for details on each flow

6. User interface specifications

Prerequisite

  • You have registered as a user through "Portal for AITRIOS" and participated in the AITRIOS project

How to start each function

  1. Jump to the README.md in the set_up_console_client directory from the hyperlink in the README.md in the directory for each feature that uses the "Console Access Library"

Get connection information

Get the following information to connect to "Console for AITRIOS" using the API:
This information is used in Create and edit the configuration file of the next section.

  • Server URL
    Check the following from the documentation of this function (README.md) :

    • API server base URL

    • Authentication server URL

  • Client app details
    Get from the list of client apps in "Portal for AITRIOS":
    See "Portal User Manual" for details.

    • Client ID

    • Secret

Create and edit the configuration file

Create the configuration file in the set_up_console_client directory, and set the preceding connection information.

Note
All parameters are required.
Note
The parameters passed to the "Console Access Library" API are as specified in the "Console Access Library" API.
Configuration Meaning Range Remarks

console_endpoint

API server base URL

String
Details follow the "Console Access Library" API specification.

Don’t abbreviate
Used for the following "Console Access Library" API

  • common.config.Config

portal_authorization_endpoint

Authentication server URL

String
Details follow the "Console Access Library" API specification.

Don’t abbreviate
Used for the following "Console Access Library" API

  • common.config.Config

client_id

Client ID required for authentication

String
Details follow the "Console Access Library" API specification.

Don’t abbreviate
Used for the following "Console Access Library" API

  • common.config.Config

client_secret

Secret required for authentication

String
Details follow the "Console Access Library" API specification.

Don’t abbreviate
Used for the following "Console Access Library" API

  • common.config.Config

Run the notebook

  1. Open the notebook, *.ipynb, in the directory for client authentication under the common directory, and run the python scripts in it

    • The scripts do the following:

      • Checks that configuration file exists in the execution directory

        • If an error occurs, the error description is displayed and running is interrupted.

      • Checks that configuration file includes each parameter

        • If an error occurs, the error description is displayed and running is interrupted.

      • Reads the value of each parameter from configuration file to call API for system client authentication

        • If an error occurs, the error description is displayed and running is interrupted.

        • If authentication succeeds and the client instance is created successfully, displays a successful message

      • Saves the client instance for use by other notebooks in the SDK

    • See "Console Access Library" Functional Specifications for details on errors and response times

Sequence

%%{init:{'themeVariables':{'fontSize':'24px'}, 'themeCSS':'text.actor {font-size:18px !important;} .messageText {font-size:18px !important;}'}}%%
sequenceDiagram
    participant user as User
    participant portal as Portal<br>for AITRIOS
    participant container as Dev Container
    participant access_lib as Console Access<br>Library
    participant auth_server as Authentication<br>server

    user ->>portal : Access<br>Web UI
    portal ->>user : Display<br>client ID/secret
    user->>container: Create and edit<br>the configuration file
    user->>container: Run the notebook
    container->> access_lib: Generate a<br>Config instance
    access_lib-->>container: Response<br>※In case of success<br>Config instance
    container->> access_lib: Run the API<br>to get access token
    access_lib->>auth_server: Authentication<br>request
    auth_server-->>access_lib: Response
    access_lib-->>container: Response
    container->>user: Results<br> (Access token acquisition<br>success/failure)
    container->>access_lib: Generate a<br>Client instance
    access_lib-->>container: Response<br>※In case of success<br>Client instance
    container->>user: Results<br> (Client generation<br>success/failure)
Loading

7. Target performances/Impact on performances

  • Users can take advantage of each feature of the "Console for AITRIOS" API without being aware of its internal operation

  • UI response time of 1.2 seconds or less

  • If processing takes more than 5 seconds, indicates that processing is in progress with successive updates

  • Provides users with documentation of usage tools and version information

8. Assumption/Restriction

  • None

9. Remarks

  • None

10. Unconfirmed items

  • None