gcp

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package gcp implements a GCP (Google Compute Platform) resources provider for ResourceDiscovery server.

See ResourceTypes variable for the list of supported resource types.

GCP provider is configured through a protobuf based config file (proto/config.proto). Example config:

{
	project_id: 'test-project-1'
	project_id: 'test-project-2'
	gce_instances {}
}

Index

Constants

View Source
const DefaultProviderID = "gcp"

DefaultProviderID is the povider id to use for this provider if a provider id is not configured explicitly.

Variables

View Source
var ForwardingRulesFilters = struct {
	RegexFilterKeys []string
	LabelsFilter    bool
}{
	[]string{"name", "region"},
	false,
}

ForwardingRulesFilters defines filters supported by the forwarding_rules resource type.

 Example:
 filter {
	 key: "name"
	 value: "cloudprober.*"
 }
View Source
var GCEInstancesFilters = struct {
	RegexFilterKeys []string
	LabelsFilter    bool
}{
	[]string{"name"},
	true,
}

GCEInstancesFilters defines filters supported by the gce_instances resource type.

 Example:
 filter {
	 key: "name"
	 value: "cloudprober.*"
 }
 filter {
	 key: "labels.app"
	 value: "service-a"
 }
View Source
var PubSubFilters = struct {
	RegexFilterKeys    []string
	FreshnessFilterKey string
}{
	[]string{"subscription"},
	"updated_within",
}

PubSubFilters defines filters supported by the pubsub_messages resource type.

 Example:
 filter {
	 key: "subscription"
	 value: "sub1.*"
 }
 filter {
	 key: "updated_within"
	 value: "5m"
 }
View Source
var ResourceTypes = struct {
	GCEInstances, ForwardingRules, RTCVariables, PubsubMessages string
}{
	"gce_instances",
	"forwarding_rules",
	"rtc_variables",
	"pubsub_messages",
}

ResourceTypes declares resource types supported by the GCP provider. Note that "rtc_variables" resource type is deprecated now and will soon be removed.

Functions

func DefaultProviderConfig

func DefaultProviderConfig(projects []string, resTypes map[string]string, reEvalSec int, apiVersion string) *serverconfigpb.Provider

DefaultProviderConfig is a convenience function that builds and returns a basic GCP provider config based on the given parameters.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements a GCP provider for a ResourceDiscovery server.

func New

New creates a GCP provider for RDS server, based on the provided config.

func (*Provider) ListResources

func (p *Provider) ListResources(req *pb.ListResourcesRequest) (*pb.ListResourcesResponse, error)

ListResources returns the list of resources based on the given request.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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