Skip to content

Commit 08b50fc

Browse files
authored
Merge pull request #31 from vngcloud/iam-vserver
Iam vserver
2 parents 7c33c9e + 5026833 commit 08b50fc

File tree

234 files changed

+33711
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+33711
-18
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ terraform
1919
.terraform.lock.hcl
2020
terraform.tfstate
2121
k8s-create-cluster.sh
22+
/provider.tf
2223
/main.tf
24+
/variable.tf
2325
terraform.tfstate.backup
2426
/example terraform/main_dev.tf
2527
### Go Patch ###

.idea/inspectionProfiles/Project_Default.xml

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/terraform.iml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ rm -rf .terraform.*
55
#rm -rf terraform.*
66
go build -o terraform-provider-vngcloud
77
#OS_ARCH="$(go env GOHOSTOS)_$(go env GOHOSTARCH)"
8-
OS_ARCH="darwin_amd64"
8+
OS_ARCH="linux_amd64"
99
echo $OS_ARCH
1010
#rm -rf ~/.terraform.d/plugins/vngcloud.vn/terraform/vngcloud/0.2
1111
#mkdir -p ~/.terraform.d/plugins/vngcloud.vn/terraform/vngcloud/0.2/$OS_ARCH
1212
#mv terraform-provider-vngcloud ~/.terraform.d/plugins/vngcloud.vn/terraform/vngcloud/0.2/$OS_ARCH
13-
rm -rf ~/.terraform.d/plugins/registry.terraform.tunm4/vngcloud/vngcloud/1.0.0
14-
mkdir -p ~/.terraform.d/plugins/registry.terraform.tunm4/vngcloud/vngcloud/1.0.0/$OS_ARCH
15-
mv terraform-provider-vngcloud ~/.terraform.d/plugins/registry.terraform.tunm4/vngcloud/vngcloud/1.0.0/$OS_ARCH
13+
rm -rf ~/.terraform.d/plugins/registry.terraform.nhontt/vngcloud/vngcloud/1.0.0
14+
mkdir -p ~/.terraform.d/plugins/registry.terraform.nhontt/vngcloud/vngcloud/1.0.0/$OS_ARCH
15+
mv terraform-provider-vngcloud ~/.terraform.d/plugins/registry.terraform.nhontt/vngcloud/vngcloud/1.0.0/$OS_ARCH
1616
terraform init
1717
#terraform apply

client/client.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package client
33
import (
44
"github.com/vngcloud/terraform-provider-vngcloud/client/authen"
55
"github.com/vngcloud/terraform-provider-vngcloud/client/vdb"
6+
"github.com/vngcloud/terraform-provider-vngcloud/client/vdbv2"
67
"github.com/vngcloud/terraform-provider-vngcloud/client/vks"
78
"github.com/vngcloud/terraform-provider-vngcloud/client/vloadbalancing"
89
"github.com/vngcloud/terraform-provider-vngcloud/client/vserver"
@@ -14,6 +15,7 @@ type Client struct {
1415
VdbClient *vdb.APIClient
1516
VlbClient *vloadbalancing.APIClient
1617
VksClient *vks.APIClient
18+
Vdbv2Client *vdbv2.APIClient
1719
ProjectId string
1820
}
1921

@@ -45,7 +47,7 @@ func NewClient(vdbBaseURL string, vserverBaseURL string, vlbBaseURL string, proj
4547
return client, nil
4648
}
4749

48-
func NewClientV2(vserverBaseURL string, vlbBaseURL string, vksBaseURL string, ClientID string, ClientSecret string, TokenURL string) (*Client, error) {
50+
func NewClientV2(vserverBaseURL string, vlbBaseURL string, vksBaseURL string, vdbBaseURL string, ClientID string, ClientSecret string, TokenURL string) (*Client, error) {
4951
authenConfig := authen.NewConfiguration(ClientID, ClientSecret, TokenURL)
5052
authenClient, err := authen.NewAuthenClient(authenConfig)
5153
if err != nil {
@@ -61,10 +63,13 @@ func NewClientV2(vserverBaseURL string, vlbBaseURL string, vksBaseURL string, Cl
6163
vksConfig := vks.NewConfiguration(vksBaseURL, authenClient.Client)
6264
vksClient := vks.NewAPIClient(vksConfig)
6365

66+
vdbConfig := vdbv2.NewConfiguration(vdbBaseURL, authenClient.Client)
67+
vdbClient := vdbv2.NewAPIClient(vdbConfig)
68+
6469
client := &Client{
6570
AuthenClient: authenClient,
6671
VserverClient: vserverClient,
67-
VdbClient: nil,
72+
Vdbv2Client: vdbClient,
6873
VksClient: vksClient,
6974
VlbClient: vlbClient,
7075
ProjectId: "projectId",

client/vdbv2/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Compiled Object files, Static and Dynamic libs (Shared Objects)
2+
*.o
3+
*.a
4+
*.so
5+
6+
# Folders
7+
_obj
8+
_test
9+
10+
# Architecture specific extensions/prefixes
11+
*.[568vq]
12+
[568vq].out
13+
14+
*.cgo1.go
15+
*.cgo2.c
16+
_cgo_defun.c
17+
_cgo_gotypes.go
18+
_cgo_export.*
19+
20+
_testmain.go
21+
22+
*.exe
23+
*.test
24+
*.prof

client/vdbv2/.swagger-codegen-ignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Swagger Codegen Ignore
2+
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

client/vdbv2/.swagger-codegen/VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0.60

client/vdbv2/.travis.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: go
2+
3+
install:
4+
- go get -d -v .
5+
6+
script:
7+
- go build -v ./
8+

0 commit comments

Comments
 (0)