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 ¶
const DefaultProviderID = "gcp"
DefaultProviderID is the povider id to use for this provider if a provider id is not configured explicitly.
Variables ¶
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.*"
}
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"
}
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"
}
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 (*Provider) ListResources ¶
func (p *Provider) ListResources(req *pb.ListResourcesRequest) (*pb.ListResourcesResponse, error)
ListResources returns the list of resources based on the given request.