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
filters
parameter 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
filters
parameter is not provided, look up objects using the provided resource_attrs as awhere
parameter, 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]=X
should move to something likeparams[:filters]=[['script_version','>=',X]]
and JobsController should overrideapply_where_limit_order_params
to use find_commit_range when>=
and<=
filters are used with thescript_version
attribute. - Implement
exclude_script_versions=X
asparams[: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 11 years ago
- Target version set to 2014-05-07 Storing and Organizing Data
Updated by Tom Clegg over 10 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 over 10 years ago
- Target version deleted (
2014-05-07 Storing and Organizing Data) - Release deleted (
4)
Updated by Tom Clegg over 10 years ago
- Target version set to Arvados Future Sprints
Updated by Peter Amstutz almost 8 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 almost 8 years ago
- Target version deleted (
Arvados Future Sprints)
Actions