Documentation
¶
Index ¶
- Variables
- func BetaMetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, ...)
- func ComparePartnerMetadataDiff(_, old, new string, d *schema.ResourceData) bool
- func FlattenMetadata(metadata *compute.Metadata) map[string]interface{}
- func MetadataRetryWrapper(update func() error) error
- func MetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, ...)
- func ResolveImage(c *transport_tpg.Config, project, name, userAgent string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ImageMap = map[string]string{
"centos": "centos-cloud",
"coreos": "coreos-cloud",
"debian": "debian-cloud",
"opensuse": "opensuse-cloud",
"rhel": "rhel-cloud",
"rocky-linux": "rocky-linux-cloud",
"sles": "suse-cloud",
"ubuntu": "ubuntu-os-cloud",
"windows": "windows-cloud",
"windows-sql": "windows-sql-cloud",
}
built-in projects to look for images/families containing the string on the left in
Functions ¶
func BetaMetadataUpdate ¶
func BetaMetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, serverMD *compute.Metadata)
Update the beta metadata (serverMD) according to the provided diff (oldMDMap v newMDMap).
func ComparePartnerMetadataDiff ¶
func ComparePartnerMetadataDiff(_, old, new string, d *schema.ResourceData) bool
func FlattenMetadata ¶
This function differs from flattenMetadataBeta only in that it takes compute.metadata rather than compute.metadata as an argument. It should be removed in favour of flattenMetadataBeta if/when all resources using it get beta support.
func MetadataRetryWrapper ¶
Since the google compute API uses optimistic locking, there is a chance we need to resubmit our updated metadata. To do this, you need to provide an update function that attempts to submit your metadata
func MetadataUpdate ¶
func MetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, serverMD *compute.Metadata)
Update the metadata (serverMD) according to the provided diff (oldMDMap v newMDMap).
func ResolveImage ¶
func ResolveImage(c *transport_tpg.Config, project, name, userAgent string) (string, error)
If the given name is a URL, return it. If it's in the form projects/{project}/global/images/{image}, return it If it's in the form projects/{project}/global/images/family/{family}, return it If it's in the form global/images/{image}, return it If it's in the form global/images/family/{family}, return it If it's in the form family/{family}, check if it's a family in the current project. If it is, return it as global/images/family/{family}.
If not, check if it could be a GCP-provided family, and if it exists. If it does, return it as projects/{project}/global/images/family/{family}.
If it's in the form {project}/{family-or-image}, check if it's an image in the named project. If it is, return it as projects/{project}/global/images/{image}.
If not, check if it's a family in the named project. If it is, return it as projects/{project}/global/images/family/{family}.
If it's in the form {family-or-image}, check if it's an image in the current project. If it is, return it as global/images/{image}.
If not, check if it could be a GCP-provided image, and if it exists. If it does, return it as projects/{project}/global/images/{image}. If not, check if it's a family in the current project. If it is, return it as global/images/family/{family}. If not, check if it could be a GCP-provided family, and if it exists. If it does, return it as projects/{project}/global/images/family/{family}
Types ¶
This section is empty.