gce

package
v0.0.0-...-eff70b3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package gce is a generated protocol buffer package.

It is generated from these files:

github.com/google/cloudprober/targets/gce/config.proto

It has these top-level messages:

TargetsConf
Instances
ForwardingRules
GlobalOptions

Package gce implements Google Compute Engine (GCE) targets for Cloudprober.

It currently supports following GCE targets:

Instances
Forwarding Rules (only regional currently)

Targets are configured through a config file, based on the protobuf defined in the config.proto file in the same directory. Example config:

All instances matching a certain regex:

targets {
  gce_targets {
    instances {}
  }
  regex: "ig-proxy-.*"
}

Public IP of all instances matching a certain regex:

targets {
  gce_targets {
    instances {
      public_ip: true
    }
  }
  regex: "ig-proxy-.*"
}

All forwarding rules in the local region:

targets {
  gce_targets {
    forwarding_rules {}
  }
}

Index

Constants

View Source
const Default_GlobalOptions_ReEvalSec int32 = 900
View Source
const Default_Instances_NetworkInterface_Index int32 = 0
View Source
const Default_Instances_UseDnsToResolve bool = false

Variables

View Source
var Instances_NetworkInterface_IPType_name = map[int32]string{
	0: "PRIVATE",
	1: "PUBLIC",
	2: "ALIAS",
}
View Source
var Instances_NetworkInterface_IPType_value = map[string]int32{
	"PRIVATE": 0,
	"PUBLIC":  1,
	"ALIAS":   2,
}

Functions

This section is empty.

Types

type ForwardingRules

type ForwardingRules struct {
	XXX_unrecognized []byte `json:"-"`
}

Represents GCE forwarding rules

func (*ForwardingRules) Descriptor

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

func (*ForwardingRules) ProtoMessage

func (*ForwardingRules) ProtoMessage()

func (*ForwardingRules) Reset

func (m *ForwardingRules) Reset()

func (*ForwardingRules) String

func (m *ForwardingRules) String() string

type GlobalOptions

type GlobalOptions struct {
	// How often targets should be evaluated/expanded
	ReEvalSec        *int32 `protobuf:"varint,1,opt,name=re_eval_sec,json=reEvalSec,def=900" json:"re_eval_sec,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

Global GCE targets options. These options are independent of the per-probe targets which are defined by the "GCETargets" type above.

func (*GlobalOptions) Descriptor

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

func (*GlobalOptions) GetReEvalSec

func (m *GlobalOptions) GetReEvalSec() int32

func (*GlobalOptions) ProtoMessage

func (*GlobalOptions) ProtoMessage()

func (*GlobalOptions) Reset

func (m *GlobalOptions) Reset()

func (*GlobalOptions) String

func (m *GlobalOptions) String() string

type Instances

type Instances struct {
	// Use DNS to resolve target names (instances). If set to false (default),
	// IP addresses specified in the compute.Instance resource is used. If set
	// to true all the other resolving options are ignored.
	UseDnsToResolve  *bool                       `protobuf:"varint,1,opt,name=use_dns_to_resolve,json=useDnsToResolve,def=0" json:"use_dns_to_resolve,omitempty"`
	NetworkInterface *Instances_NetworkInterface `protobuf:"bytes,2,opt,name=network_interface,json=networkInterface" json:"network_interface,omitempty"`
	XXX_unrecognized []byte                      `json:"-"`
}

Represents GCE instances

func (*Instances) Descriptor

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

func (*Instances) GetNetworkInterface

func (m *Instances) GetNetworkInterface() *Instances_NetworkInterface

func (*Instances) GetUseDnsToResolve

func (m *Instances) GetUseDnsToResolve() bool

func (*Instances) ProtoMessage

func (*Instances) ProtoMessage()

func (*Instances) Reset

func (m *Instances) Reset()

func (*Instances) String

func (m *Instances) String() string

type Instances_NetworkInterface

type Instances_NetworkInterface struct {
	Index            *int32                             `protobuf:"varint,1,opt,name=index,def=0" json:"index,omitempty"`
	IpType           *Instances_NetworkInterface_IPType `` /* 142-byte string literal not displayed */
	XXX_unrecognized []byte                             `json:"-"`
}

Get the IP address from Network Interface

func (*Instances_NetworkInterface) Descriptor

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

func (*Instances_NetworkInterface) GetIndex

func (m *Instances_NetworkInterface) GetIndex() int32

func (*Instances_NetworkInterface) GetIpType

func (*Instances_NetworkInterface) ProtoMessage

func (*Instances_NetworkInterface) ProtoMessage()

func (*Instances_NetworkInterface) Reset

func (m *Instances_NetworkInterface) Reset()

func (*Instances_NetworkInterface) String

func (m *Instances_NetworkInterface) String() string

type Instances_NetworkInterface_IPType

type Instances_NetworkInterface_IPType int32
const (
	// Private IP address.
	Instances_NetworkInterface_PRIVATE Instances_NetworkInterface_IPType = 0
	// IP address of the first access config.
	Instances_NetworkInterface_PUBLIC Instances_NetworkInterface_IPType = 1
	// First IP address from the first Alias IP range. For example, for
	// alias IP range "192.168.12.0/24", 192.168.12.0 will be returned.
	Instances_NetworkInterface_ALIAS Instances_NetworkInterface_IPType = 2
)
const Default_Instances_NetworkInterface_IpType Instances_NetworkInterface_IPType = Instances_NetworkInterface_PRIVATE

func (Instances_NetworkInterface_IPType) Enum

func (Instances_NetworkInterface_IPType) EnumDescriptor

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

func (Instances_NetworkInterface_IPType) String

func (*Instances_NetworkInterface_IPType) UnmarshalJSON

func (x *Instances_NetworkInterface_IPType) UnmarshalJSON(data []byte) error

type Targets

type Targets interface {
	// List produces list of targets.
	List() []string
	// Resolve, given a target name and IP Version will return the IP address for
	// that target.
	Resolve(name string, ipVer int) (net.IP, error)
}

Targets are able to list and resolve targets with their List and Resolve methods. A single instance of Targets represents a specific listing method --- if multiple sets of resources need to be listed/resolved, a separate instance of Targets will be needed.

func New

func New(conf *TargetsConf, optsProto *GlobalOptions, res *dnsRes.Resolver, log *logger.Logger) (t Targets, err error)

New is a helper function to unpack a Targets proto into a Targets interface.

type TargetsConf

type TargetsConf struct {
	// If running on GCE, this defaults to the local project.
	Project *string `protobuf:"bytes,1,opt,name=project" json:"project,omitempty"`
	// Types that are valid to be assigned to Type:
	//	*TargetsConf_Instances
	//	*TargetsConf_ForwardingRules
	Type             isTargetsConf_Type `protobuf_oneof:"type"`
	XXX_unrecognized []byte             `json:"-"`
}

TargetsConf represents GCE targets, e.g. instances, forwarding rules etc.

func (*TargetsConf) Descriptor

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

func (*TargetsConf) GetForwardingRules

func (m *TargetsConf) GetForwardingRules() *ForwardingRules

func (*TargetsConf) GetInstances

func (m *TargetsConf) GetInstances() *Instances

func (*TargetsConf) GetProject

func (m *TargetsConf) GetProject() string

func (*TargetsConf) GetType

func (m *TargetsConf) GetType() isTargetsConf_Type

func (*TargetsConf) ProtoMessage

func (*TargetsConf) ProtoMessage()

func (*TargetsConf) Reset

func (m *TargetsConf) Reset()

func (*TargetsConf) String

func (m *TargetsConf) String() string

func (*TargetsConf) XXX_OneofFuncs

func (*TargetsConf) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type TargetsConf_ForwardingRules

type TargetsConf_ForwardingRules struct {
	ForwardingRules *ForwardingRules `protobuf:"bytes,3,opt,name=forwarding_rules,json=forwardingRules,oneof"`
}

type TargetsConf_Instances

type TargetsConf_Instances struct {
	Instances *Instances `protobuf:"bytes,2,opt,name=instances,oneof"`
}

Jump to

Keyboard shortcuts

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