This repository has been archived by the owner on Feb 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathswagger.json
1 lines (1 loc) · 17.1 KB
/
swagger.json
1
{"swagger":"2.0","host":"api.screwdriver.cd","basePath":"/","schemes":["http"],"info":{"title":"Screwdriver API Documentation","version":"3"},"securityDefinitions":{"token":{"type":"bearer","name":"X-Token","in":"header"}},"tags":[],"paths":{"/v3/builds":{"get":{"summary":"Get builds with pagination","operationId":"getV3Builds","description":"Returns all build records","parameters":[{"type":"integer","description":"Page to paginate","default":1,"minimum":1,"name":"page","in":"query"},{"type":"integer","description":"Count to paginate","default":50,"minimum":1,"maximum":50,"name":"count","in":"query"}],"tags":["v3"],"responses":{"200":{"schema":{"$ref":"#/definitions/List of Builds","title":"List of Builds"},"description":"Successful"}}},"post":{"summary":"Save a build","operationId":"postV3Builds","description":"Save a specific build","parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/Create Build"}}],"tags":["v3"],"security":[{"token":[]}],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/v3/jobs":{"get":{"summary":"Get jobs with pagination","operationId":"getV3Jobs","description":"Returns all jobs records","parameters":[{"type":"integer","description":"Page to paginate","default":1,"minimum":1,"name":"page","in":"query"},{"type":"integer","description":"Count to paginate","default":50,"minimum":1,"maximum":50,"name":"count","in":"query"}],"tags":["v3"],"responses":{"200":{"schema":{"$ref":"#/definitions/List of Jobs","title":"List of Jobs"},"description":"Successful"}}}},"/v3/pipelines":{"get":{"summary":"Get pipelines with pagination","operationId":"getV3Pipelines","description":"Returns all pipeline records","parameters":[{"type":"integer","description":"Page to paginate","default":1,"minimum":1,"name":"page","in":"query"},{"type":"integer","description":"Count to paginate","default":50,"minimum":1,"maximum":50,"name":"count","in":"query"}],"tags":["v3"],"responses":{"200":{"schema":{"$ref":"#/definitions/List of Pipelines","title":"List of Pipelines"},"description":"Successful"}}},"post":{"summary":"Create a new pipeline","operationId":"postV3Pipelines","description":"Create a specific pipeline","parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/Create Pipeline"}}],"tags":["v3"],"security":[{"token":[]}],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/v3/stats":{"get":{"summary":"API stats","operationId":"getV3Stats","description":"Should return statistics for the entire system","tags":["v3"],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/v3/status":{"get":{"summary":"API status","operationId":"getV3Status","description":"Should respond with 200: ok","tags":["v3"],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/v3/builds/{id}":{"get":{"summary":"Get a single build","operationId":"getV3BuildsId","description":"Returns a build record","parameters":[{"type":"string","description":"Identifier of this build","x-example":"4b8d9b530d2e5e297b4f470d5b0a6e1310d29c5e","x-constraint":{"length":40},"x-format":{"hex":true},"name":"id","in":"path","required":true}],"tags":["v3"],"responses":{"200":{"schema":{"$ref":"#/definitions/Model 1","title":"Get Build"},"description":"Successful"}}},"put":{"summary":"Save a build","operationId":"putV3BuildsId","description":"Save a specific build","parameters":[{"type":"string","description":"Identifier of this Job","x-example":"50dc14f719cdc2c9cb1fb0e49dd2acc4cf6189a0","x-constraint":{"length":40},"x-format":{"hex":true},"name":"id","in":"path","required":true},{"in":"body","name":"body","schema":{"$ref":"#/definitions/Update Build"}}],"tags":["v3"],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/v3/jobs/{id}":{"get":{"summary":"Get a single job","operationId":"getV3JobsId","description":"Returns a job record","parameters":[{"type":"string","description":"Identifier of this Job","x-example":"50dc14f719cdc2c9cb1fb0e49dd2acc4cf6189a0","x-constraint":{"length":40},"x-format":{"hex":true},"name":"id","in":"path","required":true}],"tags":["v3"],"responses":{"200":{"schema":{"$ref":"#/definitions/Model 2","title":"Get Job"},"description":"Successful"}}},"put":{"summary":"Update a job","operationId":"putV3JobsId","description":"Update a specific job","parameters":[{"type":"string","description":"Identifier of this Job","x-example":"50dc14f719cdc2c9cb1fb0e49dd2acc4cf6189a0","x-constraint":{"length":40},"x-format":{"hex":true},"name":"id","in":"path","required":true},{"in":"body","name":"body","schema":{"$ref":"#/definitions/Update Job"}}],"tags":["v3"],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/v3/login/{impersonate*}":{"get":{"summary":"Login route","operationId":"getV3LoginImpersonate","description":"Authenticate user with github oauth provider","tags":["v3"],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}},"post":{"summary":"Login route","operationId":"postV3LoginImpersonate","description":"Authenticate user with github oauth provider","tags":["v3"],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/v3/pipelines/{id}":{"get":{"summary":"Get a single pipeline","operationId":"getV3PipelinesId","description":"Returns a pipeline record","parameters":[{"type":"string","description":"Identifier of this Pipeline","x-example":"2d991790bab1ac8576097ca87f170df73410b55c","x-constraint":{"length":40},"x-format":{"hex":true},"name":"id","in":"path","required":true}],"tags":["v3"],"responses":{"200":{"schema":{"$ref":"#/definitions/Model 3","title":"Get Pipeline"},"description":"Successful"}}},"put":{"summary":"Save a pipeline","operationId":"putV3PipelinesId","description":"Save a specific pipeline","parameters":[{"type":"string","description":"Identifier of this Pipeline","x-example":"2d991790bab1ac8576097ca87f170df73410b55c","x-constraint":{"length":40},"x-format":{"hex":true},"name":"id","in":"path","required":true},{"in":"body","name":"body","schema":{"$ref":"#/definitions/Create Pipeline"}}],"tags":["v3"],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/v3/builds/{id}/logs":{"get":{"summary":"Get logs for a build","operationId":"getV3BuildsIdLogs","description":"Streams logs","parameters":[{"type":"string","description":"Identifier of this build","x-example":"4b8d9b530d2e5e297b4f470d5b0a6e1310d29c5e","x-constraint":{"length":40},"x-format":{"hex":true},"name":"id","in":"path","required":true}],"tags":["v3"],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/v3/builds/{id}/steps/{name}":{"get":{"summary":"Get a step for a build","operationId":"getV3BuildsIdStepsName","description":"Returns a step record","parameters":[{"type":"string","description":"Identifier of this build","x-example":"4b8d9b530d2e5e297b4f470d5b0a6e1310d29c5e","x-constraint":{"length":40},"x-format":{"hex":true},"name":"id","in":"path","required":true},{"type":"string","description":"Name of the Step","required":true,"name":"name","in":"path"}],"tags":["v3"],"responses":{"200":{"schema":{"$ref":"#/definitions/Get Step Metadata","title":"Get Step Metadata"},"description":"Successful"}}},"put":{"summary":"Update a step for a build","operationId":"putV3BuildsIdStepsName","description":"Writes a step record","parameters":[{"type":"string","description":"Identifier of this build","x-example":"4b8d9b530d2e5e297b4f470d5b0a6e1310d29c5e","x-constraint":{"length":40},"x-format":{"hex":true},"name":"id","in":"path","required":true},{"type":"string","description":"Name of the Step","required":true,"name":"name","in":"path"},{"in":"body","name":"body","schema":{"$ref":"#/definitions/Update Step Metadata"}}],"tags":["v3"],"responses":{"200":{"schema":{"$ref":"#/definitions/Get Step Metadata","title":"Get Step Metadata"},"description":"Successful"}}}},"/v3/builds/{id}/steps/{name}/logs":{"get":{"summary":"Get the logs for a build step","operationId":"getV3BuildsIdStepsNameLogs","description":"Returns the logs for a step","parameters":[{"type":"string","description":"Identifier of this build","x-example":"4b8d9b530d2e5e297b4f470d5b0a6e1310d29c5e","x-constraint":{"length":40},"x-format":{"hex":true},"name":"id","in":"path","required":true},{"type":"string","description":"Name of the Step","required":true,"name":"name","in":"path"},{"type":"integer","description":"Starting Line Number","default":0,"minimum":0,"name":"from","in":"query"}],"tags":["v3"],"responses":{"200":{"schema":{"$ref":"#/definitions/List of Log Lines","title":"List of Log Lines"},"description":"Successful"}}}},"/v3/logout":{"post":{"summary":"Logout route","operationId":"postV3Logout","description":"Clears the cookie used for authentication","tags":["v3"],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/v3/validator":{"post":{"summary":"Validate a given screwdriver.yaml","operationId":"postV3Validator","description":"Returns the parsed config or validation errors","parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/Validation Input"}}],"tags":["v3"],"responses":{"200":{"schema":{"$ref":"#/definitions/Model 4","title":"Execution information"},"description":"Successful"}}}},"/v3/webhooks/build":{"post":{"summary":"Handle events from Launcher","operationId":"postV3WebhooksBuild","description":"Updates the status of the build","parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/Build Webhook"}}],"tags":["v3"],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/v3/webhooks/github":{"post":{"summary":"Handle events from GitHub","operationId":"postV3WebhooksGithub","description":"Acts on pull request, pushes, comments, etc.","tags":["v3"],"responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}}},"definitions":{"steps":{"properties":{"name":{"type":"string","description":"Name of the Step"},"code":{"type":"integer","description":"Exit code"},"startTime":{"type":"string","description":"When this step started","x-format":{"isoDate":true}},"endTime":{"type":"string","description":"When this step stopped running","x-format":{"isoDate":true}}},"required":["name"],"type":"object"},"Get Build":{"properties":{"id":{"type":"string","description":"Identifier of this build","x-example":"4b8d9b530d2e5e297b4f470d5b0a6e1310d29c5e","x-constraint":{"length":40},"x-format":{"hex":true}},"jobId":{"type":"string","description":"Identifier of the Job","x-example":"50dc14f719cdc2c9cb1fb0e49dd2acc4cf6189a0","x-constraint":{"length":40},"x-format":{"hex":true}},"parentBuildId":{"type":"string","description":"Parent build in the case of matrix jobs","x-example":"50dc14f719cdc2c9cb1fb0e49dd2acc4cf6189a0","x-constraint":{"length":40},"x-format":{"hex":true}},"number":{"type":"number","description":"Incrementing number of a Job","x-example":15,"x-constraint":{"positive":true}},"container":{"type":"string","description":"Container this build is running in","x-example":"node:4"},"cause":{"type":"string","description":"Reason why this build started","x-example":"Commit ccc493 was pushed to master"},"sha":{"type":"string","description":"SHA this project was built on","x-example":"ccc49349d3cffbd12ea9e3d41521480b4aa5de5f","x-constraint":{"length":40},"x-format":{"hex":true}},"createTime":{"type":"string","description":"When this build was created","x-format":{"isoDate":true}},"startTime":{"type":"string","description":"When this build started on a build machine","x-format":{"isoDate":true}},"endTime":{"type":"string","description":"When this build stopped running","x-format":{"isoDate":true}},"parameters":{"type":"object","description":"Input parameters that defined this build"},"meta":{"type":"object","description":"Key=>Value information from the build itself"},"steps":{"type":"array","description":"List of steps","items":{"$ref":"#/definitions/steps"}},"status":{"type":"string","description":"Current status of the build","x-example":"SUCCESS","default":"QUEUED","enum":["SUCCESS","FAILURE","QUEUED","ABORTED","RUNNING"]}},"required":["id","jobId","number","cause","createTime","status"],"type":"object"},"List of Builds":{"type":"array","items":{"$ref":"#/definitions/Get Build"}},"Named command to execute":{"properties":{"name":{"type":"string"},"command":{"type":"string"}},"type":"object"},"Job permutation":{"properties":{"image":{"type":"string"},"commands":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/Named command to execute"}},"environment":{"type":"object"}},"type":"object"},"Get Job":{"properties":{"id":{"type":"string","description":"Identifier of this Job","x-example":"50dc14f719cdc2c9cb1fb0e49dd2acc4cf6189a0","x-constraint":{"length":40},"x-format":{"hex":true}},"name":{"type":"string","description":"Name of the Job","x-example":"main","maxLength":25},"containers":{"type":"array","description":"List of container images","x-example":["node:4","node:6"],"items":{"type":"string"}},"permutations":{"type":"array","items":{"$ref":"#/definitions/Job permutation"}},"description":{"type":"string","description":"Description of the Job","x-example":"builds and tests the code","maxLength":100},"pipelineId":{"type":"string","description":"Identifier of the Pipeline","x-example":"2d991790bab1ac8576097ca87f170df73410b55c","x-constraint":{"length":40},"x-format":{"hex":true}},"state":{"type":"string","description":"Current state of the Job","x-example":"ENABLED","default":"ENABLED","enum":["ENABLED","DISABLED"]}},"required":["id","name","pipelineId","state"],"type":"object"},"List of Jobs":{"type":"array","items":{"$ref":"#/definitions/Get Job"}},"Get Pipeline":{"properties":{"id":{"type":"string","description":"Identifier of this Pipeline","x-example":"2d991790bab1ac8576097ca87f170df73410b55c","x-constraint":{"length":40},"x-format":{"hex":true}},"scmUrl":{"type":"string","description":"Source Code URL for the application","x-example":"[email protected]:screwdriver-cd/data-model.git#master"},"configUrl":{"type":"string","description":"Source Code URL for Screwdriver configuration","x-example":"[email protected]:screwdriver-cd/optional-config.git#master"},"createTime":{"type":"string","description":"When this pipeline was created","x-format":{"isoDate":true}},"admins":{"type":"object","description":"Admins of this Pipeline","x-example":{"myself":true}}},"required":["id","scmUrl","createTime","admins"],"type":"object"},"List of Pipelines":{"type":"array","items":{"$ref":"#/definitions/Get Pipeline"}},"Model 1":{"type":"object","$ref":"#/definitions/Get Build"},"Model 2":{"type":"object","$ref":"#/definitions/Get Job"},"Model 3":{"type":"object","$ref":"#/definitions/Get Pipeline"},"Get Step Metadata":{"type":"object","$ref":"#/definitions/steps"},"Log Line":{"properties":{"n":{"type":"integer","description":"Numbered line number since the start of the step","x-example":15},"t":{"type":"number","description":"Unix timestamp of the log line","x-example":1472084645.33,"x-constraint":{"positive":true}},"m":{"type":"string","description":"Line Message"}},"type":"object"},"List of Log Lines":{"type":"array","items":{"$ref":"#/definitions/Log Line"}},"Create Build":{"properties":{"jobId":{"type":"string","description":"Identifier of the Job","x-example":"50dc14f719cdc2c9cb1fb0e49dd2acc4cf6189a0","x-constraint":{"length":40},"x-format":{"hex":true}}},"required":["jobId"],"type":"object"},"Create Pipeline":{"properties":{"scmUrl":{"type":"string","description":"Source Code URL for the application","x-example":"[email protected]:screwdriver-cd/data-model.git#master"},"configUrl":{"type":"string","description":"Source Code URL for Screwdriver configuration","x-example":"[email protected]:screwdriver-cd/optional-config.git#master"}},"required":["scmUrl"],"type":"object"},"Validation Input":{"properties":{"yaml":{"type":"string"}},"type":"object"},"List of available job configurations":{"properties":{"main":{"type":"array","items":{"$ref":"#/definitions/Job permutation"}}},"required":["main"],"type":"object"},"Execution information":{"properties":{"jobs":{"type":"object","$ref":"#/definitions/List of available job configurations"},"workflow":{"type":"array","x-constraint":{"unique":true},"items":{"type":"string"}}},"type":"object"},"Model 4":{"type":"object","$ref":"#/definitions/Execution information"},"Build Webhook":{"properties":{"meta":{"type":"object","description":"Key=>Value information from the build itself"},"status":{"type":"string","description":"Current status of the build","x-example":"SUCCESS","default":"QUEUED","enum":["SUCCESS","FAILURE","QUEUED","ABORTED","RUNNING"]}},"required":["status"],"type":"object"},"Update Build":{"properties":{"status":{"type":"string","description":"Current status of the build","x-example":"SUCCESS","default":"QUEUED","enum":["SUCCESS","FAILURE","QUEUED","ABORTED","RUNNING"]}},"required":["status"],"type":"object"},"Update Job":{"properties":{"state":{"type":"string","description":"Current state of the Job","x-example":"ENABLED","default":"ENABLED","enum":["ENABLED","DISABLED"]}},"type":"object"},"Update Step Metadata":{"properties":{"code":{"type":"integer","description":"Exit code"},"startTime":{"type":"string","description":"When this step started","x-format":{"isoDate":true}},"endTime":{"type":"string","description":"When this step stopped running","x-format":{"isoDate":true}}},"type":"object"}}}