{ "openapi" : "3.0.0", "info" : { "version" : "0.0.1", "title" : "Amostra samples", "description" : "", "contact" : { "email" : "dama@bnl.gov" }, "license" : { "name" : "BSD3", "url" : "https://github.com/NSLS-II/amostra/blob/master/LICENSE" } }, "servers" : [ { "url" : "http://NSLS-II.github.io.amostra/v1" }, { "url" : "https://NSLS-II.github.io.amostra/v1" } ], "tags" : [ { "name" : "samples" } ], "paths" : { "/samples/{uuid}" : { "get" : { "tags" : [ "samples" ], "summary" : "Find a sample by uuid", "description" : "Returns a sample with specific uuid", "operationId" : "getSampleByuuid", "parameters" : [ { "name" : "uuid", "in" : "path", "description" : "Globally unique ID", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "../../amostra/schemas/sample.json" } } } }, "400" : { "description" : "Invalid uuid supplied" }, "404" : { "description" : "sample not found" } } }, "put" : { "tags" : [ "samples" ], "summary" : "Update an existing sample", "description" : "", "operationId" : "updateSample", "parameters" : [ { "name" : "uuid", "in" : "path", "description" : "Globally unique ID", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "type" : "object", "properties" : { "change" : { "type" : "object", "properties" : { "name" : { "type" : "string" }, "new" : { "type" : "object" } } } } } } } }, "responses" : { "400" : { "description" : "Invalid ID supplied" }, "404" : { "description" : "Sample not found" }, "405" : { "description" : "Validation exception" } } } }, "/samples/{uuid}/revisions" : { "get" : { "tags" : [ "samples" ], "summary" : "Find revisions of a sample by uuid", "description" : "Returns revisons of a sample with specific uuid", "operationId" : "getSampleRevisionsByuuid", "parameters" : [ { "name" : "uuid", "in" : "path", "description" : "Globally unique ID", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "type" : "object", "properties" : { "revisons" : { "type" : "array", "items" : { "$ref" : "../../amostra/schemas/sample.json" } } } } } } }, "400" : { "description" : "Invalid uuid supplied" }, "404" : { "description" : "Revisons not found" } } } }, "/samples/new" : { "post" : { "tags" : [ "samples" ], "summary" : "Create a new sample", "description" : "", "operationId" : "newSample", "requestBody" : { "description" : "Optional description in *Markdown*", "required" : true, "content" : { "application/json" : { "schema" : { "type" : "object", "properties" : { "name" : { "type" : "string", "description" : "Sample name" }, "projects" : { "description" : "List of foreign keys to Projects", "type" : "array", "items" : { "type" : "string" } }, "composition" : { "type" : "string", "description" : "Sample composition (IUCr specification)" }, "tags" : { "type" : "array", "items" : { "type" : "string" }, "description" : "Arbitrary useful labels" }, "description" : { "type" : "string", "description" : "Longer sample description" } }, "required" : [ "name" ] } } } }, "responses" : { "200" : { "description" : "successful operation" }, "400" : { "description" : "Invalid ID supplied" } } } }, "/samples" : { "post" : { "tags" : [ "samples" ], "summary" : "Search samples using a Mongo query", "description" : "", "operationId" : "postSample", "requestBody" : { "description" : "Sample object that needs to be added", "required" : true, "content" : { "application/json" : { "schema" : { "type" : "object" } } } }, "responses" : { "200" : { "description" : "successful operation" }, "405" : { "description" : "Invalid input" } } } } } }