diff --git a/go.mod b/go.mod index c6f5266ec..0aaea9dda 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,7 @@ require ( github.com/hashicorp/go-uuid v1.0.2 github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1 github.com/mitchellh/gox v1.0.1 - github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16 v16.8.0-3635 // indirect - github.com/sirupsen/logrus v1.9.0 // indirect + github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4 v4.0.1-beta.1 github.com/spf13/cast v1.3.1 github.com/stretchr/testify v1.7.0 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index e41ae7546..4719eac3a 100644 --- a/go.sum +++ b/go.sum @@ -444,8 +444,8 @@ github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96d github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= -github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16 v16.8.0-3635 h1:eVNonw1w8i0lVNNK4Ep/P8fAb2j6EEe+VNXAQXPLThc= -github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16 v16.8.0-3635/go.mod h1:vHyQVF3IKxmip+xGxXDQznKk1ffrVa4HSiEEueiekaE= +github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4 v4.0.1-beta.1 h1:EBTbuV4zFgv+MY7a5MYIELStXPMMds1aULHllA5xdFM= +github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4 v4.0.1-beta.1/go.mod h1:+eZgV1+xL/r84qmuFSVt5R8OFRO70rEz92jOnVgJNco= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= diff --git a/nutanix/provider/provider.go b/nutanix/provider/provider.go index 8f5c296d4..e486b547d 100644 --- a/nutanix/provider/provider.go +++ b/nutanix/provider/provider.go @@ -225,6 +225,8 @@ func Provider() *schema.Provider { "nutanix_vpcs_v4": networking.DataSourceNutanixVPCsv4(), "nutanix_floating_ip_v4": networking.DatasourceNutanixFloatingIPV4(), "nutanix_floating_ips_v4": networking.DatasourceNutanixFloatingIPsV4(), + "nutanix_pbr_v4": networking.DatasourceNutanixPbrV4(), + "nutanix_pbrs_v4": networking.DatasourceNutanixPbrsV4(), }, ResourcesMap: map[string]*schema.Resource{ "nutanix_virtual_machine": prism.ResourceNutanixVirtualMachine(), diff --git a/nutanix/sdks/v4/networking/networking.go b/nutanix/sdks/v4/networking/networking.go index 1e46ae760..564f1b7cc 100644 --- a/nutanix/sdks/v4/networking/networking.go +++ b/nutanix/sdks/v4/networking/networking.go @@ -1,8 +1,8 @@ package networking import ( - "github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16/api" - network "github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16/client" + "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/api" + network "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/client" "github.com/terraform-providers/terraform-provider-nutanix/nutanix/client" ) @@ -10,6 +10,7 @@ type NetworkingClient struct { SubnetApiInstance *api.SubnetApi VpcApiInstance *api.VpcApi FloatingIpApiInstance *api.FloatingIpApi + RoutingPolicy *api.RoutingPolicyApi } func NewNetworkingClient(credentials client.Credentials) (*NetworkingClient, error) { @@ -32,6 +33,7 @@ func NewNetworkingClient(credentials client.Credentials) (*NetworkingClient, err SubnetApiInstance: api.NewSubnetApi(baseClient), VpcApiInstance: api.NewVpcApi(baseClient), FloatingIpApiInstance: api.NewFloatingIpApi(baseClient), + RoutingPolicy: api.NewRoutingPolicyApi(baseClient), } return f, nil diff --git a/nutanix/services/v2/networking/data_source_nutanix_floating_ip_v2.go b/nutanix/services/v2/networking/data_source_nutanix_floating_ip_v2.go index 37af95e27..e838b6039 100644 --- a/nutanix/services/v2/networking/data_source_nutanix_floating_ip_v2.go +++ b/nutanix/services/v2/networking/data_source_nutanix_floating_ip_v2.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - import1 "github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16/models/networking/v4/config" + import1 "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/models/networking/v4/config" conns "github.com/terraform-providers/terraform-provider-nutanix/nutanix" diff --git a/nutanix/services/v2/networking/data_source_nutanix_floating_ips_v2.go b/nutanix/services/v2/networking/data_source_nutanix_floating_ips_v2.go index 4dd4de114..da84fe5d4 100644 --- a/nutanix/services/v2/networking/data_source_nutanix_floating_ips_v2.go +++ b/nutanix/services/v2/networking/data_source_nutanix_floating_ips_v2.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - import1 "github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16/models/networking/v4/config" + import1 "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/models/networking/v4/config" conns "github.com/terraform-providers/terraform-provider-nutanix/nutanix" "github.com/terraform-providers/terraform-provider-nutanix/utils" ) diff --git a/nutanix/services/v2/networking/data_source_nutanix_pbr_v2.go b/nutanix/services/v2/networking/data_source_nutanix_pbr_v2.go new file mode 100644 index 000000000..5eff1ea36 --- /dev/null +++ b/nutanix/services/v2/networking/data_source_nutanix_pbr_v2.go @@ -0,0 +1,516 @@ +package networking + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + import1 "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/models/networking/v4/config" + conns "github.com/terraform-providers/terraform-provider-nutanix/nutanix" + "github.com/terraform-providers/terraform-provider-nutanix/utils" +) + +func DatasourceNutanixPbrV4() *schema.Resource { + return &schema.Resource{ + ReadContext: DatasourceNutanixPbrV4Read, + Schema: map[string]*schema.Schema{ + "ext_id": { + Type: schema.TypeString, + Required: true, + }, + "tenant_id": { + Type: schema.TypeString, + Computed: true, + }, + "links": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": { + Type: schema.TypeString, + Computed: true, + }, + "rel": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "metadata": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: DatasourceMetadataSchemaV4(), + }, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "description": { + Type: schema.TypeString, + Computed: true, + }, + "priority": { + Type: schema.TypeInt, + Computed: true, + }, + "policies": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "policy_match": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "source": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "address_type": { + Type: schema.TypeString, + Computed: true, + }, + "subnet_prefix": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ipv4": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ip": SchemaForValuePrefixLength(), + "prefix_length": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + "ipv6": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ip": SchemaForValuePrefixLength(), + "prefix_length": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "destination": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "address_type": { + Type: schema.TypeString, + Computed: true, + }, + "subnet_prefix": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ipv4": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ip": SchemaForValuePrefixLength(), + "prefix_length": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + "ipv6": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ip": SchemaForValuePrefixLength(), + "prefix_length": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "protocol_type": { + Type: schema.TypeString, + Computed: true, + }, + "protocol_parameters": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "source_port_ranges": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_port": { + Type: schema.TypeInt, + Computed: true, + }, + "end_port": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + "destination_port_ranges": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_port": { + Type: schema.TypeInt, + Computed: true, + }, + "end_port": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + "icmp_type": { + Type: schema.TypeInt, + Computed: true, + }, + "icmp_code": { + Type: schema.TypeInt, + Computed: true, + }, + "protocol_number": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + "policy_action": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "action_type": { + Type: schema.TypeString, + Computed: true, + }, + "reroute_params": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "service_ip": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ipv4": SchemaForValuePrefixLength(), + "ipv6": SchemaForValuePrefixLength(), + }, + }, + }, + "reroute_fallback_action": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + "is_bidirectional": { + Type: schema.TypeBool, + Computed: true, + }, + }, + }, + }, + "vpc_ext_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func DatasourceNutanixPbrV4Read(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.Client).NetworkingAPI + + extID := d.Get("ext_id") + resp, err := conn.RoutingPolicy.GetRoutingPolicy(utils.StringPtr(extID.(string))) + if err != nil { + var errordata map[string]interface{} + e := json.Unmarshal([]byte(err.Error()), &errordata) + if e != nil { + return diag.FromErr(e) + } + data := errordata["data"].(map[string]interface{}) + errorList := data["error"].([]interface{}) + errorMessage := errorList[0].(map[string]interface{}) + return diag.Errorf("error while fetching routing policy : %v", errorMessage["message"]) + } + + getResp := resp.Data.GetValue().(import1.RoutingPolicy) + fmt.Println(getResp) + + if err := d.Set("name", getResp.Name); err != nil { + return diag.FromErr(err) + } + if err := d.Set("links", flattenLinks(getResp.Links)); err != nil { + return diag.FromErr(err) + } + if err := d.Set("description", getResp.Description); err != nil { + return diag.FromErr(err) + } + + if err := d.Set("tenant_id", getResp.TenantId); err != nil { + return diag.FromErr(err) + } + if err := d.Set("metadata", flattenMetadata(getResp.Metadata)); err != nil { + return diag.FromErr(err) + } + if err := d.Set("priority", getResp.Priority); err != nil { + return diag.FromErr(err) + } + if err := d.Set("vpc_ext_id", getResp.VpcExtId); err != nil { + return diag.FromErr(err) + } + if err := d.Set("policies", flattenPolicies(getResp.Policies)); err != nil { + return diag.FromErr(err) + } + + d.SetId(*getResp.ExtId) + return nil +} + +func flattenPolicies(pr []import1.RoutingPolicyRule) []interface{} { + if len(pr) > 0 { + policies := make([]interface{}, len(pr)) + + for k, v := range pr { + policy := make(map[string]interface{}) + + policy["policy_match"] = flattenPolicyMatch(v.PolicyMatch) + policy["policy_action"] = flattenRoutingPolicyAction(v.PolicyAction) + policy["is_bidirectional"] = v.IsBidirectional + + policies[k] = policy + } + return policies + } + return nil +} + +func flattenPolicyMatch(pr *import1.RoutingPolicyMatchCondition) []map[string]interface{} { + if pr != nil { + policyMatches := make([]map[string]interface{}, 0) + match := make(map[string]interface{}) + + match["source"] = flattenAddressTypeObject(pr.Source) + match["destination"] = flattenAddressTypeObject(pr.Destination) + match["protocol_type"] = flattenProtocolType(pr.ProtocolType) + match["protocol_parameters"] = flattenOneOfRoutingPolicyMatchConditionProtocolParameters(pr.ProtocolParameters) + + policyMatches = append(policyMatches, match) + return policyMatches + } + return nil +} + +func flattenAddressTypeObject(pr *import1.AddressTypeObject) []map[string]interface{} { + if pr != nil { + addressType := make([]map[string]interface{}, 0) + + address := make(map[string]interface{}) + + address["address_type"] = flattenAddressType(pr.AddressType) + address["subnet_prefix"] = flattenIPSubnet(pr.SubnetPrefix) + + addressType = append(addressType, address) + return addressType + } + return nil +} + +func flattenIPSubnet(pr *import1.IPSubnet) []map[string]interface{} { + if pr != nil { + ipsubnets := make([]map[string]interface{}, 0) + subnet := make(map[string]interface{}) + + subnet["ipv4"] = flattenIPv4Subnet(pr.Ipv4) + subnet["ipv6"] = flattenIPv6Subnet(pr.Ipv6) + + ipsubnets = append(ipsubnets, subnet) + return ipsubnets + } + return nil +} + +func flattenOneOfRoutingPolicyMatchConditionProtocolParameters(pr *import1.OneOfRoutingPolicyMatchConditionProtocolParameters) []map[string]interface{} { + if pr != nil { + protoParams := make([]map[string]interface{}, 0) + proto := make(map[string]interface{}) + + getVal := pr.ObjectType_ + + if utils.StringValue(getVal) == "networking.v4.config.LayerFourProtocolObject" { + layerObj := pr.GetValue().(import1.LayerFourProtocolObject) + + proto["source_port_ranges"] = flattenPortRange(layerObj.SourcePortRanges) + proto["destination_port_ranges"] = flattenPortRange(layerObj.DestinationPortRanges) + } + if utils.StringValue(getVal) == "networking.v4.config.ICMPObject" { + icmpObj := pr.GetValue().(import1.ICMPObject) + + proto["icmp_code"] = icmpObj.IcmpCode + proto["icmp_type"] = icmpObj.IcmpType + } + if utils.StringValue(getVal) == "networking.v4.config.ProtocolNumberObject" { + protoNum := pr.GetValue().(import1.ProtocolNumberObject) + + proto["protocol_number"] = protoNum.ProtocolNumber + } + + protoParams = append(protoParams, proto) + return protoParams + } + return nil +} + +func flattenRoutingPolicyAction(pr *import1.RoutingPolicyAction) []map[string]interface{} { + if pr != nil { + policyAction := make([]map[string]interface{}, 0) + policy := make(map[string]interface{}) + + policy["action_type"] = flattenRoutingPolicyActionType(pr.ActionType) + policy["reroute_params"] = flattenRerouteParam(pr.RerouteParams) + + policyAction = append(policyAction, policy) + return policyAction + } + return nil +} + +func flattenRerouteParam(pr []import1.RerouteParam) []interface{} { + if len(pr) > 0 { + routeParams := make([]interface{}, len(pr)) + + for k, v := range pr { + param := make(map[string]interface{}) + + param["service_ip"] = flattenNodeIPAddress(v.ServiceIp) + param["reroute_fallback_action"] = v.RerouteFallbackAction + + routeParams[k] = param + } + return routeParams + } + return nil +} + +func flattenPortRange(pr []import1.PortRange) []interface{} { + if len(pr) > 0 { + ports := make([]interface{}, len(pr)) + + for k, v := range pr { + port := make(map[string]interface{}) + + port["start_port"] = v.StartPort + port["end_port"] = v.EndPort + + ports[k] = port + } + return ports + } + return nil +} + +func flattenAddressType(pr *import1.AddressType) string { + if pr != nil { + if *pr == import1.AddressType(2) { + return "ANY" + } + if *pr == import1.AddressType(3) { + return "EXTERNAL" + } + if *pr == import1.AddressType(4) { + return "SUBNET" + } + } + return "UNKNOWN" +} + +func flattenRoutingPolicyActionType(pr *import1.RoutingPolicyActionType) string { + if pr != nil { + if *pr == import1.RoutingPolicyActionType(2) { + return "PERMIT" + } + if *pr == import1.RoutingPolicyActionType(3) { + return "DENY" + } + if *pr == import1.RoutingPolicyActionType(4) { + return "REROUTE" + } + if *pr == import1.RoutingPolicyActionType(5) { + return "FORWARD" + } + } + return "UNKNOWN" +} + +func flattenProtocolType(pr *import1.ProtocolType) string { + if pr != nil { + if *pr == import1.ProtocolType(2) { + return "ANY" + } + if *pr == import1.ProtocolType(3) { + return "ICMP" + } + if *pr == import1.ProtocolType(4) { + return "TCP" + } + if *pr == import1.ProtocolType(5) { + return "UDP" + } + if *pr == import1.ProtocolType(6) { + return "PROTOCOL_NUMBER" + } + } + return "UNKNOWN" +} diff --git a/nutanix/services/v2/networking/data_source_nutanix_pbrs_v2.go b/nutanix/services/v2/networking/data_source_nutanix_pbrs_v2.go new file mode 100644 index 000000000..d85df59e3 --- /dev/null +++ b/nutanix/services/v2/networking/data_source_nutanix_pbrs_v2.go @@ -0,0 +1,117 @@ +package networking + +import ( + "context" + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + import1 "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/models/networking/v4/config" + conns "github.com/terraform-providers/terraform-provider-nutanix/nutanix" + "github.com/terraform-providers/terraform-provider-nutanix/utils" +) + +func DatasourceNutanixPbrsV4() *schema.Resource { + return &schema.Resource{ + ReadContext: DatasourceNutanixPbrsV4Read, + Schema: map[string]*schema.Schema{ + "page": { + Type: schema.TypeInt, + Optional: true, + }, + "limit": { + Type: schema.TypeInt, + Optional: true, + }, + "filter": { + Type: schema.TypeString, + Optional: true, + }, + "order_by": { + Type: schema.TypeString, + Optional: true, + }, + "routing_policies": { + Type: schema.TypeList, + Computed: true, + Elem: DatasourceNutanixPbrV4(), + }, + }, + } +} + +func DatasourceNutanixPbrsV4Read(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.Client).NetworkingAPI + + // initialise query params + var filter, orderBy *string + var page, limit *int + + if pagef, ok := d.GetOk("page"); ok { + page = utils.IntPtr(pagef.(int)) + } else { + page = nil + } + if limitf, ok := d.GetOk("limit"); ok { + limit = utils.IntPtr(limitf.(int)) + } else { + limit = nil + } + if filterf, ok := d.GetOk("filter"); ok { + filter = utils.StringPtr(filterf.(string)) + } else { + filter = nil + } + if order, ok := d.GetOk("order_by"); ok { + orderBy = utils.StringPtr(order.(string)) + } else { + orderBy = nil + } + + resp, err := conn.RoutingPolicy.ListRoutingPolicies(page, limit, filter, orderBy, nil, nil) + if err != nil { + var errordata map[string]interface{} + e := json.Unmarshal([]byte(err.Error()), &errordata) + if e != nil { + return diag.FromErr(e) + } + data := errordata["data"].(map[string]interface{}) + errorList := data["error"].([]interface{}) + errorMessage := errorList[0].(map[string]interface{}) + return diag.Errorf("error while fetching routing policies : %v", errorMessage["message"]) + } + + getResp := resp.Data.GetValue().([]import1.RoutingPolicy) + + if err := d.Set("routing_policies", flattenRoutingEntities(getResp)); err != nil { + return diag.FromErr(err) + } + + d.SetId(resource.UniqueId()) + return nil +} + +func flattenRoutingEntities(pr []import1.RoutingPolicy) []interface{} { + if len(pr) > 0 { + routingEnts := make([]interface{}, len(pr)) + + for k, v := range pr { + entity := make(map[string]interface{}) + + entity["ext_id"] = v.ExtId + entity["tenant_id"] = v.TenantId + entity["links"] = flattenLinks(v.Links) + entity["metadata"] = flattenMetadata(v.Metadata) + entity["name"] = v.Name + entity["description"] = v.Description + entity["priority"] = v.Priority + entity["policies"] = flattenPolicies(v.Policies) + entity["vpc_ext_id"] = v.VpcExtId + + routingEnts[k] = entity + } + return routingEnts + } + return nil +} diff --git a/nutanix/services/v2/networking/data_source_nutanix_subnet_v2.go b/nutanix/services/v2/networking/data_source_nutanix_subnet_v2.go index 516936a3c..4d24f72c0 100644 --- a/nutanix/services/v2/networking/data_source_nutanix_subnet_v2.go +++ b/nutanix/services/v2/networking/data_source_nutanix_subnet_v2.go @@ -6,9 +6,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - config "github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16/models/common/v1/config" - import2 "github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16/models/common/v1/response" - import1 "github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16/models/networking/v4/config" + config "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/models/common/v1/config" + import2 "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/models/common/v1/response" + import1 "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/models/networking/v4/config" conns "github.com/terraform-providers/terraform-provider-nutanix/nutanix" "github.com/terraform-providers/terraform-provider-nutanix/utils" diff --git a/nutanix/services/v2/networking/data_source_nutanix_subnets_v2.go b/nutanix/services/v2/networking/data_source_nutanix_subnets_v2.go index 326fb5f30..9d8edf9cb 100644 --- a/nutanix/services/v2/networking/data_source_nutanix_subnets_v2.go +++ b/nutanix/services/v2/networking/data_source_nutanix_subnets_v2.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - import1 "github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16/models/networking/v4/config" + import1 "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/models/networking/v4/config" conns "github.com/terraform-providers/terraform-provider-nutanix/nutanix" "github.com/terraform-providers/terraform-provider-nutanix/utils" ) diff --git a/nutanix/services/v2/networking/data_source_nutanix_vpc_v2.go b/nutanix/services/v2/networking/data_source_nutanix_vpc_v2.go index d23aacf46..b90621542 100644 --- a/nutanix/services/v2/networking/data_source_nutanix_vpc_v2.go +++ b/nutanix/services/v2/networking/data_source_nutanix_vpc_v2.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - import1 "github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16/models/networking/v4/config" + import1 "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/models/networking/v4/config" conns "github.com/terraform-providers/terraform-provider-nutanix/nutanix" "github.com/terraform-providers/terraform-provider-nutanix/utils" ) diff --git a/nutanix/services/v2/networking/data_source_nutanix_vpcs_v2.go b/nutanix/services/v2/networking/data_source_nutanix_vpcs_v2.go index 6907f05a5..abe06f16c 100644 --- a/nutanix/services/v2/networking/data_source_nutanix_vpcs_v2.go +++ b/nutanix/services/v2/networking/data_source_nutanix_vpcs_v2.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - import1 "github.com/nutanix-core/ntnx-api-golang-sdk-internal/networking-go-client/v16/models/networking/v4/config" + import1 "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/models/networking/v4/config" conns "github.com/terraform-providers/terraform-provider-nutanix/nutanix" "github.com/terraform-providers/terraform-provider-nutanix/utils" )