Documentation ¶
Index ¶
- type BssParam
- type BssParamExtend
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type ExpandOpts
- type ExpandOptsBuilder
- type ExpandResult
- type ExtendOpts
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type Metadata
- type PagedList
- type Share
- type Turbo
- type TurboExpandResponse
- type TurboPage
- type TurboResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BssParam ¶
type BssParam struct { // The number of cycles for prepaid. // + minimum: 1 // + maximum: 11 PeriodNum int `json:"period_num" required:"true"` // The prepaid type. // + 2: month // + 3: year PeriodType int `json:"period_type" require:"true"` // Whether to automatically renew. // + 0: manual renew. // + 1: automatic renew. IsAutoRenew *int `json:"is_auto_renew,omitempty"` // Whether to pay automatically. // + 0: manual payment. // + 1: automatic payment. IsAutoPay *int `json:"is_auto_pay,omitempty"` }
BssParam is an object that represents the prepaid configuration.
type BssParamExtend ¶
type BssParamExtend struct { // Whether to pay automatically. // + 0: manual payment. // + 1: automatic payment. IsAutoPay *int `json:"is_auto_pay,omitempty"` }
BssParamExtend is an object that represents the payment detail.
type CreateOpts ¶
type CreateOpts struct { Share `json:"share" required:"share"` // The configuration of pre-paid billing mode. BssParam *BssParam `json:"bss_param,omitempty"` }Share
CreateOpts is the structure used to create a new SFS Turbo resource.
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 {
}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 response body and error from a Delete request.
func Delete ¶
func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)
Delete will delete an existing SFS Trubo 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 {
}ExpandOptsBuilder allows extensions to add additional parameters to the Expand request.
type ExpandResult ¶
type ExpandResult struct {
golangsdk.ErrResult
}
ExpandResult contains the response body and error from a Expand request.
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.
func (ExpandResult) Extract ¶
func (r ExpandResult) Extract() (*TurboExpandResponse, error)
Extract will get the Turbo expand response from the ExpandResult
type ExtendOpts ¶
type ExtendOpts struct { // Specifies the post-expansion capacity (GB) of the shared file system. NewSize int `json:"new_size" required:"true"` // The configuration of pre-paid billing mode. BssParam *BssParamExtend `json:"bss_param,omitempty"` }
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult contains the response body and error from a Get request.
type ListOpts ¶
type ListOpts struct { // 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"` }
ListOpts holds options for listing Volumes. It is passed to the volumes.List function.
func (ListOpts) ToVolumeListQuery ¶
ToVolumeListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
type Metadata ¶
type Metadata struct { ExpandType string `json:"expand_type,omitempty"` CryptKeyID string `json:"crypt_key_id,omitempty"` DedicatedFlavor string `json:"dedicated_flavor,omitempty"` MasterDedicatedHostID string `json:"master_dedicated_host_id,omitempty"` SlaveDedicatedHostID string `json:"slave_dedicated_host_id,omitempty"` DedicatedStorageID string `json:"dedicated_storage_id,omitempty"` }
Metadata specifies the metadata information
type PagedList ¶
type PagedList struct { Count int `json:"count"` }
func ListPage ¶
func ListPage(client *golangsdk.ServiceClient, opts ListOptsBuilder) (*PagedList, error)
ListPage returns one page limited by the conditions provided in Opts.
type Share ¶
type Share struct { string `json:"name" required:"true"` ShareProto string `json:"share_proto,omitempty"` ShareType string `json:"share_type" required:"true"` Size int `json:"size" required:"true"` AvailabilityZone string `json:"availability_zone" required:"true"` VpcID string `json:"vpc_id" required:"true"` SubnetID string `json:"subnet_id" required:"true"` SecurityGroupID string `json:"security_group_id" required:"true"` EnterpriseProjectId string `json:"enterprise_project_id,omitempty"` BackupID string `json:"backup_id,omitempty"` Description string `json:"description,omitempty"` Metadata Metadata `json:"metadata,omitempty"` }Name
CreateOpts contains the options for create an SFS Turbo. This object is passed to shares.Create().
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"` ShareProto string `json:"share_proto"` 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 avaliable 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 time.Time `json:"-"` // The enterprise project ID EnterpriseProjectId string `json:"enterprise_project_id"` }
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.
func List ¶
List returns a Pager which allows you to iterate over a collection of SFS Turbo resources.
func (*Turbo) UnmarshalJSON ¶
type TurboExpandResponse ¶
type TurboPage ¶
type TurboPage struct {
pagination.LinkedPageBase
}
TurboPage is the page returned by a pager when traversing over a collection of Shares.
func (TurboPage) NextPageURL ¶
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 { // The ID of the SFS Turbo file system. ID string `json:"id"` // The name of the SFS Turbo file system. Name string `json:"name"` // The status of the SFS Turbo file system. Status string `json:"status"` // The order ID. OrderId string `json:"orderId"` }
TurboResponse contains the information of creating response