policies

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type CreateOpts

type CreateOpts struct {
	// Name specifies the policy name. The value consists of 1 to 64 characters
	// and can contain only letters, digits, underscores (_), and hyphens (-).
	Name string `json:"name"`
	// OperationDefinition - scheduling configuration
	OperationDefinition *PolicyODCreate `json:"operation_definition"`
	// Enabled - whether to enable the policy, default: true
	Enabled *bool `json:"enabled,omitempty"`
	// OperationType - policy type
	OperationType OperationType `json:"operation_type"`
	// Trigger - time rule for the policy execution
	Trigger *Trigger `json:"trigger"`
}

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)

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)

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() (*Policy, error)

type ListOpts

type ListOpts struct {
	OperationType OperationType `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 OperationType

type OperationType string

OperationType is a Policy type. One of `backup` and `replication`.

type Policy

type Policy struct {
	ID                  string                 `json:"id"`
	Name                string                 `json:"name"`
	Enabled             bool                   `json:"enabled"`
	OperationDefinition *PolicyODCreate        `json:"operation_definition"`
	OperationType       OperationType          `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"`
	WeekBackups           int    `json:"week_backups"`
	YearBackups           int    `json:"year_backups"`
	MonthBackups          int    `json:"month_backups"`
	MaxBackups            int    `json:"max_backups,omitempty"`
	RetentionDurationDays int    `json:"retention_duration_days,omitempty"`
	Timezone              string `json:"timezone,omitempty"`
}

PolicyODCreate is policy operation definition see https://docs.otc.t-systems.com/en-us/api/cbr/CreatePolicy.html#CreatePolicy__request_PolicyoODCreate

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 {
	Properties PolicyTriggerPropertiesResp `json:"properties"`
}

type Trigger

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

type TriggerProperties

type TriggerProperties struct {
	// Pattern - Scheduling policy of the scheduler. Can't be empty.
	Pattern []string `json:"pattern"`
}

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)

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