asyncapi: '2.6.0' info: title: Value-Aware Artificial Intelligence API version: '1.2.0' description: | This api provide the messages that the VALAWAI infrastructure cna manage. This messages are used to start/stop the infrastructure and for mantains the data and control topology. license: name: GNU General Public License version 3 url: https://opensource.org/license/gpl-3-0/ contact: name: VALAWAI url: https://valawai.eu/ channels: valawai/component/register: subscribe: summary: Used by the components to inform that it is present on the infratructure. message: $ref: '#/components/messages/register_component' valawai/component/query: subscribe: summary: Used to obtain information about some components defined on VALAWAI. message: $ref: '#/components/messages/query_components' valawai/component/page: publish: summary: Used to inform of the components found that satisfy the query. message: $ref: '#/components/messages/components_page' valawai/component/unregister: subscribe: summary: Used by the components to inform that it leave the infratructure. message: $ref: '#/components/messages/unregister_component' valawai/topology/create: subscribe: summary: Used to create a connection between two components of the VALAWAI infrastructure. message: $ref: '#/components/messages/create_connection' valawai/topology/query: subscribe: summary: Used to obtain information about some topology defined on VALAWAI. message: $ref: '#/components/messages/query_connections' valawai/topology/page: publish: summary: Used to inform of the topology connections found that satisfy the query. message: $ref: '#/components/messages/connections_page' valawai/topology/change: subscribe: summary: Used by the components to inform of the changes that has to be done to the topology. message: $ref: '#/components/messages/change_topology' valawai/log/add: subscribe: summary: Add a new log message to be stored. message: $ref: '#/components/messages/add_log' valawai/c{type}/{name}/control/registered: parameters: type: description: The identifeier of the component type. schema: type: string enum: - '0' - '1' - '2' name: description: The name of the component. schema: type: string pattern: '\w+' publish: summary: Notify a component that it has been registered. message: $ref: '#/components/messages/registered_component' valawai/c2/{name}/control/{action}: parameters: name: description: The name of the component. schema: type: string pattern: '\w+' action: description: The name of the action. schema: type: string pattern: '\w+' publish: summary: Notify a C2 component of the message interchange between other non C2 components. message: $ref: '#/components/messages/sent_message' components: messages: register_component: contentType: application/json payload: $ref: '#/components/schemas/register_component_payload' query_components: contentType: application/json payload: $ref: '#/components/schemas/query_components_payload' components_page: contentType: application/json payload: $ref: '#/components/schemas/components_page_payload' unregister_component: contentType: application/json payload: $ref: '#/components/schemas/unregister_component_payload' create_connection: contentType: application/json payload: $ref: '#/components/schemas/create_connection_payload' change_topology: contentType: application/json payload: $ref: '#/components/schemas/change_topology_payload' query_connections: contentType: application/json payload: $ref: '#/components/schemas/query_connections_payload' connections_page: contentType: application/json payload: $ref: '#/components/schemas/connections_page_payload' add_log: contentType: application/json payload: $ref: '#/components/schemas/add_log_payload' registered_component: contentType: application/json payload: $ref: '#/components/schemas/component_payload' sent_message: contentType: application/json payload: $ref: '#/components/schemas/sent_message_payload' schemas: register_component_payload: description: The information necessary to register a component. type: object properties: type: description: The type of component. oneOf: - $ref: '#/components/schemas/component_type' name: description: The component name. type: string pattern: 'c[0|1|2]_\\w+' examples: - c0_voice_to_text - c2_value_awarness_detector version: description: the component version. type: string pattern: '\d+\.\d+\.\d+' examples: - 1.0.0 - 1.7.2 asyncapi_yaml: description: The asyncapi specification in yaml. type: string examples: - 'asyncapi: 2.6.0\ninfo:\n title: Service To test\n version: 1.5.0\n description: This service is in charge of processing user signups\nchannels:\n valawai/test_input:\n subscribe:\n message:\n payload:\n type: object\n properties:\n content:\n type: string' change_topology_payload: type: object properties: action: description: The type of action to do on the topology connection. type: string enum: - 'ENABLE' - 'DISABLE' - 'REMOVE' connection_id: description: The identifier of the topology connection that has changed. type: string pattern: '[0-9a-fA-F]{24}' examples: - '65c1f59ea4cb169f42f5edc4' query_components_payload: type: object properties: id: description: The identifier of the query. type: string examples: - '1elkjfg289' pattern: description: The pattern to match the name or description of the components to return. If it is defined between / it is considered a PCRE regular expression. type: string examples: - 'c0_voice_to_text' - '/.+voice.+/i' type: description: The type to match the components to return. If it is defined between / it is considered a PCRE regular expression. type: string examples: - 'C0' - '/C[1|2]/' order: description: The order in witch the components has to be returned. It is form by the field names, separated by a comma, and each of it with the - prefix for descending order or + for ascending. By default is +since. type: string pattern: (,?[+|-]?[type|name|description|since])* examples: - 'type' - '-message,+type' offset: description: The index of the first component to return. type: integer minimum: 0 examples: - 1 - 7 limit: description: The maximum number of components to return. type: integer minimum: 1 examples: - 5 - 10 components_page_payload: type: object properties: query_id: description: The identifier of the query that this is the answer. type: string examples: - '1elkjfg289' total: description: The number of components that satisfy the query. type: integer minimum: 0 examples: - 5 - 10 components: description: The components that satisfy the query. type: array items: - $ref: '#/components/schemas/component_payload' component_payload: type: object properties: id: description: The identifier of the component. type: string pattern: '[0-9a-fA-F]{24}' examples: - '65c1f59ea4cb169f42f5edc4' name: description: The name of the component. type: string examples: - 'c0_voice_to_text' description: description: The description of the component. type: string examples: - 'Generate text from the ambient audio' version: description: The component version. type: string pattern: '\d+\.\d+\.\d+' examples: - '1.0.5' api_version: description: The version of the component API. type: string pattern: '\d+\.\d+\.\d+' examples: - '2.3.0' type: description: The type level of the component in the VALAWAI. oneOf: - $ref: '#/components/schemas/component_type' since: description: The epoch time, in seconds, since the component is available in VALAWAI. type: integer minimum: 0 examples: - '1709902001' channels: description: The channels that the component have. type: array items: - $ref: '#/components/schemas/channel_schema' component_type: type: string enum: - 'C0' - 'C1' - 'C2' channel_schema: type: object description: A schema that define the messages that a channel can receive or send. properties: id: description: The identifier of the channel. type: string examples: - 'valawai/c0/voice_to_text/data/audio' description: description: The description of the channel. type: string examples: - 'Provide the audio to convert to text' subscribe: description: The type of payload that the channel can receive. oneOf: - $ref: '#/components/schemas/payload_schema' publish: description: The type of payload that the channel can send. oneOf: - $ref: '#/components/schemas/payload_schema' payload_schema: type: object discriminator: type properties: type: type: string enum: - BASIC - ENUM - OBJECT - ARRAY - CONST - REF - ONE_OF - ANY_OF - ALL_OF required: - type basic_payload_schema: description: The basic payload schema. allOf: - $ref: '#/components/schemas/payload_schema' - type: object properties: type: const: 'BASIC' format: type: string description: The format of the basic type. enum: - 'INTEGER' - 'NUMBER' - 'BOOLEAN' - 'STRING' enum_payload_schema: description: A payload that is defined of one value of a set. allOf: - $ref: '#/components/schemas/payload_schema' - type: object properties: type: const: 'ENUM' values: type: array description: The possible enum values. items: - type: string object_payload_schema: description: A definition of a schema that describe an object. allOf: - $ref: '#/components/schemas/payload_schema' - type: object properties: type: const: 'OBJECT' id: type: integer description: The identifier used whne this schme is refer by other components. properties: description: The properties that define the object. additionalProperties: $ref: '#/components/schemas/payload_schema' array_payload_schema: description: A payload that is represented by an array of values. allOf: - $ref: '#/components/schemas/payload_schema' - type: object properties: type: const: 'ARRAY' items: description: The type for the elements on the array. type: array items: - $ref: '#/components/schemas/payload_schema' constant_payload_schema: description: A payload that is a consatnt value. allOf: - $ref: '#/components/schemas/payload_schema' - type: object properties: type: const: 'CONST' value: type: string description: The constant of the schema. reference_payload_schema: description: A payload that is a reference to another schema. allOf: - $ref: '#/components/schemas/payload_schema' - type: object properties: type: const: 'REF' value: type: integer description: The identifier of the schema that this a reference. one_of_payload_schema: description: A payload that is one of the possible schemas. allOf: - $ref: '#/components/schemas/payload_schema' - type: object properties: type: const: 'ONE_OF' items: description: The possible schemas. type: array items: - $ref: '#/components/schemas/payload_schema' any_of_payload_schema: description: A payload that is any of the possible schemas. allOf: - $ref: '#/components/schemas/payload_schema' - type: object properties: type: const: 'ANY_OF' items: description: The possible schemas. type: array items: - $ref: '#/components/schemas/payload_schema' all_of_payload_schema: description: A payload that is a set of schemas. allOf: - $ref: '#/components/schemas/payload_schema' - type: object properties: type: const: 'ALL_OF' items: description: The schemas that has to match. type: array items: - $ref: '#/components/schemas/payload_schema' unregister_component_payload: description: The information necessary to unregister a component. type: object properties: component_id: type: string description: The identifeir of the component to unregister. pattern: '[0-9a-fA-F]{24}' examples: - '65c1f59ea4cb169f42f5edc4' add_log_payload: description: The information of a log to add. type: object properties: level: type: string description: The level of the log. enum: - 'ERROR' - 'WARN' - 'INFO' - 'DEBUG' message: type: string description: The message of the log. maxLength: 1 examples: - 'The component is active' payload: type: string description: The payload of the log. examples: - '{"pattern:"p1"}' component_id: type: string description: The identifeir of the component that has generated the log. pattern: '[0-9a-fA-F]{24}' examples: - '65c1f59ea4cb169f42f5edc4' query_connections_payload: type: object properties: id: description: The identifier of the query. type: string examples: - '1elkjfg289' source_channel_name: description: The name to match the source channel of the topology connections to return. If it is defined between / it is considered a PCRE regular expression. type: string examples: - 'voice_to_text' - '/.+voice.+/i' source_component_id: description: The identifier to match the source component of the topology connections to return. If it is defined between / it is considered a PCRE regular expression. type: string examples: - '65c1f59ea4cb169f42f5edc4' - '/.+59ea.+/i' target_channel_name: description: The name to match the target channel of the topology connections to return. If it is defined between / it is considered a PCRE regular expression. type: string examples: - 'voice_to_text' - '/.+voice.+/i' target_component_id: description: The identifier to match the target component of the topology connections to return. If it is defined between / it is considered a PCRE regular expression. type: string examples: - '65c1f59ea4cb169f42f5edc4' - '/.+59ea.+/i' order: description: The order in witch the topology connections has to be returned. It is form by the field names, separated by a comma, and each of it with the - prefix for descending order or + for ascending.By default is -updateTimestamp. type: string pattern: (,?[+|-]?[createTimestamp|updateTimestamp|enabled|source.componentId|source.channelName|target.componentId|target.channelName])* examples: - 'enabled' - '-createTimestamp,+enabled' offset: description: The index of the first topology connection to return. type: integer minimum: 0 examples: - 1 - 7 limit: description: The maximum number of topology connections to return. type: integer minimum: 1 examples: - 5 - 10 connections_page_payload: type: object properties: query_id: description: The identifier of the query that this is the answer. type: string examples: - '1elkjfg289' total: description: The number of topology connections that satisfy the query. type: integer minimum: 0 examples: - 5 - 10 connections: description: The topology connections that satisfy the query. type: array items: - $ref: '#/components/schemas/connection_payload' connection_payload: type: object properties: id: description: The identifier of the topology connection. type: string pattern: '[0-9a-fA-F]{24}' examples: - '65c1f59ea4cb169f42f5edc4' create_timestamp: description: The epoch time, in seconds, when the connection has been created. type: integer examples: - '1709902001' update_timestamp: description: The epoch time, in seconds, when the connection has been updated. type: integer examples: - '1709902001' source: description: The node that is the source of the connection. oneOf: - $ref: '#/components/schemas/node_payload' target: description: The node that is the target of the connection. oneOf: - $ref: '#/components/schemas/node_payload' enabled: description: This is 'true' if the connection is enabled. type: boolean node_payload: type: object properties: component_id: description: The identifier of the component that the topology connection starts or ends. type: string pattern: '[0-9a-fA-F]{24}' examples: - '65c1f59ea4cb169f42f5edc4' channel_name: description: The name of the channel of the component that do the connection. type: string examples: - 'valawai/c0/voice_to_text/data/audio' create_connection_payload: type: object properties: source: description: The node that is the source of the connection. oneOf: - $ref: '#/components/schemas/node_payload' target: description: The node that is the target of the connection. oneOf: - $ref: '#/components/schemas/node_payload' enabled: description: This is 'true' if the connection has to be enabled. type: boolean sent_message_payload: type: object properties: connection_id: description: The identifier of the topology connection that allows the message interchanging. type: string pattern: '[0-9a-fA-F]{24}' examples: - '65c1f59ea4cb169f42f5edc4' source: description: The source component that has sent the message. oneOf: - $ref: '#/components/schemas/min_component_payload' target: description: The target component that has received the message. oneOf: - $ref: '#/components/schemas/min_component_payload' message_payload: description: The payload of the message that has been through the connection. type: object timestamp: description: The epoch time, in seconds, when the message was sent. type: integer examples: - '1709902001' min_component_payload: type: object description: The information of a component that is involved in a message. properties: id: description: The identifier of the component. type: string pattern: '[0-9a-fA-F]{24}' examples: - '65c1f59ea4cb169f42f5edc4' name: description: The name of the component. type: string examples: - 'c0_voice_to_text' type: description: The type level of the component in the VALAWAI. oneOf: - $ref: '#/components/schemas/component_type'