packer-cn/vendor/github.com/profitbricks/profitbricks-sdk-go/image.go

28 lines
703 B
Go
Raw Normal View History

2016-06-28 22:35:41 -04:00
package profitbricks
// ListImages returns an Collection struct
func ListImages() Collection {
path := image_col_path()
return is_list(path)
}
// GetImage returns an Instance struct where id ==imageid
func GetImage(imageid string) Instance {
path := image_path(imageid)
return is_get(path)
}
// PatchImage replaces any image properties from values in jason
//returns an Instance struct where id ==imageid
func PatchImage(imageid string, obj map[string]string) Instance {
jason := []byte(MkJson(obj))
path := image_path(imageid)
return is_patch(path, jason)
}
// Deletes an image where id==imageid
func DeleteImage(imageid string) Resp {
path := image_path(imageid)
return is_delete(path)
}