Files
stf/lib/units/api/swagger/api_v1.yaml
2016-07-22 19:34:22 +05:30

232 lines
5.8 KiB
YAML

swagger: "2.0"
info:
version: "2.0.0"
title: Smartphone Test Farm
description: Control and manager real Smartphone devices from browser and restful apis
license:
name: Apache-2.0
url: http://www.apache.org/licenses/LICENSE-2.0
contact:
name: STF Support
email: contact@openstf.io
url: http://openstf.io/
basePath: /api/v1
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
tags:
- name: user
description: User Operations
- name: device
description: Device Operations
paths:
/me:
x-swagger-router-controller: user
get:
summary: User Profile
description: The User Profile endpoint returns information about current authorized user.
operationId: getCurrentUser
tags:
- user
responses:
"200":
description: Current User Profile information
schema:
$ref: "#/definitions/UserResponse"
default:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
# TODO: Change group endpoint with something more easy to understandable endpoint
/group:
x-swagger-router-controller: user
get:
summary: User Group
description: The User Group endpoint returns information about user group of current authorized user.
operationId: getCurrentUserGroup
tags:
- user
responses:
"200":
description: Current User's Group information
schema:
$ref: "#/definitions/GroupResponse"
default:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/accessTokens:
x-swagger-router-controller: token
get:
summary: Access Tokens
description: The Access Tokens endpoints returns titles of all the valid access tokens.
operationId: getAccessTokens
tags:
- user
responses:
"200":
description: Access Tokens titles
schema:
$ref: "#/definitions/AccessTokensResponse"
default:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/devices:
x-swagger-router-controller: device
get:
summary: Device List
description: The devices enpoint return list of all the STF devices including Disconnected and Offline
operationId: getDevices
tags:
- device
responses:
"200":
description: List of Devices
schema:
$ref: "#/definitions/DeviceListResponse"
default:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/devices/{serial}:
x-swagger-router-controller: device
get:
summary: Device Information
description: The device enpoint return information about a single device.
operationId: getDeviceBySerial
tags:
- device
parameters:
- name: serial
in: path
description: Device Serial
required: true
type: string
responses:
"200":
description: Device Information
schema:
$ref: "#/definitions/DeviceResponse"
default:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/swagger.json:
x-swagger-pipe: swagger_raw
/devices/{serial}/reserve:
x-swagger-router-controller: device
put:
summary: Reseve Device
description: The device reserve enpoint will reserve a device if device it usable
operationId: reserveDeviceBySerial
tags:
- device
parameters:
- name: serial
in: path
description: Device Serial
required: true
type: string
responses:
"200":
description: Device Information
schema:
$ref: "#/definitions/DeviceResponse"
default:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/devices/{serial}/release:
x-swagger-router-controller: device
put:
summary: Device Information
description: The device reserve enpoint will release a device
operationId: releaseDeviceBySerial
tags:
- device
parameters:
- name: serial
in: path
description: Device Serial
required: true
type: string
responses:
"200":
description: Device Information
schema:
$ref: "#/definitions/DeviceResponse"
default:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/swagger.json:
x-swagger-pipe: swagger_raw
definitions:
UserResponse:
required:
- user
properties:
user:
type: object
GroupResponse:
required:
- devices
properties:
devices:
type: array
items:
type: object
AccessTokensResponse:
required:
- tokens
properties:
tokens:
type: array
items:
type: string
DeviceListResponse:
required:
- devices
properties:
devices:
type: array
items:
type: object
DeviceResponse:
required:
- device
properties:
device:
type: object
ErrorResponse:
required:
- message
properties:
message:
type: string
securityDefinitions:
accessTokenAuth:
type: apiKey
name: accessTokenAuth
in: header