terraform-provider-google/disk_type.go
Jeff Goldschrafe 69c09c1cb7 Configurable disk types for GCE
Supports configuring the disk type for Google Compute Engine disk
resources. Both `google_compute_disk` and `google_compute_instance`
disk types are supported.

Resolves #351.
2014-10-07 01:40:20 -04:00

16 lines
429 B
Go

package google
import (
"code.google.com/p/google-api-go-client/compute/v1"
)
// readDiskType finds the disk type with the given name.
func readDiskType(c *Config, zone *compute.Zone, name string) (*compute.DiskType, error) {
diskType, err := c.clientCompute.DiskTypes.Get(c.Project, zone.Name, name).Do()
if err == nil && diskType != nil && diskType.SelfLink != "" {
return diskType, nil
} else {
return nil, err
}
}