From ac4c69b1bcf2eb2126838d19167d1cf9a50ce57c Mon Sep 17 00:00:00 2001 From: Matthew Geldert Date: Thu, 21 Jun 2018 15:02:30 +0100 Subject: [PATCH] Fix for ISSUE_1 import failures --- 4.0.0/data_source_config_action.go | 4 ++++ 4.0.0/data_source_config_action_program.go | 4 ++++ 4.0.0/data_source_config_aptimizer_profile.go | 4 ++++ 4.0.0/data_source_config_aptimizer_scope.go | 4 ++++ 4.0.0/data_source_config_bandwidth.go | 4 ++++ 4.0.0/data_source_config_bgpneighbor.go | 4 ++++ 4.0.0/data_source_config_cloud_api_credential.go | 4 ++++ 4.0.0/data_source_config_custom.go | 4 ++++ 4.0.0/data_source_config_dns_server_zone.go | 4 ++++ 4.0.0/data_source_config_dns_server_zone_file.go | 4 ++++ 4.0.0/data_source_config_event_type.go | 4 ++++ 4.0.0/data_source_config_extra_file.go | 4 ++++ 4.0.0/data_source_config_glb_service.go | 4 ++++ 4.0.0/data_source_config_kerberos_keytab.go | 4 ++++ 4.0.0/data_source_config_kerberos_krb5conf.go | 4 ++++ 4.0.0/data_source_config_kerberos_principal.go | 4 ++++ 4.0.0/data_source_config_license_key.go | 4 ++++ 4.0.0/data_source_config_location.go | 4 ++++ 4.0.0/data_source_config_log_export.go | 4 ++++ 4.0.0/data_source_config_monitor.go | 4 ++++ 4.0.0/data_source_config_monitor_script.go | 4 ++++ 4.0.0/data_source_config_persistence.go | 4 ++++ 4.0.0/data_source_config_pool.go | 4 ++++ 4.0.0/data_source_config_protection.go | 4 ++++ 4.0.0/data_source_config_rate.go | 4 ++++ 4.0.0/data_source_config_rule.go | 4 ++++ 4.0.0/data_source_config_rule_authenticator.go | 4 ++++ 4.0.0/data_source_config_service_level_monitor.go | 4 ++++ 4.0.0/data_source_config_ssl_ca.go | 4 ++++ 4.0.0/data_source_config_ssl_client_key.go | 4 ++++ 4.0.0/data_source_config_ssl_server_key.go | 4 ++++ 4.0.0/data_source_config_traffic_ip_group.go | 4 ++++ 4.0.0/data_source_config_traffic_manager.go | 4 ++++ 4.0.0/data_source_config_user_authenticator.go | 4 ++++ 4.0.0/data_source_config_user_group.go | 4 ++++ 4.0.0/data_source_config_virtual_server.go | 4 ++++ 4.0.0/resource_action.go | 7 +++++++ 4.0.0/resource_action_program.go | 7 +++++++ 4.0.0/resource_aptimizer_profile.go | 7 +++++++ 4.0.0/resource_aptimizer_scope.go | 7 +++++++ 4.0.0/resource_bandwidth.go | 7 +++++++ 4.0.0/resource_bgpneighbor.go | 7 +++++++ 4.0.0/resource_cloud_api_credential.go | 7 +++++++ 4.0.0/resource_custom.go | 7 +++++++ 4.0.0/resource_dns_server_zone.go | 7 +++++++ 4.0.0/resource_dns_server_zone_file.go | 7 +++++++ 4.0.0/resource_event_type.go | 7 +++++++ 4.0.0/resource_extra_file.go | 7 +++++++ 4.0.0/resource_glb_service.go | 7 +++++++ 4.0.0/resource_kerberos_keytab.go | 7 +++++++ 4.0.0/resource_kerberos_krb5conf.go | 7 +++++++ 4.0.0/resource_kerberos_principal.go | 7 +++++++ 4.0.0/resource_license_key.go | 7 +++++++ 4.0.0/resource_location.go | 7 +++++++ 4.0.0/resource_log_export.go | 7 +++++++ 4.0.0/resource_monitor.go | 7 +++++++ 4.0.0/resource_monitor_script.go | 7 +++++++ 4.0.0/resource_persistence.go | 7 +++++++ 4.0.0/resource_pool.go | 7 +++++++ 4.0.0/resource_protection.go | 7 +++++++ 4.0.0/resource_rate.go | 7 +++++++ 4.0.0/resource_rule.go | 7 +++++++ 4.0.0/resource_rule_authenticator.go | 7 +++++++ 4.0.0/resource_service_level_monitor.go | 7 +++++++ 4.0.0/resource_ssl_ca.go | 7 +++++++ 4.0.0/resource_ssl_client_key.go | 7 +++++++ 4.0.0/resource_ssl_server_key.go | 7 +++++++ 4.0.0/resource_traffic_ip_group.go | 7 +++++++ 4.0.0/resource_traffic_manager.go | 4 ++++ 4.0.0/resource_user_authenticator.go | 7 +++++++ 4.0.0/resource_user_group.go | 7 +++++++ 4.0.0/resource_virtual_server.go | 7 +++++++ 5.2.0/data_source_config_action.go | 4 ++++ 5.2.0/data_source_config_action_program.go | 4 ++++ 5.2.0/data_source_config_aptimizer_profile.go | 4 ++++ 5.2.0/data_source_config_aptimizer_scope.go | 4 ++++ 5.2.0/data_source_config_bandwidth.go | 4 ++++ 5.2.0/data_source_config_bgpneighbor.go | 4 ++++ 5.2.0/data_source_config_cloud_api_credential.go | 4 ++++ 5.2.0/data_source_config_custom.go | 4 ++++ 5.2.0/data_source_config_dns_server_zone.go | 4 ++++ 5.2.0/data_source_config_dns_server_zone_file.go | 4 ++++ 5.2.0/data_source_config_event_type.go | 4 ++++ 5.2.0/data_source_config_extra_file.go | 4 ++++ 5.2.0/data_source_config_glb_service.go | 4 ++++ 5.2.0/data_source_config_kerberos_keytab.go | 4 ++++ 5.2.0/data_source_config_kerberos_krb5conf.go | 4 ++++ 5.2.0/data_source_config_kerberos_principal.go | 4 ++++ 5.2.0/data_source_config_license_key.go | 4 ++++ 5.2.0/data_source_config_location.go | 4 ++++ 5.2.0/data_source_config_log_export.go | 4 ++++ 5.2.0/data_source_config_monitor.go | 4 ++++ 5.2.0/data_source_config_monitor_script.go | 4 ++++ 5.2.0/data_source_config_persistence.go | 4 ++++ 5.2.0/data_source_config_pool.go | 4 ++++ 5.2.0/data_source_config_protection.go | 4 ++++ 5.2.0/data_source_config_rate.go | 4 ++++ 5.2.0/data_source_config_rule.go | 4 ++++ 5.2.0/data_source_config_rule_authenticator.go | 4 ++++ 5.2.0/data_source_config_saml_trustedidp.go | 4 ++++ 5.2.0/data_source_config_service_level_monitor.go | 4 ++++ 5.2.0/data_source_config_servicediscovery.go | 4 ++++ 5.2.0/data_source_config_ssl_ca.go | 4 ++++ 5.2.0/data_source_config_ssl_client_key.go | 4 ++++ 5.2.0/data_source_config_ssl_server_key.go | 4 ++++ 5.2.0/data_source_config_ssl_ticket_key.go | 4 ++++ 5.2.0/data_source_config_traffic_ip_group.go | 4 ++++ 5.2.0/data_source_config_traffic_manager.go | 4 ++++ 5.2.0/data_source_config_user_authenticator.go | 4 ++++ 5.2.0/data_source_config_user_group.go | 4 ++++ 5.2.0/data_source_config_virtual_server.go | 4 ++++ 5.2.0/resource_action.go | 7 +++++++ 5.2.0/resource_action_program.go | 7 +++++++ 5.2.0/resource_aptimizer_profile.go | 7 +++++++ 5.2.0/resource_aptimizer_scope.go | 7 +++++++ 5.2.0/resource_bandwidth.go | 7 +++++++ 5.2.0/resource_bgpneighbor.go | 7 +++++++ 5.2.0/resource_cloud_api_credential.go | 7 +++++++ 5.2.0/resource_custom.go | 7 +++++++ 5.2.0/resource_dns_server_zone.go | 7 +++++++ 5.2.0/resource_dns_server_zone_file.go | 7 +++++++ 5.2.0/resource_event_type.go | 7 +++++++ 5.2.0/resource_extra_file.go | 7 +++++++ 5.2.0/resource_glb_service.go | 7 +++++++ 5.2.0/resource_kerberos_keytab.go | 7 +++++++ 5.2.0/resource_kerberos_krb5conf.go | 7 +++++++ 5.2.0/resource_kerberos_principal.go | 7 +++++++ 5.2.0/resource_license_key.go | 7 +++++++ 5.2.0/resource_location.go | 7 +++++++ 5.2.0/resource_log_export.go | 7 +++++++ 5.2.0/resource_monitor.go | 7 +++++++ 5.2.0/resource_monitor_script.go | 7 +++++++ 5.2.0/resource_persistence.go | 7 +++++++ 5.2.0/resource_pool.go | 7 +++++++ 5.2.0/resource_protection.go | 7 +++++++ 5.2.0/resource_rate.go | 7 +++++++ 5.2.0/resource_rule.go | 7 +++++++ 5.2.0/resource_rule_authenticator.go | 7 +++++++ 5.2.0/resource_saml_trustedidp.go | 7 +++++++ 5.2.0/resource_service_level_monitor.go | 7 +++++++ 5.2.0/resource_servicediscovery.go | 7 +++++++ 5.2.0/resource_ssl_ca.go | 7 +++++++ 5.2.0/resource_ssl_client_key.go | 7 +++++++ 5.2.0/resource_ssl_server_key.go | 7 +++++++ 5.2.0/resource_ssl_ticket_key.go | 7 +++++++ 5.2.0/resource_traffic_ip_group.go | 7 +++++++ 5.2.0/resource_traffic_manager.go | 4 ++++ 5.2.0/resource_user_authenticator.go | 7 +++++++ 5.2.0/resource_user_group.go | 7 +++++++ 5.2.0/resource_virtual_server.go | 7 +++++++ 150 files changed, 819 insertions(+) diff --git a/4.0.0/data_source_config_action.go b/4.0.0/data_source_config_action.go index 811d9305..79b109c6 100644 --- a/4.0.0/data_source_config_action.go +++ b/4.0.0/data_source_config_action.go @@ -215,6 +215,10 @@ func dataSourceAction() *schema.Resource { func dataSourceActionRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAction(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_action_program.go b/4.0.0/data_source_config_action_program.go index 57d79189..fe539a73 100644 --- a/4.0.0/data_source_config_action_program.go +++ b/4.0.0/data_source_config_action_program.go @@ -35,6 +35,10 @@ func dataSourceActionProgram() *schema.Resource { func dataSourceActionProgramRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetActionProgram(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_aptimizer_profile.go b/4.0.0/data_source_config_aptimizer_profile.go index 7ed51617..514f0043 100644 --- a/4.0.0/data_source_config_aptimizer_profile.go +++ b/4.0.0/data_source_config_aptimizer_profile.go @@ -69,6 +69,10 @@ func dataSourceAptimizerProfile() *schema.Resource { func dataSourceAptimizerProfileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerProfile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_aptimizer_scope.go b/4.0.0/data_source_config_aptimizer_scope.go index ae0ed1f7..057b0526 100644 --- a/4.0.0/data_source_config_aptimizer_scope.go +++ b/4.0.0/data_source_config_aptimizer_scope.go @@ -51,6 +51,10 @@ func dataSourceAptimizerScope() *schema.Resource { func dataSourceAptimizerScopeRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerScope(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_bandwidth.go b/4.0.0/data_source_config_bandwidth.go index f3acc75c..2a796f7e 100644 --- a/4.0.0/data_source_config_bandwidth.go +++ b/4.0.0/data_source_config_bandwidth.go @@ -52,6 +52,10 @@ func dataSourceBandwidth() *schema.Resource { func dataSourceBandwidthRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetBandwidth(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_bgpneighbor.go b/4.0.0/data_source_config_bgpneighbor.go index d630fc2a..8e4c980e 100644 --- a/4.0.0/data_source_config_bgpneighbor.go +++ b/4.0.0/data_source_config_bgpneighbor.go @@ -86,6 +86,10 @@ func dataSourceBgpneighbor() *schema.Resource { func dataSourceBgpneighborRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetBgpneighbor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_cloud_api_credential.go b/4.0.0/data_source_config_cloud_api_credential.go index 8a70028c..9efd3a36 100644 --- a/4.0.0/data_source_config_cloud_api_credential.go +++ b/4.0.0/data_source_config_cloud_api_credential.go @@ -82,6 +82,10 @@ func dataSourceCloudApiCredential() *schema.Resource { func dataSourceCloudApiCredentialRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetCloudApiCredential(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_custom.go b/4.0.0/data_source_config_custom.go index e43376b2..2d3bfd97 100644 --- a/4.0.0/data_source_config_custom.go +++ b/4.0.0/data_source_config_custom.go @@ -60,6 +60,10 @@ func dataSourceCustom() *schema.Resource { func dataSourceCustomRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetCustom(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_dns_server_zone.go b/4.0.0/data_source_config_dns_server_zone.go index 943ed672..7afc03d6 100644 --- a/4.0.0/data_source_config_dns_server_zone.go +++ b/4.0.0/data_source_config_dns_server_zone.go @@ -41,6 +41,10 @@ func dataSourceDnsServerZone() *schema.Resource { func dataSourceDnsServerZoneRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZone(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_dns_server_zone_file.go b/4.0.0/data_source_config_dns_server_zone_file.go index 0b8ca288..3eb33d81 100644 --- a/4.0.0/data_source_config_dns_server_zone_file.go +++ b/4.0.0/data_source_config_dns_server_zone_file.go @@ -35,6 +35,10 @@ func dataSourceDnsServerZoneFile() *schema.Resource { func dataSourceDnsServerZoneFileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZoneFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_event_type.go b/4.0.0/data_source_config_event_type.go index a4835edc..4f29328f 100644 --- a/4.0.0/data_source_config_event_type.go +++ b/4.0.0/data_source_config_event_type.go @@ -255,6 +255,10 @@ func dataSourceEventType() *schema.Resource { func dataSourceEventTypeRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetEventType(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_extra_file.go b/4.0.0/data_source_config_extra_file.go index 3350fe53..47cf524e 100644 --- a/4.0.0/data_source_config_extra_file.go +++ b/4.0.0/data_source_config_extra_file.go @@ -35,6 +35,10 @@ func dataSourceExtraFile() *schema.Resource { func dataSourceExtraFileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetExtraFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_glb_service.go b/4.0.0/data_source_config_glb_service.go index 412f4dc6..a993b368 100644 --- a/4.0.0/data_source_config_glb_service.go +++ b/4.0.0/data_source_config_glb_service.go @@ -243,6 +243,10 @@ func dataSourceGlbService() *schema.Resource { func dataSourceGlbServiceRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetGlbService(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_kerberos_keytab.go b/4.0.0/data_source_config_kerberos_keytab.go index 975ae7df..ee0ac7a3 100644 --- a/4.0.0/data_source_config_kerberos_keytab.go +++ b/4.0.0/data_source_config_kerberos_keytab.go @@ -35,6 +35,10 @@ func dataSourceKerberosKeytab() *schema.Resource { func dataSourceKerberosKeytabRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKeytab(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_kerberos_krb5conf.go b/4.0.0/data_source_config_kerberos_krb5conf.go index 25609609..8986c02f 100644 --- a/4.0.0/data_source_config_kerberos_krb5conf.go +++ b/4.0.0/data_source_config_kerberos_krb5conf.go @@ -35,6 +35,10 @@ func dataSourceKerberosKrb5Conf() *schema.Resource { func dataSourceKerberosKrb5ConfRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKrb5Conf(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_kerberos_principal.go b/4.0.0/data_source_config_kerberos_principal.go index 8d45056f..52f29f47 100644 --- a/4.0.0/data_source_config_kerberos_principal.go +++ b/4.0.0/data_source_config_kerberos_principal.go @@ -65,6 +65,10 @@ func dataSourceKerberosPrincipal() *schema.Resource { func dataSourceKerberosPrincipalRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosPrincipal(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_license_key.go b/4.0.0/data_source_config_license_key.go index 30c6093a..5b1aca72 100644 --- a/4.0.0/data_source_config_license_key.go +++ b/4.0.0/data_source_config_license_key.go @@ -35,6 +35,10 @@ func dataSourceLicenseKey() *schema.Resource { func dataSourceLicenseKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLicenseKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_location.go b/4.0.0/data_source_config_location.go index c243baaa..f5735d97 100644 --- a/4.0.0/data_source_config_location.go +++ b/4.0.0/data_source_config_location.go @@ -65,6 +65,10 @@ func dataSourceLocation() *schema.Resource { func dataSourceLocationRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLocation(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_log_export.go b/4.0.0/data_source_config_log_export.go index d3af4e85..34d4e285 100644 --- a/4.0.0/data_source_config_log_export.go +++ b/4.0.0/data_source_config_log_export.go @@ -104,6 +104,10 @@ func dataSourceLogExport() *schema.Resource { func dataSourceLogExportRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLogExport(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_monitor.go b/4.0.0/data_source_config_monitor.go index efbba572..ac296cf0 100644 --- a/4.0.0/data_source_config_monitor.go +++ b/4.0.0/data_source_config_monitor.go @@ -274,6 +274,10 @@ func dataSourceMonitor() *schema.Resource { func dataSourceMonitorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_monitor_script.go b/4.0.0/data_source_config_monitor_script.go index d1a7af7a..8964a89c 100644 --- a/4.0.0/data_source_config_monitor_script.go +++ b/4.0.0/data_source_config_monitor_script.go @@ -35,6 +35,10 @@ func dataSourceMonitorScript() *schema.Resource { func dataSourceMonitorScriptRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetMonitorScript(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_persistence.go b/4.0.0/data_source_config_persistence.go index b09626c5..ad1753d3 100644 --- a/4.0.0/data_source_config_persistence.go +++ b/4.0.0/data_source_config_persistence.go @@ -96,6 +96,10 @@ func dataSourcePersistence() *schema.Resource { func dataSourcePersistenceRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetPersistence(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_pool.go b/4.0.0/data_source_config_pool.go index 898add80..7084422d 100644 --- a/4.0.0/data_source_config_pool.go +++ b/4.0.0/data_source_config_pool.go @@ -754,6 +754,10 @@ func dataSourcePool() *schema.Resource { func dataSourcePoolRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetPool(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_protection.go b/4.0.0/data_source_config_protection.go index 8c7b8067..4b64781b 100644 --- a/4.0.0/data_source_config_protection.go +++ b/4.0.0/data_source_config_protection.go @@ -228,6 +228,10 @@ func dataSourceProtection() *schema.Resource { func dataSourceProtectionRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetProtection(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_rate.go b/4.0.0/data_source_config_rate.go index ea11b6ce..d4ed004c 100644 --- a/4.0.0/data_source_config_rate.go +++ b/4.0.0/data_source_config_rate.go @@ -56,6 +56,10 @@ func dataSourceRate() *schema.Resource { func dataSourceRateRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRate(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_rule.go b/4.0.0/data_source_config_rule.go index 4bafdd62..f1c41741 100644 --- a/4.0.0/data_source_config_rule.go +++ b/4.0.0/data_source_config_rule.go @@ -35,6 +35,10 @@ func dataSourceRule() *schema.Resource { func dataSourceRuleRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRule(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_rule_authenticator.go b/4.0.0/data_source_config_rule_authenticator.go index c7717b33..048ee4d8 100644 --- a/4.0.0/data_source_config_rule_authenticator.go +++ b/4.0.0/data_source_config_rule_authenticator.go @@ -110,6 +110,10 @@ func dataSourceRuleAuthenticator() *schema.Resource { func dataSourceRuleAuthenticatorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRuleAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_service_level_monitor.go b/4.0.0/data_source_config_service_level_monitor.go index 59340774..1a3eeadf 100644 --- a/4.0.0/data_source_config_service_level_monitor.go +++ b/4.0.0/data_source_config_service_level_monitor.go @@ -62,6 +62,10 @@ func dataSourceServiceLevelMonitor() *schema.Resource { func dataSourceServiceLevelMonitorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetServiceLevelMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_ssl_ca.go b/4.0.0/data_source_config_ssl_ca.go index accb8461..742b7597 100644 --- a/4.0.0/data_source_config_ssl_ca.go +++ b/4.0.0/data_source_config_ssl_ca.go @@ -35,6 +35,10 @@ func dataSourceSslCa() *schema.Resource { func dataSourceSslCaRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslCa(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_ssl_client_key.go b/4.0.0/data_source_config_ssl_client_key.go index c3ab4fe3..79261511 100644 --- a/4.0.0/data_source_config_ssl_client_key.go +++ b/4.0.0/data_source_config_ssl_client_key.go @@ -53,6 +53,10 @@ func dataSourceSslClientKey() *schema.Resource { func dataSourceSslClientKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslClientKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_ssl_server_key.go b/4.0.0/data_source_config_ssl_server_key.go index 932792c1..228b9c4b 100644 --- a/4.0.0/data_source_config_ssl_server_key.go +++ b/4.0.0/data_source_config_ssl_server_key.go @@ -53,6 +53,10 @@ func dataSourceSslServerKey() *schema.Resource { func dataSourceSslServerKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslServerKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_traffic_ip_group.go b/4.0.0/data_source_config_traffic_ip_group.go index 3ffe4592..07739c84 100644 --- a/4.0.0/data_source_config_traffic_ip_group.go +++ b/4.0.0/data_source_config_traffic_ip_group.go @@ -206,6 +206,10 @@ func dataSourceTrafficIpGroup() *schema.Resource { func dataSourceTrafficIpGroupRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetTrafficIpGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_traffic_manager.go b/4.0.0/data_source_config_traffic_manager.go index 9578c524..291a7a0f 100644 --- a/4.0.0/data_source_config_traffic_manager.go +++ b/4.0.0/data_source_config_traffic_manager.go @@ -897,6 +897,10 @@ func dataSourceTrafficManager() *schema.Resource { func dataSourceTrafficManagerRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetTrafficManager(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_user_authenticator.go b/4.0.0/data_source_config_user_authenticator.go index 0b07f976..d0105700 100644 --- a/4.0.0/data_source_config_user_authenticator.go +++ b/4.0.0/data_source_config_user_authenticator.go @@ -293,6 +293,10 @@ func dataSourceUserAuthenticator() *schema.Resource { func dataSourceUserAuthenticatorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetUserAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_user_group.go b/4.0.0/data_source_config_user_group.go index ce7670e0..4f563856 100644 --- a/4.0.0/data_source_config_user_group.go +++ b/4.0.0/data_source_config_user_group.go @@ -86,6 +86,10 @@ func dataSourceUserGroup() *schema.Resource { func dataSourceUserGroupRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetUserGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/data_source_config_virtual_server.go b/4.0.0/data_source_config_virtual_server.go index 7380812a..c035b25c 100644 --- a/4.0.0/data_source_config_virtual_server.go +++ b/4.0.0/data_source_config_virtual_server.go @@ -1607,6 +1607,10 @@ func dataSourceVirtualServer() *schema.Resource { func dataSourceVirtualServerRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetVirtualServer(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_action.go b/4.0.0/resource_action.go index d4115ac8..06836b1f 100644 --- a/4.0.0/resource_action.go +++ b/4.0.0/resource_action.go @@ -223,6 +223,10 @@ func resourceAction() *schema.Resource { func resourceActionRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAction(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -278,6 +282,9 @@ func resourceActionRead(d *schema.ResourceData, tm interface{}) error { func resourceActionExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetAction(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_action_program.go b/4.0.0/resource_action_program.go index 5d17ee88..1eecb2b9 100644 --- a/4.0.0/resource_action_program.go +++ b/4.0.0/resource_action_program.go @@ -44,6 +44,10 @@ func resourceActionProgram() *schema.Resource { func resourceActionProgramRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetActionProgram(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceActionProgramRead(d *schema.ResourceData, tm interface{}) error { func resourceActionProgramExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetActionProgram(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_aptimizer_profile.go b/4.0.0/resource_aptimizer_profile.go index d6bb5fe9..026bbe11 100644 --- a/4.0.0/resource_aptimizer_profile.go +++ b/4.0.0/resource_aptimizer_profile.go @@ -77,6 +77,10 @@ func resourceAptimizerProfile() *schema.Resource { func resourceAptimizerProfileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerProfile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -96,6 +100,9 @@ func resourceAptimizerProfileRead(d *schema.ResourceData, tm interface{}) error func resourceAptimizerProfileExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerProfile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_aptimizer_scope.go b/4.0.0/resource_aptimizer_scope.go index 0fb6b713..5a78c236 100644 --- a/4.0.0/resource_aptimizer_scope.go +++ b/4.0.0/resource_aptimizer_scope.go @@ -59,6 +59,10 @@ func resourceAptimizerScope() *schema.Resource { func resourceAptimizerScopeRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerScope(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -77,6 +81,9 @@ func resourceAptimizerScopeRead(d *schema.ResourceData, tm interface{}) error { func resourceAptimizerScopeExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerScope(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_bandwidth.go b/4.0.0/resource_bandwidth.go index d5af2306..493483c0 100644 --- a/4.0.0/resource_bandwidth.go +++ b/4.0.0/resource_bandwidth.go @@ -60,6 +60,10 @@ func resourceBandwidth() *schema.Resource { func resourceBandwidthRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetBandwidth(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -78,6 +82,9 @@ func resourceBandwidthRead(d *schema.ResourceData, tm interface{}) error { func resourceBandwidthExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetBandwidth(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_bgpneighbor.go b/4.0.0/resource_bgpneighbor.go index 4eefe166..3da13aba 100644 --- a/4.0.0/resource_bgpneighbor.go +++ b/4.0.0/resource_bgpneighbor.go @@ -94,6 +94,10 @@ func resourceBgpneighbor() *schema.Resource { func resourceBgpneighborRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetBgpneighbor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -116,6 +120,9 @@ func resourceBgpneighborRead(d *schema.ResourceData, tm interface{}) error { func resourceBgpneighborExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetBgpneighbor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_cloud_api_credential.go b/4.0.0/resource_cloud_api_credential.go index a07b0de3..f84791ea 100644 --- a/4.0.0/resource_cloud_api_credential.go +++ b/4.0.0/resource_cloud_api_credential.go @@ -90,6 +90,10 @@ func resourceCloudApiCredential() *schema.Resource { func resourceCloudApiCredentialRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetCloudApiCredential(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -112,6 +116,9 @@ func resourceCloudApiCredentialRead(d *schema.ResourceData, tm interface{}) erro func resourceCloudApiCredentialExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetCloudApiCredential(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_custom.go b/4.0.0/resource_custom.go index b1a3f4d3..49b3426d 100644 --- a/4.0.0/resource_custom.go +++ b/4.0.0/resource_custom.go @@ -68,6 +68,10 @@ func resourceCustom() *schema.Resource { func resourceCustomRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetCustom(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -98,6 +102,9 @@ func resourceCustomRead(d *schema.ResourceData, tm interface{}) error { func resourceCustomExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetCustom(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_dns_server_zone.go b/4.0.0/resource_dns_server_zone.go index 8a76252c..db1178f4 100644 --- a/4.0.0/resource_dns_server_zone.go +++ b/4.0.0/resource_dns_server_zone.go @@ -49,6 +49,10 @@ func resourceDnsServerZone() *schema.Resource { func resourceDnsServerZoneRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZone(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -66,6 +70,9 @@ func resourceDnsServerZoneRead(d *schema.ResourceData, tm interface{}) error { func resourceDnsServerZoneExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZone(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_dns_server_zone_file.go b/4.0.0/resource_dns_server_zone_file.go index cd7ddda7..038896d7 100644 --- a/4.0.0/resource_dns_server_zone_file.go +++ b/4.0.0/resource_dns_server_zone_file.go @@ -44,6 +44,10 @@ func resourceDnsServerZoneFile() *schema.Resource { func resourceDnsServerZoneFileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZoneFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceDnsServerZoneFileRead(d *schema.ResourceData, tm interface{}) error func resourceDnsServerZoneFileExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZoneFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_event_type.go b/4.0.0/resource_event_type.go index 17031122..c00b90f0 100644 --- a/4.0.0/resource_event_type.go +++ b/4.0.0/resource_event_type.go @@ -263,6 +263,10 @@ func resourceEventType() *schema.Resource { func resourceEventTypeRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetEventType(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -310,6 +314,9 @@ func resourceEventTypeRead(d *schema.ResourceData, tm interface{}) error { func resourceEventTypeExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetEventType(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_extra_file.go b/4.0.0/resource_extra_file.go index 840a1b21..e33f9d70 100644 --- a/4.0.0/resource_extra_file.go +++ b/4.0.0/resource_extra_file.go @@ -44,6 +44,10 @@ func resourceExtraFile() *schema.Resource { func resourceExtraFileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetExtraFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceExtraFileRead(d *schema.ResourceData, tm interface{}) error { func resourceExtraFileExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetExtraFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_glb_service.go b/4.0.0/resource_glb_service.go index d44c20fc..22b3c0fa 100644 --- a/4.0.0/resource_glb_service.go +++ b/4.0.0/resource_glb_service.go @@ -251,6 +251,10 @@ func resourceGlbService() *schema.Resource { func resourceGlbServiceRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetGlbService(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -319,6 +323,9 @@ func resourceGlbServiceRead(d *schema.ResourceData, tm interface{}) error { func resourceGlbServiceExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetGlbService(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_kerberos_keytab.go b/4.0.0/resource_kerberos_keytab.go index 2943e295..6a3a440a 100644 --- a/4.0.0/resource_kerberos_keytab.go +++ b/4.0.0/resource_kerberos_keytab.go @@ -44,6 +44,10 @@ func resourceKerberosKeytab() *schema.Resource { func resourceKerberosKeytabRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKeytab(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceKerberosKeytabRead(d *schema.ResourceData, tm interface{}) error { func resourceKerberosKeytabExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKeytab(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_kerberos_krb5conf.go b/4.0.0/resource_kerberos_krb5conf.go index 38c4212a..0bf41c2e 100644 --- a/4.0.0/resource_kerberos_krb5conf.go +++ b/4.0.0/resource_kerberos_krb5conf.go @@ -44,6 +44,10 @@ func resourceKerberosKrb5Conf() *schema.Resource { func resourceKerberosKrb5ConfRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKrb5Conf(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceKerberosKrb5ConfRead(d *schema.ResourceData, tm interface{}) error func resourceKerberosKrb5ConfExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKrb5Conf(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_kerberos_principal.go b/4.0.0/resource_kerberos_principal.go index 82e215e4..695b43d7 100644 --- a/4.0.0/resource_kerberos_principal.go +++ b/4.0.0/resource_kerberos_principal.go @@ -73,6 +73,10 @@ func resourceKerberosPrincipal() *schema.Resource { func resourceKerberosPrincipalRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosPrincipal(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -93,6 +97,9 @@ func resourceKerberosPrincipalRead(d *schema.ResourceData, tm interface{}) error func resourceKerberosPrincipalExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetKerberosPrincipal(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_license_key.go b/4.0.0/resource_license_key.go index 6684a9c6..74b740f3 100644 --- a/4.0.0/resource_license_key.go +++ b/4.0.0/resource_license_key.go @@ -44,6 +44,10 @@ func resourceLicenseKey() *schema.Resource { func resourceLicenseKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLicenseKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceLicenseKeyRead(d *schema.ResourceData, tm interface{}) error { func resourceLicenseKeyExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetLicenseKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_location.go b/4.0.0/resource_location.go index de2186d6..519edd23 100644 --- a/4.0.0/resource_location.go +++ b/4.0.0/resource_location.go @@ -73,6 +73,10 @@ func resourceLocation() *schema.Resource { func resourceLocationRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLocation(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -93,6 +97,9 @@ func resourceLocationRead(d *schema.ResourceData, tm interface{}) error { func resourceLocationExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetLocation(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_log_export.go b/4.0.0/resource_log_export.go index a20fa1d0..1e332a42 100644 --- a/4.0.0/resource_log_export.go +++ b/4.0.0/resource_log_export.go @@ -112,6 +112,10 @@ func resourceLogExport() *schema.Resource { func resourceLogExportRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLogExport(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -148,6 +152,9 @@ func resourceLogExportRead(d *schema.ResourceData, tm interface{}) error { func resourceLogExportExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetLogExport(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_monitor.go b/4.0.0/resource_monitor.go index d475aab0..21a565c1 100644 --- a/4.0.0/resource_monitor.go +++ b/4.0.0/resource_monitor.go @@ -282,6 +282,10 @@ func resourceMonitor() *schema.Resource { func resourceMonitorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -343,6 +347,9 @@ func resourceMonitorRead(d *schema.ResourceData, tm interface{}) error { func resourceMonitorExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_monitor_script.go b/4.0.0/resource_monitor_script.go index dce91fb6..7edb0830 100644 --- a/4.0.0/resource_monitor_script.go +++ b/4.0.0/resource_monitor_script.go @@ -44,6 +44,10 @@ func resourceMonitorScript() *schema.Resource { func resourceMonitorScriptRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetMonitorScript(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceMonitorScriptRead(d *schema.ResourceData, tm interface{}) error { func resourceMonitorScriptExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetMonitorScript(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_persistence.go b/4.0.0/resource_persistence.go index 2f523801..661b03c9 100644 --- a/4.0.0/resource_persistence.go +++ b/4.0.0/resource_persistence.go @@ -104,6 +104,10 @@ func resourcePersistence() *schema.Resource { func resourcePersistenceRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetPersistence(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -127,6 +131,9 @@ func resourcePersistenceRead(d *schema.ResourceData, tm interface{}) error { func resourcePersistenceExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetPersistence(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_pool.go b/4.0.0/resource_pool.go index b8323412..fce9c6c5 100644 --- a/4.0.0/resource_pool.go +++ b/4.0.0/resource_pool.go @@ -782,6 +782,10 @@ func resourcePool() *schema.Resource { func resourcePoolRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetPool(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -897,6 +901,9 @@ func resourcePoolRead(d *schema.ResourceData, tm interface{}) error { func resourcePoolExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetPool(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_protection.go b/4.0.0/resource_protection.go index bb5773a1..7c5731b3 100644 --- a/4.0.0/resource_protection.go +++ b/4.0.0/resource_protection.go @@ -236,6 +236,10 @@ func resourceProtection() *schema.Resource { func resourceProtectionRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetProtection(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -272,6 +276,9 @@ func resourceProtectionRead(d *schema.ResourceData, tm interface{}) error { func resourceProtectionExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetProtection(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_rate.go b/4.0.0/resource_rate.go index 7b7c8a6e..45e23176 100644 --- a/4.0.0/resource_rate.go +++ b/4.0.0/resource_rate.go @@ -64,6 +64,10 @@ func resourceRate() *schema.Resource { func resourceRateRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRate(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -82,6 +86,9 @@ func resourceRateRead(d *schema.ResourceData, tm interface{}) error { func resourceRateExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetRate(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_rule.go b/4.0.0/resource_rule.go index a4af6d4c..2deccda5 100644 --- a/4.0.0/resource_rule.go +++ b/4.0.0/resource_rule.go @@ -44,6 +44,10 @@ func resourceRule() *schema.Resource { func resourceRuleRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRule(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceRuleRead(d *schema.ResourceData, tm interface{}) error { func resourceRuleExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetRule(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_rule_authenticator.go b/4.0.0/resource_rule_authenticator.go index 58c7d906..79a2990d 100644 --- a/4.0.0/resource_rule_authenticator.go +++ b/4.0.0/resource_rule_authenticator.go @@ -118,6 +118,10 @@ func resourceRuleAuthenticator() *schema.Resource { func resourceRuleAuthenticatorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRuleAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -144,6 +148,9 @@ func resourceRuleAuthenticatorRead(d *schema.ResourceData, tm interface{}) error func resourceRuleAuthenticatorExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetRuleAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_service_level_monitor.go b/4.0.0/resource_service_level_monitor.go index 1ceb00f6..b2318f0d 100644 --- a/4.0.0/resource_service_level_monitor.go +++ b/4.0.0/resource_service_level_monitor.go @@ -70,6 +70,10 @@ func resourceServiceLevelMonitor() *schema.Resource { func resourceServiceLevelMonitorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetServiceLevelMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -89,6 +93,9 @@ func resourceServiceLevelMonitorRead(d *schema.ResourceData, tm interface{}) err func resourceServiceLevelMonitorExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetServiceLevelMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_ssl_ca.go b/4.0.0/resource_ssl_ca.go index 815f542c..ae369e3a 100644 --- a/4.0.0/resource_ssl_ca.go +++ b/4.0.0/resource_ssl_ca.go @@ -44,6 +44,10 @@ func resourceSslCa() *schema.Resource { func resourceSslCaRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslCa(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceSslCaRead(d *schema.ResourceData, tm interface{}) error { func resourceSslCaExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetSslCa(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_ssl_client_key.go b/4.0.0/resource_ssl_client_key.go index c4c527df..0825a232 100644 --- a/4.0.0/resource_ssl_client_key.go +++ b/4.0.0/resource_ssl_client_key.go @@ -62,6 +62,10 @@ func resourceSslClientKey() *schema.Resource { func resourceSslClientKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslClientKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -81,6 +85,9 @@ func resourceSslClientKeyRead(d *schema.ResourceData, tm interface{}) error { func resourceSslClientKeyExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetSslClientKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_ssl_server_key.go b/4.0.0/resource_ssl_server_key.go index 01d4b687..5ac703f9 100644 --- a/4.0.0/resource_ssl_server_key.go +++ b/4.0.0/resource_ssl_server_key.go @@ -62,6 +62,10 @@ func resourceSslServerKey() *schema.Resource { func resourceSslServerKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslServerKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -81,6 +85,9 @@ func resourceSslServerKeyRead(d *schema.ResourceData, tm interface{}) error { func resourceSslServerKeyExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetSslServerKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_traffic_ip_group.go b/4.0.0/resource_traffic_ip_group.go index eec60618..d1ac3b6a 100644 --- a/4.0.0/resource_traffic_ip_group.go +++ b/4.0.0/resource_traffic_ip_group.go @@ -214,6 +214,10 @@ func resourceTrafficIpGroup() *schema.Resource { func resourceTrafficIpGroupRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetTrafficIpGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -261,6 +265,9 @@ func resourceTrafficIpGroupRead(d *schema.ResourceData, tm interface{}) error { func resourceTrafficIpGroupExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetTrafficIpGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_traffic_manager.go b/4.0.0/resource_traffic_manager.go index d0072108..c20b8729 100644 --- a/4.0.0/resource_traffic_manager.go +++ b/4.0.0/resource_traffic_manager.go @@ -904,6 +904,10 @@ func resourceTrafficManager() *schema.Resource { func resourceTrafficManagerRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetTrafficManager(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_user_authenticator.go b/4.0.0/resource_user_authenticator.go index 108005cd..c3cacff9 100644 --- a/4.0.0/resource_user_authenticator.go +++ b/4.0.0/resource_user_authenticator.go @@ -301,6 +301,10 @@ func resourceUserAuthenticator() *schema.Resource { func resourceUserAuthenticatorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetUserAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -349,6 +353,9 @@ func resourceUserAuthenticatorRead(d *schema.ResourceData, tm interface{}) error func resourceUserAuthenticatorExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetUserAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_user_group.go b/4.0.0/resource_user_group.go index 0426f2eb..5abd740b 100644 --- a/4.0.0/resource_user_group.go +++ b/4.0.0/resource_user_group.go @@ -94,6 +94,10 @@ func resourceUserGroup() *schema.Resource { func resourceUserGroupRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetUserGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -127,6 +131,9 @@ func resourceUserGroupRead(d *schema.ResourceData, tm interface{}) error { func resourceUserGroupExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetUserGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/4.0.0/resource_virtual_server.go b/4.0.0/resource_virtual_server.go index 738a0854..b3467062 100644 --- a/4.0.0/resource_virtual_server.go +++ b/4.0.0/resource_virtual_server.go @@ -1615,6 +1615,10 @@ func resourceVirtualServer() *schema.Resource { func resourceVirtualServerRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetVirtualServer(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -1854,6 +1858,9 @@ func resourceVirtualServerRead(d *schema.ResourceData, tm interface{}) error { func resourceVirtualServerExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetVirtualServer(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_action.go b/5.2.0/data_source_config_action.go index 0879d0e8..49949f8d 100644 --- a/5.2.0/data_source_config_action.go +++ b/5.2.0/data_source_config_action.go @@ -215,6 +215,10 @@ func dataSourceAction() *schema.Resource { func dataSourceActionRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAction(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_action_program.go b/5.2.0/data_source_config_action_program.go index dbf77cc8..3ba90144 100644 --- a/5.2.0/data_source_config_action_program.go +++ b/5.2.0/data_source_config_action_program.go @@ -35,6 +35,10 @@ func dataSourceActionProgram() *schema.Resource { func dataSourceActionProgramRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetActionProgram(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_aptimizer_profile.go b/5.2.0/data_source_config_aptimizer_profile.go index 5dd6b017..ac2ac897 100644 --- a/5.2.0/data_source_config_aptimizer_profile.go +++ b/5.2.0/data_source_config_aptimizer_profile.go @@ -69,6 +69,10 @@ func dataSourceAptimizerProfile() *schema.Resource { func dataSourceAptimizerProfileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerProfile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_aptimizer_scope.go b/5.2.0/data_source_config_aptimizer_scope.go index 83e841b4..8dd1f31e 100644 --- a/5.2.0/data_source_config_aptimizer_scope.go +++ b/5.2.0/data_source_config_aptimizer_scope.go @@ -51,6 +51,10 @@ func dataSourceAptimizerScope() *schema.Resource { func dataSourceAptimizerScopeRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerScope(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_bandwidth.go b/5.2.0/data_source_config_bandwidth.go index 0515fcec..a065e2b9 100644 --- a/5.2.0/data_source_config_bandwidth.go +++ b/5.2.0/data_source_config_bandwidth.go @@ -52,6 +52,10 @@ func dataSourceBandwidth() *schema.Resource { func dataSourceBandwidthRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetBandwidth(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_bgpneighbor.go b/5.2.0/data_source_config_bgpneighbor.go index b71d3e98..9eeeeed9 100644 --- a/5.2.0/data_source_config_bgpneighbor.go +++ b/5.2.0/data_source_config_bgpneighbor.go @@ -86,6 +86,10 @@ func dataSourceBgpneighbor() *schema.Resource { func dataSourceBgpneighborRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetBgpneighbor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_cloud_api_credential.go b/5.2.0/data_source_config_cloud_api_credential.go index 8b1a4145..9e9e26d4 100644 --- a/5.2.0/data_source_config_cloud_api_credential.go +++ b/5.2.0/data_source_config_cloud_api_credential.go @@ -82,6 +82,10 @@ func dataSourceCloudApiCredential() *schema.Resource { func dataSourceCloudApiCredentialRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetCloudApiCredential(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_custom.go b/5.2.0/data_source_config_custom.go index 2e1767b5..e35c02a3 100644 --- a/5.2.0/data_source_config_custom.go +++ b/5.2.0/data_source_config_custom.go @@ -60,6 +60,10 @@ func dataSourceCustom() *schema.Resource { func dataSourceCustomRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetCustom(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_dns_server_zone.go b/5.2.0/data_source_config_dns_server_zone.go index b301960e..29ad13fa 100644 --- a/5.2.0/data_source_config_dns_server_zone.go +++ b/5.2.0/data_source_config_dns_server_zone.go @@ -41,6 +41,10 @@ func dataSourceDnsServerZone() *schema.Resource { func dataSourceDnsServerZoneRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZone(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_dns_server_zone_file.go b/5.2.0/data_source_config_dns_server_zone_file.go index bd512270..8616225a 100644 --- a/5.2.0/data_source_config_dns_server_zone_file.go +++ b/5.2.0/data_source_config_dns_server_zone_file.go @@ -35,6 +35,10 @@ func dataSourceDnsServerZoneFile() *schema.Resource { func dataSourceDnsServerZoneFileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZoneFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_event_type.go b/5.2.0/data_source_config_event_type.go index 0419214f..1fd8fecd 100644 --- a/5.2.0/data_source_config_event_type.go +++ b/5.2.0/data_source_config_event_type.go @@ -255,6 +255,10 @@ func dataSourceEventType() *schema.Resource { func dataSourceEventTypeRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetEventType(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_extra_file.go b/5.2.0/data_source_config_extra_file.go index 15f6f7de..c0cd4a74 100644 --- a/5.2.0/data_source_config_extra_file.go +++ b/5.2.0/data_source_config_extra_file.go @@ -35,6 +35,10 @@ func dataSourceExtraFile() *schema.Resource { func dataSourceExtraFileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetExtraFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_glb_service.go b/5.2.0/data_source_config_glb_service.go index eca5f6d5..d451311c 100644 --- a/5.2.0/data_source_config_glb_service.go +++ b/5.2.0/data_source_config_glb_service.go @@ -243,6 +243,10 @@ func dataSourceGlbService() *schema.Resource { func dataSourceGlbServiceRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetGlbService(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_kerberos_keytab.go b/5.2.0/data_source_config_kerberos_keytab.go index 9d0ba6d2..df91cb74 100644 --- a/5.2.0/data_source_config_kerberos_keytab.go +++ b/5.2.0/data_source_config_kerberos_keytab.go @@ -35,6 +35,10 @@ func dataSourceKerberosKeytab() *schema.Resource { func dataSourceKerberosKeytabRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKeytab(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_kerberos_krb5conf.go b/5.2.0/data_source_config_kerberos_krb5conf.go index 18d828eb..32ab1c64 100644 --- a/5.2.0/data_source_config_kerberos_krb5conf.go +++ b/5.2.0/data_source_config_kerberos_krb5conf.go @@ -35,6 +35,10 @@ func dataSourceKerberosKrb5Conf() *schema.Resource { func dataSourceKerberosKrb5ConfRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKrb5Conf(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_kerberos_principal.go b/5.2.0/data_source_config_kerberos_principal.go index e6fa94d2..83fd003c 100644 --- a/5.2.0/data_source_config_kerberos_principal.go +++ b/5.2.0/data_source_config_kerberos_principal.go @@ -65,6 +65,10 @@ func dataSourceKerberosPrincipal() *schema.Resource { func dataSourceKerberosPrincipalRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosPrincipal(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_license_key.go b/5.2.0/data_source_config_license_key.go index 7d3d70a6..9a2be8fa 100644 --- a/5.2.0/data_source_config_license_key.go +++ b/5.2.0/data_source_config_license_key.go @@ -35,6 +35,10 @@ func dataSourceLicenseKey() *schema.Resource { func dataSourceLicenseKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLicenseKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_location.go b/5.2.0/data_source_config_location.go index 03ac77a5..cc9dad5b 100644 --- a/5.2.0/data_source_config_location.go +++ b/5.2.0/data_source_config_location.go @@ -65,6 +65,10 @@ func dataSourceLocation() *schema.Resource { func dataSourceLocationRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLocation(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_log_export.go b/5.2.0/data_source_config_log_export.go index 35b3f008..1e7bb578 100644 --- a/5.2.0/data_source_config_log_export.go +++ b/5.2.0/data_source_config_log_export.go @@ -104,6 +104,10 @@ func dataSourceLogExport() *schema.Resource { func dataSourceLogExportRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLogExport(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_monitor.go b/5.2.0/data_source_config_monitor.go index 58efb4e7..3f079e1a 100644 --- a/5.2.0/data_source_config_monitor.go +++ b/5.2.0/data_source_config_monitor.go @@ -274,6 +274,10 @@ func dataSourceMonitor() *schema.Resource { func dataSourceMonitorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_monitor_script.go b/5.2.0/data_source_config_monitor_script.go index f95183c8..a9ff5242 100644 --- a/5.2.0/data_source_config_monitor_script.go +++ b/5.2.0/data_source_config_monitor_script.go @@ -35,6 +35,10 @@ func dataSourceMonitorScript() *schema.Resource { func dataSourceMonitorScriptRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetMonitorScript(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_persistence.go b/5.2.0/data_source_config_persistence.go index af396b4d..5a059b84 100644 --- a/5.2.0/data_source_config_persistence.go +++ b/5.2.0/data_source_config_persistence.go @@ -96,6 +96,10 @@ func dataSourcePersistence() *schema.Resource { func dataSourcePersistenceRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetPersistence(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_pool.go b/5.2.0/data_source_config_pool.go index 9e4e131d..5491e698 100644 --- a/5.2.0/data_source_config_pool.go +++ b/5.2.0/data_source_config_pool.go @@ -810,6 +810,10 @@ func dataSourcePool() *schema.Resource { func dataSourcePoolRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetPool(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_protection.go b/5.2.0/data_source_config_protection.go index 0073a364..35281956 100644 --- a/5.2.0/data_source_config_protection.go +++ b/5.2.0/data_source_config_protection.go @@ -228,6 +228,10 @@ func dataSourceProtection() *schema.Resource { func dataSourceProtectionRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetProtection(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_rate.go b/5.2.0/data_source_config_rate.go index 4d64498d..ee1469be 100644 --- a/5.2.0/data_source_config_rate.go +++ b/5.2.0/data_source_config_rate.go @@ -56,6 +56,10 @@ func dataSourceRate() *schema.Resource { func dataSourceRateRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRate(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_rule.go b/5.2.0/data_source_config_rule.go index 89ffbaf4..1f7fed3f 100644 --- a/5.2.0/data_source_config_rule.go +++ b/5.2.0/data_source_config_rule.go @@ -35,6 +35,10 @@ func dataSourceRule() *schema.Resource { func dataSourceRuleRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRule(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_rule_authenticator.go b/5.2.0/data_source_config_rule_authenticator.go index adfb544f..291e2528 100644 --- a/5.2.0/data_source_config_rule_authenticator.go +++ b/5.2.0/data_source_config_rule_authenticator.go @@ -110,6 +110,10 @@ func dataSourceRuleAuthenticator() *schema.Resource { func dataSourceRuleAuthenticatorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRuleAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_saml_trustedidp.go b/5.2.0/data_source_config_saml_trustedidp.go index ab732677..5a7fb35e 100644 --- a/5.2.0/data_source_config_saml_trustedidp.go +++ b/5.2.0/data_source_config_saml_trustedidp.go @@ -62,6 +62,10 @@ func dataSourceSamlTrustedidp() *schema.Resource { func dataSourceSamlTrustedidpRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSamlTrustedidp(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_service_level_monitor.go b/5.2.0/data_source_config_service_level_monitor.go index 22b5be56..8e7067e7 100644 --- a/5.2.0/data_source_config_service_level_monitor.go +++ b/5.2.0/data_source_config_service_level_monitor.go @@ -62,6 +62,10 @@ func dataSourceServiceLevelMonitor() *schema.Resource { func dataSourceServiceLevelMonitorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetServiceLevelMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_servicediscovery.go b/5.2.0/data_source_config_servicediscovery.go index 1c5f1cab..e646b92d 100644 --- a/5.2.0/data_source_config_servicediscovery.go +++ b/5.2.0/data_source_config_servicediscovery.go @@ -35,6 +35,10 @@ func dataSourceServicediscovery() *schema.Resource { func dataSourceServicediscoveryRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetServicediscovery(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_ssl_ca.go b/5.2.0/data_source_config_ssl_ca.go index b93b77b8..5b10350c 100644 --- a/5.2.0/data_source_config_ssl_ca.go +++ b/5.2.0/data_source_config_ssl_ca.go @@ -35,6 +35,10 @@ func dataSourceSslCa() *schema.Resource { func dataSourceSslCaRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslCa(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_ssl_client_key.go b/5.2.0/data_source_config_ssl_client_key.go index 142b8557..c006cffe 100644 --- a/5.2.0/data_source_config_ssl_client_key.go +++ b/5.2.0/data_source_config_ssl_client_key.go @@ -53,6 +53,10 @@ func dataSourceSslClientKey() *schema.Resource { func dataSourceSslClientKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslClientKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_ssl_server_key.go b/5.2.0/data_source_config_ssl_server_key.go index d5750000..e3b1c75c 100644 --- a/5.2.0/data_source_config_ssl_server_key.go +++ b/5.2.0/data_source_config_ssl_server_key.go @@ -53,6 +53,10 @@ func dataSourceSslServerKey() *schema.Resource { func dataSourceSslServerKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslServerKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_ssl_ticket_key.go b/5.2.0/data_source_config_ssl_ticket_key.go index a03ea0d5..400ac5ba 100644 --- a/5.2.0/data_source_config_ssl_ticket_key.go +++ b/5.2.0/data_source_config_ssl_ticket_key.go @@ -74,6 +74,10 @@ func dataSourceSslTicketKey() *schema.Resource { func dataSourceSslTicketKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslTicketKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_traffic_ip_group.go b/5.2.0/data_source_config_traffic_ip_group.go index ec3b1dfa..7624a3dc 100644 --- a/5.2.0/data_source_config_traffic_ip_group.go +++ b/5.2.0/data_source_config_traffic_ip_group.go @@ -206,6 +206,10 @@ func dataSourceTrafficIpGroup() *schema.Resource { func dataSourceTrafficIpGroupRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetTrafficIpGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_traffic_manager.go b/5.2.0/data_source_config_traffic_manager.go index fa1509e8..7f8cb7e1 100644 --- a/5.2.0/data_source_config_traffic_manager.go +++ b/5.2.0/data_source_config_traffic_manager.go @@ -846,6 +846,10 @@ func dataSourceTrafficManager() *schema.Resource { func dataSourceTrafficManagerRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetTrafficManager(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_user_authenticator.go b/5.2.0/data_source_config_user_authenticator.go index 2b15dacd..6e19eda0 100644 --- a/5.2.0/data_source_config_user_authenticator.go +++ b/5.2.0/data_source_config_user_authenticator.go @@ -293,6 +293,10 @@ func dataSourceUserAuthenticator() *schema.Resource { func dataSourceUserAuthenticatorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetUserAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_user_group.go b/5.2.0/data_source_config_user_group.go index a547274b..22242c60 100644 --- a/5.2.0/data_source_config_user_group.go +++ b/5.2.0/data_source_config_user_group.go @@ -86,6 +86,10 @@ func dataSourceUserGroup() *schema.Resource { func dataSourceUserGroupRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetUserGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/data_source_config_virtual_server.go b/5.2.0/data_source_config_virtual_server.go index 8945d55b..5a4a8514 100644 --- a/5.2.0/data_source_config_virtual_server.go +++ b/5.2.0/data_source_config_virtual_server.go @@ -1729,6 +1729,10 @@ func dataSourceVirtualServer() *schema.Resource { func dataSourceVirtualServerRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetVirtualServer(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_action.go b/5.2.0/resource_action.go index 2389ed5f..c564d07e 100644 --- a/5.2.0/resource_action.go +++ b/5.2.0/resource_action.go @@ -223,6 +223,10 @@ func resourceAction() *schema.Resource { func resourceActionRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAction(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -278,6 +282,9 @@ func resourceActionRead(d *schema.ResourceData, tm interface{}) error { func resourceActionExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetAction(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_action_program.go b/5.2.0/resource_action_program.go index c8f1385a..aed1d6d6 100644 --- a/5.2.0/resource_action_program.go +++ b/5.2.0/resource_action_program.go @@ -44,6 +44,10 @@ func resourceActionProgram() *schema.Resource { func resourceActionProgramRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetActionProgram(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceActionProgramRead(d *schema.ResourceData, tm interface{}) error { func resourceActionProgramExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetActionProgram(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_aptimizer_profile.go b/5.2.0/resource_aptimizer_profile.go index 91ca7e5c..abdc220a 100644 --- a/5.2.0/resource_aptimizer_profile.go +++ b/5.2.0/resource_aptimizer_profile.go @@ -77,6 +77,10 @@ func resourceAptimizerProfile() *schema.Resource { func resourceAptimizerProfileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerProfile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -96,6 +100,9 @@ func resourceAptimizerProfileRead(d *schema.ResourceData, tm interface{}) error func resourceAptimizerProfileExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerProfile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_aptimizer_scope.go b/5.2.0/resource_aptimizer_scope.go index e40bd8e0..b00a21b2 100644 --- a/5.2.0/resource_aptimizer_scope.go +++ b/5.2.0/resource_aptimizer_scope.go @@ -59,6 +59,10 @@ func resourceAptimizerScope() *schema.Resource { func resourceAptimizerScopeRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerScope(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -77,6 +81,9 @@ func resourceAptimizerScopeRead(d *schema.ResourceData, tm interface{}) error { func resourceAptimizerScopeExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetAptimizerScope(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_bandwidth.go b/5.2.0/resource_bandwidth.go index f7cedab0..e768acf8 100644 --- a/5.2.0/resource_bandwidth.go +++ b/5.2.0/resource_bandwidth.go @@ -60,6 +60,10 @@ func resourceBandwidth() *schema.Resource { func resourceBandwidthRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetBandwidth(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -78,6 +82,9 @@ func resourceBandwidthRead(d *schema.ResourceData, tm interface{}) error { func resourceBandwidthExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetBandwidth(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_bgpneighbor.go b/5.2.0/resource_bgpneighbor.go index 88075b6c..1a93fb6d 100644 --- a/5.2.0/resource_bgpneighbor.go +++ b/5.2.0/resource_bgpneighbor.go @@ -94,6 +94,10 @@ func resourceBgpneighbor() *schema.Resource { func resourceBgpneighborRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetBgpneighbor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -116,6 +120,9 @@ func resourceBgpneighborRead(d *schema.ResourceData, tm interface{}) error { func resourceBgpneighborExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetBgpneighbor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_cloud_api_credential.go b/5.2.0/resource_cloud_api_credential.go index 116edbc9..40ff3982 100644 --- a/5.2.0/resource_cloud_api_credential.go +++ b/5.2.0/resource_cloud_api_credential.go @@ -90,6 +90,10 @@ func resourceCloudApiCredential() *schema.Resource { func resourceCloudApiCredentialRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetCloudApiCredential(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -112,6 +116,9 @@ func resourceCloudApiCredentialRead(d *schema.ResourceData, tm interface{}) erro func resourceCloudApiCredentialExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetCloudApiCredential(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_custom.go b/5.2.0/resource_custom.go index a362f3e0..663588c8 100644 --- a/5.2.0/resource_custom.go +++ b/5.2.0/resource_custom.go @@ -68,6 +68,10 @@ func resourceCustom() *schema.Resource { func resourceCustomRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetCustom(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -98,6 +102,9 @@ func resourceCustomRead(d *schema.ResourceData, tm interface{}) error { func resourceCustomExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetCustom(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_dns_server_zone.go b/5.2.0/resource_dns_server_zone.go index 2cb62efb..4f69c480 100644 --- a/5.2.0/resource_dns_server_zone.go +++ b/5.2.0/resource_dns_server_zone.go @@ -49,6 +49,10 @@ func resourceDnsServerZone() *schema.Resource { func resourceDnsServerZoneRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZone(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -66,6 +70,9 @@ func resourceDnsServerZoneRead(d *schema.ResourceData, tm interface{}) error { func resourceDnsServerZoneExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZone(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_dns_server_zone_file.go b/5.2.0/resource_dns_server_zone_file.go index b53e1c0c..216cc019 100644 --- a/5.2.0/resource_dns_server_zone_file.go +++ b/5.2.0/resource_dns_server_zone_file.go @@ -44,6 +44,10 @@ func resourceDnsServerZoneFile() *schema.Resource { func resourceDnsServerZoneFileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZoneFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceDnsServerZoneFileRead(d *schema.ResourceData, tm interface{}) error func resourceDnsServerZoneFileExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetDnsServerZoneFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_event_type.go b/5.2.0/resource_event_type.go index 2ed1dbd7..9c79ce49 100644 --- a/5.2.0/resource_event_type.go +++ b/5.2.0/resource_event_type.go @@ -263,6 +263,10 @@ func resourceEventType() *schema.Resource { func resourceEventTypeRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetEventType(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -310,6 +314,9 @@ func resourceEventTypeRead(d *schema.ResourceData, tm interface{}) error { func resourceEventTypeExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetEventType(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_extra_file.go b/5.2.0/resource_extra_file.go index b4d33ac2..4b0d03cb 100644 --- a/5.2.0/resource_extra_file.go +++ b/5.2.0/resource_extra_file.go @@ -44,6 +44,10 @@ func resourceExtraFile() *schema.Resource { func resourceExtraFileRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetExtraFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceExtraFileRead(d *schema.ResourceData, tm interface{}) error { func resourceExtraFileExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetExtraFile(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_glb_service.go b/5.2.0/resource_glb_service.go index ac421beb..3ac6679b 100644 --- a/5.2.0/resource_glb_service.go +++ b/5.2.0/resource_glb_service.go @@ -251,6 +251,10 @@ func resourceGlbService() *schema.Resource { func resourceGlbServiceRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetGlbService(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -319,6 +323,9 @@ func resourceGlbServiceRead(d *schema.ResourceData, tm interface{}) error { func resourceGlbServiceExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetGlbService(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_kerberos_keytab.go b/5.2.0/resource_kerberos_keytab.go index 4da0fa82..77343bac 100644 --- a/5.2.0/resource_kerberos_keytab.go +++ b/5.2.0/resource_kerberos_keytab.go @@ -44,6 +44,10 @@ func resourceKerberosKeytab() *schema.Resource { func resourceKerberosKeytabRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKeytab(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceKerberosKeytabRead(d *schema.ResourceData, tm interface{}) error { func resourceKerberosKeytabExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKeytab(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_kerberos_krb5conf.go b/5.2.0/resource_kerberos_krb5conf.go index 9575da34..f097dd4d 100644 --- a/5.2.0/resource_kerberos_krb5conf.go +++ b/5.2.0/resource_kerberos_krb5conf.go @@ -44,6 +44,10 @@ func resourceKerberosKrb5Conf() *schema.Resource { func resourceKerberosKrb5ConfRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKrb5Conf(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceKerberosKrb5ConfRead(d *schema.ResourceData, tm interface{}) error func resourceKerberosKrb5ConfExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetKerberosKrb5Conf(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_kerberos_principal.go b/5.2.0/resource_kerberos_principal.go index 8017088a..85b5175f 100644 --- a/5.2.0/resource_kerberos_principal.go +++ b/5.2.0/resource_kerberos_principal.go @@ -73,6 +73,10 @@ func resourceKerberosPrincipal() *schema.Resource { func resourceKerberosPrincipalRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetKerberosPrincipal(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -93,6 +97,9 @@ func resourceKerberosPrincipalRead(d *schema.ResourceData, tm interface{}) error func resourceKerberosPrincipalExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetKerberosPrincipal(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_license_key.go b/5.2.0/resource_license_key.go index 40e7418e..acbc9141 100644 --- a/5.2.0/resource_license_key.go +++ b/5.2.0/resource_license_key.go @@ -44,6 +44,10 @@ func resourceLicenseKey() *schema.Resource { func resourceLicenseKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLicenseKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceLicenseKeyRead(d *schema.ResourceData, tm interface{}) error { func resourceLicenseKeyExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetLicenseKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_location.go b/5.2.0/resource_location.go index 48c9415f..684b9954 100644 --- a/5.2.0/resource_location.go +++ b/5.2.0/resource_location.go @@ -73,6 +73,10 @@ func resourceLocation() *schema.Resource { func resourceLocationRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLocation(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -93,6 +97,9 @@ func resourceLocationRead(d *schema.ResourceData, tm interface{}) error { func resourceLocationExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetLocation(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_log_export.go b/5.2.0/resource_log_export.go index 1c2033a9..76050830 100644 --- a/5.2.0/resource_log_export.go +++ b/5.2.0/resource_log_export.go @@ -112,6 +112,10 @@ func resourceLogExport() *schema.Resource { func resourceLogExportRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetLogExport(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -148,6 +152,9 @@ func resourceLogExportRead(d *schema.ResourceData, tm interface{}) error { func resourceLogExportExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetLogExport(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_monitor.go b/5.2.0/resource_monitor.go index 39b7b41c..51cc07db 100644 --- a/5.2.0/resource_monitor.go +++ b/5.2.0/resource_monitor.go @@ -282,6 +282,10 @@ func resourceMonitor() *schema.Resource { func resourceMonitorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -343,6 +347,9 @@ func resourceMonitorRead(d *schema.ResourceData, tm interface{}) error { func resourceMonitorExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_monitor_script.go b/5.2.0/resource_monitor_script.go index 694ad368..70bb5082 100644 --- a/5.2.0/resource_monitor_script.go +++ b/5.2.0/resource_monitor_script.go @@ -44,6 +44,10 @@ func resourceMonitorScript() *schema.Resource { func resourceMonitorScriptRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetMonitorScript(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceMonitorScriptRead(d *schema.ResourceData, tm interface{}) error { func resourceMonitorScriptExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetMonitorScript(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_persistence.go b/5.2.0/resource_persistence.go index a266f82e..ddcf696e 100644 --- a/5.2.0/resource_persistence.go +++ b/5.2.0/resource_persistence.go @@ -104,6 +104,10 @@ func resourcePersistence() *schema.Resource { func resourcePersistenceRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetPersistence(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -127,6 +131,9 @@ func resourcePersistenceRead(d *schema.ResourceData, tm interface{}) error { func resourcePersistenceExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetPersistence(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_pool.go b/5.2.0/resource_pool.go index 7ae90595..d85c9fd5 100644 --- a/5.2.0/resource_pool.go +++ b/5.2.0/resource_pool.go @@ -838,6 +838,10 @@ func resourcePool() *schema.Resource { func resourcePoolRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetPool(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -959,6 +963,9 @@ func resourcePoolRead(d *schema.ResourceData, tm interface{}) error { func resourcePoolExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetPool(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_protection.go b/5.2.0/resource_protection.go index 928cbe2e..f15eb5d0 100644 --- a/5.2.0/resource_protection.go +++ b/5.2.0/resource_protection.go @@ -236,6 +236,10 @@ func resourceProtection() *schema.Resource { func resourceProtectionRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetProtection(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -272,6 +276,9 @@ func resourceProtectionRead(d *schema.ResourceData, tm interface{}) error { func resourceProtectionExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetProtection(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_rate.go b/5.2.0/resource_rate.go index 2b6189da..62b42cce 100644 --- a/5.2.0/resource_rate.go +++ b/5.2.0/resource_rate.go @@ -64,6 +64,10 @@ func resourceRate() *schema.Resource { func resourceRateRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRate(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -82,6 +86,9 @@ func resourceRateRead(d *schema.ResourceData, tm interface{}) error { func resourceRateExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetRate(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_rule.go b/5.2.0/resource_rule.go index ba2c7dc4..96711e8d 100644 --- a/5.2.0/resource_rule.go +++ b/5.2.0/resource_rule.go @@ -44,6 +44,10 @@ func resourceRule() *schema.Resource { func resourceRuleRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRule(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceRuleRead(d *schema.ResourceData, tm interface{}) error { func resourceRuleExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetRule(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_rule_authenticator.go b/5.2.0/resource_rule_authenticator.go index da569993..48aa3ae2 100644 --- a/5.2.0/resource_rule_authenticator.go +++ b/5.2.0/resource_rule_authenticator.go @@ -118,6 +118,10 @@ func resourceRuleAuthenticator() *schema.Resource { func resourceRuleAuthenticatorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetRuleAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -144,6 +148,9 @@ func resourceRuleAuthenticatorRead(d *schema.ResourceData, tm interface{}) error func resourceRuleAuthenticatorExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetRuleAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_saml_trustedidp.go b/5.2.0/resource_saml_trustedidp.go index 56683ac9..11f356f9 100644 --- a/5.2.0/resource_saml_trustedidp.go +++ b/5.2.0/resource_saml_trustedidp.go @@ -70,6 +70,10 @@ func resourceSamlTrustedidp() *schema.Resource { func resourceSamlTrustedidpRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSamlTrustedidp(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -90,6 +94,9 @@ func resourceSamlTrustedidpRead(d *schema.ResourceData, tm interface{}) error { func resourceSamlTrustedidpExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetSamlTrustedidp(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_service_level_monitor.go b/5.2.0/resource_service_level_monitor.go index 7dadc718..fadf5bb6 100644 --- a/5.2.0/resource_service_level_monitor.go +++ b/5.2.0/resource_service_level_monitor.go @@ -70,6 +70,10 @@ func resourceServiceLevelMonitor() *schema.Resource { func resourceServiceLevelMonitorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetServiceLevelMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -89,6 +93,9 @@ func resourceServiceLevelMonitorRead(d *schema.ResourceData, tm interface{}) err func resourceServiceLevelMonitorExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetServiceLevelMonitor(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_servicediscovery.go b/5.2.0/resource_servicediscovery.go index 213b349f..3bbbd22b 100644 --- a/5.2.0/resource_servicediscovery.go +++ b/5.2.0/resource_servicediscovery.go @@ -44,6 +44,10 @@ func resourceServicediscovery() *schema.Resource { func resourceServicediscoveryRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetServicediscovery(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceServicediscoveryRead(d *schema.ResourceData, tm interface{}) error func resourceServicediscoveryExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetServicediscovery(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_ssl_ca.go b/5.2.0/resource_ssl_ca.go index 4f800c4a..abc74a08 100644 --- a/5.2.0/resource_ssl_ca.go +++ b/5.2.0/resource_ssl_ca.go @@ -44,6 +44,10 @@ func resourceSslCa() *schema.Resource { func resourceSslCaRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslCa(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -59,6 +63,9 @@ func resourceSslCaRead(d *schema.ResourceData, tm interface{}) error { func resourceSslCaExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetSslCa(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_ssl_client_key.go b/5.2.0/resource_ssl_client_key.go index efb0724c..d21ce6f8 100644 --- a/5.2.0/resource_ssl_client_key.go +++ b/5.2.0/resource_ssl_client_key.go @@ -62,6 +62,10 @@ func resourceSslClientKey() *schema.Resource { func resourceSslClientKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslClientKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -81,6 +85,9 @@ func resourceSslClientKeyRead(d *schema.ResourceData, tm interface{}) error { func resourceSslClientKeyExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetSslClientKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_ssl_server_key.go b/5.2.0/resource_ssl_server_key.go index f152c984..3700fc3f 100644 --- a/5.2.0/resource_ssl_server_key.go +++ b/5.2.0/resource_ssl_server_key.go @@ -62,6 +62,10 @@ func resourceSslServerKey() *schema.Resource { func resourceSslServerKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslServerKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -81,6 +85,9 @@ func resourceSslServerKeyRead(d *schema.ResourceData, tm interface{}) error { func resourceSslServerKeyExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetSslServerKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_ssl_ticket_key.go b/5.2.0/resource_ssl_ticket_key.go index 45d49014..fb6878b7 100644 --- a/5.2.0/resource_ssl_ticket_key.go +++ b/5.2.0/resource_ssl_ticket_key.go @@ -82,6 +82,10 @@ func resourceSslTicketKey() *schema.Resource { func resourceSslTicketKeyRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetSslTicketKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -102,6 +106,9 @@ func resourceSslTicketKeyRead(d *schema.ResourceData, tm interface{}) error { func resourceSslTicketKeyExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetSslTicketKey(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_traffic_ip_group.go b/5.2.0/resource_traffic_ip_group.go index da69317f..20e9f14d 100644 --- a/5.2.0/resource_traffic_ip_group.go +++ b/5.2.0/resource_traffic_ip_group.go @@ -214,6 +214,10 @@ func resourceTrafficIpGroup() *schema.Resource { func resourceTrafficIpGroupRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetTrafficIpGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -261,6 +265,9 @@ func resourceTrafficIpGroupRead(d *schema.ResourceData, tm interface{}) error { func resourceTrafficIpGroupExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetTrafficIpGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_traffic_manager.go b/5.2.0/resource_traffic_manager.go index d1d5a89b..727b77f8 100644 --- a/5.2.0/resource_traffic_manager.go +++ b/5.2.0/resource_traffic_manager.go @@ -853,6 +853,10 @@ func resourceTrafficManager() *schema.Resource { func resourceTrafficManagerRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetTrafficManager(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_user_authenticator.go b/5.2.0/resource_user_authenticator.go index 6b9f55c2..3670b04e 100644 --- a/5.2.0/resource_user_authenticator.go +++ b/5.2.0/resource_user_authenticator.go @@ -301,6 +301,10 @@ func resourceUserAuthenticator() *schema.Resource { func resourceUserAuthenticatorRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetUserAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -349,6 +353,9 @@ func resourceUserAuthenticatorRead(d *schema.ResourceData, tm interface{}) error func resourceUserAuthenticatorExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetUserAuthenticator(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_user_group.go b/5.2.0/resource_user_group.go index b6066eb4..6cb9821a 100644 --- a/5.2.0/resource_user_group.go +++ b/5.2.0/resource_user_group.go @@ -94,6 +94,10 @@ func resourceUserGroup() *schema.Resource { func resourceUserGroupRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetUserGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -127,6 +131,9 @@ func resourceUserGroupRead(d *schema.ResourceData, tm interface{}) error { func resourceUserGroupExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetUserGroup(objectName) if err != nil { if err.ErrorId == "resource.not_found" { diff --git a/5.2.0/resource_virtual_server.go b/5.2.0/resource_virtual_server.go index 0493ca0d..26be86d3 100644 --- a/5.2.0/resource_virtual_server.go +++ b/5.2.0/resource_virtual_server.go @@ -1737,6 +1737,10 @@ func resourceVirtualServer() *schema.Resource { func resourceVirtualServerRead(d *schema.ResourceData, tm interface{}) error { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + d.Set("name", objectName) + } object, err := tm.(*vtm.VirtualTrafficManager).GetVirtualServer(objectName) if err != nil { if err.ErrorId == "resource.not_found" { @@ -1988,6 +1992,9 @@ func resourceVirtualServerRead(d *schema.ResourceData, tm interface{}) error { func resourceVirtualServerExists(d *schema.ResourceData, tm interface{}) (bool, error) { objectName := d.Get("name").(string) + if objectName == "" { + objectName = d.Id() + } _, err := tm.(*vtm.VirtualTrafficManager).GetVirtualServer(objectName) if err != nil { if err.ErrorId == "resource.not_found" {