github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/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  	// VirtualType stores virtual type.
    25  	VirtualType string `json:"virtual_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  	// Series is OS version, for e.g. "quantal".
    44  	Series string `json:"series"`
    45  
    46  	// Arch is the architecture for this cloud image, for e.g. "amd64"
    47  	Arch string `json:"arch"`
    48  
    49  	// VirtualType contains the type of the cloud image, for e.g. "pv", "hvm". "kvm".
    50  	VirtualType string `json:"virtual_type,omitempty"`
    51  
    52  	// RootStorageType contains type of root storage, for e.g. "ebs", "instance".
    53  	RootStorageType string `json:"root_storage_type,omitempty"`
    54  
    55  	// RootStorageSize contains size of root storage in gigabytes (GB).
    56  	RootStorageSize *uint64 `json:"root_storage_size,omitempty"`
    57  
    58  	// Source describes where this image is coming from: is it public? custom?
    59  	Source string `json:"source"`
    60  }
    61  
    62  // ListCloudImageMetadataResult holds the results of querying cloud image metadata.
    63  type ListCloudImageMetadataResult struct {
    64  	Result []CloudImageMetadata `json:"result"`
    65  }
    66  
    67  // MetadataSaveParams holds cloud image metadata details to save.
    68  type MetadataSaveParams struct {
    69  	Metadata []CloudImageMetadata `json:"metadata"`
    70  }