{"swagger":"2.0","info":{"version":"2.0","title":"Abaci","description":"Official API for <a href=\"abaci-concept.html?target=OVERVIEW.md\">Abaci</a>. Made with &hearts;.\n"},"schemes":["https"],"host":"demo.polyglotted.co","basePath":"/api/v2","securityDefinitions":{"AUTH":{"type":"apiKey","in":"header","name":"Authorization","description":"RESIDENT prefix used to authenticate the Base64 encoded principal:credential pair.<p/>\nTOKEN prefix used to validate session token provided in the Base64 encoded principal:token pair.<p/>\nMust use RFC2045-MIME variant of Base64, except not limited to 76 char/line.<p/>\nBasic format: 'Authorization: (RESIDENT|TOKEN) principal:(credential|token)'\n"}},"security":[{"AUTH":[]}],"tags":[{"name":"security","description":"authentication, access policies, role mappings and trusted subjects"},{"name":"meta","description":"traits, models, repositories and schemas"},{"name":"record","description":"data management"},{"name":"search","description":"filter and aggregation"}],"produces":["application/json"],"definitions":{"Trait":{"type":"object","description":"A trait is either a constant or a definition"},"ModelItem":{"type":"object","description":"Fix me","required":["traitFqn","name"],"properties":{"traitFqn":{"type":"string"},"name":{"type":"string"},"desc":{"type":"string"},"idProperties":{"type":"array","items":{"type":"string"}},"autoCompleteFields":{"type":"array","items":{"type":"string"}},"referenceMap":{"type":"object"},"glossaryMap":{"type":"object"},"strict":{"type":"boolean"},"allEnabled":{"type":"boolean"},"approvalRequired":{"type":"boolean"},"approvalRoles":{"type":"array","items":{"type":"string"}}}},"Model":{"type":"object","description":"Fix me","required":["model"],"properties":{"realm":{"type":"string"},"model":{"$ref":"#/definitions/ModelItem"},"indexProperties":{"type":"object"},"children":{"type":"array","items":{"$ref":"#/definitions/ModelItem"}}}},"Repository":{"type":"object","description":"A logical grouping of models.","required":["name","models","filter"],"properties":{"name":{"type":"string"},"models":{"type":"array","items":{"type":"string"}},"filter":{"type":"string","enum":["ALL","LIVE","ARCHIVE","PENDING","REJECTED"]}}},"Schema":{"type":"object","description":"A collection of traits, models and repositories.","required":["name"],"properties":{"name":{"type":"string"},"traits":{"type":"array","items":{"$ref":"#/definitions/Trait"},"description":"A list of constants and/or definitions for this schema."},"models":{"type":"array","items":{"$ref":"#/definitions/Model"},"description":"A list of models for this schema."},"repositories":{"type":"array","items":{"$ref":"#/definitions/Repository"},"description":"A list of repositories for this schema."}}},"Condition":{"type":"object","required":["attribute","function","value"],"description":"A condition of a Policy Rule or Subscription","properties":{"attribute":{"type":"string","description":"The property id of the model"},"function":{"enum":["EQUALS","GREATER_THAN","GREATER_THAN_EQUALS","LESS_THAN","LESS_THAN_EQUALS","PREFIX","IN","BETWEEN","REGEX"],"description":"The relationship expressed between condition attribute and value."},"negate":{"type":"boolean","description":"Negate the function","default":false},"value":{"type":"object","description":"A primitive or primitive array representing the attribute value. TODO - REVISIT."}}},"Rule":{"type":"object","description":"A rule of a Policy","required":["effect"],"properties":{"effect":{"type":"string","enum":["ALLOW","DENY"]},"conditions":{"type":"array","items":{"$ref":"#/definitions/Condition"}}}},"Subject":{"type":"object","description":"Fix me","required":["principal","attributes"],"properties":{"principal":{"type":"string"},"attributes":{"type":"object"},"subscriptions":{"type":"array","items":{"$ref":"#/definitions/Subscription"}}}},"Policy":{"type":"object","description":"Fix me","required":["urn","action","resourceUrns","effect"],"properties":{"urn":{"type":"string"},"action":{"enum":["READ","WRITE"]},"resourceUrns":{"type":"array","items":{"type":"string"},"minItems":1},"rules":{"type":"array","items":{"$ref":"#/definitions/Rule"}},"effect":{"type":"string","enum":["ALLOW","DENY"],"default":"DENY"},"enabled":{"type":"boolean","default":true},"subscriptionDriven":{"type":"boolean","default":false}}},"Subscription":{"type":"object","description":"Fix me","required":["id","description","conditions"],"properties":{"id":{"type":"string"},"description":{"type":"string"},"conditions":{"type":"array","items":{"$ref":"#/definitions/Condition"},"minLength":1}}},"RoleMapping":{"type":"object","description":"Fix me","required":["role","groups"],"properties":{"role":{"type":"string","enum":["ANONYMOUS","MODELER","CURATOR","CONSUMER","GATEKEEPER","ADMINISTRATOR"]},"groups":{"type":"array","items":{"type":"string"},"minLength":1}}},"ErrorResponse":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}},"RecordMetadata":{"properties":{"&id":{"type":"string","description":"record identifier"},"&model":{"type":"string","description":"name of the model"},"&key":{"type":"string","description":"unique record key"},"&timestamp":{"type":"integer","format":"int64","description":"created/updated timestamp"},"&user":{"type":"string","description":"user that created this record"}}},"SaveOperationResult":{"properties":{"&model":{"type":"string","description":"name of the model"},"&id":{"type":"string","description":"record identifier"},"&timestamp":{"type":"integer","format":"int64","description":"created/updated timestamp"},"&result":{"type":"string","enum":["created","updated","deleted","noop"],"description":"result of this operation"}}},"SaveResponse":{"description":"a map of (id, SaveOperationResult). `\"a99bb180-7ce3-5ac2-ae6a-ab81b6dd1104\"`is an example id","properties":{"a99bb180-7ce3-5ac2-ae6a-ab81b6dd1104":{"$ref":"#/definitions/SaveOperationResult"}},"additionalProperties":{"$ref":"#/definitions/SaveOperationResult"}},"SearchResponse":{"type":"object","description":"Standard response format for search requests","properties":{"header":{"type":"object","properties":{"tookInMillis":{"type":"integer","format":"int64"},"totalHits":{"type":"integer","format":"int64"},"returnedHits":{"type":"integer","format":"int64"},"scrollId":{"type":"integer","format":"int64"}}},"results":{"type":"array","items":{"type":"object"}}}},"SearchRequest":{"type":"object","description":"Please refer to https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html"},"Session":{"type":"object","properties":{"&id":{"type":"string"},"&key":{"type":"string"},"&model":{"type":"string","example":"Session"},"&timestamp":{"type":"integer","format":"int64"},"&ttlExpiry":{"type":"integer","format":"int64"},"&user":{"type":"string"},"principal":{"type":"string"},"attributes":{"type":"object","properties":{"ACCESS_TOKEN":{"type":"string"},"ACTIVATED":{"type":"boolean"},"EMAIL":{"type":"string"},"FULL_NAME":{"type":"string"},"PARTIAL_AUTH":{"type":"boolean"},"REALM":{"type":"string"},"REMOTE_ADDR":{"type":"string"},"ROLES":{"type":"array","items":{"type":"string","enum":["CONSUMER","CURATOR","ADMINISTRATOR"]}},"USER_ID":{"type":"string"},"USER_TYPE":{"type":"string"}}}}},"Record":{"type":"object","description":"Placeholder for any model"}},"paths":{"/attachments/{id}":{"get":{"tags":["security"],"parameters":[{"in":"path","name":"id","description":"Access policy to add","required":true}],"responses":{"200":{"description":"OK"}}}},"/auth/authenticate":{"post":{"tags":["security"],"security":[],"summary":"Authenticate a user","parameters":[{"in":"header","name":"Authorization","description":"RESIDENT prefix used to authenticate the Base64 encoded principal:credential pair.<p/> TOKEN prefix used to validate session token provided in the Base64 encoded principal:token pair.<p/> Must use RFC2045-MIME variant of Base64, except not limited to 76 char/line.<p/> Basic format: 'Authorization: (RESIDENT|TOKEN) principal:(credential|token)'","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Session"}},"401":{"description":"UNAUTHORIZED\n* if suitable plugin cannot be found for the AuthScheme\n* if password or username is wrong\n* if `otp` is invalid\n* if authentication fails\n* if session is invalid\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if indexing session fails\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/auth/reauthenticate":{"post":{"tags":["security"],"summary":"Reauthenticate a user","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Session"}},"401":{"description":"UNAUTHORIZED\n* if suitable plugin cannot be found for the AuthScheme\n* if password or username is wrong\n* if `otp` is invalid\n* if authentication fails\n* if session is invalid\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if indexing session fails\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/auth/logout":{"post":{"tags":["security"],"summary":"Logout a user","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Session"}},"401":{"description":"UNAUTHORIZED\n* if suitable plugin cannot be found for the AuthScheme\n* if password or username is wrong\n* if `otp` is invalid\n* if authentication fails\n* if session is invalid\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if indexing session fails\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/access/policies":{"post":{"tags":["security"],"summary":"Create access policy","consumes":["application/json"],"parameters":[{"in":"body","name":"body","description":"Access policy to add","required":true,"schema":{"$ref":"#/definitions/Policy"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/access/policies/{urn}":{"get":{"tags":["security"],"summary":"Get access policy","parameters":[{"in":"path","name":"urn","description":"Identifier of the access policy","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Policy"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails consumer validation\n* if policy engine denies access to read\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"404":{"description":"NOT FOUND\n* if the requested object cannot be found\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"put":{"tags":["security"],"summary":"Update access policy","consumes":["application/json"],"parameters":[{"in":"path","name":"urn","description":"Identifier of the access policy","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the access policy to update. Must match \"&amp;timestamp\" of record requiring update.","required":true,"type":"integer","format":"int64"},{"in":"body","name":"body","description":"access policy to update","required":true,"schema":{"$ref":"#/definitions/Policy"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"delete":{"tags":["security"],"summary":"Delete access policy","description":"When an access policy is deleted, all access will be revoked for the given policy.","consumes":["application/json"],"parameters":[{"in":"path","name":"urn","description":"Identifier of the access policy","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the access policy to delete","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveOperationResult"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/access/trustedsubjects":{"post":{"tags":["security"],"summary":"Create trusted subject","consumes":["application/json"],"parameters":[{"in":"body","name":"body","description":"Trusted subject to add","required":true,"schema":{"$ref":"#/definitions/Subject"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/access/trustedsubjects/{principal}":{"get":{"tags":["security"],"summary":"Get trusted subject","parameters":[{"in":"path","name":"principal","description":"Identifier of the trusted subject","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Policy"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails consumer validation\n* if policy engine denies access to read\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"404":{"description":"NOT FOUND\n* if the requested object cannot be found\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"put":{"tags":["security"],"summary":"Update trusted subject","consumes":["application/json"],"parameters":[{"in":"path","name":"principal","description":"Identifier of the trusted subject","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the trusted subject to update. Must match \"&amp;timestamp\" of record requiring update.","required":true,"type":"integer","format":"int64"},{"in":"body","name":"body","description":"trusted subject to update","required":true,"schema":{"$ref":"#/definitions/Policy"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"delete":{"tags":["security"],"summary":"Delete trusted subject","description":"When an trusted subject is deleted, all access will be revoked for the given policy.","consumes":["application/json"],"parameters":[{"in":"path","name":"principal","description":"Identifier of the trusted subject","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the trusted subject to delete","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveOperationResult"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/access/rolemappings":{"post":{"tags":["security"],"summary":"Create role mapping","consumes":["application/json"],"parameters":[{"in":"body","name":"body","description":"Role mapping to add","required":true,"schema":{"$ref":"#/definitions/RoleMapping"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/access/rolemappings/{id}":{"get":{"tags":["security"],"summary":"Get role mapping","parameters":[{"in":"path","name":"id","description":"Identifier of the role mapping","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/RoleMapping"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails consumer validation\n* if policy engine denies access to read\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"404":{"description":"NOT FOUND\n* if the requested object cannot be found\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"put":{"tags":["security"],"summary":"Update role mapping","consumes":["application/json"],"parameters":[{"in":"path","name":"id","description":"Identifier of the role mapping","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the role mapping to update. Must match \"&amp;timestamp\" of record requiring update.","required":true,"type":"integer","format":"int64"},{"in":"body","name":"body","description":"role mapping to update","required":true,"schema":{"$ref":"#/definitions/RoleMapping"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"delete":{"tags":["security"],"summary":"Delete role mapping","description":"When an role mapping is deleted, all access will be revoked for the given policy.","consumes":["application/json"],"parameters":[{"in":"path","name":"id","description":"Identifier of the role mapping","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the role mapping to delete","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveOperationResult"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/meta/traits":{"post":{"tags":["meta"],"summary":"Create trait","consumes":["application/json"],"parameters":[{"in":"body","name":"body","description":"Trait to add","required":true,"schema":{"$ref":"#/definitions/Trait"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/meta/traits/{fqn}":{"get":{"tags":["meta"],"summary":"Get trait","parameters":[{"in":"path","name":"fqn","description":"Identifier of the trait","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Trait"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails consumer validation\n* if policy engine denies access to read\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"404":{"description":"NOT FOUND\n* if the requested object cannot be found\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"put":{"tags":["meta"],"summary":"Update trait","consumes":["application/json"],"parameters":[{"in":"path","name":"fqn","description":"Identifier of the trait","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the trait to update. Must match \"&amp;timestamp\" of record requiring update.","required":true,"type":"integer","format":"int64"},{"in":"body","name":"body","description":"trait to update","required":true,"schema":{"$ref":"#/definitions/Trait"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"delete":{"tags":["meta"],"summary":"Delete trait","description":"When an trait is deleted, all access will be revoked for the given policy.","consumes":["application/json"],"parameters":[{"in":"path","name":"fqn","description":"Identifier of the trait","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the trait to delete","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveOperationResult"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/meta/models":{"post":{"tags":["meta"],"summary":"Create model","consumes":["application/json"],"parameters":[{"in":"body","name":"body","description":"Model to add","required":true,"schema":{"$ref":"#/definitions/Model"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/meta/models/{id}":{"get":{"tags":["meta"],"summary":"Get model","parameters":[{"in":"path","name":"id","description":"Identifier of the model","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Model"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails consumer validation\n* if policy engine denies access to read\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"404":{"description":"NOT FOUND\n* if the requested object cannot be found\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"put":{"tags":["meta"],"summary":"Update model","consumes":["application/json"],"parameters":[{"in":"path","name":"id","description":"Identifier of the model","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the model to update. Must match \"&amp;timestamp\" of record requiring update.","required":true,"type":"integer","format":"int64"},{"in":"body","name":"body","description":"model to update","required":true,"schema":{"$ref":"#/definitions/Model"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"delete":{"tags":["meta"],"summary":"Delete model","consumes":["application/json"],"parameters":[{"in":"path","name":"id","description":"Identifier of the model","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the model to delete","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveOperationResult"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/meta/repositories":{"post":{"tags":["meta"],"summary":"Create repository","consumes":["application/json"],"parameters":[{"in":"body","name":"body","description":"Repository to add","required":true,"schema":{"$ref":"#/definitions/Repository"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/meta/repositories/{name}":{"get":{"tags":["meta"],"summary":"Get repository","parameters":[{"in":"path","name":"name","description":"Identifier of the repository","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Repository"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails consumer validation\n* if policy engine denies access to read\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"404":{"description":"NOT FOUND\n* if the requested object cannot be found\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"put":{"tags":["meta"],"summary":"Update repository","consumes":["application/json"],"parameters":[{"in":"path","name":"name","description":"Identifier of the repository","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the repository to update. Must match \"&amp;timestamp\" of record requiring update.","required":true,"type":"integer","format":"int64"},{"in":"body","name":"body","description":"repository to update","required":true,"schema":{"$ref":"#/definitions/Repository"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"delete":{"tags":["meta"],"summary":"Delete repository","consumes":["application/json"],"parameters":[{"in":"path","name":"name","description":"Identifier of the repository","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the repository to delete","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveOperationResult"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/meta/schemas":{"post":{"tags":["meta"],"summary":"Create schema","consumes":["application/json"],"parameters":[{"in":"body","name":"body","description":"Schema to add","required":true,"schema":{"$ref":"#/definitions/Schema"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/records/{model}":{"post":{"tags":["record"],"summary":"Create record","consumes":["application/json"],"parameters":[{"in":"path","name":"model","description":"Name of the model","required":true,"type":"string"},{"in":"body","name":"body","description":"Record to add","required":true,"schema":{"$ref":"#/definitions/Record"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/records/{model}/{id}":{"get":{"tags":["record"],"summary":"Get record","parameters":[{"in":"path","name":"model","description":"Name of the model","required":true,"type":"string"},{"in":"path","name":"id","description":"Identifier of the record","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Record"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails consumer validation\n* if policy engine denies access to read\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"404":{"description":"NOT FOUND\n* if the requested object cannot be found\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"put":{"tags":["record"],"summary":"Update record","consumes":["application/json"],"parameters":[{"in":"path","name":"model","description":"Name of the model","required":true,"type":"string"},{"in":"path","name":"id","description":"Identifier of the record","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the record to update. Must match \"&amp;timestamp\" of record requiring update.","required":true,"type":"integer","format":"int64"},{"in":"body","name":"body","description":"model to update","required":true,"schema":{"$ref":"#/definitions/Record"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}},"delete":{"tags":["record"],"summary":"Delete record","consumes":["application/json"],"parameters":[{"in":"path","name":"model","description":"Name of the model","required":true,"type":"string"},{"in":"path","name":"id","description":"Identifier of the record","required":true,"type":"string"},{"in":"query","name":"timestamp","description":"Timestamp of the record to delete","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SaveOperationResult"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if the data fails validation\n* if any transformation step fails internally\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails role validation (self or curator or administrator)\n* if policy engine denies access to save record\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"412":{"description":"PRECONDITION FAILED\n* if any ES indexing errors are found\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if the trait cannot be found for the data\n* if any other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}},"/search":{"post":{"tags":["search"],"summary":"Search all things","consumes":["application/json"],"parameters":[{"in":"query","name":"model","description":"Name of the model to search.","required":true,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"in":"query","name":"flattenAgg","description":"Flattens aggregations if requested.","required":false,"type":"boolean"},{"in":"query","name":"verbose","description":"Verbose governs which meta fields are returned with each record.","required":false,"type":"string","enum":["meta","unique","none"]},{"in":"body","name":"body","description":"Uses native Elasticsearch search format. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html","required":true,"schema":{"$ref":"#/definitions/SearchRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SearchResponse"}},"400":{"description":"BAD REQUEST\n* if the body is empty\n* if deserialization of the search query fails or other illegal arguments\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"403":{"description":"FORBIDDEN\n* if no `Authorization` header present\n* if any error trying to parse `Authorization` header (malformed)\n* if `AuthScheme` is not supported\n* if `X-Realm` cannot be inferred from Hostname\n* if policy engine fails consumer validation\n* if policy engine denies access to read\n","schema":{"$ref":"#/definitions/ErrorResponse"}},"500":{"description":"INTERNAL SERVER ERROR\n* if any ES error or other unknown error happens\n","schema":{"$ref":"#/definitions/ErrorResponse"}}}}}}}