Documentation
¶
Overview ¶
Package gce is a lightweight testable wrapper around GCE compute APIs needed for the gcagent.
Index ¶
- type GCE
- func (g *GCE) GetAddress(project, location, name string) (*compute.Address, error)
- func (g *GCE) GetAddressByIP(project, region, ip string) (*compute.Address, error)
- func (g *GCE) GetDisk(project, zone, disk string) (*compute.Disk, error)
- func (g *GCE) GetFilestoreByIP(project, location, ip string) (*file.ListInstancesResponse, error)
- func (g *GCE) GetFilestoreInstance(project, location, filestore string) (*file.Instance, error)
- func (g *GCE) GetForwardingRule(project, location, name string) (*compute.ForwardingRule, error)
- func (g *GCE) GetInstance(project, zone, instance string) (*compute.Instance, error)
- func (g *GCE) GetInstanceByIP(project, ip string) (*compute.Instance, error)
- func (g *GCE) GetInstanceGroup(project, zone, name string) (*compute.InstanceGroup, error)
- func (g *GCE) GetRegionalBackendService(project, region, service string) (*compute.BackendService, error)
- func (g *GCE) GetSecret(ctx context.Context, projectID, secretName string) (string, error)
- func (g *GCE) GetURIForIP(project, ip string) (string, error)
- func (g *GCE) ListInstanceGroupInstances(project, zone, name string) (*compute.InstanceGroupsListInstances, error)
- func (g *GCE) ListZoneOperations(project, zone, filter string, maxResults int64) (*compute.OperationList, error)
- type WLM
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCE ¶
type GCE struct {
// contains filtered or unexported fields
}
GCE is a wrapper for Google Compute Engine services.
func NewGCEClient ¶
NewGCEClient creates a new GCE service wrapper.
func (*GCE) GetAddress ¶
GetAddress retrieves a GCE Address defined by the project, location, and name provided.
func (*GCE) GetAddressByIP ¶
GetAddressByIP attempts to find a ComputeAddress object with a given IP. The string is assumed to be an exact match, so a full IPv4 address is expected. A region should be supplied, or "" to search for a global address.
func (*GCE) GetDisk ¶
GetDisk retrieves a GCE Persistent Disk defined by the project zone and name provided.
func (*GCE) GetFilestoreByIP ¶
func (g *GCE) GetFilestoreByIP(project, location, ip string) (*file.ListInstancesResponse, error)
GetFilestoreByIP attempts to locate a GCE Filestore instance defined by the project, location, and IP Address provided.
func (*GCE) GetFilestoreInstance ¶
GetFilestoreInstance retrieves a GCE Filestore Instance defined by the project, locaiton, and name provided.
func (*GCE) GetForwardingRule ¶
func (g *GCE) GetForwardingRule(project, location, name string) (*compute.ForwardingRule, error)
GetForwardingRule retrieves a GCE Forwarding rule defined by the project, zone, and name provided.
func (*GCE) GetInstance ¶
GetInstance retrieves a GCE Instance defined by the project, zone, and name provided.
func (*GCE) GetInstanceByIP ¶
GetInstanceByIP retrieves a GCE Instance defined by the project, and IP provided. May return nil if an instance with the corresponding IP cannot be found.
func (*GCE) GetInstanceGroup ¶
func (g *GCE) GetInstanceGroup(project, zone, name string) (*compute.InstanceGroup, error)
GetInstanceGroup retrieves a GCE Instance Group rule defined by the project, zone, and name provided.
func (*GCE) GetRegionalBackendService ¶
func (g *GCE) GetRegionalBackendService(project, region, service string) (*compute.BackendService, error)
GetRegionalBackendService retrieves a GCE Backend Service defined by the project, region, and name provided.
func (*GCE) GetSecret ¶
GetSecret accesses the secret manager for the specified project ID and returns the stored password.
func (*GCE) GetURIForIP ¶
GetURIForIP attempts to locate the URI for any object that is related to the IP address provided.
func (*GCE) ListInstanceGroupInstances ¶
func (g *GCE) ListInstanceGroupInstances(project, zone, name string) (*compute.InstanceGroupsListInstances, error)
ListInstanceGroupInstances retrieves a list of GCE Instances in the Instance group defined by the project, zone, and name provided.
func (*GCE) ListZoneOperations ¶
func (g *GCE) ListZoneOperations(project, zone, filter string, maxResults int64) (*compute.OperationList, error)
ListZoneOperations retrieves a list of Operations resources defined by the project, and zone provided. Results will be filtered according to the provided filter string, and limit the number jof results to maxResults.
type WLM ¶
type WLM struct {
// contains filtered or unexported fields
}
WLM is a wrapper for Workload Manager API services.
func NewWLMClient ¶
NewWLMClient creates a new WLM service wrapper.
func (*WLM) WriteInsight ¶
func (w *WLM) WriteInsight(project string, location string, writeInsightRequest *workloadmanager.WriteInsightRequest) error
WriteInsight wraps a call to the WLM insights:write API.
Directories
¶
Path | Synopsis |
---|---|
Package fake provides a fake version of the GCE struct to return canned responses in unit tests.
|
Package fake provides a fake version of the GCE struct to return canned responses in unit tests. |
Package metadataserver performs requests to the metadata server of a GCE instance.
|
Package metadataserver performs requests to the metadata server of a GCE instance. |
Package workloadmanager contains types and functions to interact with the various WorkloadManager cloud APIs.
|
Package workloadmanager contains types and functions to interact with the various WorkloadManager cloud APIs. |