diff --git a/services/ugn/apis.go b/services/ugn/apis.go index 7aba3283..93a7e2d1 100644 --- a/services/ugn/apis.go +++ b/services/ugn/apis.go @@ -198,65 +198,6 @@ func (c *UGNClient) CreateInterRegionBandwidth(req *CreateInterRegionBandwidthRe return &res, nil } -// CreateUGNRequest is request schema for CreateUGN action -type CreateUGNRequest struct { - request.CommonBase - - // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) - // ProjectId *string `required:"true"` - - // - Name *string `required:"false"` - - // 数组,数组内每个元素的字段如下:NetworkID:string,网络实例 ID,如 uvnet-xxxx;Type:string,网络实例类型,枚举值:VPC/HybridGW/...;Region:string,网络实例所属地域,如 cn-sh2;OrgName:string,网络实例所属项目名,如 org-xxx - Networks []string `required:"false"` - - // - Remark *string `required:"false"` -} - -// CreateUGNResponse is response schema for CreateUGN action -type CreateUGNResponse struct { - response.CommonBase - - // - Message string - - // - UGNID string -} - -// NewCreateUGNRequest will create request of CreateUGN action. -func (c *UGNClient) NewCreateUGNRequest() *CreateUGNRequest { - req := &CreateUGNRequest{} - - // 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(false) - return req -} - -/* -API: CreateUGN - -创建云联网 -*/ -func (c *UGNClient) CreateUGN(req *CreateUGNRequest) (*CreateUGNResponse, error) { - var err error - var res CreateUGNResponse - - reqCopier := *req - - err = c.Client.InvokeAction("CreateUGN", &reqCopier, &res) - if err != nil { - return &res, err - } - - return &res, nil -} - // DeleteInterRegionBandwidthRequest is request schema for DeleteInterRegionBandwidth action type DeleteInterRegionBandwidthRequest struct { request.CommonBase @@ -425,6 +366,68 @@ func (c *UGNClient) DescribeInterRegionBandwidth(req *DescribeInterRegionBandwid return &res, nil } +// DescribeSimpleUGNRequest is request schema for DescribeSimpleUGN action +type DescribeSimpleUGNRequest struct { + request.CommonBase + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + // ProjectId *string `required:"false"` + + // UGN ID + UGNID *string `required:"true"` +} + +// DescribeSimpleUGNResponse is response schema for DescribeSimpleUGN action +type DescribeSimpleUGNResponse struct { + response.CommonBase + + // + BwPackages []SimpleBwPackage + + // + Message string + + // + Networks []SimpleNetwork + + // + Routes []SimpleRoute + + // + UGN UGN +} + +// NewDescribeSimpleUGNRequest will create request of DescribeSimpleUGN action. +func (c *UGNClient) NewDescribeSimpleUGNRequest() *DescribeSimpleUGNRequest { + req := &DescribeSimpleUGNRequest{} + + // 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: DescribeSimpleUGN + +获取简洁版UGN详情 +*/ +func (c *UGNClient) DescribeSimpleUGN(req *DescribeSimpleUGNRequest) (*DescribeSimpleUGNResponse, error) { + var err error + var res DescribeSimpleUGNResponse + + reqCopier := *req + + err = c.Client.InvokeAction("DescribeSimpleUGN", &reqCopier, &res) + if err != nil { + return &res, err + } + + return &res, nil +} + // DescribeUGNInstanceRequest is request schema for DescribeUGNInstance action type DescribeUGNInstanceRequest struct { request.CommonBase @@ -662,6 +665,201 @@ func (c *UGNClient) DetachUGNInstance(req *DetachUGNInstanceRequest) (*DetachUGN return &res, nil } +// GetSimpleUGNBwPackagesRequest is request schema for GetSimpleUGNBwPackages action +type GetSimpleUGNBwPackagesRequest 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"` + + // + UGNID *string `required:"true"` +} + +// GetSimpleUGNBwPackagesResponse is response schema for GetSimpleUGNBwPackages action +type GetSimpleUGNBwPackagesResponse struct { + response.CommonBase + + // + BwPackages []SimpleBwPackage + + // + Limit int + + // + Message string + + // + Offset int + + // + TotalCount int +} + +// NewGetSimpleUGNBwPackagesRequest will create request of GetSimpleUGNBwPackages action. +func (c *UGNClient) NewGetSimpleUGNBwPackagesRequest() *GetSimpleUGNBwPackagesRequest { + req := &GetSimpleUGNBwPackagesRequest{} + + // 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: GetSimpleUGNBwPackages + +获取指定云联网内的带宽包 +*/ +func (c *UGNClient) GetSimpleUGNBwPackages(req *GetSimpleUGNBwPackagesRequest) (*GetSimpleUGNBwPackagesResponse, error) { + var err error + var res GetSimpleUGNBwPackagesResponse + + reqCopier := *req + + err = c.Client.InvokeAction("GetSimpleUGNBwPackages", &reqCopier, &res) + if err != nil { + return &res, err + } + + return &res, nil +} + +// ListSimpleBwPackageRequest is request schema for ListSimpleBwPackage action +type ListSimpleBwPackageRequest struct { + request.CommonBase + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + // ProjectId *string `required:"true"` + + // + Limit *int `required:"false"` + + // + Offset *int `required:"false"` +} + +// ListSimpleBwPackageResponse is response schema for ListSimpleBwPackage action +type ListSimpleBwPackageResponse struct { + response.CommonBase + + // + BwPackages []SimpleBwPackage + + // + Limit int + + // + Offset int + + // + TotalCount int +} + +// NewListSimpleBwPackageRequest will create request of ListSimpleBwPackage action. +func (c *UGNClient) NewListSimpleBwPackageRequest() *ListSimpleBwPackageRequest { + req := &ListSimpleBwPackageRequest{} + + // 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: ListSimpleBwPackage + +获取当前项目下的带宽包列表 +*/ +func (c *UGNClient) ListSimpleBwPackage(req *ListSimpleBwPackageRequest) (*ListSimpleBwPackageResponse, error) { + var err error + var res ListSimpleBwPackageResponse + + reqCopier := *req + + err = c.Client.InvokeAction("ListSimpleBwPackage", &reqCopier, &res) + if err != nil { + return &res, err + } + + return &res, nil +} + +// ListUGNRequest is request schema for ListUGN action +type ListUGNRequest 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"` +} + +// ListUGNResponse is response schema for ListUGN action +type ListUGNResponse struct { + response.CommonBase + + // + Limit int + + // + Message string + + // + Offset int + + // + TotalCount int + + // + UGNs []UGN +} + +// NewListUGNRequest will create request of ListUGN action. +func (c *UGNClient) NewListUGNRequest() *ListUGNRequest { + req := &ListUGNRequest{} + + // 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: ListUGN + +获取当前项目下所有云联网资源 +*/ +func (c *UGNClient) ListUGN(req *ListUGNRequest) (*ListUGNResponse, error) { + var err error + var res ListUGNResponse + + reqCopier := *req + + err = c.Client.InvokeAction("ListUGN", &reqCopier, &res) + if err != nil { + return &res, err + } + + return &res, nil +} + // ModifyInterRegionBandwidthRequest is request schema for ModifyInterRegionBandwidth action type ModifyInterRegionBandwidthRequest struct { request.CommonBase @@ -777,61 +975,55 @@ func (c *UGNClient) ModifyUGNAttribute(req *ModifyUGNAttributeRequest) (*ModifyU return &res, nil } -// PublishUGNRouteRuleRequest is request schema for PublishUGNRouteRule action -type PublishUGNRouteRuleRequest struct { +// ModifyUGNBandwidthRequest is request schema for ModifyUGNBandwidth action +type ModifyUGNBandwidthRequest struct { request.CommonBase // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) - // ProjectId *string `required:"true"` - - // 归属实例路由规则Id - DeriveRouteRuleId *string `required:"true"` + // ProjectId *string `required:"false"` - // 归属实例路由表Id - DeriveRouteTableId *string `required:"true"` + // 带宽值 + BandWidth *int `required:"true"` - // 实例Id - InstanceId *string `required:"true"` + // 带宽包id + PackageID *string `required:"true"` - // 云联网Id - UGNId *string `required:"true"` + // 云联网id + UGNID *string `required:"true"` } -// PublishUGNRouteRuleResponse is response schema for PublishUGNRouteRule action -type PublishUGNRouteRuleResponse struct { +// ModifyUGNBandwidthResponse is response schema for ModifyUGNBandwidth action +type ModifyUGNBandwidthResponse struct { response.CommonBase - // 返回码描述信息 + // Message string - - // 路由规则Id - RouteRuleId string } -// NewPublishUGNRouteRuleRequest will create request of PublishUGNRouteRule action. -func (c *UGNClient) NewPublishUGNRouteRuleRequest() *PublishUGNRouteRuleRequest { - req := &PublishUGNRouteRuleRequest{} +// NewModifyUGNBandwidthRequest will create request of ModifyUGNBandwidth action. +func (c *UGNClient) NewModifyUGNBandwidthRequest() *ModifyUGNBandwidthRequest { + req := &ModifyUGNBandwidthRequest{} // 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(false) + req.SetRetryable(true) return req } /* -API: PublishUGNRouteRule +API: ModifyUGNBandwidth -发布云联网路由规则 +修改云联网带宽大小 */ -func (c *UGNClient) PublishUGNRouteRule(req *PublishUGNRouteRuleRequest) (*PublishUGNRouteRuleResponse, error) { +func (c *UGNClient) ModifyUGNBandwidth(req *ModifyUGNBandwidthRequest) (*ModifyUGNBandwidthResponse, error) { var err error - var res PublishUGNRouteRuleResponse + var res ModifyUGNBandwidthResponse reqCopier := *req - err = c.Client.InvokeAction("PublishUGNRouteRule", &reqCopier, &res) + err = c.Client.InvokeAction("ModifyUGNBandwidth", &reqCopier, &res) if err != nil { return &res, err } @@ -839,8 +1031,8 @@ func (c *UGNClient) PublishUGNRouteRule(req *PublishUGNRouteRuleRequest) (*Publi return &res, nil } -// UnpublishUGNRouteRuleRequest is request schema for UnpublishUGNRouteRule action -type UnpublishUGNRouteRuleRequest struct { +// PublishUGNRouteRuleRequest is request schema for PublishUGNRouteRule action +type PublishUGNRouteRuleRequest struct { request.CommonBase // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) @@ -859,38 +1051,41 @@ type UnpublishUGNRouteRuleRequest struct { UGNId *string `required:"true"` } -// UnpublishUGNRouteRuleResponse is response schema for UnpublishUGNRouteRule action -type UnpublishUGNRouteRuleResponse struct { +// PublishUGNRouteRuleResponse is response schema for PublishUGNRouteRule action +type PublishUGNRouteRuleResponse struct { response.CommonBase // 返回码描述信息 Message string + + // 路由规则Id + RouteRuleId string } -// NewUnpublishUGNRouteRuleRequest will create request of UnpublishUGNRouteRule action. -func (c *UGNClient) NewUnpublishUGNRouteRuleRequest() *UnpublishUGNRouteRuleRequest { - req := &UnpublishUGNRouteRuleRequest{} +// NewPublishUGNRouteRuleRequest will create request of PublishUGNRouteRule action. +func (c *UGNClient) NewPublishUGNRouteRuleRequest() *PublishUGNRouteRuleRequest { + req := &PublishUGNRouteRuleRequest{} // 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) + req.SetRetryable(false) return req } /* -API: UnpublishUGNRouteRule +API: PublishUGNRouteRule -取消发布云联网路由规则 +发布云联网路由规则 */ -func (c *UGNClient) UnpublishUGNRouteRule(req *UnpublishUGNRouteRuleRequest) (*UnpublishUGNRouteRuleResponse, error) { +func (c *UGNClient) PublishUGNRouteRule(req *PublishUGNRouteRuleRequest) (*PublishUGNRouteRuleResponse, error) { var err error - var res UnpublishUGNRouteRuleResponse + var res PublishUGNRouteRuleResponse reqCopier := *req - err = c.Client.InvokeAction("UnpublishUGNRouteRule", &reqCopier, &res) + err = c.Client.InvokeAction("PublishUGNRouteRule", &reqCopier, &res) if err != nil { return &res, err } @@ -898,79 +1093,102 @@ func (c *UGNClient) UnpublishUGNRouteRule(req *UnpublishUGNRouteRuleRequest) (*U return &res, nil } -// UpdateUGNBwPackageRequest is request schema for UpdateUGNBwPackage action -type UpdateUGNBwPackageRequest struct { +// SDescribeUGNRequest is request schema for SDescribeUGN action +type SDescribeUGNRequest struct { request.CommonBase // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) // ProjectId *string `required:"false"` - // - BwBidRate *float64 `required:"true"` + // UGN ID + UGNID *string `required:"true"` +} - // - BwULRate *float64 `required:"true"` +// SDescribeUGNResponse is response schema for SDescribeUGN action +type SDescribeUGNResponse struct { + response.CommonBase // - ChargeType *string `required:"false"` + BwPackages []SBwPackage // - Coupon *string `required:"false"` + Message string - // 名称 - Name *string `required:"false"` + // + Networks []SNetwork - // 带宽包 ID - PackageID *string `required:"true"` + // 暂不支持 + Policies []string // - Path *string `required:"true"` + Routes []Route // - PayMode *string `required:"true"` + UGN UGN +} - // - Qos *string `required:"true"` +// NewSDescribeUGNRequest will create request of SDescribeUGN action. +func (c *UGNClient) NewSDescribeUGNRequest() *SDescribeUGNRequest { + req := &SDescribeUGNRequest{} - // - Quantity *string `required:"false"` + // setup request with client config + c.Client.SetupRequest(req) - // - RegionA *string `required:"true"` + // setup retryable with default retry policy (retry for non-create action and common error) + req.SetRetryable(true) + return req +} - // - RegionABwMax *int `required:"true"` +/* +API: SDescribeUGN - // - RegionABwMin *int `required:"true"` +获取简洁版UGN详情 +*/ +func (c *UGNClient) SDescribeUGN(req *SDescribeUGNRequest) (*SDescribeUGNResponse, error) { + var err error + var res SDescribeUGNResponse - // - RegionB *string `required:"true"` + reqCopier := *req - // - RegionBBwMax *int `required:"true"` + err = c.Client.InvokeAction("SDescribeUGN", &reqCopier, &res) + if err != nil { + return &res, err + } - // - RegionBBwMin *int `required:"true"` + return &res, nil +} - // 备注 - Remark *string `required:"false"` +// UnpublishUGNRouteRuleRequest is request schema for UnpublishUGNRouteRule action +type UnpublishUGNRouteRuleRequest struct { + request.CommonBase - // 所绑定的 UGN ID - UGNID *string `required:"true"` + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + // ProjectId *string `required:"true"` + + // 归属实例路由规则Id + DeriveRouteRuleId *string `required:"true"` + + // 归属实例路由表Id + DeriveRouteTableId *string `required:"true"` + + // 实例Id + InstanceId *string `required:"true"` + + // 云联网Id + UGNId *string `required:"true"` } -// UpdateUGNBwPackageResponse is response schema for UpdateUGNBwPackage action -type UpdateUGNBwPackageResponse struct { +// UnpublishUGNRouteRuleResponse is response schema for UnpublishUGNRouteRule action +type UnpublishUGNRouteRuleResponse struct { response.CommonBase - // + // 返回码描述信息 Message string } -// NewUpdateUGNBwPackageRequest will create request of UpdateUGNBwPackage action. -func (c *UGNClient) NewUpdateUGNBwPackageRequest() *UpdateUGNBwPackageRequest { - req := &UpdateUGNBwPackageRequest{} +// NewUnpublishUGNRouteRuleRequest will create request of UnpublishUGNRouteRule action. +func (c *UGNClient) NewUnpublishUGNRouteRuleRequest() *UnpublishUGNRouteRuleRequest { + req := &UnpublishUGNRouteRuleRequest{} // setup request with client config c.Client.SetupRequest(req) @@ -981,17 +1199,17 @@ func (c *UGNClient) NewUpdateUGNBwPackageRequest() *UpdateUGNBwPackageRequest { } /* -API: UpdateUGNBwPackage +API: UnpublishUGNRouteRule -更新带宽包配置 +取消发布云联网路由规则 */ -func (c *UGNClient) UpdateUGNBwPackage(req *UpdateUGNBwPackageRequest) (*UpdateUGNBwPackageResponse, error) { +func (c *UGNClient) UnpublishUGNRouteRule(req *UnpublishUGNRouteRuleRequest) (*UnpublishUGNRouteRuleResponse, error) { var err error - var res UpdateUGNBwPackageResponse + var res UnpublishUGNRouteRuleResponse reqCopier := *req - err = c.Client.InvokeAction("UpdateUGNBwPackage", &reqCopier, &res) + err = c.Client.InvokeAction("UnpublishUGNRouteRule", &reqCopier, &res) if err != nil { return &res, err } diff --git a/services/ugn/models.go b/services/ugn/models.go index fa9d78e9..3cf7c5fc 100644 --- a/services/ugn/models.go +++ b/services/ugn/models.go @@ -38,6 +38,135 @@ type InterRegionBandwidth struct { UGNId string } +/* +SimpleNetwork - 简洁版云联网网络实例 +*/ +type SimpleNetwork struct { + + // + CreateTime int + + // 网络实例名称 + Name string + + // 网络实例的ID,如 vnet-xxxxx + NetworkID string + + // 网络实例所在项目的ID + OrgID int + + // 网络实例所在项目名 + OrgName string + + // 网络实例所在地域 + Region string + + // 网络实例所在地域ID + RegionID int + + // 网络实例类型:VPC/HybridGW/... + Type string +} + +/* +SimpleBwPackage - 简洁版带宽包 +*/ +type SimpleBwPackage struct { + + // 带宽值 + BandWidth float64 + + // 带宽包切换计费类型 + ChangePayMode string + + // 带宽包切换状态 + ChangeStatus int + + // 带宽包切换时间 + ChangeTime int + + // 创建时间 + CreateTime int + + // 过期时间 + ExpireTime int + + // + Name string + + // + PackageID string + + // 智能路径Delay:最低时延|IGP:普通线路|TCO:最低成本 + Path string + + // 计费模式 FixedBw:固定带宽|Peak95:经典95|Max5:第五峰值|Traffic:流量计费 + PayMode string + + // 服务质量Diamond:钻石|Platinum:铂金|Gold:黄金 + Qos string + + // 地域A名称 + RegionA string + + // 地域B名称 + RegionB string + + // + Remark string + + // + UGNID string +} + +/* +UGN - 云联网信息 +*/ +type UGN struct { + + // 绑定带宽包数量 + BwPackageCount int + + // 云联网创建时间 + CreateTime int + + // 云联网名称 + Name string + + // 关联网络实例数量 + NetworkCount int + + // 云联网备注 + Remark string + + // 云联网资源 ID + UGNID string +} + +/* +SimpleRoute - 简洁版云联网路由条目 +*/ +type SimpleRoute struct { + + // 目的网段 + DstAddr string + + // 下一跳网络实例 ID + NextHopID string + + // 下一跳网络实例所属地域 + NextHopRegion string + + // 下一跳网络实例所属地域 id + NextHopRegionID int + + // 下一跳网络实例类型 + NextHopType string + + // 路由优先级 + Priority int +} + /* Instance - 云联网实例信息 */ @@ -118,3 +247,111 @@ type RouteRule struct { // 路由规则类型,枚举值 0:自动发布的LOCAL和动态路由1:手动发布的自定义路由 RouteRuleType int } + +/* +Route - 云联网路由条目 +*/ +type Route struct { + + // 目的网段 + DstAddr string + + // 下一跳网络实例 ID + NexthopID string + + // 下一跳网络实例所属地域 + NexthopRegion string + + // 下一跳网络实例所属地域 id + NexthopRegionID int + + // 下一跳网络实例类型 + NexthopType string + + // 路由优先级 + Priority int +} + +/* +SNetwork - 简洁版云联网网络实例 +*/ +type SNetwork struct { + + // + CreateTime string + + // 网络实例名称 + Name string + + // 网络实例的ID,如 vnet-xxxxx + NetworkID string + + // 网络实例所在项目的ID + OrgID int + + // 网络实例所在项目名 + OrgName string + + // 网络实例所在地域 + Region string + + // 网络实例所在地域ID + RegionID int + + // 网络实例类型:VPC/HybridGW/... + Type string +} + +/* +SBwPackage - 简洁版带宽包 +*/ +type SBwPackage struct { + + // 带宽值 + BandWidth int + + // 带宽包切换计费类型 + ChangePayMode string + + // 带宽包切换状态 + ChangeStatus int + + // 带宽包切换时间 + ChangeTime int + + // 创建时间 + CreateTime int + + // 过期时间 + ExpireTime int + + // 备注信息 + Message string + + // + Name string + + // + PackageID string + + // 智能路径Delay:最低时延|IGP:普通线路|TCO:最低成本 + Path string + + // 计费模式 FixedBw:固定带宽|Peak95:经典95|Max5:第五峰值|Traffic:流量计费 + PayMode string + + // 服务质量Diamond:钻石|Platinum:铂金|Gold:黄金 + Qos string + + // 地域A名称 + RegionA string + + // 地域B名称 + RegionB string + + // + Remark string + + // + UGNID string +} diff --git a/services/ulb/apis.go b/services/ulb/apis.go index 0fe83a64..31be13ce 100644 --- a/services/ulb/apis.go +++ b/services/ulb/apis.go @@ -294,21 +294,6 @@ func (c *ULBClient) BindSSL(req *BindSSLRequest) (*BindSSLResponse, error) { return &res, nil } -/* -CreateListenerParamStickinessConfig is request schema for complex param -*/ -type CreateListenerParamStickinessConfig struct { - - // (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效;限定字符长度:[0-255] - CookieName *string `required:"false"` - - // 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现;默认值为:false - Enabled *bool `required:"false"` - - // (应用型专用)Cookie处理方式。限定枚举值:"ServerInsert" / "UserDefined";默认值为:“ServerInsert” - Type *string `required:"false"` -} - /* CreateListenerParamHealthCheckConfig is request schema for complex param */ @@ -327,6 +312,21 @@ type CreateListenerParamHealthCheckConfig struct { Type *string `required:"false"` } +/* +CreateListenerParamStickinessConfig is request schema for complex param +*/ +type CreateListenerParamStickinessConfig struct { + + // (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效;限定字符长度:[0-255] + CookieName *string `required:"false"` + + // 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现;默认值为:false + Enabled *bool `required:"false"` + + // (应用型专用)Cookie处理方式。限定枚举值:"ServerInsert" / "UserDefined";默认值为:“ServerInsert” + Type *string `required:"false"` +} + // CreateListenerRequest is request schema for CreateListener action type CreateListenerRequest struct { request.CommonBase @@ -623,6 +623,140 @@ func (c *ULBClient) CreatePolicyGroup(req *CreatePolicyGroupRequest) (*CreatePol return &res, nil } +/* +CreateRuleParamRuleActionsForwardConfigTargets is request schema for complex param +*/ +type CreateRuleParamRuleActionsForwardConfigTargets struct { + + // 转发的后端服务节点的标识ID。限定在监听器的服务节点池里;数组长度可以是0;转发服务节点配置的数组长度不为0时,Id必填 + Id *string `required:"false"` + + // 转发的后端服务节点的权重。仅监听器负载均衡算法是加权轮询是有效 + Weight *int `required:"false"` +} + +/* +CreateRuleParamRuleConditionsPathConfig is request schema for complex param +*/ +type CreateRuleParamRuleConditionsPathConfig struct { + + // 取值。暂时只支持数组长度为1;取值需符合相关条件;路径匹配时必填 + Values []string `required:"false"` +} + +/* +CreateRuleParamRuleConditionsHostConfig is request schema for complex param +*/ +type CreateRuleParamRuleConditionsHostConfig struct { + + // 匹配方式。限定枚举值:"Regular"/"Wildcard",默认值:"Regular" + MatchMode *string `required:"false"` + + // 取值。暂时只支持数组长度为1;取值需符合相关匹配方式的条件;域名匹配时必填 + Values []string `required:"false"` +} + +/* +CreateRuleParamRuleActionsForwardConfig is request schema for complex param +*/ +type CreateRuleParamRuleActionsForwardConfig struct { + + // + Targets []CreateRuleParamRuleActionsForwardConfigTargets `required:"false"` +} + +/* +CreateRuleParamRuleConditions is request schema for complex param +*/ +type CreateRuleParamRuleConditions struct { + + // + HostConfig *CreateRuleParamRuleConditionsHostConfig `required:"false"` + + // + PathConfig *CreateRuleParamRuleConditionsPathConfig `required:"false"` + + // 匹配条件类型。限定枚举值:"Host"/"Path" + Type *string `required:"true"` +} + +/* +CreateRuleParamRuleActions is request schema for complex param +*/ +type CreateRuleParamRuleActions struct { + + // + ForwardConfig *CreateRuleParamRuleActionsForwardConfig `required:"false"` + + // 动作类型。限定枚举值:"Forward";RuleActions暂支持长度为1 + Type *string `required:"true"` +} + +// CreateRuleRequest is request schema for CreateRule action +type CreateRuleRequest struct { + request.CommonBase + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + // ProjectId *string `required:"true"` + + // [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + // Region *string `required:"true"` + + // 监听器的ID + ListenerId *string `required:"true"` + + // 负载均衡实例的ID + LoadBalancerId *string `required:"true"` + + // 当转发的服务节点为空时,规则是否忽略。默认值true + Pass *bool `required:"false"` + + // + RuleActions []CreateRuleParamRuleActions `required:"false"` + + // + RuleConditions []CreateRuleParamRuleConditions `required:"false"` +} + +// CreateRuleResponse is response schema for CreateRule action +type CreateRuleResponse struct { + response.CommonBase + + // 转发规则的ID + RuleId string +} + +// NewCreateRuleRequest will create request of CreateRule action. +func (c *ULBClient) NewCreateRuleRequest() *CreateRuleRequest { + req := &CreateRuleRequest{} + + // 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(false) + return req +} + +/* +API: CreateRule + +给应用型负载均衡监听器创建一条转发规则 +*/ +func (c *ULBClient) CreateRule(req *CreateRuleRequest) (*CreateRuleResponse, error) { + var err error + var res CreateRuleResponse + + reqCopier := *req + + err = c.Client.InvokeAction("CreateRule", &reqCopier, &res) + if err != nil { + return &res, err + } + + return &res, nil +} + // CreateSSLRequest is request schema for CreateSSL action type CreateSSLRequest struct { request.CommonBase @@ -1417,6 +1551,145 @@ func (c *ULBClient) DeleteVServer(req *DeleteVServerRequest) (*DeleteVServerResp return &res, nil } +// DescribeListenersRequest is request schema for DescribeListeners action +type DescribeListenersRequest struct { + request.CommonBase + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + // ProjectId *string `required:"true"` + + // [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + // Region *string `required:"true"` + + // 数据分页值,默认为100 + Limit *int `required:"false"` + + // 应用型负载均衡监听器的ID。若指定ListenerId,则忽略LoadBalancerId。ListenId和LoadBalancerId必选其一 + ListenerId *string `required:"false"` + + // 应用型负载均衡实例的ID。未指定ListenId,则描述指定的LoadBalancerId下的所有监听器。 + LoadBalancerId *string `required:"false"` + + // 数据偏移量,默认为0 + Offset *int `required:"false"` +} + +// DescribeListenersResponse is response schema for DescribeListeners action +type DescribeListenersResponse struct { + response.CommonBase + + // 负载均衡监听器信息 + Listeners []Listener + + // 满足条件的负载均衡监听器总数 + TotalCount int +} + +// NewDescribeListenersRequest will create request of DescribeListeners action. +func (c *ULBClient) NewDescribeListenersRequest() *DescribeListenersRequest { + req := &DescribeListenersRequest{} + + // 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: DescribeListeners + +描述一个指定的监听器或者一个应用型负载均衡实例下的所有监听器 +*/ +func (c *ULBClient) DescribeListeners(req *DescribeListenersRequest) (*DescribeListenersResponse, error) { + var err error + var res DescribeListenersResponse + + reqCopier := *req + + err = c.Client.InvokeAction("DescribeListeners", &reqCopier, &res) + if err != nil { + return &res, err + } + + return &res, nil +} + +// DescribeLoadBalancersRequest is request schema for DescribeLoadBalancers action +type DescribeLoadBalancersRequest struct { + request.CommonBase + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + // ProjectId *string `required:"true"` + + // [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + // Region *string `required:"true"` + + // 数据分页值,默认为100 + Limit *string `required:"false"` + + // 负载均衡实例的ID。必须是同一类型的实例,若指定了实例ID,将忽略除Type外的其他过滤条件 + LoadBalancerIds []string `required:"false"` + + // 数据偏移量,默认为0 + Offset *string `required:"false"` + + // 是否获取监听器和后端服务节点的详细信息。默认值:false + ShowDetail *bool `required:"false"` + + // 限定所在的子网 + SubnetId *string `required:"false"` + + // 负载均衡实例的类型。限定枚举值:"Application" / "Network",默认值:"Application" + Type *string `required:"false"` + + // 限定所在的VPC + VPCId *string `required:"false"` +} + +// DescribeLoadBalancersResponse is response schema for DescribeLoadBalancers action +type DescribeLoadBalancersResponse struct { + response.CommonBase + + // 负载均衡实例信息 + LoadBalancers []LoadBalancer + + // 满足条件的负载均衡实例总数 + TotalCount int +} + +// NewDescribeLoadBalancersRequest will create request of DescribeLoadBalancers action. +func (c *ULBClient) NewDescribeLoadBalancersRequest() *DescribeLoadBalancersRequest { + req := &DescribeLoadBalancersRequest{} + + // 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: DescribeLoadBalancers + +描述特定条件下的应用型负载均衡实例或者全部的应用型负载均衡实例 +*/ +func (c *ULBClient) DescribeLoadBalancers(req *DescribeLoadBalancersRequest) (*DescribeLoadBalancersResponse, error) { + var err error + var res DescribeLoadBalancersResponse + + reqCopier := *req + + err = c.Client.InvokeAction("DescribeLoadBalancers", &reqCopier, &res) + if err != nil { + return &res, err + } + + return &res, nil +} + // DescribePolicyGroupRequest is request schema for DescribePolicyGroup action type DescribePolicyGroupRequest struct { request.CommonBase @@ -1473,6 +1746,65 @@ func (c *ULBClient) DescribePolicyGroup(req *DescribePolicyGroupRequest) (*Descr return &res, nil } +// DescribeRulesRequest is request schema for DescribeRules action +type DescribeRulesRequest struct { + request.CommonBase + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + // ProjectId *string `required:"true"` + + // [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + // Region *string `required:"true"` + + // 监听器的ID + ListenerId *string `required:"true"` + + // 应用型负载均衡实例的ID + LoadBalancerId *string `required:"true"` + + // 应用型负载均衡转发规则的ID。指定RuleId,则只描述该规则 + RuleId *string `required:"false"` +} + +// DescribeRulesResponse is response schema for DescribeRules action +type DescribeRulesResponse struct { + response.CommonBase + + // 转发规则信息 + Rules []Rule +} + +// NewDescribeRulesRequest will create request of DescribeRules action. +func (c *ULBClient) NewDescribeRulesRequest() *DescribeRulesRequest { + req := &DescribeRulesRequest{} + + // 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: DescribeRules + +描述一条指定的转发规则或者一个应用型负载均衡监听器下的所有转发规则 +*/ +func (c *ULBClient) DescribeRules(req *DescribeRulesRequest) (*DescribeRulesResponse, error) { + var err error + var res DescribeRulesResponse + + reqCopier := *req + + err = c.Client.InvokeAction("DescribeRules", &reqCopier, &res) + if err != nil { + return &res, err + } + + return &res, nil +} + // DescribeSSLRequest is request schema for DescribeSSL action type DescribeSSLRequest struct { request.CommonBase diff --git a/services/ulb/models.go b/services/ulb/models.go index 9fa47efc..e18a0693 100644 --- a/services/ulb/models.go +++ b/services/ulb/models.go @@ -53,6 +53,357 @@ type BackendSet struct { ResourceId string } +/* +ForwardTargetSet - 转发的后端服务节点 +*/ +type ForwardTargetSet struct { + + // 服务节点的标识ID + Id string + + // 权重。仅监听器负载均衡算法是加权轮询是有效;取值范围[1-100],默认值为1 + Weight int +} + +/* +PathConfigSet - 路径相关配置 +*/ +type PathConfigSet struct { + + // 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件 + Values []string +} + +/* +HostConfigSet - 域名相关配置 +*/ +type HostConfigSet struct { + + // 匹配方式。限定枚举值:Regular-正则,Wildcard-泛域名; 默认值:Regular + MatchMode string + + // 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件 + Values []string +} + +/* +ForwardConfigSet - 转发服务节点相关配置 +*/ +type ForwardConfigSet struct { + + // 转发的后端服务节点。限定在监听器的服务节点池里;数组长度可以为0。具体结构详见 ForwardTargetSet + Targets []ForwardTargetSet +} + +/* +RuleCondition - 转发规则匹配条件 +*/ +type RuleCondition struct { + + // 域名相关配置。Type为Host时必填。具体结构详见 HostConfigSet + HostConfig HostConfigSet + + // 路径相关配置。Type为Path时必填。具体结构详见 PathConfigSet + PathConfig PathConfigSet + + // 匹配条件类型。限定枚举值:Host,Path + Type string +} + +/* +RuleAction - 转发动作 +*/ +type RuleAction struct { + + // 转发服务节点相关配置。 具体结构详见 ForwardConfigSet + ForwardConfig ForwardConfigSet + + // 动作类型。限定枚举值:Forward + Type string +} + +/* +StickinessConfigSet - 会话保持相关配置 +*/ +type StickinessConfigSet struct { + + // (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效 + CookieName string + + // 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现 + Enabled bool + + // (应用型专用)Cookie处理方式。限定枚举值: ServerInsert -> 自动生成KEY;UserDefined -> 用户自定义KEY + Type string +} + +/* +Rule - (应用型专用)转发规则信息 +*/ +type Rule struct { + + // 是否为默认转发规则 + IsDefault bool + + // 当转发的服务节点为空时,规则是否忽略 + Pass bool + + // 转发动作。具体规则详见RuleAction + RuleActions []RuleAction + + // 转发规则匹配条件。具体结构详见 RuleCondition + RuleConditions []RuleCondition + + // 转发规则的ID + RuleId string +} + +/* +Certificate - (应用型专用)服务器证书信息 +*/ +type Certificate struct { + + // 是否为默认证书 + IsDefault bool + + // 证书ID + SSLId string +} + +/* +HealthCheckConfigSet - 健康检查相关配置 +*/ +type HealthCheckConfigSet struct { + + // (应用型专用)HTTP检查域名。 当Type为HTTP时,此字段有意义,代表HTTP检查域名 + Domain string + + // 是否开启健康检查功能。暂时不支持关闭。 默认值为:true + Enabled bool + + // (应用型专用)HTTP检查路径。当Type为HTTP时,此字段有意义,代表HTTP检查路径 + Path string + + // 健康检查方式。应用型限定取值: Port -> 端口检查;HTTP -> HTTP检查; 默认值:Port + Type string +} + +/* +Target - 服务节点信息 +*/ +type Target struct { + + // 服务节点是否启用 + Enabled bool + + // 服务节点的标识ID。为ALB/NLB中使用,与资源自身ID无关,可用于UpdateTargetsAttribute/RemoveTargets + Id string + + // 服务节点是否为备节点 + IsBackup bool + + // 服务节点的端口 + Port int + + // 服务节点的IP + ResourceIP string + + // 服务节点的资源ID + ResourceId string + + // 服务节点的资源名称 + ResourceName string + + // 服务节点的类型。限定枚举值:UHost -> 云主机,UNI -> 虚拟网卡,UPM -> 物理云主机,IP -> IP类型; 默认值:"UHost"; 非IP类型,如果该资源有多个IP,将只能添加主IP; 非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。 在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑 + ResourceType string + + // 服务节点的健康检查状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康 + State string + + // 服务节点的子网资源ID + SubnetId string + + // 服务节点的VPC资源ID + VPCId string + + // 服务节点的权重。仅在加权轮询算法时有效 + Weight int +} + +/* +Listener - 负载均衡监听器信息 +*/ +type Listener struct { + + // (应用型专用)服务器默认证书ID。仅HTTPS监听支持。具体接口详见 Certificate + Certificates []Certificate + + // (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩 + CompressionEnabled bool + + // (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启 + HTTP2Enabled bool + + // 健康检查相关配置。具体结构详见 HealthCheckConfigSet + HealthCheckConfig HealthCheckConfigSet + + // 连接空闲超时时间。单位:秒 + IdleTimeout int + + // 监听器的ID + ListenerId string + + // 监听器的监听端口 + ListenerPort int + + // 监听协议。应用型限定取值: HTTP、HTTPS + ListenerProtocol string + + // 监听器的名称 + Name string + + // (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启 + RedirectEnabled bool + + // (应用型专用)重定向端口 + RedirectPort int + + // 监听器的备注信息 + Remark string + + // (应用型专用)转发规则信息 + Rules []Rule + + // 负载均衡算法。应用型限定取值:Roundrobin -> 轮询;Source -> 源地址; WeightRoundrobin -> 加权轮询; Leastconn -> 最小连接数;Backup ->主备模式 + Scheduler string + + // (应用型专用)安全策略组ID。仅HTTPS监听支持绑定;Default -> 原生策略 + SecurityPolicyId string + + // listener健康状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康,PartialHealth -> 部分健康,None -> 无节点状态 + State string + + // 会话保持相关配置。具体结构详见 StickinessConfigSet + StickinessConfig StickinessConfigSet + + // 添加的服务节点信息。具体结构详见 Target + Targets []Target +} + +/* +FirewallSet - ulb防火墙信息 +*/ +type FirewallSet struct { + + // 防火墙ID + FirewallId string + + // 防火墙名称 + FirewallName string +} + +/* +AccessLogConfigSet - (应用型专用)访问日志相关配置 +*/ +type AccessLogConfigSet struct { + + // (应用型专用)是否开启访问日志记录功能 + Enabled bool + + // (应用型专用)用于存储访问日志的bucket + US3BucketName string + + // (应用型专用)上传访问日志到bucket所需的token + US3TokenId string +} + +/* +IPInfo - 绑定的IP信息 +*/ +type IPInfo struct { + + // 网络模式。 限定枚举值:Internet -> 互联网,Intranet -> 内联网 + AddressType string + + // 带宽值。单位M + Bandwidth int + + // 带宽类型。限定枚举值:1 -> 共享带宽,0 -> 普通带宽类型 + BandwidthType int + + // IP地址 + IP string + + // IP协议版本 + IPVersion string + + // 唯一标识ID + Id string + + // 外网IP的运营商信息。枚举值为:Telecom -> 电信,Unicom -> 联通,International -> 国际IP,Bgp -> BGP,Duplet -> 双线(电信+联通双线路),BGPPro -> 精品BGP,China-mobile -> 中国移动,Anycast -> AnycastEIP + OperatorName string +} + +/* +LoadBalancer - 负载均衡实例信息 +*/ +type LoadBalancer struct { + + // (应用型专用)访问日志相关配置 + AccessLogConfig AccessLogConfigSet + + // 是否开启自动续费 + AutoRenewEnabled bool + + // 付费模式 + ChargeType string + + // 负载均衡实例创建时间。格式为Unix Timestamp + CreateTime int + + // 防火墙信息 + Firewall FirewallSet + + // 绑定的IP信息。具体结构详见 IPInfo + IPInfos []IPInfo + + // 负载均衡实例支持的IP协议版本 + IPVersion string + + // 监听器信息。当ShowDetail为false时,为空 + Listeners []Listener + + // 负载均衡实例的ID + LoadBalancerId string + + // 负载均衡实例的名称 + Name string + + // 有效期(计费)。格式为Unix Timestamp + PurchaseValue int + + // 负载均衡实例的备注信息 + Remark string + + // 应用型实例的代理IP或网络型FULLNAT模式下snat所用的IP + SnatIPs []string + + // lb状态:Normal-正常;Arrears-欠费停服 + Status string + + // 负载均衡实例所属的子网资源ID。负载均衡实例的内网VIP和SNAT场景的源IP限定在该子网内;指定子网不影响添加后端服务节点时的范围,依旧是整个VPC下支持的资源 + SubnetId string + + // 负载均衡实例所属的业务组ID + Tag string + + // 负载均衡实例的类型。限定枚举值:Application -> 应用型,Network -> 网络型 + Type string + + // 负载均衡实例所属的VPC资源ID + VPCId string +} + /* UlbPolicyBackendSet - DescribePolicyGroup */ @@ -356,6 +707,57 @@ type PolicyBackendSet struct { SubResourceType string } +/* +ULBBackendSet - DescribeULB +*/ +type ULBBackendSet struct { + + // 后端资源实例的Id + BackendId string + + // 后端提供服务的实例启用与否,枚举值:0 禁用 1 启用 + Enabled int + + // 是否为backup,只有当vserver的Backup属性为1时才会有此字段,说明:0:主rs1:备rs + IsBackup int + + // 后端提供服务的端口 + Port int + + // 后端提供服务的内网IP + PrivateIP string + + // 资源实例的资源Id + ResourceId string + + // 资源实例的资源名称 + ResourceName string + + // 资源实例的类型 + ResourceType string + + // 后端提供服务的实例运行状态,枚举值:0健康检查健康状态 1 健康检查异常 + Status int + + // 资源绑定的虚拟网卡实例的资源Id + SubResourceId string + + // 资源绑定的虚拟网卡实例的资源名称 + SubResourceName string + + // 资源绑定的虚拟网卡实例的类型 + SubResourceType string + + // 后端提供服务的资源所在的子网的ID + SubnetId string + + // 后端服务器所在的VPC + VPCId string + + // 后端RS权重(在加权轮询算法下有效) + Weight int +} + /* BindSecurityPolicy - VServer绑定的安全策略组信息 */ @@ -410,57 +812,6 @@ type ULBPolicySet struct { VServerId string } -/* -ULBBackendSet - DescribeULB -*/ -type ULBBackendSet struct { - - // 后端资源实例的Id - BackendId string - - // 后端提供服务的实例启用与否,枚举值:0 禁用 1 启用 - Enabled int - - // 是否为backup,只有当vserver的Backup属性为1时才会有此字段,说明:0:主rs1:备rs - IsBackup int - - // 后端提供服务的端口 - Port int - - // 后端提供服务的内网IP - PrivateIP string - - // 资源实例的资源Id - ResourceId string - - // 资源实例的资源名称 - ResourceName string - - // 资源实例的类型 - ResourceType string - - // 后端提供服务的实例运行状态,枚举值:0健康检查健康状态 1 健康检查异常 - Status int - - // 资源绑定的虚拟网卡实例的资源Id - SubResourceId string - - // 资源绑定的虚拟网卡实例的资源名称 - SubResourceName string - - // 资源绑定的虚拟网卡实例的类型 - SubResourceType string - - // 后端提供服务的资源所在的子网的ID - SubnetId string - - // 后端服务器所在的VPC - VPCId string - - // 后端RS权重(在加权轮询算法下有效) - Weight int -} - /* LoggerSet - ulb日志信息 */ @@ -572,18 +923,6 @@ type ULBIPSet struct { OperatorName string } -/* -FirewallSet - ulb防火墙信息 -*/ -type FirewallSet struct { - - // 防火墙ID - FirewallId string - - // 防火墙名称 - FirewallName string -} - /* ULBSet - DescribeULB */ diff --git a/services/usms/apis.go b/services/usms/apis.go index 9fabdfc4..d66c1c17 100644 --- a/services/usms/apis.go +++ b/services/usms/apis.go @@ -9,6 +9,74 @@ import ( // USMS API Schema +// AddBackfillRequest is request schema for AddBackfill action +type AddBackfillRequest struct { + request.CommonBase + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + // ProjectId *string `required:"true"` + + // [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + // Region *string `required:"false"` + + // [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + // Zone *string `required:"false"` + + // 回填时间,秒级别时间戳 + BackfillTime *int `required:"false"` + + // 回填内容 + Content *string `required:"false"` + + // 发送Number,记录一次发送请求的唯一性 + SendNo *string `required:"true"` + + // 发送请求的时间,秒级别时间戳 + SendTime *int `required:"false"` + + // 短信的接收目标,手机号需要添加国家码,比如(1)231xxxx + Target *string `required:"true"` +} + +// AddBackfillResponse is response schema for AddBackfill action +type AddBackfillResponse struct { + response.CommonBase + + // 返回错误消息。当 RetCode 非 0 时提供详细的描述信息 + Message string +} + +// NewAddBackfillRequest will create request of AddBackfill action. +func (c *USMSClient) NewAddBackfillRequest() *AddBackfillRequest { + req := &AddBackfillRequest{} + + // 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(false) + return req +} + +/* +API: AddBackfill + +用户通过接口发送消息,当消息在终端被消费,调用该接口,进行记录。 +*/ +func (c *USMSClient) AddBackfill(req *AddBackfillRequest) (*AddBackfillResponse, error) { + var err error + var res AddBackfillResponse + + reqCopier := *req + + err = c.Client.InvokeAction("AddBackfill", &reqCopier, &res) + if err != nil { + return &res, err + } + + return &res, nil +} + // CreateUSMSSignatureRequest is request schema for CreateUSMSSignature action type CreateUSMSSignatureRequest struct { request.CommonBase diff --git a/tests/setup_test.go b/tests/setup_test.go index 6ebe6c1f..cc501cd8 100644 --- a/tests/setup_test.go +++ b/tests/setup_test.go @@ -63,7 +63,6 @@ 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" @@ -196,9 +195,6 @@ 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 db1f4eff..e06d46f3 100644 --- a/ucloud/version/version.go +++ b/ucloud/version/version.go @@ -1,3 +1,3 @@ package version -const Version = "0.22.10" +const Version = "0.22.11"