Skip to content

Commit

Permalink
Add v3 method for fetching PrismCentral info (#170)
Browse files Browse the repository at this point in the history
The new method returns result of /prism_central GET call.
  • Loading branch information
thunderboltsid authored Jul 23, 2024
1 parent f9d980d commit def33ae
Show file tree
Hide file tree
Showing 20 changed files with 92,172 additions and 194 deletions.
24 changes: 18 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ build: ## Build your project and put the output binary in bin/
mkdir -p bin
$(GOCMD) build -o bin/$(BINARY_NAME) .

TOOLS_BIN_DIR := hack/tools/bin

$(TOOLS_BIN_DIR):
mkdir -p $(TOOLS_BIN_DIR)

# CRD_OPTIONS define options to add to the CONTROLLER_GEN
CRD_OPTIONS ?= "crd:crdVersions=v1"

Expand All @@ -34,7 +29,23 @@ stop-keploy:
@-pkill "server"

generate: $(CONTROLLER_GEN) ## Generate zz_generated.deepcopy.go
$(CONTROLLER_GEN) paths="./..." object:headerFile="hack/boilerplate.go.txt"
controller-gen paths="./..." object:headerFile="hack/boilerplate.go.txt"

generate-v3-models: ## Generate V3 models using go-swagger
swagger generate model \
--spec=v3/swagger.json \
--target=v3 \
--skip-validation \
--model=prism_central \
--model=pc_vm \
--model=mcm_config \
--model=cmsp_config \
--model=cmsp_network_config \
--model=deployment_settings \
--model=my_ntnx_token \
--model=cluster_reference \
--model=pc_vm_nic_configuration \
--model=network_config

clean: ## Remove build related file
rm -fr ./bin vendor hack/tools/bin
Expand Down Expand Up @@ -77,3 +88,4 @@ help: ## Show this help.
if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " ${YELLOW}%-20s${GREEN}%s${RESET}\n", $$1, $$2} \
else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \
}' $(MAKEFILE_LIST)

1 change: 1 addition & 0 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
Expand Down
48 changes: 48 additions & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,54 @@
}
}
},
"[email protected]": {
"last_modified": "2024-07-07T07:43:47Z",
"resolved": "github:NixOS/nixpkgs/b60793b86201040d9dee019a05089a9150d08b5b#go-swagger",
"source": "devbox-search",
"version": "0.31.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/2hgdipfam6qzbik0idip7y3gksi90isq-go-swagger-0.31.0",
"default": true
}
],
"store_path": "/nix/store/2hgdipfam6qzbik0idip7y3gksi90isq-go-swagger-0.31.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/bnpbh9qaswwbbapqik3w1q72xv49627p-go-swagger-0.31.0",
"default": true
}
],
"store_path": "/nix/store/bnpbh9qaswwbbapqik3w1q72xv49627p-go-swagger-0.31.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/9vzdfxv7gyx0pqzc5jvc48ycqahgyr6r-go-swagger-0.31.0",
"default": true
}
],
"store_path": "/nix/store/9vzdfxv7gyx0pqzc5jvc48ycqahgyr6r-go-swagger-0.31.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/rbim3gwp9kcywxdpl7vpl8hqj3vw9jjg-go-swagger-0.31.0",
"default": true
}
],
"store_path": "/nix/store/rbim3gwp9kcywxdpl7vpl8hqj3vw9jjg-go-swagger-0.31.0"
}
}
},
"[email protected]": {
"last_modified": "2024-03-22T11:26:23Z",
"resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#go",
Expand Down
1 change: 0 additions & 1 deletion environment/credentials/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 50 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ module github.com/nutanix-cloud-native/prism-go-client

go 1.21

toolchain go1.22.2

require (
github.com/PaesslerAG/jsonpath v0.1.1
github.com/go-logr/logr v1.2.3
github.com/go-logr/logr v1.4.1
github.com/go-logr/zapr v1.2.3
github.com/google/uuid v1.3.0
github.com/go-openapi/errors v0.22.0
github.com/go-openapi/strfmt v0.23.0
github.com/go-openapi/swag v0.23.0
github.com/go-openapi/validate v0.24.0
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
Expand All @@ -15,71 +21,80 @@ require (
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/onsi/ginkgo/v2 v2.7.0
github.com/onsi/gomega v1.26.0
github.com/stretchr/testify v1.8.1
github.com/onsi/ginkgo/v2 v2.19.0
github.com/onsi/gomega v1.33.1
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.24.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.26.1
k8s.io/apimachinery v0.26.1
k8s.io/client-go v0.26.1
k8s.io/api v0.29.7
k8s.io/apimachinery v0.29.7
k8s.io/client-go v0.29.7
)

require (
github.com/PaesslerAG/gval v1.0.0 // indirect
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/creasty/defaults v1.6.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fullstorydev/grpcurl v1.8.7 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/loads v0.22.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.10.1 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/go-test/deep v1.0.8 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect
github.com/hashicorp/go-retryablehttp v0.7.1 // indirect
github.com/jhump/protoreflect v1.14.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/k0kubun/pp/v3 v3.1.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
go.keploy.io/server v0.9.1 // indirect
go.keploy.io/server v0.8.6 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.21.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
google.golang.org/grpc v1.48.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221107191617-1a15be271d1d // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit def33ae

Please sign in to comment.