Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PXP-5529): implement GET /objects endpoint #15

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2d7666a
feat(endpoint): add GET /objects
johnfrancismccann Nov 19, 2020
fe95adf
feat(GET /objects): use search_metadata_helper
johnfrancismccann Dec 3, 2020
da7f330
feat(GET /objects): filter resource paths LIKE val
johnfrancismccann Dec 8, 2020
d639b2b
feat(GET /objects): map filter operators w/ dict
johnfrancismccann Dec 10, 2020
6a6093f
feat(GET /objects): filter all of array where op
johnfrancismccann Dec 12, 2020
683ed5d
feat(GET /objects): POST /bulk/documents in indexd
johnfrancismccann Dec 13, 2020
05c879c
feat(GET /objects): filter w/ () syntax (x,:eq,42)
johnfrancismccann Dec 14, 2020
bf3a6f6
feat(GET /objects): parse filter with parsimonious
johnfrancismccann Dec 15, 2020
06cc2f0
feat(GET /objects): DRY up sqlalchemy clauses
johnfrancismccann Dec 15, 2020
a8d24e5
feat(GET /objects): remove unnecessary comments
johnfrancismccann Dec 15, 2020
f86f036
feat(GET /objects): support boolean SQL clauses
johnfrancismccann Dec 16, 2020
4e0191d
feat(GET /objects): use filter_dict
johnfrancismccann Dec 16, 2020
f48a015
feat(GET /objects): account for empty filter param
johnfrancismccann Dec 16, 2020
e774189
feat(GET /objects): remove commented code
johnfrancismccann Dec 16, 2020
a87bfaa
feat(GET /objects): document examples
johnfrancismccann Dec 16, 2020
a75914d
Apply automatic documentation changes
johnfrancismccann Dec 16, 2020
71506e6
feat(GET /objects): use data param
johnfrancismccann Mar 8, 2021
79e2c7d
feat(GET /objects): return items list in response
johnfrancismccann Mar 9, 2021
80a12d5
feat(GET /objects): restore search_metadata
johnfrancismccann Mar 9, 2021
879e64a
feat(GET /objects): clean up parsing grammar
johnfrancismccann Mar 11, 2021
1b00631
test(GET /objects): add filter tests
johnfrancismccann Mar 12, 2021
9a350c4
test(GET /objects): use resp_json variable
johnfrancismccann Mar 14, 2021
7c90096
docs(GET /objects): add function docstrings
johnfrancismccann Mar 15, 2021
20f00ff
Apply automatic documentation changes
johnfrancismccann Mar 15, 2021
81aedb8
feat(GET /objects): use advanced_search_metadata
johnfrancismccann Mar 16, 2021
aec9b9e
Apply automatic documentation changes
johnfrancismccann Mar 16, 2021
167d39a
feat(GET /objects): change limit from 2000 to 1024
johnfrancismccann Mar 16, 2021
60b9be5
Apply automatic documentation changes
johnfrancismccann Mar 16, 2021
4ff094d
docs(GET /objects): add docstrings to tests
johnfrancismccann Mar 16, 2021
3e574f8
test(GET /objects): add :lte and :gt tests
johnfrancismccann Mar 16, 2021
5d7deba
feat(GET /objects): use search_metadata_objects
johnfrancismccann Mar 17, 2021
f688cd3
Apply automatic documentation changes
johnfrancismccann Mar 17, 2021
df595e8
Merge branch 'master' into feat/get-objects
johnfrancismccann Apr 1, 2021
e35d9bf
feat(GET /objects): compile filter grammar once
johnfrancismccann Apr 2, 2021
d313286
Apply automatic documentation changes
johnfrancismccann Apr 2, 2021
e82e87c
Merge branch 'master' into feat/get-objects
johnfrancismccann Oct 8, 2021
23cb565
docs(GET /objects): move dev info from swagger
johnfrancismccann Oct 8, 2021
8f91573
style(GET /objects): use get on records dict
johnfrancismccann Oct 8, 2021
7ed158e
test(GET /objects): use fixture to set up objects
johnfrancismccann Oct 10, 2021
8636930
feat(GET /objects): add detail in filter error res
johnfrancismccann Oct 11, 2021
82cb87e
Apply automatic documentation changes
johnfrancismccann Oct 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,107 @@ paths:
tags:
- Index
/objects:
get:
description: "Returns a list of objects and their corresponding Indexd records.\n\
\nGiven the following metadata objects:\n\n {\n \"0\": {\n \
\ \"message\": \"hello\",\n \"_uploader_id\": \"100\",\n\
\ \"_resource_paths\": [\n \"/programs/a\",\n \
\ \"/programs/b\"\n ],\n \"pet\": \"dog\"\
,\n \"pet_age\": 1\n },\n \"1\": {\n \"\
message\": \"greetings\",\n \"_uploader_id\": \"101\",\n \
\ \"_resource_paths\": [\n \"/open\",\n \
\ \"/programs/c/projects/a\"\n ],\n \"pet\": \"ferret\"\
,\n \"pet_age\": 5,\n \"sport\": \"soccer\"\n \
\ },\n \"2\": {\n \"message\": \"morning\",\n \
\ \"_uploader_id\": \"102\",\n \"_resource_paths\": [\n \
\ \"/programs/d\",\n \"/programs/e\"\n \
\ ],\n \"counts\": [42, 42, 42],\n \"pet\": \"ferret\"\
,\n \"pet_age\": 10,\n \"sport\": \"soccer\"\n \
\ },\n \"3\": {\n \"message\": \"evening\",\n \
\ \"_uploader_id\": \"103\",\n \"_resource_paths\": [\n \
\ \"/programs/f/projects/a\",\n \"/admin\"\n \
\ ],\n \"counts\": [1, 3, 5],\n \"pet\": \"\
ferret\",\n \"pet_age\": 15,\n \"sport\": \"basketball\"\
\n }\n }\n\nExample requests with filters:\n\n GET /objects?filter=(message,:eq,\"\
morning\") returns \"2\" (i.e. the MDS object and Indexd record identified\
\ by \"2\")\n GET /objects?filter=(counts.1,:eq,3) returns \"3\"\n GET\
\ /objects?filter=(pet_age,:lte,5) returns \"0\" and \"1\"\n GET /objects?filter=(pet_age,:gt,5)\
\ returns \"2\" and \"3\"\n\nCompound expressions are supported:\n\n GET\
\ /objects?filter=(_resource_paths,:any,(,:like,\"/programs/%/projects/%\"\
)) returns \"1\" and \"3\"\n GET /objects?filter=(counts,:all,(,:eq,42))\
\ returns \"2\"\n\nBoolean expressions are also supported:\n\n GET /objects?filter=(or,(_uploader_id,:eq,\"\
101\"),(_uploader_id,:eq,\"102\")) returns \"1\" and \"2\"\n GET /objects?filter=(or,(and,(pet,:eq,\"\
ferret\"),(sport,:eq,\"soccer\")),(message,:eq,\"hello\")) returns \"0\",\
\ \"1\", and \"2\""
operationId: get_objects_objects_get
parameters:
- description: Switch to return a list of GUIDs (false), or metadata objects
(true).
in: query
name: data
required: false
schema:
default: true
description: Switch to return a list of GUIDs (false), or metadata objects
(true).
title: Data
type: boolean
- description: The offset for what objects are returned (zero-indexed). The
exact offset will be equal to page*limit (e.g. with page=1, limit=15, 15
objects beginning at index 15 will be returned).
in: query
name: page
required: false
schema:
default: 0
description: The offset for what objects are returned (zero-indexed). The
exact offset will be equal to page*limit (e.g. with page=1, limit=15,
15 objects beginning at index 15 will be returned).
title: Page
type: integer
- description: 'Maximum number of objects returned (max: 1024). Also used with
page to determine page size.'
in: query
name: limit
required: false
schema:
default: 10
description: 'Maximum number of objects returned (max: 1024). Also used
with page to determine page size.'
title: Limit
type: integer
- description: The filter(s) that will be applied to the result. The format
is filter=(field_name,operator,value), in which the field_name is a json
key without quotes, operator is one of :eq, :ne, :gt, :gte, :lt, :lte, :like,
:all, :any, and value is a typed json value against which the operator is
run (examples in the endpoint description).
in: query
name: filter
required: false
schema:
default: ''
description: The filter(s) that will be applied to the result. The format
is filter=(field_name,operator,value), in which the field_name is a json
key without quotes, operator is one of :eq, :ne, :gt, :gte, :lt, :lte,
:like, :all, :any, and value is a typed json value against which the operator
is run (examples in the endpoint description).
title: Filter
type: string
responses:
'200':
content:
application/json:
schema: {}
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Get Objects
tags:
- Object
post:
description: "Create object placeholder and attach metadata, return Upload url\
\ to the user.\n\nArgs:\n body (CreateObjInput): input body for create\
Expand Down
Loading