@@ -64,7 +64,8 @@ func List(c *gophercloud.ServiceClient, opts ListOptsBuilder, resourceType strin
64
64
65
65
// Get retrieves a specific Gnocchi resource based on its type and ID.
66
66
func 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 )
68
69
return
69
70
}
70
71
@@ -132,9 +133,10 @@ func Create(ctx context.Context, client *gophercloud.ServiceClient, resourceType
132
133
r .Err = err
133
134
return
134
135
}
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 {
136
137
OkCodes : []int {201 },
137
138
})
139
+ _ , r .Header , r .Err = gophercloud .ParseResponse (resp , err )
138
140
return
139
141
}
140
142
@@ -200,9 +202,10 @@ func Update(ctx context.Context, c *gophercloud.ServiceClient, resourceType, res
200
202
r .Err = err
201
203
return
202
204
}
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 {
204
206
OkCodes : []int {200 },
205
207
})
208
+ _ , r .Header , r .Err = gophercloud .ParseResponse (resp , err )
206
209
return
207
210
}
208
211
@@ -213,6 +216,7 @@ func Delete(ctx context.Context, c *gophercloud.ServiceClient, resourceType, res
213
216
"Accept" : "application/json, */*" ,
214
217
},
215
218
}
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 )
217
221
return
218
222
}
0 commit comments