File tree Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ GET /api/resources/find-resources-in-batch?id=riscv-ubuntu-20.04-boot&resource_v
53
53
54
54
- Each ` id ` parameter must have a corresponding ` resource_version ` parameter
55
55
- Use ` resource_version=None ` to retrieve all versions of a resource
56
- - Returns 404 if any requested resource is missing
56
+ - Returns a list of resources that were found even if not all requested resources were found.
57
+ - Returns an empty list is no resources were found.
57
58
58
59
### 2. Advanced Resource Search
59
60
Original file line number Diff line number Diff line change @@ -80,23 +80,6 @@ def find_resources_in_batch(req: func.HttpRequest) -> func.HttpResponse:
80
80
collection .find ({"$or" : queries }, RESOURCE_FIELDS )
81
81
)
82
82
83
- # Check if any resources were found
84
- if not resources :
85
- return create_error_response (
86
- 404 , "No requested resources were found"
87
- )
88
-
89
- # Check if at least one instance of each requested ID is present
90
- found_ids = {resource .get ("id" ) for resource in resources }
91
- missing_ids = set (ids ) - found_ids
92
-
93
- if missing_ids :
94
- return create_error_response (
95
- 404 ,
96
- "The following requested resources were not found: "
97
- f"{ ', ' .join (missing_ids )} " ,
98
- )
99
-
100
83
return func .HttpResponse (
101
84
body = json .dumps (resources ),
102
85
status_code = 200 ,
You can’t perform that action at this time.
0 commit comments