diff options
Diffstat (limited to 'src/ahl-apidef.json')
-rw-r--r-- | src/ahl-apidef.json | 206 |
1 files changed, 114 insertions, 92 deletions
diff --git a/src/ahl-apidef.json b/src/ahl-apidef.json index 45067ea..3ab6f4a 100644 --- a/src/ahl-apidef.json +++ b/src/ahl-apidef.json @@ -1,6 +1,5 @@ { "openapi": "3.0.0", - "$schema": "http:iot.bzh/download/openapi/schema-3.0/default-schema.json", "info": { "description": "Audio high level API for AGL applications", "title": "audiohighlevel", @@ -11,7 +10,7 @@ "prefix": "audiohlapi_", "postfix": "", "start": null, - "onevent": null, + "onevent": "AhlOnEvent", "init": "AhlBindingInit", "scope": "", "private": false @@ -107,23 +106,21 @@ }, "stream_info": { "type": "object", - "required": [ "stream_id", "endpoint_info" ], + "required": [ "stream_id", "state", "mute", "endpoint_info" ], "properties": { "stream_id": { "type": "int" }, + "state": { "type": "int" }, + "mute": { "type": "int" }, + "device_uri": { "type": "string" }, "$ref": "#/components/schemas/endpoint_info" } } }, "x-permissions": { - "streamcontrol": { - "permission": "urn:AGL:permission:audio:public:streamcontrol" - }, - "routingcontrol": { - "permission": "urn:AGL:permission:audio:public:routingcontrol" - }, - "soundevent": { - "permission": "urn:AGL:permission:audio:public:soundevent" - } + "streamcontrol": { "permission": "urn:AGL:permission:audio:public:streamcontrol"}, + "endpointcontrol": { "permission": "urn:AGL:permission:audio:public:endpointcontrol"}, + "audiostream": { "permission": "urn:AGL:permission:audio:public:audiostream"}, + "soundevent": {"permission": "urn:AGL:permission:audio:public:soundevent"} }, "responses": { "200": { @@ -136,9 +133,7 @@ } } }, - "400": { - "description": "Invalid arguments" - } + "400": { "description": "Invalid arguments" } } }, "paths": { @@ -186,15 +181,14 @@ "items": { "$ref": "#/components/schemas/endpoint_info"} } }, - "400": { - "$ref": "#/components/responses/400" } + "400": { "$ref": "#/components/responses/400" } } } }, "/stream_open": { "description": "Request opening a stream", "get": { - "x-permissions": { "$ref": "#/components/x-permissions/streamcontrol" }, + "x-permissions": { "$ref": "#/components/x-permissions/audiostream" }, "parameters": [ { "in": "query", @@ -230,7 +224,7 @@ "/stream_close": { "description": "Request closing a stream", "get": { - "x-permissions": { "$ref": "#/components/x-permissions/streamcontrol" }, + "x-permissions": { "$ref": "#/components/x-permissions/audiostream" }, "parameters": [ { "in": "query", @@ -245,34 +239,50 @@ } } }, - "/set_volume": { - "description": "Set volume", + "/set_stream_state": { + "description": "Change stream active state", "get": { - "x-permissions": { "$ref": "#/components/x-permissions/streamcontrol" }, + "x-permissions": { + "$ref": "#/components/x-permissions/streamcontrol" + }, "parameters": [ { "in": "query", - "name": "endpoint_type", + "name": "stream_id", "required": true, - "schema": { "type": "enum" } + "schema": {"type": "int"} }, { "in": "query", - "name": "endpoint_id", + "name": "state", "required": true, - "schema": { "type": "int" } - }, + "schema": {"type": "int"} + } + ], + "responses": { + "200": { "$ref": "#/components/responses/200" }, + "400": { "$ref": "#/components/responses/400" } + } + } + }, + "/set_stream_mute": { + "description": "Change stream mute state", + "get": { + "x-permissions": { + "$ref": "#/components/x-permissions/streamcontrol" + }, + "parameters": [ { "in": "query", - "name": "volume", + "name": "stream_id", "required": true, - "schema": { "type": "string" } + "schema": {"type": "int"} }, { "in": "query", - "name": "ramp_time_ms", - "required": false, - "schema": { "type": "int" } + "name": "mute", + "required": true, + "schema": {"type": "int"} } ], "responses": { @@ -281,39 +291,33 @@ } } }, - "/get_volume": { - "description": "Get volume", + "/get_stream_info": { + "description": "Retrieve stream information", "get": { "parameters": [ { "in": "query", - "name": "endpoint_type", - "required": true, - "schema": { "type": "enum" } - }, - { - "in": "query", - "name": "endpoint_id", + "name": "stream_id", "required": true, - "schema": { "type": "int" } + "schema": {"type": "int"} } ], "responses": { "200": { "$ref": "#/components/responses/200", "response": { - "description": "Endpoint volume value", - "type": "double" + "description": "Stream information structure", + "$ref": "#/components/schemas/stream_info" } }, "400": { "$ref": "#/components/responses/400" } } } }, - "/set_property": { - "description": "Set property value", + "/set_volume": { + "description": "Set volume on endpoint", "get": { - "x-permissions": { "$ref": "#/components/x-permissions/streamcontrol" }, + "x-permissions": { "$ref": "#/components/x-permissions/endpointcontrol" }, "parameters": [ { "in": "query", @@ -324,26 +328,14 @@ { "in": "query", "name": "endpoint_id", - "required": false, - "schema": { "type": "int" } - }, - { - "in": "query", - "name": "property_name", "required": true, - "schema": { "type": "string" } + "schema": { "type": "int" } }, { "in": "query", - "name": "value", + "name": "volume", "required": true, "schema": { "type": "string" } - }, - { - "in": "query", - "name": "ramp_time_ms", - "required": false, - "schema": { "type": "int" } } ], "responses": { @@ -352,8 +344,8 @@ } } }, - "/get_property": { - "description": "Get property value", + "/get_volume": { + "description": "Get endpoint volume", "get": { "parameters": [ { @@ -365,21 +357,15 @@ { "in": "query", "name": "endpoint_id", - "required": false, - "schema": { "type": "int" } - }, - { - "in": "query", - "name": "property_name", "required": true, - "schema": { "type": "string" } + "schema": { "type": "int" } } ], "responses": { "200": { "$ref": "#/components/responses/200", "response": { - "description": "Property value", + "description": "Endpoint volume value", "type": "double" } }, @@ -387,10 +373,9 @@ } } }, - "/set_state": { - "description": "Set state", + "/get_endpoint_info": { + "description": "Retrieve endpoint information including its properties", "get": { - "x-permissions": { "$ref": "#/components/x-permissions/streamcontrol" }, "parameters": [ { "in": "query", @@ -401,18 +386,42 @@ { "in": "query", "name": "endpoint_id", + "required": false, + "schema": { "type": "int" } + } + ], + "responses": { + "200": { "$ref": "#/components/responses/200" }, + "400": { "$ref": "#/components/responses/400" } + } + } + }, + "/set_property": { + "description": "Set endpoint property value", + "get": { + "x-permissions": { "$ref": "#/components/x-permissions/endpointcontrol" }, + "parameters": [ + { + "in": "query", + "name": "endpoint_type", "required": true, + "schema": { "type": "enum" } + }, + { + "in": "query", + "name": "endpoint_id", + "required": false, "schema": { "type": "int" } }, { "in": "query", - "name": "state_name", + "name": "property_name", "required": true, "schema": { "type": "string" } }, { "in": "query", - "name": "state_value", + "name": "value", "required": true, "schema": { "type": "string" } } @@ -423,8 +432,8 @@ } } }, - "/get_state": { - "description": "Get state value", + "/get_property": { + "description": "Get endpoint property value", "get": { "parameters": [ { @@ -436,12 +445,12 @@ { "in": "query", "name": "endpoint_id", - "required": true, + "required": false, "schema": { "type": "int" } }, { "in": "query", - "name": "state_name", + "name": "property_name", "required": true, "schema": { "type": "string" } } @@ -450,22 +459,39 @@ "200": { "$ref": "#/components/responses/200", "response": { - "description": "Endpoint state value", - "type": "string" + "description": "Property value", + "type": "double" } }, "400": { "$ref": "#/components/responses/400" } } } }, - "/post_sound_event": { - "description": "Post sound event", + "/get_list_actions": { + "description": "Retrieve a list of supported actions for a particular audio role", + "get": { + "parameters": [ + { + "in": "query", + "name": "audio_role", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { "$ref": "#/components/responses/200" }, + "400": { "$ref": "#/components/responses/400" } + } + } + }, + "/post_action": { + "description": "Post sound or audio device related action event (extendable mechanism)", "get": { "x-permissions": { "$ref": "#/components/x-permissions/soundevent" }, "parameters": [ { "in": "query", - "name": "event_name", + "name": "action_name", "required": true, "schema": { "type": "string" } }, @@ -483,7 +509,7 @@ }, { "in": "query", - "name": "audio_context", + "name": "action_context", "required": false, "schema": { "type": "object" } } @@ -530,12 +556,8 @@ } ], "responses": { - "200": { - "$ref": "#/components/responses/200" - }, - "400": { - "$ref": "#/components/responses/400" - } + "200": { "$ref": "#/components/responses/200" }, + "400": { "$ref": "#/components/responses/400" } } } } |