storagepb

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package storagepb provides storage protobuf client and server interfaces.

Package storagepb is a generated protocol buffer package.

It is generated from these files:

storage.proto

It has these top-level messages:

Group
Profile
NetBoot

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIdRequired = errors.New("Id is required")
)
View Source
var (
	ErrProfileRequired = errors.New("Group requires a Profile")
)

Functions

This section is empty.

Types

type ByReqs

type ByReqs []*Group

ByReqs defines a collection of Group structs which have a deterministic sorted order by increasing number of Requirements, then by sorted key/value strings. For example, a Group with Requirements {a:b, c:d} should be ordered after one with {a:b} and before one with {a:d, c:d}.

func (ByReqs) Len

func (groups ByReqs) Len() int

func (ByReqs) Less

func (groups ByReqs) Less(i, j int) bool

func (ByReqs) Swap

func (groups ByReqs) Swap(i, j int)

type Group

type Group struct {
	// machine readable Id
	Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	// human readable name
	Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	// Profile id
	Profile string `protobuf:"bytes,3,opt,name=profile" json:"profile,omitempty"`
	// Selectors to match machines
	Selector map[string]string `` /* 136-byte string literal not displayed */
	// JSON encoded metadata
	Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"`
}

Group selects one or more machines and matches them to a Profile.

func ParseGroup

func ParseGroup(data []byte) (*Group, error)

ParseGroup parses bytes into a Group.

func (*Group) AssertValid

func (g *Group) AssertValid() error

AssertValid validates a Group. Returns nil if there are no validation errors.

func (*Group) Copy

func (g *Group) Copy() *Group

func (*Group) Descriptor

func (*Group) Descriptor() ([]byte, []int)

func (*Group) GetId

func (m *Group) GetId() string

func (*Group) GetMetadata

func (m *Group) GetMetadata() []byte

func (*Group) GetName

func (m *Group) GetName() string

func (*Group) GetProfile

func (m *Group) GetProfile() string

func (*Group) GetSelector

func (m *Group) GetSelector() map[string]string

func (*Group) Matches

func (g *Group) Matches(labels map[string]string) bool

Matches returns true if the given labels satisfy all the selector requirements, false otherwise.

func (*Group) Normalize

func (g *Group) Normalize() error

Normalize normalizes Group selectors according to reserved selector rules which require "mac" addresses to be valid, normalized MAC addresses.

func (*Group) ProtoMessage

func (*Group) ProtoMessage()

func (*Group) Reset

func (m *Group) Reset()

func (*Group) String

func (m *Group) String() string

func (*Group) ToRichGroup

func (g *Group) ToRichGroup() (*RichGroup, error)

ToRichGroup converts a Group into a RichGroup suitable for writing and user manipulation.

type NetBoot

type NetBoot struct {
	// the URL of the kernel image
	Kernel string `protobuf:"bytes,1,opt,name=kernel" json:"kernel,omitempty"`
	// the init RAM filesystem URLs
	Initrd []string `protobuf:"bytes,2,rep,name=initrd" json:"initrd,omitempty"`
	// kernel args
	Args []string `protobuf:"bytes,4,rep,name=args" json:"args,omitempty"`
}

NetBoot describes network or PXE boot settings for a machine.

func (*NetBoot) Copy

func (b *NetBoot) Copy() *NetBoot

func (*NetBoot) Descriptor

func (*NetBoot) Descriptor() ([]byte, []int)

func (*NetBoot) GetArgs

func (m *NetBoot) GetArgs() []string

func (*NetBoot) GetInitrd

func (m *NetBoot) GetInitrd() []string

func (*NetBoot) GetKernel

func (m *NetBoot) GetKernel() string

func (*NetBoot) ProtoMessage

func (*NetBoot) ProtoMessage()

func (*NetBoot) Reset

func (m *NetBoot) Reset()

func (*NetBoot) String

func (m *NetBoot) String() string

type Profile

type Profile struct {
	// profile id
	Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	// human readable name
	Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	// ignition id
	IgnitionId string `protobuf:"bytes,3,opt,name=ignition_id,json=ignitionId" json:"ignition_id,omitempty"`
	// cloud config id
	CloudId string `protobuf:"bytes,4,opt,name=cloud_id,json=cloudId" json:"cloud_id,omitempty"`
	// support network boot / PXE
	Boot *NetBoot `protobuf:"bytes,5,opt,name=boot" json:"boot,omitempty"`
	// generic config id
	GenericId string `protobuf:"bytes,6,opt,name=generic_id,json=genericId" json:"generic_id,omitempty"`
}

Profile defines the boot and provisioning behavior of a group of machines.

func ParseProfile

func ParseProfile(data []byte) (*Profile, error)

ParseProfile parses bytes into a Profile.

func (*Profile) AssertValid

func (p *Profile) AssertValid() error

AssertValid validates a Profile. Returns nil if there are no validation errors.

func (*Profile) Copy

func (p *Profile) Copy() *Profile

func (*Profile) Descriptor

func (*Profile) Descriptor() ([]byte, []int)

func (*Profile) GetBoot

func (m *Profile) GetBoot() *NetBoot

func (*Profile) GetCloudId

func (m *Profile) GetCloudId() string

func (*Profile) GetGenericId

func (m *Profile) GetGenericId() string

func (*Profile) GetId

func (m *Profile) GetId() string

func (*Profile) GetIgnitionId

func (m *Profile) GetIgnitionId() string

func (*Profile) GetName

func (m *Profile) GetName() string

func (*Profile) ProtoMessage

func (*Profile) ProtoMessage()

func (*Profile) Reset

func (m *Profile) Reset()

func (*Profile) String

func (m *Profile) String() string

type RichGroup

type RichGroup struct {
	// machine readable Id
	Id string `json:"id,omitempty"`
	// Human readable name
	Name string `json:"name,omitempty"`
	// Profile id
	Profile string `json:"profile,omitempty"`
	// Selectors to match machines
	Selector map[string]string `json:"selector,omitempty"`
	// Metadata
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

RichGroup is a user provided Group definition.

func (*RichGroup) ToGroup

func (rg *RichGroup) ToGroup() (*Group, error)

ToGroup converts a user provided RichGroup into a Group which can be serialized as a protocol buffer.

Jump to

Keyboard shortcuts

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