feat(rcs): migrate all RCS APIs from rainyun-go-sdk

- 35 endpoints across 14 files, response structs split for reuse
- Reuse RcsRecord/Node/Plan/OsInfo/UsageData across list/detail/create
- Fix source bugs: {id} path placeholders, missing / in firewall pos path,
  missing body in ChargeRcsTrafic, resp vs &resp
- Add HTTPMethod_PATCH, common.BasicOperationResponse, VncConnectionInfo
This commit is contained in:
2026-08-05 22:35:28 +08:00
parent 0cd1a28f84
commit b8490ef422
20 changed files with 779 additions and 8 deletions
+36
View File
@@ -0,0 +1,36 @@
package rcs
import (
"fmt"
"github.com/XingfenD/rainyun_api_go_sdk/apis/common"
"github.com/XingfenD/rainyun_api_go_sdk/constant"
)
type RcsManagesElasticCloudDisksRequest struct {
Actions []struct {
Type string `json:"type"` // 操作类型: expand: 扩容, create: 创建
Action any `json:"action"` // 操作参数, RcsManagesElasticCloudDisksExpand或RcsManagesElasticCloudDisksCreate
} `json:"actions"`
}
type RcsManagesElasticCloudDisksExpand struct {
EdiskID int `json:"edisk_id"` // 弹性云盘ID
SizeInGb int `json:"size_in_gb"` // 操作容量
Backup bool `json:"backup"` // 支持备份
}
type RcsManagesElasticCloudDisksCreate struct {
SizeInGb int `json:"size_in_gb"` // 操作容量
DiskType string `json:"disk_type"` // 磁盘类型(ssd/hdd)
Backup bool `json:"backup"` // 支持备份
Tag string `json:"tag"` // 标签
}
func (s *RcsService) RcsManagesElasticCloudDisks(id int, req *RcsManagesElasticCloudDisksRequest) (*common.BasicOperationResponse, error) {
path := fmt.Sprintf("/product/rcs/%d/edisk", id)
var resp common.BasicOperationResponse
err := s.client.Do(constant.HTTPMethod_POST, path, nil, req, &resp)
return &resp, err
}