fix(docs): update api doc (#24289)

This commit is contained in:
屈轩
2026-02-09 19:18:33 +08:00
committed by GitHub
parent a72601cf9e
commit 4c32b50e67
15 changed files with 2374 additions and 307 deletions
+24
View File
@@ -215,6 +215,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
progress:
description: 操作进度0-100
format: float
@@ -415,6 +419,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
policy_type:
description: |-
权限类型
@@ -588,6 +596,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
progress:
description: 操作进度0-100
format: float
@@ -958,6 +970,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
owner_id:
description: 本地用户Id
type: string
@@ -1255,6 +1271,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
progress:
description: 操作进度0-100
format: float
@@ -1497,6 +1517,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
owner_id:
description: 本地用户Id
type: string
File diff suppressed because it is too large Load Diff
+57 -13
View File
@@ -140,6 +140,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
project_id:
type: string
x-go-name: ProjectId
@@ -352,6 +356,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
parent_id:
type: string
x-go-name: ParentId
@@ -515,6 +523,10 @@ definitions:
format: date-time
type: string
x-go-name: NotBefore
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
private_key:
type: string
x-go-name: PrivateKey
@@ -757,6 +769,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
pending_deleted:
description: 资源是否处于回收站中
type: boolean
@@ -1012,6 +1028,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
policy_count:
description: 该认证源关联的所有域的权限策略数量
format: int64
@@ -1927,6 +1947,10 @@ definitions:
type: string
type: array
x-go-name: OrgNodeId
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
org_nodes:
items:
$ref: '#/definitions/SOrganizationNodeInfo'
@@ -2191,6 +2215,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
parent_id:
description: 上级项目或域的ID
type: string
@@ -2302,6 +2330,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
parent_region_id:
type: string
x-go-name: ParentRegionId
@@ -2465,6 +2497,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
pending_deleted:
description: 资源是否处于回收站中
type: boolean
@@ -3227,6 +3263,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
pending_deleted:
description: 资源是否处于回收站中
type: boolean
@@ -3349,6 +3389,10 @@ definitions:
org_id:
type: string
x-go-name: OrgId
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
organization:
type: string
x-go-name: Organization
@@ -3634,6 +3678,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
type:
type: string
x-go-name: Type
@@ -4089,6 +4137,11 @@ definitions:
description: 资源是否启用
type: boolean
x-go-name: Enabled
expired_at:
description: 过期时间
format: date-time
type: string
x-go-name: ExpiredAt
ext_resource:
additionalProperties:
format: int64
@@ -4159,19 +4212,6 @@ definitions:
description: 用户的默认语言设置,默认是zh_CN
type: string
x-go-name: Lang
last_active_at:
description: 上次登录时间
format: date-time
type: string
x-go-name: LastActiveAt
last_login_ip:
description: 上次用户登录IP
type: string
x-go-name: LastLoginIp
last_login_source:
description: 上次用户登录方式,可能值有:web(web控制台),cli(命令行climc),API(api)
type: string
x-go-name: LastLoginSource
metadata:
additionalProperties:
type: string
@@ -4190,6 +4230,10 @@ definitions:
description: 登录后是否需要重置密码
type: boolean
x-go-name: NeedResetPassword
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
password_expires_at:
description: 密码过期时间(如果开启了密码过期)
format: date-time
+14 -6
View File
@@ -270,6 +270,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
os_arch:
description: 操作系统 CPU 架构
example: x86 arm
@@ -649,6 +653,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
os_arch:
description: 操作系统 CPU 架构
example: x86 arm
@@ -1697,18 +1705,18 @@ paths:
name: refresh
type: boolean
x-go-name: Refresh
- description: 指定项目或者域的ID
in: path
name: scopeId
required: true
type: string
x-go-name: ScopeId
- description: 配额所属范围,可能值为projects和domains,分别代表项目的配额和域的配额
in: path
name: scope
required: true
type: string
x-go-name: Scope
- description: 指定项目或者域的ID
in: path
name: scopeId
required: true
type: string
x-go-name: ScopeId
responses:
"200":
$ref: '#/responses/models_GetImageQuotaOutput'
+32
View File
@@ -244,6 +244,10 @@ definitions:
no_data_state:
type: string
x-go-name: NoDataState
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
progress:
description: 操作进度0-100
format: float
@@ -416,6 +420,10 @@ definitions:
no_data_state:
type: string
x-go-name: NoDataState
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
progress:
description: 操作进度0-100
format: float
@@ -708,6 +716,10 @@ definitions:
no_data_state:
type: string
x-go-name: NoDataState
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
panel_id:
type: string
x-go-name: PanelId
@@ -971,6 +983,10 @@ definitions:
description: 标签
type: object
x-go-name: Metadata
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
project:
description: |-
资源归属项目的名称(向后兼容别名)
@@ -1321,6 +1337,10 @@ definitions:
notifier_id:
type: string
x-go-name: NotifierId
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
period:
type: string
x-go-name: Period
@@ -1798,6 +1818,10 @@ definitions:
notifier_id:
type: string
x-go-name: NotifierId
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
period:
type: string
x-go-name: Period
@@ -3503,6 +3527,10 @@ definitions:
notifier_id:
type: string
x-go-name: NotifierId
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
period:
type: string
x-go-name: Period
@@ -3810,6 +3838,10 @@ definitions:
no_data_state:
type: string
x-go-name: NoDataState
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
progress:
description: 操作进度0-100
format: float
+20
View File
@@ -135,6 +135,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
project_domain:
description: 资源归属项目的域名称
type: string
@@ -607,6 +611,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
priority:
type: string
x-go-name: Priority
@@ -1036,6 +1044,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
pending_deleted:
description: 资源是否处于回收站中
type: boolean
@@ -1955,6 +1967,10 @@ definitions:
description: 标签
type: object
x-go-name: Metadata
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
receivers:
description: 'description: receivers'
items:
@@ -2200,6 +2216,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
progress:
description: 操作进度0-100
format: float
+4
View File
@@ -322,6 +322,10 @@ definitions:
description: 资源名称
type: string
x-go-name: Name
org_node_md5:
description: 用以组织架构变更通知其他服务权限变更
type: string
x-go-name: OrgNodeMd5
policies:
description: 策略内容
type: object
-14
View File
@@ -1,17 +1,3 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
+2 -2
View File
@@ -484,7 +484,7 @@ type KickstartConfig struct {
ConfigURL string `json:"config_url,omitempty"`
// 操作系统类型 (用于确定内核参数和文件路径)
// enum: centos,rhel,fedora,openeuler,ubuntu
// enum: ["centos", "rhel", "fedora", "openeuler", "ubuntu"]
// required: true
OSType string `json:"os_type" validate:"required,oneof=centos rhel fedora openeuler ubuntu"`
@@ -725,7 +725,7 @@ type ServerCreateInput struct {
// ServerUpdateKickstartStatusInput 更新虚拟机 kickstart 状态的输入
type ServerUpdateKickstartStatusInput struct {
// kickstart 状态
// enum: kickstart_pending,kickstart_installing,kickstart_completed,kickstart_failed
// enum: ["kickstart_pending", "kickstart_installing", "kickstart_completed", "kickstart_failed"]
// required: true
Status string `json:"status" validate:"required,oneof=kickstart_pending kickstart_installing kickstart_completed kickstart_failed"`
+1 -1
View File
@@ -36,7 +36,7 @@ type SnapshotCreateInput struct {
Location string `json:"location"`
// swagger:ignore
Size int `json:"size"`
// swagger:ingore
// swagger:ignore
VirtualSize int `json:"virtual_size"`
// swagger:ignore
DiskType string `json:"disk_type"`
+19 -5
View File
@@ -1128,11 +1128,13 @@ type SGuestNetworkTrafficLog struct {
apis.SLogBase
apis.SProjectizedResourceBase
SGuestResourceBase
SNetworkResourceBase
// MAC地址
Mac string `json:"mac"`
// IPv4地址
IpAddr string `json:"ip_addr"`
// IPv6地址
Ip6Addr string `json:"ip6_addr"`
RowId int64 `json:"row_id"`
// 下行流量,单位 bytes
RxBytes int64 `json:"rx_bytes"`
// 上行流量,单位 bytes
@@ -1147,7 +1149,7 @@ type SGuestResourceBase struct {
}
// SGuestScreenDump is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestScreenDump.
/* type SGuestScreenDump struct {
type SGuestScreenDump struct {
apis.SResourceBase
RowId int64 `json:"row_id"`
GuestId string `json:"guest_id"`
@@ -1158,7 +1160,7 @@ type SGuestResourceBase struct {
S3Endpoint string `json:"s3_endpoint"`
S3BucketName string `json:"s3_bucket_name"`
S3UseSsl bool `json:"s3_use_ssl"`
} */
}
// SGuestTemplate is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestTemplate.
type SGuestTemplate struct {
@@ -1253,6 +1255,16 @@ type SGuestnetwork struct {
SBillingChargeTypeBase
}
// SGuestnetworksecgroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestnetworksecgroup.
type SGuestnetworksecgroup struct {
apis.SResourceBase
RowId int64 `json:"row_id"`
GuestId string `json:"guest_id"`
SSecurityGroupResourceBase
NetworkIndex int `json:"network_index"`
Admin bool `json:"admin"`
}
// SGuestsecgroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestsecgroup.
type SGuestsecgroup struct {
SGuestJointsBase
@@ -1766,7 +1778,7 @@ type SLoadbalancer struct {
NetworkType string `json:"network_type"`
SLoadbalancerClusterResourceBase
// 计费类型
ChargeType string `json:"charge_type"`
SBillingChargeTypeBase
// 套餐名称
LoadbalancerSpec string `json:"loadbalancer_spec"`
// 默认后端服务器组Id
@@ -2783,7 +2795,9 @@ type SSnapshot struct {
CreatedBy string `json:"created_by"`
Location string `json:"location"`
// 快照大小,单位Mb
Size int `json:"size"`
Size int `json:"size"`
// Virtual size, for kvm is origin disk size
VirtualSize int `json:"virtual_size"`
OutOfChain bool `json:"out_of_chain"`
FakeDeleted bool `json:"fake_deleted"`
DiskType string `json:"disk_type"`
+9 -7
View File
@@ -145,13 +145,15 @@ type SReceiver struct {
type SRobot struct {
apis.SSharableVirtualResourceBase
apis.SEnabledResourceBase
Type string `json:"type"`
Address string `json:"address"`
Lang string `json:"lang"`
Header jsonutils.JSONObject `json:"header"`
Body jsonutils.JSONObject `json:"body"`
MsgKey string `json:"msg_key"`
UseTemplate *bool `json:"use_template,omitempty"`
Type string `json:"type"`
Address string `json:"address"`
Lang string `json:"lang"`
Header jsonutils.JSONObject `json:"header"`
Body jsonutils.JSONObject `json:"body"`
MsgKey string `json:"msg_key"`
// webhook 签名加密
SecretKey string `json:"secret_key"`
UseTemplate *bool `json:"use_template,omitempty"`
}
// SSubscriber is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SSubscriber.
@@ -56,3 +56,9 @@ type SScopedPolicyBinding struct {
PolicyId string `json:"policy_id"`
Priority int `json:"priority"`
}
// STag is an autogenerated struct via yunion.io/x/onecloud/pkg/yunionconf/models.STag.
type STag struct {
apis.SInfrasResourceBase
Values []string `json:"values"`
}
@@ -36,6 +36,8 @@ import (
"yunion.io/x/onecloud/pkg/util/stringutils2"
)
// +onecloud:swagger-gen-model-singular=guestnetworksecgroup
// +onecloud:swagger-gen-model-plural=guestnetworksecgroups
type SGuestnetworksecgroupManager struct {
db.SResourceBaseManager
SGuestResourceBaseManager
@@ -61,6 +63,7 @@ func init() {
})
}
// +onecloud:model-api-gen
type SGuestnetworksecgroup struct {
db.SResourceBase
-68
View File
@@ -16,7 +16,6 @@ package models
import (
"context"
"crypto/md5"
"database/sql"
"fmt"
"math"
@@ -138,44 +137,6 @@ func (manager *SServerSkuManager) FilterByUniqValues(q *sqlchemy.SQuery, values
return q
}
type SInstanceSpecQueryParams struct {
Provider string
PublicCloud bool
ZoneId string
PostpaidStatus string
PrepaidStatus string
IngoreCache bool
}
func (self *SInstanceSpecQueryParams) GetCacheKey() string {
hashStr := fmt.Sprintf("%s:%t:%s:%s:%s", self.Provider, self.PublicCloud, self.ZoneId, self.PostpaidStatus, self.PrepaidStatus)
_md5 := md5.Sum([]byte(hashStr))
return "InstanceSpecs_" + fmt.Sprintf("%x", _md5)
}
func NewInstanceSpecQueryParams(query jsonutils.JSONObject) *SInstanceSpecQueryParams {
zone := jsonutils.GetAnyString(query, []string{"zone", "zone_id"})
postpaid, _ := query.GetString("postpaid_status")
prepaid, _ := query.GetString("prepaid_status")
ingore_cache, _ := query.Bool("ingore_cache")
provider := normalizeProvider(jsonutils.GetAnyString(query, []string{"provider"}))
public_cloud, _ := query.Bool("public_cloud")
if utils.IsInStringArray(provider, cloudprovider.GetPublicProviders()) {
public_cloud = true
}
params := &SInstanceSpecQueryParams{
Provider: provider,
PublicCloud: public_cloud,
ZoneId: zone,
PostpaidStatus: postpaid,
PrepaidStatus: prepaid,
IngoreCache: ingore_cache,
}
return params
}
func sliceToJsonObject(items []int) jsonutils.JSONObject {
sort.Slice(items, func(i, j int) bool {
if items[i] < items[j] {
@@ -495,20 +456,6 @@ func intervalMem(n int) (int, int) {
return interval(n, 1024)
}
func normalizeProvider(provider string) string {
if len(provider) == 0 {
return provider
}
for _, p := range api.CLOUD_PROVIDERS {
if strings.ToLower(p) == strings.ToLower(provider) {
return p
}
}
return provider
}
func networkUsableRegionQueries(f sqlchemy.IQueryField) []sqlchemy.ICondition {
providers := usableCloudProviders()
networks := NetworkManager.Query("wire_id").Equals("status", api.NETWORK_STATUS_AVAILABLE)
@@ -1166,21 +1113,6 @@ func (self *SServerSku) constructSku(extSku cloudprovider.ICloudSku) {
self.Name = extSku.GetName()
}
func (self *SServerSku) setPrepaidPostpaidStatus(userCred mcclient.TokenCredential, prepaidStatus, postpaidStatus string) error {
if prepaidStatus != self.PrepaidStatus || postpaidStatus != self.PostpaidStatus {
diff, err := db.Update(self, func() error {
self.PrepaidStatus = prepaidStatus
self.PostpaidStatus = postpaidStatus
return nil
})
if err != nil {
return err
}
db.OpsLog.LogEvent(self, db.ACT_UPDATE, diff, userCred)
}
return nil
}
func (region *SCloudregion) getMetaUrl(base string, externalId string) string {
if region.Provider == api.CLOUD_PROVIDER_HUAWEI && strings.Contains(region.ExternalId, "_") {
idx := strings.Index(region.ExternalId, "_")