sharetransfers

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTransfersInto

func ExtractTransfersInto(r pagination.Page, v interface{}) error

ExtractTransfersInto similar to ExtractInto but operates on a `list` of transfers

func List

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

func ListDetail

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

List returns Transfers with details optionally limited by the conditions provided in ListOpts.

Types

type AcceptOpts

type AcceptOpts struct {
	// The auth key of the share transfer to accept.
	AuthKey string `json:"auth_key" required:"true"`

	// Whether to clear access rules when accept the share.
	ClearAccessRules bool `json:"clear_access_rules,omitempty"`
}

AcceptOpts contains options for a Share transfer accept reqeust.

func (AcceptOpts) ToAcceptMap

func (opts AcceptOpts) ToAcceptMap() (map[string]interface{}, error)

ToAcceptMap assembles a request body based on the contents of a AcceptOpts.

type AcceptResult

type AcceptResult struct {
	gophercloud.ErrResult
}

AcceptResult contains the response body and error from an Accept request.

func Accept

func Accept(client *gophercloud.ServiceClient, id string, opts AcceptOpts) (r AcceptResult)

Accept will accept a share tranfer request based on the values in AcceptOpts.

type CreateOpts

type CreateOpts struct {
	// The ID of the share to transfer.
	ShareID string `json:"share_id" required:"true"`

	// The name of the share transfer.
	Name string `json:"name,omitempty"`
}

CreateOpts contains options for a Share transfer.

func (CreateOpts) ToTransferCreateMap

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

ToCreateMap assembles a request body based on the contents of a TransferOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToTransferCreateMap() (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 share tranfer request based on the values in CreateOpts.

func (CreateResult) Extract

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

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

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

ExtractInto converts our response data into a transfer struct.

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 deletes a share transfer.

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 retrieves the Transfer with the provided ID. To extract the Transfer object from the response, call the Extract method on the GetResult.

func (GetResult) Extract

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

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

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

ExtractInto converts our response data into a transfer struct.

type ListOpts

type ListOpts struct {
	// AllTenants will retrieve transfers of all tenants/projects. Admin
	// only.
	AllTenants bool `q:"all_tenants"`

	// The user defined name of the share transfer to filter resources by.
	Name string `q:"name"`

	// The name pattern that can be used to filter share transfers.
	NamePattern string `q:"name~"`

	// The key to sort a list of transfers. A valid value is id, name,
	// resource_type, resource_id, source_project_id, destination_project_id,
	// created_at, expires_at.
	SortKey string `q:"sort_key"`

	// The direction to sort a list of resources. A valid value is asc, or
	// desc.
	SortDir string `q:"sort_dir"`

	// Requests a page size of items.
	Limit int `q:"limit"`

	// Used in conjunction with limit to return a slice of items.
	Offset int `q:"offset"`

	// The ID of the last-seen item.
	Marker string `q:"marker"`
}

ListOpts holds options for listing Transfers. It is passed to the sharetransfers.List or sharetransfers.ListDetail functions.

func (ListOpts) ToTransferListQuery

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

ToTransferListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

type Transfer

type Transfer struct {
	ID                   string              `json:"id"`
	Accepted             bool                `json:"accepted"`
	AuthKey              string              `json:"auth_key"`
	Name                 string              `json:"name"`
	SourceProjectID      string              `json:"source_project_id"`
	DestinationProjectID string              `json:"destination_project_id"`
	ResourceID           string              `json:"resource_id"`
	ResourceType         string              `json:"resource_type"`
	CreatedAt            time.Time           `json:"-"`
	ExpiresAt            time.Time           `json:"-"`
	Links                []map[string]string `json:"links"`
}

Transfer represents a Share Transfer record.

func ExtractTransfers

func ExtractTransfers(r pagination.Page) ([]Transfer, error)

ExtractTransfers extracts and returns Transfers. It is used while iterating over a transfers.List call.

func (*Transfer) UnmarshalJSON

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

UnmarshalJSON is our unmarshalling helper.

type TransferPage

type TransferPage struct {
	pagination.MarkerPageBase
}

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

func (TransferPage) IsEmpty

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

IsEmpty satisifies the IsEmpty method of the Page interface.

func (TransferPage) LastMarker

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

LastMarker returns the last offset in a ListResult.

func (TransferPage) NextPageURL

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

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

Jump to

Keyboard shortcuts

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