cisco/sdk/image.go -rw-r--r-- 477 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package cisco

import (
	"encoding/json"
)

type Image struct {
	Name           string `json:"name"`
	Architecture   string `json:"architecture"`
	Fingerprint    string `json:"fingerprint"`
	Size           int64  `json:"size"`
	VirtualMachine bool   `json:"vm"`
}

func ListImage() ([]Image, error) {
	var result []Image

	data, err := SendRequest(ImageListRoute, Request{})

	if err != nil {
		return nil, err
	}

	json.Unmarshal(data.([]byte), &result)
	return result, err
}