Skip to content

Commit

Permalink
chore: move uuid pckage to sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
azrod committed Dec 2, 2024
1 parent 6049b98 commit f05295c
Show file tree
Hide file tree
Showing 77 changed files with 226 additions and 1,929 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0
github.com/iancoleman/strcase v0.3.0
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.13.0
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.14.0
github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339
github.com/rs/zerolog v1.33.0
github.com/thanhpk/randstr v1.0.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.13.0 h1:qqmOfyTj3LVZ2f059EhfevW1mdxo4mgFh8KLt6JzuAY=
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.13.0/go.mod h1:CTQO1VIVFvImvmKoR4ntL3HxBi5REm6ssLzUj3kv1sc=
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.14.0 h1:IHqwdPRAEfw/xP6I0COzE9hsju7Hk+TLjd3xzJ6AOqM=
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.14.0/go.mod h1:CTQO1VIVFvImvmKoR4ntL3HxBi5REm6ssLzUj3kv1sc=
github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339 h1:DEKcWLGbEhu/I6kn9NAXhVCFrbPhR+Ef7oLmpLVnnPM=
github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339/go.mod h1:11JAFfGWVmhoT4AAORKsIC5M6nI+uDGSEOScMzavgPA=
github.com/peterhellberg/link v1.2.0 h1:UA5pg3Gp/E0F2WdX7GERiNrPQrM1K6CVJUUWfHa4t6c=
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/catalog/acl_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (

"github.com/hashicorp/terraform-plugin-framework/resource"

"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/client"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/metrics"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/adminorg"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
)

// Ensure the implementation satisfies the expected interfaces.
Expand Down Expand Up @@ -289,7 +289,7 @@ func (r *aclResource) read(ctx context.Context, planOrState *ACLModel) (stateRef
return stateRefreshed, true, diags
}
x := ACLModelSharedWithUser{}
x.UserID.Set(uuid.Normalize(uuid.User, id).String())
x.UserID.Set(urn.Normalize(urn.User, id).String())
x.AccessLevel.Set(user.AccessLevel)

sharedWithUsers = append(sharedWithUsers, x)
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/catalog/acl_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
fsetvalidator "github.com/FrangipaneTeam/terraform-plugin-framework-validators/setvalidator"
fstringvalidator "github.com/FrangipaneTeam/terraform-plugin-framework-validators/stringvalidator"

"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
)

func aclSchema(_ context.Context) superschema.Schema {
Expand Down Expand Up @@ -51,7 +51,7 @@ func aclSchema(_ context.Context) superschema.Schema {
Validators: []validator.String{
stringvalidator.ExactlyOneOf(path.MatchRoot("catalog_name"), path.MatchRoot("catalog_id")),
fstringvalidator.IsURN(),
fstringvalidator.PrefixContains(uuid.Catalog.String()),
fstringvalidator.PrefixContains(urn.Catalog.String()),
},
},
},
Expand Down Expand Up @@ -111,7 +111,7 @@ func aclSchema(_ context.Context) superschema.Schema {
Required: true,
Validators: []validator.String{
fstringvalidator.IsURN(),
fstringvalidator.PrefixContains(uuid.User.String()),
fstringvalidator.PrefixContains(urn.User.String()),
},
},
DataSource: &schemaD.StringAttribute{
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/catalog/catalog_vapp_template_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (

"github.com/hashicorp/terraform-plugin-framework/datasource"

"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/client"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/metrics"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/adminorg"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
)

var (
Expand Down Expand Up @@ -107,7 +107,7 @@ func (d *vAppTemplateDataSource) Read(ctx context.Context, req datasource.ReadRe
// field ID in vAppTemplate attribute is always empty. ID exist in HREF attribute.
// get last 36 characters of href
// href ex : http://url.com/xx/xx/xx/vappTemplate-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
vappTemplateID := uuid.Normalize(uuid.VAPPTemplate, vAppTemplate.HREF[len(vAppTemplate.HREF)-36:])
vappTemplateID := urn.Normalize(urn.VAPPTemplate, vAppTemplate.HREF[len(vAppTemplate.HREF)-36:])
stateUpdated.TemplateID.Set(vappTemplateID.String())
stateUpdated.ID.Set(vappTemplateID.String())

Expand Down
11 changes: 5 additions & 6 deletions internal/provider/common/acl/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import (

superschema "github.com/FrangipaneTeam/terraform-plugin-framework-superschema"

"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
)

type SharedWithModel struct {
Expand Down Expand Up @@ -139,7 +138,7 @@ func SharedSetToAccessControl(_ *govcd.VCDClient, org *govcd.AdminOrg, input []S
subjectName = user.User.Name

oModel = &SharedWithModel{
UserID: types.StringValue(uuid.Normalize(uuid.User, common.ExtractUUID(subjectHref)).String()),
UserID: types.StringValue(urn.Normalize(urn.User, urn.ExtractUUID(subjectHref)).String()),
SubjectName: types.StringValue(subjectName),
}
} else if !item.GroupID.IsNull() && !item.GroupID.IsUnknown() {
Expand All @@ -152,7 +151,7 @@ func SharedSetToAccessControl(_ *govcd.VCDClient, org *govcd.AdminOrg, input []S
subjectType = group.Group.Type
subjectName = group.Group.Name
oModel = &SharedWithModel{
GroupID: types.StringValue(uuid.Normalize(uuid.Group, common.ExtractUUID(subjectHref)).String()),
GroupID: types.StringValue(urn.Normalize(urn.Group, urn.ExtractUUID(subjectHref)).String()),
SubjectName: types.StringValue(subjectName),
}
}
Expand Down Expand Up @@ -183,9 +182,9 @@ func AccessControlListToSharedSet(input []*govcdtypes.AccessSetting) ([]SharedWi
switch item.Subject.Type {
case govcdtypes.MimeAdminUser:

o.UserID = types.StringValue(uuid.Normalize(uuid.User, common.ExtractUUID(item.Subject.HREF)).String())
o.UserID = types.StringValue(urn.Normalize(urn.User, urn.ExtractUUID(item.Subject.HREF)).String())
case govcdtypes.MimeAdminGroup:
o.GroupID = types.StringValue(uuid.Normalize(uuid.Group, common.ExtractUUID(item.Subject.HREF)).String())
o.GroupID = types.StringValue(urn.Normalize(urn.Group, urn.ExtractUUID(item.Subject.HREF)).String())
default:
return nil, fmt.Errorf("unhandled type '%s' for item %s", item.Subject.Type, item.Subject.Name)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/common/adminorg/vdc_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package adminorg
import (
"github.com/vmware/go-vcloud-director/v2/govcd"

"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
)

// GetVDCGroupByNameOrID returns the VDC group using the name or ID provided in the argument.
func (ao *AdminOrg) GetVDCGroupByNameOrID(nameOrID string) (*govcd.VdcGroup, error) {
if uuid.IsVDCGroup(nameOrID) {
if urn.IsVDCGroup(nameOrID) {
return ao.GetVdcGroupById(nameOrID)
}
return ao.GetVdcGroupByName(nameOrID)
Expand Down
16 changes: 0 additions & 16 deletions internal/provider/common/common.go

This file was deleted.

6 changes: 3 additions & 3 deletions internal/provider/common/edgegw/edgegw.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (

"github.com/hashicorp/terraform-plugin-framework/types"

"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
sdkv1 "github.com/orange-cloudavenue/cloudavenue-sdk-go/v1"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/client"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/mutex"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
)

var ErrEdgeGatewayIDOrNameIsEmpty = fmt.Errorf("edge gateway ID or name is empty")
Expand Down Expand Up @@ -93,7 +93,7 @@ func (e EdgeGateway) GetSecurityGroupByNameOrID(nsxtFirewallGroupNameOrID string
return nil, err
}

if uuid.IsValid(nsxtFirewallGroupNameOrID) {
if urn.IsValid(nsxtFirewallGroupNameOrID) {
return e.GetNsxtFirewallGroupById(nsxtFirewallGroupNameOrID)
}

Expand Down Expand Up @@ -124,7 +124,7 @@ func (e EdgeGateway) GetIPSetByNameOrID(nsxtFirewallGroupNameOrID string) (*govc
return nil, err
}

if uuid.IsValid(nsxtFirewallGroupNameOrID) {
if urn.IsValid(nsxtFirewallGroupNameOrID) {
return e.GetIPSetByID(nsxtFirewallGroupNameOrID)
}

Expand Down
6 changes: 3 additions & 3 deletions internal/provider/edgegw/app_port_profile_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (

supertypes "github.com/FrangipaneTeam/terraform-plugin-framework-supertypes"

"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/client"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/metrics"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/edgegw"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/org"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
)

// NewAppPortProfileResource is a helper function to simplify the provider implementation.
Expand Down Expand Up @@ -297,13 +297,13 @@ func (r *appPortProfileResource) ImportState(ctx context.Context, req resource.I
EdgeGatewayName: supertypes.NewStringNull(),
}

if uuid.IsEdgeGateway(edgeIDOrName) {
if urn.IsEdgeGateway(edgeIDOrName) {
x.EdgeGatewayID.Set(edgeIDOrName)
} else {
x.EdgeGatewayName.Set(edgeIDOrName)
}

if uuid.IsAppPortProfile(appPortProfileIDOrName) {
if urn.IsAppPortProfile(appPortProfileIDOrName) {
x.ID.Set(appPortProfileIDOrName)
} else {
x.Name.Set(appPortProfileIDOrName)
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/edgegw/dhcp_forwarding_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (

"github.com/hashicorp/terraform-plugin-framework/resource"

"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/client"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/metrics"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/edgegw"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/mutex"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/org"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
)

// Ensure the implementation satisfies the expected interfaces.
Expand Down Expand Up @@ -275,7 +275,7 @@ func (r *dhcpForwardingResource) ImportState(ctx context.Context, req resource.I
return
}

if uuid.IsEdgeGateway(req.ID) {
if urn.IsEdgeGateway(req.ID) {
edgegwID = req.ID
} else {
edgegwName = req.ID
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/edgegw/edgegateway_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

"github.com/hashicorp/terraform-plugin-framework/datasource"

"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/client"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/metrics"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
)

var (
Expand Down Expand Up @@ -74,7 +74,7 @@ func (d *edgeGatewayDataSource) Read(ctx context.Context, req datasource.ReadReq
return
}

data.ID.Set(uuid.Normalize(uuid.Gateway, edgegw.GetID()).String())
data.ID.Set(urn.Normalize(urn.Gateway, edgegw.GetID()).String())
data.Tier0VrfID.Set(edgegw.GetTier0VrfID())
data.OwnerName.Set(edgegw.GetOwnerName())
data.OwnerType.Set(string(edgegw.GetOwnerType()))
Expand Down
11 changes: 5 additions & 6 deletions internal/provider/edgegw/edgegateway_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ import (
"github.com/hashicorp/terraform-plugin-framework/resource"

commoncloudavenue "github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/common/cloudavenue"
"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
v1 "github.com/orange-cloudavenue/cloudavenue-sdk-go/v1"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/client"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/metrics"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/cloudavenue"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
)

const (
Expand Down Expand Up @@ -287,7 +286,7 @@ func (r *edgeGatewayResource) Create(ctx context.Context, req resource.CreateReq
}
}
if !found {
plan.ID.Set(uuid.Normalize(uuid.Gateway, edgegw.GetID()).String())
plan.ID.Set(urn.Normalize(urn.Gateway, edgegw.GetID()).String())
plan.Name.Set(edgegw.GetName())
edgegwNew = edgegw
break
Expand Down Expand Up @@ -394,7 +393,7 @@ func (r *edgeGatewayResource) Update(ctx context.Context, req resource.UpdateReq
ctx, cancel = context.WithTimeout(ctx, updateTimeout)
defer cancel()

edgegw, err := r.client.CAVSDK.V1.EdgeGateway.Get(common.ExtractUUID(plan.ID.Get()))
edgegw, err := r.client.CAVSDK.V1.EdgeGateway.Get(urn.ExtractUUID(plan.ID.Get()))
if err != nil {
resp.Diagnostics.AddError("Error retrieving edge gateway", err.Error())
return
Expand Down Expand Up @@ -446,7 +445,7 @@ func (r *edgeGatewayResource) Delete(ctx context.Context, req resource.DeleteReq
return
}

edgegw, err := r.client.CAVSDK.V1.EdgeGateway.Get(common.ExtractUUID(state.ID.Get()))
edgegw, err := r.client.CAVSDK.V1.EdgeGateway.Get(urn.ExtractUUID(state.ID.Get()))
if err != nil {
if commoncloudavenue.IsNotFound(err) {
resp.State.RemoveResource(ctx)
Expand Down Expand Up @@ -494,7 +493,7 @@ func (r *edgeGatewayResource) read(_ context.Context, planOrState *edgeGatewayRe
}

if !planOrState.ID.IsKnown() {
stateRefreshed.ID.Set(uuid.Normalize(uuid.Gateway, edgegw.GetID()).String())
stateRefreshed.ID.Set(urn.Normalize(urn.Gateway, edgegw.GetID()).String())
}

stateRefreshed.Tier0VrfID.Set(edgegw.GetTier0VrfID())
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/edgegw/edgegateways_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (

"github.com/hashicorp/terraform-plugin-framework/datasource"

"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/client"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/metrics"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/utils"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
)

var (
Expand Down Expand Up @@ -77,7 +77,7 @@ func (d *edgeGatewaysDataSource) Read(ctx context.Context, req datasource.ReadRe
gws := make([]*edgeGatewayDataSourceModelEdgeGateway, 0)
for _, edge := range *gateways {
gw := new(edgeGatewayDataSourceModelEdgeGateway)
gw.ID.Set(uuid.Normalize(uuid.Gateway, edge.GetID()).String())
gw.ID.Set(urn.Normalize(urn.Gateway, edge.GetID()).String())
gw.Name.Set(edge.GetName())
gw.Description.Set(edge.GetDescription())
gw.OwnerType.Set(string(edge.GetOwnerType()))
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/edgegw/firewall_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (

supertypes "github.com/FrangipaneTeam/terraform-plugin-framework-supertypes"

"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/client"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/metrics"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/edgegw"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/mutex"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/org"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
)

// Ensure the implementation satisfies the expected interfaces.
Expand Down Expand Up @@ -272,8 +272,8 @@ func (r *firewallResource) ImportState(ctx context.Context, req resource.ImportS
return
}

if uuid.IsValid(req.ID) {
edgegwID = uuid.Normalize(uuid.Gateway, req.ID).String()
if urn.IsValid(req.ID) {
edgegwID = urn.Normalize(urn.Gateway, req.ID).String()
} else {
edgegwName = req.ID
}
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/edgegw/ip_set_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (

"github.com/hashicorp/terraform-plugin-framework/resource"

"github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/urn"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/client"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/metrics"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/edgegw"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/mutex"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/org"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/pkg/uuid"
)

// Ensure the implementation satisfies the expected interfaces.
Expand Down Expand Up @@ -347,7 +347,7 @@ func (r *ipSetResource) ImportState(ctx context.Context, req resource.ImportStat
return
}

if uuid.IsEdgeGateway(idParts[0]) {
if urn.IsEdgeGateway(idParts[0]) {
edgegwID = idParts[0]
} else {
edgegwName = idParts[0]
Expand Down
Loading

0 comments on commit f05295c

Please sign in to comment.