Skip to content

Commit

Permalink
Merge pull request #24 from vngcloud/iam-vserver
Browse files Browse the repository at this point in the history
vks
  • Loading branch information
manhtu1997 authored Jun 6, 2024
2 parents b8839f8 + e55f220 commit 1b94488
Show file tree
Hide file tree
Showing 60 changed files with 6,135 additions and 25 deletions.
1 change: 0 additions & 1 deletion .terraform.tfstate.lock.info

This file was deleted.

13 changes: 7 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#bin/bash
#export TF_LOG=debug
rm -rf .terraform
rm -r .terraform.lock.hcl
rm -rf .terraform.*
#rm -rf terraform.*
go build -o terraform-provider-vngcloud
#OS_ARCH="$(go env GOHOSTOS)_$(go env GOHOSTARCH)"
OS_ARCH="linux_amd64"
OS_ARCH="darwin_amd64"
echo $OS_ARCH
#rm -rf ~/.terraform.d/plugins/vngcloud.vn/terraform/vngcloud/0.2
#mkdir -p ~/.terraform.d/plugins/vngcloud.vn/terraform/vngcloud/0.2/$OS_ARCH
#mv terraform-provider-vngcloud ~/.terraform.d/plugins/vngcloud.vn/terraform/vngcloud/0.2/$OS_ARCH
rm -rf ~/.terraform.d/plugins/registry.terraform.tunm4/vngcloud/vngcloud/0.2
mkdir -p ~/.terraform.d/plugins/registry.terraform.tunm4/vngcloud/vngcloud/0.2/$OS_ARCH
mv terraform-provider-vngcloud ~/.terraform.d/plugins/registry.terraform.tunm4/vngcloud/vngcloud/0.2/$OS_ARCH
#terraform init
rm -rf ~/.terraform.d/plugins/registry.terraform.tunm4/vngcloud/vngcloud/1.0.0
mkdir -p ~/.terraform.d/plugins/registry.terraform.tunm4/vngcloud/vngcloud/1.0.0/$OS_ARCH
mv terraform-provider-vngcloud ~/.terraform.d/plugins/registry.terraform.tunm4/vngcloud/vngcloud/1.0.0/$OS_ARCH
terraform init
#terraform apply
8 changes: 7 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package client
import (
"github.com/vngcloud/terraform-provider-vngcloud/client/authen"
"github.com/vngcloud/terraform-provider-vngcloud/client/vdb"
"github.com/vngcloud/terraform-provider-vngcloud/client/vks"
"github.com/vngcloud/terraform-provider-vngcloud/client/vloadbalancing"
"github.com/vngcloud/terraform-provider-vngcloud/client/vserver"
)
Expand All @@ -12,6 +13,7 @@ type Client struct {
VserverClient *vserver.APIClient
VdbClient *vdb.APIClient
VlbClient *vloadbalancing.APIClient
VksClient *vks.APIClient
ProjectId string
}

Expand Down Expand Up @@ -43,7 +45,7 @@ func NewClient(vdbBaseURL string, vserverBaseURL string, vlbBaseURL string, proj
return client, nil
}

func NewClientV2(vserverBaseURL string, vlbBaseURL string, ClientID string, ClientSecret string, TokenURL string) (*Client, error) {
func NewClientV2(vserverBaseURL string, vlbBaseURL string, vksBaseURL string, ClientID string, ClientSecret string, TokenURL string) (*Client, error) {
authenConfig := authen.NewConfiguration(ClientID, ClientSecret, TokenURL)
authenClient, err := authen.NewAuthenClient(authenConfig)
if err != nil {
Expand All @@ -56,10 +58,14 @@ func NewClientV2(vserverBaseURL string, vlbBaseURL string, ClientID string, Clie
vlbConfig := vloadbalancing.NewConfiguration(vlbBaseURL, authenClient.Client)
vlbClient := vloadbalancing.NewAPIClient(vlbConfig)

vksConfig := vks.NewConfiguration(vksBaseURL, authenClient.Client)
vksClient := vks.NewAPIClient(vksConfig)

client := &Client{
AuthenClient: authenClient,
VserverClient: vserverClient,
VdbClient: nil,
VksClient: vksClient,
VlbClient: vlbClient,
ProjectId: "projectId",
}
Expand Down
68 changes: 68 additions & 0 deletions client/vks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Go API client for swagger

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

## Overview
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.

- API version: 1.0-SNAPSHOT
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen

## Installation
Put the package under your project folder and add the following in import:
```golang
import "./swagger"
```

## Documentation for API Endpoints

All URIs are relative to */*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*V1ClusterControllerApi* | [**V1ClustersClusterIdDelete**](docs/V1ClusterControllerApi.md#v1clustersclusteriddelete) | **Delete** /v1/clusters/{clusterId} |
*V1ClusterControllerApi* | [**V1ClustersClusterIdGet**](docs/V1ClusterControllerApi.md#v1clustersclusteridget) | **Get** /v1/clusters/{clusterId} |
*V1ClusterControllerApi* | [**V1ClustersClusterIdKubeconfigGet**](docs/V1ClusterControllerApi.md#v1clustersclusteridkubeconfigget) | **Get** /v1/clusters/{clusterId}/kubeconfig |
*V1ClusterControllerApi* | [**V1ClustersClusterIdPut**](docs/V1ClusterControllerApi.md#v1clustersclusteridput) | **Put** /v1/clusters/{clusterId} |
*V1ClusterControllerApi* | [**V1ClustersGet**](docs/V1ClusterControllerApi.md#v1clustersget) | **Get** /v1/clusters |
*V1ClusterControllerApi* | [**V1ClustersPost**](docs/V1ClusterControllerApi.md#v1clusterspost) | **Post** /v1/clusters |
*V1NodeGroupControllerApi* | [**V1ClustersClusterIdNodeGroupsGet**](docs/V1NodeGroupControllerApi.md#v1clustersclusteridnodegroupsget) | **Get** /v1/clusters/{clusterId}/node-groups |
*V1NodeGroupControllerApi* | [**V1ClustersClusterIdNodeGroupsNodeGroupIdDelete**](docs/V1NodeGroupControllerApi.md#v1clustersclusteridnodegroupsnodegroupiddelete) | **Delete** /v1/clusters/{clusterId}/node-groups/{nodeGroupId} |
*V1NodeGroupControllerApi* | [**V1ClustersClusterIdNodeGroupsNodeGroupIdGet**](docs/V1NodeGroupControllerApi.md#v1clustersclusteridnodegroupsnodegroupidget) | **Get** /v1/clusters/{clusterId}/node-groups/{nodeGroupId} |
*V1NodeGroupControllerApi* | [**V1ClustersClusterIdNodeGroupsNodeGroupIdNodesGet**](docs/V1NodeGroupControllerApi.md#v1clustersclusteridnodegroupsnodegroupidnodesget) | **Get** /v1/clusters/{clusterId}/node-groups/{nodeGroupId}/nodes |
*V1NodeGroupControllerApi* | [**V1ClustersClusterIdNodeGroupsNodeGroupIdPut**](docs/V1NodeGroupControllerApi.md#v1clustersclusteridnodegroupsnodegroupidput) | **Put** /v1/clusters/{clusterId}/node-groups/{nodeGroupId} |
*V1NodeGroupControllerApi* | [**V1ClustersClusterIdNodeGroupsPost**](docs/V1NodeGroupControllerApi.md#v1clustersclusteridnodegroupspost) | **Post** /v1/clusters/{clusterId}/node-groups |
*V1NodeGroupImageControllerApi* | [**V1NodeGroupImagesGet**](docs/V1NodeGroupImageControllerApi.md#v1nodegroupimagesget) | **Get** /v1/node-group-images |
*V1WorkspaceControllerApi* | [**V1WorkspaceGet**](docs/V1WorkspaceControllerApi.md#v1workspaceget) | **Get** /v1/workspace |
*V1WorkspaceControllerApi* | [**V1WorkspacePost**](docs/V1WorkspaceControllerApi.md#v1workspacepost) | **Post** /v1/workspace |
*V1WorkspaceControllerApi* | [**V1WorkspaceResetServiceAccountPost**](docs/V1WorkspaceControllerApi.md#v1workspaceresetserviceaccountpost) | **Post** /v1/workspace/reset-service-account |

## Documentation For Models

- [ClusterDetailDto](docs/ClusterDetailDto.md)
- [ClusterDto](docs/ClusterDto.md)
- [CreateClusterComboDto](docs/CreateClusterComboDto.md)
- [CreateNodeGroupDto](docs/CreateNodeGroupDto.md)
- [NetworkType](docs/NetworkType.md)
- [NodeDto](docs/NodeDto.md)
- [NodeGroupAutoScaleConfigDto](docs/NodeGroupAutoScaleConfigDto.md)
- [NodeGroupDetailDto](docs/NodeGroupDetailDto.md)
- [NodeGroupDto](docs/NodeGroupDto.md)
- [NodeGroupImageDto](docs/NodeGroupImageDto.md)
- [NodeGroupTaintDto](docs/NodeGroupTaintDto.md)
- [NodeGroupUpgradeConfigDto](docs/NodeGroupUpgradeConfigDto.md)
- [PagingResultDtoClusterDto](docs/PagingResultDtoClusterDto.md)
- [PagingResultDtoNodeDto](docs/PagingResultDtoNodeDto.md)
- [PagingResultDtoNodeGroupDto](docs/PagingResultDtoNodeGroupDto.md)
- [UpdateClusterDto](docs/UpdateClusterDto.md)
- [UpdateNodeGroupDto](docs/UpdateNodeGroupDto.md)
- [WorkspaceDto](docs/WorkspaceDto.md)

## Documentation For Authorization
Endpoints do not require authorization.


## Author


Loading

0 comments on commit 1b94488

Please sign in to comment.