Actions
Feature #2176
closedAPI server supports atomic find_or_create operation
Status:
Closed
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
-
Story points:
1.0
Description
Generalize the special case in jobs.create.
Add optionalfind_or_create flag to create method. If set:
- If
filtersparameter is provided, look up objects using those filters.- If exactly one result is found, return that.
- If no results are found, create a new object as usual.
- If >1 results are found, return an error.
- If
filtersparameter is not provided, look up objects using the provided resource_attrs as awhereparameter, and proceed as above.
- Move
no_reuse(and other params that aren't actually resource attributes) out ofresource_attrs, e.g.,params[:job][:minimum_script_version]=Xshould move to something likeparams[:filters]=[['script_version','>=',X]]and JobsController should overrideapply_where_limit_order_paramsto use find_commit_range when>=and<=filters are used with thescript_versionattribute. - Implement
exclude_script_versions=Xasparams[:filters]=[['script_version','not in',X]](adding a"not in"operator should be trivial) - Implement the range logic so the client can do commit range lookups itself using
list, not just implicitly viacreate
Updated by Tom Clegg almost 12 years ago
- Target version set to 2014-05-07 Storing and Organizing Data
Updated by Tom Clegg almost 12 years ago
- Subject changed from API server supports find_or_create operation to API server supports atomic find_or_create operation
- Description updated (diff)
Updated by Tom Clegg almost 12 years ago
- Target version deleted (
2014-05-07 Storing and Organizing Data) - Release deleted (
4)
Updated by Tom Clegg over 11 years ago
- Target version set to Arvados Future Sprints
Updated by Peter Amstutz almost 10 years ago
- Assigned To deleted (
Peter Amstutz)
Updated by Peter Amstutz about 9 years ago
- Status changed from New to Closed
Containers API uses a different approach. Does not have compelling use case in other APIs.
Updated by Tom Clegg about 9 years ago
- Target version deleted (
Arvados Future Sprints)
Actions