Skip to content

Instantly share code, notes, and snippets.

@halkeye
Last active April 8, 2016 17:37
Show Gist options
  • Save halkeye/b6194e1a2195a2daaba9 to your computer and use it in GitHub Desktop.
Save halkeye/b6194e1a2195a2daaba9 to your computer and use it in GitHub Desktop.
Attempting to start making a swagger file for saucelabs api
# for i in java ruby; do java -jar ./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i ../saucerest-java/swagger.yml -l ${i} -o samples/client/saucelabs/${i}/default -DgroupId=com.saucelabs -DartifactId=saucerest -DartifactVersion=2.0.0 -DserializableModel=true; done
swagger: '2.0'
info:
title: Sauce Labs REST API
description: Do the thing!
version: 1.0.0
termsOfService: 'https://saucelabs.com/tos/'
contact:
name: Sauce Labs
url: 'http://saucelabs.com'
email: [email protected]
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
#host: saucelabs.com
schemes:
- https
basePath: /rest/v1
consumes:
- application/json
produces:
- application/json
securityDefinitions:
basicAuth:
type: basic
parameters:
full:
name: full
in: query
description: Should the return result contain everything or just the basics
required: false
type: boolean
username:
name: username
in: path
description: username
required: true
type: string
id:
name: id
in: path
description: Object id
required: true
type: string
limit:
name: limit
in: query
description: Number of results to return
default: 50
type: number
subaccounts:
name: subaccounts
in: query
description: Include subaccounts in list of jobs
default: false
type: boolean
paths:
'/info/platforms/{platform}':
get:
summary: Appium Platform Selections
operationId: getSupportedPlatforms
description: |
A really cool description goes here
tags:
- Info
parameters:
- name: platform
in: path
description: username
required: true
type: string
enum: ["appium", "webdriver"]
responses:
'200':
description: An array of platforms
schema:
type: array
items:
$ref: '#/definitions/Platform'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/info/status':
get:
summary: Sauce Labs Status
operationId: getStatus
tags:
- Info
responses:
'200':
description: Sauce Status
schema:
$ref: '#/definitions/SauceStatus'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/users/{username}':
get:
summary: User information
operationId: getUser
tags:
- User
security:
- basicAuth: []
parameters:
- "$ref": "#/parameters/username"
responses:
'200':
description: User
schema:
$ref: '#/definitions/User'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/users/{username}/concurrency':
get:
summary: User concurrency
operationId: getConcurrency
tags:
- User
security:
- basicAuth: []
parameters:
- "$ref": "#/parameters/username"
responses:
'200':
description: User
schema:
$ref: '#/definitions/Concurrency'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/users/{username}/activity':
get:
summary: Get currently running job counts broken down by account and job status
tags:
- User
- Activity
security:
- basicAuth: []
parameters:
- "$ref": "#/parameters/username"
responses:
'200':
description: The result shows real-time numbers for the parent account and all of its sub-accounts. There is also a "totals" section at the end which tallies the numbers across all accounts.
schema:
$ref: '#/definitions/Activity'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/users/{username}/monthly-minutes':
get:
summary: User's monthly-minutes
tags:
- User
security:
- basicAuth: []
parameters:
- "$ref": "#/parameters/username"
responses:
'200':
description: User
schema:
type: object
properties:
manual:
type: string
automated:
type: string
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{username}/builds':
get:
summary: Get all of a users builds
security:
- basicAuth: []
tags:
- Build
parameters:
- "$ref": "#/parameters/username"
- "$ref": "#/parameters/limit"
- "$ref": "#/parameters/subaccounts"
responses:
'200':
description: List of builds
schema:
type: array
items:
$ref: '#/definitions/Build'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{username}/builds/{id}/jobs':
get:
summary: Get all of the jobs associated with a build
security:
- basicAuth: []
tags:
- Build
- Job
parameters:
- "$ref": "#/parameters/username"
- "$ref": "#/parameters/id"
responses:
'200':
description: List of jobs
schema:
type: array
items:
$ref: '#/definitions/Job'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{username}/builds/{id}/failed-jobs':
get:
summary: Get all of the jobs associated with a build that have failed
security:
- basicAuth: []
tags:
- Build
- Job
parameters:
- "$ref": "#/parameters/username"
- "$ref": "#/parameters/id"
responses:
'200':
description: List of jobs
schema:
type: array
items:
$ref: '#/definitions/Job'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{username}/jobs':
get:
summary: Get all of a users jobs
security:
- basicAuth: []
tags:
- Job
parameters:
- "$ref": "#/parameters/username"
- "$ref": "#/parameters/limit"
- "$ref": "#/parameters/subaccounts"
- "$ref": "#/parameters/full"
- name: manual_only
in: query
description: Only return manual jobs
default: false
type: boolean
- name: auto_only
in: query
description: FIXME ---- ?
default: false
type: boolean
responses:
'200':
description: List of jobs
schema:
type: object
properties:
# FIXME - key is here
jobs:
type: array
items:
$ref: '#/definitions/Job'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{username}/jobs/{id}':
get:
summary: Get Job Information
operationId: getJobInfo
security:
- basicAuth: []
tags:
- Job
parameters:
- "$ref": "#/parameters/username"
- "$ref": "#/parameters/id"
responses:
'200':
description: Job
schema:
$ref: '#/definitions/Job'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
summary: Update Job Information
operationId: updateJobInfo
security:
- basicAuth: []
tags:
- Job
parameters:
- "$ref": "#/parameters/username"
- "$ref": "#/parameters/id"
- name: body
in: body
required: true
schema:
$ref: '#/definitions/Job'
responses:
'200':
description: Job
schema:
$ref: '#/definitions/Job'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{username}/jobs/{id}/stop':
put:
summary: Stop Job Information
operationId: stopJob
security:
- basicAuth: []
tags:
- Job
parameters:
- "$ref": "#/parameters/username"
- "$ref": "#/parameters/id"
responses:
'200':
description: Success
default:
description: Failure
'/{username}/tunnels':
get:
summary: Get Tunnels
operationId: getTunnels
security:
- basicAuth: []
tags:
- Tunnel
parameters:
- "$ref": "#/parameters/username"
- "$ref": "#/parameters/full"
responses:
'200':
description: Tunnels
schema:
type: array
items:
type: string
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{username}/available_tunnels':
get:
summary: Get Tunnels
security:
- basicAuth: []
tags:
- Tunnel
parameters:
- "$ref": "#/parameters/username"
responses:
'200':
description: Tunnels
schema:
type: object
additionalProperties:
$ref: '#/definitions/Tunnel'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{username}/tunnels/{id}':
delete:
summary: Delete a Tunnel
operationId: deleteTunnel
security:
- basicAuth: []
tags:
- Tunnel
parameters:
- "$ref": "#/parameters/username"
- "$ref": "#/parameters/id"
responses:
'200':
description: Successfully delete tunnel
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
get:
summary: Get Tunnels
operationId: getTunnelInformation
security:
- basicAuth: []
tags:
- Tunnel
parameters:
- "$ref": "#/parameters/username"
- "$ref": "#/parameters/id"
responses:
'200':
description: Tunnels
schema:
$ref: '#/definitions/Tunnel'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/storage/{username}':
get:
summary: User information
operationId: getStoredFiles
tags:
- Storage
security:
- basicAuth: []
parameters:
- "$ref": "#/parameters/username"
responses:
'200':
description: An array of files
schema:
type: array
items:
$ref: '#/definitions/File'
'404':
description: User is not found
schema:
$ref: '#/definitions/Error'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/stats/ci:
post:
tags:
- Stats
operationId: recordCI
summary: Record CI Usage
security:
- basicAuth: []
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/CIStat'
responses:
'200':
description: Success
definitions:
Platform:
type: object
description: Platforms that sauce supports
properties:
deprecated_backend_versions:
type: array
description: that thing
items:
type: string
short_version:
type: string
description: Image URL representing the product.
long_version:
type: string
description: Image URL representing the product.
latest_stable_version:
type: string
recommended_backend_version:
type: string
supported_backend_versions:
type: array
items:
type: string
long_name:
type: string
api_name:
type: string
device:
type: string
automation_backend:
type: string
os:
type: string
User:
type: object
description: User
properties:
domain:
type: string
first_name:
type: string
description: First name of the Sauce user.
last_name:
type: string
description: Last name of the Sauce user.
creation_time:
type: string
format: unixtime
user_type:
type: string
# FIXME enum: []
ancestor_concurrency_limit:
$ref: '#/definitions/ConcurrencyLimit'
concurrency_limit:
$ref: '#/definitions/ConcurrencyLimit'
manual_minutes:
type: integer
can_run_manual:
type: boolean
prevent_emails:
type: array
items:
type: string
enum: ["marketing"] #FIXME
id:
type: string
verified:
type: boolean
subscribed:
type: boolean
title:
type: string
ancestor_allows_subaccounts:
type: boolean
email:
type: string
format: email
username:
type: string
vm_lockdown:
type: boolean
parent:
type: string
is_admin:
type: string #FIXME - pretty sure this should be a boolean
access_key:
type: string
name:
type: string
is_sso:
type: boolean
entity_type:
type: string
minutes:
type: integer
ConcurrencyLimit:
type: object
properties:
mac:
type: integer
description: Number of concurrent mac VMs allowed
scout:
type: integer
overall:
type: integer
real_device:
type: integer
Concurrency:
type: object
properties:
timestamp:
type: string
format: timestamp
concurrency:
type: object
additionalProperties:
$ref: '#/definitions/SubAccountConcurrencyValues'
SubAccountConcurrencyValues:
type: object
properties:
current:
$ref: '#/definitions/ConcurrencyValues'
remaining:
$ref: '#/definitions/ConcurrencyValues'
ConcurrencyValues:
type: object
properties:
overall:
type: integer
mac:
type: integer
manual:
type: integer
CIStat:
type: object
required:
- platform
properties:
platform:
type: string
description: CI platform which is being used
example: 'jenkins'
platform_version:
type: string
description: platform version
example: '1.180'
Job:
type: object
required:
- id
properties:
browser_short_version:
type: string
video_url:
type: string
format: url
creation_time:
type: string
format: unixtime
"custom-data":
type: string
browser_version:
type: string
owner:
type: string
automation_backend:
type: string
id:
type: string
collects_automator_log:
type: boolean
record_screenshots:
type: boolean
record_video:
type: boolean
build:
type: string
passed:
type: boolean
public:
type: string
enum: ["public", "public restricted", "share", "team"]
assigned_tunnel_id:
type: string
status:
type: string
log_url:
type: string
format: url
start_time:
type: string
format: unixtimes
proxied:
type: boolean
proxy_host: # this is returned by getBuildJobs but not by getJobInfo
type: boolean
modification_time:
type: string
format: unixtime
tags:
type: array
items:
type: string
name:
type: string
commands_not_successful:
type: integer
consolidated_status:
type: string
enum: ["error", "passed", "complete"] # FIXME - what other options?
selenium_version:
type: string
manual:
description: Is manual testing
type: boolean
end_time:
type: string
format: unixtime
deletion_time: # FIXME this is returned by getBuildJobs but not by getJobInfo
type: string
format: unixtime
os:
type: string
breakpointed:
type: string # FIXME i think this can be other things
browser:
type: string
command_counts: # FIXME - this is returned by getBuildJobs but not by getJobInfo
$ref: '#/definitions/CommandCountStats'
base_config:
$ref: '#/definitions/BaseConfig'
BaseConfig:
type: object
properties:
status:
type: string
platform:
type: string
browserName:
type: string
version:
type: integer
name:
type: string
CommandCountStats:
type: object
properties:
all:
type: integer
error:
type: integer
Tunnel:
type: object
required:
- id
properties:
status:
type: string
direct_domains:
type: array
items:
type: string
vm_version:
type: string
last_connected:
type: string
format: unixtime
shutdown_time:
type: string
format: unixtime
creation_time:
type: string
format: unixtime
launch_time:
type: string
format: unixtime
ssh_port:
type: integer
user_shutdown:
type: boolean
use_caching_proxy:
type: boolean
domain_names:
type: array
items:
type: string
shared_tunnel:
type: boolean
tunnel_identifier:
type: string
host:
type: string
no_proxy_caching:
type: boolean
owner:
type: string
use_kgp:
type: boolean
no_ssl_bump_domains:
type: array
items:
type: string
id:
type: string
metadata:
$ref: '#/definitions/TunnelMetaData'
Activity:
type: object
properties:
ccy_exec_peak:
type: array
items:
type: integer
datetime:
type: array
items:
type: string
format: date
minutes:
type: array
items:
type: integer
jobs:
type: array
items:
type: integer
TunnelMetaData:
type: object
properties:
hostname:
type: string
git_version:
type: string
platform:
type: string
command:
type: string
build:
type: integer
release:
type: string
nofile_limit:
type: integer
SauceStatus:
type: object
properties:
wait_time:
type: number
format: double
service_operational:
type: boolean
status_message:
type: string
Build:
type: object
properties:
status:
type: string
# FIXME - enum: []
jobs:
type: object
properties:
completed:
type: integer
finished:
type: integer
queued:
type: integer
failed:
type: integer
running:
type: integer
passed:
type: integer
errored:
type: integer
public:
type: integer
name:
type: string
deletion_time:
type: integer
format: unixtime
# FIXME - shouldn't be here
start_time:
type: integer
format: unixtime
creation_time:
type: integer
format: unixtime
number:
type: integer
public:
type: boolean
modification_time:
type: integer
format: unixtime
prefix:
type: string
end_time:
type: integer
format: unixtime
passed:
type: boolean
owner:
type: string
run:
type: integer
id:
type: string
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string
File:
type: object
properties:
name:
type: string
md5:
type: string
size:
type: integer
mtime:
type: string
format: unixtime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment