sharetypes

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 2 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List returns ShareTypes optionally limited by the conditions provided in ListOpts.

Types

type AccessOpts

type AccessOpts struct {
	// The UUID of the project to which access to the share type is granted.
	Project string `json:"project"`
}

func (AccessOpts) ToAddAccessMap

func (opts AccessOpts) ToAddAccessMap() (map[string]interface{}, error)

ToAddAccessMap assembles a request body based on the contents of a AccessOpts.

func (AccessOpts) ToRemoveAccessMap

func (opts AccessOpts) ToRemoveAccessMap() (map[string]interface{}, error)

ToRemoveAccessMap assembles a request body based on the contents of a AccessOpts.

type AddAccessOptsBuilder

type AddAccessOptsBuilder interface {
	ToAddAccessMap() (map[string]interface{}, error)
}

AddAccessOptsBuilder allows extensions to add additional parameters to the AddAccess

type AddAccessResult

type AddAccessResult struct {
	gophercloud.ErrResult
}

AddAccessResult contains the response body and error from a Add Access request.

func AddAccess

func AddAccess(client *gophercloud.ServiceClient, id string, opts AddAccessOptsBuilder) (r AddAccessResult)

AddAccess will add access to a ShareType based on the values in AccessOpts.

type CreateOpts

type CreateOpts struct {
	// The share type name
	Name string `json:"name" required:"true"`
	// Indicates whether a share type is publicly accessible
	IsPublic bool `json:"os-share-type-access:is_public"`
	// The extra specifications for the share type
	ExtraSpecs ExtraSpecsOpts `json:"extra_specs" required:"true"`
}

CreateOpts contains options for creating a ShareType. This object is passed to the sharetypes.Create function. For more information about these parameters, see the ShareType object.

func (CreateOpts) ToShareTypeCreateMap

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

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

type CreateOptsBuilder

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

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

CreateResult contains the response body and error from a Create request.

func Create

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

Create will create a new ShareType based on the values in CreateOpts. To extract the ShareType object from the response, call the Extract method on the CreateResult.

func (CreateResult) Extract

func (r CreateResult) Extract() (*ShareType, error)

Extract will get the ShareType object out of the commonResult object.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult contains the response body and error from a Delete request.

func Delete

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

Delete will delete the existing ShareType with the provided ID.

type ExtraSpecs

type ExtraSpecs map[string]interface{}

ExtraSpecs contains all the information associated with extra specifications for an Openstack ShareType.

type ExtraSpecsOpts

type ExtraSpecsOpts struct {
	// An extra specification that defines the driver mode for share server, or storage, life cycle management
	DriverHandlesShareServers bool `json:"driver_handles_share_servers" required:"true"`
	// An extra specification that filters back ends by whether they do or do not support share snapshots
	SnapshotSupport *bool `json:"snapshot_support,omitempty"`
}

ExtraSpecsOpts represent the extra specifications that can be selected for a share type

type GetDefaultResult

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

GetDefaultResult contains the response body and error from a Get Default request.

func GetDefault

func GetDefault(client *gophercloud.ServiceClient) (r GetDefaultResult)

GetDefault will retrieve the default ShareType.

func (GetDefaultResult) Extract

func (r GetDefaultResult) Extract() (*ShareType, error)

Extract will get the ShareType object out of the commonResult object.

type GetExtraSpecsResult

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

GetExtraSpecsResult contains the response body and error from a Get Extra Specs request.

func GetExtraSpecs

func GetExtraSpecs(client *gophercloud.ServiceClient, id string) (r GetExtraSpecsResult)

GetExtraSpecs will retrieve the extra specifications for a given ShareType.

func (GetExtraSpecsResult) Extract

func (r GetExtraSpecsResult) Extract() (ExtraSpecs, error)

Extract will get the ExtraSpecs object out of the commonResult object.

type ListOpts

type ListOpts struct {
	// Select if public types, private types, or both should be listed
	IsPublic string `q:"is_public"`
}

ListOpts holds options for listing ShareTypes. It is passed to the sharetypes.List function.

func (ListOpts) ToShareTypeListQuery

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

ToShareTypeListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

type RemoveAccessOptsBuilder

type RemoveAccessOptsBuilder interface {
	ToRemoveAccessMap() (map[string]interface{}, error)
}

RemoveAccessOptsBuilder allows extensions to add additional parameters to the RemoveAccess

type RemoveAccessResult

type RemoveAccessResult struct {
	gophercloud.ErrResult
}

RemoveAccessResult contains the response body and error from a Remove Access request.

func RemoveAccess

RemoveAccess will remove access to a ShareType based on the values in AccessOpts.

type SetExtraSpecsOpts

type SetExtraSpecsOpts struct {
	// A list of all extra specifications to be added to a ShareType
	ExtraSpecs map[string]interface{} `json:"extra_specs" required:"true"`
}

func (SetExtraSpecsOpts) ToShareTypeSetExtraSpecsMap

func (opts SetExtraSpecsOpts) ToShareTypeSetExtraSpecsMap() (map[string]interface{}, error)

ToShareTypeSetExtraSpecsMap assembles a request body based on the contents of a SetExtraSpecsOpts.

type SetExtraSpecsOptsBuilder

type SetExtraSpecsOptsBuilder interface {
	ToShareTypeSetExtraSpecsMap() (map[string]interface{}, error)
}

SetExtraSpecsOptsBuilder allows extensions to add additional parameters to the SetExtraSpecs request.

type SetExtraSpecsResult

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

SetExtraSpecsResult contains the response body and error from a Set Extra Specs request.

func SetExtraSpecs

SetExtraSpecs will set new specifications for a ShareType based on the values in SetExtraSpecsOpts. To extract the extra specifications object from the response, call the Extract method on the SetExtraSpecsResult.

func (SetExtraSpecsResult) Extract

func (r SetExtraSpecsResult) Extract() (ExtraSpecs, error)

Extract will get the ExtraSpecs object out of the commonResult object.

type ShareType

type ShareType struct {
	// The Share Type ID
	ID string `json:"id"`
	// The Share Type name
	Name string `json:"name"`
	// Indicates whether a share type is publicly accessible
	IsPublic bool `json:"os-share-type-access:is_public"`
	// The required extra specifications for the share type
	RequiredExtraSpecs map[string]interface{} `json:"required_extra_specs"`
	// The extra specifications for the share type
	ExtraSpecs map[string]interface{} `json:"extra_specs"`
}

ShareType contains all the information associated with an OpenStack ShareType.

func ExtractShareTypes

func ExtractShareTypes(r pagination.Page) ([]ShareType, error)

ExtractShareTypes extracts and returns ShareTypes. It is used while iterating over a sharetypes.List call.

type ShareTypeAccess

type ShareTypeAccess struct {
	// The share type ID of the member.
	ShareTypeID string `json:"share_type_id"`
	// The UUID of the project for which access to the share type is granted.
	ProjectID string `json:"project_id"`
}

ShareTypeAccess contains all the information associated with an OpenStack ShareTypeAccess.

type ShareTypePage

type ShareTypePage struct {
	pagination.SinglePageBase
}

ShareTypePage is a pagination.pager that is returned from a call to the List function.

func (ShareTypePage) IsEmpty

func (r ShareTypePage) IsEmpty() (bool, error)

IsEmpty returns true if a ListResult contains no ShareTypes.

type ShowAccessResult

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

ShowAccessResult contains the response body and error from a Show access request.

func ShowAccess

func ShowAccess(client *gophercloud.ServiceClient, id string) (r ShowAccessResult)

ShowAccess will show access details for an existing ShareType.

func (ShowAccessResult) Extract

func (r ShowAccessResult) Extract() ([]ShareTypeAccess, error)

Extract will get the ShareTypeAccess objects out of the shareTypeAccessResult object.

type UnsetExtraSpecsResult

type UnsetExtraSpecsResult struct {
	gophercloud.ErrResult
}

UnsetExtraSpecsResult contains the response body and error from a Unset Extra Specs request.

func UnsetExtraSpecs

func UnsetExtraSpecs(client *gophercloud.ServiceClient, id string, key string) (r UnsetExtraSpecsResult)

UnsetExtraSpecs will unset an extra specification for an existing ShareType.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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