github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/apiserver/params/image_metadata.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package params 5 6 // ImageMetadataFilter holds filter properties used to search for image metadata. 7 // It amalgamates both simplestreams.MetadataLookupParams and simplestreams.LookupParams 8 // and adds additional properties to satisfy existing and new use cases. 9 type ImageMetadataFilter struct { 10 // Region stores metadata region. 11 Region string `json:"region,omitempty"` 12 13 // Series stores all desired series. 14 Series []string `json:"series,omitempty"` 15 16 // Arches stores all desired architectures. 17 Arches []string `json:"arches,omitempty"` 18 19 // Stream can be "" or "released" for the default "released" stream, 20 // or "daily" for daily images, or any other stream that the available 21 // simplestreams metadata supports. 22 Stream string `json:"stream,omitempty"` 23 24 // VirtType stores virtualisation type. 25 VirtType string `json:"virt_type,omitempty"` 26 27 // RootStorageType stores storage type. 28 RootStorageType string `json:"root-storage-type,omitempty"` 29 } 30 31 // CloudImageMetadata holds cloud image metadata properties. 32 type CloudImageMetadata struct { 33 // ImageId is an image identifier. 34 ImageId string `json:"image_id"` 35 36 // Stream contains reference to a particular stream, 37 // for e.g. "daily" or "released" 38 Stream string `json:"stream,omitempty"` 39 40 // Region is the name of cloud region associated with the image. 41 Region string `json:"region"` 42 43 // Version is OS version, for e.g. "12.04". 44 Version string `json:"version"` 45 46 // Series is OS series, for e.g. "trusty". 47 Series string `json:"series"` 48 49 // Arch is the architecture for this cloud image, for e.g. "amd64" 50 Arch string `json:"arch"` 51 52 // VirtType contains the virtualisation type of the cloud image, for e.g. "pv", "hvm". "kvm". 53 VirtType string `json:"virt_type,omitempty"` 54 55 // RootStorageType contains type of root storage, for e.g. "ebs", "instance". 56 RootStorageType string `json:"root_storage_type,omitempty"` 57 58 // RootStorageSize contains size of root storage in gigabytes (GB). 59 RootStorageSize *uint64 `json:"root_storage_size,omitempty"` 60 61 // Source describes where this image is coming from: is it public? custom? 62 Source string `json:"source"` 63 64 // Priority is an importance factor for image metadata. 65 // Higher number means higher priority. 66 // This will allow to sort metadata by importance. 67 Priority int `json:"priority"` 68 } 69 70 // ListCloudImageMetadataResult holds the results of querying cloud image metadata. 71 type ListCloudImageMetadataResult struct { 72 Result []CloudImageMetadata `json:"result"` 73 } 74 75 // MetadataSaveParams holds lists of cloud image metadata to save. Each list 76 // will be saved atomically. 77 type MetadataSaveParams struct { 78 Metadata []CloudImageMetadataList `json:"metadata,omitempty"` 79 } 80 81 // CloudImageMetadataList holds a list of cloud image metadata. 82 type CloudImageMetadataList struct { 83 Metadata []CloudImageMetadata `json:"metadata,omitempty"` 84 } 85 86 // MetadataImageIds holds image ids and can be used to identify related image metadata. 87 type MetadataImageIds struct { 88 Ids []string `json:"image_ids"` 89 }