shares

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager

List returns a Pager which allows you to iterate over a collection of SFS Turbo resources.

Types

type ChangeSGOpts added in v0.2.7

type ChangeSGOpts struct {
	// Specifies the change_security_group object.
	ChangeSecurityGroup SecurityGroupOpts `json:"change_security_group" required:"true"`
}

ChangeSGOpts contains the options for changing security group to a SFS Turbo

func (ChangeSGOpts) ToShareSGMap added in v0.2.7

func (opts ChangeSGOpts) ToShareSGMap() (map[string]interface{}, error)

ToShareExpandMap assembles a request body based on the contents of a ChangeSGOpts.

type ChangeSGOptsBuilder added in v0.2.7

type ChangeSGOptsBuilder interface {
	ToShareSGMap() (map[string]interface{}, error)
}

ChangeSGOptsBuilder allows extensions to change the security group bound to a SFS Turbo file system

type ChangeSGResult added in v0.2.7

type ChangeSGResult struct {
	golangsdk.ErrResult
}

ChangeSGResult contains the error from a ChangeSG request.

type CreateOpts

type CreateOpts struct {
	// Defines the SFS Turbo file system name
	Name string `json:"name" required:"true"`
	// Defines the SFS Turbo file system protocol to use, the valid value is NFS.
	ShareProto string `json:"share_proto,omitempty"`
	// ShareType defines the file system type. the valid values are STANDARD and PERFORMANCE.
	ShareType string `json:"share_type" required:"true"`
	// Size in GB, range from 500 to 32768.
	Size int `json:"size" required:"true"`
	// The availability zone of the SFS Turbo file system
	AvailabilityZone string `json:"availability_zone" required:"true"`
	// The VPC ID
	VpcID string `json:"vpc_id" required:"true"`
	// The subnet ID
	SubnetID string `json:"subnet_id" required:"true"`
	// The security group ID
	SecurityGroupID string `json:"security_group_id" required:"true"`
	// The enterprise project ID
	EnterpriseProjectId string `json:"enterprise_project_id,omitempty"`
	// The backup ID
	BackupID string `json:"backup_id,omitempty"`
	// Share description
	Description string `json:"description,omitempty"`
	// The metadata information
	Metadata Metadata `json:"metadata,omitempty"`
}

CreateOpts contains the options for create an SFS Turbo. This object is passed to shares.Create().

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 *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create will create a new SFS Turbo file system 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() (*TurboResponse, error)

Extract will get the Turbo response object from the CreateResult

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult contains the error from a Delete request.

func Delete

func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)

Delete will delete an existing SFS Turbo file system with the given UUID.

type ExpandOpts

type ExpandOpts struct {
	// Specifies the extend object.
	Extend ExtendOpts `json:"extend" required:"true"`
}

ExpandOpts contains the options for expanding a SFS Turbo. This object is passed to shares.Expand().

func (ExpandOpts) ToShareExpandMap

func (opts ExpandOpts) ToShareExpandMap() (map[string]interface{}, error)

ToShareExpandMap assembles a request body based on the contents of a ExpandOpts.

type ExpandOptsBuilder

type ExpandOptsBuilder interface {
	ToShareExpandMap() (map[string]interface{}, error)
}

ExpandOptsBuilder allows extensions to add additional parameters to the Expand request.

type ExpandResult

type ExpandResult struct {
	golangsdk.ErrResult
}

ExpandResult contains the error from an Expand request.

func ChangeSG added in v0.2.7

func ChangeSG(client *golangsdk.ServiceClient, shareID string, opts ChangeSGOptsBuilder) (r ExpandResult)

ChangeSG will change security group to a SFS Turbo based on the values in ChangeSGOpts.

func Expand

func Expand(client *golangsdk.ServiceClient, shareID string, opts ExpandOptsBuilder) (r ExpandResult)

Expand will expand a SFS Turbo based on the values in ExpandOpts.

type ExtendOpts

type ExtendOpts struct {
	// Specifies the post-expansion capacity (GB) of the shared file system.
	NewSize int `json:"new_size" required:"true"`
}

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 *golangsdk.ServiceClient, id string) (r GetResult)

Get will get a single SFS Turbo file system with given UUID

func (GetResult) Extract

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

Extract will get the Turbo object from the GetResult

type ListOpts added in v0.2.7

type ListOpts struct {
	Limit  string `q:"limit"`
	Offset string `q:"offset"`
}

func (ListOpts) ToShareListQuery added in v0.2.7

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

type ListOptsBuilder added in v0.2.7

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

type Metadata

type Metadata struct {
	CryptKeyID string `json:"crypt_key_id,omitempty"`
	ExpandType string `json:"expand_type,omitempty"`
}

Metadata specifies the metadata information

type SecurityGroupOpts added in v0.2.7

type SecurityGroupOpts struct {
	// Specifies the ID of the security group to be modified.
	SecurityGroupID string `json:"security_group_id" required:"true"`
}

type Turbo

type Turbo struct {
	// The UUID of the SFS Turbo file system
	ID string `json:"id"`
	// The name of the SFS Turbo file system
	Name string `json:"name"`
	// Size of the share in GB
	Size string `json:"size"`
	// The statue of the SFS Turbo file system
	Status string `json:"status"`
	// The sub-statue of the SFS Turbo file system
	SubStatus string `json:"sub_status"`
	// The version ID of the SFS Turbo file system
	Version string `json:"version"`
	// The mount location
	ExportLocation string `json:"export_location"`
	// The creation progress of the SFS Turbo file system
	Actions []string `json:"actions"`
	// The protocol type of the SFS Turbo file system
	ShareProto string `json:"share_proto"`
	// The type of the SFS Turbo file system, STANDARD or PERFORMANCE.
	ShareType string `json:"share_type"`
	// The region of the SFS Turbo file system
	Region string `json:"region"`
	// The code of the availability zone
	AvailabilityZone string `json:"availability_zone"`
	// The name of the availability zone
	AZName string `json:"az_name"`
	// The VPC ID
	VpcID string `json:"vpc_id"`
	// The subnet ID
	SubnetID string `json:"subnet_id"`
	// The security group ID
	SecurityGroupID string `json:"security_group_id"`
	// The available capacity if the SFS Turbo file system
	AvailCapacity string `json:"avail_capacity"`
	// bandwidth is returned for an enhanced file system
	ExpandType string `json:"expand_type"`
	// The ID of the encryption key
	CryptKeyID string `json:"crypt_key_id"`
	// The billing mode, 0 indicates pay-per-use, 1 indicates yearly/monthly subscription
	PayModel string `json:"pay_model"`
	// Timestamp when the share was created
	CreatedAt string `json:"created_at"`
}

Turbo contains all information associated with an SFS Turbo file system

func ExtractTurbos

func ExtractTurbos(r pagination.Page) ([]Turbo, error)

ExtractTurbos accepts a Page struct, specifically a TurboPage struct, and extracts the elements into a slice of share structs. In other words, a generic collection is mapped into a relevant slice.

type TurboPage

type TurboPage struct {
	pagination.LinkedPageBase
}

TurboPage is the page returned by a pager when traversing over a collection of Shares.

func (TurboPage) IsEmpty

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

IsEmpty returns true if a ListResult contains no Shares.

func (TurboPage) NextPageURL

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

NextPageURL is invoked when a paginated collection of 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 TurboResponse

type TurboResponse struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Status string `json:"status"`
}

TurboResponse contains the information of creating response

Jump to

Keyboard shortcuts

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