Documentation
¶
Index ¶
- func CheckIdempotencyKey(ctx context.Context, client computeInstancesClient, project, idemKey string) *computepb.Instance
- func CreateInstance(parentCtx context.Context, client computeInstancesClient, env, leaseID string, ...) error
- func DeleteInstance(ctx context.Context, c computeInstancesClient, r *api.ReleaseVMRequest) error
- func GetInstance(parentCtx context.Context, client computeInstancesClient, leaseID string, ...) (*computepb.Instance, error)
- func ListInstances(ctx context.Context, client computeInstancesClient, r *api.ListLeasesRequest) ([]*computepb.Instance, error)
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.