policies

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 Delete

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

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

type ListOpts

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

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 Create

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

func Get

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

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]Policy, error)

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOpts) (*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 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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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