policies

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List is a method to obtain the specified CBR policy according to the vault ID or operation type. This method can also obtain all the CBR policies through the default parameter settings.

Types

type CreateOpts

type CreateOpts struct {
	Name                string          `json:"name" required:"true"`
	OperationDefinition *PolicyODCreate `json:"operation_definition" required:"true"`
	OperationType       string          `json:"operation_type" required:"true"`
	Trigger             *Trigger        `json:"trigger" required:"true"`
	Enabled             *bool           `json:"enabled,omitempty"`
}

func (CreateOpts) ToPolicyCreateMap

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

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToPolicyCreateMap() (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)

Create is a method by which to create function that create a CBR policy

func (CreateResult) Extract

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

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

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

Delete is a method to delete an existing CBR policy

type GetResult

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

func Get

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

Get is a method to obtain the specified CBR policy according to the policy ID.

func (GetResult) Extract

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

type ListOpts

type ListOpts struct {
	OperationType string `q:"operation_type"`
	VaultID       string `q:"vault_id"`
}

func (ListOpts) ToPolicyListQuery

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

type ListOptsBuilder

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

type Policy

type Policy struct {
	ID                  string                 `json:"id"`
	Name                string                 `json:"name"`
	Enabled             bool                   `json:"enabled"`
	OperationDefinition *PolicyODCreate        `json:"operation_definition"`
	OperationType       string                 `json:"operation_type"`
	Trigger             *PolicyTriggerResp     `json:"trigger"`
	AssociatedVaults    []PolicyAssociateVault `json:"associated_vaults"`
}

func ExtractPolicies

func ExtractPolicies(r pagination.Page) ([]Policy, error)

type PolicyAssociateVault

type PolicyAssociateVault struct {
	VaultID            string `json:"vault_id"`
	DestinationVaultID string `json:"destination_vault_id"`
}

type PolicyODCreate

type PolicyODCreate struct {
	DailyBackups          int    `json:"day_backups,omitempty"`
	WeekBackups           int    `json:"week_backups,omitempty"`
	YearBackups           int    `json:"year_backups,omitempty"`
	MonthBackups          int    `json:"month_backups,omitempty"`
	MaxBackups            int    `json:"max_backups,omitempty"`
	RetentionDurationDays int    `json:"retention_duration_days,omitempty"`
	Timezone              string `json:"timezone,omitempty"`
	EnableAcceleration    bool   `json:"enable_acceleration,omitempty"`
	DestinationProjectID  string `json:"destination_project_id,omitempty"`
	DestinationRegion     string `json:"destination_region,omitempty"`
}

PolicyODCreate is policy operation definition

type PolicyPage

type PolicyPage struct {
	pagination.SinglePageBase
}

type PolicyTriggerPropertiesResp

type PolicyTriggerPropertiesResp struct {
	Pattern   []string `json:"pattern"`
	StartTime string   `json:"start_time"`
}

type PolicyTriggerResp

type PolicyTriggerResp struct {
	TriggerID  string                      `json:"id"`
	Name       string                      `json:"name"`
	Type       string                      `json:"type"`
	Properties PolicyTriggerPropertiesResp `json:"properties"`
}

type Trigger

type Trigger struct {
	Properties TriggerProperties `json:"properties"  required:"true"`
}

type TriggerProperties

type TriggerProperties struct {
	Pattern []string `json:"pattern"  required:"true"`
}

type UpdateOpts

type UpdateOpts struct {
	Enabled             *bool           `json:"enabled,omitempty"`
	Name                string          `json:"name,omitempty"`
	OperationDefinition *PolicyODCreate `json:"operation_definition,omitempty"`
	Trigger             *Trigger        `json:"trigger,omitempty"`
}

func (UpdateOpts) ToPolicyUpdateMap

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

type UpdateOptsBuilder

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

Delete is a method to update an existing CBR policy

func (UpdateResult) Extract

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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