File tree Expand file tree Collapse file tree
openstack/imageservice/v2/images Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -335,6 +335,20 @@ func (r ReplaceImageMinDisk) ToImagePatchMap() map[string]interface{} {
335335 }
336336}
337337
338+ // ReplaceImageMinRam represents an updated min_ram property request.
339+ type ReplaceImageMinRam struct {
340+ NewMinRam int
341+ }
342+
343+ // ToImagePatchMap assembles a request body based on ReplaceImageTags.
344+ func (r ReplaceImageMinRam ) ToImagePatchMap () map [string ]interface {} {
345+ return map [string ]interface {}{
346+ "op" : "replace" ,
347+ "path" : "/min_ram" ,
348+ "value" : r .NewMinRam ,
349+ }
350+ }
351+
338352// UpdateOp represents a valid update operation.
339353type UpdateOp string
340354
Original file line number Diff line number Diff line change @@ -317,6 +317,11 @@ func HandleImageUpdateSuccessfully(t *testing.T) {
317317 "op": "replace",
318318 "path": "/min_disk",
319319 "value": 21
320+ },
321+ {
322+ "op": "replace",
323+ "path": "/min_ram",
324+ "value": 1024
320325 }
321326 ]` )
322327
@@ -341,7 +346,7 @@ func HandleImageUpdateSuccessfully(t *testing.T) {
341346 "file": "/v2/images/da3b75d9-3f4a-40e7-8a2c-bfab23927dea/file",
342347 "schema": "/v2/schemas/image",
343348 "owner": "",
344- "min_ram": 0 ,
349+ "min_ram": 1024 ,
345350 "min_disk": 21,
346351 "disk_format": "",
347352 "virtual_size": 0,
Original file line number Diff line number Diff line change @@ -255,6 +255,7 @@ func TestUpdateImage(t *testing.T) {
255255 images.ReplaceImageName {NewName : "Fedora 17" },
256256 images.ReplaceImageTags {NewTags : []string {"fedora" , "beefy" }},
257257 images.ReplaceImageMinDisk {NewMinDisk : 21 },
258+ images.ReplaceImageMinRam {NewMinRam : 1024 },
258259 }).Extract ()
259260
260261 th .AssertNoErr (t , err )
@@ -281,7 +282,7 @@ func TestUpdateImage(t *testing.T) {
281282 },
282283
283284 Owner : "" ,
284- MinRAMMegabytes : 0 ,
285+ MinRAMMegabytes : 1024 ,
285286 MinDiskGigabytes : 21 ,
286287
287288 DiskFormat : "" ,
You can’t perform that action at this time.
0 commit comments