Skip to content

Commit

Permalink
Merge pull request #50 from gimmetm/feature/vnks_openapi_update
Browse files Browse the repository at this point in the history
update: vnks
  • Loading branch information
jj41 authored May 30, 2023
2 parents b6bede0 + db2417e commit c231aa4
Show file tree
Hide file tree
Showing 56 changed files with 1,848 additions and 245 deletions.
31 changes: 28 additions & 3 deletions services/vnks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
## 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: 2021-12-07T02:44:04Z
- Package version:
- API version: 2023-03-23T09:23:10Z
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.NcpGoForVnksClientCodegen

## Installation
Expand All @@ -23,21 +23,34 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*V2Api* | [**ClustersGet**](docs/V2Api.md#clustersget) | **Get** /clusters |
*V2Api* | [**ClustersPost**](docs/V2Api.md#clusterspost) | **Post** /clusters |
*V2Api* | [**ClustersUuidAddSubnetPatch**](docs/V2Api.md#clustersuuidaddsubnetpatch) | **Patch** /clusters/{uuid}/add-subnet |
*V2Api* | [**ClustersUuidDelete**](docs/V2Api.md#clustersuuiddelete) | **Delete** /clusters/{uuid} |
*V2Api* | [**ClustersUuidGet**](docs/V2Api.md#clustersuuidget) | **Get** /clusters/{uuid} |
*V2Api* | [**ClustersUuidIpAclGet**](docs/V2Api.md#clustersuuidipaclget) | **Get** /clusters/{uuid}/ip-acl |
*V2Api* | [**ClustersUuidIpAclPatch**](docs/V2Api.md#clustersuuidipaclpatch) | **Patch** /clusters/{uuid}/ip-acl |
*V2Api* | [**ClustersUuidKubeconfigGet**](docs/V2Api.md#clustersuuidkubeconfigget) | **Get** /clusters/{uuid}/kubeconfig |
*V2Api* | [**ClustersUuidKubeconfigResetPatch**](docs/V2Api.md#clustersuuidkubeconfigresetpatch) | **Patch** /clusters/{uuid}/kubeconfig/reset |
*V2Api* | [**ClustersUuidLogPatch**](docs/V2Api.md#clustersuuidlogpatch) | **Patch** /clusters/{uuid}/log |
*V2Api* | [**ClustersUuidNodePoolGet**](docs/V2Api.md#clustersuuidnodepoolget) | **Get** /clusters/{uuid}/node-pool |
*V2Api* | [**ClustersUuidNodePoolInstanceNoDelete**](docs/V2Api.md#clustersuuidnodepoolinstancenodelete) | **Delete** /clusters/{uuid}/node-pool/{instanceNo} |
*V2Api* | [**ClustersUuidNodePoolInstanceNoPatch**](docs/V2Api.md#clustersuuidnodepoolinstancenopatch) | **Patch** /clusters/{uuid}/node-pool/{instanceNo} |
*V2Api* | [**ClustersUuidNodePoolInstanceNoUpgradePatch**](docs/V2Api.md#clustersuuidnodepoolinstancenoupgradepatch) | **Patch** /clusters/{uuid}/node-pool/{instanceNo}/upgrade |
*V2Api* | [**ClustersUuidNodePoolPost**](docs/V2Api.md#clustersuuidnodepoolpost) | **Post** /clusters/{uuid}/node-pool |
*V2Api* | [**ClustersUuidNodesGet**](docs/V2Api.md#clustersuuidnodesget) | **Get** /clusters/{uuid}/nodes |
*V2Api* | [**ClustersUuidNodesInstanceNoDelete**](docs/V2Api.md#clustersuuidnodesinstancenodelete) | **Delete** /clusters/{uuid}/nodes/{instanceNo} |
*V2Api* | [**ClustersUuidOidcGet**](docs/V2Api.md#clustersuuidoidcget) | **Get** /clusters/{uuid}/oidc |
*V2Api* | [**ClustersUuidOidcPatch**](docs/V2Api.md#clustersuuidoidcpatch) | **Patch** /clusters/{uuid}/oidc |
*V2Api* | [**ClustersUuidUpgradePatch**](docs/V2Api.md#clustersuuidupgradepatch) | **Patch** /clusters/{uuid}/upgrade |
*V2Api* | [**OptionServerImageGet**](docs/V2Api.md#optionserverimageget) | **Get** /option/server-image |
*V2Api* | [**OptionServerProductCodeGet**](docs/V2Api.md#optionserverproductcodeget) | **Get** /option/server-product-code |
*V2Api* | [**OptionVersionGet**](docs/V2Api.md#optionversionget) | **Get** /option/version |
*V2Api* | [**RootGet**](docs/V2Api.md#rootget) | **Get** / |


## Documentation For Models

- [AddSubnetDto](docs/AddSubnetDto.md)
- [AuditLogDto](docs/AuditLogDto.md)
- [AutoscaleOption](docs/AutoscaleOption.md)
- [AutoscalerUpdate](docs/AutoscalerUpdate.md)
- [Cluster](docs/Cluster.md)
Expand All @@ -47,14 +60,26 @@ Class | Method | HTTP request | Description
- [ClustersRes](docs/ClustersRes.md)
- [CreateClusterRes](docs/CreateClusterRes.md)
- [DefaultNodePoolParam](docs/DefaultNodePoolParam.md)
- [IpAclsDto](docs/IpAclsDto.md)
- [IpAclsEntriesDto](docs/IpAclsEntriesDto.md)
- [IpAclsEntriesRes](docs/IpAclsEntriesRes.md)
- [IpAclsRes](docs/IpAclsRes.md)
- [KubeconfigRes](docs/KubeconfigRes.md)
- [NodePool](docs/NodePool.md)
- [NodePoolCreationBody](docs/NodePoolCreationBody.md)
- [NodePoolDto](docs/NodePoolDto.md)
- [NodePoolRes](docs/NodePoolRes.md)
- [NodePoolUpdateBody](docs/NodePoolUpdateBody.md)
- [NodePoolsRes](docs/NodePoolsRes.md)
- [OidcRes](docs/OidcRes.md)
- [OptionRes](docs/OptionRes.md)
- [OptionResForServerProduct](docs/OptionResForServerProduct.md)
- [OptionsRes](docs/OptionsRes.md)
- [OptionsResForServerProduct](docs/OptionsResForServerProduct.md)
- [ServerProduct](docs/ServerProduct.md)
- [SubnetDto](docs/SubnetDto.md)
- [UpdateClusterRes](docs/UpdateClusterRes.md)
- [UpdateNodePoolRes](docs/UpdateNodePoolRes.md)
- [UpdateOidcDto](docs/UpdateOidcDto.md)
- [WorkerNode](docs/WorkerNode.md)
- [WorkerNodeRes](docs/WorkerNodeRes.md)

Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

package vnks

type NodePoolsRes struct {

// 노드풀 목록
NodePool []*NodePoolRes `json:"nodePool"`
type AddSubnetDto struct {
Subnets []*SubnetDto `json:"subnets"`
}
5 changes: 4 additions & 1 deletion services/vnks/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (
xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)")
)

// APIClient manages communication with the vnks API v2021-11-25T15:22:25Z
// APIClient manages communication with the vnks API v2023-03-23T09:23:10Z
// In most cases there should be only one, shared, APIClient.
type APIClient struct {
cfg *ncloud.Configuration
Expand Down Expand Up @@ -271,6 +271,9 @@ func (c *APIClient) prepareRequest(
if auth := c.cfg.GetCredentials(); auth != nil {
timestamp := strconv.FormatInt(time.Now().UnixNano()/int64(time.Millisecond), 10)
signer := hmac.NewSigner(auth.SecretKey(), crypto.SHA256)
if len(query) > 0 {
path += fmt.Sprintf("?%s", url.RawQuery)
}
signature, _ := signer.Sign(method, path, auth.AccessKey(), timestamp)

localVarRequest.Header.Add("x-ncp-apigw-timestamp", timestamp)
Expand Down
13 changes: 13 additions & 0 deletions services/vnks/audit_log_dto.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* vnks
*
* <br/>https://nks.apigw.ntruss.com/vnks/v2
*
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/

package vnks

type AuditLogDto struct {
Audit *bool `json:"audit"`
}
31 changes: 21 additions & 10 deletions services/vnks/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Cluster struct {
// 클러스터 acg 이름
AcgName *string `json:"acgName"`

// 클러스터 acg 번호
// 클러스터 acg no
AcgNo *int32 `json:"acgNo"`

// 클러스터 이름
Expand All @@ -38,7 +38,7 @@ type Cluster struct {
CpuCount *int32 `json:"cpuCount"`

// 메모리 용량
MemorySize *int32 `json:"memorySize"`
MemorySize *int64 `json:"memorySize"`

// 생성 일자
CreatedAt *string `json:"createdAt"`
Expand All @@ -52,7 +52,7 @@ type Cluster struct {
// region의 코드
RegionCode *string `json:"regionCode"`

// 클러스터의 상태
// 클러스터 상태
Status *string `json:"status"`

// CNI Plugin Code
Expand All @@ -61,9 +61,12 @@ type Cluster struct {
// 로드밸런서 전용 서브넷 이름
SubnetLbName *string `json:"subnetLbName"`

// 로드밸런서 전용 서브넷 No
// 로드밸런서 전용 Private Subnet No
SubnetLbNo *int32 `json:"subnetLbNo"`

// 로드밸런서 전용 Private Subnet No
LbPrivateSubnetNo *int32 `json:"lbPrivateSubnetNo"`

// 로드밸런서 전용 Public Subnet No
LbPublicSubnetNo *int32 `json:"lbPublicSubnetNo,omitempty"`

Expand All @@ -83,20 +86,28 @@ type Cluster struct {
VpcNo *int32 `json:"vpcNo"`

// zone 코드
ZoneCode *string `json:"zoneCode,omitempty"`
ZoneCode *string `json:"zoneCode"`

// zone 번호
ZoneNo *int32 `json:"zoneNo,omitempty"`
ZoneNo *int32 `json:"zoneNo"`

// InitScript 번호
InitScriptNo *int32 `json:"initScriptNo"`

// InitScript 이름
InitScriptName *string `json:"initScriptName"`

// Pod Security Policy 설정 여부
PodSecurityPolicyEnabled *bool `json:"podSecurityPolicyEnabled"`

// 로그인 키 이름
LoginKeyName *string `json:"loginKeyName"`

// log
// 노드풀
NodePool []*NodePool `json:"nodePool"`

Log *ClusterLogInput `json:"log"`

// Public Network
PublicNetwork *bool `json:"publicNetwork"`

// 노드풀
NodePool []*NodePoolRes `json:"nodePool"`
}
39 changes: 21 additions & 18 deletions services/vnks/cluster_input_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ type ClusterInputBody struct {
// 클러스터 타입
ClusterType *string `json:"clusterType"`

// 쿠버네티스 버전 [Version 조회 API](/docs/compute-vpckubernetesservice-nksv2#k8sSupportedVersion)
K8sVersion *string `json:"k8sVersion,omitempty"`

// 로그인 키 이름
LoginKeyName *string `json:"loginKeyName"`

// 쿠버네티스 버전
K8sVersion *string `json:"k8sVersion,omitempty"`

// Region의 코드
RegionCode *string `json:"regionCode"`

// zone 코드
// Zone 코드
ZoneCode *string `json:"zoneCode,omitempty"`

// Zone 번호
Expand All @@ -37,30 +37,33 @@ type ClusterInputBody struct {
// CNI Plugin Code (ncloud-vpc-cni or cilium)
KubeNetworkPlugin *string `json:"kubeNetworkPlugin,omitempty"`

// vpc의 No
// [VPC 번호](/docs/networking-vpc-vpcmanagement-getvpclist)
VpcNo *int32 `json:"vpcNo"`

// 서브넷 No 목록
// [서브넷 번호 목록](/docs/networking-vpc-subnetmanagement-getsubnetlist)
SubnetNoList []*int32 `json:"subnetNoList"`

// 로드밸런서 전용 서브넷 No
SubnetLbNo *int32 `json:"subnetLbNo"`
// [로드밸런서 전용 Private Subnet 번호](/docs/networking-vpc-subnetmanagement-getsubnetlist)
SubnetLbNo *int32 `json:"subnetLbNo,omitempty"`

// 로드밸런서 전용 Public Subnet No
LbPublicSubnetNo *int32 `json:"lbPublicSubnetNo,omitempty"`

// log
Log *ClusterLogInput `json:"log,omitempty"`

// 기본 노드풀
DefaultNodePool *DefaultNodePoolParam `json:"defaultNodePool,omitempty"`
// [로드밸런서 전용 Private Subnet 번호](/docs/networking-vpc-subnetmanagement-getsubnetlist)
LbPrivateSubnetNo *int32 `json:"lbPrivateSubnetNo,omitempty"`

// 추가 노드풀
NodePool []*NodePool `json:"nodePool,omitempty"`
// [로드밸런서 전용 Public Subnet 번호(Singapore 리전만 지원)](/docs/networking-vpc-subnetmanagement-getsubnetlist)
LbPublicSubnetNo *int32 `json:"lbPublicSubnetNo,omitempty"`

// InitScript 번호
InitScriptNo *int32 `json:"initScriptNo,omitempty"`

// Pod Security Policy 설정 여부
PodSecurityPolicyEnabled *bool `json:"podSecurityPolicyEnabled,omitempty"`

//
Log *ClusterLogInput `json:"log,omitempty"`

//
DefaultNodePool *DefaultNodePoolParam `json:"defaultNodePool,omitempty"`

// 추가 노드풀
NodePool []*NodePoolDto `json:"nodePool,omitempty"`
}
2 changes: 1 addition & 1 deletion services/vnks/cluster_log_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ package vnks

type ClusterLogInput struct {

// audit log 설정
// Audit Log 설정
Audit *bool `json:"audit,omitempty"`
}
2 changes: 1 addition & 1 deletion services/vnks/cluster_res.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ package vnks

type ClusterRes struct {

// 클러스터
//
Cluster *Cluster `json:"cluster"`
}
12 changes: 7 additions & 5 deletions services/vnks/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewConfiguration(region string, apiKeys ...*ncloud.APIKey) *ncloud.Configur
cfg := &ncloud.Configuration{
BasePath: "https://nks.apigw.ntruss.com/vnks/v2",
DefaultHeader: make(map[string]string),
UserAgent: "vnks//go",
UserAgent: "vnks/1.0.0/go",
}
if len(apiKeys) > 0 {
cfg.APIKey = apiKeys[0]
Expand All @@ -46,14 +46,16 @@ func NewConfiguration(region string, apiKeys ...*ncloud.APIKey) *ncloud.Configur
ncloudApiGw = strings.Replace(ncloudApiGw, "https://ncloud.", "https://nks.", 1)
ncloudApiGw = strings.Replace(ncloudApiGw, "https://fin-ncloud.", "https://nks.", 1)

switch region {
case "KR":
cfg.BasePath = fmt.Sprintf("%s/vnks/v2", ncloudApiGw)
case "FKR":
switch {
case strings.HasPrefix(region, "F"):
cfg.BasePath = fmt.Sprintf("%s/nks/v2", ncloudApiGw)
case region == "KR", strings.Contains(region, "CS"):
cfg.BasePath = fmt.Sprintf("%s/vnks/v2", ncloudApiGw)
default:
cfg.BasePath = fmt.Sprintf("%s/vnks/%s-v2", ncloudApiGw, strings.ToLower(region))
}

cfg.DefaultHeader["x-ncp-region_code"] = region

return cfg
}
8 changes: 7 additions & 1 deletion services/vnks/default_node_pool_param.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ type DefaultNodePoolParam struct {
// Subnet 번호
SubnetNo *int32 `json:"subnetNo,omitempty"`

// 상품 코드
// Subnet 번호
SubnetNoList []*int32 `json:"subnetNoList,omitempty"`

// 상품 코드 [서버 스펙 목록](/docs/compute-vserver-server-common-getserverproductlist)
ProductCode *string `json:"productCode"`

// Server image code
SoftwareCode *string `json:"softwareCode,omitempty"`
}
10 changes: 10 additions & 0 deletions services/vnks/docs/AddSubnetDto.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AddSubnetDto

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Subnets** | **[[]\*SubnetDto](SubnetDto.md)** | | [default to null]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


10 changes: 10 additions & 0 deletions services/vnks/docs/AuditLogDto.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AuditLogDto

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Audit** | ***bool** | | [default to null]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


20 changes: 12 additions & 8 deletions services/vnks/docs/Cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,38 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Uuid** | ***string** | 클러스터 uuid | [default to null]
**AcgName** | ***string** | 클러스터 acg 이름 | [default to null]
**AcgNo** ***int32** | 클러스터 acg 번호 | [default to null]
**AcgNo** | ***int32** | 클러스터 acg no | [default to null]
**Name** | ***string** | 클러스터 이름 | [default to null]
**Capacity** | ***string** | 클러스터 용량 | [default to null]
**ClusterType** | ***string** | 클러스터 타입 | [default to null]
**NodeCount** | ***int32** | 등록된 노드 총 개수 | [default to null]
**NodeMaxCount** | ***int32** | 사용할 수 있는 노드의 최대 개수 | [default to null]
**CpuCount** | ***int32** | cpu 개수 | [default to null]
**MemorySize** | ***int32** | 메모리 용량 | [default to null]
**MemorySize** | ***int64** | 메모리 용량 | [default to null]
**CreatedAt** | ***string** | 생성 일자 | [default to null]
**Endpoint** | ***string** | Control Plane API 주소 | [default to null]
**K8sVersion** | ***string** | 쿠버네티스 버전 | [default to null]
**RegionCode** | ***string** | region의 코드 | [default to null]
**Status** | ***string** | 클러스터의 상태 | [default to null]
**Status** | ***string** | 클러스터 상태 | [default to null]
**KubeNetworkPlugin** | ***string** | CNI Plugin Code | [default to null]
**SubnetLbName** | ***string** | 로드밸런서 전용 서브넷 이름 | [default to null]
**SubnetLbNo** | ***int32** | 로드밸런서 전용 서브넷 No | [default to null]
**SubnetLbNo** | ***int32** | 로드밸런서 전용 Private Subnet No | [default to null]
**LbPrivateSubnetNo** | ***int32** | 로드밸런서 전용 Private Subnet No | [default to null]
**LbPublicSubnetNo** | ***int32** | 로드밸런서 전용 Public Subnet No | [optional] [default to null]
**SubnetName** | ***string** | 서브넷 이름 | [default to null]
**SubnetNoList** | **[]\*int32** | 서브넷 No 목록 | [default to null]
**UpdatedAt** | ***string** | 최근 업데이트 일자 | [default to null]
**VpcName** | ***string** | vpc 이름 | [default to null]
**VpcNo** | ***int32** | vpc 번호 | [default to null]
**ZoneCode** | ***string** | zone 코드 | [optional] [default to null]
**ZoneNo** | ***int32** | zone 번호 | [optional] [default to null]
**ZoneCode** | ***string** | zone 코드 | [default to null]
**ZoneNo** | ***int32** | zone 번호 | [default to null]
**InitScriptNo** | ***int32** | InitScript 번호 | [default to null]
**InitScriptName** | ***string** | InitScript 이름 | [default to null]
**PodSecurityPolicyEnabled** | ***bool** | Pod Security Policy 설정 여부 | [default to null]
**LoginKeyName** | ***string** | 로그인 키 이름 | [default to null]
**Log** | **[*ClusterLogInput](ClusterLogInput.md)** | log | [default to null]
**NodePool** | **[[]\*NodePool](NodePool.md)** | 노드풀 | [default to null]
**Log** | **[*ClusterLogInput](ClusterLogInput.md)** | | [default to null]
**PublicNetwork** | ***bool** | Public Network | [default to null]
**NodePool** | **[[]\*NodePoolRes](NodePoolRes.md)** | 노드풀 | [default to null]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
Loading

0 comments on commit c231aa4

Please sign in to comment.