mirror of https://github.com/hashicorp/terraform
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.pull/372/head
parent
28cd738edc
commit
ddfdfebcc5
@ -0,0 +1,15 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue