ayas

updated

12 years ago

A

ayas

Community Manager

7466 Posts

68017 Points

0

2609

October 27th, 2014 21:00

Quota setting by API

Hi there ,,,

My customer try to set quota by API .. but it does not work ok...

Anybody know what is wrong with ?

1. checked schema by GET /platform/1/quota/quotas?describe

2. Use PUT for set ....

{

  "properties" :

           {

               "container": False

               "enforced": False

               "include_snapshots": false

               "thresholds_include_overhead": false

               "type": "directory"

               "linked": null

               "notifications": "custom"

               "path": "/ifs/data/nfs-rest-new

               "persona": null

               "ready": true

               "thresholds" :

               {

                   "advisory": 524288000

                   "advisory_exceeded": false

                   "advisory_last_exceeded": 0

                   "hard": 51200000000

                   "hard_exceeded": false

                   "hard_last_exceeded": 0

                   "soft": null

                   "soft_exceeded": false

                   "soft_grace": null

                   "soft_last_exceeded": null

               }

           }

}

And chose POST @ method then Error ...

Not to sure what to do ... ....can anybody know what need to be done ?

  • Yan_Faubert

    117 Posts

    1617

    0

    Posted October 28th, 2014 11:00

    Yes, change to lowercase 'false' but also you need to remove some of the other attributes that are 'read-only'.  A working example is pasted below using 'curl':

    curl -k --user username:password -X POST https://192.168.36.202:8080/platform/1/quota/quotas -d \

    '{

                   "container": false,

                   "enforced": true,

                   "include_snapshots": false,

                   "thresholds_include_overhead": false,

                   "type": "directory",

                   "path": "/ifs/data/nfs",

                   "thresholds": {

                       "advisory": 524288000,

                       "hard": 51200000000

                   }

    }'

    The resulting quota looks like this:

    yfvm-7105-2# isi quota quotas view --type=directory --path=/ifs/data/nfs

                           Path: /ifs/data/nfs

                           Type: directory

                      Snapshots: No

    Thresholds Include Overhead: No

                          Usage

                              Files : 3

                      With Overhead : 7.53M

                       W/O Overhead : 5.00M

                           Over: -

                       Enforced: Yes

                      Container: No

                         Linked: -

                     Thresholds

                     Hard Threshold : 47.68G

                      Hard Exceeded : No

                 Hard Last Exceeded : 1969-12-31T19:00:00

                 Advisory Threshold : 500.00M

                  Advisory Exceeded : No

             Advisory Last Exceeded : 1969-12-31T19:00:00

                     Soft Threshold : -

                      Soft Exceeded : No

                 Soft Last Exceeded : -

                         Soft Grace : -

  • Peter_Sero

    6 Operator

    1169 Posts

    1617

    0

    Posted October 27th, 2014 23:00

    Have you tried lowercase true and false?