-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathswagger.json
More file actions
1 lines (1 loc) 路 8.29 KB
/
Copy pathswagger.json
File metadata and controls
1 lines (1 loc) 路 8.29 KB
1
{"swagger": "2.0", "info": {"title": "myBRC REST API", "description": "REST API for myBRC", "version": "v1"}, "host": "scgup-dev.lbl.gov", "schemes": ["https"], "basePath": "/mybrc-rest", "consumes": ["application/json"], "produces": ["application/json"], "securityDefinitions": {"Basic": {"type": "basic"}}, "security": [{"Basic": []}], "paths": {"/api_token_auth/": {"post": {"operationId": "api_token_auth_create", "description": "", "parameters": [], "responses": {"201": {"description": ""}}, "tags": ["api_token_auth"]}, "parameters": []}, "/can_submit_job/{job_cost}/{user_id}/{account_id}/": {"get": {"operationId": "can_submit_job_read", "description": "Returns whether or not a Job with the given cost can be submitted by the given user for the given account.", "parameters": [{"name": "job_cost", "in": "path", "description": "A string representation of a nonnegative decimal number with no greater than 11 total digits and no greater than 2 decimal places.", "type": "string", "required": true}, {"name": "user_id", "in": "path", "description": "A string representation of the user's cluster UID, a five digit number.", "type": "string", "required": true}, {"name": "account_id", "in": "path", "description": "The name of the account.", "type": "string", "required": true}, {"name": "Authorization", "in": "header", "description": "The authorization token for the requester. The token should be preceded by 'Token ' (no quotes).", "type": "string"}], "responses": {"200": {"description": "A mapping from \"success\" to whether or not the job can be submitted and a mapping from \"message\" to reasoning.", "schema": {"type": "object", "properties": {"success": {"type": "boolean"}, "message": {"type": "string", "x-nullable": true}}}}, "400": {"description": "A mapping from \"success\" to False and a mapping from \"message\" to an error message.", "schema": {"type": "object", "properties": {"success": {"type": "boolean", "default": false}, "message": {"type": "string", "x-nullable": true}}}}}, "tags": ["can_submit_job"]}, "parameters": [{"name": "account_id", "in": "path", "required": true, "type": "string"}, {"name": "job_cost", "in": "path", "required": true, "type": "string"}, {"name": "user_id", "in": "path", "required": true, "type": "string"}]}, "/jobs/": {"get": {"operationId": "jobs_list", "description": "A ViewSet for the Job model, intended for allocation accounting purposes.", "parameters": [{"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/Job"}}}}}}, "tags": ["jobs"]}, "post": {"operationId": "jobs_create", "description": "Creates a new Job identified by the given Slurm ID.", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/Job"}}, {"name": "Authorization", "in": "header", "description": "The authorization token for the requester. The token should be preceded by 'Token ' (no quotes).", "type": "string"}], "responses": {"201": {"description": "", "schema": {"$ref": "#/definitions/Job"}}}, "tags": ["jobs"]}, "parameters": []}, "/jobs/{jobslurmid}/": {"put": {"operationId": "jobs_update", "description": "Updates all fields of the Job identified by the given Slurm ID.", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/Job"}}, {"name": "Authorization", "in": "header", "description": "The authorization token for the requester. The token should be preceded by 'Token ' (no quotes).", "type": "string"}], "responses": {"200": {"description": "", "schema": {"$ref": "#/definitions/Job"}}}, "tags": ["jobs"]}, "parameters": [{"name": "jobslurmid", "in": "path", "required": true, "type": "string"}]}, "/partitions/": {"get": {"operationId": "partitions_list", "description": "A ViewSet for the Partition model.", "parameters": [{"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/Partition"}}}}}}, "tags": ["partitions"]}, "parameters": []}, "/upload_cpu_data/{filename}": {"put": {"operationId": "upload_cpu_data_update", "description": "Creates CPU data from the given zipped JSON file.", "parameters": [{"name": "Authorization", "in": "header", "description": "The authorization token for the requester. The token should be preceded by 'Token ' (no quotes).", "type": "string"}], "responses": {"200": {"description": ""}}, "consumes": [], "tags": ["upload_cpu_data"]}, "parameters": [{"name": "filename", "in": "path", "required": true, "type": "string"}]}, "/users/": {"get": {"operationId": "users_list", "description": "A ViewSet for the SCGUser model.", "parameters": [{"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/SCGUser"}}}}}}, "tags": ["users"]}, "parameters": []}}, "definitions": {"Node": {"required": ["name"], "type": "object", "properties": {"name": {"title": "Name", "type": "string", "maxLength": 30, "minLength": 1}}}, "Job": {"required": ["jobslurmid", "userid", "accountid"], "type": "object", "properties": {"jobslurmid": {"title": "Jobslurmid", "type": "string", "maxLength": 150, "minLength": 1}, "submitdate": {"title": "Submitdate", "type": "string", "format": "date-time", "x-nullable": true}, "startdate": {"title": "Startdate", "type": "string", "format": "date-time", "x-nullable": true}, "enddate": {"title": "Enddate", "type": "string", "format": "date-time", "x-nullable": true}, "userid": {"title": "Userid", "type": "string", "pattern": "^[0-9]+$"}, "accountid": {"title": "Accountid", "type": "string"}, "amount": {"title": "Amount", "type": "string", "format": "decimal"}, "jobstatus": {"title": "Jobstatus", "type": "string", "maxLength": 50, "x-nullable": true}, "partition": {"title": "Partition", "type": "string", "maxLength": 50, "x-nullable": true}, "qos": {"title": "Qos", "type": "string", "maxLength": 50, "x-nullable": true}, "nodes": {"type": "array", "items": {"$ref": "#/definitions/Node"}}, "num_cpus": {"title": "Num cpus", "type": "integer", "maximum": 2147483647, "minimum": -2147483648, "x-nullable": true}, "num_req_nodes": {"title": "Num req nodes", "type": "integer", "maximum": 2147483647, "minimum": -2147483648, "x-nullable": true}, "num_alloc_nodes": {"title": "Num alloc nodes", "type": "integer", "maximum": 2147483647, "minimum": -2147483648, "x-nullable": true}, "raw_time": {"title": "Raw time", "type": "number", "x-nullable": true}, "cpu_time": {"title": "Cpu time", "type": "number", "x-nullable": true}}}, "Partition": {"required": ["name"], "type": "object", "properties": {"name": {"title": "Name", "type": "string", "maxLength": 150, "minLength": 1}, "shared": {"title": "Shared", "type": "boolean"}, "num_nodes": {"title": "Num nodes", "type": "integer", "maximum": 2147483647, "minimum": -2147483648}, "num_cores": {"title": "Num cores", "type": "integer", "maximum": 2147483647, "minimum": -2147483648}, "su_per_core_hour": {"title": "Su per core hour", "type": "string", "format": "decimal"}}}, "SCGUser": {"required": ["email"], "type": "object", "properties": {"username": {"title": "Username", "type": "string", "pattern": "^[a-zA-Z]+$", "maxLength": 150, "minLength": 3, "x-nullable": true}, "email": {"title": "Email address", "description": "Required. Must be an existing email address.", "type": "string", "format": "email", "maxLength": 254, "minLength": 1}}}}}