...
High level architecture diagram
More details, please find in the attachment CLI architecture.pptx
CLI Components
•Open Command – Models the most of the requirements of CLI and it’s the CLI schema engine, understands the OPEN-CLI 1.0 schema and make it as Command
–Command Plug-in : Provides extensibility support to implement any commands which are depends on java api
–HTTP Command : An special command plug-in provided by framework to implement the Command on top of REST API without writing any java code. (only YAML template is sufficient)
•Command Discoverer – Discovers the available CLI templates (YAML file created by using OPEN-CLI 1.0 schema) placed under OPEN_CLI_HOME directory or its sub-directories and register them into Command Registrar.
•Command Registrar – Maintains the map of command name vs actual command executable
•Main – Provides the interactive/direct command mode to run the commands from Linux OS console
Sample YAML CLI template
Code Block | ||||
---|---|---|---|---|
| ||||
open_cli_schema_version: 1.0
name: microservice-create
description: Register microservice into Open-O
service:
name: msb
version: v1
parameters:
- name: service-name
description: Open-O service name
type: string
short_option: x
long_option: service-name
is_optional: false
- name: service-version
description: Open-O service version
type: string
short_option: y
long_option: service-version
is_optional: false
- name: service-url
description: Open-O service base url
type: url
short_option: r
long_option: service-url
is_optional: false
- name: node-ip
description: Open-O service running node IP
type: string
- name: node-port
description: Open-O service running node port
type: string
- name: create-or-update
description: Open-O service create or update
type: bool
default_value: true
results:
direction: portrait
attributes:
- name: name
description: Open-O service name
scope: short
type: string
- name: version
description: Open-O service version
scope: short
type: string
- name: url
description: Open-O service base url
scope: short
type: url
- name: status
description: Open-O service status
scope: short
type: long
- name: nodes
description: Open-O service running nodes
scope: long
type: string
- name: location
description: Open-O service location
scope: long
type: url
http:
request:
uri: /services
method: POST
body: '{"serviceName":"${service-name}","version":"${service-version}","url":"${service-url}","protocol":"REST","visualRange":"1","lb_policy":"hash","nodes":[{"ip":"${node-ip}","port":"${node-port}","ttl":0}]}'
headers:
queries:
createOrUpdate: ${create-or-update}
success_codes:
- 201
- 200
result_map:
name: $b{$.serviceName}
version: $b{$.version}
url: $b{$.url}
status: $b{$.status}
nodes: $b{$.nodes[*].ip}:$b{$.nodes[*].port}
location: $h{Location}
|
API Incoming Dependencies
...