file_shares

package
v0.6.29 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

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 ExtractFileShareIDFromTask

func ExtractFileShareIDFromTask(task *tasks.Task) (string, error)

func ExtractFileSharesInto

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

func ExtractMetadataInto

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

func List

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.

func (CreateAccessRuleOpts) Validate

func (opts CreateAccessRuleOpts) Validate() error

Validate

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.

func (CreateOpts) Validate

func (opts CreateOpts) Validate() error

Validate

type CreateOptsBuilder

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

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.

func (ExtendOpts) Validate

func (opts ExtendOpts) Validate() error

Validate

type FileShare

type FileShare struct {
	Name             string                          `json:"name"`
	ID               string                          `json:"id"`
	Protocol         string                          `json:"protocol"`
	Status           string                          `json:"status"`
	Size             int                             `json:"size"`
	VolumeType       string                          `json:"volume_type"`
	CreatedAt        *gcorecloud.JSONRFC3339MilliNoZ `json:"created_at"`
	ShareNetworkName string                          `json:"share_network_name"`
	NetworkName      string                          `json:"network_name"`
	SubnetName       string                          `json:"subnet_name"`
	ConnectionPoint  string                          `json:"connection_point"`
	TaskID           *string                         `json:"task_id"`
	CreatorTaskID    *string                         `json:"creator_task_id"`
	ProjectID        int                             `json:"project_id"`
	RegionID         int                             `json:"region_id"`
	Region           string                          `json:"region"`
	Metadata         map[string]interface{}          `json:"metadata"`
}

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 {
	NetworkID string `json:"network_id,omitempty" validate:"uuid4"`
	SubnetID  string `json:"subnet_id,omitempty" validate:"uuid4"`
}

type FileSharePage

type FileSharePage struct {
	pagination.LinkedPageBase
}

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 {
	FileShares []string `mapstructure:"file_shares"`
}

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

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

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

func (r MetadataResult) Extract() (*FileShare, error)

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 {
	ToFileShareResizeMap() (map[string]interface{}, error)
}

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.

func (UpdateOpts) Validate

func (opts UpdateOpts) Validate() error

Validate

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToFileShareUpdateMap() (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 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

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

Extract is a function that accepts a result and extracts a file share resource.

func (UpdateResult) ExtractInto

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

Directories

Path Synopsis
file shares unit tests
file shares unit tests

Jump to

Keyboard shortcuts

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