@@ -71,18 +71,24 @@ func deleteBlobstore(c *client.Client, name string) error {
7171 return nil
7272}
7373
74- func (s * BlobStoreService ) GetQuotaStatus (name string ) error {
74+ func (s * BlobStoreService ) GetQuotaStatus (name string ) ( * blobstore. QuotaStatus , error ) {
7575 return getBlobstoreQuotaStatus (s .Client , name )
7676}
7777
78- func getBlobstoreQuotaStatus (c * client.Client , name string ) error {
79- body , resp , err := c .Delete (fmt .Sprintf ("%s/%s" , blobstoreAPIEndpoint , name ) )
78+ func getBlobstoreQuotaStatus (c * client.Client , name string ) ( * blobstore. QuotaStatus , error ) {
79+ body , resp , err := c .Get (fmt .Sprintf ("%s/%s/%s " , blobstoreAPIEndpoint , name , "quota-status" ), nil )
8080 if err != nil {
81- return err
81+ return nil , err
8282 }
8383
84- if resp .StatusCode != http .StatusNoContent {
85- return fmt .Errorf ("could not delete blobstore \" %s \" : HTTP: %d, % s" , name , resp . StatusCode , string ( body ) )
84+ if resp .StatusCode != http .StatusOK {
85+ return nil , fmt .Errorf ("could not get quotastatus for blobstore % s" , name )
8686 }
87- return nil
87+
88+ var quotaStatus blobstore.QuotaStatus
89+ if err := json .Unmarshal (body , & quotaStatus ); err != nil {
90+ return nil , fmt .Errorf ("could not unmarshal of blobstore quotastatus: %v" , err )
91+ }
92+
93+ return & quotaStatus , nil
8894}
0 commit comments