Skip to content

Conversation

nagem
Copy link
Contributor

@nagem nagem commented Nov 9, 2017

Similar to #893, add endpoint to modify container info using set/delete/replace keywords.

POST /api/<container>/<container_id>/info

Format of request:

# set or delete required, can have both
{
	"set": {}, 
	"delete": []
}
  • "set" is a non-empty map of key : value (values may be scalars or complex objects). All keys are added to the info key if they do not exist, or are replaced by the value if they do exist
  • "delete" is a non-empty list of top level keys to be deleted. If key does not exist, request is ignored.

OR

{
	"replace": {}
}
  • the value of the "replace" key will be set as the value of the info key for the file. It can be an empty map.

Example Requests

POST /api/acquisitions/5984d10adf01e2001433dde8/info HTTP/1.1
Content-Type: application/json

{
	"set": {
		"top_level_key": 123,
		"complex_object_key": {
			"a": 1,
			"b": 2
		}
	},
	"delete": ["keys", "to", "be", "removed"]
}
POST /api/acquisitions/5984d10adf01e2001433dde8/info HTTP/1.1
Content-Type: application/json

{
	"replace": {
		"notice": "this is a full replace of the info field"
	}
}

Breaking Changes

None

There will be a transition period where setting info through PUT /container_name/container_idwill still be allowed. It is expected that eventually all changes in info should go through these new endpoints.

@kofalt SDK related additive changes

Review Checklist

  • Tests were added to cover all code changes
  • Documentation was added / updated
  • Code and tests follow standards in CONTRIBUTING.md

@nagem nagem requested a review from kofalt November 9, 2017 19:51
@nagem nagem assigned ambrussimon and unassigned ambrussimon Nov 9, 2017
@nagem nagem requested a review from ambrussimon November 9, 2017 19:51
@codecov-io
Copy link

codecov-io commented Nov 9, 2017

Codecov Report

Merging #988 into master will increase coverage by 0.03%.
The diff coverage is 97.22%.

@@            Coverage Diff             @@
##           master     #988      +/-   ##
==========================================
+ Coverage   90.39%   90.43%   +0.03%     
==========================================
  Files          50       50              
  Lines        6717     6753      +36     
==========================================
+ Hits         6072     6107      +35     
- Misses        645      646       +1

@nagem nagem force-pushed the info-field-editing branch from 55a3c08 to d445b98 Compare November 13, 2017 19:55
@nagem
Copy link
Contributor Author

nagem commented Nov 13, 2017

Tests are added. Feel free to start SDK development at any time @kofalt

@nagem nagem force-pushed the info-field-editing branch from d445b98 to 13d73b3 Compare November 27, 2017 16:17
@nagem
Copy link
Contributor Author

nagem commented Nov 27, 2017

Rebased, merging when CI is green.

@nagem nagem merged commit d480a5a into master Nov 27, 2017
@nagem nagem deleted the info-field-editing branch November 27, 2017 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants