Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
List and get Compute image metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
orivej committed Apr 15, 2016
1 parent 231898e commit c0b914f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 22 additions & 2 deletions openstack/compute/v2/images/requests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ func TestListImages(t *testing.T) {
"minDisk": 0,
"progress": 100,
"minRam": 0,
"metadata": {}
"metadata": {
"string": "string",
"true": true,
"nil": null
}
}
]
}
Expand Down Expand Up @@ -82,6 +86,7 @@ func TestListImages(t *testing.T) {
MinRAM: 0,
Progress: 100,
Status: "ACTIVE",
Metadata: map[string]interface{}{},
},
Image{
ID: "f90f6034-2570-4974-8351-6b49732ef2eb",
Expand All @@ -92,6 +97,11 @@ func TestListImages(t *testing.T) {
MinRAM: 0,
Progress: 100,
Status: "ACTIVE",
Metadata: map[string]interface{}{
"string": "string",
"true": true,
"nil": nil,
},
},
}

Expand Down Expand Up @@ -131,7 +141,12 @@ func TestGetImage(t *testing.T) {
"minDisk": 0,
"progress": 100,
"minRam": 0,
"metadata": {}
"metadata": {
"string": "string",
"true": true,
"nil": null
}
}
}
`)
Expand All @@ -151,6 +166,11 @@ func TestGetImage(t *testing.T) {
MinDisk: 0,
Progress: 100,
MinRAM: 0,
Metadata: map[string]interface{}{
"string": "string",
"true": true,
"nil": nil,
},
}

if !reflect.DeepEqual(expected, actual) {
Expand Down
2 changes: 2 additions & 0 deletions openstack/compute/v2/images/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ type Image struct {

Created string

Metadata map[string]interface{}

// MinDisk and MinRAM specify the minimum resources a server must provide to be able to install the image.
MinDisk int
MinRAM int
Expand Down

0 comments on commit c0b914f

Please sign in to comment.