Version: v1.1.0 Latest Latest

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 1 Imported by: 15



Package imageimport enables management of images import and retrieval of the Imageservice Import API information.

Example to Get an information about the Import API

importInfo, err := imageimport.Get(imagesClient).Extract()
if err != nil {

fmt.Printf("%+v\n", importInfo)

Example to Create a new image import

createOpts := imageimport.CreateOpts{
  Name: imageimport.WebDownloadMethod,
  URI:  "",
imageID := "da3b75d9-3f4a-40e7-8a2c-bfab23927dea"

err := imageimport.Create(imagesClient, imageID, createOpts).ExtractErr()
if err != nil {



This section is empty.


This section is empty.


This section is empty.


type CreateOpts

type CreateOpts struct {
	Name ImportMethod `json:"name"`
	URI  string       `json:"uri"`

CreateOpts specifies parameters of a new image import.

func (CreateOpts) ToImportCreateMap

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

ToImportCreateMap constructs a request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToImportCreateMap() (map[string]interface{}, error)

CreateOptsBuilder allows to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {

CreateResult is the result of import Create operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Create

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

Create requests the creation of a new image import on the server.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields

GetResult represents the result of a get operation. Call its Extract method to interpret it as ImportInfo.

func Get

Get retrieves Import API information data.

func (GetResult) Extract

func (r GetResult) Extract() (*ImportInfo, error)

Extract is a function that accepts a result and extracts ImportInfo.

type ImportInfo

type ImportInfo struct {
	ImportMethods ImportMethods `json:"import-methods"`

ImportInfo represents information data for the Import API.

type ImportMethod

type ImportMethod string

ImportMethod represents valid Import API method.

const (
	// GlanceDirectMethod represents glance-direct Import API method.
	GlanceDirectMethod ImportMethod = "glance-direct"

	// WebDownloadMethod represents web-download Import API method.
	WebDownloadMethod ImportMethod = "web-download"

type ImportMethods

type ImportMethods struct {
	Description string   `json:"description"`
	Type        string   `json:"type"`
	Value       []string `json:"value"`

ImportMethods contains information about available Import API methods.


Path Synopsis

Jump to

Keyboard shortcuts

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