Skip to content

Commit

Permalink
Update dependencies on ntnx-api-golang-clients to v4.0.1 (#205)
Browse files Browse the repository at this point in the history
With v4 API being GA, we update the underlying APIs we consume in prism-go-client. This also updates the dependencies to pull in the apache licensed version of dependency. StorageContainersAPI has been relocated to a new API namespace.
  • Loading branch information
thunderboltsid authored Jan 2, 2025
1 parent adcc61c commit 82499a6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 28 deletions.
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ require (
github.com/google/uuid v1.6.0
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/keploy/go-sdk v0.9.0
github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4 v4.0.1-beta.2
github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4 v4.0.2-beta.1
github.com/nutanix/ntnx-api-golang-clients/prism-go-client/v4 v4.0.1-beta.1
github.com/nutanix/ntnx-api-golang-clients/storage-go-client/v4 v4.0.2-alpha.3
github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4 v4.0.1-beta.1
github.com/nutanix/ntnx-api-golang-clients/volumes-go-client/v4 v4.0.1-beta.1
github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4 v4.0.1
github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4 v4.0.1
github.com/nutanix/ntnx-api-golang-clients/prism-go-client/v4 v4.0.1
github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4 v4.0.1
github.com/nutanix/ntnx-api-golang-clients/volumes-go-client/v4 v4.0.1
github.com/onsi/ginkgo/v2 v2.19.0
github.com/onsi/gomega v1.33.1
github.com/stretchr/testify v1.9.0
Expand Down
22 changes: 10 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -345,18 +345,16 @@ github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJ
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4 v4.0.1-beta.2 h1:s1u5/GEw3mTZakepJoTD1OvPVU1YuioRxmKZin+W99s=
github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4 v4.0.1-beta.2/go.mod h1:sd4Fnk6MVfEDVY+8WyRoQTmLhi2SgZ3riySWErVHf8E=
github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4 v4.0.2-beta.1 h1:PvZQwYhhJtxmzLpnzEhHTpp2fV6woc6W65PHGsHzVfs=
github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4 v4.0.2-beta.1/go.mod h1:+eZgV1+xL/r84qmuFSVt5R8OFRO70rEz92jOnVgJNco=
github.com/nutanix/ntnx-api-golang-clients/prism-go-client/v4 v4.0.1-beta.1 h1:hvy3QCc2SgVidYxTq0rRPOazJOt1PP8A86kW7j6sywU=
github.com/nutanix/ntnx-api-golang-clients/prism-go-client/v4 v4.0.1-beta.1/go.mod h1:Yhk+xD4mN90OKEHnk5ARf97CX5p4+MEC/B/YIVoZeZ0=
github.com/nutanix/ntnx-api-golang-clients/storage-go-client/v4 v4.0.2-alpha.3 h1:K3I9YtqKcKKxSL4+tcxnFeLOoaptiVlpsOJ9Xzq3shM=
github.com/nutanix/ntnx-api-golang-clients/storage-go-client/v4 v4.0.2-alpha.3/go.mod h1:kz3gO87xtWnPOCP2kN7yw5LvCDVRnvg8BOWL7CarqXA=
github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4 v4.0.1-beta.1 h1:XuTRvYu1kiNjdXOYVwyjhKlFWyo9nMit6GsOYV8+5Cg=
github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4 v4.0.1-beta.1/go.mod h1:CaWm4GFpAjQQDc6YXl/dUDrHpuW54h8j6Cj7EslE4Qk=
github.com/nutanix/ntnx-api-golang-clients/volumes-go-client/v4 v4.0.1-beta.1 h1:VJSaQDnnYeNEk1mkQqEbt573OdM62+5s/B0e9kszdas=
github.com/nutanix/ntnx-api-golang-clients/volumes-go-client/v4 v4.0.1-beta.1/go.mod h1:Z+RKLwsHYxAcFbZPy2ft3QAK9kBPt9bQdqXSp7eYWkY=
github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4 v4.0.1 h1:OmOuXNY2DSsR4GUwECV2N6YK5OywXjwEFQSZou6x2HQ=
github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4 v4.0.1/go.mod h1:sd4Fnk6MVfEDVY+8WyRoQTmLhi2SgZ3riySWErVHf8E=
github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4 v4.0.1 h1:2D2ZJd5Cn0fMeWYnTEHsR1Fcv2G1BSrOAl1fVURtfn4=
github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4 v4.0.1/go.mod h1:+eZgV1+xL/r84qmuFSVt5R8OFRO70rEz92jOnVgJNco=
github.com/nutanix/ntnx-api-golang-clients/prism-go-client/v4 v4.0.1 h1:cPQ5RczmwE98P24bhWrMtJzuPKrnCMB48G7Dzzfca1g=
github.com/nutanix/ntnx-api-golang-clients/prism-go-client/v4 v4.0.1/go.mod h1:Yhk+xD4mN90OKEHnk5ARf97CX5p4+MEC/B/YIVoZeZ0=
github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4 v4.0.1 h1:4/neYUoEkERd08WwqE4vQSb8RsZdtp1RxpoYLnVFJGE=
github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4 v4.0.1/go.mod h1:CaWm4GFpAjQQDc6YXl/dUDrHpuW54h8j6Cj7EslE4Qk=
github.com/nutanix/ntnx-api-golang-clients/volumes-go-client/v4 v4.0.1 h1:drMlCQoTpIxmveSyZVDihr083zry2Au7fIB5FHtI4Ew=
github.com/nutanix/ntnx-api-golang-clients/volumes-go-client/v4 v4.0.1/go.mod h1:Z+RKLwsHYxAcFbZPy2ft3QAK9kBPt9bQdqXSp7eYWkY=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
Expand Down
18 changes: 8 additions & 10 deletions v4/v4.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import (
"net/url"
"strconv"

clusterApi "github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4/api"
clusterClient "github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4/client"
clustermgmtapi "github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4/api"
clustermgmtclient "github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4/client"
networkingApi "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/api"
networkingClient "github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4/client"
prismApi "github.com/nutanix/ntnx-api-golang-clients/prism-go-client/v4/api"
prismClient "github.com/nutanix/ntnx-api-golang-clients/prism-go-client/v4/client"
storageApi "github.com/nutanix/ntnx-api-golang-clients/storage-go-client/v4/api"
storageClient "github.com/nutanix/ntnx-api-golang-clients/storage-go-client/v4/client"
vmApi "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api"
vmClient "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client"
volumesApi "github.com/nutanix/ntnx-api-golang-clients/volumes-go-client/v4/api"
Expand All @@ -30,11 +28,11 @@ const (
// Client manages the V4 API
type Client struct {
CategoriesApiInstance *prismApi.CategoriesApi
ClustersApiInstance *clusterApi.ClustersApi
ClustersApiInstance *clustermgmtapi.ClustersApi
ImagesApiInstance *vmApi.ImagesApi
StorageContainerAPI *storageApi.StorageContainerApi
SubnetsApiInstance *networkingApi.SubnetsApi
SubnetIPReservationApi *networkingApi.SubnetIPReservationApi
StorageContainerAPI *clustermgmtapi.StorageContainersApi
TasksApiInstance *prismApi.TasksApi
VolumeGroupsApiInstance *volumesApi.VolumeGroupsApi
VmApiInstance *vmApi.VmApi
Expand Down Expand Up @@ -104,13 +102,13 @@ func initClusterApiInstance(v4Client *Client, credentials prismgoclient.Credenti
if err != nil {
return err
}
apiClientInstance := clusterClient.NewApiClient()
apiClientInstance := clustermgmtclient.NewApiClient()
apiClientInstance.VerifySSL = !credentials.Insecure
apiClientInstance.Host = ep.host
apiClientInstance.Port = ep.port
apiClientInstance.AddDefaultHeader(
authorizationHeader, fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", credentials.Username, credentials.Password)))))
v4Client.ClustersApiInstance = clusterApi.NewClustersApi(apiClientInstance)
v4Client.ClustersApiInstance = clustermgmtapi.NewClustersApi(apiClientInstance)
return nil
}

Expand Down Expand Up @@ -151,13 +149,13 @@ func initStorageApiInstance(v4Client *Client, credentials prismgoclient.Credenti
if err != nil {
return err
}
apiClientInstance := storageClient.NewApiClient()
apiClientInstance := clustermgmtclient.NewApiClient()
apiClientInstance.SetVerifySSL(!credentials.Insecure)
apiClientInstance.Host = ep.host
apiClientInstance.Port = ep.port
apiClientInstance.AddDefaultHeader(
authorizationHeader, fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", credentials.Username, credentials.Password)))))
v4Client.StorageContainerAPI = storageApi.NewStorageContainerApi(apiClientInstance)
v4Client.StorageContainerAPI = clustermgmtapi.NewStorageContainersApi(apiClientInstance)
return nil
}

Expand Down

0 comments on commit 82499a6

Please sign in to comment.