Add extracted tools: CitrineOS, OpenOCPP, ShapeShifter
- CitrineOS core extracted (CSMS OCPP 2.0.1) - OpenOCPP extracted (firmware OCPP 1.6J/2.0.1) - ShapeShifter library installed (pip install -e) - ShapeShifter specification extracted - EVerest extracted TODO updated with progress
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
filegroup(
|
||||
name = "schemas",
|
||||
srcs = glob(["*.yaml"]),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
install(
|
||||
FILES
|
||||
interface.yaml
|
||||
config.yaml
|
||||
manifest.yaml
|
||||
type.yaml
|
||||
error-declaration-list.yaml
|
||||
error-object.yaml
|
||||
DESTINATION "${CMAKE_INSTALL_DATADIR}/everest/schemas"
|
||||
)
|
||||
235
tools/EVerest-main/lib/everest/framework/schemas/config.yaml
Normal file
235
tools/EVerest-main/lib/everest/framework/schemas/config.yaml
Normal file
@@ -0,0 +1,235 @@
|
||||
$schema: http://json-schema.org/draft-07/schema#
|
||||
description: Json schema of main EVerest config file
|
||||
$defs:
|
||||
config_map:
|
||||
type: object
|
||||
description: >-
|
||||
This is a config map. Each property specifies one simple config
|
||||
option and will be validated agains the schema provided by the module's manifest
|
||||
file.
|
||||
patternProperties:
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
description: A single config option
|
||||
type:
|
||||
- boolean
|
||||
- integer
|
||||
- number
|
||||
- string
|
||||
default: {}
|
||||
additionalProperties: false
|
||||
type: object
|
||||
required:
|
||||
- active_modules
|
||||
additionalProperties: false
|
||||
properties:
|
||||
settings:
|
||||
type: object
|
||||
properties:
|
||||
prefix:
|
||||
type: string
|
||||
config_file:
|
||||
type: string
|
||||
configs_dir:
|
||||
type: string
|
||||
schemas_dir:
|
||||
type: string
|
||||
modules_dir:
|
||||
type: string
|
||||
interfaces_dir:
|
||||
type: string
|
||||
types_dir:
|
||||
type: string
|
||||
errors_dir:
|
||||
type: string
|
||||
www_dir:
|
||||
type: string
|
||||
logging_config_file:
|
||||
type: string
|
||||
controller_port:
|
||||
type: integer
|
||||
controller_rpc_timeout_ms:
|
||||
type: integer
|
||||
mqtt_broker_socket_path:
|
||||
type: string
|
||||
mqtt_broker_host:
|
||||
type: string
|
||||
mqtt_broker_port:
|
||||
type: integer
|
||||
mqtt_everest_prefix:
|
||||
type: string
|
||||
mqtt_external_prefix:
|
||||
type: string
|
||||
telemetry_prefix:
|
||||
type: string
|
||||
telemetry_enabled:
|
||||
type: boolean
|
||||
validate_schema:
|
||||
type: boolean
|
||||
run_as_user:
|
||||
type: string
|
||||
forward_exceptions:
|
||||
type: boolean
|
||||
additionalProperties: false
|
||||
active_modules:
|
||||
type: object
|
||||
patternProperties:
|
||||
# module id
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
description: This are the required properties for every module id entry
|
||||
required:
|
||||
- module
|
||||
properties:
|
||||
standalone:
|
||||
description: Indicates to the manager that the module will be started standalone
|
||||
type: boolean
|
||||
module:
|
||||
description: Module name (e.g. directory name in the modules subdirectory)
|
||||
type: string
|
||||
# module name
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_-]*$
|
||||
capabilities:
|
||||
description: Linux capabilities required to run this module
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
config_module:
|
||||
description: Config map for the module
|
||||
$ref: '#/$defs/config_map'
|
||||
config_implementation:
|
||||
description: List of config maps for each implementation
|
||||
type: object
|
||||
patternProperties:
|
||||
# implementation id
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
description: Config map for this implementation.
|
||||
# arbitrary implementation config validated by our schema in the module manifest later on
|
||||
$ref: '#/$defs/config_map'
|
||||
# add empty config if not already present
|
||||
default: {}
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
telemetry:
|
||||
description: If this object is present telemetry for the module will be enabled
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
description: Telemetry from modules using the same id will be grouped together
|
||||
type: integer
|
||||
connections:
|
||||
type: object
|
||||
description: >-
|
||||
List of requirements: a mapping of all requirement ids listed
|
||||
in the module's manifest to module_id (declared in this file) and implementation_id
|
||||
(declared in manifest).
|
||||
patternProperties:
|
||||
# requirement id
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- module_id
|
||||
- implementation_id
|
||||
properties:
|
||||
module_id:
|
||||
description: module_id this requirement id maps to
|
||||
type: string
|
||||
# reference to module id
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_.-]*$
|
||||
implementation_id:
|
||||
description: implementation_id this requirement id maps to
|
||||
type: string
|
||||
# reference to implementation id
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_.-]*$
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
# add empty config if not already present
|
||||
default: {}
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
mapping:
|
||||
description: >-
|
||||
this configures a module mapping and a list of implementations this module provides and their mapping to the 3-tier-model of charging station, evse and connector
|
||||
if no mapping is provided by default this implementation is associated with the charging station
|
||||
type: object
|
||||
properties:
|
||||
module:
|
||||
type: object
|
||||
properties:
|
||||
evse:
|
||||
description: evse this module id maps to
|
||||
type: integer
|
||||
connector:
|
||||
description: connector this module id maps to
|
||||
type: integer
|
||||
# allow arbitrary additional properties for future extensions (not used at the moment)
|
||||
additionalProperties: true
|
||||
implementations:
|
||||
type: object
|
||||
patternProperties:
|
||||
# implementation id
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
type: object
|
||||
required:
|
||||
- evse
|
||||
properties:
|
||||
evse:
|
||||
description: evse this implementation id maps to
|
||||
type: integer
|
||||
connector:
|
||||
description: connector this implementation id maps to
|
||||
type: integer
|
||||
# allow arbitrary additional properties for future extensions (not used at the moment)
|
||||
additionalProperties: true
|
||||
# add empty config if not already present
|
||||
default: {}
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
access:
|
||||
description: >-
|
||||
Access control settings for this specific module
|
||||
type: object
|
||||
properties:
|
||||
config:
|
||||
description: >-
|
||||
Fine grained control about configuration access to other modules
|
||||
type: object
|
||||
properties:
|
||||
allow_global_read:
|
||||
description: Allow global read access to config items
|
||||
type: boolean
|
||||
allow_global_write:
|
||||
description: Allow global write access to config items
|
||||
type: boolean
|
||||
allow_set_read_only:
|
||||
description: Allow setting of readonly config items, will need a restart
|
||||
type: boolean
|
||||
modules:
|
||||
description: Module access settings
|
||||
type: object
|
||||
patternProperties:
|
||||
# reference to module id
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
type: object
|
||||
properties:
|
||||
allow_read:
|
||||
description: Allow read access to config items
|
||||
type: boolean
|
||||
allow_write:
|
||||
description: Allow write access to config items
|
||||
type: boolean
|
||||
allow_set_read_only:
|
||||
description: Allow setting of a readonly config items, will need a restart
|
||||
type: boolean
|
||||
additionalProperties: false
|
||||
additionalProperties: false
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
# add empty config dict if not already present
|
||||
default: {}
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
|
||||
x-module-layout: {}
|
||||
@@ -0,0 +1,34 @@
|
||||
$schema: http://json-schema.org/draft-07/schema#
|
||||
description: Json schema for EVerest error definition files
|
||||
$defs:
|
||||
error_list_subschema:
|
||||
description: This describes a list of errors of this unit
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/$defs/error_subschema'
|
||||
default: []
|
||||
error_subschema:
|
||||
type: object
|
||||
description: json schema declaring the error
|
||||
required:
|
||||
- name
|
||||
- description
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
minLength: 2
|
||||
pattern: ^[A-Z][A-Za-z0-9]*$
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
additionalProperties: false
|
||||
type: object
|
||||
required:
|
||||
- description
|
||||
properties:
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
errors:
|
||||
$ref: '#/$defs/error_list_subschema'
|
||||
additionalProperties: false
|
||||
@@ -0,0 +1,43 @@
|
||||
$schema: http://json-schema.org/draft-07/schema#
|
||||
description: Json schema for EVerest error objects
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- description
|
||||
- message
|
||||
- from
|
||||
- timestamp
|
||||
- uuid
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
minLength: 2
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
message:
|
||||
type: string
|
||||
minLength: 2
|
||||
from:
|
||||
type: object
|
||||
required:
|
||||
- module
|
||||
- implementation
|
||||
properties:
|
||||
module:
|
||||
type: string
|
||||
minLength: 2
|
||||
implementation:
|
||||
type: string
|
||||
minLength: 2
|
||||
additionalProperties: false
|
||||
timestamp:
|
||||
type: string
|
||||
format: date-time
|
||||
uuid:
|
||||
type: string
|
||||
minLength: 2
|
||||
severity:
|
||||
type: string
|
||||
minLength: 2
|
||||
additionalProperties: false
|
||||
158
tools/EVerest-main/lib/everest/framework/schemas/interface.yaml
Normal file
158
tools/EVerest-main/lib/everest/framework/schemas/interface.yaml
Normal file
@@ -0,0 +1,158 @@
|
||||
$schema: http://json-schema.org/draft-07/schema#
|
||||
description: Json schema for EVerest interface files
|
||||
$defs:
|
||||
# all subschemas can not use allOf with the draft-07 schema because that will cause our validator to
|
||||
# add all draft-07 default values which never validate (the {"not": true} default contradicts everything)
|
||||
# --> validating against draft-07 will be done in an extra step in config.cpp
|
||||
var_subschema:
|
||||
type: object
|
||||
# require at least a type declaration for this command/result schema
|
||||
required:
|
||||
- type
|
||||
- description
|
||||
properties:
|
||||
type:
|
||||
type:
|
||||
- string
|
||||
- array
|
||||
items:
|
||||
type: string
|
||||
uniqueItems: true
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
qos:
|
||||
"type": "integer"
|
||||
"minimum": 0
|
||||
"maximum": 2
|
||||
"default": 2
|
||||
# we don't allow default values
|
||||
default: false
|
||||
# allow all sorts of entries (should be a json schema!)
|
||||
additionalProperties: true
|
||||
cmd_arguments_subschema:
|
||||
type: object
|
||||
patternProperties:
|
||||
# arbitrary argument name
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
type: object
|
||||
# require at least a type declaration for this command/result schema
|
||||
required:
|
||||
- type
|
||||
- description
|
||||
properties:
|
||||
type:
|
||||
type:
|
||||
- array
|
||||
- string
|
||||
items:
|
||||
type: string
|
||||
uniqueItems: true
|
||||
pattern: ^(?!null).*$
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
# we don't allow default values
|
||||
default: false
|
||||
# allow all sorts of entries (should be a json schema!)
|
||||
additionalProperties: true
|
||||
# only allow argument names conforming to our pattern above
|
||||
additionalProperties: false
|
||||
default: {}
|
||||
cmd_result_subschema:
|
||||
type: object
|
||||
# require at least a type declaration for this command/result schema
|
||||
required:
|
||||
- type
|
||||
- description
|
||||
properties:
|
||||
type:
|
||||
type:
|
||||
- array
|
||||
- string
|
||||
items:
|
||||
type: string
|
||||
uniqueItems: true
|
||||
pattern: ^(?!null).*$
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
# we don't allow default values
|
||||
default: false
|
||||
# allow all sorts of entries (should be a json schema!)
|
||||
additionalProperties: true
|
||||
default:
|
||||
type: 'null'
|
||||
description: This returns nothing
|
||||
type: object
|
||||
required:
|
||||
- description
|
||||
properties:
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
cmds:
|
||||
description: >-
|
||||
This describes a list of commands for this unit having arguments
|
||||
and result declared as json schema
|
||||
type: object
|
||||
patternProperties:
|
||||
# arbitrary command name
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
type: object
|
||||
description: >-
|
||||
the keys 'arguments' and 'result' declare json schemas defining
|
||||
the arguments and result for this command (default: 'type': 'null')
|
||||
required:
|
||||
- description
|
||||
properties:
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
# default is an empty arguments/result list
|
||||
arguments:
|
||||
$ref: '#/$defs/cmd_arguments_subschema'
|
||||
result:
|
||||
$ref: '#/$defs/cmd_result_subschema'
|
||||
default: {}
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
# add empty cmds if not already present
|
||||
default: {}
|
||||
vars:
|
||||
description: This describes a list of exported variables of this unit
|
||||
type: object
|
||||
patternProperties:
|
||||
# arbitrary variable name
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
description: >-
|
||||
json schema declaring the contents of the variables exported
|
||||
by this unit
|
||||
$ref: '#/$defs/var_subschema'
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
# add empty vars if not already present
|
||||
default: {}
|
||||
errors:
|
||||
description: This describes a list of error list allowed to be raised by this unit
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- reference
|
||||
properties:
|
||||
reference:
|
||||
anyOf:
|
||||
# reference to a complete error list
|
||||
# (e.g. /errors/example)
|
||||
- type: string
|
||||
pattern: ^/errors/[a-z][a-zA-Z0-9_]*$
|
||||
# reference to a single error
|
||||
# (e.g. /errors/example#/ExampleErrorA)
|
||||
- type: string
|
||||
pattern: ^/errors/[a-z][a-zA-Z0-9_]*#/[A-Z][A-Za-z0-9]*$
|
||||
additionalProperties: false
|
||||
default: []
|
||||
additionalProperties: false
|
||||
174
tools/EVerest-main/lib/everest/framework/schemas/manifest.yaml
Normal file
174
tools/EVerest-main/lib/everest/framework/schemas/manifest.yaml
Normal file
@@ -0,0 +1,174 @@
|
||||
$schema: http://json-schema.org/draft-07/schema#
|
||||
description: Json schema for EVerest manifest files
|
||||
$defs:
|
||||
config_set_schema:
|
||||
type: object
|
||||
patternProperties:
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- description
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum:
|
||||
- boolean
|
||||
- integer
|
||||
- number
|
||||
- string
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
mutability:
|
||||
type: string
|
||||
enum:
|
||||
- ReadOnly
|
||||
- ReadWrite
|
||||
- WriteOnly
|
||||
default: ReadOnly
|
||||
additionalProperties: true
|
||||
additionalProperties: false
|
||||
default: {}
|
||||
type: object
|
||||
required:
|
||||
- description
|
||||
- metadata
|
||||
properties:
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
config:
|
||||
description: >-
|
||||
Config set for this module (and possibly default values) declared
|
||||
as json schema
|
||||
$ref: '#/$defs/config_set_schema'
|
||||
provides:
|
||||
description: >-
|
||||
this configures a list of implementations this module provides along
|
||||
with their api, provided vars and config
|
||||
type: object
|
||||
# at least one implementation is required
|
||||
minProperties: 1
|
||||
patternProperties:
|
||||
# arbitrary implementation id
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
description: This defines api, provided vars and config of this implementation
|
||||
type: object
|
||||
required:
|
||||
- description
|
||||
- interface
|
||||
# sadly the schema validates properties from "properties" against matching "patternProperties", too
|
||||
# --> we have to prevent this matching to not double validate against competing schemes
|
||||
patternProperties:
|
||||
# allow all sorts of additional properties that can be used to match requirements to
|
||||
^(?!interface|config|cmds|vars$)[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
# only allow primitive types in here
|
||||
type:
|
||||
- string
|
||||
- integer
|
||||
- number
|
||||
- boolean
|
||||
- 'null'
|
||||
properties:
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
interface:
|
||||
description: this defines the interface to be implemented
|
||||
type: string
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_.-]*$
|
||||
minLength: 3
|
||||
config:
|
||||
description: >-
|
||||
Config set for this implementation (and possibly default
|
||||
values) declared as json schema
|
||||
$ref: '#/$defs/config_set_schema'
|
||||
additionalProperties: false
|
||||
# add empty provides if not already present
|
||||
default: {}
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
requires:
|
||||
description: >-
|
||||
This describes a list of requirements that must be fulfilled by other
|
||||
modules. The key of this is an arbitrary requirement id that has to be referenced
|
||||
in the connections object by the main config, the values are a list of properties
|
||||
(key-value-pairs) the required module and implementations must have set in their
|
||||
provides section to fulfill this requirement
|
||||
type: object
|
||||
patternProperties:
|
||||
# requirement id
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
type: object
|
||||
required:
|
||||
- interface
|
||||
properties:
|
||||
interface:
|
||||
type: string
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_.-]*$
|
||||
min_connections:
|
||||
type: integer
|
||||
minimum: 0
|
||||
default: 1
|
||||
max_connections:
|
||||
type: integer
|
||||
minimum: 1
|
||||
default: 1
|
||||
# Used for now for the Rust bindings.
|
||||
ignore:
|
||||
type: object
|
||||
properties:
|
||||
vars:
|
||||
type:
|
||||
- string
|
||||
- array
|
||||
items:
|
||||
type: string
|
||||
uniqueItems: true
|
||||
errors:
|
||||
type: boolean
|
||||
default: false
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
default: {}
|
||||
metadata:
|
||||
description: this describes some metadata for this module
|
||||
type: object
|
||||
required:
|
||||
- license
|
||||
- authors
|
||||
properties:
|
||||
base_license:
|
||||
description: URI pointing to the base license of this module (e.g. https://opensource.org/licenses/Apache-2.0)
|
||||
type: string
|
||||
format: uri
|
||||
license:
|
||||
description: URI pointing to the license of this module (e.g. https://opensource.org/licenses/Apache-2.0)
|
||||
type: string
|
||||
format: uri
|
||||
authors:
|
||||
description: Author(s) of this module (an array of strings)
|
||||
type: array
|
||||
minItems: 1
|
||||
items:
|
||||
type: string
|
||||
minLength: 2
|
||||
# allow all sorts of additional properties
|
||||
additionalProperties: true
|
||||
default: {}
|
||||
enable_external_mqtt:
|
||||
description: this requests access to the external mqtt publishing interface
|
||||
type: boolean
|
||||
default: false
|
||||
enable_telemetry:
|
||||
description: this requests access to the telemetry publishing interface
|
||||
type: boolean
|
||||
default: false
|
||||
enable_global_errors:
|
||||
description: this requests access to the global error subscription interface
|
||||
type: boolean
|
||||
default: false
|
||||
additionalProperties: false
|
||||
@@ -0,0 +1,91 @@
|
||||
CREATE TABLE IF NOT EXISTS MUTABILITY (ID INT PRIMARY KEY, MUTABILITY TEXT);
|
||||
CREATE TABLE IF NOT EXISTS DATATYPE (ID INT PRIMARY KEY, DATATYPE TEXT);
|
||||
|
||||
CREATE TABLE CONFIG_META (
|
||||
ID INTEGER PRIMARY KEY,
|
||||
LAST_UPDATED TEXT NOT NULL,
|
||||
VALID TEXT INTEGER NOT NULL,
|
||||
CONFIG_DUMP TEXT NOT NULL,
|
||||
CONFIG_FILE_PATH TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS SETTING (
|
||||
ID INTEGER PRIMARY KEY CHECK (id = 0),
|
||||
PREFIX TEXT NOT NULL,
|
||||
CONFIG_FILE TEXT NOT NULL,
|
||||
CONFIGS_DIR TEXT NOT NULL,
|
||||
SCHEMAS_DIR TEXT NOT NULL,
|
||||
MODULES_DIR TEXT NOT NULL,
|
||||
INTERFACES_DIR TEXT NOT NULL,
|
||||
TYPES_DIR TEXT NOT NULL,
|
||||
ERRORS_DIR TEXT NOT NULL,
|
||||
WWW_DIR TEXT NOT NULL,
|
||||
LOGGING_CONFIG_FILE TEXT NOT NULL,
|
||||
CONTROLLER_PORT INTEGER NOT NULL,
|
||||
CONTROLLER_RPC_TIMEOUT_MS INTEGER NOT NULL,
|
||||
MQTT_BROKER_SOCKET_PATH TEXT NOT NULL,
|
||||
MQTT_BROKER_HOST TEXT NOT NULL,
|
||||
MQTT_BROKER_PORT INTEGER NOT NULL,
|
||||
MQTT_EVEREST_PREFIX TEXT NOT NULL,
|
||||
MQTT_EXTERNAL_PREFIX TEXT NOT NULL,
|
||||
TELEMETRY_PREFIX TEXT NOT NULL,
|
||||
TELEMETRY_ENABLED INTEGER NOT NULL,
|
||||
VALIDATE_SCHEMA INTEGER NOT NULL,
|
||||
RUN_AS_USER TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS MODULE (
|
||||
ID TEXT PRIMARY KEY,
|
||||
NAME TEXT NOT NULL,
|
||||
STANDALONE INTEGER,
|
||||
CAPABILITIES TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS MODULE_FULFILLMENT (
|
||||
MODULE_ID TEXT,
|
||||
REQUIREMENT_NAME TEXT NOT NULL,
|
||||
IMPLEMENTATION_ID TEXT NOT NULL,
|
||||
IMPLEMENTATION_MODULE_ID TEXT NOT NULL,
|
||||
PRIMARY KEY (MODULE_ID, REQUIREMENT_NAME, IMPLEMENTATION_ID, IMPLEMENTATION_MODULE_ID),
|
||||
FOREIGN KEY (MODULE_ID) REFERENCES MODULE (ID) ON DELETE CASCADE,
|
||||
FOREIGN KEY (IMPLEMENTATION_MODULE_ID) REFERENCES MODULE (ID) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS MODULE_TIER_MAPPING (
|
||||
MODULE_ID TEXT,
|
||||
IMPLEMENTATION_ID TEXT NOT NULL,
|
||||
EVSE_ID INTEGER NOT NULL,
|
||||
CONNECTOR_ID INTEGER,
|
||||
PRIMARY KEY (MODULE_ID, IMPLEMENTATION_ID),
|
||||
FOREIGN KEY (MODULE_ID) REFERENCES MODULE (ID) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS CONFIGURATION (
|
||||
PARAMETER_NAME TEXT,
|
||||
MODULE_ID TEXT NOT NULL,
|
||||
MODULE_IMPLEMENTATION_ID TEXT NOT NULL,
|
||||
"VALUE" TEXT NOT NULL,
|
||||
MUTABILITY_ID INTEGER NOT NULL,
|
||||
DATATYPE_ID INTEGER NOT NULL,
|
||||
UNIT TEXT,
|
||||
SOURCE TEXT,
|
||||
PRIMARY KEY (MODULE_ID, PARAMETER_NAME, MODULE_IMPLEMENTATION_ID),
|
||||
FOREIGN KEY (MODULE_ID) REFERENCES MODULE (ID) ON DELETE CASCADE,
|
||||
FOREIGN KEY (DATATYPE_ID) REFERENCES DATATYPE (ID) ON DELETE RESTRICT,
|
||||
FOREIGN KEY (MUTABILITY_ID) REFERENCES MUTABILITY (ID) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
INSERT OR REPLACE INTO MUTABILITY (ID, MUTABILITY) VALUES
|
||||
(0, "ReadOnly"),
|
||||
(1, "WriteOnly"),
|
||||
(2, "ReadWrite");
|
||||
INSERT
|
||||
OR REPLACE INTO DATATYPE VALUES
|
||||
(0, "string"),
|
||||
(1, "decimal"),
|
||||
(2, "integer"),
|
||||
(3, "boolean");
|
||||
INSERT
|
||||
OR IGNORE INTO SETTING (ID)
|
||||
VALUES (0);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE SETTING DROP COLUMN FORWARD_EXCEPTIONS;
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE SETTING ADD COLUMN FORWARD_EXCEPTIONS INTEGER NOT NULL DEFAULT 0;
|
||||
@@ -0,0 +1,2 @@
|
||||
DROP TABLE CONFIG_ACCESS;
|
||||
DROP TABLE MODULE_CONFIG_ACCESS;
|
||||
@@ -0,0 +1,19 @@
|
||||
CREATE TABLE IF NOT EXISTS CONFIG_ACCESS (
|
||||
MODULE_ID TEXT,
|
||||
ALLOW_GLOBAL_READ INTEGER,
|
||||
ALLOW_GLOBAL_WRITE INTEGER,
|
||||
ALLOW_SET_READ_ONLY INTEGER,
|
||||
PRIMARY KEY (MODULE_ID),
|
||||
FOREIGN KEY (MODULE_ID) REFERENCES MODULE (ID) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS MODULE_CONFIG_ACCESS (
|
||||
MODULE_ID TEXT,
|
||||
OTHER_MODULE_ID TEXT,
|
||||
ALLOW_READ INTEGER,
|
||||
ALLOW_WRITE INTEGER,
|
||||
ALLOW_SET_READ_ONLY INTEGER,
|
||||
PRIMARY KEY (MODULE_ID),
|
||||
FOREIGN KEY (MODULE_ID) REFERENCES MODULE (ID) ON DELETE CASCADE,
|
||||
FOREIGN KEY (OTHER_MODULE_ID) REFERENCES MODULE (ID) ON DELETE CASCADE
|
||||
);
|
||||
@@ -0,0 +1,5 @@
|
||||
filegroup(
|
||||
name = "migrations",
|
||||
srcs = glob(["*.sql"]),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
41
tools/EVerest-main/lib/everest/framework/schemas/type.yaml
Normal file
41
tools/EVerest-main/lib/everest/framework/schemas/type.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
$schema: http://json-schema.org/draft-07/schema#
|
||||
description: Json schema for EVerest type files
|
||||
$defs:
|
||||
typelist_subschema:
|
||||
allOf:
|
||||
- $ref: http://json-schema.org/draft-07/schema#
|
||||
- type: object
|
||||
# require at least a type declaration
|
||||
required:
|
||||
- type
|
||||
- description
|
||||
properties:
|
||||
type:
|
||||
type:
|
||||
- array
|
||||
- string
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
# allow all sorts of entries (should be a json schema!)
|
||||
additionalProperties: true
|
||||
type: object
|
||||
required:
|
||||
- description
|
||||
properties:
|
||||
description:
|
||||
type: string
|
||||
minLength: 2
|
||||
types:
|
||||
description: This describes a list of types of this unit
|
||||
type: object
|
||||
patternProperties:
|
||||
# arbitrary type name
|
||||
^[a-zA-Z_][a-zA-Z0-9_.-]*$:
|
||||
description: json schema declaring the type
|
||||
$ref: '#/$defs/typelist_subschema'
|
||||
# don't allow arbitrary additional properties
|
||||
additionalProperties: false
|
||||
# add empty types if not already present
|
||||
default: {}
|
||||
additionalProperties: false
|
||||
Reference in New Issue
Block a user