sdrangel/swagger/sdrangel/api/swagger/swagger.yaml

801 lines
24 KiB
YAML
Raw Normal View History

2017-11-14 19:38:11 -05:00
swagger: "2.0"
info:
2017-11-15 12:52:11 -05:00
description: "This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube"
2017-11-14 19:38:11 -05:00
version: "4.0.0"
title: SDRangel
2017-11-15 12:52:11 -05:00
contact:
url: "https://github.com/f4exb/sdrangel"
email: "f4exb06@gmail.com"
2017-11-14 19:38:11 -05:00
# during dev, should point to your local machine
host: localhost:10010
# basePath prefixes all resource paths
basePath: /
#
schemes:
# tip: remove http to make production-grade
- http
- https
# format of bodies a client can send (Content-Type)
consumes:
- application/json
# format of the responses to the client (Accepts)
produces:
- application/json
paths:
/sdrangel:
# binds a127 app logic to a route
x-swagger-router-controller: instance
get:
description: SDRangel instance summary
# used as the method name of the controller
operationId: instanceSummary
responses:
"200":
description: Success
schema:
# a pointer to a definition
$ref: "#/definitions/InstanceSummaryResponse"
# responses may fall through to errors
"500":
2017-11-14 19:38:11 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-14 19:38:11 -05:00
/sdrangel/devices:
x-swagger-router-controller: instance
get:
2017-11-15 12:52:11 -05:00
description: Get a list of sampling devices that can be used to take part in a device set
2017-11-14 19:38:11 -05:00
operationId: instanceDevices
parameters:
2017-11-15 18:51:56 -05:00
- name: tx
2017-11-14 19:38:11 -05:00
in: query
description: Set to non zero (true) for Tx direction (default Rx)
2017-11-14 19:38:11 -05:00
required: false
type: integer
2017-11-14 19:38:11 -05:00
responses:
"200":
description: Success
schema:
$ref: "#/definitions/InstanceDevicesResponse"
"500":
2017-11-14 19:38:11 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-14 19:38:11 -05:00
/sdrangel/channels:
x-swagger-router-controller: instance
get:
2017-11-15 12:52:11 -05:00
description: Get a list of channel plugins available in this instance
2017-11-14 19:38:11 -05:00
operationId: instanceChannels
parameters:
2017-11-15 18:51:56 -05:00
- name: tx
2017-11-14 19:38:11 -05:00
in: query
description: Set to non zero (true) for Tx channels (default Rx)
2017-11-14 19:38:11 -05:00
required: false
type: integer
2017-11-14 19:38:11 -05:00
responses:
"200":
description: Success
schema:
$ref: "#/definitions/InstanceChannelsResponse"
"500":
2017-11-14 19:38:11 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
/sdrangel/logging:
x-swagger-router-controller: instance
get:
description: Get logging information for this instance
operationId: instanceLoggingGet
responses:
"200":
description: Success
schema:
$ref: "#/definitions/LoggingInfo"
"500":
2017-11-15 18:51:56 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
put:
description: Change logging parmeters for this instance
operationId: instanceLoggingPut
consumes:
- application/json
parameters:
- name: body
in: body
description: Logging information
required: true
schema:
$ref: "#/definitions/LoggingInfo"
responses:
"200":
description: Return new data on success
schema:
$ref: "#/definitions/LoggingInfo"
"400":
description: Invallid data
schema:
$ref: "#/definitions/ErrorResponse"
"500":
2017-11-15 18:51:56 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
/sdrangel/audio:
x-swagger-router-controller: instance
get:
description: Get audio devices list available to this instance
operationId: instanceAudioGet
responses:
"200":
description: Success
schema:
$ref: "#/definitions/AudioDevices"
"500":
2017-11-15 18:51:56 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
patch:
description: Set audio devices
operationId: instanceAudioPatch
consumes:
- application/json
parameters:
- name: body
in: body
description: Select audio devices to use for this instance
required: true
schema:
$ref: "#/definitions/AudioDevicesSelect"
responses:
"200":
description: Success
schema:
$ref: "#/definitions/AudioDevicesSelect"
"500":
2017-11-15 18:51:56 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
/sdrangel/location:
x-swagger-router-controller: instance
get:
description: Get instance geolocation information
operationId: instanceLocationGet
responses:
"200":
description: On success return location
schema:
$ref: "#/definitions/LocationInformation"
"500":
2017-11-15 18:51:56 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
put:
description: Set instance geolocation information
operationId: instanceLocationPut
consumes:
- application/json
parameters:
- name: body
in: body
description: Location of instance in latitude and longitude
required: true
schema:
$ref: "#/definitions/LocationInformation"
responses:
"200":
description: On success return location
schema:
$ref: "#/definitions/LocationInformation"
"400":
description: Location invalid
"500":
2017-11-15 18:51:56 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
/sdrangel/dvserial:
x-swagger-router-controller: instance
patch:
description: Set or reset DV serial processing for AMBE frames decoding in digital voice modes
operationId: instanceDVSerialPatch
parameters:
- name: dvserial
in: query
description: Set to non zero (true) to set DV serial processing
2017-11-15 18:51:56 -05:00
required: false
type: integer
2017-11-15 18:51:56 -05:00
responses:
"200":
description: On success return list of devices or empty list if unset
schema:
$ref: "#/definitions/DVSeralDevices"
"500":
2017-11-15 18:51:56 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
/sdrangel/preset:
x-swagger-router-controller: instance
get:
description: List all presets in the instance
operationId: instancePresetGet
responses:
"200":
description: On success return preset list
schema:
$ref: "#/definitions/Presets"
"500":
2017-11-15 18:51:56 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
patch:
description: Load a preset in a device set
operationId: instancePresetPatch
consumes:
- application/json
parameters:
- name: body
in: body
2017-11-16 12:42:35 -05:00
description: Load preset settings to the device set
2017-11-15 18:51:56 -05:00
required: true
schema:
2017-11-16 12:42:35 -05:00
$ref: "#/definitions/PresetTransfer"
2017-11-15 18:51:56 -05:00
responses:
"200":
description: On success return preset identification
schema:
$ref: "#/definitions/PresetIdentifier"
"400":
description: Preset type and device set type mismatch
schema:
$ref: "#/definitions/ErrorResponse"
2017-11-15 18:51:56 -05:00
"404":
description: No preset or device set found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
put:
description: Save device set settings on a preset. Preset is updated if it already exists else it is created with the given name and group. If created given frequency and type is ignored and is determined with the device set values.
2017-11-15 18:51:56 -05:00
operationId: instancePresetPut
consumes:
- application/json
parameters:
- name: body
in: body
2017-11-16 12:42:35 -05:00
description: save device set settings to the preset
2017-11-15 18:51:56 -05:00
required: true
schema:
2017-11-16 12:42:35 -05:00
$ref: "#/definitions/PresetTransfer"
2017-11-15 18:51:56 -05:00
responses:
"200":
description: On success return preset identification
schema:
$ref: "#/definitions/PresetIdentifier"
"404":
description: No preset or device set found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
post:
description: Create a new preset from a device set settings
operationId: instancePresetPost
consumes:
- application/json
parameters:
- name: body
in: body
2017-11-16 12:42:35 -05:00
description: save device set settings on a new preset
2017-11-15 18:51:56 -05:00
required: true
schema:
2017-11-16 12:42:35 -05:00
$ref: "#/definitions/PresetTransfer"
2017-11-15 18:51:56 -05:00
responses:
"200":
description: On success return preset identification
schema:
$ref: "#/definitions/PresetIdentifier"
"400":
description: Invalid frequency
"404":
description: Device set not found
"409":
description: Preset already exists
"500":
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-15 18:51:56 -05:00
delete:
description: Deletes a preset
operationId: instancePresetDelete
consumes:
- application/json
parameters:
- name: body
in: body
description: delete this preset
required: true
schema:
$ref: "#/definitions/PresetIdentifier"
responses:
"200":
description: On success return deleted preset identification
schema:
$ref: "#/definitions/PresetIdentifier"
"400":
description: Invalid frequency
"404":
description: Preset not found
"500":
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-16 02:42:34 -05:00
/sdrangel/devicesets:
x-swagger-router-controller: instance
get:
description: Get summary information about device sets opened in the instance
operationId: instanceDeviceSetsGet
responses:
"200":
description: On success return device set list
schema:
$ref: "#/definitions/DeviceSetList"
"500":
2017-11-16 02:42:34 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-16 02:42:34 -05:00
post:
description: Add (append) a new device set
operationId: instanceDeviceSetsPost
2017-11-16 12:42:35 -05:00
parameters:
- name: tx
in: query
description: Set to non zero (true) for a Tx device set (default Rx)
2017-11-16 12:42:35 -05:00
required: false
type: integer
2017-11-16 02:42:34 -05:00
responses:
"200":
description: On success return new device set
schema:
$ref: "#/definitions/DeviceSet"
"500":
2017-11-16 02:42:34 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-16 02:42:34 -05:00
delete:
description: "Remove last device set"
operationId: instanceDeviceSetsDelete
responses:
"200":
description: On success return new list of device sets
schema:
$ref: "#/definitions/DeviceSetList"
"404":
description: "No more device sets opened in this instance"
"500":
2017-11-16 02:42:34 -05:00
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
"501":
description: Function not implemented
2017-11-14 19:38:11 -05:00
/swagger:
x-swagger-pipe: swagger_raw
# complex objects have schema definitions
definitions:
InstanceSummaryResponse:
2017-11-15 12:52:11 -05:00
description: "Summarized information about this SDRangel instance"
2017-11-14 19:38:11 -05:00
required:
- version
2017-11-16 02:42:34 -05:00
- devicesetlist
2017-11-14 19:38:11 -05:00
properties:
version:
2017-11-15 12:52:11 -05:00
description: "Current software version"
2017-11-14 19:38:11 -05:00
type: string
logging:
$ref: "#/definitions/LoggingInfo"
2017-11-16 02:42:34 -05:00
devicesetlist:
$ref: "#/definitions/DeviceSetList"
2017-11-14 19:38:11 -05:00
user:
2017-11-15 12:52:11 -05:00
$ref: "http://localhost:8081/User.yaml#/User"
2017-11-14 19:38:11 -05:00
InstanceDevicesResponse:
2017-11-15 12:52:11 -05:00
description: "Summarized information about logical devices from hardware devices attached to this SDRangel instance"
2017-11-14 19:38:11 -05:00
required:
- devicecount
properties:
devicecount:
2017-11-15 12:52:11 -05:00
description: "Number of devices attached"
2017-11-14 19:38:11 -05:00
type: integer
devices:
type: array
items:
$ref: "#/definitions/DeviceListItem"
InstanceChannelsResponse:
2017-11-15 12:52:11 -05:00
description: "Summarized information about channel plugins available in this SDRangel instance"
2017-11-14 19:38:11 -05:00
required:
- channelcount
properties:
channelcount:
2017-11-15 12:52:11 -05:00
description: "Number of plugins available"
2017-11-14 19:38:11 -05:00
type: integer
channels:
type: array
items:
$ref: "#/definitions/ChannelListItem"
ErrorResponse:
required:
- message
properties:
message:
type: string
LoggingInfo:
2017-11-15 12:52:11 -05:00
description: "Logging parameters setting"
2017-11-14 19:38:11 -05:00
properties:
consoleLevel:
2017-11-15 12:52:11 -05:00
description: "Minimum level of messages printed to console: debug, info, warning, error"
2017-11-14 19:38:11 -05:00
type: string
fileLevel:
2017-11-15 12:52:11 -05:00
description: "Minimum level of messages written to file: debug, info, warning, error"
2017-11-14 19:38:11 -05:00
type: string
dumpToFile:
description: "not zero (true) if messages are written to file"
type: integer
2017-11-14 19:38:11 -05:00
fileName:
2017-11-15 12:52:11 -05:00
description: "Name of the log file"
2017-11-14 19:38:11 -05:00
type: string
DeviceListItem:
2017-11-15 12:52:11 -05:00
description: "Summarized information about attached hardware device"
2017-11-14 19:38:11 -05:00
required:
- hwType
properties:
displayedName:
description: "Displayable name that uniquely identifies this device instance"
type: string
2017-11-14 19:38:11 -05:00
hwType:
2017-11-15 12:52:11 -05:00
description: "Key to identify the type of hardware device"
2017-11-14 19:38:11 -05:00
type: string
serial:
description: "Serial number of the hardware device"
type: string
sequence:
description: "Sequence in the enumeration of same device types"
type: integer
2017-11-15 18:51:56 -05:00
tx:
description: "Set to not zero (true) if this is a Tx device"
type: integer
2017-11-15 12:52:11 -05:00
nbStreams:
description: "Number of channels or streams in the device"
type: integer
2017-11-14 19:38:11 -05:00
streamIndex:
2017-11-15 12:52:11 -05:00
description: "Index of the channel in the device"
2017-11-14 19:38:11 -05:00
type: integer
deviceSetIndex:
description: "Index of the device set that claimed this device (-1 if not claimed)"
2017-11-14 19:38:11 -05:00
type: integer
index:
description: "Index of the device in the list of registered devices"
type: integer
2017-11-14 19:38:11 -05:00
ChannelListItem:
2017-11-15 12:52:11 -05:00
description: "Summarized information about channel plugin"
2017-11-14 19:38:11 -05:00
required:
- name
- id
properties:
name:
2017-11-15 12:52:11 -05:00
description: "Displayable name of the channel plugin"
2017-11-14 19:38:11 -05:00
type: string
idURI:
description: "Key to identify the channel plugin type in URI form"
type: string
2017-11-14 19:38:11 -05:00
id:
description: "Key to identify the channel plugin type as short object name"
2017-11-14 19:38:11 -05:00
type: string
2017-11-15 18:51:56 -05:00
tx:
description: "Not zero (true) if this is a Tx channel"
type: integer
2017-11-14 19:38:11 -05:00
version:
2017-11-15 12:52:11 -05:00
description: "Channel plugin version number"
2017-11-14 19:38:11 -05:00
type: string
index:
description: "Index of the channel in the list of registered channels"
type: integer
2017-11-14 19:38:11 -05:00
DeviceSet:
2017-11-15 12:52:11 -05:00
description: "Sampling device and its associated channels"
2017-11-14 19:38:11 -05:00
required:
- samplingDevice
- channelcount
properties:
samplingDevice:
$ref: "#/definitions/SamplingDevice"
channelcount:
2017-11-15 12:52:11 -05:00
description: "Number of channels in the set"
2017-11-14 19:38:11 -05:00
type: integer
channels:
2017-11-15 12:52:11 -05:00
description: "Channels list"
2017-11-14 19:38:11 -05:00
type: array
items:
$ref: "#/definitions/Channel"
2017-11-16 02:42:34 -05:00
DeviceSetList:
description: "List of device sets opened in this instance"
required:
- devicesetcount
properties:
devicesetcount:
description: "Number of device sets opened in this instance"
type: integer
deviceSets:
type: array
items:
$ref: "#/definitions/DeviceSet"
2017-11-14 19:38:11 -05:00
SamplingDevice:
2017-11-15 12:52:11 -05:00
description: "Information about a logical device available from an attached hardware device that can be used as a sampling device"
2017-11-14 19:38:11 -05:00
required:
- index
- hwType
- streamIndex
- sequence
- serial
- centerFrequency
- bandwidth
- state
2017-11-14 19:38:11 -05:00
properties:
index:
2017-11-16 02:42:34 -05:00
description: "Index in the list of device sets opened in this instance"
2017-11-14 19:38:11 -05:00
type: integer
hwType:
2017-11-15 12:52:11 -05:00
description: "Key to identify the type of hardware device"
2017-11-14 19:38:11 -05:00
type: string
2017-11-15 18:51:56 -05:00
tx:
description: "Not zero (true) if this is a Tx device"
type: integer
2017-11-15 12:52:11 -05:00
nbStreams:
description: "Number of channels or streams in the device"
type: integer
2017-11-14 19:38:11 -05:00
streamIndex:
2017-11-15 12:52:11 -05:00
description: "Index of the channel in the device"
2017-11-14 19:38:11 -05:00
type: integer
sequence:
2017-11-15 12:52:11 -05:00
description: "Sequence in the enumeration of same device types"
2017-11-14 19:38:11 -05:00
type: integer
serial:
2017-11-15 12:52:11 -05:00
description: "Serial number of the hardware device"
2017-11-14 19:38:11 -05:00
type: string
centerFrequency:
2017-11-15 12:52:11 -05:00
description: "Center frequency in Hz at which the device is tuned possibly taking NCO into account"
2017-11-14 19:38:11 -05:00
type: integer
2017-11-15 12:52:11 -05:00
format: int64
2017-11-14 19:38:11 -05:00
bandwidth:
2017-11-15 12:52:11 -05:00
description: "Bandwidth in Hz or complex S/s of baseband"
2017-11-14 19:38:11 -05:00
type: integer
state:
description: "State: notStarted, idle, ready, running, error"
type: string
2017-11-14 19:38:11 -05:00
Channel:
2017-11-15 12:52:11 -05:00
description: "Channel summarized information"
2017-11-14 19:38:11 -05:00
required:
- index
- id
- uid
- title
2017-11-14 19:38:11 -05:00
- deltaFrequency
properties:
index:
2017-11-15 12:52:11 -05:00
description: "Index in the list of channels"
2017-11-14 19:38:11 -05:00
type: integer
id:
2017-11-15 12:52:11 -05:00
description: "Key to identify the type of channel"
2017-11-14 19:38:11 -05:00
type: string
uid:
description: "Channel instance unique id"
type: integer
format: int64
title:
description: "Freeform title of the channel"
type: string
2017-11-14 19:38:11 -05:00
deltaFrequency:
2017-11-15 12:52:11 -05:00
description: "Channel shift frequency in Hz from the center of baseband"
2017-11-14 19:38:11 -05:00
type: integer
2017-11-15 18:51:56 -05:00
AudioDevices:
description: "List of audio devices available in the system"
required:
- inputVolume
2017-11-15 18:51:56 -05:00
- nbInputDevices
- inputDeviceSelectedIndex
2017-11-15 18:51:56 -05:00
- nbOutputDevices
- outputDeviceSelectedIndex
2017-11-15 18:51:56 -05:00
properties:
inputVolume:
description: "Audio input volume [0.0..1.0]"
type: number
format: float
2017-11-15 18:51:56 -05:00
nbInputDevices:
description: "Number of input audio devices"
type: integer
inputDeviceSelectedIndex:
description: "Index of selected input audio devices (-1 if default)"
type: integer
2017-11-15 18:51:56 -05:00
inputDevices:
description: "List of input devices"
2017-11-15 18:51:56 -05:00
type: array
items:
$ref: "#/definitions/AudioDevice"
2017-11-15 18:51:56 -05:00
nbOutputDevices:
description: "Number of output audio devices"
type: integer
outputDeviceSelectedIndex:
description: "Index of selected output audio devices (-1 if default)"
type: integer
2017-11-15 18:51:56 -05:00
outputDevices:
description: "List of output devices"
2017-11-15 18:51:56 -05:00
type: array
items:
$ref: "#/definitions/AudioDevice"
AudioDevice:
description: "Audio device"
properties:
name:
description: "Displayable name of the device"
type: string
2017-11-15 18:51:56 -05:00
AudioDevicesSelect:
description: "Audio devices selected"
required:
- inputVolume
- inputIndex
- outputIndex
2017-11-15 18:51:56 -05:00
properties:
inputVolume:
description: "Audio input volume [0.0..1.0]"
type: number
format: float
inputIndex:
description: "Index of the audio input device (-1 for default)"
type: integer
outputIndex:
description: "Index of the audio output device (-1 for default)"
type: integer
2017-11-15 18:51:56 -05:00
LocationInformation:
description: "Instance geolocation information"
required:
- latitude
- longitude
properties:
latitude:
description: "Lautitude in decimal degrees positive to the north"
type: number
format: float
2017-11-15 18:51:56 -05:00
longitude:
description: "Longitude in decimal degrees positive to the east"
type: number
format: float
2017-11-15 18:51:56 -05:00
DVSeralDevices:
description: "List of DV serial devices available in the system"
required:
- nbDevices
properties:
nbDevices:
description: "Number of DV serial devices"
type: integer
dvSerialDevices:
description: "Device names of DV serial devices"
type: array
items:
$ref: "#/definitions/DVSerialDevice"
DVSerialDevice:
description: "DV serial device details"
properties:
deviceName:
description: "Name of the serial device in the system"
type: string
2017-11-15 18:51:56 -05:00
Presets:
description: "Settings presets"
required:
- nbGroups
properties:
nbGroups:
description: "Number of preset groups"
type: integer
groups:
type: array
items:
$ref: "#/definitions/PresetGroup"
PresetGroup:
description: "Group of presets"
required:
- groupName
- nbPresets
properties:
groupName:
description: "Name of the preset group"
type: string
nbPresets:
description: "Number of presets in the group"
type: integer
presets:
type: array
items:
$ref: "#/definitions/PresetItem"
PresetIdentifier:
description: "Settings preset item"
required:
- groupName
- centerFrequency
- type
- name
properties:
groupName:
description: "Name of the preset group"
type: string
centerFrequency:
description: "Center freqeuency in Hz"
type: integer
format: int64
2017-11-15 18:51:56 -05:00
type:
description: "Type of device set (R: Rx, T: Tx)"
type: string
name:
description: "Descriptive name of the preset"
type: string
PresetItem:
description: "Settings preset item"
required:
- centerFrequency
- type
- name
properties:
centerFrequency:
description: "Center freqeuency in Hz"
type: integer
format: int64
2017-11-15 18:51:56 -05:00
type:
description: "Type of device set (R: Rx, T: Tx)"
type: string
name:
description: "Descriptive name of the preset"
type: string
2017-11-16 12:42:35 -05:00
PresetTransfer:
description: "Preset transfer to or from a device set"
required:
- deviceSetIndex
- preset
properties:
deviceSetIndex:
description: "Index of the device set"
type: integer
preset:
$ref: "#/definitions/PresetIdentifier"