You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Printf("[DEBUG] API Policy (Resource Group %q / API Management Service %q / API %q) was not found - removing from state!", resourceGroup, serviceName, apiName)
141
+
log.Printf("[DEBUG] %s was not found - removing from state!", *id)
143
142
d.SetId("")
144
143
returnnil
145
144
}
146
145
147
-
returnfmt.Errorf("making Read request for API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err)
146
+
returnfmt.Errorf("making Read request for %s: %+v", *id, err)
returnfmt.Errorf("checking for presence of existing API %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err)
299
+
returnfmt.Errorf("checking for presence of existing %s: %s", id, err)
298
300
}
299
301
}
300
302
@@ -323,7 +325,7 @@ func resourceApiManagementApiCreateUpdate(d *pluginsdk.ResourceData, meta interf
323
325
contentFormat:=importV["content_format"].(string)
324
326
contentValue:=importV["content_value"].(string)
325
327
326
-
log.Printf("[DEBUG] Importing API Management API %q of type %q", name, contentFormat)
328
+
log.Printf("[DEBUG] Importing API Management API %q of type %q", id.Name, contentFormat)
returnfmt.Errorf("retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err)
423
+
returnfmt.Errorf("waiting on creating/updating %s: %+v", id, err)
427
424
}
428
425
429
-
ifread.ID==nil {
430
-
returnfmt.Errorf("Cannot read ID for API %q / Revision %q (API Management Service %q / Resource Group %q)", name, revision, serviceName, resourceGroup)
431
-
}
432
-
433
-
d.SetId(*read.ID)
426
+
d.SetId(id.ID())
434
427
returnresourceApiManagementApiRead(d, meta)
435
428
}
436
429
@@ -444,31 +437,27 @@ func resourceApiManagementApiRead(d *pluginsdk.ResourceData, meta interface{}) e
log.Printf("[DEBUG] API %q Revision %q (API Management Service %q / Resource Group %q) does not exist - removing from state!", name, revision, serviceName, resourceGroup)
450
+
log.Printf("[DEBUG] API %q Revision %q (API Management Service %q / Resource Group %q) does not exist - removing from state!", name, revision, id.ServiceName, id.ResourceGroup)
462
451
d.SetId("")
463
452
returnnil
464
453
}
465
454
466
-
returnfmt.Errorf("retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err)
455
+
returnfmt.Errorf("retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, id.ServiceName, id.ResourceGroup, err)
467
456
}
468
457
469
-
d.Set("api_management_name", serviceName)
458
+
d.Set("api_management_name", id.ServiceName)
470
459
d.Set("name", name)
471
-
d.Set("resource_group_name", resourceGroup)
460
+
d.Set("resource_group_name", id.ResourceGroup)
472
461
473
462
ifprops:=resp.APIContractProperties; props!=nil {
474
463
d.Set("description", props.Description)
@@ -515,21 +504,17 @@ func resourceApiManagementApiDelete(d *pluginsdk.ResourceData, meta interface{})
0 commit comments