Skip to content

Commit

Permalink
Merge pull request #105 from citrix/implement_imports
Browse files Browse the repository at this point in the history
Implement imports
  • Loading branch information
George Nikolopoulos authored Jul 6, 2020
2 parents b9a537e + a7b9690 commit 4087fab
Show file tree
Hide file tree
Showing 44 changed files with 145 additions and 7 deletions.
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_auditmessageaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func resourceCitrixAdcAuditmessageaction() *schema.Resource {
Read: readAuditmessageactionFunc,
Update: updateAuditmessageactionFunc,
Delete: deleteAuditmessageactionFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"bypasssafetycheck": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_auditsyslogaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func resourceCitrixAdcAuditsyslogaction() *schema.Resource {
Read: readAuditsyslogactionFunc,
Update: updateAuditsyslogactionFunc,
Delete: deleteAuditsyslogactionFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"acl": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_auditsyslogpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ func resourceCitrixAdcAuditsyslogpolicy() *schema.Resource {
Read: readAuditsyslogpolicyFunc,
Update: updateAuditsyslogpolicyFunc,
Delete: deleteAuditsyslogpolicyFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"action": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_csaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func resourceCitrixAdcCsaction() *schema.Resource {
Read: readCsactionFunc,
Update: updateCsactionFunc,
Delete: deleteCsactionFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"comment": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_cspolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func resourceCitrixAdcCspolicy() *schema.Resource {
Read: readCspolicyFunc,
Update: updateCspolicyFunc,
Delete: deleteCspolicyFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"action": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_csvserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceCitrixAdcCsvserver() *schema.Resource {
Read: readCsvserverFunc,
Update: updateCsvserverFunc,
Delete: deleteCsvserverFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"appflowlog": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_gslbservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ func resourceCitrixAdcGslbservice() *schema.Resource {
Read: readGslbserviceFunc,
Update: updateGslbserviceFunc,
Delete: deleteGslbserviceFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"appflowlog": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_gslbsite.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceCitrixAdcGslbsite() *schema.Resource {
Read: readGslbsiteFunc,
Update: updateGslbsiteFunc,
Delete: deleteGslbsiteFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"clip": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_gslbvserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceCitrixAdcGslbvserver() *schema.Resource {
Read: readGslbvserverFunc,
Update: updateGslbvserverFunc,
Delete: deleteGslbvserverFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"appflowlog": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_inat.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceCitrixAdcInat() *schema.Resource {
Read: readInatFunc,
Update: updateInatFunc,
Delete: deleteInatFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"ftp": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func resourceCitrixAdcInterface() *schema.Resource {
Read: readInterfaceFunc,
Update: updateInterfaceFunc,
Delete: deleteInterfaceFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"autoneg": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_ipset.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func resourceCitrixAdcIpset() *schema.Resource {
Create: createIpsetFunc,
Read: readIpsetFunc,
Delete: deleteIpsetFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_lbmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceCitrixAdcLbmonitor() *schema.Resource {
Read: readLbmonitorFunc,
Update: updateLbmonitorFunc,
Delete: deleteLbmonitorFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"action": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_lbvserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceCitrixAdcLbvserver() *schema.Resource {
Read: readLbvserverFunc,
Update: updateLbvserverFunc,
Delete: deleteLbvserverFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"appflowlog": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_linkset.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceCitrixAdcLinkset() *schema.Resource {
Create: createLinksetFunc,
Read: readLinksetFunc,
Delete: deleteLinksetFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"linkset_id": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_netprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceCitrixAdcNetprofile() *schema.Resource {
Read: readNetprofileFunc,
Update: updateNetprofileFunc,
Delete: deleteNetprofileFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"mbf": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_nsacl.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceCitrixAdcNsacl() *schema.Resource {
Read: readNsaclFunc,
Update: updateNsaclFunc,
Delete: deleteNsaclFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"aclaction": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_nshttpprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func resourceCitrixAdcNshttpprofile() *schema.Resource {
Read: readNshttpprofileFunc,
Update: updateNshttpprofileFunc,
Delete: deleteNshttpprofileFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_nsip.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceCitrixAdcNsip() *schema.Resource {
Read: readNsipFunc,
Update: updateNsipFunc,
Delete: deleteNsipFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"advertiseondefaultpartition": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_nsip6.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceCitrixAdcNsip6() *schema.Resource {
Read: readNsip6Func,
Update: updateNsip6Func,
Delete: deleteNsip6Func,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"advertiseondefaultpartition": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_nsrpcnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func resourceCitrixAdcNsrpcnode() *schema.Resource {
Read: readNsrpcnodeFunc,
Update: updateNsrpcnodeFunc,
Delete: deleteNsrpcnodeFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"ipaddress": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_nstcpprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceCitrixAdcNstcpprofile() *schema.Resource {
Read: readNstcpprofileFunc,
Update: updateNstcpprofileFunc,
Delete: deleteNstcpprofileFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"ackaggregation": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_policyexpression.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func resourceCitrixAdcPolicyexpression() *schema.Resource {
Read: readPolicyexpressionFunc,
Update: updatePolicyexpressionFunc,
Delete: deletePolicyexpressionFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"clientsecuritymessage": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_responderaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceCitrixAdcResponderaction() *schema.Resource {
Update: updateResponderactionFunc,
Delete: deleteResponderactionFunc,
CustomizeDiff: customizeResponderactionDiff,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"bypasssafetycheck": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_responderpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ func resourceCitrixAdcResponderpolicy() *schema.Resource {
Update: updateResponderpolicyFunc,
Delete: deleteResponderpolicyFunc,
//CustomizeDiff: customizeResponderpolicyDiff,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"action": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_responderpolicylabel.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ func resourceCitrixAdcResponderpolicylabel() *schema.Resource {
Create: createResponderpolicylabelFunc,
Read: readResponderpolicylabelFunc,
Delete: deleteResponderpolicylabelFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"comment": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_rewriteaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceCitrixAdcRewriteaction() *schema.Resource {
Update: updateRewriteactionFunc,
Delete: deleteRewriteactionFunc,
CustomizeDiff: customizeRewriteactionDiff,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"bypasssafetycheck": &schema.Schema{
Type: schema.TypeString,
Expand Down
15 changes: 9 additions & 6 deletions citrixadc/resource_citrixadc_rewritepolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ func resourceCitrixAdcRewritepolicy() *schema.Resource {
Read: readRewritepolicyFunc,
Update: updateRewritepolicyFunc,
Delete: deleteRewritepolicyFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"action": &schema.Schema{
Type: schema.TypeString,
Expand Down Expand Up @@ -236,12 +239,6 @@ func createRewritepolicyFunc(d *schema.ResourceData, meta interface{}) error {

d.SetId(rewritepolicyName)

err = readRewritepolicyFunc(d, meta)
if err != nil {
log.Printf("[ERROR] netscaler-provider: ?? we just created this rewritepolicy but we can't read it ?? %s", rewritepolicyName)
return nil
}

if err := updateRewriteGlobalBinding(d, meta); err != nil {
return err
}
Expand All @@ -254,6 +251,12 @@ func createRewritepolicyFunc(d *schema.ResourceData, meta interface{}) error {
return err
}

err = readRewritepolicyFunc(d, meta)
if err != nil {
log.Printf("[ERROR] netscaler-provider: ?? we just created this rewritepolicy but we can't read it ?? %s", rewritepolicyName)
return nil
}

return nil
}

Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_rewritepolicylabel.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ func resourceCitrixAdcRewritepolicylabel() *schema.Resource {
Create: createRewritepolicylabelFunc,
Read: readRewritepolicylabelFunc,
Delete: deleteRewritepolicylabelFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"comment": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceCitrixAdcRoute() *schema.Resource {
Read: readRouteFunc,
Update: updateRouteFunc,
Delete: deleteRouteFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"network": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceCitrixAdcServer() *schema.Resource {
Read: readServerFunc,
Update: updateServerFunc,
Delete: deleteServerFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"comment": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceCitrixAdcService() *schema.Resource {
Read: readServiceFunc,
Update: updateServiceFunc,
Delete: deleteServiceFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"accessdown": {
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_servicegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ func resourceCitrixAdcServicegroup() *schema.Resource {
Read: readServicegroupFunc,
Update: updateServicegroupFunc,
Delete: deleteServicegroupFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"appflowlog": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_sslaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ func resourceCitrixAdcSslaction() *schema.Resource {
Create: createSslactionFunc,
Read: readSslactionFunc,
Delete: deleteSslactionFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_sslcertkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceCitrixAdcSslcertkey() *schema.Resource {
Update: updateSslcertkeyFunc,
Delete: deleteSslcertkeyFunc,
CustomizeDiff: customizeDiff,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"bundle": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_sslcipher.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ func resourceCitrixAdcSslcipher() *schema.Resource {
Read: readSslcipherFunc,
// Update: updateSslcipherFunc, // All fields are ForceNew or Computed w/out Optional, Update is superfluous
Delete: deleteSslcipherFunc,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"ciphergroupname": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions citrixadc/resource_citrixadc_sslparameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceCitrixAdcSslparameter() *schema.Resource {
Read: readSslparameterFunc,
Update: updateSslparameterFunc,
Delete: deleteSslparameterFunc, // Thought sslparameter resource donot have DELETE operation, it is required to set ID to "" d.SetID("") to maintain terraform state
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"crlmemorysizemb": &schema.Schema{
Type: schema.TypeInt,
Expand Down
Loading

0 comments on commit 4087fab

Please sign in to comment.