Skip to content

Commit

Permalink
enh: Switch to terraform SDKv2
Browse files Browse the repository at this point in the history
  • Loading branch information
smutel committed Apr 28, 2022
1 parent 06b9099 commit dde04e1
Show file tree
Hide file tree
Showing 1,751 changed files with 35,241 additions and 380,521 deletions.
20 changes: 4 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,32 @@ module github.com/smutel/terraform-provider-netbox
go 1.15

require (
cloud.google.com/go/iam v0.3.0 // indirect
cloud.google.com/go/storage v1.21.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/aws/aws-sdk-go v1.43.16 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/go-openapi/runtime v0.23.2
github.com/go-openapi/strfmt v0.21.2
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-getter v1.5.11 // indirect
github.com/hashicorp/go-hclog v1.2.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.3 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/go-version v1.4.0 // indirect
github.com/hashicorp/hcl/v2 v2.11.1 // indirect
github.com/hashicorp/terraform-plugin-sdk v1.17.2
github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
github.com/klauspost/compress v1.15.1 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/smutel/go-netbox v3.0.1+incompatible
github.com/spf13/afero v1.8.2 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/vmihailenco/tagparser v0.1.2 // indirect
github.com/zclconf/go-cty v1.10.0 // indirect
go.mongodb.org/mongo-driver v1.8.4 // indirect
golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect
google.golang.org/api v0.71.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 // indirect
google.golang.org/grpc v1.45.0 // indirect
)
375 changes: 37 additions & 338 deletions go.sum

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package main

import (
"github.com/hashicorp/terraform-plugin-sdk/plugin"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
"github.com/smutel/terraform-provider-netbox/netbox"
)

func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: func() terraform.ResourceProvider {
opts := &plugin.ServeOpts{
ProviderFunc: func() *schema.Provider {
return netbox.Provider()
},
})
}

plugin.Serve(opts)
}
4 changes: 2 additions & 2 deletions netbox/data_netbox_dcim_platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"regexp"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
4 changes: 2 additions & 2 deletions netbox/data_netbox_dcim_site.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"regexp"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
4 changes: 2 additions & 2 deletions netbox/data_netbox_ipam_aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/ipam"
)
Expand Down
4 changes: 2 additions & 2 deletions netbox/data_netbox_ipam_ip_addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"regexp"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/ipam"
)
Expand Down
4 changes: 2 additions & 2 deletions netbox/data_netbox_ipam_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"regexp"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/ipam"
)
Expand Down
4 changes: 2 additions & 2 deletions netbox/data_netbox_ipam_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/ipam"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_ipam_vlan.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/ipam"
)
Expand Down
4 changes: 2 additions & 2 deletions netbox/data_netbox_ipam_vlan_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"regexp"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/ipam"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/circuits"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_circuits_circuit_types_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/circuits"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_circuits_circuits_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/circuits"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_circuits_provider_networks_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/circuits"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_circuits_providers_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/circuits"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_cables_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_console_ports_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_console_server_ports_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_device_bay_templates_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_device_bays_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_device_roles_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_device_types_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_devices_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_front_port_templates_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_front_ports_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_interface_templates_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_interfaces_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_inventory_items_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_locations_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_manufacturers_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_platforms_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_power_feeds_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_netbox_json_dcim_power_outlets_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package netbox
import (
"encoding/json"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
netboxclient "github.com/smutel/go-netbox/netbox/client"
"github.com/smutel/go-netbox/netbox/client/dcim"
)
Expand Down
Loading

0 comments on commit dde04e1

Please sign in to comment.