Documentation ¶
Index ¶
- func ExtractTransfersInto(r pagination.Page, v interface{}) error
- func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type AcceptOpts
- type AcceptResult
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type Transfer
- type TransferPage
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 ¶
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
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 { string `json:"share_id" required:"true"` // The name of the share transfer. Name string `json:"name,omitempty"` }ShareID
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 ¶
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) 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) 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 ¶
ToTransferListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
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 ¶
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.