shares

package
v1.1.19 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package shares provides information and interaction with the different API versions for the Shared File System service, code-named Manila.

For more information, see: https://docs.openstack.org/api-ref/shared-file-system/

Example to Revert a Share to a Snapshot ID

opts := &shares.RevertOpts{
	// snapshot ID to revert to
	SnapshotID: "ddeac769-9742-497f-b985-5bcfa94a3fd6",
}
manilaClient.Microversion = "2.27"
err := shares.Revert(manilaClient, shareID, opts).ExtractErr()
if err != nil {
	panic(err)
}

Example to Reset a Share Status

opts := &shares.ResetStatusOpts{
	// a new Share Status
	Status: "available",
}
manilaClient.Microversion = "2.7"
err := shares.ResetStatus(manilaClient, shareID, opts).ExtractErr()
if err != nil {
	panic(err)
}

Example to Force Delete a Share

manilaClient.Microversion = "2.7"
err := shares.ForceDelete(manilaClient, shareID).ExtractErr()
if err != nil {
	panic(err)
}

Example to Unmanage a Share

manilaClient.Microversion = "2.7"
err := shares.Unmanage(manilaClient, shareID).ExtractErr()
if err != nil {
	panic(err)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListDetail

func ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

ListDetail returns []Share optionally limited by the conditions provided in ListOpts.

Types

type AccessRight

type AccessRight struct {
	// The UUID of the share to which you are granted or denied access.
	ShareID string `json:"share_id"`
	// The access rule type that can be "ip", "cert" or "user".
	AccessType string `json:"access_type,omitempty"`
	// The value that defines the access that can be a valid format of IP, cert or user.
	AccessTo string `json:"access_to,omitempty"`
	// The access credential of the entity granted share access.
	AccessKey string `json:"access_key,omitempty"`
	// The access level to the share is either "rw" or "ro".
	AccessLevel string `json:"access_level,omitempty"`
	// The state of the access rule
	State string `json:"state,omitempty"`
	// The access rule ID.
	ID string `json:"id"`
}

AccessRight contains all information associated with an OpenStack share Grant Access Response

type CreateOpts

type CreateOpts struct {
	// Defines the share protocol to use
	ShareProto string `json:"share_proto" required:"true"`
	// Size in GB
	Size int `json:"size" required:"true"`
	// Defines the share name
	Name string `json:"name,omitempty"`
	// Share description
	Description string `json:"description,omitempty"`
	// DisplayName is equivalent to Name. The API supports using both
	// This is an inherited attribute from the block storage API
	DisplayName string `json:"display_name,omitempty"`
	// DisplayDescription is equivalent to Description. The API supports using both
	// This is an inherited attribute from the block storage API
	DisplayDescription string `json:"display_description,omitempty"`
	// ShareType defines the sharetype. If omitted, a default share type is used
	ShareType string `json:"share_type,omitempty"`
	// VolumeType is deprecated but supported. Either ShareType or VolumeType can be used
	VolumeType string `json:"volume_type,omitempty"`
	// The UUID from which to create a share
	SnapshotID string `json:"snapshot_id,omitempty"`
	// Determines whether or not the share is public
	IsPublic *bool `json:"is_public,omitempty"`
	// Key value pairs of user defined metadata
	Metadata map[string]string `json:"metadata,omitempty"`
	// The UUID of the share network to which the share belongs to
	ShareNetworkID string `json:"share_network_id,omitempty"`
	// The UUID of the consistency group to which the share belongs to
	ConsistencyGroupID string `json:"consistency_group_id,omitempty"`
	// The availability zone of the share
	AvailabilityZone string `json:"availability_zone,omitempty"`
}

CreateOpts contains the options for create a Share. This object is passed to shares.Create(). For more information about these parameters, please refer to the Share object, or the shared file systems API v2 documentation

func (CreateOpts) ToShareCreateMap

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

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

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToShareCreateMap() (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 Share based on the values in CreateOpts. To extract the Share object from the response, call the Extract method on the CreateResult.

func (CreateResult) Extract

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

Extract will get the Share object from the commonResult

type DeleteMetadatumResult

type DeleteMetadatumResult struct {
	gophercloud.ErrResult
}

DeleteMetadatumResult contains the response body and error from a DeleteMetadatum request.

func DeleteMetadatum

func DeleteMetadatum(client *gophercloud.ServiceClient, id, key string) (r DeleteMetadatumResult)

DeleteMetadatum deletes a single key-value pair from the metadata of the specified share.

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 an existing Share with the given UUID.

type ExportLocation

type ExportLocation struct {
	// The export location path that should be used for mount operation.
	Path string `json:"path"`
	// The UUID of the share instance that this export location belongs to.
	ShareInstanceID string `json:"share_instance_id"`
	// Defines purpose of an export location.
	// If set to true, then it is expected to be used for service needs
	// and by administrators only.
	// If it is set to false, then this export location can be used by end users.
	IsAdminOnly bool `json:"is_admin_only"`
	// The share export location UUID.
	ID string `json:"id"`
	// Drivers may use this field to identify which export locations are
	// most efficient and should be used preferentially by clients.
	// By default it is set to false value. New in version 2.14
	Preferred bool `json:"preferred"`
}

ExportLocation contains all information associated with a share export location

type ExtendOpts

type ExtendOpts struct {
	// New size in GBs.
	NewSize int `json:"new_size"`
}

ExtendOpts contains options for extending a Share. For more information about these parameters, please, refer to the shared file systems API v2, Share Actions, Extend share documentation

func (ExtendOpts) ToShareExtendMap

func (opts ExtendOpts) ToShareExtendMap() (map[string]interface{}, error)

ToShareExtendMap assembles a request body based on the contents of a ExtendOpts.

type ExtendOptsBuilder

type ExtendOptsBuilder interface {
	ToShareExtendMap() (map[string]interface{}, error)
}

ExtendOptsBuilder allows extensions to add additional parameters to the Extend request.

type ExtendResult

type ExtendResult struct {
	gophercloud.ErrResult
}

ExtendResult contains the response body and error from an Extend request.

func Extend

func Extend(client *gophercloud.ServiceClient, id string, opts ExtendOptsBuilder) (r ExtendResult)

Extend will extend the capacity of an existing share. ExtendResult contains only the error. To extract it, call the ExtractErr method on the ExtendResult. Client must have Microversion set; minimum supported microversion for Extend is 2.7.

type ForceDeleteResult

type ForceDeleteResult struct {
	gophercloud.ErrResult
}

ForceDeleteResult contains the response error from an ForceDelete request.

func ForceDelete

func ForceDelete(client *gophercloud.ServiceClient, id string) (r ForceDeleteResult)

ForceDelete will delete the existing share in any state. ForceDeleteResult contains only the error. To extract it, call the ExtractErr method on the ForceDeleteResult. Client must have Microversion set; minimum supported microversion for ForceDelete is 2.7.

type GetExportLocationResult

type GetExportLocationResult struct {
	gophercloud.Result
}

GetExportLocationResult contains the result body and error from a GetExportLocation request.

func GetExportLocation

func GetExportLocation(client *gophercloud.ServiceClient, shareID string, id string) (r GetExportLocationResult)

GetExportLocation will get shareID's export location by an ID. Client must have Microversion set; minimum supported microversion for GetExportLocation is 2.9.

func (GetExportLocationResult) Extract

Extract will get the Export Location from the GetExportLocationResult

type GetMetadatumResult

type GetMetadatumResult struct {
	gophercloud.Result
}

GetMetadatumResult contains the response body and error from a GetMetadatum request.

func GetMetadatum

func GetMetadatum(client *gophercloud.ServiceClient, id, key string) (r GetMetadatumResult)

GetMetadatum retrieves a single metadata item of the specified share. To extract the retrieved metadata from the response, call the Extract method on the GetMetadatumResult.

func (GetMetadatumResult) Extract

func (r GetMetadatumResult) Extract() (map[string]string, error)

Extract will get the string-string map from GetMetadatumResult

type GetResult

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

GetResult contains the response body and error from a Get request.

func Get

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

Get will get a single share with given UUID

func (GetResult) Extract

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

Extract will get the Share object from the commonResult

type GrantAccessOpts

type GrantAccessOpts struct {
	// The access rule type that can be "ip", "cert" or "user".
	AccessType string `json:"access_type"`
	// The value that defines the access that can be a valid format of IP, cert or user.
	AccessTo string `json:"access_to"`
	// The access level to the share is either "rw" or "ro".
	AccessLevel string `json:"access_level"`
}

GrantAccessOpts contains the options for creation of an GrantAccess request. For more information about these parameters, please, refer to the shared file systems API v2, Share Actions, Grant Access documentation

func (GrantAccessOpts) ToGrantAccessMap

func (opts GrantAccessOpts) ToGrantAccessMap() (map[string]interface{}, error)

ToGrantAccessMap assembles a request body based on the contents of a GrantAccessOpts.

type GrantAccessOptsBuilder

type GrantAccessOptsBuilder interface {
	ToGrantAccessMap() (map[string]interface{}, error)
}

GrantAccessOptsBuilder allows extensions to add additional parameters to the GrantAccess request.

type GrantAccessResult

type GrantAccessResult struct {
	gophercloud.Result
}

GrantAccessResult contains the result body and error from an GrantAccess request.

func GrantAccess

func GrantAccess(client *gophercloud.ServiceClient, id string, opts GrantAccessOptsBuilder) (r GrantAccessResult)

GrantAccess will grant access to a Share based on the values in GrantAccessOpts. To extract the GrantAccess object from the response, call the Extract method on the GrantAccessResult. Client must have Microversion set; minimum supported microversion for GrantAccess is 2.7.

func (GrantAccessResult) Extract

func (r GrantAccessResult) Extract() (*AccessRight, error)

Extract will get the GrantAccess object from the commonResult

type ListAccessRightsResult

type ListAccessRightsResult struct {
	gophercloud.Result
}

ListAccessRightsResult contains the result body and error from a ListAccessRights request.

func ListAccessRights

func ListAccessRights(client *gophercloud.ServiceClient, id string) (r ListAccessRightsResult)

ListAccessRights lists all access rules assigned to a Share based on its id. To extract the AccessRight slice from the response, call the Extract method on the ListAccessRightsResult. Client must have Microversion set; minimum supported microversion for ListAccessRights is 2.7.

func (ListAccessRightsResult) Extract

func (r ListAccessRightsResult) Extract() ([]AccessRight, error)

Extract will get a slice of AccessRight objects from the commonResult

type ListExportLocationsResult

type ListExportLocationsResult struct {
	gophercloud.Result
}

ListExportLocationsResult contains the result body and error from a ListExportLocations request.

func ListExportLocations

func ListExportLocations(client *gophercloud.ServiceClient, id string) (r ListExportLocationsResult)

ListExportLocations will list shareID's export locations. Client must have Microversion set; minimum supported microversion for ListExportLocations is 2.9.

func (ListExportLocationsResult) Extract

Extract will get the Export Locations from the ListExportLocationsResult

type ListOpts

type ListOpts struct {
	// (Admin only). Defines whether to list the requested resources for all projects.
	AllTenants bool `q:"all_tenants"`
	// The share name.
	Name string `q:"name"`
	// Filters by a share status.
	Status string `q:"status"`
	// The UUID of the share server.
	ShareServerID string `q:"share_server_id"`
	// One or more metadata key and value pairs as a dictionary of strings.
	Metadata map[string]string `q:"metadata"`
	// The extra specifications for the share type.
	ExtraSpecs map[string]string `q:"extra_specs"`
	// The UUID of the share type.
	ShareTypeID string `q:"share_type_id"`
	// The maximum number of shares to return.
	Limit int `q:"limit"`
	// The offset to define start point of share or share group listing.
	Offset int `q:"offset"`
	// The key to sort a list of shares.
	SortKey string `q:"sort_key"`
	// The direction to sort a list of shares.
	SortDir string `q:"sort_dir"`
	// The UUID of the share’s base snapshot to filter the request based on.
	SnapshotID string `q:"snapshot_id"`
	// The share host name.
	Host string `q:"host"`
	// The share network ID.
	ShareNetworkID string `q:"share_network_id"`
	// The UUID of the project in which the share was created. Useful with all_tenants parameter.
	ProjectID string `q:"project_id"`
	// The level of visibility for the share.
	IsPublic *bool `q:"is_public"`
	// The UUID of a share group to filter resource.
	ShareGroupID string `q:"share_group_id"`
	// The export location UUID that can be used to filter shares or share instances.
	ExportLocationID string `q:"export_location_id"`
	// The export location path that can be used to filter shares or share instances.
	ExportLocationPath string `q:"export_location_path"`
	// The name pattern that can be used to filter shares, share snapshots, share networks or share groups.
	NamePattern string `q:"name~"`
	// The description pattern that can be used to filter shares, share snapshots, share networks or share groups.
	DescriptionPattern string `q:"description~"`
	// Whether to show count in API response or not, default is False.
	WithCount bool `q:"with_count"`
	// DisplayName is equivalent to Name. The API supports using both
	// This is an inherited attribute from the block storage API
	DisplayName string `q:"display_name"`
	// Equivalent to NamePattern.
	DisplayNamePattern string `q:"display_name~"`
	// VolumeTypeID is deprecated but supported. Either ShareTypeID or VolumeTypeID can be used
	VolumeTypeID string `q:"volume_type_id"`
	// The UUID of the share group snapshot.
	ShareGroupSnapshotID string `q:"share_group_snapshot_id"`
	// DisplayDescription is equivalent to Description. The API supports using both
	// This is an inherited attribute from the block storage API
	DisplayDescription string `q:"display_description"`
	// Equivalent to DescriptionPattern
	DisplayDescriptionPattern string `q:"display_description~"`
}

ListOpts holds options for listing Shares. It is passed to the shares.List function.

func (ListOpts) ToShareListQuery

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

ToShareListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

type MetadataResult

type MetadataResult struct {
	gophercloud.Result
}

MetadataResult contains the response body and error from GetMetadata, SetMetadata or UpdateMetadata requests.

func GetMetadata

func GetMetadata(client *gophercloud.ServiceClient, id string) (r MetadataResult)

GetMetadata retrieves metadata of the specified share. To extract the retrieved metadata from the response, call the Extract method on the MetadataResult.

func SetMetadata

func SetMetadata(client *gophercloud.ServiceClient, id string, opts SetMetadataOptsBuilder) (r MetadataResult)

SetMetadata sets metadata of the specified share. Existing metadata items are either kept or overwritten by the metadata from the request. To extract the updated metadata from the response, call the Extract method on the MetadataResult.

func UpdateMetadata

func UpdateMetadata(client *gophercloud.ServiceClient, id string, opts UpdateMetadataOptsBuilder) (r MetadataResult)

UpdateMetadata updates metadata of the specified share. All existing metadata items are discarded and replaced by the metadata from the request. To extract the updated metadata from the response, call the Extract method on the MetadataResult.

func (MetadataResult) Extract

func (r MetadataResult) Extract() (map[string]string, error)

Extract will get the string-string map from MetadataResult

type ResetStatusOpts

type ResetStatusOpts struct {
	// Status is a share status to reset to. Must be "new", "error" or "active".
	Status string `json:"status"`
}

ResetStatusOpts contains options for resetting a Share status. For more information about these parameters, please, refer to the shared file systems API v2, Share Actions, ResetStatus share documentation.

func (ResetStatusOpts) ToShareResetStatusMap

func (opts ResetStatusOpts) ToShareResetStatusMap() (map[string]interface{}, error)

ToShareResetStatusMap assembles a request body based on the contents of a ResetStatusOpts.

type ResetStatusOptsBuilder

type ResetStatusOptsBuilder interface {
	ToShareResetStatusMap() (map[string]interface{}, error)
}

ResetStatusOptsBuilder allows extensions to add additional parameters to the ResetStatus request.

type ResetStatusResult

type ResetStatusResult struct {
	gophercloud.ErrResult
}

ResetStatusResult contains the response error from an ResetStatus request.

func ResetStatus

func ResetStatus(client *gophercloud.ServiceClient, id string, opts ResetStatusOptsBuilder) (r ResetStatusResult)

ResetStatus will reset the existing share status. ResetStatusResult contains only the error. To extract it, call the ExtractErr method on the ResetStatusResult. Client must have Microversion set; minimum supported microversion for ResetStatus is 2.7.

type RevertOpts

type RevertOpts struct {
	// SnapshotID is a Snapshot ID to revert a Share to
	SnapshotID string `json:"snapshot_id"`
}

RevertOpts contains options for reverting a Share to a snapshot. For more information about these parameters, please, refer to the shared file systems API v2, Share Actions, Revert share documentation. Available only since Manila Microversion 2.27

func (RevertOpts) ToShareRevertMap

func (opts RevertOpts) ToShareRevertMap() (map[string]interface{}, error)

ToShareRevertMap assembles a request body based on the contents of a RevertOpts.

type RevertOptsBuilder

type RevertOptsBuilder interface {
	ToShareRevertMap() (map[string]interface{}, error)
}

RevertOptsBuilder allows extensions to add additional parameters to the Revert request.

type RevertResult

type RevertResult struct {
	gophercloud.ErrResult
}

RevertResult contains the response error from an Revert request.

func Revert

func Revert(client *gophercloud.ServiceClient, id string, opts RevertOptsBuilder) (r RevertResult)

Revert will revert the existing share to a Snapshot. RevertResult contains only the error. To extract it, call the ExtractErr method on the RevertResult. Client must have Microversion set; minimum supported microversion for Revert is 2.27.

type RevokeAccessOpts

type RevokeAccessOpts struct {
	AccessID string `json:"access_id"`
}

RevokeAccessOpts contains the options for creation of a RevokeAccess request. For more information about these parameters, please, refer to the shared file systems API v2, Share Actions, Revoke Access documentation

func (RevokeAccessOpts) ToRevokeAccessMap

func (opts RevokeAccessOpts) ToRevokeAccessMap() (map[string]interface{}, error)

ToRevokeAccessMap assembles a request body based on the contents of a RevokeAccessOpts.

type RevokeAccessOptsBuilder

type RevokeAccessOptsBuilder interface {
	ToRevokeAccessMap() (map[string]interface{}, error)
}

RevokeAccessOptsBuilder allows extensions to add additional parameters to the RevokeAccess request.

type RevokeAccessResult

type RevokeAccessResult struct {
	gophercloud.ErrResult
}

RevokeAccessResult contains the response body and error from a Revoke access request.

func RevokeAccess

RevokeAccess will revoke an existing access to a Share based on the values in RevokeAccessOpts. RevokeAccessResult contains only the error. To extract it, call the ExtractErr method on the RevokeAccessResult. Client must have Microversion set; minimum supported microversion for RevokeAccess is 2.7.

type SetMetadataOpts

type SetMetadataOpts struct {
	Metadata map[string]string `json:"metadata"`
}

SetMetadataOpts contains options for setting share metadata. For more information about these parameters, please, refer to the shared file systems API v2, Share Metadata, Show share metadata documentation.

func (SetMetadataOpts) ToSetMetadataMap

func (opts SetMetadataOpts) ToSetMetadataMap() (map[string]interface{}, error)

ToSetMetadataMap assembles a request body based on the contents of an SetMetadataOpts.

type SetMetadataOptsBuilder

type SetMetadataOptsBuilder interface {
	ToSetMetadataMap() (map[string]interface{}, error)
}

SetMetadataOptsBuilder allows extensions to add additional parameters to the SetMetadata request.

type Share

type Share struct {
	// The availability zone of the share
	AvailabilityZone string `json:"availability_zone"`
	// A description of the share
	Description string `json:"description,omitempty"`
	// DisplayDescription is inherited from BlockStorage API.
	// Both Description and DisplayDescription can be used
	DisplayDescription string `json:"display_description,omitempty"`
	// DisplayName is inherited from BlockStorage API
	// Both DisplayName and Name can be used
	DisplayName string `json:"display_name,omitempty"`
	// Indicates whether a share has replicas or not.
	HasReplicas bool `json:"has_replicas"`
	// The host name of the share
	Host string `json:"host"`
	// The UUID of the share
	ID string `json:"id"`
	// Indicates the visibility of the share
	IsPublic bool `json:"is_public,omitempty"`
	// Share links for pagination
	Links []map[string]string `json:"links"`
	// Key, value -pairs of custom metadata
	Metadata map[string]string `json:"metadata,omitempty"`
	// The name of the share
	Name string `json:"name,omitempty"`
	// The UUID of the project to which this share belongs to
	ProjectID string `json:"project_id"`
	// The share replication type
	ReplicationType string `json:"replication_type,omitempty"`
	// The UUID of the share network
	ShareNetworkID string `json:"share_network_id"`
	// The shared file system protocol
	ShareProto string `json:"share_proto"`
	// The UUID of the share server
	ShareServerID string `json:"share_server_id"`
	// The UUID of the share type.
	ShareType string `json:"share_type"`
	// The name of the share type.
	ShareTypeName string `json:"share_type_name"`
	// Size of the share in GB
	Size int `json:"size"`
	// UUID of the snapshot from which to create the share
	SnapshotID string `json:"snapshot_id"`
	// The share status
	Status string `json:"status"`
	// The task state, used for share migration
	TaskState string `json:"task_state"`
	// The type of the volume
	VolumeType string `json:"volume_type,omitempty"`
	// The UUID of the consistency group this share belongs to
	ConsistencyGroupID string `json:"consistency_group_id"`
	// Used for filtering backends which either support or do not support share snapshots
	SnapshotSupport          bool   `json:"snapshot_support"`
	SourceCgsnapshotMemberID string `json:"source_cgsnapshot_member_id"`
	// Used for filtering backends which either support or do not support creating shares from snapshots
	CreateShareFromSnapshotSupport bool `json:"create_share_from_snapshot_support"`
	// Timestamp when the share was created
	CreatedAt time.Time `json:"-"`
	// Timestamp when the share was updated
	UpdatedAt time.Time `json:"-"`
}

Share contains all information associated with an OpenStack Share

func ExtractShares

func ExtractShares(r pagination.Page) ([]Share, error)

ExtractShares extracts and returns a Share slice. It is used while iterating over a shares.List call.

func (*Share) UnmarshalJSON

func (r *Share) UnmarshalJSON(b []byte) error

type SharePage

type SharePage struct {
	pagination.MarkerPageBase
}

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

func (SharePage) IsEmpty

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

IsEmpty satisifies the IsEmpty method of the Page interface

func (SharePage) LastMarker

func (r SharePage) LastMarker() (string, error)

LastMarker returns the last offset in a ListResult.

func (SharePage) NextPageURL

func (r SharePage) NextPageURL() (string, error)

NextPageURL generates the URL for the page of results after this one.

type ShrinkOpts

type ShrinkOpts struct {
	// New size in GBs.
	NewSize int `json:"new_size"`
}

ShrinkOpts contains options for shrinking a Share. For more information about these parameters, please, refer to the shared file systems API v2, Share Actions, Shrink share documentation

func (ShrinkOpts) ToShareShrinkMap

func (opts ShrinkOpts) ToShareShrinkMap() (map[string]interface{}, error)

ToShareShrinkMap assembles a request body based on the contents of a ShrinkOpts.

type ShrinkOptsBuilder

type ShrinkOptsBuilder interface {
	ToShareShrinkMap() (map[string]interface{}, error)
}

ShrinkOptsBuilder allows extensions to add additional parameters to the Shrink request.

type ShrinkResult

type ShrinkResult struct {
	gophercloud.ErrResult
}

ShrinkResult contains the response body and error from a Shrink request.

func Shrink

func Shrink(client *gophercloud.ServiceClient, id string, opts ShrinkOptsBuilder) (r ShrinkResult)

Shrink will shrink the capacity of an existing share. ShrinkResult contains only the error. To extract it, call the ExtractErr method on the ShrinkResult. Client must have Microversion set; minimum supported microversion for Shrink is 2.7.

type UnmanageResult

type UnmanageResult struct {
	gophercloud.ErrResult
}

UnmanageResult contains the response error from an Unmanage request.

func Unmanage

func Unmanage(client *gophercloud.ServiceClient, id string) (r UnmanageResult)

Unmanage will remove a share from the management of the Shared File System service without deleting the share. UnmanageResult contains only the error. To extract it, call the ExtractErr method on the UnmanageResult. Client must have Microversion set; minimum supported microversion for Unmanage is 2.7.

type UpdateMetadataOpts

type UpdateMetadataOpts struct {
	Metadata map[string]string `json:"metadata"`
}

UpdateMetadataOpts contains options for updating share metadata. For more information about these parameters, please, refer to the shared file systems API v2, Share Metadata, Update share metadata documentation.

func (UpdateMetadataOpts) ToUpdateMetadataMap

func (opts UpdateMetadataOpts) ToUpdateMetadataMap() (map[string]interface{}, error)

ToUpdateMetadataMap assembles a request body based on the contents of an UpdateMetadataOpts.

type UpdateMetadataOptsBuilder

type UpdateMetadataOptsBuilder interface {
	ToUpdateMetadataMap() (map[string]interface{}, error)
}

UpdateMetadataOptsBuilder allows extensions to add additional parameters to the UpdateMetadata request.

type UpdateOpts

type UpdateOpts struct {
	// Share name. Manila share update logic doesn't have a "name" alias.
	DisplayName *string `json:"display_name,omitempty"`
	// Share description. Manila share update logic doesn't have a "description" alias.
	DisplayDescription *string `json:"display_description,omitempty"`
	// Determines whether or not the share is public
	IsPublic *bool `json:"is_public,omitempty"`
}

UpdateOpts contain options for updating an existing Share. This object is passed to the share.Update function. For more information about the parameters, see the Share object.

func (UpdateOpts) ToShareUpdateMap

func (opts UpdateOpts) ToShareUpdateMap() (map[string]interface{}, error)

ToShareUpdateMap assembles a request body based on the contents of an UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToShareUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult contains the response body and error from an Update request.

func Update

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

Update will update the Share with provided information. To extract the updated Share from the response, call the Extract method on the UpdateResult.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Share, error)

Extract will get the Share object from the commonResult

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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