controller

package
v0.0.0-...-9febfc8 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIdempotencyKey

func CheckIdempotencyKey(ctx context.Context, client computeInstancesClient, project, idemKey string) *computepb.Instance

CheckIdempotencyKey checks the request idempotency with the existing leases

CheckIdempotencyKey takes a key and searches all instances within a project to check if any current lease matches the request being made. If a request is a duplicate request based on the key, then the instance already created will be returned to the caller and no additional request will be made to GCE.

func CreateInstance

func CreateInstance(parentCtx context.Context, client computeInstancesClient, env, leaseID string, r *api.LeaseVMRequest) error

CreateInstance sends an instance creation request to the Compute Engine API and waits for it to complete.

func DeleteInstance

func DeleteInstance(ctx context.Context, c computeInstancesClient, r *api.ReleaseVMRequest) error

DeleteInstance sends an instance deletion request to the Compute Engine API.

func GetInstance

func GetInstance(parentCtx context.Context, client computeInstancesClient, leaseID string, hostReqs *api.VMRequirements, shouldPoll bool) (*computepb.Instance, error)

GetInstance gets a GCE instance based on lease id and GCE configs.

GetInstance returns a GCE instance with valid network interface and network IP. If no network is available, it does not return the instance.

func ListInstances

func ListInstances(ctx context.Context, client computeInstancesClient, r *api.ListLeasesRequest) ([]*computepb.Instance, error)

ListInstances lists VMs in a GCP project based on request filters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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