From 3c9d4ef1991b0c2dbc11e205e36e4e12d5b02f24 Mon Sep 17 00:00:00 2001 From: tamperMonkeyZQ Date: Mon, 6 May 2024 20:38:21 +0800 Subject: [PATCH] MongoDB support attribute auto_renew_length --- baiducloud/flex/billing.go | 20 +++++ baiducloud/service/mongodb/instance_common.go | 10 ++- .../service/mongodb/resource_instance.go | 7 ++ .../mongodb/resource_sharding_instance.go | 7 ++ go.mod | 2 +- go.sum | 4 +- .../baidubce/bce-sdk-go/bce/config.go | 2 +- .../baidubce/bce-sdk-go/services/eip/model.go | 81 ++++++++++--------- .../bce-sdk-go/services/mongodb/model.go | 10 ++- .../bce-sdk-go/services/mongodb/mongodb.go | 2 + .../bce-sdk-go/services/resmanager/client.go | 14 ++-- .../bce-sdk-go/services/resmanager/model.go | 10 +++ .../services/resmanager/resmanager.go | 27 ++++++- .../baidubce/bce-sdk-go/services/vpc/model.go | 20 ++--- .../baidubce/bce-sdk-go/services/vpn/model.go | 39 +++++---- .../baidubce/bce-sdk-go/services/vpn/vpn.go | 2 +- vendor/modules.txt | 2 +- website/docs/r/mongodb_instance.html.markdown | 1 + .../r/mongodb_sharding_instance.html.markdown | 1 + 19 files changed, 177 insertions(+), 84 deletions(-) diff --git a/baiducloud/flex/billing.go b/baiducloud/flex/billing.go index 525da44f..f3fb1df3 100644 --- a/baiducloud/flex/billing.go +++ b/baiducloud/flex/billing.go @@ -40,6 +40,26 @@ func SchemaReservationLength() *schema.Schema { } } +func SchemaAutoRenewLength() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeInt, + Description: "The automatic renewal time (month). Effective when `payment_timing` is `Prepaid`. " + + "Valid values: `1`~`9`, `12`, `24`, `36`. Defaults to `1`.", + Optional: true, + ForceNew: true, + ValidateFunc: ValidateReservationLength(), + } +} + +func SchemaAutoRenewTimeUnit() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeString, + Description: "Auto renew time unit, currently only supports monthly.", + Optional: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{"month"}, false), + } +} func ValidatePaymentTiming() schema.SchemaValidateFunc { return validation.StringInSlice([]string{PaymentTimingPostpaid, PaymentTimingPrepaid}, false) } diff --git a/baiducloud/service/mongodb/instance_common.go b/baiducloud/service/mongodb/instance_common.go index e2b53fbb..edb33ae1 100644 --- a/baiducloud/service/mongodb/instance_common.go +++ b/baiducloud/service/mongodb/instance_common.go @@ -22,10 +22,12 @@ func basicResourceInstanceSchema() map[string]*schema.Schema { }, "payment_timing": flex.SchemaPaymentTiming(), "reservation_length": flex.SchemaReservationLength(), - "vpc_id": flex.SchemaVpcID(), - "subnets": flex.SchemaSubnets(), - "tags": flex.SchemaTagsOnlySupportCreation(), - "resource_group_id": flex.SchemaResourceGroupID(), + "auto_renew_length": flex.SchemaAutoRenewLength(), + //"auto_renew_time_unit": flex.SchemaAutoRenewTimeUnit(), + "vpc_id": flex.SchemaVpcID(), + "subnets": flex.SchemaSubnets(), + "tags": flex.SchemaTagsOnlySupportCreation(), + "resource_group_id": flex.SchemaResourceGroupID(), "storage_engine": { Type: schema.TypeString, Description: "Storage engine of the instance. Valid values: `WiredTiger`.", diff --git a/baiducloud/service/mongodb/resource_instance.go b/baiducloud/service/mongodb/resource_instance.go index 0b1d78c3..c90111b5 100644 --- a/baiducloud/service/mongodb/resource_instance.go +++ b/baiducloud/service/mongodb/resource_instance.go @@ -138,6 +138,13 @@ func buildCreationArgs(d *schema.ResourceData) *mongodb.CreateReplicaArgs { ReservationTimeUnit: "month", } billing.Reservation = reservation + if v, ok := d.GetOk("auto_renew_length"); ok { + autoRenew := mongodb.AutoRenewModel{ + AutoRenewLength: v.(int), + AutoRenewTimeUnit: "month", + } + billing.AutoRenew = autoRenew + } } args := &mongodb.CreateReplicaArgs{ Billing: billing, diff --git a/baiducloud/service/mongodb/resource_sharding_instance.go b/baiducloud/service/mongodb/resource_sharding_instance.go index 27cd1e85..eda60330 100644 --- a/baiducloud/service/mongodb/resource_sharding_instance.go +++ b/baiducloud/service/mongodb/resource_sharding_instance.go @@ -182,6 +182,13 @@ func buildShardingCreationArgs(d *schema.ResourceData) *mongodb.CreateShardingAr ReservationTimeUnit: "month", } billing.Reservation = reservation + if v, ok := d.GetOk("auto_renew_length"); ok { + autoRenew := mongodb.AutoRenewModel{ + AutoRenewLength: v.(int), + AutoRenewTimeUnit: "month", + } + billing.AutoRenew = autoRenew + } } args := &mongodb.CreateShardingArgs{ Billing: billing, diff --git a/go.mod b/go.mod index e2d8da90..22a33cbf 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/terraform-providers/terraform-provider-baiducloud require ( - github.com/baidubce/bce-sdk-go v0.9.176 + github.com/baidubce/bce-sdk-go v0.9.177 github.com/hashicorp/terraform-plugin-sdk v1.17.2 github.com/hashicorp/vault v0.10.4 github.com/mitchellh/go-homedir v1.1.0 diff --git a/go.sum b/go.sum index d1ad17be..fbbfbc60 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.37.0 h1:GzFnhOIsrGyQ69s7VgqtrG2BG8v7X7vwB3Xpbd/DBBk= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/baidubce/bce-sdk-go v0.9.176 h1:TOge9h5E95P1bONejSewus22aBTlKtHqgaHzD85yMIU= -github.com/baidubce/bce-sdk-go v0.9.176/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg= +github.com/baidubce/bce-sdk-go v0.9.177 h1:jtt5ZRPOlvikw6rTqGSyJtgqyOo6Ht8Dqr1giZYxwlk= +github.com/baidubce/bce-sdk-go v0.9.177/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= diff --git a/vendor/github.com/baidubce/bce-sdk-go/bce/config.go b/vendor/github.com/baidubce/bce-sdk-go/bce/config.go index 3081145c..2c3e1e05 100644 --- a/vendor/github.com/baidubce/bce-sdk-go/bce/config.go +++ b/vendor/github.com/baidubce/bce-sdk-go/bce/config.go @@ -26,7 +26,7 @@ import ( // Constants and default values for the package bce const ( - SDK_VERSION = "0.9.177" + SDK_VERSION = "0.9.178" URI_PREFIX = "/" // now support uri without prefix "v1" so just set root path DEFAULT_DOMAIN = "baidubce.com" DEFAULT_PROTOCOL = "http" diff --git a/vendor/github.com/baidubce/bce-sdk-go/services/eip/model.go b/vendor/github.com/baidubce/bce-sdk-go/services/eip/model.go index 952019a2..936f6f1e 100644 --- a/vendor/github.com/baidubce/bce-sdk-go/services/eip/model.go +++ b/vendor/github.com/baidubce/bce-sdk-go/services/eip/model.go @@ -34,7 +34,8 @@ type CreateEipArgs struct { Name string `json:"name,omitempty"` BandWidthInMbps int `json:"bandwidthInMbps"` Billing *Billing `json:"billing"` - Tags []model.TagModel `json:"tags"` + Tags []model.TagModel `json:"tags,omitempty"` + ResourceGroupId string `json:"resourceGroupId,omitempty"` AutoRenewTimeUnit string `json:"autoRenewTimeUnit,omitempty"` AutoRenewTime int `json:"autoRenewTime,omitempty"` RouteType string `json:"routeType,omitempty"` @@ -46,7 +47,8 @@ type BatchCreateEipArgs struct { Name string `json:"name,omitempty"` BandWidthInMbps int `json:"bandwidthInMbps"` Billing *Billing `json:"billing"` - Tags []model.TagModel `json:"tags"` + Tags []model.TagModel `json:"tags,omitempty"` + ResourceGroupId string `json:"resourceGroupId,omitempty"` AutoRenewTimeUnit string `json:"autoRenewTimeUnit,omitempty"` AutoRenewTime int `json:"autoRenewTime,omitempty"` RouteType string `json:"routeType,omitempty"` @@ -232,7 +234,8 @@ type CreateEipGroupArgs struct { EipCount int `json:"eipCount"` BandWidthInMbps int `json:"bandwidthInMbps"` Billing *Billing `json:"billing"` - Tags []model.TagModel `json:"tags"` + Tags []model.TagModel `json:"tags,omitempty"` + ResourceGroupId string `json:"resourceGroupId,omitempty"` RouteType string `json:"routeType,omitempty"` Idc string `json:"idc,omitempty"` Continuous bool `json:"continuous,omitempty"` @@ -280,22 +283,23 @@ type ListEipGroupResult struct { } type EipGroupModel struct { - Name string `json:"name"` - Status string `json:"status"` - Id string `json:"id"` - BandWidthInMbps int `json:"bandwidthInMbps"` - DefaultDomesticBandwidth int `json:"defaultDomesticBandwidth"` - BwShortId string `json:"bwShortId"` - BwBandwidthInMbps int `json:"bwBandwidthInMbps"` - DomesticBwShortId string `json:"domesticBwShortId"` - DomesticBwBandwidthInMbps int `json:"domesticBwBandwidthInMbps"` - PaymentTiming string `json:"paymentTiming"` - BillingMethod string `json:"billingMethod"` - CreateTime string `json:"createTime"` - ExpireTime string `json:"expireTime"` - Region string `json:"region"` - RouteType string `json:"routeType"` - Eips []EipModel `json:"eips"` + Name string `json:"name"` + Status string `json:"status"` + Id string `json:"id"` + BandWidthInMbps int `json:"bandwidthInMbps"` + DefaultDomesticBandwidth int `json:"defaultDomesticBandwidth"` + BwShortId string `json:"bwShortId"` + BwBandwidthInMbps int `json:"bwBandwidthInMbps"` + DomesticBwShortId string `json:"domesticBwShortId"` + DomesticBwBandwidthInMbps int `json:"domesticBwBandwidthInMbps"` + PaymentTiming string `json:"paymentTiming"` + BillingMethod string `json:"billingMethod"` + CreateTime string `json:"createTime"` + ExpireTime string `json:"expireTime"` + Region string `json:"region"` + RouteType string `json:"routeType"` + Eips []EipModel `json:"eips"` + Tags []model.TagModel `json:"tags"` } type EipGroupMoveOutArgs struct { @@ -320,13 +324,15 @@ type EipGroupPurchaseReservedArgs struct { } type CreateEipBpArgs struct { - Name string `json:"name"` - Eip string `json:"eip"` - EipGroupId string `json:"eipGroupId"` - BandwidthInMbps int `json:"bandwidthInMbps"` - Type string `json:"type"` - AutoReleaseTime string `json:"autoReleaseTime"` - ClientToken string `json:"-"` + Name string `json:"name"` + Eip string `json:"eip"` + EipGroupId string `json:"eipGroupId"` + BandwidthInMbps int `json:"bandwidthInMbps"` + Type string `json:"type"` + AutoReleaseTime string `json:"autoReleaseTime"` + Tags []model.TagModel `json:"tags,omitempty"` + ResourceGroupId string `json:"resourceGroupId,omitempty"` + ClientToken string `json:"-"` } type CreateEipBpResult struct { @@ -339,17 +345,18 @@ type ResizeEipBpArgs struct { } type EipBpDetail struct { - Name string `json:"name"` - Id string `json:"id"` - BindType string `json:"bindType"` - BandwidthInMbps int `json:"bandwidthInMbps"` - InstanceId string `json:"instanceId"` - Eips []string `json:"eips"` - InstanceBandwidthInMbps int `json:"instanceBandwidthInMbps"` - CreateTime string `json:"createTime"` - AutoReleaseTime string `json:"autoReleaseTime"` - Type string `json:"type"` - Region string `json:"region"` + Name string `json:"name"` + Id string `json:"id"` + BindType string `json:"bindType"` + BandwidthInMbps int `json:"bandwidthInMbps"` + InstanceId string `json:"instanceId"` + Eips []string `json:"eips"` + InstanceBandwidthInMbps int `json:"instanceBandwidthInMbps"` + CreateTime string `json:"createTime"` + AutoReleaseTime string `json:"autoReleaseTime"` + Type string `json:"type"` + Region string `json:"region"` + Tags []model.TagModel `json:"tags"` } type ListEipBpArgs struct { diff --git a/vendor/github.com/baidubce/bce-sdk-go/services/mongodb/model.go b/vendor/github.com/baidubce/bce-sdk-go/services/mongodb/model.go index 0b980819..570c9701 100644 --- a/vendor/github.com/baidubce/bce-sdk-go/services/mongodb/model.go +++ b/vendor/github.com/baidubce/bce-sdk-go/services/mongodb/model.go @@ -157,9 +157,15 @@ type Reservation struct { ReservationTimeUnit string `json:"reservationTimeUnit"` // 时间单位,Month } +type AutoRenewModel struct { + AutoRenewLength int `json:"autoRenewLength"` // 到期后续费的时长(月),取值范围为[0,1,2,3,4,5,6,7,8,9,12,24,36]。0表示关闭自动续费,否则为开启自动续费。 + AutoRenewTimeUnit string `json:"autoRenewTimeUnit"` // 时间单位,取值范围为["Month"],当前仅支持按月 +} + type BillingModel struct { - PaymentTiming string `json:"paymentTiming"` // 付费方式 - Reservation Reservation `json:"reservation"` // 保留信息 + PaymentTiming string `json:"paymentTiming"` // 付费方式 + Reservation Reservation `json:"reservation"` // 保留信息 + AutoRenew AutoRenewModel `json:"autoRenew"` // 自动续费 } type CreateReplicaArgs struct { diff --git a/vendor/github.com/baidubce/bce-sdk-go/services/mongodb/mongodb.go b/vendor/github.com/baidubce/bce-sdk-go/services/mongodb/mongodb.go index 34b79a66..5b6c215e 100644 --- a/vendor/github.com/baidubce/bce-sdk-go/services/mongodb/mongodb.go +++ b/vendor/github.com/baidubce/bce-sdk-go/services/mongodb/mongodb.go @@ -128,6 +128,8 @@ func (c *Client) CreateReplica(args *CreateReplicaArgs) (*CreateResult, error) { if args.Billing.PaymentTiming == S_POSTPAID { args.Billing.Reservation.ReservationLength = 0 args.Billing.Reservation.ReservationTimeUnit = "Month" + args.Billing.AutoRenew.AutoRenewLength = 0 + args.Billing.AutoRenew.AutoRenewTimeUnit = "Month" } if len(args.AccountPassword) > 0 { diff --git a/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/client.go b/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/client.go index 1c95c9bf..fca3c287 100644 --- a/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/client.go +++ b/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/client.go @@ -21,10 +21,10 @@ import "github.com/baidubce/bce-sdk-go/bce" const ( URI_PREFIX = bce.URI_PREFIX DEFAULT_ENDPOINT = "resourcemanager.baidubce.com" - REQUEST_ADD_TO_GROUP = "v1/res/resource" - REQUEST_CHANGE_GROUP = "v1/res/resource/move" + REQUEST_BASE_RESOURCE = "v1/res/resource" + REQUEST_CHANGE_GROUP = REQUEST_BASE_RESOURCE + "/move" REQUEST_QUERY_GROUP = "v1/res/group" - REQUEST_QUERY_GROUP_BATCH = "v1/res/resource/batch/queryGroupRes" + REQUEST_QUERY_GROUP_BATCH = REQUEST_BASE_RESOURCE + "/batch/queryGroupRes" ) // Client of Group service is a kind of BceClient, so derived from BceClient @@ -43,10 +43,6 @@ func NewClient(ak, sk, endPoint string) (*Client, error) { return &Client{client}, nil } -func getAddToGroupUri() string { - return URI_PREFIX + REQUEST_ADD_TO_GROUP -} - func getChangeGroupUri() string { return URI_PREFIX + REQUEST_CHANGE_GROUP } @@ -58,3 +54,7 @@ func getQueryGroupUri() string { func getGroupBatchUri() string { return URI_PREFIX + REQUEST_QUERY_GROUP_BATCH } + +func getBaseResourceUri() string { + return URI_PREFIX + REQUEST_BASE_RESOURCE +} diff --git a/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/model.go b/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/model.go index c20c85b8..82c6223a 100644 --- a/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/model.go +++ b/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/model.go @@ -60,6 +60,11 @@ type GroupInfo struct { DeleteTime string `json:"deleteTime"` } +type ResourceGroupsInfo struct { + ResourceInfo + GroupIds []string `json:"groupIds"` +} + type BindResourceToGroupArgs struct { Bindings []Binding `json:"bindings"` } @@ -135,3 +140,8 @@ type ResourceGroupsDetailFull struct { type ResGroupDetailResponse struct { ResourceGroupsDetailFull []ResourceGroupsDetailFull `json:"resGroups"` } + +type ResourceGroupsPageInfo struct { + ResourceGroupsInfo []ResourceGroupsInfo `json:"infos"` + Total int `json:"total"` +} diff --git a/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/resmanager.go b/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/resmanager.go index bc6d1e1e..50595525 100644 --- a/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/resmanager.go +++ b/vendor/github.com/baidubce/bce-sdk-go/services/resmanager/resmanager.go @@ -17,6 +17,7 @@ package resmanager import ( "fmt" + "strconv" "github.com/baidubce/bce-sdk-go/bce" "github.com/baidubce/bce-sdk-go/http" @@ -34,7 +35,7 @@ func (c *Client) BindResourceToGroup(args *BindResourceToGroupArgs) (*BindResour result := &BindResourceResult{} err := bce.NewRequestBuilder(c). WithMethod(http.POST). - WithURL(getAddToGroupUri()). + WithURL(getBaseResourceUri()). WithQueryParamFilter("force", "false"). WithHeader(http.CONTENT_TYPE, bce.DEFAULT_CONTENT_TYPE). WithBody(args). @@ -75,7 +76,7 @@ func (c *Client) RemoveResourceFromGroup(args *BindResourceToGroupArgs) error { } err := bce.NewRequestBuilder(c). WithMethod(http.PUT). - WithURL(getAddToGroupUri()). + WithURL(getBaseResourceUri()). WithQueryParamFilter("force", "false"). WithHeader(http.CONTENT_TYPE, bce.DEFAULT_CONTENT_TYPE). WithBody(args). @@ -117,3 +118,25 @@ func (c *Client) GetResGroupBatch(args *ResGroupDetailRequest) (*ResGroupDetailR return result, err } + +func (c *Client) getGroupRes(groupId, id, types, regions, name string, isCurrent bool, tags string, pageNo, pageSize int) (*ResourceGroupsPageInfo, error) { + result := &ResourceGroupsPageInfo{} + err := bce.NewRequestBuilder(c). + WithMethod(http.GET). + WithURL(getBaseResourceUri()). + WithQueryParam("queryGroupResource", ""). + WithQueryParamFilter("groupId", groupId). + WithQueryParamFilter("id", id). + WithQueryParamFilter("types", types). + WithQueryParamFilter("regions", regions). + WithQueryParamFilter("name", name). + WithQueryParamFilter("isCurrent", strconv.FormatBool(isCurrent)). + WithQueryParamFilter("tags", tags). + WithQueryParamFilter("pageNo", strconv.Itoa(pageNo)). + WithQueryParamFilter("pageSize", strconv.Itoa(pageSize)). + WithHeader(http.CONTENT_TYPE, bce.DEFAULT_CONTENT_TYPE). + WithResult(result). + Do() + + return result, err +} diff --git a/vendor/github.com/baidubce/bce-sdk-go/services/vpc/model.go b/vendor/github.com/baidubce/bce-sdk-go/services/vpc/model.go index 7a8da759..2eb3e7ad 100644 --- a/vendor/github.com/baidubce/bce-sdk-go/services/vpc/model.go +++ b/vendor/github.com/baidubce/bce-sdk-go/services/vpc/model.go @@ -432,15 +432,16 @@ type UpdateAclRuleArgs struct { // CreateNatGatewayArgs defines the structure of the input parameters for the CreateNatGateway api type CreateNatGatewayArgs struct { - ClientToken string `json:"-"` - Name string `json:"name"` - VpcId string `json:"vpcId"` - Spec NatGatewaySpecType `json:"spec"` - CuNum string `json:"cuNum,omitempty"` - Eips []string `json:"eips,omitempty"` - DnatEips []string `json:"dnatEips,omitempty"` - Billing *Billing `json:"billing"` - Tags []model.TagModel `json:"tags,omitempty"` + ClientToken string `json:"-"` + Name string `json:"name"` + VpcId string `json:"vpcId"` + Spec NatGatewaySpecType `json:"spec"` + CuNum string `json:"cuNum,omitempty"` + Eips []string `json:"eips,omitempty"` + DnatEips []string `json:"dnatEips,omitempty"` + Billing *Billing `json:"billing"` + Tags []model.TagModel `json:"tags,omitempty"` + ResourceGroupId string `json:"resourceGroupId,omitempty"` } type ResizeNatGatewayArgs struct { @@ -668,6 +669,7 @@ type CreatePeerConnArgs struct { PeerIfName string `json:"peerIfName,omitempty"` Billing *Billing `json:"billing"` Tags []model.TagModel `json:"tags,omitempty"` + ResourceGroupId string `json:"resourceGroupId,omitempty"` } // CreatePeerConnResult defines the structure of the output parameters for the CreatePeerConn api diff --git a/vendor/github.com/baidubce/bce-sdk-go/services/vpn/model.go b/vendor/github.com/baidubce/bce-sdk-go/services/vpn/model.go index da5f7d56..da43c888 100644 --- a/vendor/github.com/baidubce/bce-sdk-go/services/vpn/model.go +++ b/vendor/github.com/baidubce/bce-sdk-go/services/vpn/model.go @@ -16,6 +16,8 @@ package vpn +import "github.com/baidubce/bce-sdk-go/model" + type ( PaymentTimingType string PeerConnRoleType string @@ -34,12 +36,14 @@ const ( // CreateVpnGatewayArgs defines the structure of the input parameters for the CreateVpnGateway api type CreateVpnGatewayArgs struct { - ClientToken string `json:"-"` - VpnName string `json:"vpnName"` - VpcId string `json:"vpcId"` - Description string `json:"description,omitempty"` - Eip string `json:"eip,omitempty"` - Billing *Billing `json:"billing"` + ClientToken string `json:"-"` + VpnName string `json:"vpnName"` + VpcId string `json:"vpcId"` + Description string `json:"description,omitempty"` + Eip string `json:"eip,omitempty"` + Billing *Billing `json:"billing"` + ResourceGroupId string `json:"resourceGroupId,omitempty"` + Tags []model.TagModel `json:"tags,omitempty"` } type Reservation struct { @@ -76,17 +80,18 @@ type ListVpnGatewayResult struct { // VPN is the result for getVpnDetail api. type VPN struct { - Status VpnStatusType `json:"status"` - Eip string `json:"eip"` - VpnId string `json:"vpnId"` - VpcId string `json:"vpcId"` - Description string `json:"description"` - ExpiredTime string `json:"expiredTime"` - ProductType string `json:"paymentTiming"` - VpnConnNum int `json:"vpnConnNum"` - BandwidthInMbps int `json:"bandwidthInMbps"` - VpnConns []VpnConn `json:"vpnConns"` - Name string `json:"vpnName"` + Status VpnStatusType `json:"status"` + Eip string `json:"eip"` + VpnId string `json:"vpnId"` + VpcId string `json:"vpcId"` + Description string `json:"description"` + ExpiredTime string `json:"expiredTime"` + ProductType string `json:"paymentTiming"` + VpnConnNum int `json:"vpnConnNum"` + BandwidthInMbps int `json:"bandwidthInMbps"` + VpnConns []VpnConn `json:"vpnConns"` + Name string `json:"vpnName"` + Tags []model.TagModel `json:"tags"` } // UpdateVpnGatewayArgs defines the structure of the input parameters for the UpdateVpnGateway api diff --git a/vendor/github.com/baidubce/bce-sdk-go/services/vpn/vpn.go b/vendor/github.com/baidubce/bce-sdk-go/services/vpn/vpn.go index 0b945362..5e90343e 100644 --- a/vendor/github.com/baidubce/bce-sdk-go/services/vpn/vpn.go +++ b/vendor/github.com/baidubce/bce-sdk-go/services/vpn/vpn.go @@ -53,7 +53,7 @@ func (c *Client) CreateVpnGateway(args *CreateVpnGatewayArgs) (*CreateVpnGateway // PARAMS: // - args: the arguments to list vpn gateways // RETURNS: -// - *ListVpnGatewayResult: the result of vpn gateway list +// - *ListVpnGatewayResult: the result of vpn gateway list, excluding tags. // - error: nil if success otherwise the specific error func (c *Client) ListVpnGateway(args *ListVpnGatewayArgs) (*ListVpnGatewayResult, error) { diff --git a/vendor/modules.txt b/vendor/modules.txt index 97ff49ce..6cdc09d5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -77,7 +77,7 @@ github.com/aws/aws-sdk-go/service/sso github.com/aws/aws-sdk-go/service/sso/ssoiface github.com/aws/aws-sdk-go/service/sts github.com/aws/aws-sdk-go/service/sts/stsiface -# github.com/baidubce/bce-sdk-go v0.9.176 +# github.com/baidubce/bce-sdk-go v0.9.177 github.com/baidubce/bce-sdk-go/auth github.com/baidubce/bce-sdk-go/bce github.com/baidubce/bce-sdk-go/http diff --git a/website/docs/r/mongodb_instance.html.markdown b/website/docs/r/mongodb_instance.html.markdown index d2f2af0e..0f1afb0e 100644 --- a/website/docs/r/mongodb_instance.html.markdown +++ b/website/docs/r/mongodb_instance.html.markdown @@ -55,6 +55,7 @@ resource "baiducloud_mongodb_instance" "example" { - `engine_version` (String) Database version of the instance. Valid values: `3.4`, `3.6`. - `name` (String) Name of the instance. If not specified, it will be randomly generated. - `payment_timing` (String) Payment timing of billing. Valid values: `Prepaid`, `Postpaid`. Defaults to `Postpaid`. +- `auto_renew_time_length` - (Optional, ForceNew)The automatic renewal time (month). Effective when `payment_timing` is `Prepaid`. Valid values: `1`~`9`, `12`, `24`, `36`. - `readonly_node_num` (Number) Number of readonly nodes in the instance. Only effective when `voting_member_num` is set to `2` or `3`. Valid values: `0`~`5`. Defaults to `0`. - `reservation_length` (Number) The reservation length (month) will pay. Effective when `payment_timing` is `Prepaid`. Valid values: `1`~`9`, `12`, `24`, `36`. Defaults to `1`. - `resource_group_id` (String) Resource group id of the resource. Effective upon creation, modifications are not supported currently. diff --git a/website/docs/r/mongodb_sharding_instance.html.markdown b/website/docs/r/mongodb_sharding_instance.html.markdown index 5e2a7f48..70d356aa 100644 --- a/website/docs/r/mongodb_sharding_instance.html.markdown +++ b/website/docs/r/mongodb_sharding_instance.html.markdown @@ -63,6 +63,7 @@ resource "baiducloud_mongodb_sharding_instance" "example" { - `name` (String) Name of the instance. If not specified, it will be randomly generated. - `payment_timing` (String) Payment timing of billing. Valid values: `Prepaid`, `Postpaid`. Defaults to `Postpaid`. - `reservation_length` (Number) The reservation length (month) will pay. Effective when `payment_timing` is `Prepaid`. Valid values: `1`~`9`, `12`, `24`, `36`. Defaults to `1`. +- `auto_renew_time_length` - (Optional, ForceNew)The automatic renewal time (month). Effective when `payment_timing` is `Prepaid`. Valid values: `1`~`9`, `12`, `24`, `36`. - `resource_group_id` (String) Resource group id of the resource. Effective upon creation, modifications are not supported currently. - `shard_storage_type` (String) Storage type of the instance. Valid values: `CDS_PREMIUM_SSD`, `CDS_ENHANCED_SSD`, `LOCAL_DISK`. Defaults to `CDS_PREMIUM_SSD`. - `storage_engine` (String) Storage engine of the instance. Valid values: `WiredTiger`.