Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions mmv1/api/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ type Resource struct {
// updates. This is typical of newer GCP APIs.
UpdateMask bool `yaml:"update_mask,omitempty"`

// [Optional] If set to true, this resource supports requestId for idempotency.
// This is typical of newer GCP APIs complying with AIP-155.
SupportsRequestId bool `yaml:"supports_request_id,omitempty"`

// [Optional] The HTTP verb used during create. Defaults to POST.
CreateVerb string `yaml:"create_verb,omitempty"`

Expand Down Expand Up @@ -799,6 +803,14 @@ func (r Resource) GetAsync() *Async {
return r.ProductMetadata.Async
}

// Returns true if the resource supports requestId for idempotency.
func (r Resource) HasSupportsRequestId() bool {
if r.SupportsRequestId {
return true
}
return false
}

// Return the resource-specific identity properties, or a best guess of the
// `name` value for the resource.
func (r Resource) GetIdentity() []*Type {
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/Address.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
api: 'https://cloud.google.com/compute/docs/reference/beta/addresses'
docs:
base_url: 'projects/{{project}}/regions/{{region}}/addresses'
supports_request_id: true
has_self_link: true
immutable: true
timeouts:
Expand Down Expand Up @@ -79,7 +80,7 @@
primary_resource_id: 'internal_with_shared_loadbalancer_vip'
vars:
address_name: 'my-internal-address'
# It is almost identical to internal_with_gce_endpoint

Check warning on line 83 in mmv1/products/compute/Address.yaml

View workflow job for this annotation

GitHub Actions / lint-yaml

83:2 [comments-indentation] comment not indented like content
exclude_docs: true
# TODO: Remove this example when instance is supported
- name: 'instance_with_ip'
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/Disk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ references:
api: 'https://cloud.google.com/compute/docs/reference/v1/disks'
docs:
base_url: 'projects/{{project}}/zones/{{zone}}/disks'
supports_request_id: true
has_self_link: true
immutable: true
timeouts:
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/Firewall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ docs:
* `enable_logging` - (Optional, Deprecated) This field denotes whether to enable logging for a particular firewall rule.
If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of `log_config`
base_url: 'projects/{{project}}/global/firewalls'
supports_request_id: true
has_self_link: true
update_verb: 'PATCH'
timeouts:
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/FirewallPolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ references:
api: 'https://cloud.google.com/compute/docs/reference/rest/v1/firewallPolicies'
docs:
base_url: 'locations/global/firewallPolicies'
supports_request_id: true
self_link: 'locations/global/firewallPolicies/{{name}}'
create_url: 'locations/global/firewallPolicies?parentId={{parent}}'
update_verb: 'PATCH'
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/FirewallPolicyAssociation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ references:
docs:
id_format: 'locations/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}'
base_url: 'locations/global/firewallPolicies/{{firewall_policy}}'
supports_request_id: true
self_link: 'locations/global/firewallPolicies/{{firewall_policy}}/getAssociation?name={{name}}'
create_url: 'locations/global/firewallPolicies/{{firewall_policy}}/addAssociation'
delete_url: 'locations/global/firewallPolicies/{{firewall_policy}}/removeAssociation?name={{name}}'
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/FirewallPolicyRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ references:
docs:
id_format: 'locations/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}}'
base_url: 'locations/global/firewallPolicies/{{firewall_policy}}'
supports_request_id: true
self_link: 'locations/global/firewallPolicies/{{firewall_policy}}/getRule?priority={{priority}}'
create_url: 'locations/global/firewallPolicies/{{firewall_policy}}/addRule'
update_url: 'locations/global/firewallPolicies/{{firewall_policy}}/patchRule?priority={{priority}}'
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/ForwardingRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ references:
api: 'https://cloud.google.com/compute/docs/reference/v1/forwardingRules'
docs:
base_url: 'projects/{{project}}/regions/{{region}}/forwardingRules'
supports_request_id: true
has_self_link: true
immutable: true
timeouts:
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/GlobalAddress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ references:
api: 'https://cloud.google.com/compute/docs/reference/v1/globalAddresses'
docs:
base_url: 'projects/{{project}}/global/addresses'
supports_request_id: true
has_self_link: true
immutable: true
timeouts:
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/GlobalForwardingRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
exclude_attribution_label: true
docs:
base_url: 'projects/{{project}}/global/forwardingRules'
supports_request_id: true
has_self_link: true
immutable: true
timeouts:
Expand Down Expand Up @@ -430,7 +431,7 @@
For Private Service Connect forwarding rules that forward traffic to Google
APIs, a network must be provided.
default_from_api: true
# TODO: When implementing new types enable converting the

Check warning on line 434 in mmv1/products/compute/GlobalForwardingRule.yaml

View workflow job for this annotation

GitHub Actions / lint-yaml

434:3 [comments-indentation] comment not indented like content
# manifest input from a single value to a range of form NN-NN. The API
# accepts a single value, e.g. '80', but the API stores and returns
# '80-80'. This causes idempotency false positive.
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/HealthCheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ references:
api: 'https://cloud.google.com/compute/docs/reference/rest/v1/healthChecks'
docs:
base_url: 'projects/{{project}}/global/healthChecks'
supports_request_id: true
has_self_link: true
timeouts:
insert_minutes: 20
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/InstanceGroupManager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
exclude: true
docs:
base_url: 'projects/{{project}}/zones/{{zone}}/instanceGroupManagers'
supports_request_id: true
has_self_link: true
timeouts:
insert_minutes: 20
Expand Down Expand Up @@ -164,7 +165,7 @@
group. The group uses this template to create all new instances in the
managed instance group.
required: true
# kind is internal transport detail

Check warning on line 168 in mmv1/products/compute/InstanceGroupManager.yaml

View workflow job for this annotation

GitHub Actions / lint-yaml

168:3 [comments-indentation] comment not indented like content
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl'
resource: 'InstanceTemplate'
imports: 'selfLink'
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/InstanceTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: |
Resource that enables a convenient way to save a virtual machine (VM) instance's configuration
that includes all of its properties and allows you to create a new instance from it.
base_url: 'projects/{{project}}/global/instanceTemplates'
supports_request_id: true
has_self_link: true
exclude_resource: true
properties:
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/InterconnectAttachment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ references:
api: 'https://cloud.google.com/compute/docs/reference/rest/v1/interconnectAttachments'
docs:
base_url: 'projects/{{project}}/regions/{{region}}/interconnectAttachments'
supports_request_id: true
has_self_link: true
update_verb: 'PATCH'
timeouts:
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/Network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ references:
api: 'https://cloud.google.com/compute/docs/reference/rest/v1/networks'
docs:
base_url: 'projects/{{project}}/global/networks'
supports_request_id: true
has_self_link: true
immutable: true
timeouts:
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/NetworkAttachment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ references:
api: 'https://cloud.google.com/compute/docs/reference/rest/v1/networkAttachments'
docs:
base_url: 'projects/{{project}}/regions/{{region}}/networkAttachments'
supports_request_id: true
update_verb: 'PATCH'
timeouts:
insert_minutes: 20
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/NetworkFirewallPolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ api_resource_type_kind: FirewallPolicy
description: "The Compute NetworkFirewallPolicy resource"
docs:
base_url: 'projects/{{project}}/global/firewallPolicies'
supports_request_id: true
self_link: 'projects/{{project}}/global/firewallPolicies/{{name}}'
create_url: 'projects/{{project}}/global/firewallPolicies'
update_verb: 'PATCH'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ references:
docs:
id_format: 'projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}'
base_url: 'projects/{{project}}/global/firewallPolicies/{{firewall_policy}}'
supports_request_id: true
self_link: 'projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/getAssociation?name={{name}}'
create_url: 'projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/addAssociation'
delete_url: 'projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/removeAssociation?name={{name}}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ references:
docs:
id_format: 'projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/packetMirroringRules/{{priority}}'
base_url: 'projects/{{project}}/global/firewallPolicies/{{firewall_policy}}'
supports_request_id: true
self_link: 'projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/getPacketMirroringRule?priority={{priority}}'
create_url: 'projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/addPacketMirroringRule'
update_url: 'projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/patchPacketMirroringRule?priority={{priority}}'
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/NetworkFirewallPolicyRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ description: |
references:
api: https://cloud.google.com/compute/docs/reference/rest/v1/networkFirewallPolicies/addRule
base_url: projects/{{project}}/global/firewallPolicies/{{firewall_policy}}
supports_request_id: true
self_link: projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/getRule?priority={{priority}}
create_url: projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/addRule
delete_url: projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/removeRule?priority={{priority}}
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/RegionNetworkFirewallPolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ api_resource_type_kind: FirewallPolicy
description: "The Compute NetworkFirewallPolicy resource"
docs:
base_url: 'projects/{{project}}/regions/{{region}}/firewallPolicies'
supports_request_id: true
self_link: 'projects/{{project}}/regions/{{region}}/firewallPolicies/{{name}}'
create_url: 'projects/{{project}}/regions/{{region}}/firewallPolicies'
update_verb: 'PATCH'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ references:
guides: {}
api: https://cloud.google.com/compute/docs/reference/rest/v1/regionNetworkFirewallPolicies/addAssociation
base_url: projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}
supports_request_id: true
immutable: true
self_link: projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/getAssociation?name={{name}}
create_url: projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/addAssociation
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/RegionNetworkFirewallPolicyRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ references:
docs:
id_format: 'projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/{{priority}}'
base_url: 'projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}'
supports_request_id: true
self_link: 'projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/getRule?priority={{priority}}'
create_url: 'projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/addRule'
update_url: 'projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/patchRule?priority={{priority}}'
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/Route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ docs:
`next_hop_instance`. Omit if `next_hop_instance` is specified as
a URL.
base_url: 'projects/{{project}}/global/routes'
supports_request_id: true
has_self_link: true
immutable: true
mutex: 'projects/{{project}}/global/networks/{{network}}/peerings'
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/Router.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
api: 'https://cloud.google.com/compute/docs/reference/rest/v1/routers'
docs:
base_url: 'projects/{{project}}/regions/{{region}}/routers'
supports_request_id: true
has_self_link: true
# Since Terraform has separate resources for router, router interface, and
# router peer, calling PUT on the router will delete the interface and peer.
Expand All @@ -46,7 +47,7 @@
- 'resourceComputeRouterCustomDiff'
sweeper:
prefixes:
- "swg-autogen-router" # Secure Web Proxy(SWP) auto-generated router prefix.

Check warning on line 50 in mmv1/products/compute/Router.yaml

View workflow job for this annotation

GitHub Actions / lint-yaml

50:28 [comments] too few spaces before comment
url_substitutions:
- region: "us-central1"
- region: "us-east1"
Expand Down Expand Up @@ -125,7 +126,7 @@
description: |
A reference to the network to which this router belongs.
immutable: true
# TODO: Figure out the story for interfaces/bgpPeers. Right

Check warning on line 129 in mmv1/products/compute/Router.yaml

View workflow job for this annotation

GitHub Actions / lint-yaml

129:3 [comments-indentation] comment not indented like content
# now in Terraform we have three separate resources: router,
# router_interface, and router_peer. Decide whether we want to keep that
# pattern for the other providers, keep it unique for Terraform, or add
Expand Down Expand Up @@ -172,7 +173,7 @@

This enum field has the one valid value: ALL_SUBNETS
send_empty_value: true
# TODO: #324 enum?

Check warning on line 176 in mmv1/products/compute/Router.yaml

View workflow job for this annotation

GitHub Actions / lint-yaml

176:2 [comments-indentation] comment not indented like content
item_type:
type: String
- name: 'advertisedIpRanges'
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/RouterNat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ references:
docs:
id_format: '{{project}}/{{region}}/{{router}}/{{name}}'
base_url: 'projects/{{project}}/regions/{{region}}/routers/{{router}}'
supports_request_id: true
self_link: 'projects/{{project}}/regions/{{region}}/routers/{{router}}'
create_url: 'projects/{{project}}/regions/{{region}}/routers/{{router}}'
create_verb: 'PATCH'
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/ServiceAttachment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ references:
api: 'https://cloud.google.com/compute/docs/reference/beta/serviceAttachments'
docs:
base_url: 'projects/{{project}}/regions/{{region}}/serviceAttachments'
supports_request_id: true
has_self_link: true
update_verb: 'PATCH'
timeouts:
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/compute/Subnetwork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ references:
Private Google Access: https://cloud.google.com/vpc/docs/configure-private-google-access
api: https://cloud.google.com/compute/docs/reference/rest/v1/subnetworks
base_url: projects/{{project}}/regions/{{region}}/subnetworks
supports_request_id: true
immutable: true
has_self_link: true
collection_url_key: items
Expand Down
2 changes: 2 additions & 0 deletions mmv1/templates/terraform/resource.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ func resource{{ $.ResourceName -}}Create(d *schema.ResourceData, meta interface{
Body: obj,
Timeout: d.Timeout(schema.TimeoutCreate),
Headers: headers,
SendRequestId: {{ $.HasSupportsRequestId }},
{{- if $.ErrorRetryPredicates }}
ErrorRetryPredicates: []transport_tpg.RetryErrorPredicateFunc{{"{"}}{{ join $.ErrorRetryPredicates "," -}}{{"}"}},
{{- end}}
Expand Down Expand Up @@ -1361,6 +1362,7 @@ func resource{{ $.ResourceName }}Delete(d *schema.ResourceData, meta interface{}
Body: obj,
Timeout: d.Timeout(schema.TimeoutDelete),
Headers: headers,
SendRequestId: {{ $.HasSupportsRequestId }},
{{- if $.ErrorRetryPredicates }}
ErrorRetryPredicates: []transport_tpg.RetryErrorPredicateFunc{{"{"}}{{- join $.ErrorRetryPredicates "," -}}{{"}"}},
{{- end }}
Expand Down
13 changes: 12 additions & 1 deletion mmv1/third_party/terraform/fwtransport/framework_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"strings"
"time"

"github.com/google/uuid"
"github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource"
Expand Down Expand Up @@ -73,6 +74,7 @@ type SendRequestOptions struct {
Headers http.Header
ErrorRetryPredicates []transport_tpg.RetryErrorPredicateFunc
ErrorAbortPredicates []transport_tpg.RetryErrorPredicateFunc
SendRequestId bool
}

func SendRequest(opt SendRequestOptions, diags *diag.Diagnostics) (map[string]interface{}, error) {
Expand All @@ -99,6 +101,11 @@ func SendRequest(opt SendRequestOptions, diags *diag.Diagnostics) (map[string]in
opt.Timeout = DefaultRequestTimeout
}

var requestId string
if opt.SendRequestId {
requestId = uuid.New().String()
}

var res *http.Response
err := transport_tpg.Retry(transport_tpg.RetryOptions{
RetryFunc: func() error {
Expand All @@ -110,7 +117,11 @@ func SendRequest(opt SendRequestOptions, diags *diag.Diagnostics) (map[string]in
}
}

u, err := transport_tpg.AddQueryParams(opt.RawURL, map[string]string{"alt": "json"})
queryParams := map[string]string{"alt": "json"}
if requestId != "" {
queryParams["requestId"] = requestId
}
u, err := transport_tpg.AddQueryParams(opt.RawURL, queryParams)
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package compute

import (
"context"
"encoding/json"
"fmt"
"reflect"
"strings"
Expand Down Expand Up @@ -1715,18 +1716,46 @@ func resourceComputeInstanceTemplateCreate(d *schema.ResourceData, meta interfac
Properties: instanceProperties,
Name: itName,
}
url, err := tpgresource.ReplaceVars(d, config, "{{"{{"}}ComputeBasePath{{"}}"}}projects/{{"{{"}}project{{"}}"}}/global/instanceTemplates")
if err != nil {
return err
}

op, err := config.NewComputeClient(userAgent).InstanceTemplates.Insert(project, instanceTemplate).Do()
var obj map[string]interface{}
e, err := json.Marshal(instanceTemplate)
if err != nil {
return fmt.Errorf("Error marshaling instance template: %s", err)
}
err = json.Unmarshal(e, &obj)
if err != nil {
return fmt.Errorf("Error unmarshaling instance template: %s", err)
}

res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "POST",
Project: project,
RawURL: url,
UserAgent: userAgent,
Body: obj,
Timeout: d.Timeout(schema.TimeoutCreate),
SendRequestId: true,
})
if err != nil {
return fmt.Errorf("Error creating instance template: %s", err)
}

// Store the ID now
d.SetId(fmt.Sprintf("projects/%s/global/instanceTemplates/%s", project, instanceTemplate.Name))

targetId := ""
if v, ok := res["targetId"]; ok {
targetId = fmt.Sprintf("%v", v)
}
// And also the unique ID
d.Set("self_link_unique", fmt.Sprintf("%v?uniqueId=%v", d.Id(), op.TargetId))
d.Set("self_link_unique", fmt.Sprintf("%v?uniqueId=%v", d.Id(), targetId))

err = ComputeOperationWaitTime(config, op, project, "Creating Instance Template", userAgent, d.Timeout(schema.TimeoutCreate))
err = ComputeOperationWaitTime(config, res, project, "Creating Instance Template", userAgent, d.Timeout(schema.TimeoutCreate))
if err != nil {
return err
}
Expand Down Expand Up @@ -2224,14 +2253,25 @@ func resourceComputeInstanceTemplateDelete(d *schema.ResourceData, meta interfac
return err
}

splits := strings.Split(d.Id(), "/")
op, err := config.NewComputeClient(userAgent).InstanceTemplates.Delete(
project, splits[len(splits)-1]).Do()
url, err := tpgresource.ReplaceVars(d, config, "{{"{{"}}ComputeBasePath{{"}}"}}projects/{{"{{"}}project{{"}}"}}/global/instanceTemplates/{{"{{"}}name{{"}}"}}")
if err != nil {
return err
}

res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Project: project,
RawURL: url,
UserAgent: userAgent,
Timeout: d.Timeout(schema.TimeoutDelete),
SendRequestId: true,
})
if err != nil {
return fmt.Errorf("Error deleting instance template: %s", err)
return transport_tpg.HandleNotFoundError(err, d, "Instance Template")
}

err = ComputeOperationWaitTime(config, op, project, "Deleting Instance Template", userAgent, d.Timeout(schema.TimeoutDelete))
err = ComputeOperationWaitTime(config, res, project, "Deleting Instance Template", userAgent, d.Timeout(schema.TimeoutDelete))
if err != nil {
return err
}
Expand Down
Loading
Loading