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 list objects api #291

Merged
merged 1 commit into from
Sep 29, 2020
Merged

Add list objects api #291

merged 1 commit into from
Sep 29, 2020

Conversation

cesnietor
Copy link
Collaborator

@cesnietor cesnietor commented Sep 29, 2020

For #290
This includes the basic information of an object.
This api can be called using /api/v1/buckets/{bucket_name}/objects?prefix={prefix}&recursive={true|false}
Where prefix is a folder and recursive is used to traverse across the folders.

e.g. GET on /api/v1/buckets/bucket1/objects?recursive=false:
Response Payload:

{
    "objects": [
        {
            "last_modified": "2020-09-28 23:21:02.235 +0000 UTC",
            "name": "file.csv",
            "size": 45813
        },
        {
            "last_modified": "2020-09-28 23:22:08.562 +0000 UTC",
            "name": "photo.jpg",
            "size": 103614
        },
        {
            "last_modified": "0001-01-01 00:00:00 +0000 UTC",
            "name": "inky/"
        }
    ],
    "total": 3
}

With prefix parameter:
/api/v1/buckets/bucket1/objects?prefix=inky/&recursive=false

{
    "objects": [
        {
            "last_modified": "2020-09-28 23:25:31.171 +0000 UTC",
            "name": "inky/.gitignore",
            "size": 330
        },
        {
            "last_modified": "2020-09-28 23:25:31.17 +0000 UTC",
            "name": "inky/.stickler.yml",
            "size": 72
        },
        {
            "last_modified": "0001-01-01 00:00:00 +0000 UTC",
            "name": "inky/.git/"
        },
        {
            "last_modified": "0001-01-01 00:00:00 +0000 UTC",
            "name": "inky/examples/"
        },
        {
            "last_modified": "0001-01-01 00:00:00 +0000 UTC",
            "name": "inky/library/"
        },
    ],
    "total": 5
}
  • Tests included

@cesnietor cesnietor added the enhancement New feature or request label Sep 29, 2020
@cesnietor cesnietor self-assigned this Sep 29, 2020
bexsoft
bexsoft previously approved these changes Sep 29, 2020
Copy link
Collaborator

@bexsoft bexsoft left a comment

Choose a reason for hiding this comment

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

LGTM

Alevsk
Alevsk previously approved these changes Sep 29, 2020
This includes the basic information of an object
@dvaldivia dvaldivia merged commit 7afd608 into minio:master Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants