targets

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0, Apache-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HostErrorFormat     = fmt.Errorf(`should in format [<group>]\n<hostname> ansible_host=<ip>`)
	HostErrorNotSame    = fmt.Errorf("hostname not same with inventory file name")
	HostErrorNoIp       = fmt.Errorf("no ip address")
	HostErrorNoRole     = fmt.Errorf("no group")
	HostErrorNoHostname = fmt.Errorf("no hostname")
	HostErrorReserved   = fmt.Errorf("hostname reservced")
	HostnameReserved    = pkgs.Strings([]string{
		"0local", "all",
	})
)
View Source
var (
	KeyErrorNoName = fmt.Errorf("no name specified")
)
View Source
var State_name = map[int32]string{
	0: "CREATED",
	1: "DEPLOYED",
	2: "RUNNING",
	3: "MAINTAINENCE",
	4: "UPDATED",
	5: "DELETED",
}
View Source
var State_value = map[string]int32{
	"CREATED":      0,
	"DEPLOYED":     1,
	"RUNNING":      2,
	"MAINTAINENCE": 3,
	"UPDATED":      4,
	"DELETED":      5,
}

Functions

func AppendTarget

func AppendTarget(w tables.Table, target *Target)

func Commands

func Commands(getContext func() context.Context,
	getClientConn func() *grpc.ClientConn) (
	commands []*cobra.Command)

func DisplayTarget

func DisplayTarget(target *Target)

func FindGroups

func FindGroups(target string) (groups []string)

func LoadHostnames

func LoadHostnames(target string) (hostnames []string)

func NewTargetTable

func NewTargetTable() tables.Table

func Register

func Register(s *grpc.Server)

func RegisterTargetAdminServer

func RegisterTargetAdminServer(s *grpc.Server, srv TargetAdminServer)

Types

type CreateRequest

type CreateRequest struct {
	Name                 string            `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Release              *releases.Release `protobuf:"bytes,2,opt,name=release,proto3" json:"release,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*CreateRequest) Descriptor

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

func (*CreateRequest) GetName

func (m *CreateRequest) GetName() string

func (*CreateRequest) GetRelease

func (m *CreateRequest) GetRelease() *releases.Release

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) Reset

func (m *CreateRequest) Reset()

func (*CreateRequest) String

func (m *CreateRequest) String() string

func (*CreateRequest) XXX_DiscardUnknown

func (m *CreateRequest) XXX_DiscardUnknown()

func (*CreateRequest) XXX_Marshal

func (m *CreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateRequest) XXX_Merge

func (m *CreateRequest) XXX_Merge(src proto.Message)

func (*CreateRequest) XXX_Size

func (m *CreateRequest) XXX_Size() int

func (*CreateRequest) XXX_Unmarshal

func (m *CreateRequest) XXX_Unmarshal(b []byte) error

type DeleteRequest

type DeleteRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeleteRequest) Descriptor

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

func (*DeleteRequest) GetName

func (m *DeleteRequest) GetName() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) Reset

func (m *DeleteRequest) Reset()

func (*DeleteRequest) String

func (m *DeleteRequest) String() string

func (*DeleteRequest) XXX_DiscardUnknown

func (m *DeleteRequest) XXX_DiscardUnknown()

func (*DeleteRequest) XXX_Marshal

func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteRequest) XXX_Merge

func (m *DeleteRequest) XXX_Merge(src proto.Message)

func (*DeleteRequest) XXX_Size

func (m *DeleteRequest) XXX_Size() int

func (*DeleteRequest) XXX_Unmarshal

func (m *DeleteRequest) XXX_Unmarshal(b []byte) error

type DeployRequest

type DeployRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeployRequest) Descriptor

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

func (*DeployRequest) GetName

func (m *DeployRequest) GetName() string

func (*DeployRequest) ProtoMessage

func (*DeployRequest) ProtoMessage()

func (*DeployRequest) Reset

func (m *DeployRequest) Reset()

func (*DeployRequest) String

func (m *DeployRequest) String() string

func (*DeployRequest) XXX_DiscardUnknown

func (m *DeployRequest) XXX_DiscardUnknown()

func (*DeployRequest) XXX_Marshal

func (m *DeployRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeployRequest) XXX_Merge

func (m *DeployRequest) XXX_Merge(src proto.Message)

func (*DeployRequest) XXX_Size

func (m *DeployRequest) XXX_Size() int

func (*DeployRequest) XXX_Unmarshal

func (m *DeployRequest) XXX_Unmarshal(b []byte) error

type Env

type Env struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Value                string   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Env) Descriptor

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

func (*Env) GetName

func (m *Env) GetName() string

func (*Env) GetValue

func (m *Env) GetValue() string

func (*Env) ProtoMessage

func (*Env) ProtoMessage()

func (*Env) Reset

func (m *Env) Reset()

func (*Env) String

func (m *Env) String() string

func (*Env) XXX_DiscardUnknown

func (m *Env) XXX_DiscardUnknown()

func (*Env) XXX_Marshal

func (m *Env) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Env) XXX_Merge

func (m *Env) XXX_Merge(src proto.Message)

func (*Env) XXX_Size

func (m *Env) XXX_Size() int

func (*Env) XXX_Unmarshal

func (m *Env) XXX_Unmarshal(b []byte) error

type EnvsRequest

type EnvsRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Env                  *Env     `protobuf:"bytes,2,opt,name=env,proto3" json:"env,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*EnvsRequest) Descriptor

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

func (*EnvsRequest) GetEnv

func (m *EnvsRequest) GetEnv() *Env

func (*EnvsRequest) GetName

func (m *EnvsRequest) GetName() string

func (*EnvsRequest) ProtoMessage

func (*EnvsRequest) ProtoMessage()

func (*EnvsRequest) Reset

func (m *EnvsRequest) Reset()

func (*EnvsRequest) String

func (m *EnvsRequest) String() string

func (*EnvsRequest) XXX_DiscardUnknown

func (m *EnvsRequest) XXX_DiscardUnknown()

func (*EnvsRequest) XXX_Marshal

func (m *EnvsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EnvsRequest) XXX_Merge

func (m *EnvsRequest) XXX_Merge(src proto.Message)

func (*EnvsRequest) XXX_Size

func (m *EnvsRequest) XXX_Size() int

func (*EnvsRequest) XXX_Unmarshal

func (m *EnvsRequest) XXX_Unmarshal(b []byte) error

type GetRequest

type GetRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetRequest) Descriptor

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

func (*GetRequest) GetName

func (m *GetRequest) GetName() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) XXX_DiscardUnknown

func (m *GetRequest) XXX_DiscardUnknown()

func (*GetRequest) XXX_Marshal

func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetRequest) XXX_Merge

func (m *GetRequest) XXX_Merge(src proto.Message)

func (*GetRequest) XXX_Size

func (m *GetRequest) XXX_Size() int

func (*GetRequest) XXX_Unmarshal

func (m *GetRequest) XXX_Unmarshal(b []byte) error

type Host

type Host struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Group                string   `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"`
	Ip                   string   `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Host) Descriptor

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

func (*Host) GetGroup

func (m *Host) GetGroup() string

func (*Host) GetIp

func (m *Host) GetIp() string

func (*Host) GetName

func (m *Host) GetName() string

func (*Host) Load

func (host *Host) Load(target string, name string) (err error)

func (*Host) ProtoMessage

func (*Host) ProtoMessage()

func (*Host) Reset

func (m *Host) Reset()

func (*Host) Save

func (host *Host) Save(target string) (err error)

func (*Host) String

func (m *Host) String() string

func (*Host) XXX_DiscardUnknown

func (m *Host) XXX_DiscardUnknown()

func (*Host) XXX_Marshal

func (m *Host) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Host) XXX_Merge

func (m *Host) XXX_Merge(src proto.Message)

func (*Host) XXX_Size

func (m *Host) XXX_Size() int

func (*Host) XXX_Unmarshal

func (m *Host) XXX_Unmarshal(b []byte) error

type HostsRequest

type HostsRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Host                 *Host    `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HostsRequest) Descriptor

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

func (*HostsRequest) GetHost

func (m *HostsRequest) GetHost() *Host

func (*HostsRequest) GetName

func (m *HostsRequest) GetName() string

func (*HostsRequest) ProtoMessage

func (*HostsRequest) ProtoMessage()

func (*HostsRequest) Reset

func (m *HostsRequest) Reset()

func (*HostsRequest) String

func (m *HostsRequest) String() string

func (*HostsRequest) XXX_DiscardUnknown

func (m *HostsRequest) XXX_DiscardUnknown()

func (*HostsRequest) XXX_Marshal

func (m *HostsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HostsRequest) XXX_Merge

func (m *HostsRequest) XXX_Merge(src proto.Message)

func (*HostsRequest) XXX_Size

func (m *HostsRequest) XXX_Size() int

func (*HostsRequest) XXX_Unmarshal

func (m *HostsRequest) XXX_Unmarshal(b []byte) error

type Key

type Key struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Private              string   `protobuf:"bytes,2,opt,name=private,proto3" json:"private,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Key) Descriptor

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

func (*Key) GetName

func (m *Key) GetName() string

func (*Key) GetPrivate

func (m *Key) GetPrivate() string

func (*Key) Load

func (key *Key) Load(target, name string) (err error)

func (*Key) ProtoMessage

func (*Key) ProtoMessage()

func (*Key) Remove

func (key *Key) Remove(target string) (err error)

func (*Key) Reset

func (m *Key) Reset()

func (*Key) Save

func (key *Key) Save(target string) (err error)

func (*Key) String

func (m *Key) String() string

func (*Key) XXX_DiscardUnknown

func (m *Key) XXX_DiscardUnknown()

func (*Key) XXX_Marshal

func (m *Key) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Key) XXX_Merge

func (m *Key) XXX_Merge(src proto.Message)

func (*Key) XXX_Size

func (m *Key) XXX_Size() int

func (*Key) XXX_Unmarshal

func (m *Key) XXX_Unmarshal(b []byte) error

type KeysRequest

type KeysRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Key                  *Key     `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*KeysRequest) Descriptor

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

func (*KeysRequest) GetKey

func (m *KeysRequest) GetKey() *Key

func (*KeysRequest) GetName

func (m *KeysRequest) GetName() string

func (*KeysRequest) ProtoMessage

func (*KeysRequest) ProtoMessage()

func (*KeysRequest) Reset

func (m *KeysRequest) Reset()

func (*KeysRequest) String

func (m *KeysRequest) String() string

func (*KeysRequest) XXX_DiscardUnknown

func (m *KeysRequest) XXX_DiscardUnknown()

func (*KeysRequest) XXX_Marshal

func (m *KeysRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KeysRequest) XXX_Merge

func (m *KeysRequest) XXX_Merge(src proto.Message)

func (*KeysRequest) XXX_Size

func (m *KeysRequest) XXX_Size() int

func (*KeysRequest) XXX_Unmarshal

func (m *KeysRequest) XXX_Unmarshal(b []byte) error

type ListRequest

type ListRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListRequest) Descriptor

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

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) Reset

func (m *ListRequest) Reset()

func (*ListRequest) String

func (m *ListRequest) String() string

func (*ListRequest) XXX_DiscardUnknown

func (m *ListRequest) XXX_DiscardUnknown()

func (*ListRequest) XXX_Marshal

func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListRequest) XXX_Merge

func (m *ListRequest) XXX_Merge(src proto.Message)

func (*ListRequest) XXX_Size

func (m *ListRequest) XXX_Size() int

func (*ListRequest) XXX_Unmarshal

func (m *ListRequest) XXX_Unmarshal(b []byte) error

type State

type State int32
const (
	State_CREATED      State = 0
	State_DEPLOYED     State = 1
	State_RUNNING      State = 2
	State_MAINTAINENCE State = 3
	State_UPDATED      State = 4
	State_DELETED      State = 5
)

func (State) EnumDescriptor

func (State) EnumDescriptor() ([]byte, []int)

func (State) String

func (x State) String() string

type Target

type Target struct {
	Name                 string            `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	State                State             `protobuf:"varint,2,opt,name=state,proto3,enum=com.github.ibm.cloudland.sca.targets.State" json:"state,omitempty"`
	Hosts                []*Host           `protobuf:"bytes,4,rep,name=hosts,proto3" json:"hosts,omitempty"`
	Release              *releases.Release `protobuf:"bytes,5,opt,name=release,proto3" json:"release,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*Target) Descriptor

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

func (*Target) GetHosts

func (m *Target) GetHosts() []*Host

func (*Target) GetName

func (m *Target) GetName() string

func (*Target) GetRelease

func (m *Target) GetRelease() *releases.Release

func (*Target) GetState

func (m *Target) GetState() State

func (*Target) ProtoMessage

func (*Target) ProtoMessage()

func (*Target) Reset

func (m *Target) Reset()

func (*Target) String

func (m *Target) String() string

func (*Target) XXX_DiscardUnknown

func (m *Target) XXX_DiscardUnknown()

func (*Target) XXX_Marshal

func (m *Target) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Target) XXX_Merge

func (m *Target) XXX_Merge(src proto.Message)

func (*Target) XXX_Size

func (m *Target) XXX_Size() int

func (*Target) XXX_Unmarshal

func (m *Target) XXX_Unmarshal(b []byte) error

type TargetAdminClient

type TargetAdminClient interface {
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*Target, error)
	Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Target, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*Target, error)
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (TargetAdmin_ListClient, error)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Target, error)
	Deploy(ctx context.Context, in *DeployRequest, opts ...grpc.CallOption) (*Target, error)
	Envs(ctx context.Context, in *EnvsRequest, opts ...grpc.CallOption) (TargetAdmin_EnvsClient, error)
	Hosts(ctx context.Context, in *HostsRequest, opts ...grpc.CallOption) (TargetAdmin_HostsClient, error)
	Keys(ctx context.Context, in *KeysRequest, opts ...grpc.CallOption) (TargetAdmin_KeysClient, error)
}

TargetAdminClient is the client API for TargetAdmin service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTargetAdminClient

func NewTargetAdminClient(cc *grpc.ClientConn) TargetAdminClient

type TargetAdminServer

TargetAdminServer is the server API for TargetAdmin service.

type TargetAdmin_EnvsClient

type TargetAdmin_EnvsClient interface {
	Recv() (*Env, error)
	grpc.ClientStream
}

type TargetAdmin_EnvsServer

type TargetAdmin_EnvsServer interface {
	Send(*Env) error
	grpc.ServerStream
}

type TargetAdmin_HostsClient

type TargetAdmin_HostsClient interface {
	Recv() (*Host, error)
	grpc.ClientStream
}

type TargetAdmin_HostsServer

type TargetAdmin_HostsServer interface {
	Send(*Host) error
	grpc.ServerStream
}

type TargetAdmin_KeysClient

type TargetAdmin_KeysClient interface {
	Recv() (*Key, error)
	grpc.ClientStream
}

type TargetAdmin_KeysServer

type TargetAdmin_KeysServer interface {
	Send(*Key) error
	grpc.ServerStream
}

type TargetAdmin_ListClient

type TargetAdmin_ListClient interface {
	Recv() (*Target, error)
	grpc.ClientStream
}

type TargetAdmin_ListServer

type TargetAdmin_ListServer interface {
	Send(*Target) error
	grpc.ServerStream
}

type UnimplementedTargetAdminServer

type UnimplementedTargetAdminServer struct {
}

UnimplementedTargetAdminServer can be embedded to have forward compatible implementations.

func (*UnimplementedTargetAdminServer) Create

func (*UnimplementedTargetAdminServer) Delete

func (*UnimplementedTargetAdminServer) Deploy

func (*UnimplementedTargetAdminServer) Envs

func (*UnimplementedTargetAdminServer) Get

func (*UnimplementedTargetAdminServer) Hosts

func (*UnimplementedTargetAdminServer) Keys

func (*UnimplementedTargetAdminServer) List

func (*UnimplementedTargetAdminServer) Update

type UpdateRequest

type UpdateRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version              string   `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UpdateRequest) Descriptor

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

func (*UpdateRequest) GetName

func (m *UpdateRequest) GetName() string

func (*UpdateRequest) GetVersion

func (m *UpdateRequest) GetVersion() string

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) Reset

func (m *UpdateRequest) Reset()

func (*UpdateRequest) String

func (m *UpdateRequest) String() string

func (*UpdateRequest) XXX_DiscardUnknown

func (m *UpdateRequest) XXX_DiscardUnknown()

func (*UpdateRequest) XXX_Marshal

func (m *UpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdateRequest) XXX_Merge

func (m *UpdateRequest) XXX_Merge(src proto.Message)

func (*UpdateRequest) XXX_Size

func (m *UpdateRequest) XXX_Size() int

func (*UpdateRequest) XXX_Unmarshal

func (m *UpdateRequest) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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