v1

package
v0.0.0-...-b5648fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package image implements a client library for accessing OpenStack Image V1 service

Images and ImageDetails can be retrieved using the api.

In addition more complex filtering and sort queries can by using the ImageQueryParameters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetailResponse

type DetailResponse struct {
	CheckSum        string                `json:"checksum"`
	ContainerFormat string                `json:"container_format"`
	CreatedAt       util.RFC8601DateTime  `json:"created_at"`
	Deleted         bool                  `json:"deleted"`
	DeletedAt       *util.RFC8601DateTime `json:"deleted_at"`
	DiskFormat      string                `json:"disk_format"`
	ID              string                `json:"id"`
	IsPublic        bool                  `json:"is_public"`
	MinDisk         int64                 `json:"min_disk"`
	MinRAM          int64                 `json:"min_ram"`
	Name            string                `json:"name"`
	Owner           *string               `json:"owner"`
	UpdatedAt       util.RFC8601DateTime  `json:"updated_at"`
	Properties      map[string]string     `json:"properties"`
	Protected       bool                  `json:"protected"`
	Status          string                `json:"status"`
	Size            int64                 `json:"size"`
	VirtualSize     *int64                `json:"virtual_size"` // Note: Property exists in OpenStack dev stack payloads but not Helion public cloud.
}

DetailResponse is a structure for all properties of an image for a detailed query

type QueryParameters

type QueryParameters struct {
	Name            string
	Status          string
	ContainerFormat string
	DiskFormat      string
	MinSize         int64
	MaxSize         int64
	SortKey         string
	SortDirection   SortDirection
	Marker          string
	Limit           int64
}

QueryParameters is a structure that contains the filter, sort, and paging parameters for an image or imagedetail query.

type Response

type Response struct {
	CheckSum        string `json:"checksum"`
	ContainerFormat string `json:"container_format"`
	DiskFormat      string `json:"disk_format"`
	ID              string `json:"id"`
	Name            string `json:"name"`
	Size            int64  `json:"size"`
}

Response is a structure for all properties of an image for a non detailed query

type Service

type Service struct {
	Session openstack.Session
	Client  http.Client
	URL     string
}

Service is a client service that can make requests against a OpenStack version 1 image service. Below is an example on creating an image service and getting images:

	imageService := image.ImageService{Client: *http.DefaultClient, TokenId: tokenId, Url: "http://imageservicelocation"}
 images:= imageService.Images()

func (Service) Images

func (imageService Service) Images() (image []Response, err error)

Images will issue a get request to OpenStack to retrieve the list of images.

func (Service) ImagesDetail

func (imageService Service) ImagesDetail() (image []DetailResponse, err error)

ImagesDetail will issue a get request to OpenStack to retrieve the list of images complete with additional details.

func (Service) QueryImages

func (imageService Service) QueryImages(queryParameters *QueryParameters) ([]Response, error)

QueryImages will issue a get request with the specified ImageQueryParameters to retrieve the list of images.

func (Service) QueryImagesDetail

func (imageService Service) QueryImagesDetail(queryParameters *QueryParameters) ([]DetailResponse, error)

QueryImagesDetail will issue a get request with the specified QueryParameters to retrieve the list of images with additional details.

type SortDirection

type SortDirection string

SortDirection of the sort, ascending or descending.

const (
	// Desc specifies the sort direction to be descending.
	Desc SortDirection = "desc"
	// Asc specifies the sort direction to be ascending.
	Asc SortDirection = "asc"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL