vaults

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssociateResources added in v0.2.5

func AssociateResources(client *golangsdk.ServiceClient, vaultID string, opts AssociateResourcesOpts) ([]string, error)

func Delete

func Delete(client *golangsdk.ServiceClient, id string) (err error)

func DissociateResources added in v0.2.5

func DissociateResources(client *golangsdk.ServiceClient, vaultID string, opts DissociateResourcesOpts) ([]string, error)

Types

type AssociateResourcesOpts added in v0.2.5

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

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"`
}

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"`
}

type DissociateResourcesOpts added in v0.2.5

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

type PolicyBinding added in v0.2.5

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

func BindPolicy added in v0.2.5

func BindPolicy(client *golangsdk.ServiceClient, vaultID string, opts BindPolicyOpts) (*PolicyBinding, error)

func UnbindPolicy added in v0.2.5

func UnbindPolicy(client *golangsdk.ServiceClient, vaultID string, opts BindPolicyOpts) (*PolicyBinding, error)

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 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"`
}

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"`
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*Vault, error)

func Get

func Get(client *golangsdk.ServiceClient, id string) (*Vault, error)

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOpts) (*Vault, error)

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