Skip to content

Instantly share code, notes, and snippets.

@fantix
Created February 11, 2020 22:40
Show Gist options
  • Save fantix/5ae1d8a9d3aa7dcdc59bae0f043bc3cf to your computer and use it in GitHub Desktop.
Save fantix/5ae1d8a9d3aa7dcdc59bae0f043bc3cf to your computer and use it in GitHub Desktop.
Gen3 Metadata Service
{"openapi":"3.0.2","info":{"title":"DCFS Metadata Service","version":"1.2.0a0"},"paths":{"/version":{"get":{"summary":"Get Version","operationId":"get_version_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/_status":{"get":{"summary":"Get Status","operationId":"get_status__status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/metadata_index":{"get":{"tags":["Index"],"summary":"List Metadata Indexes","description":"List all the metadata key paths indexed in the database.","operationId":"list_metadata_indexes_metadata_index_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBasic":[]}]}},"/metadata_index/{path}":{"post":{"tags":["Index"],"summary":"Create Metadata Indexes","description":"Create a database index on the given metadata key path.","operationId":"create_metadata_indexes_metadata_index__path__post","parameters":[{"required":true,"schema":{"title":"Path"},"name":"path","in":"path"}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBasic":[]}]},"delete":{"tags":["Index"],"summary":"Drop Metadata Indexes","description":"Drop the database index on the given metadata key path.","operationId":"drop_metadata_indexes_metadata_index__path__delete","parameters":[{"required":true,"schema":{"title":"Path"},"name":"path","in":"path"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBasic":[]}]}},"/metadata":{"get":{"tags":["Query"],"summary":"Search Metadata","description":"Search the metadata.\n\nWithout filters, this will return all data. Add filters as query strings like this:\n\n GET /metadata?a=1&b=2\n\nThis will match all records that have metadata containing all of:\n\n {\"a\": 1, \"b\": 2}\n\nThe values are always treated as strings for filtering. Nesting is supported:\n\n GET /metadata?a.b.c=3\n\nMatching records containing:\n\n {\"a\": {\"b\": {\"c\": 3}}}\n\nProviding the same key with more than one value filters records whose value of the\ngiven key matches any of the given values. But values of different keys must all\nmatch. For example:\n\n GET /metadata?a.b.c=3&a.b.c=33&a.b.d=4\n\nMatches these:\n\n {\"a\": {\"b\": {\"c\": 3, \"d\": 4}}}\n {\"a\": {\"b\": {\"c\": 33, \"d\": 4}}}\n {\"a\": {\"b\": {\"c\": \"3\", \"d\": 4, \"e\": 5}}}\n\nBut won't match these:\n\n {\"a\": {\"b\": {\"c\": 3}}}\n {\"a\": {\"b\": {\"c\": 3, \"d\": 5}}}\n {\"a\": {\"b\": {\"d\": 5}}}\n {\"a\": {\"b\": {\"c\": \"333\", \"d\": 4}}}","operationId":"search_metadata_metadata_get","parameters":[{"description":"Switch to returning a list of GUIDs (false), or GUIDs mapping to their metadata (true).","required":false,"schema":{"title":"Data","type":"boolean","description":"Switch to returning a list of GUIDs (false), or GUIDs mapping to their metadata (true).","default":false},"name":"data","in":"query"},{"description":"Maximum number of records returned. (max: 100)","required":false,"schema":{"title":"Limit","type":"integer","description":"Maximum number of records returned. (max: 100)","default":10},"name":"limit","in":"query"},{"description":"Return results at this given offset.","required":false,"schema":{"title":"Offset","type":"integer","description":"Return results at this given offset.","default":0},"name":"offset","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Maintain"],"summary":"Batch Create Metadata","description":"Create metadata in batch.","operationId":"batch_create_metadata_metadata_post","parameters":[{"required":false,"schema":{"title":"Overwrite","type":"boolean","default":true},"name":"overwrite","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"title":"Data List","type":"array","items":{}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBasic":[]}]}},"/metadata/{guid}":{"get":{"tags":["Query"],"summary":"Get Metadata","description":"Get the metadata of the GUID.","operationId":"get_metadata_metadata__guid__get","parameters":[{"required":true,"schema":{"title":"Guid"},"name":"guid","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Maintain"],"summary":"Update Metadata","description":"Update the metadata of the GUID.","operationId":"update_metadata_metadata__guid__put","parameters":[{"required":true,"schema":{"title":"Guid"},"name":"guid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"title":"Data","type":"object"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBasic":[]}]},"post":{"tags":["Maintain"],"summary":"Create Metadata","description":"Create metadata for the GUID.","operationId":"create_metadata_metadata__guid__post","parameters":[{"required":true,"schema":{"title":"Guid"},"name":"guid","in":"path"},{"required":false,"schema":{"title":"Overwrite","type":"boolean","default":false},"name":"overwrite","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"title":"Data","type":"object"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBasic":[]}]},"delete":{"tags":["Maintain"],"summary":"Delete Metadata","description":"Delete the metadata of the GUID.","operationId":"delete_metadata_metadata__guid__delete","parameters":[{"required":true,"schema":{"title":"Guid"},"name":"guid","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBasic":[]}]}}},"components":{"schemas":{"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"type":"string"}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}}},"securitySchemes":{"HTTPBasic":{"type":"http","scheme":"basic"}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment