Help us shape the future of Go! Take the 2026 Go Developer Survey

vaults

package
v0.5.21 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssociateResourcesOpts added in v0.2.5

type AssociateResourcesOpts struct {
	Resources []ResourceCreate `json:"resources"`
}

func (AssociateResourcesOpts) ToAssociateResourcesMap added in v0.2.5

func (opts AssociateResourcesOpts) ToAssociateResourcesMap() (map[string]interface{}, error)

type AssociateResourcesOptsBuilder added in v0.2.5

type AssociateResourcesOptsBuilder interface {
	ToAssociateResourcesMap() (map[string]interface{}, error)
}

type AssociateResourcesResult added in v0.2.5

type AssociateResourcesResult struct {
	golangsdk.Result
}

func AssociateResources added in v0.2.5

func AssociateResources(client *golangsdk.ServiceClient, vaultID string, opts AssociateResourcesOptsBuilder) (r AssociateResourcesResult)

func (AssociateResourcesResult) Extract added in v0.2.5

func (r AssociateResourcesResult) Extract() ([]string, error)

type Billing

type Billing struct {
	Allocated       int    `json:"allocated"`
	ChargingMode    string `json:"charging_mode"`
	CloudType       string `json:"cloud_type"`
	ConsistentLevel string `json:"consistent_level"`
	ObjectType      string `json:"object_type"`
	OrderID         string `json:"order_id"`
	ProductID       string `json:"product_id"`
	ProtectType     string `json:"protect_type"`
	Size            int    `json:"size"`
	SpecCode        string `json:"spec_code"`
	Status          string `json:"status"`
	StorageUnit     string `json:"storage_unit"`
	Used            int    `json:"used"`
	FrozenScene     string `json:"frozen_scene"`
}

type BillingCreate

type BillingCreate struct {
	// Cloud platform. Enumeration values:
	//    public
	//    hybrid
	CloudType string `json:"cloud_type,omitempty"`
	// Backup specifications. The default value is `crash_consistent`
	ConsistentLevel string `json:"consistent_level"`
	// Object type
	ObjectType string `json:"object_type"`
	// Operation type. Enumeration values:
	//    backup
	//    replication
	ProtectType string `json:"protect_type"`
	// Capacity, in GB. Minimum: `1`. Maximum: `10485760`
	Size int `json:"size"`
	// Billing mode. Possible values are `post_paid` (pay-per-use) or `pre_paid` (yearly/monthly packages).
	// The value defaults to post_paid.
	ChargingMode string `json:"charging_mode,omitempty"`
	// Package type. This parameter is mandatory if charging_mode is set to pre_paid.
	// Possible values are `year` (yearly) or `month`(monthly).
	PeriodType string `json:"period_type,omitempty"`
	// Required duration for the package. This parameter is mandatory if charging_mode is set to `pre_paid`.
	PeriodNum int `json:"period_num,omitempty"`
	// Whether to automatically renew the subscription after expiration. By default, it is not renewed.
	IsAutoRenew bool `json:"is_auto_renew,omitempty"`
	// Whether the fee is automatically deducted from the customer's account balance after an order is submitted.
	// The non-automatic payment mode is used by default.
	IsAutoPay bool `json:"is_auto_pay,omitempty"`
	// Redirection URL
	ConsoleURL string `json:"console_url,omitempty"`
	// Extended information for creating a vault
	ExtraInfo *BillingCreateExtraInfo `json:"extra_info,omitempty"`
}

type BillingCreateExtraInfo

type BillingCreateExtraInfo struct {
	// ID of the application for creating vaults in combination.
	// This parameter is mandatory when creating vaults in combination.
	CombinedOrderID string `json:"combined_order_id,omitempty"`
	// Number of items in the application for creating vaults in the combination mode.
	// This parameter is mandatory when creating vaults in the combination mode.
	CombinedOrderECSNum int `json:"combined_order_ecs_num,omitempty"`
}

type BillingUpdate

type BillingUpdate struct {
	Size int `json:"size,omitempty"`
}

type BindPolicyOpts added in v0.2.5

type BindPolicyOpts struct {
	PolicyID string `json:"policy_id"`
}

func (BindPolicyOpts) ToBindPolicyMap added in v0.2.5

func (opts BindPolicyOpts) ToBindPolicyMap() (map[string]interface{}, error)

type BindPolicyOptsBuilder added in v0.2.5

type BindPolicyOptsBuilder interface {
	ToBindPolicyMap() (map[string]interface{}, error)
}

type BindPolicyResult added in v0.2.5

type BindPolicyResult struct {
	golangsdk.Result
}

func BindPolicy added in v0.2.5

func BindPolicy(client *golangsdk.ServiceClient, vaultID string, opts BindPolicyOptsBuilder) (r BindPolicyResult)

func (BindPolicyResult) Extract added in v0.2.5

func (r BindPolicyResult) Extract() (*PolicyBinding, error)

type CreateOpts

type CreateOpts struct {
	// Backup policy ID. If the value of this parameter is missing,
	// automatic backup is not performed.
	BackupPolicyID string `json:"backup_policy_id,omitempty"`
	// Parameter information for billing creation
	Billing *BillingCreate `json:"billing"`
	// User-defined vault description
	Description string `json:"description,omitempty"`
	// Vault name
	Name string `json:"name"`
	// Associated resources. Set this parameter to [] if no resources are associated when creating a vault.
	Resources []ResourceCreate `json:"resources"`
	// Tags - Tag list.
	// This list cannot be an empty list.
	// The list can contain up to 10 keys.
	// Keys in this list must be unique.
	Tags []tags.ResourceTag `json:"tags,omitempty"`
	// Enterprise project ID. The default value is 0.
	EnterpriseProjectID string `json:"enterprise_project_id,omitempty"`
	// Whether automatic association is supported
	AutoBind bool `json:"auto_bind,omitempty"`
	// Rules for automatic association
	BindRules *VaultBindRules `json:"bind_rules,omitempty"`
	// Whether to automatically expand the vault capacity.
	// Only pay-per-use vaults support this function.
	AutoExpand bool `json:"auto_expand,omitempty"`
}

func (CreateOpts) ToVaultCreateMap

func (opts CreateOpts) ToVaultCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder

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

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

func (CreateResult) Extract

func (r CreateResult) Extract() (*Vault, error)

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

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

type DissociateResourcesOpts added in v0.2.5

type DissociateResourcesOpts struct {
	ResourceIDs []string `json:"resource_ids"`
}

func (DissociateResourcesOpts) ToDissociateResourcesMap added in v0.2.5

func (opts DissociateResourcesOpts) ToDissociateResourcesMap() (map[string]interface{}, error)

type DissociateResourcesOptsBuilder added in v0.2.5

type DissociateResourcesOptsBuilder interface {
	ToDissociateResourcesMap() (map[string]interface{}, error)
}

type DissociateResourcesResult added in v0.2.5

type DissociateResourcesResult struct {
	golangsdk.Result
}

func DissociateResources added in v0.2.5

func DissociateResources(client *golangsdk.ServiceClient, vaultID string, opts DissociateResourcesOptsBuilder) (r DissociateResourcesResult)

func (DissociateResourcesResult) Extract added in v0.2.5

func (r DissociateResourcesResult) Extract() ([]string, error)

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

func (GetResult) Extract

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

type PolicyBinding added in v0.2.5

type PolicyBinding struct {
	VaultID  string `json:"vault_id"`
	PolicyID string `json:"policy_id"`
}

type ResourceCreate

type ResourceCreate struct {
	// ID of the resource to be backed up
	ID string `json:"id"`
	// Type of the resource to be backed up.
	// Possible values are `OS::Nova::Server` and `OS::Cinder::Volume`
	Type string `json:"type"`
	// Resource name
	Name string `json:"name,omitempty"`
	// Extra information of the resource
	ExtraInfo *ResourceExtraInfo `json:"extra_info,omitempty"`
}

type ResourceExtraInfo

type ResourceExtraInfo struct {
	// ID of the disk that is excluded from the backup.
	// This parameter is used only when there are VM disk backups.
	ExcludeVolumes []string `json:"exclude_volumes,omitempty"`
	// Disk to be backed up
	IncludeVolumes []ResourceExtraInfoIncludeVolumes `json:"include_volumes,omitempty"`
}

type ResourceExtraInfoIncludeVolumes

type ResourceExtraInfoIncludeVolumes struct {
	// EVS disk ID. Only UUID is supported.
	ID string `json:"id"`
	// OS type
	OSVersion string `json:"os_version,omitempty"`
}

type ResourceResp

type ResourceResp struct {
	ExtraInfo     ResourceExtraInfo `json:"extra_info"`
	ID            string            `json:"id"`
	Name          string            `json:"name"`
	ProtectStatus string            `json:"protect_status"`
	Size          int               `json:"size"`
	Type          string            `json:"type"`
	BackupSize    int               `json:"backup_size"`
	BackupCount   int               `json:"backup_count"`
}

type UnbindPolicyResult added in v0.2.5

type UnbindPolicyResult struct {
	golangsdk.Result
}

func UnbindPolicy added in v0.2.5

func UnbindPolicy(client *golangsdk.ServiceClient, vaultID string, opts BindPolicyOptsBuilder) (r UnbindPolicyResult)

func (UnbindPolicyResult) Extract added in v0.2.5

func (r UnbindPolicyResult) Extract() (*PolicyBinding, error)

type UpdateOpts

type UpdateOpts struct {
	Billing    *BillingUpdate  `json:"billing,omitempty"`
	Name       string          `json:"name,omitempty"`
	AutoBind   *bool           `json:"auto_bind,omitempty"`
	BindRules  *VaultBindRules `json:"bind_rules,omitempty"`
	AutoExpand *bool           `json:"auto_expand,omitempty"`
}

func (UpdateOpts) ToVaultUpdateMap

func (opts UpdateOpts) ToVaultUpdateMap() (map[string]interface{}, error)

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToVaultUpdateMap() (map[string]interface{}, error)
}

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

func (UpdateResult) Extract

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

type Vault

type Vault struct {
	ID          string             `json:"id"`
	Name        string             `json:"name"`
	Billing     Billing            `json:"billing"`
	Description string             `json:"description"`
	ProjectID   string             `json:"project_id"`
	ProviderID  string             `json:"provider_id"`
	Resources   []ResourceResp     `json:"resources"`
	Tags        []tags.ResourceTag `json:"tags"`

	EnterpriseProjectID string `json:"enterprise_project_id"`

	AutoBind   bool           `json:"auto_bind"`
	BindRules  VaultBindRules `json:"bind_rules"`
	UserID     string         `json:"user_id"`
	CreatedAt  string         `json:"created_at"`
	AutoExpand bool           `json:"auto_expand"`
}

type VaultBindRules

type VaultBindRules struct {
	// Filters automatically associated resources by tag.
	Tags []tags.ResourceTag `json:"tags,omitempty"`
}

Jump to

Keyboard shortcuts

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