openstack

package
v1.0.0-rc07 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	StatusPlanned  = "planned"
	StatusNoOp     = "no-op"
	StatusBlocked  = "blocked"
	StatusApplied  = "applied"
	StatusDeclined = "declined"
	StatusPartial  = "partial"
)
View Source
const ResultSchemaVersion = 1

Variables

This section is empty.

Functions

func IsNonRemoteBackend

func IsNonRemoteBackend(service, backend string) bool

IsNonRemoteBackend reports whether the backend needs no OpenStack cloud, container, endpoint, or credential provisioning.

func ValidateOptions

func ValidateOptions(opts Options) error

Types

type ApplyInput

type ApplyInput struct {
	ConfigPath    string
	RecoveryPath  string
	OriginalBytes []byte
	Options       Options
	Adapter       cloudopenstack.StorageAdapter
	FileSystem    FileSystem
	Validate      func(*v2.Config) error
}

type ConfigChange

type ConfigChange struct {
	Path string `json:"path" yaml:"path"`
	Old  string `json:"old" yaml:"old"`
	New  string `json:"new" yaml:"new"`
}

type FileSystem

type FileSystem interface {
	ReadFile(string) ([]byte, error)
	CheckRecoveryPath(string) error
	Backup(string, []byte) error
	WriteAtomic(string, []byte) error
	WriteRecovery(string, recoveryJournal) error
	UpdateRecovery(string, recoveryJournal) error
	RemoveRecovery(string) error
	ReadRecovery(string) (recoveryJournal, error)
}

type OSFileSystem

type OSFileSystem struct{}

func (OSFileSystem) Backup

func (OSFileSystem) Backup(path string, data []byte) error

func (OSFileSystem) CheckRecoveryPath

func (OSFileSystem) CheckRecoveryPath(path string) error

func (OSFileSystem) ReadFile

func (OSFileSystem) ReadFile(path string) ([]byte, error)

func (OSFileSystem) ReadRecovery

func (OSFileSystem) ReadRecovery(recoveryPath string) (recoveryJournal, error)

func (OSFileSystem) RemoveRecovery

func (OSFileSystem) RemoveRecovery(path string) error

func (OSFileSystem) UpdateRecovery

func (OSFileSystem) UpdateRecovery(path string, state recoveryJournal) error

func (OSFileSystem) WriteAtomic

func (OSFileSystem) WriteAtomic(path string, data []byte) error

func (OSFileSystem) WriteRecovery

func (OSFileSystem) WriteRecovery(path string, state recoveryJournal) error

type Options

type Options struct {
	Service           string
	Backend           string
	Cluster           string
	Container         string
	S3Endpoint        string
	RotateCredentials bool
}

func (Options) String

func (o Options) String() string

type PlanInput

type PlanInput struct {
	Config  *v2.Config
	Options Options
	Adapter cloudopenstack.StorageAdapter
}

type PlanOutput

type PlanOutput struct {
	Result    Result
	Preflight cloudopenstack.StoragePreflight
	// contains filtered or unexported fields
}

func Plan

func Plan(ctx context.Context, input PlanInput) (PlanOutput, error)

type RecoveryState

type RecoveryState struct {
	Path             string   `json:"path" yaml:"path"`
	CredentialType   string   `json:"credential_type" yaml:"credential_type"`
	S3Endpoint       string   `json:"s3_endpoint,omitempty" yaml:"s3_endpoint,omitempty"`
	Containers       []string `json:"containers,omitempty" yaml:"containers,omitempty"`
	Service          string   `json:"service" yaml:"service"`
	Backend          string   `json:"backend" yaml:"backend"`
	PersistenceState string   `json:"persistence_state" yaml:"persistence_state"`
}

type RemoteAction

type RemoteAction struct {
	Order    int    `json:"order" yaml:"order"`
	Action   string `json:"action" yaml:"action"`
	Resource string `json:"resource" yaml:"resource"`
	Name     string `json:"name,omitempty" yaml:"name,omitempty"`
	ID       string `json:"id,omitempty" yaml:"id,omitempty"`
	Scope    string `json:"scope,omitempty" yaml:"scope,omitempty"`
}

type Result

type Result struct {
	SchemaVersion int            `json:"schema_version" yaml:"schema_version"`
	Operation     string         `json:"operation" yaml:"operation"`
	Status        string         `json:"status" yaml:"status"`
	Service       string         `json:"service" yaml:"service"`
	Backend       string         `json:"backend" yaml:"backend"`
	Container     string         `json:"container" yaml:"container"`
	Containers    []string       `json:"containers,omitempty" yaml:"containers,omitempty"`
	S3Endpoint    string         `json:"s3_endpoint,omitempty" yaml:"s3_endpoint,omitempty"`
	Changes       []ConfigChange `json:"changes" yaml:"changes"`
	RemoteActions []RemoteAction `json:"remote_actions" yaml:"remote_actions"`
	SecretPaths   []string       `json:"secret_paths" yaml:"secret_paths"`
	Warnings      []string       `json:"warnings,omitempty" yaml:"warnings,omitempty"`
	Recovery      *RecoveryState `json:"recovery,omitempty" yaml:"recovery,omitempty"`
}

func Apply

func Apply(ctx context.Context, input ApplyInput) (Result, error)

Jump to

Keyboard shortcuts

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