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

Create drive return zero quota size #149

Open
amrita-shrestha opened this issue Dec 1, 2023 · 4 comments
Open

Create drive return zero quota size #149

amrita-shrestha opened this issue Dec 1, 2023 · 4 comments

Comments

@amrita-shrestha
Copy link
Contributor

amrita-shrestha commented Dec 1, 2023

While doing create drive API request we get some numeric value in quota->total. Using libre graph create drive return zero. So there is difference in response from api and libre graph library

curl -XPOST 'https://localhost:9200/graph/v1.0/drives' \
--data '{
  "name": "Venus"
}'

-------Response------------

{
    "driveAlias": "project/venus",
    "driveType": "project",
    "id": "bb740b6b-d7e7-4cd7-b7ed-c10b45c6f648$426a5fb6-a547-4a15-ba1e-326855c98298",
    "lastModifiedDateTime": "2023-12-01T12:25:49.425938453+05:45",
    "name": "Venus",
    "owner": {
        "user": {
            "displayName": "",
            "id": "426a5fb6-a547-4a15-ba1e-326855c98298"
        }
    },
    "quota": {
        "total": 1000000000
    },
    "root": {
        "eTag": "\"45440fdf2bc0aa8a7a2ab85048c6f3c4\"",
        "id": "bb740b6b-d7e7-4cd7-b7ed-c10b45c6f648$426a5fb6-a547-4a15-ba1e-326855c98298",
        "permissions": [
            {
                "grantedToIdentities": [
                    {
                        "user": {
                            "displayName": "Admin",
                            "id": "42283afb-2a06-4b47-b707-db649d1ba001"
                        }
                    }
                ],
                "roles": [
                    "manager"
                ]
            }
        ],
        "webDavUrl": "https://localhost:9200/dav/spaces/bb740b6b-d7e7-4cd7-b7ed-c10b45c6f648$426a5fb6-a547-4a15-ba1e-326855c98298"
    },
    "webUrl": "https://localhost:9200/f/bb740b6b-d7e7-4cd7-b7ed-c10b45c6f648$426a5fb6-a547-4a15-ba1e-326855c98298"
}

Using Libregraph

            [quota] => OpenAPI\Client\Model\Quota Object
                (
                    [openAPINullablesSetToNull:protected] => Array
                        (
                        )

                    [container:protected] => Array
                        (
                            [deleted] => 
                            [remaining] => 
                            [state] => 
                            [total] => 0
                            [used] => 
                        )

                )
@micbar
Copy link
Contributor

micbar commented Dec 1, 2023

I think the libregraph php should also return the numeric value.

@amrita-shrestha
Copy link
Contributor Author

amrita-shrestha commented Dec 1, 2023

@micbar another question related to this issue should post and get requests return the same object in drive case
Currently, createDrive() and getDrive() throws difference value for quota in libre graph library
From createDrive we get

            [quota] => OpenAPI\Client\Model\Quota Object
                (
                    [openAPINullablesSetToNull:protected] => Array
                        (
                        )

                    [container:protected] => Array
                        (
                            [deleted] => 
                            [remaining] => 
                            [state] => 
                            [total] => 0
                            [used] => 
                        )

                )

From getDrive

            [quota] => OpenAPI\Client\Model\Quota Object
                (
                    [openAPINullablesSetToNull:protected] => Array
                        (
                        )

                    [container:protected] => Array
                        (
                            [deleted] => 
                            [remaining] => 96254746624
                            [state] => normal
                            [total] => 0
                            [used] => 0
                        )

                )

@individual-it
Copy link
Member

@amrita-shrestha could you please post a response for create drive when done using curl, I think that would make things easier to understand.

@micbar I think the issue is that in #/components/schemas/quota the properties are not required. Which of those properties of quota do we expect in the object and which are optional?

@individual-it
Copy link
Member

Oh I see, the example is the creation of drive and the quota only has

    "quota": {
        "total": 1000000000
    },

no remaining, state or used property

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

No branches or pull requests

3 participants