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

Add put object api and add list object improvements #356

Merged
merged 1 commit into from
Oct 28, 2020

Conversation

cesnietor
Copy link
Collaborator

To add object tags we can now do PUT on /api/v1/buckets/<bucketName>/objects/tags?prefix=<prefix>&version_id=<object_version>
Request payload example:

{
    "tags": {
        "tag1": "val1",
        "tag2": "val2"
    }
}

When doing GET it will list the tags only for single object defined on prefix like:
/api/v1/buckets/<bucketName>/objects?prefix=folder/file.txt&with_versions=true
Response Payload:

{
    "objects": [
        {
            "is_latest": true,
            "last_modified": "2020-10-14 21:54:00.842 +0000 UTC",
            "legal_hold_status": "OFF",
            "name": "file.txt",
            "retention_mode": "COMPLIANCE",
            "retention_until_date": "2020-10-23 15:04:05 +0000 UTC",
            "size": 19822527,
            "tags": {
                "tag1": "val1",
                "tag2": "val2"
            },
            "version_id": "be2e946b-fa54-4a7a-9d79-f2392e221585"
        },
        {
            "last_modified": "2020-10-14 21:31:39.231 +0000 UTC",
            "name": "file.txt",
            "version_id": "f3eb5d80-9bfb-4eea-a554-236ea8dafff0"
        }
    ],
    "total": 2
}
  • Tests included

Comment on lines +449 to +456
- name: prefix
in: query
required: true
type: string
- name: version_id
in: query
required: true
type: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any special reason about why prefix and query cannot be part of the putObjectTagsRequest object in the request body?, everything else looks good

@dvaldivia dvaldivia added this to Review in progress in Console Version 1 Oct 28, 2020
Console Version 1 automation moved this from Review in progress to Reviewer approved Oct 28, 2020
@dvaldivia dvaldivia merged commit 24cc60f into minio:master Oct 28, 2020
Console Version 1 automation moved this from Reviewer approved to Done Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants