OpenAPI Specification
swagger: '2.0'
info:
description: " ## Overview\nOpen ADK is designed for the users that they can build their own application very quickly. Open ADK provided two features:\n- Easy way to call API\n- Easy way to receive the data from remote device\n\n## Requirements.\nPython 2.7 or 3.4+\n\n## Installation & Usage\nYou can install Open ADK from github.\n```\npip install git+https://github.com/UBTEDU/Yanshee_OpenADK.git\n```\n(you may need to run pip with root permission: sudo pip install git+https://github.com/UBTEDU/Yanshee_OpenADK.git)\nThen import the package:\n```\nimport openadk\n```\n\n## Setuptools\nInstall via [Setuptools](https://pypi.org/project/setuptools/).\n```\npython setup.py install --user\n```\n(or sudo python setup.py install to install the package for all users)\nThen import the package:\n```\nimport openadk\n```\n\n## Getting Started\nPlease follow the installation procedure and then run the following:\n```\nfrom __future__ import print_function\nimport time\nimport openadk\nfrom openadk.rest import ApiException\nfrom pprint import pprint\n\n# create an instance of the API class\nconfiguration = openadk.Configuration()\nconfiguration.host = 'http://<ip>:9090/v1'\napi_instance = openadk.DevicesApi(openadk.ApiClient(configuration))\n\ntry:\n\t# Get system's battery information\n\tapi_response = api_instance.get_devices_battery()\n\tpprint(api_response)\nexcept ApiException as e:\n\tprint(\"Exception when calling DevicesApi->get_devices_battery: %s\" % e)\n```\n"
version: 1.0.0
title: Yanshee Open ADK subscriptions API
termsOfService: https://account.ubtrobot.com/gdpr/ukit/v1.0.3/TermsOfUse_en.html
contact:
email: swenggroup@ubtrobot.com
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
host: 127.0.0.1:10101
basePath: /v1
schemes:
- http
tags:
- name: subscriptions
description: Receive data from remote device.
paths:
/subscriptions/motions:
put:
tags:
- subscriptions
summary: Get the motion's status, which is pushed from the remote device.
description: ' Get motions'' status. The possible values:
- idle
- run
- pause '
operationId: putMotions
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
description: ' The motion''s status. '
required: true
schema:
$ref: '#/definitions/SubscriptionMotionsStatusResponse'
responses:
200:
description: Success
schema:
$ref: '#/definitions/SubscriptionCommonResponse'
/subscriptions/sensors/gyro:
put:
tags:
- subscriptions
summary: Get the gyroscope sensor's data, which is pushed from the remote device.
description: ''
operationId: putSensorsSubscription
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/SubscriptionSensorsGyroValueResponse'
responses:
200:
description: Success
schema:
$ref: '#/definitions/SubscriptionCommonResponse'
/subscriptions/sensors/ultrasonic:
put:
tags:
- subscriptions
summary: Get ultrasonic sensor's data, which is pushed from the remote device.
description: ''
operationId: putSensorsSubscriptionSensorsUltrasonic
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/SubscriptionSensorsUltrasonicValueResponse'
responses:
200:
description: Success
schema:
$ref: '#/definitions/SubscriptionCommonResponse'
/subscriptions/sensors/infrared:
put:
tags:
- subscriptions
summary: Get infrared sensor's data, which is pushed from the remote device.
description: ''
operationId: putSensorsSubscriptionSensorsInfrared
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/SubscriptionSensorsInfraredValueResponse'
responses:
200:
description: Success
schema:
$ref: '#/definitions/SubscriptionCommonResponse'
/subscriptions/sensors/environment:
put:
tags:
- subscriptions
summary: Get environment sensor's data, which is pushed from the remote device.
description: ''
operationId: putSensorsSubscriptionSensorsEnvironment
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/SubscriptionSensorsEnvironmentValueResponse'
responses:
200:
description: Success
schema:
$ref: '#/definitions/SubscriptionCommonResponse'
/subscriptions/sensors/touch:
put:
tags:
- subscriptions
summary: Get touch sensor's data, which is pushed from the remote device.
description: ''
operationId: putSensorsSubscriptionSensorsTouch
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/SubscriptionSensorsTouchValueResponse'
responses:
200:
description: Success
schema:
$ref: '#/definitions/SubscriptionCommonResponse'
/subscriptions/sensors/pressure:
put:
tags:
- subscriptions
summary: Get pressure sensor's data, which is pushed from the remote device.
description: ''
operationId: putSensorsSubscriptionSensorsPressure
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/SubscriptionSensorsPressureValueResponse'
responses:
200:
description: Success
schema:
$ref: '#/definitions/SubscriptionCommonResponse'
/subscriptions/visions:
put:
tags:
- subscriptions
summary: Get compute vision's result, which is pushed from the remote device.
description: 'URL example: http://10.10.1.30:80/subscriptions/visions'
operationId: putVisionSubscriptionVisions
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/SubscriptionVisionsGetResponse'
responses:
200:
description: Success
schema:
$ref: '#/definitions/SubscriptionCommonResponse'
/subscriptions/voice/iat:
put:
tags:
- subscriptions
summary: Get auto transform's result, which is pushed from the remote device.
description: 'URL example: http://10.10.1.30:80/subscriptions/voice/iat'
operationId: putVoiceIatSubscriptionVoiceIAT
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/SubscriptionVoiceResponse'
responses:
200:
description: Success
schema:
$ref: '#/definitions/SubscriptionCommonResponse'
/subscriptions/voice/asr:
put:
tags:
- subscriptions
summary: Get automatic speech recognition's result, which is pushed from the remote device.
description: 'URL example: http://10.10.1.30:80/subscriptions/voice/asr'
operationId: putVoiceAsrSubscriptionsVoiceASR
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/SubscriptionVoiceResponse'
responses:
200:
description: Success
schema:
$ref: '#/definitions/SubscriptionCommonResponse'
/subscriptions/voice/tts:
put:
tags:
- subscriptions
summary: Get text to speech's result, which is pushed from the remote device.
description: 'Example URL : http://10.10.1.30:80/tts'
operationId: putTTSSubscriptionsVoiceTTS
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/SubscriptionVoiceResponse'
responses:
200:
description: Success
schema:
$ref: '#/definitions/SubscriptionCommonResponse'
definitions:
SubscriptionSensorsInfraredValue:
type: object
required:
- infrared
properties:
infrared:
type: array
items:
$ref: '#/definitions/SubscriptionSensorsInfraredInfo'
xml:
name: SubscriptionSensorsInfraredValue
SubscriptionVisionsAnalysis:
type: object
properties:
age:
$ref: '#/definitions/SubscriptionVisionsAge'
gender:
$ref: '#/definitions/SubscriptionVisionsGender'
xml:
name: SubscriptionVisionsAnalysis
SubscriptionSensorsUltrasonicValue:
type: object
required:
- ultrasonic
properties:
ultrasonic:
type: array
items:
$ref: '#/definitions/SubscriptionSensorsUltrasonicInfo'
xml:
name: SubscriptionSensorsUltrasonicValue
SubscriptionVisionsGetResponse:
type: object
required:
- code
- type
- msg
properties:
code:
type: integer
description: Return code. 0 means success.
example: 0
type:
type: string
enum:
- recognition
- tracking
- gender
- age_group
- quantity
- color_detect
description: ' The compute vision''s result. The possible "type" values:
- recognition
- tracking
- gender
- age_group
- quantity
- color_detect '
data:
$ref: '#/definitions/SubscriptionVisionsResults'
timestamp:
type: integer
format: int64
description: Timestamp, Unix standard time.
example: 1551838515
status:
type: string
description: Compute vision's status
example: idle
msg:
type: string
description: Return code details.
example: Success
xml:
name: SubscriptionVisionsGetResponse
SubscriptionSensorsTouchValueResponse:
type: object
required:
- code
- data
- msg
properties:
code:
type: integer
description: Return code. 0 means success.
format: int32
data:
$ref: '#/definitions/SubscriptionSensorsTouchValue'
msg:
type: string
description: Return code's details.
example: Success
xml:
name: SubscriptionSensorsTouchValueResponse
SubscriptionCommonResponse:
type: object
required:
- code
- data
- msg
properties:
code:
type: integer
description: Return code. 0 means success.
format: int32
data:
type: object
example: {}
msg:
description: Return code's details.
type: string
example: Success
xml:
name: SubscriptionCommonResponse
SubscriptionSensorsInfraredValueResponse:
type: object
required:
- code
- data
- msg
properties:
code:
type: integer
description: Return code. 0 means success.
format: int32
data:
$ref: '#/definitions/SubscriptionSensorsInfraredValue'
msg:
type: string
description: Return code's details.
example: Success
xml:
name: SubscriptionSensorsInfraredValueResponse
SubscriptionMotionsStatus:
type: object
required:
- status
properties:
status:
type: string
description: The motions' status.
enum:
- idle
- run
- pause
name:
type: string
description: Motion name
default: None
timestamp:
type: integer
format: int64
description: Timestamp, Unix standard time.
example: 1551838515
SubscriptionSensorsPressureValue:
type: object
required:
- pressure
properties:
pressure:
type: array
items:
$ref: '#/definitions/SubscriptionSensorsPressureInfo'
xml:
name: SubscriptionSensorsUltrasonicValue
SubscriptionName:
type: object
required:
- name
properties:
name:
type: string
xml:
name: SubscriptionName
SubscriptionSensorsGyroInfo:
type: object
required:
- id
- euler-x
- euler-y
- euler-z
properties:
id:
type: integer
format: int32
minimum: 1
maximum: 127
example: 52
gyro-x:
type: number
format: float
example: 0.1021
gyro-y:
type: number
format: float
example: 0.602
gyro-z:
type: number
format: float
example: 0.0213
accel-x:
type: number
format: float
example: 0.147949
accel-y:
type: number
format: float
example: 0.116699
accel-z:
type: number
example: 0.813477
compass-x:
type: number
format: float
example: 0.1021
compass-y:
type: number
format: float
example: 0.602
compass-z:
type: number
format: float
example: 0.01232
euler-x:
type: number
format: float
example: 8.073578
euler-y:
type: number
format: float
example: -10.11795
euler-z:
type: number
format: float
example: 0.72052
xml:
name: SubscriptionSensorsGyroInfo
SubscriptionSensorsUltrasonicValueResponse:
type: object
required:
- code
- data
- msg
properties:
code:
type: integer
description: Return code. 0 means success.
format: int32
data:
$ref: '#/definitions/SubscriptionSensorsUltrasonicValue'
msg:
type: string
description: Return code's details.
example: Success
xml:
name: SubscriptionSensorsUltrasonicValueResponse
SubscriptionSensorsGyroValueResponse:
type: object
required:
- code
- data
- msg
properties:
code:
type: integer
description: Return code. 0 means success.
format: int32
data:
$ref: '#/definitions/SubscriptionSensorsGyroValue'
msg:
type: string
description: Return code's details.
example: Success
xml:
name: SubscriptionSensorsGyroValueResponse
SubscriptionSensorsPressureInfo:
type: object
required:
- id
- value
properties:
id:
description: Sensor's I2C address.
type: integer
format: int32
minimum: 1
maximum: 127
example: 35
slot:
type: integer
description: Sensor's slot number.
format: int32
minimum: 1
maximum: 6
example: 1
value:
description: The pressure sensor's value. (N)
type: integer
format: int32
example: 25
xml:
name: SubscriptionSensorsPressureInfo
SubscriptionVisionsGender:
type: object
required:
- gender
properties:
gender:
type: string
enum:
- male
- female
- none
description: ' The compute vision''s result. The possible values:
- male
- female
- none default value '
xml:
name: SubscriptionVisionsGender
SubscriptionSensorsEnvironmentValue:
type: object
required:
- environment
properties:
environment:
type: array
items:
$ref: '#/definitions/SubscriptionSensorsEnvironmentInfo'
xml:
name: SubscriptionSensorsEnvironmentValue
SubscriptionSensorsEnvironmentInfo:
type: object
required:
- id
- temperature
- humidity
properties:
id:
type: integer
format: int32
minimum: 1
maximum: 127
example: 54
slot:
type: integer
description: The sensor's slot number.
format: int32
minimum: 1
maximum: 6
example: 1
temperature:
description: The temperature sensor's value.
type: integer
format: int32
example: 25
humidity:
description: The humidity sensor's value.
type: integer
format: int32
example: 75
pressure:
description: The pressure sensor's value.
type: integer
format: int32
example: 1003
xml:
name: SubscriptionSensorsEnvironmentInfo
SubscriptionSensorsTouchInfo:
type: object
required:
- id
- value
properties:
id:
description: Sensor's I2C address.
type: integer
format: int32
minimum: 1
maximum: 127
example: 29
slot:
type: integer
description: Sensor's slot number.
format: int32
minimum: 1
maximum: 6
example: 1
value:
description: ' The touch sensor''s value. The possible values:
- 0 Not touched
- 1 Button 1 is touched
- 2 Button 2 is touched
- 3 Button 1 and 2 are touched
'
type: integer
format: int32
example: 25
xml:
name: SubscriptionSensorsTouchInfo
SubscriptionVoiceResponse:
type: object
description: ' Automatic speech recognition or auto transform''s result. '
required:
- code
- type
- msg
properties:
code:
type: integer
description: Return code. 0 means success.
example: 0
type:
type: string
enum:
- asr
- iat
- tts
description: ' The possible values:
- asr
- iat
- tts '
example: asr
data:
description: ' Automatic speech recognition or auto transform''s result. '
type: object
example: {}
status:
type: string
description: ' Status value
- build
- run
- idle
'
example: idle
timestamp:
description: Timestamp, Unix standard time.
type: integer
format: int64
example: 1000789666
msg:
description: Return code's details.
type: string
xml:
name: SubscriptionVoiceResponse
SubscriptionSensorsPressureValueResponse:
type: object
required:
- code
- data
- msg
properties:
code:
type: integer
description: Return code. 0 means success.
format: int32
data:
$ref: '#/definitions/SubscriptionSensorsPressureValue'
msg:
type: string
description: Return code's details.
example: Success
xml:
name: SubscriptionSensorsPressureValueResponse
SubscriptionVisionsAge:
type: object
properties:
age:
type: integer
description: Age.
example: 5
minimum: 0
group:
type: string
description: ' The age group value. The possible values:
- baby
- children
- juvenile
- youth
- middle_age
- old_age
- none '
example: baby
xml:
name: SubscriptionVisionsAge
SubscriptionSensorsUltrasonicInfo:
type: object
required:
- id
- value
properties:
id:
description: Sensor's I2C address.
type: integer
format: int32
minimum: 1
maximum: 127
example: 17
slot:
type: integer
description: Sensor's slot number.
format: int32
minimum: 1
maximum: 6
example: 1
value:
description: ' The ultrasonic sensor''s value. (mm) '
type: integer
format: int32
example: 25
xml:
name: SubscriptionSensorsUltrasonicInfo
SubscriptionSensorsInfraredInfo:
type: object
required:
- id
- value
properties:
id:
description: Sensor's I2C address.
type: integer
format: int32
minimum: 1
maximum: 127
example: 23
slot:
type: integer
description: Sensor's slot number.
format: int32
minimum: 1
maximum: 6
example: 1
value:
description: Distance value. (mm)
type: integer
format: int32
example: 25
xml:
name: SubscriptionSensorsInfraredInfo
SubscriptionSensorsEnvironmentValueResponse:
type: object
required:
- code
- data
- msg
properties:
code:
type: integer
description: Return code. 0 means success.
format: int32
data:
$ref: '#/definitions/SubscriptionSensorsEnvironmentValue'
msg:
type: string
description: Return code's details.
example: Success
xml:
name: SubscriptionSensorsEnvironmentValueResponse
SubscriptionSensorsGyroValue:
type: object
required:
- gyro
properties:
gyro:
type: array
items:
$ref: '#/definitions/SubscriptionSensorsGyroInfo'
xml:
name: SubscriptionSensorsGyroValue
SubscriptionSensorsTouchValue:
type: object
required:
- touch
properties:
touch:
type: array
items:
$ref: '#/definitions/SubscriptionSensorsTouchInfo'
xml:
name: SubscriptionSensorsTouchValue
SubscriptionVisionsResults:
type: object
properties:
analysis:
$ref: '#/definitions/SubscriptionVisionsAnalysis'
recognition:
$ref: '#/definitions/SubscriptionName'
quantity:
type: integer
description: Quantity.
minimum: 0
example: 1
color:
type: array
description: ' The color results. The possible values:
- none
- black
- gray
- white
- red
- orange
- yellow
- green
- cyan
- blue
- purple '
items:
$ref: '#/definitions/SubscriptionName'
example:
- name: black
- name: gray
- name: red
- name: blue
xml:
name: SubscriptionVisionsResults
SubscriptionMotionsStatusResponse:
type: object
required:
- code
- data
- msg
properties:
code:
type: integer
description: Return code. 0 means success.
format: int32
data:
$ref: '#/definitions/SubscriptionMotionsStatus'
msg:
description: Return code's details.
type: string
example: Success
xml:
name: SubscriptionMotionsStatusResponse
externalDocs:
description: Find out more about Swagger
url: http://swagger.io