func (c *Compute) CreateSnapshot(ctx context.Context, projectID, zone, disk string, rb *compute.Snapshot) (*compute.Operation, error) {
	return c.compute.Disks.CreateSnapshot(projectID, zone, disk, rb).Context(ctx).Do()
}
CreateSnapshot creates a snapshot of a specified persistent disk.
package clients
import (
	"context"
	"fmt"
	"log"
	"time"
	compute "google.golang.org/api/compute/v1"
)
const (
	maxLoops = 180
	loopSleep = 5 * time.Second
)
type Compute struct {
	compute   *compute.Service
	disks     *compute.DisksService
	snapshots *compute.SnapshotsService
	opsZone   *compute.ZoneOperationsService
	opsGlobal *compute.GlobalOperationsService
}
func NewCompute(ctx context.Context) (*Compute, error) {
	cc, err := compute.NewService(ctx)
	if err != nil {
		return nil, fmt.Errorf("failed to init cs: %q", err)
	}
	return &Compute{
		compute:   cc,
		disks:     compute.NewDisksService(cc),
		snapshots: compute.NewSnapshotsService(cc),
		opsZone:   compute.NewZoneOperationsService(cc),
		opsGlobal: compute.NewGlobalOperationsService(cc),
	}, nil
}
func (c *Compute) DiskInsert(ctx context.Context, projectID, zone string, disk *compute.Disk) (*compute.Operation, error) {
	return c.disks.Insert(projectID, zone, disk).Context(ctx).Do()
}
func (c *Compute) DeleteDiskSnapshot(ctx context.Context, project, snapshot string) (*compute.Operation, error) {
	return c.snapshots.Delete(project, snapshot).Context(ctx).Do()
}
func (c *Compute) InsertFirewallRule(ctx context.Context, projectID string, fw *compute.Firewall) (*compute.Operation, error) {
	return c.compute.Firewalls.Insert(projectID, fw).Context(ctx).Do()
}
func (c *Compute) PatchFirewallRule(ctx context.Context, projectID string, rule string, rb *compute.Firewall) (*compute.Operation, error) {
	return c.compute.Firewalls.Patch(projectID, rule, rb).Context(ctx).Do()
}
func (c *Compute) DeleteFirewallRule(ctx context.Context, projectID string, rule string) (*compute.Operation, error) {
	return c.compute.Firewalls.Delete(projectID, rule).Context(ctx).Do()
}
func (c *Compute) GetInstance(ctx context.Context, project, zone, instance string) (*compute.Instance, error) {
	return c.compute.Instances.Get(project, zone, instance).Context(ctx).Do()
}
func (c *Compute) DeleteAccessConfig(ctx context.Context, project, zone, instance, accessConfig, networkInterface string) (*compute.Operation, error) {
	return c.compute.Instances.DeleteAccessConfig(project, zone, instance, accessConfig, networkInterface).Context(ctx).Do()
}
func (c *Compute) FirewallRule(ctx context.Context, projectID string, ruleID string) (*compute.Firewall, error) {
	return c.compute.Firewalls.Get(projectID, ruleID).Context(ctx).Do()
}