@@ -71,18 +71,24 @@ func deleteBlobstore(c *client.Client, name string) error {
71
71
return nil
72
72
}
73
73
74
- func (s * BlobStoreService ) GetQuotaStatus (name string ) error {
74
+ func (s * BlobStoreService ) GetQuotaStatus (name string ) ( * blobstore. QuotaStatus , error ) {
75
75
return getBlobstoreQuotaStatus (s .Client , name )
76
76
}
77
77
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 )
80
80
if err != nil {
81
- return err
81
+ return nil , err
82
82
}
83
83
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 )
86
86
}
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
88
94
}
0 commit comments