@@ -64,7 +64,8 @@ func List(c *gophercloud.ServiceClient, opts ListOptsBuilder, resourceType strin
6464
6565// Get retrieves a specific Gnocchi resource based on its type and ID.
6666func Get (ctx context.Context , c * gophercloud.ServiceClient , resourceType string , resourceID string ) (r GetResult ) {
67- _ , r .Err = c .Get (ctx , getURL (c , resourceType , resourceID ), & r .Body , nil )
67+ resp , err := c .Get (ctx , getURL (c , resourceType , resourceID ), & r .Body , nil )
68+ _ , r .Header , r .Err = gophercloud .ParseResponse (resp , err )
6869 return
6970}
7071
@@ -132,9 +133,10 @@ func Create(ctx context.Context, client *gophercloud.ServiceClient, resourceType
132133 r .Err = err
133134 return
134135 }
135- _ , r . Err = client .Post (ctx , createURL (client , resourceType ), b , & r .Body , & gophercloud.RequestOpts {
136+ resp , err : = client .Post (ctx , createURL (client , resourceType ), b , & r .Body , & gophercloud.RequestOpts {
136137 OkCodes : []int {201 },
137138 })
139+ _ , r .Header , r .Err = gophercloud .ParseResponse (resp , err )
138140 return
139141}
140142
@@ -200,9 +202,10 @@ func Update(ctx context.Context, c *gophercloud.ServiceClient, resourceType, res
200202 r .Err = err
201203 return
202204 }
203- _ , r . Err = c .Patch (ctx , updateURL (c , resourceType , resourceID ), b , & r .Body , & gophercloud.RequestOpts {
205+ resp , err : = c .Patch (ctx , updateURL (c , resourceType , resourceID ), b , & r .Body , & gophercloud.RequestOpts {
204206 OkCodes : []int {200 },
205207 })
208+ _ , r .Header , r .Err = gophercloud .ParseResponse (resp , err )
206209 return
207210}
208211
@@ -213,6 +216,7 @@ func Delete(ctx context.Context, c *gophercloud.ServiceClient, resourceType, res
213216 "Accept" : "application/json, */*" ,
214217 },
215218 }
216- _ , r .Err = c .Delete (ctx , deleteURL (c , resourceType , resourceID ), requestOpts )
219+ resp , err := c .Delete (ctx , deleteURL (c , resourceType , resourceID ), requestOpts )
220+ _ , r .Header , r .Err = gophercloud .ParseResponse (resp , err )
217221 return
218222}
0 commit comments