Documentation ¶
Index ¶
- func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
- func Delete(c *gcorecloud.ServiceClient, fileShareID string) (r tasks.Result)
- func Extend(c *gcorecloud.ServiceClient, fileShareID string, opts ResizeOptsBuilder) (r tasks.Result)
- func ExtractAccessRuleInto(r pagination.Page, v interface{}) error
- func ExtractFileShareIDFromTask(task *tasks.Task) (string, error)
- func ExtractFileSharesInto(r pagination.Page, v interface{}) error
- func ExtractMetadataInto(r pagination.Page, v interface{}) error
- func List(c *gcorecloud.ServiceClient) pagination.Pager
- func ListAccessRules(c *gcorecloud.ServiceClient, fileShareID string) pagination.Pager
- func MetadataList(client *gcorecloud.ServiceClient, id string) pagination.Pager
- type AccessRule
- type AccessRulePage
- type CreateAccessRuleOpts
- type CreateAccessRuleOptsBuilder
- type CreateAccessRuleResult
- type CreateOpts
- type CreateOptsBuilder
- type DeleteResult
- type ExtendOpts
- type FileShare
- type FileShareNetworkOpts
- type FileSharePage
- type FileShareTaskResult
- type GetAccessRuleResult
- type GetResult
- type Metadata
- type MetadataActionResult
- func MetadataCreateOrUpdate(client *gcorecloud.ServiceClient, id string, opts map[string]interface{}) (r MetadataActionResult)
- func MetadataDelete(client *gcorecloud.ServiceClient, id string, key string) (r MetadataActionResult)
- func MetadataReplace(client *gcorecloud.ServiceClient, id string, opts map[string]interface{}) (r MetadataActionResult)
- type MetadataPage
- type MetadataResult
- type ResizeOptsBuilder
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
Create accepts a CreateOpts struct and creates a new file share using the values provided.
func Delete ¶
func Delete(c *gcorecloud.ServiceClient, fileShareID string) (r tasks.Result)
Delete accepts a unique ID and deletes the file share associated with it.
func Extend ¶
func Extend(c *gcorecloud.ServiceClient, fileShareID string, opts ResizeOptsBuilder) (r tasks.Result)
Extend accepts a ExtendOpts struct and resize an existing file share using the values provided.
func ExtractAccessRuleInto ¶
func ExtractAccessRuleInto(r pagination.Page, v interface{}) error
func ExtractFileSharesInto ¶
func ExtractFileSharesInto(r pagination.Page, v interface{}) error
func ExtractMetadataInto ¶
func ExtractMetadataInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *gcorecloud.ServiceClient) pagination.Pager
List returns a Pager which allows you to iterate over a collection of file shares.
func ListAccessRules ¶
func ListAccessRules(c *gcorecloud.ServiceClient, fileShareID string) pagination.Pager
List returns a Pager which allows you to iterate over a collection of file shares.
func MetadataList ¶
func MetadataList(client *gcorecloud.ServiceClient, id string) pagination.Pager
Types ¶
type AccessRule ¶
type AccessRule struct { ID string `json:"id"` State string `json:"state"` AccessTo string `json:"access_to"` AccessLevel string `json:"access_level"` }
FileShare represents a file share structure.
func ExtractAccessRule ¶
func ExtractAccessRule(r pagination.Page) ([]AccessRule, error)
ExtractAccessRule accepts a Page struct, specifically a AccessRulePage struct, and extracts the elements into a slice of AccessRule structs. In other words, a generic collection is mapped into a relevant slice.
type AccessRulePage ¶
type AccessRulePage struct {
pagination.LinkedPageBase
}
AccessRulePage is the page returned by a pager when traversing over a collection of file share access rules.
func (AccessRulePage) IsEmpty ¶
func (r AccessRulePage) IsEmpty() (bool, error)
IsEmpty checks whether a AccessRulePage struct is empty.
func (AccessRulePage) NextPageURL ¶
func (r AccessRulePage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of file share access rules has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type CreateAccessRuleOpts ¶
type CreateAccessRuleOpts struct { IPAddress string `json:"ip_address,omitempty" validate:"required,ipv4|cidrv4,omitempty"` AccessMode string `json:"access_mode" validate:"required,oneof=ro rw"` }
func (CreateAccessRuleOpts) ToAccessRuleCreateMap ¶
func (opts CreateAccessRuleOpts) ToAccessRuleCreateMap() (map[string]interface{}, error)
ToAccessRuleCreateMap builds a request body from CreateAccessRuleOpts.
type CreateAccessRuleOptsBuilder ¶
type CreateAccessRuleOptsBuilder interface {
ToAccessRuleCreateMap() (map[string]interface{}, error)
}
CreateAccessRuleOptsBuilder allows extensions to add additional parameters to the AccessRuleCreate request.
type CreateAccessRuleResult ¶
type CreateAccessRuleResult struct {
// contains filtered or unexported fields
}
func CreateAccessRule ¶
func CreateAccessRule(c *gcorecloud.ServiceClient, fileShareID string, opts CreateAccessRuleOptsBuilder) (r CreateAccessRuleResult)
CreateAccessRule accepts a CreateAccessRuleOpts struct and creates a new file share access rule using the values provided.
func (CreateAccessRuleResult) Extract ¶
func (r CreateAccessRuleResult) Extract() (*AccessRule, error)
Extract is a function that accepts a result and extracts a file share access rule resource.
func (CreateAccessRuleResult) ExtractInto ¶
func (r CreateAccessRuleResult) ExtractInto(v interface{}) error
type CreateOpts ¶
type CreateOpts struct { Name string `json:"name" required:"true" validate:"required"` Protocol string `json:"protocol" required:"true" validate:"required,oneof=NFS"` Size int `json:"size" required:"true" validate:"required,gt=1"` Network FileShareNetworkOpts `json:"network" required:"true" validate:"required,dive"` Access []CreateAccessRuleOpts `json:"access,omitempty" validate:"dive"` Metadata map[string]string `json:"metadata,omitempty"` }
CreateOpts represents options used to create a file share.
func (CreateOpts) ToFileShareCreateMap ¶
func (opts CreateOpts) ToFileShareCreateMap() (map[string]interface{}, error)
ToFileShareCreateMap builds a request body from CreateOpts.
type CreateOptsBuilder ¶
type CreateOptsBuilder interface {
}CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type DeleteResult ¶
type DeleteResult struct {
gcorecloud.ErrResult
}
DeleteResult represents the result of a delete operation
func DeleteAccessRule ¶
func DeleteAccessRule(c *gcorecloud.ServiceClient, fileShareID string, ruleID string) (r DeleteResult)
Delete accepts a unique ID and deletes the file share access rule associated with it.
type ExtendOpts ¶
type ExtendOpts struct {
Size int `json:"size" required:"true" validate:"required,gt=1"`
}
ExtendOpts represents options used to resize a file share.
func (ExtendOpts) ToFileShareResizeMap ¶
func (opts ExtendOpts) ToFileShareResizeMap() (map[string]interface{}, error)
ToFileShareResizeMap builds a request body from ResizeOpts.
type FileShare ¶
type FileShare struct {}
FileShare represents a file share structure.
func ExtractFileShares ¶
func ExtractFileShares(r pagination.Page) ([]FileShare, error)
ExtractFileShare accepts a Page struct, specifically a FileSharePage struct, and extracts the elements into a slice of FileShare structs. In other words, a generic collection is mapped into a relevant slice.
func ListAll ¶
func ListAll(client *gcorecloud.ServiceClient) ([]FileShare, error)
ListAll is a convenience function that returns all file shares.
type FileShareNetworkOpts ¶
type FileShareNetworkOpts struct {}
type FileSharePage ¶
type FileSharePage struct {
}FileSharePage is the page returned by a pager when traversing over a collection of file shares.
func (FileSharePage) IsEmpty ¶
func (r FileSharePage) IsEmpty() (bool, error)
IsEmpty checks whether a FileSharePage struct is empty.
func (FileSharePage) NextPageURL ¶
func (r FileSharePage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of file shares has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type FileShareTaskResult ¶
type FileShareTaskResult struct {
}type GetAccessRuleResult ¶
type GetAccessRuleResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a FileShare.
func (GetAccessRuleResult) Extract ¶
func (r GetAccessRuleResult) Extract() (*AccessRule, error)
Extract is a function that accepts a result and extracts a file share access rule resource.
func (GetAccessRuleResult) ExtractInto ¶
func (r GetAccessRuleResult) ExtractInto(v interface{}) error
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 a FileShare.
func Get ¶
func Get(c *gcorecloud.ServiceClient, id string) (r GetResult)
Get retrieves a specific file share based on its unique ID.
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts a file share resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type Metadata ¶
type Metadata struct { Key string `json:"key"` Value string `json:"value"` ReadOnly bool `json:"read_only"` }
func ExtractMetadata ¶
func ExtractMetadata(r pagination.Page) ([]Metadata, error)
ExtractMetadata accepts a Page struct, specifically a MetadataPage struct, and extracts the elements into a slice of securitygroups metadata structs. In other words, a generic collection is mapped into a relevant slice.
func MetadataListAll ¶
func MetadataListAll(client *gcorecloud.ServiceClient, id string) ([]Metadata, error)
type MetadataActionResult ¶
type MetadataActionResult struct {
gcorecloud.ErrResult
}
MetadataActionResult represents the result of a create, delete or update operation(no content)
func MetadataCreateOrUpdate ¶
func MetadataCreateOrUpdate(client *gcorecloud.ServiceClient, id string, opts map[string]interface{}) (r MetadataActionResult)
MetadataCreateOrUpdate creates or update a metadata for an security group.
func MetadataDelete ¶
func MetadataDelete(client *gcorecloud.ServiceClient, id string, key string) (r MetadataActionResult)
MetadataDelete deletes defined metadata key for a security group.
func MetadataReplace ¶
func MetadataReplace(client *gcorecloud.ServiceClient, id string, opts map[string]interface{}) (r MetadataActionResult)
MetadataReplace replace a metadata for an security group.
type MetadataPage ¶
type MetadataPage struct {
pagination.LinkedPageBase
}
MetadataPage is the page returned by a pager when traversing over a collection of instance metadata objects.
type MetadataResult ¶
type MetadataResult struct {
// contains filtered or unexported fields
}
MetadataResult represents the result of a get operation
func MetadataGet ¶
func MetadataGet(client *gcorecloud.ServiceClient, id string, key string) (r MetadataResult)
MetadataGet gets defined metadata key for a security group.
func (MetadataResult) Extract ¶
Extract is a function that accepts a result and extracts a file share resource.
func (MetadataResult) ExtractInto ¶
func (r MetadataResult) ExtractInto(v interface{}) error
type ResizeOptsBuilder ¶
type ResizeOptsBuilder interface {
}ResizeOptsBuilder has parameters for resize request.
type UpdateOpts ¶
type UpdateOpts struct {
Name string `json:"name" required:"true" validate:"required"`
}
UpdateOpts represents options used to update a file share.
func (UpdateOpts) ToFileShareUpdateMap ¶
func (opts UpdateOpts) ToFileShareUpdateMap() (map[string]interface{}, error)
ToFileShareUpdateMap builds a request body from UpdateOpts.
type UpdateOptsBuilder ¶
type UpdateOptsBuilder interface {
}UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a FileShare.
func Update ¶
func Update(c *gcorecloud.ServiceClient, fileShareID string, opts UpdateOptsBuilder) (r UpdateResult)
Update accepts a UpdateOpts struct and updates an existing file share using the values provided. For more information, see the Create function.
func (UpdateResult) Extract ¶
Extract is a function that accepts a result and extracts a file share resource.
func (UpdateResult) ExtractInto ¶
func (r UpdateResult) ExtractInto(v interface{}) error