diff --git a/services/ugn/apis.go b/services/ugn/apis.go index 1b25c7b4..7aba3283 100644 --- a/services/ugn/apis.go +++ b/services/ugn/apis.go @@ -205,25 +205,25 @@ type CreateUGNRequest struct { // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) // ProjectId *string `required:"true"` - // 云联网名称,如果没有传入,默认值为“UGN” + // Name *string `required:"false"` - // 云联网备注,如果没有传入的话,默认为“” - Remark *string `required:"false"` + // 数组,数组内每个元素的字段如下:NetworkID:string,网络实例 ID,如 uvnet-xxxx;Type:string,网络实例类型,枚举值:VPC/HybridGW/...;Region:string,网络实例所属地域,如 cn-sh2;OrgName:string,网络实例所属项目名,如 org-xxx + Networks []string `required:"false"` - // 业务组Id,如果没有传入,默认值为“Default” - Tag *string `required:"false"` + // + Remark *string `required:"false"` } // CreateUGNResponse is response schema for CreateUGN action type CreateUGNResponse struct { response.CommonBase - // 返回码描述信息 + // Message string - // 云联网Id - UGNId string + // + UGNID string } // NewCreateUGNRequest will create request of CreateUGN action. @@ -425,68 +425,6 @@ func (c *UGNClient) DescribeInterRegionBandwidth(req *DescribeInterRegionBandwid return &res, nil } -// DescribeUGNRequest is request schema for DescribeUGN action -type DescribeUGNRequest struct { - request.CommonBase - - // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) - // ProjectId *string `required:"true"` - - // 数据分页值。默认为20 - Limit *int `required:"false"` - - // 数据偏移量。默认为0 - Offset *int `required:"false"` - - // 云联网Id - UGNIds []string `required:"false"` -} - -// DescribeUGNResponse is response schema for DescribeUGN action -type DescribeUGNResponse struct { - response.CommonBase - - // 返回码描述信息 - Message string - - // UGNs字段的数量 - TotalCount int - - // 云联网信息 - UGNs []UGN -} - -// NewDescribeUGNRequest will create request of DescribeUGN action. -func (c *UGNClient) NewDescribeUGNRequest() *DescribeUGNRequest { - req := &DescribeUGNRequest{} - - // setup request with client config - c.Client.SetupRequest(req) - - // setup retryable with default retry policy (retry for non-create action and common error) - req.SetRetryable(true) - return req -} - -/* -API: DescribeUGN - -查询云联网 -*/ -func (c *UGNClient) DescribeUGN(req *DescribeUGNRequest) (*DescribeUGNResponse, error) { - var err error - var res DescribeUGNResponse - - reqCopier := *req - - err = c.Client.InvokeAction("DescribeUGN", &reqCopier, &res) - if err != nil { - return &res, err - } - - return &res, nil -} - // DescribeUGNInstanceRequest is request schema for DescribeUGNInstance action type DescribeUGNInstanceRequest struct { request.CommonBase @@ -959,3 +897,104 @@ func (c *UGNClient) UnpublishUGNRouteRule(req *UnpublishUGNRouteRuleRequest) (*U return &res, nil } + +// UpdateUGNBwPackageRequest is request schema for UpdateUGNBwPackage action +type UpdateUGNBwPackageRequest struct { + request.CommonBase + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + // ProjectId *string `required:"false"` + + // + BwBidRate *float64 `required:"true"` + + // + BwULRate *float64 `required:"true"` + + // + ChargeType *string `required:"false"` + + // + Coupon *string `required:"false"` + + // 名称 + Name *string `required:"false"` + + // 带宽包 ID + PackageID *string `required:"true"` + + // + Path *string `required:"true"` + + // + PayMode *string `required:"true"` + + // + Qos *string `required:"true"` + + // + Quantity *string `required:"false"` + + // + RegionA *string `required:"true"` + + // + RegionABwMax *int `required:"true"` + + // + RegionABwMin *int `required:"true"` + + // + RegionB *string `required:"true"` + + // + RegionBBwMax *int `required:"true"` + + // + RegionBBwMin *int `required:"true"` + + // 备注 + Remark *string `required:"false"` + + // 所绑定的 UGN ID + UGNID *string `required:"true"` +} + +// UpdateUGNBwPackageResponse is response schema for UpdateUGNBwPackage action +type UpdateUGNBwPackageResponse struct { + response.CommonBase + + // + Message string +} + +// NewUpdateUGNBwPackageRequest will create request of UpdateUGNBwPackage action. +func (c *UGNClient) NewUpdateUGNBwPackageRequest() *UpdateUGNBwPackageRequest { + req := &UpdateUGNBwPackageRequest{} + + // setup request with client config + c.Client.SetupRequest(req) + + // setup retryable with default retry policy (retry for non-create action and common error) + req.SetRetryable(true) + return req +} + +/* +API: UpdateUGNBwPackage + +更新带宽包配置 +*/ +func (c *UGNClient) UpdateUGNBwPackage(req *UpdateUGNBwPackageRequest) (*UpdateUGNBwPackageResponse, error) { + var err error + var res UpdateUGNBwPackageResponse + + reqCopier := *req + + err = c.Client.InvokeAction("UpdateUGNBwPackage", &reqCopier, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/services/ugn/models.go b/services/ugn/models.go index c22c3605..fa9d78e9 100644 --- a/services/ugn/models.go +++ b/services/ugn/models.go @@ -38,36 +38,6 @@ type InterRegionBandwidth struct { UGNId string } -/* -UGN - 云联网信息 -*/ -type UGN struct { - - // 云联网创建时间 - CreateTime int - - // 实例Id - Instances []string - - // 跨域路由Id - InterRegionBandwidths []string - - // 云联网名称 - Name string - - // 云联网备注 - Remark string - - // 路由规则Id - RouteRules []string - - // 业务组Id - Tag string - - // 云联网Id - UGNId string -} - /* Instance - 云联网实例信息 */ diff --git a/tests/setup_test.go b/tests/setup_test.go index cc501cd8..6ebe6c1f 100644 --- a/tests/setup_test.go +++ b/tests/setup_test.go @@ -63,6 +63,7 @@ import ( "github.com/ucloud/ucloud-sdk-go/services/udts" "github.com/ucloud/ucloud-sdk-go/services/uec" "github.com/ucloud/ucloud-sdk-go/services/ufs" + "github.com/ucloud/ucloud-sdk-go/services/ugn" "github.com/ucloud/ucloud-sdk-go/services/uk8s" "github.com/ucloud/ucloud-sdk-go/services/umedia" "github.com/ucloud/ucloud-sdk-go/services/unvs" @@ -195,6 +196,9 @@ func testSetup() { spec.AddFixture("UFile", driver.SetupClientFixture(func() (ucloud.ServiceClient, error) { return ufile.NewClient(&cfg, &credential), nil })) + spec.AddFixture("UGN", driver.SetupClientFixture(func() (ucloud.ServiceClient, error) { + return ugn.NewClient(&cfg, &credential), nil + })) spec.AddFixture("UHost", driver.SetupClientFixture(func() (ucloud.ServiceClient, error) { return uhost.NewClient(&cfg, &credential), nil })) diff --git a/ucloud/version/version.go b/ucloud/version/version.go index 80adf4ab..db1f4eff 100644 --- a/ucloud/version/version.go +++ b/ucloud/version/version.go @@ -1,3 +1,3 @@ package version -const Version = "0.22.9" +const Version = "0.22.10"