gophercloud: github.com/rackspace/gophercloud/openstack/imageservice/v2/images Index | Files

package images

import "github.com/rackspace/gophercloud/openstack/imageservice/v2/images"

Index

Package Files

fixtures.go requests.go results.go types.go urls.go

func ExtractImages Uses

func ExtractImages(page pagination.Page) ([]Image, error)

ExtractImages interprets the results of a single page from a List() call, producing a slice of Image entities.

func HandleCreateImageMemberConflict Uses

func HandleCreateImageMemberConflict(t *testing.T)

HandleCreateImageMemberConflict setup for case when member is already image member

func HandleCreateImageMemberInvalidVisibility Uses

func HandleCreateImageMemberInvalidVisibility(t *testing.T)

HandleCreateImageMemberInvalidVisibility setup for case when visibility=public

func HandleCreateImageMemberSuccessfully Uses

func HandleCreateImageMemberSuccessfully(t *testing.T)

HandleCreateImageMemberSuccessfully setup

func HandleGetImageDataSuccessfully Uses

func HandleGetImageDataSuccessfully(t *testing.T)

HandleGetImageDataSuccessfully setup

func HandleImageCreationSuccessfully Uses

func HandleImageCreationSuccessfully(t *testing.T)

HandleImageCreationSuccessfully test setup

func HandleImageCreationSuccessfullyNulls Uses

func HandleImageCreationSuccessfullyNulls(t *testing.T)

HandleImageCreationSuccessfullyNulls test setup JSON null values could be also returned according to behaviour https://bugs.launchpad.net/glance/+bug/1481512

func HandleImageDeleteSuccessfully Uses

func HandleImageDeleteSuccessfully(t *testing.T)

HandleImageDeleteSuccessfully test setup

func HandleImageGetSuccessfully Uses

func HandleImageGetSuccessfully(t *testing.T)

HandleImageGetSuccessfully test setup

func HandleImageListSuccessfully Uses

func HandleImageListSuccessfully(t *testing.T)

HandleImageListSuccessfully test setup

func HandleImageMemberDetails Uses

func HandleImageMemberDetails(t *testing.T)

HandleImageMemberDetails setup

func HandleImageMemberEmptyList Uses

func HandleImageMemberEmptyList(t *testing.T)

HandleImageMemberEmptyList happy path setup

func HandleImageMemberList Uses

func HandleImageMemberList(t *testing.T)

HandleImageMemberList happy path setup

func HandleImageUpdateSuccessfully Uses

func HandleImageUpdateSuccessfully(t *testing.T)

HandleImageUpdateSuccessfully setup

func HandlePutImageDataSuccessfully Uses

func HandlePutImageDataSuccessfully(t *testing.T)

HandlePutImageDataSuccessfully setup

func List Uses

func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

List implements image list request

type CallsCounter Uses

type CallsCounter struct {
    Counter int
}

CallsCounter for checking if request handler was called at all

func HandleImageMemberDeleteByNonOwner Uses

func HandleImageMemberDeleteByNonOwner(t *testing.T) *CallsCounter

HandleImageMemberDeleteByNonOwner setup

func HandleImageMemberDeleteSuccessfully Uses

func HandleImageMemberDeleteSuccessfully(t *testing.T) *CallsCounter

HandleImageMemberDeleteSuccessfully setup

func HandleImageMemberUpdate Uses

func HandleImageMemberUpdate(t *testing.T) *CallsCounter

HandleImageMemberUpdate setup

type CreateOpts Uses

type CreateOpts struct {
    // Name [required] is the name of the new image.
    Name string

    // Id [optional] is the the image ID.
    ID  string

    // Visibility [optional] defines who can see/use the image.
    Visibility *ImageVisibility

    // Tags [optional] is a set of image tags.
    Tags []string

    // ContainerFormat [optional] is the format of the
    // container. Valid values are ami, ari, aki, bare, and ovf.
    ContainerFormat string

    // DiskFormat [optional] is the format of the disk. If set,
    // valid values are ami, ari, aki, vhd, vmdk, raw, qcow2, vdi,
    // and iso.
    DiskFormat string

    // MinDiskGigabytes [optional] is the amount of disk space in
    // GB that is required to boot the image.
    MinDiskGigabytes int

    // MinRAMMegabytes [optional] is the amount of RAM in MB that
    // is required to boot the image.
    MinRAMMegabytes int

    // protected [optional] is whether the image is not deletable.
    Protected bool

    // properties [optional] is a set of properties, if any, that
    // are associated with the image.
    Properties map[string]string
}

CreateOpts implements CreateOptsBuilder

func (CreateOpts) ToImageCreateMap Uses

func (opts CreateOpts) ToImageCreateMap() (map[string]interface{}, error)

ToImageCreateMap assembles a request body based on the contents of a CreateOpts.

type CreateOptsBuilder Uses

type CreateOptsBuilder interface {
    // Returns value that can be passed to json.Marshal
    ToImageCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder describes struct types that can be accepted by the Create call. The CreateOpts struct in this package does.

type CreateResult Uses

type CreateResult struct {
    // contains filtered or unexported fields
}

CreateResult represents the result of a Create operation

func Create Uses

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult

Create implements create image request

func (CreateResult) Extract Uses

func (c CreateResult) Extract() (*Image, error)

Extract interprets any commonResult as an Image.

type DeleteResult Uses

type DeleteResult struct {
    gophercloud.Result
}

DeleteResult model

func Delete Uses

func Delete(client *gophercloud.ServiceClient, id string) DeleteResult

Delete implements image delete request

type GetImageDataResult Uses

type GetImageDataResult struct {
    gophercloud.Result
}

GetImageDataResult model for image response

func Download Uses

func Download(client *gophercloud.ServiceClient, id string) GetImageDataResult

Download retrieves file

func (GetImageDataResult) Extract Uses

func (g GetImageDataResult) Extract() (io.Reader, error)

Extract builds images model from io.Reader

type GetResult Uses

type GetResult struct {
    // contains filtered or unexported fields
}

GetResult represents the result of a Get operation

func Get Uses

func Get(client *gophercloud.ServiceClient, id string) GetResult

Get implements image get request

func (GetResult) Extract Uses

func (c GetResult) Extract() (*Image, error)

Extract interprets any commonResult as an Image.

type Image Uses

type Image struct {
    // ID is the image UUID
    ID  string

    // Name is the human-readable display name for the image.
    Name string

    // Status is the image status. It can be "queued" or "active"
    // See imageservice/v2/images/type.go
    Status ImageStatus

    // Tags is a list of image tags. Tags are arbitrarily defined strings
    // attached to an image.
    Tags []string

    // ContainerFormat is the format of the container.
    // Valid values are ami, ari, aki, bare, and ovf.
    ContainerFormat string `mapstructure:"container_format"`

    // DiskFormat is the format of the disk.
    // If set, valid values are ami, ari, aki, vhd, vmdk, raw, qcow2, vdi, and iso.
    DiskFormat string `mapstructure:"disk_format"`

    // MinDiskGigabytes is the amount of disk space in GB that is required to boot the image.
    MinDiskGigabytes int `mapstructure:"min_disk"`

    // MinRAMMegabytes [optional] is the amount of RAM in MB that is required to boot the image.
    MinRAMMegabytes int `mapstructure:"min_ram"`

    // Owner is the tenant the image belongs to.
    Owner string

    // Protected is whether the image is deletable or not.
    Protected bool

    // Visibility defines who can see/use the image.
    Visibility ImageVisibility

    // Checksum is the checksum of the data that's associated with the image
    Checksum string

    // SizeBytes is the size of the data that's associated with the image.
    SizeBytes int `mapstructure:"size"`

    // Metadata is a set of metadata associated with the image.
    // Image metadata allow for meaningfully define the image properties
    // and tags. See http://docs.openstack.org/developer/glance/metadefs-concepts.html.
    Metadata map[string]string

    // Properties is a set of key-value pairs, if any, that are associated with the image.
    Properties map[string]string

    // CreatedDate is the date when the image has been created.
    CreatedDate string `mapstructure:"created_at"`

    // LastUpdate is the date when the last change has been made to the image or it's properties.
    LastUpdate string `mapstructure:"updated_at"`

    // File is the trailing path after the glance endpoint that represent the location
    // of the image or the path to retrieve it.
    File string `mapstructure:"file"`

    // Schema is the path to the JSON-schema that represent the image or image entity.
    Schema string `mapstructure:"schema"`
}

Image model Does not include the literal image data; just metadata. returned by listing images, and by fetching a specific image.

type ImageMemberStatus Uses

type ImageMemberStatus string

MemberStatus is a status for adding a new member (tenant) to an image member list.

const (
    // ImageMemberStatusAccepted is the status for an accepted image member.
    ImageMemberStatusAccepted ImageMemberStatus = "accepted"

    // ImageMemberStatusPending shows that the member addition is pending
    ImageMemberStatusPending ImageMemberStatus = "pending"

    // ImageMemberStatusAccepted is the status for a rejected image member
    ImageMemberStatusRejected ImageMemberStatus = "rejected"

    // ImageMemberStatusAll
    ImageMemberStatusAll ImageMemberStatus = "all"
)

type ImagePage Uses

type ImagePage struct {
    pagination.LinkedPageBase
}

ImagePage represents page

func (ImagePage) IsEmpty Uses

func (page ImagePage) IsEmpty() (bool, error)

IsEmpty returns true if a page contains no Images results.

func (ImagePage) NextPageURL Uses

func (page ImagePage) NextPageURL() (string, error)

NextPageURL uses the response's embedded link reference to navigate to the next page of results.

type ImageStatus Uses

type ImageStatus string

ImageStatus image statuses http://docs.openstack.org/developer/glance/statuses.html

const (
    // ImageStatusQueued is a status for an image which identifier has
    // been reserved for an image in the image registry.
    ImageStatusQueued ImageStatus = "queued"

    // ImageStatusSaving denotes that an image’s raw data is currently being uploaded to Glance
    ImageStatusSaving ImageStatus = "saving"

    // ImageStatusActive denotes an image that is fully available in Glance.
    ImageStatusActive ImageStatus = "active"

    // ImageStatusKilled denotes that an error occurred during the uploading
    // of an image’s data, and that the image is not readable.
    ImageStatusKilled ImageStatus = "killed"

    // ImageStatusDeleted is used for an image that is no longer available to use.
    // The image information is retained in the image registry.
    ImageStatusDeleted ImageStatus = "deleted"

    // ImageStatusPendingDelete is similar to Delete, but the image is not yet deleted.
    ImageStatusPendingDelete ImageStatus = "pending_delete"

    // ImageStatusDeactivated denotes that access to image data is not allowed to any non-admin user.
    ImageStatusDeactivated ImageStatus = "deactivated"
)

type ImageVisibility Uses

type ImageVisibility string

ImageVisibility denotes an image that is fully available in Glance. This occurs when the image data is uploaded, or the image size is explicitly set to zero on creation. According to design https://wiki.openstack.org/wiki/Glance-v2-community-image-visibility-design

const (
    // ImageVisibilityPublic all users
    ImageVisibilityPublic ImageVisibility = "public"

    // ImageVisibilityPrivate users with tenantId == tenantId(owner)
    ImageVisibilityPrivate ImageVisibility = "private"

    // ImageVisibilityShared images are visible to:
    // - users with tenantId == tenantId(owner)
    // - users with tenantId in the member-list of the image
    // - users with tenantId in the member-list with member_status == 'accepted'
    ImageVisibilityShared ImageVisibility = "shared"

    // ImageVisibilityCommunity images:
    // - all users can see and boot it
    // - users with tenantId in the member-list of the image with member_status == 'accepted'
    //   have this image in their default image-list
    ImageVisibilityCommunity ImageVisibility = "community"
)

type ListOpts Uses

type ListOpts struct {
    // Integer value for the limit of values to return.
    Limit int `q:"limit"`

    // UUID of the server at which you want to set a marker.
    Marker string `q:"marker"`

    Name         string            `q:"name"`
    Visibility   ImageVisibility   `q:"visibility"`
    MemberStatus ImageMemberStatus `q:"member_status"`
    Owner        string            `q:"owner"`
    Status       ImageStatus       `q:"status"`
    SizeMin      int64             `q:"size_min"`
    SizeMax      int64             `q:"size_max"`
    SortKey      string            `q:"sort_key"`
    SortDir      string            `q:"sort_dir"`
    Tag          string            `q:"tag"`
}

ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the server attributes you want to see returned. Marker and Limit are used for pagination. http://developer.openstack.org/api-ref-image-v2.html

func (ListOpts) ToImageListQuery Uses

func (opts ListOpts) ToImageListQuery() (string, error)

ToImageListQuery formats a ListOpts into a query string.

type ListOptsBuilder Uses

type ListOptsBuilder interface {
    ToImageListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type Patch Uses

type Patch interface {
    ToImagePatchMap() map[string]interface{}
}

Patch represents a single update to an existing image. Multiple updates to an image can be submitted at the same time.

type PutImageDataResult Uses

type PutImageDataResult struct {
    gophercloud.Result
}

PutImageDataResult is model put image respose

func Upload Uses

func Upload(client *gophercloud.ServiceClient, id string, data io.ReadSeeker) PutImageDataResult

Upload uploads image file

type ReplaceImageChecksum Uses

type ReplaceImageChecksum struct {
    Checksum string
}

ReplaceImageChecksum implements Patch

func (ReplaceImageChecksum) ReplaceImageChecksum Uses

func (rc ReplaceImageChecksum) ReplaceImageChecksum() map[string]interface{}

ReplaceImageChecksum builder

type ReplaceImageName Uses

type ReplaceImageName struct {
    NewName string
}

ReplaceImageName implements Patch

func (ReplaceImageName) ToImagePatchMap Uses

func (r ReplaceImageName) ToImagePatchMap() map[string]interface{}

ToImagePatchMap builder

type ReplaceImageTags Uses

type ReplaceImageTags struct {
    NewTags []string
}

ReplaceImageTags implements Patch

func (ReplaceImageTags) ToImagePatchMap Uses

func (r ReplaceImageTags) ToImagePatchMap() map[string]interface{}

ToImagePatchMap builder

type UpdateOpts Uses

type UpdateOpts []Patch

UpdateOpts implements UpdateOpts

func (UpdateOpts) ToImageUpdateMap Uses

func (opts UpdateOpts) ToImageUpdateMap() []interface{}

ToImageUpdateMap builder

type UpdateOptsBuilder Uses

type UpdateOptsBuilder interface {
    // returns value implementing json.Marshaler which when marshaled matches the patch schema:
    // http://specs.openstack.org/openstack/glance-specs/specs/api/v2/http-patch-image-api-v2.html
    ToImageUpdateMap() []interface{}
}

UpdateOptsBuilder implements UpdateOptsBuilder

type UpdateResult Uses

type UpdateResult struct {
    // contains filtered or unexported fields
}

UpdateResult represents the result of an Update operation

func Update Uses

func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult

Update implements image updated request

func (UpdateResult) Extract Uses

func (c UpdateResult) Extract() (*Image, error)

Extract interprets any commonResult as an Image.

type UpdateVisibility Uses

type UpdateVisibility struct {
    Visibility ImageVisibility
}

UpdateVisibility updated visibility

func (UpdateVisibility) ToImagePatchMap Uses

func (u UpdateVisibility) ToImagePatchMap() map[string]interface{}

ToImagePatchMap builder

Package images imports 13 packages (graph) and is imported by 4 packages. Updated 2016-07-18. Refresh now. Tools for package owners.