diff --git a/cmd/climc/shell/scaling_policy.go b/cmd/climc/shell/scaling_policy.go index 30c7a892bf..f87dba1673 100644 --- a/cmd/climc/shell/scaling_policy.go +++ b/cmd/climc/shell/scaling_policy.go @@ -72,12 +72,12 @@ func init() { } type ScalingAlarm struct { - AlarmCumulate int `help:"Cumulate times alarm will trigger, for 'alarm' trigger" json:"cumulate"` - AlarmCycle int `help:"Monitoring cycle for indicators, for 'alarm' trigger" json:"cycle"` - AlarmIndicator string `help:"Indicator for 'alarm' trigger" json:"indicator"` - AlarmWrapper string `help:"Wrapper for Indicators" choices:"max|min|average" json:"wrapper"` - AlarmOperator string `help:"Operator between Indicator and Operator" json:"operator"` - AlarmValue float64 `help:"Value of Indicator" json:"value"` + AlarmCumulate int `help:"Cumulate times alarm will trigger, for 'alarm' trigger" json:"cumulate"` + AlarmCycle int `help:"Monitoring cycle for indicators, for 'alarm' trigger" json:"cycle"` + AlarmIndicator string `help:"Indicator for 'alarm' trigger" json:"indicator"` + AlarmWrapper string `help:"Wrapper for Indicators" choices:"max|min|average" json:"wrapper"` + AlarmOperator string `help:"Operator between Indicator and Operator" json:"operator"` + AlarmValue float64 `help:"Value of Indicator" json:"value"` } type ScalingPolicyCreateOptions struct { diff --git a/pkg/apis/compute/zz_generated.model.go b/pkg/apis/compute/zz_generated.model.go index d30a1368dc..f52ae6a1fd 100644 --- a/pkg/apis/compute/zz_generated.model.go +++ b/pkg/apis/compute/zz_generated.model.go @@ -27,8 +27,10 @@ type SAwsCachedLb struct { apis.SExternalizedResourceBase SManagedResourceBase SCloudregionResourceBase - BackendServerId string `json:"backend_server_id"` - BackendId string `json:"backend_id"` + BackendServerId string `json:"backend_server_id"` + // 后端服务器 实例ID + BackendId string `json:"backend_id"` + // 本地loadbalancebackend id CachedBackendGroupId string `json:"cached_backend_group_id"` } @@ -38,13 +40,17 @@ type SAwsCachedLbbg struct { apis.SExternalizedResourceBase SManagedResourceBase SCloudregionResourceBase - LoadbalancerId string `json:"loadbalancer_id"` - BackendGroupId string `json:"backend_group_id"` - TargetType string `json:"target_type"` - ProtocolType string `json:"protocol_type"` - Port int `json:"port"` + LoadbalancerId string `json:"loadbalancer_id"` + BackendGroupId string `json:"backend_group_id"` + TargetType string `json:"target_type"` + // 后端服务器类型 + ProtocolType string `json:"protocol_type"` + // 监听协议类型 + Port int `json:"port"` + // 监听端口 HealthCheckProtocol string `json:"health_check_protocol"` - HealthCheckInterval int `json:"health_check_interval"` + // 健康检查协议类型 + HealthCheckInterval int `json:"health_check_interval"` } // SBaremetalagent is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SBaremetalagent. @@ -94,7 +100,8 @@ type SCachedLoadbalancerAcl struct { apis.SExternalizedResourceBase SManagedResourceBase SCloudregionResourceBase - AclId string `json:"acl_id"` + AclId string `json:"acl_id"` + // 本地ACL ID ListenerId string `json:"listener_id"` } @@ -103,6 +110,7 @@ type SCachedLoadbalancerCertificate struct { apis.SVirtualResourceBase apis.SExternalizedResourceBase SManagedResourceBase + // 云账号ID SCloudregionResourceBase SLoadbalancerCertificateResourceBase } @@ -111,12 +119,24 @@ type SCachedLoadbalancerCertificate struct { type SCachedimage struct { apis.SStandaloneResourceBase apis.SExternalizedResourceBase - Size int64 `json:"size"` - Info interface{} `json:"info"` - LastSync time.Time `json:"last_sync"` - LastRef time.Time `json:"last_ref"` - RefCount int `json:"ref_count"` - ImageType string `json:"image_type"` + // 镜像大小单位: Byte + // example: 53687091200 + Size int64 `json:"size"` + // 镜像详情信息 + // example: {"deleted":false,"disk_format":"qcow2","id":"img-a6uucnfl","is_public":true,"min_disk":51200,"min_ram":0,"name":"FreeBSD 11.1 64bit","properties":{"os_arch":"x86_64","os_distribution":"FreeBSD","os_type":"FreeBSD","os_version":"11"},"protected":true,"size":53687091200,"status":"active"} + Info interface{} `json:"info"` + // 上此同步时间 + // example: 2020-01-17T05:28:54.000000Z + LastSync time.Time `json:"last_sync"` + // 最近一次缓存引用时间 + // 2020-01-17T05:20:54.000000Z + LastRef time.Time `json:"last_ref"` + // 引用次数 + // example: 0 + RefCount int `json:"ref_count"` + // 镜像类型, system: 公有云镜像, customized: 自定义镜像 + // example: system + ImageType string `json:"image_type"` } // SCloudaccount is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudaccount. @@ -185,12 +205,25 @@ type SCloudprovider struct { apis.SEnabledStatusStandaloneResourceBase apis.SProjectizedResourceBase SSyncableBaseResource - HealthStatus string `json:"health_status"` - AccessUrl string `json:"access_url"` - Account string `json:"account"` - Secret string `json:"secret"` + // 云端服务健康状态。例如欠费、项目冻结都属于不健康状态。 + // | HealthStatus | 说明 | + // |---------------|----------------------| + // | normal | 远端处于健康状态 | + // | insufficient | 不足按需资源余额 | + // | suspended | 远端处于冻结状态 | + // | arrears | 远端处于欠费状态 | + // | unknown | 未知状态,查询失败 | + // | no permission | 没有权限获取账单信息 | + HealthStatus string `json:"health_status"` + AccessUrl string `json:"access_url"` + // 云账号的用户信息,例如用户名,access key等 + Account string `json:"account"` + // 云账号的密码信息,例如密码,access key secret等。该字段在数据库加密存储。Google需要存储秘钥证书,需要此字段比较长 + Secret string `json:"secret"` + // 归属云账号ID CloudaccountId string `json:"cloudaccount_id"` - Provider string `json:"provider"` + // 云账号的平台信息 + Provider string `json:"provider"` } // SCloudproviderCapability is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudproviderCapability. @@ -201,15 +234,36 @@ type SCloudproviderCapability struct { Capability string `json:"capability"` } +// SCloudproviderQuota is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudproviderQuota. +type SCloudproviderQuota struct { + apis.SStandaloneResourceBase + apis.SExternalizedResourceBase + SManagedResourceBase + SCloudregionResourceBase + // 配额范围 + // cloudregion: 区域级别 + // cloudprovider: 云订阅级别 + QuotaRange string `json:"quota_range"` + // 已使用的配额 + // -1代表未从云平台拿到已使用配额信息 + UsedCount int `json:"used_count"` + // 最大配额限制 + MaxCount int `json:"max_count"` + // 配额类型 + QuotaType string `json:"quota_type"` +} + // SCloudproviderregion is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudproviderregion. type SCloudproviderregion struct { apis.SJointResourceBase SSyncableBaseResource SCloudregionResourceBase - CloudproviderId string `json:"cloudprovider_id"` - Enabled bool `json:"enabled"` - SyncResults interface{} `json:"sync_results"` - LastDeepSyncAt time.Time `json:"last_deep_sync_at"` + // 云订阅ID + CloudproviderId string `json:"cloudprovider_id"` + Enabled bool `json:"enabled"` + // SyncIntervalSeconds int `list:"domain"` + SyncResults interface{} `json:"sync_results"` + LastDeepSyncAt time.Time `json:"last_deep_sync_at"` } // SCloudregion is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudregion. @@ -218,12 +272,17 @@ type SCloudregion struct { SManagedResourceBase apis.SExternalizedResourceBase cloudprovider.SGeographicInfo + // 云环境 + // example: ChinaCloud Environment string `json:"environment"` - Provider string `json:"provider"` + // 云平台 + // example: Huawei + Provider string `json:"provider"` } // SCloudregionResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudregionResourceBase. type SCloudregionResourceBase struct { + // 归属区域ID CloudregionId string `json:"cloudregion_id"` } @@ -235,25 +294,55 @@ type SDBInstance struct { SBillingResourceBase SCloudregionResourceBase SDeletePreventableResourceBase - MasterInstanceId string `json:"master_instance_id"` - VcpuCount int `json:"vcpu_count"` - VmemSizeMb int `json:"vmem_size_mb"` - StorageType string `json:"storage_type"` - DiskSizeGB int `json:"disk_size_gb"` - Port int `json:"port"` - Category string `json:"category"` - Engine string `json:"engine"` - EngineVersion string `json:"engine_version"` - InstanceType string `json:"instance_type"` - MaintainTime string `json:"maintain_time"` - SecgroupId string `json:"secgroup_id"` - VpcId string `json:"vpc_id"` - ConnectionStr string `json:"connection_str"` + // 主实例Id + MasterInstanceId string `json:"master_instance_id"` + // CPU数量 + // example: 1 + VcpuCount int `json:"vcpu_count"` + // 内存大小 + // example: 1024 + VmemSizeMb int `json:"vmem_size_mb"` + // 存储类型 + // example: local_ssd + StorageType string `json:"storage_type"` + // 存储大小 + // example: 10240 + DiskSizeGB int `json:"disk_size_gb"` + // 端口 + // example: 3306 + Port int `json:"port"` + // 实例类型 + // example: ha + Category string `json:"category"` + // 引擎 + // example: MySQL + Engine string `json:"engine"` + // 引擎版本 + // example: 5.7 + EngineVersion string `json:"engine_version"` + // 套餐名称 + // example: mysql.x4.large.2c + InstanceType string `json:"instance_type"` + // 维护时间 + MaintainTime string `json:"maintain_time"` + // 安全组Id + // example: default + SecgroupId string `json:"secgroup_id"` + // 虚拟私有网络Id + // example: ed20d84e-3158-41b1-870c-1725e412e8b6 + VpcId string `json:"vpc_id"` + // 外部连接地址 + ConnectionStr string `json:"connection_str"` + // 内部连接地址 InternalConnectionStr string `json:"internal_connection_str"` - Zone1 string `json:"zone1"` - Zone2 string `json:"zone2"` - Zone3 string `json:"zone3"` - ZoneId string `json:"zone_id"` + // 可用区1 + Zone1 string `json:"zone1"` + // 可用区2 + Zone2 string `json:"zone2"` + // 可用区3 + Zone3 string `json:"zone3"` + // 可用区Id(对应公有云的可用区Id) + ZoneId string `json:"zone_id"` } // SDBInstanceAccount is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstanceAccount. @@ -261,6 +350,7 @@ type SDBInstanceAccount struct { apis.SStatusStandaloneResourceBase apis.SExternalizedResourceBase SDBInstanceResourceBase + // 数据库密码 Secret string `json:"secret"` } @@ -271,13 +361,23 @@ type SDBInstanceBackup struct { SManagedResourceBase apis.SExternalizedResourceBase SDBInstanceResourceBase - Engine string `json:"engine"` - EngineVersion string `json:"engine_version"` - StartTime time.Time `json:"start_time"` - EndTime time.Time `json:"end_time"` - BackupMode string `json:"backup_mode"` - DBNames string `json:"db_names"` - BackupSizeMb int `json:"backup_size_mb"` + // RDS引擎 + // example: MySQL + Engine string `json:"engine"` + // RDS引擎版本 + // example: 5.7 + EngineVersion string `json:"engine_version"` + // 备份开始时间 + StartTime time.Time `json:"start_time"` + // 备份结束时间 + EndTime time.Time `json:"end_time"` + // 备份模式 + BackupMode string `json:"backup_mode"` + // 备份数据库名称 + DBNames string `json:"db_names"` + // 备份大小 + // example: 32 + BackupSizeMb int `json:"backup_size_mb"` } // SDBInstanceDatabase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstanceDatabase. @@ -285,6 +385,8 @@ type SDBInstanceDatabase struct { apis.SStatusStandaloneResourceBase apis.SExternalizedResourceBase SDBInstanceResourceBase + // 字符集 + // example: utf-8 CharacterSet string `json:"character_set"` } @@ -306,7 +408,9 @@ type SDBInstanceParameter struct { apis.SStandaloneResourceBase apis.SExternalizedResourceBase SDBInstanceResourceBase - Key string `json:"key"` + // 数据库参数名称 + Key string `json:"key"` + // 数据库参数值 Value string `json:"value"` } @@ -316,13 +420,13 @@ type SDBInstancePrivilege struct { apis.SExternalizedResourceBase Id string `json:"id"` Privilege string `json:"privilege"` - DBInstanceaccountId string `json:"db_instanceaccount_id"` - DBInstancedatabaseId string `json:"db_instancedatabase_id"` + DBInstanceaccountId string `json:"dbinstanceaccount_id"` + DBInstancedatabaseId string `json:"dbinstancedatabase_id"` } // SDBInstanceResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstanceResourceBase. type SDBInstanceResourceBase struct { - DBInstanceId string `json:"db_instance_id"` + DBInstanceId string `json:"dbinstance_id"` } // SDBInstanceSku is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstanceSku. @@ -330,9 +434,10 @@ type SDBInstanceSku struct { apis.SEnabledStatusStandaloneResourceBase apis.SExternalizedResourceBase SCloudregionResourceBase - Provider string `json:"provider"` - StorageType string `json:"storage_type"` - DiskSizeStep int `json:"disk_size_step"` + Provider string `json:"provider"` + StorageType string `json:"storage_type"` + DiskSizeStep int `json:"disk_size_step"` + // 步长 MaxDiskSizeGb int `json:"max_disk_size_gb"` MinDiskSizeGb int `json:"min_disk_size_gb"` IOPS int `json:"iops"` @@ -352,6 +457,8 @@ type SDBInstanceSku struct { // SDeletePreventableResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDeletePreventableResourceBase. type SDeletePreventableResourceBase struct { + // 是否开启删除保护 + // example: true DisableDelete *bool `json:"disable_delete,omitempty"` } @@ -361,16 +468,33 @@ type SDisk struct { apis.SExternalizedResourceBase SBillingResourceBase SStorageResourceBase - DiskFormat string `json:"disk_format"` - DiskSize int `json:"disk_size"` - AccessPath string `json:"access_path"` - AutoDelete bool `json:"auto_delete"` + // 磁盘存储类型 + // example: qcow2 + DiskFormat string `json:"disk_format"` + // 磁盘大小, 单位Mb + // example: 10240 + DiskSize int `json:"disk_size"` + // 磁盘路径 + AccessPath string `json:"access_path"` + // 是否跟随云主机自动删除, 仅绑定到云主机时才生效 + // example: false + AutoDelete bool `json:"auto_delete"` + // 备份磁盘实例的存储ID BackupStorageId string `json:"backup_storage_id"` - TemplateId string `json:"template_id"` - SnapshotId string `json:"snapshot_id"` - FsFormat string `json:"fs_format"` - DiskType string `json:"disk_type"` - Nonpersistent bool `json:"nonpersistent"` + // 镜像Id + TemplateId string `json:"template_id"` + // 快照Id + SnapshotId string `json:"snapshot_id"` + // 文件系统 + FsFormat string `json:"fs_format"` + // 磁盘类型 + // sys: 系统盘 + // data: 数据盘 + // swap: 交换盘 + // example: sys + DiskType string `json:"disk_type"` + // # is persistent + Nonpersistent bool `json:"nonpersistent"` } // SDiskResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDiskResourceBase. @@ -382,6 +506,8 @@ type SDiskResourceBase struct { type SDnsRecord struct { apis.SAdminSharableVirtualResourceBase apis.SEnabledResourceBase + // DNS记录的过期时间,单位为秒 + // example: 60 Ttl int `json:"ttl"` } @@ -389,6 +515,8 @@ type SDnsRecord struct { type SDynamicschedtag struct { apis.SStandaloneResourceBase SSchedtagResourceBase + // 动态调度标间的匹配条件 + // example: host.sys_load > 1.5 || host.mem_used_percent > 0.7 => "high_load" Condition string `json:"condition"` Enabled *bool `json:"enabled,omitempty"` } @@ -401,25 +529,52 @@ type SElasticcache struct { SDeletePreventableResourceBase SVpcResourceBase SZoneResourceBase - SlaveZones string `json:"slave_zones"` - InstanceType string `json:"instance_type"` - CapacityMB int `json:"capacity_mb"` - LocalCategory string `json:"local_category"` - NodeType string `json:"node_type"` - Engine string `json:"engine"` - EngineVersion string `json:"engine_version"` - NetworkType string `json:"network_type"` - NetworkId string `json:"network_id"` - SecurityGroupId string `json:"security_group_id"` - PrivateDNS string `json:"private_dns"` - PrivateIpAddr string `json:"private_ip_addr"` - PrivateConnectPort int `json:"private_connect_port"` - PublicDNS string `json:"public_dns"` - PublicIpAddr string `json:"public_ip_addr"` - PublicConnectPort int `json:"public_connect_port"` - MaintainStartTime string `json:"maintain_start_time"` - MaintainEndTime string `json:"maintain_end_time"` - AuthMode string `json:"auth_mode"` + // 备可用区 + SlaveZones string `json:"slave_zones"` + // 实例规格 + // example: redis.master.micro.default + InstanceType string `json:"instance_type"` + // 容量 + // example: 1024 + CapacityMB int `json:"capacity_mb"` + // 对应Sku + LocalCategory string `json:"local_category"` + // 类型 + // single(单副本) | double(双副本) | readone (单可读) | readthree (3可读) | readfive(5只读) + NodeType string `json:"node_type"` + // 后端存储引擎 + // Redis | Memcache + // example: redis + Engine string `json:"engine"` + // 后端存储引擎版本 + // example: 4.0 + EngineVersion string `json:"engine_version"` + // 网络类型, CLASSIC(经典网络) VPC(专有网络) + // example: CLASSIC + NetworkType string `json:"network_type"` + // 所属网络ID + NetworkId string `json:"network_id"` + // 安全组 + SecurityGroupId string `json:"security_group_id"` + // 内网DNS + PrivateDNS string `json:"private_dns"` + // 内网IP地址 + PrivateIpAddr string `json:"private_ip_addr"` + // 内网访问端口 + PrivateConnectPort int `json:"private_connect_port"` + // 公网DNS + PublicDNS string `json:"public_dns"` + // 公网IP地址 + PublicIpAddr string `json:"public_ip_addr"` + // 外网访问端口 + PublicConnectPort int `json:"public_connect_port"` + // 维护开始时间,格式为HH:mmZ + // example: 02:00Z + MaintainStartTime string `json:"maintain_start_time"` + // 维护结束时间 + MaintainEndTime string `json:"maintain_end_time"` + // 访问密码? on (开启密码)|off (免密码访问) + AuthMode string `json:"auth_mode"` } // SElasticcacheAccount is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SElasticcacheAccount. @@ -427,9 +582,11 @@ type SElasticcacheAccount struct { apis.SStatusStandaloneResourceBase apis.SExternalizedResourceBase SElasticcacheResourceBase - AccountType string `json:"account_type"` + AccountType string `json:"account_type"` + // 账号类型 normal |admin AccountPrivilege string `json:"account_privilege"` - Password string `json:"password"` + // 账号权限 read | write | repl(复制, 复制权限支持读写,且开放SYNC/PSYNC命令) + Password string `json:"password"` } // SElasticcacheAcl is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SElasticcacheAcl. @@ -437,6 +594,7 @@ type SElasticcacheAcl struct { apis.SStatusStandaloneResourceBase apis.SExternalizedResourceBase SElasticcacheResourceBase + // Ip地址白名单列表 IpList string `json:"ip_list"` } @@ -445,12 +603,18 @@ type SElasticcacheBackup struct { apis.SStatusStandaloneResourceBase apis.SExternalizedResourceBase SElasticcacheResourceBase - BackupSizeMb int `json:"backup_size_mb"` - BackupType string `json:"backup_type"` - BackupMode string `json:"backup_mode"` - DownloadURL string `json:"download_url"` - StartTime time.Time `json:"start_time"` - EndTime time.Time `json:"end_time"` + // 备份大小 + BackupSizeMb int `json:"backup_size_mb"` + // 备份类型, 全量|增量额 + BackupType string `json:"backup_type"` + // 备份模式,自动|手动 + BackupMode string `json:"backup_mode"` + // 下载地址 + DownloadURL string `json:"download_url"` + // 开始备份时间 + StartTime time.Time `json:"start_time"` + // 结束备份时间 + EndTime time.Time `json:"end_time"` } // SElasticcacheParameter is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SElasticcacheParameter. @@ -458,15 +622,21 @@ type SElasticcacheParameter struct { apis.SStatusStandaloneResourceBase apis.SExternalizedResourceBase SElasticcacheResourceBase - Key string `json:"key"` - Value string `json:"value"` - ValueRange string `json:"value_range"` - Modifiable bool `json:"modifiable"` - ForceRestart bool `json:"force_restart"` + // Parameter KEY + Key string `json:"key"` + // Parameter Value + Value string `json:"value"` + // 校验代码,参数的可选范围。 + ValueRange string `json:"value_range"` + // True(可修改) False(不可修改) + Modifiable bool `json:"modifiable"` + // True(重启生效) False(无需重启,提交后即生效) + ForceRestart bool `json:"force_restart"` } // SElasticcacheResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SElasticcacheResourceBase. type SElasticcacheResourceBase struct { + // 弹性缓存ID ElasticcacheId string `json:"elasticcache_id"` } @@ -475,31 +645,50 @@ type SElasticcacheSku struct { apis.SStatusStandaloneResourceBase apis.SExternalizedResourceBase SCloudregionResourceBase + // 区域 SZoneResourceBase - SlaveZoneId string `json:"slave_zone_id"` - InstanceSpec string `json:"instance_spec"` - EngineArch string `json:"engine_arch"` - LocalCategory string `json:"local_category"` - PrepaidStatus string `json:"prepaid_status"` - PostpaidStatus string `json:"postpaid_status"` - Engine string `json:"engine"` - EngineVersion string `json:"engine_version"` - CpuArch string `json:"cpu_arch"` - StorageType string `json:"storage_type"` - PerformanceType string `json:"performance_type"` - NodeType string `json:"node_type"` - MemorySizeMB int `json:"memory_size_mb"` - DiskSizeGB int `json:"disk_size_gb"` - ShardNum int `json:"shard_num"` - MaxShardNum int `json:"max_shard_num"` - ReplicasNum int `json:"replicas_num"` - MaxReplicasNum int `json:"max_replicas_num"` - MaxClients int `json:"max_clients"` - MaxConnections int `json:"max_connections"` - MaxInBandwidthMb int `json:"max_in_bandwidth_mb"` - MaxMemoryMB int `json:"max_memory_mb"` - QPS int `json:"qps"` - Provider string `json:"provider"` + SlaveZoneId string `json:"slave_zone_id"` + InstanceSpec string `json:"instance_spec"` + EngineArch string `json:"engine_arch"` + LocalCategory string `json:"local_category"` + PrepaidStatus string `json:"prepaid_status"` + PostpaidStatus string `json:"postpaid_status"` + // 引擎 redis|memcached + Engine string `json:"engine"` + // 引擎版本 3.0 + EngineVersion string `json:"engine_version"` + // CPU 架构 x86|ARM + CpuArch string `json:"cpu_arch"` + // 存储类型 DRAM|SCM + StorageType string `json:"storage_type"` + // standrad|enhanced + PerformanceType string `json:"performance_type"` + // single(单副本) | double(双副本) | readone (单可读) | readthree (3可读) | readfive(5只读) + NodeType string `json:"node_type"` + // 内存容量 + MemorySizeMB int `json:"memory_size_mb"` + // 套餐附带硬盘容量 + DiskSizeGB int `json:"disk_size_gb"` + // 最小分片数量 + ShardNum int `json:"shard_num"` + // 最大分片数量 + MaxShardNum int `json:"max_shard_num"` + // 最小副本数量 + ReplicasNum int `json:"replicas_num"` + // 最大副本数量 + MaxReplicasNum int `json:"max_replicas_num"` + // 最大客户端数 + MaxClients int `json:"max_clients"` + // 最大连接数 + MaxConnections int `json:"max_connections"` + // 最大内网带宽 + MaxInBandwidthMb int `json:"max_in_bandwidth_mb"` + // 实际可使用的最大内存 + MaxMemoryMB int `json:"max_memory_mb"` + // QPS参考值 + QPS int `json:"qps"` + // 公有云厂商 Aliyun/Azure/AWS/Qcloud/... + Provider string `json:"provider"` } // SElasticip is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SElasticip. @@ -509,15 +698,30 @@ type SElasticip struct { SManagedResourceBase SCloudregionResourceBase SBillingResourceBase - NetworkId string `json:"network_id"` - Mode string `json:"mode"` - IpAddr string `json:"ip_addr"` + // IP子网Id, 仅私有云不为空 + NetworkId string `json:"network_id"` + // 标识弹性或非弹性 + // | Mode | 说明 | + // |------------|------------| + // | public_ip | 公网IP | + // | elastic_ip | 弹性公网IP | + // example: elastic_ip + Mode string `json:"mode"` + // IP地址 + IpAddr string `json:"ip_addr"` + // 绑定资源类型 AssociateType string `json:"associate_type"` - AssociateId string `json:"associate_id"` - Bandwidth int `json:"bandwidth"` - ChargeType string `json:"charge_type"` - BgpType string `json:"bgp_type"` - AutoDellocate *bool `json:"auto_dellocate,omitempty"` + // 绑定资源Id + AssociateId string `json:"associate_id"` + // 带宽大小 + Bandwidth int `json:"bandwidth"` + // 计费类型: 流量、带宽 + // example: bandwidth + ChargeType string `json:"charge_type"` + // 目前只有华为云此字段是必需填写的 + BgpType string `json:"bgp_type"` + // 是否跟随主机删除而自动释放 + AutoDellocate *bool `json:"auto_dellocate,omitempty"` } // SExternalProject is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SExternalProject. @@ -543,11 +747,14 @@ type SGroup struct { apis.SVirtualResourceBase SZoneResourceBase apis.SEnabledResourceBase - ServiceType string `json:"service_type"` - ParentId string `json:"parent_id"` - SchedStrategy string `json:"sched_strategy"` - Granularity int `json:"granularity"` - ForceDispersion *bool `json:"force_dispersion,omitempty"` + // 服务类型 + ServiceType string `json:"service_type"` + ParentId string `json:"parent_id"` + // 调度策略 + SchedStrategy string `json:"sched_strategy"` + // the upper limit number of guests with this group in a host + Granularity int `json:"granularity"` + ForceDispersion *bool `json:"force_dispersion,omitempty"` } // SGroupJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGroupJointsBase. @@ -558,14 +765,17 @@ type SGroupJointsBase struct { // SGroupResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGroupResourceBase. type SGroupResourceBase struct { + // 实例组ID GroupId string `json:"group_id"` } // SGroupguest is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGroupguest. type SGroupguest struct { SGroupJointsBase - Tag string `json:"tag"` - GuestId string `json:"guest_id"` + Tag string `json:"tag"` + // Column(VARCHAR(256, charset='ascii'), nullable=True) + GuestId string `json:"guest_id"` + // Column(VARCHAR(36, charset='ascii'), nullable=False) GuestStatus string `json:"guest_status"` } @@ -585,24 +795,38 @@ type SGuest struct { SBillingResourceBase SDeletePreventableResourceBase SHostResourceBase - VcpuCount int `json:"vcpu_count"` - VmemSize int `json:"vmem_size"` - BootOrder string `json:"boot_order"` + // CPU大小 + VcpuCount int `json:"vcpu_count"` + // 内存大小, 单位Mb + VmemSize int `json:"vmem_size"` + // 启动顺序 + BootOrder string `json:"boot_order"` + // 关机操作类型 + // example: stop ShutdownBehavior string `json:"shutdown_behavior"` - KeypairId string `json:"keypair_id"` - BackupHostId string `json:"backup_host_id"` - Vga string `json:"vga"` - Vdi string `json:"vdi"` - Machine string `json:"machine"` - Bios string `json:"bios"` - OsType string `json:"os_type"` - FlavorId string `json:"flavor_id"` - SecgrpId string `json:"secgrp_id"` - AdminSecgrpId string `json:"admin_secgrp_id"` - SrcIpCheck *bool `json:"omitempty,src_ip_check"` - SrcMacCheck *bool `json:"omitempty,src_mac_check"` - Hypervisor string `json:"hypervisor"` - InstanceType string `json:"instance_type"` + // 秘钥对Id + KeypairId string `json:"keypair_id"` + // 备份机所在宿主机Id + BackupHostId string `json:"backup_host_id"` + Vga string `json:"vga"` + Vdi string `json:"vdi"` + Machine string `json:"machine"` + Bios string `json:"bios"` + // 操作系统类型 + OsType string `json:"os_type"` + FlavorId string `json:"flavor_id"` + // 安全组Id + // example: default + SecgrpId string `json:"secgrp_id"` + // 管理员可见安全组Id + AdminSecgrpId string `json:"admin_secgrp_id"` + SrcIpCheck *bool `json:"src_ip_check,omitempty"` + SrcMacCheck *bool `json:"src_mac_check,omitempty"` + // 虚拟化技术 + // example: kvm + Hypervisor string `json:"hypervisor"` + // 套餐名称 + InstanceType string `json:"instance_type"` } // SGuestJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestJointsBase. @@ -616,18 +840,28 @@ type SGuestTemplate struct { apis.SSharableVirtualResourceBase SCloudregionResourceBase SVpcResourceBase - VcpuCount int `json:"vcpu_count"` - VmemSize int `json:"vmem_size"` - OsType string `json:"os_type"` - ImageType string `json:"image_type"` - ImageId string `json:"image_id"` - Hypervisor string `json:"hypervisor"` - BillingType string `json:"billing_type"` - Content interface{} `json:"content"` + // 虚拟机CPU数量 + VcpuCount int `json:"vcpu_count"` + // 虚拟机内存大小(MB) + VmemSize int `json:"vmem_size"` + // 虚拟机操作系统类型 + // pattern:Linux|Windows|VMWare + OsType string `json:"os_type"` + // 镜像类型 + ImageType string `json:"image_type"` + // 镜像ID + ImageId string `json:"image_id"` + // 虚拟机技术 + Hypervisor string `json:"hypervisor"` + // 计费方式 + BillingType string `json:"billing_type"` + // 其他配置信息 + Content interface{} `json:"content"` } // SGuestTemplateResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestTemplateResourceBase. type SGuestTemplateResourceBase struct { + // 主机模板ID GuestTemplateId string `json:"guest_template_id"` } @@ -635,10 +869,13 @@ type SGuestTemplateResourceBase struct { type SGuestdisk struct { SGuestJointsBase SDiskResourceBase - ImagePath string `json:"image_path"` - Driver string `json:"driver"` - CacheMode string `json:"cache_mode"` - AioMode string `json:"aio_mode"` + ImagePath string `json:"image_path"` + Driver string `json:"driver"` + // Column(VARCHAR(32, charset='ascii'), nullable=True) + CacheMode string `json:"cache_mode"` + // Column(VARCHAR(32, charset='ascii'), nullable=True) + AioMode string `json:"aio_mode"` + // Column(VARCHAR(32, charset='ascii'), nullable=True) Iops int `json:"iops"` Bps int `json:"bps"` Mountpoint string `json:"mountpoint"` @@ -649,15 +886,24 @@ type SGuestdisk struct { type SGuestnetwork struct { SGuestJointsBase NetworkId string `json:"network_id"` - MacAddr string `json:"mac_addr"` - IpAddr string `json:"ip_addr"` - Ip6Addr string `json:"ip6_addr"` - Driver string `json:"driver"` - BwLimit int `json:"bw_limit"` - Index byte `json:"index"` - Virtual bool `json:"virtual"` - Ifname string `json:"ifname"` - TeamWith string `json:"team_with"` + // MAC地址 + MacAddr string `json:"mac_addr"` + // IPv4地址 + IpAddr string `json:"ip_addr"` + // IPv6地址 + Ip6Addr string `json:"ip6_addr"` + // 虚拟网卡驱动 + Driver string `json:"driver"` + // 带宽限制,单位mbps + BwLimit int `json:"bw_limit"` + // 网卡序号 + Index byte `json:"index"` + // 是否为虚拟接口(无IP) + Virtual bool `json:"virtual"` + // 虚拟网卡设备名称 + Ifname string `json:"ifname"` + // bind配对网卡MAC地址 + TeamWith string `json:"team_with"` } // SGuestsecgroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestsecgroup. @@ -673,44 +919,79 @@ type SHost struct { SZoneResourceBase SManagedResourceBase SBillingResourceBase - Rack string `json:"rack"` - Slots string `json:"slots"` - AccessMac string `json:"access_mac"` - AccessIp string `json:"access_ip"` - ManagerUri string `json:"manager_uri"` - SysInfo interface{} `json:"sys_info"` - SN string `json:"sn"` - CpuCount int `json:"cpu_count"` - NodeCount byte `json:"node_count"` - CpuDesc string `json:"cpu_desc"` - CpuMhz int `json:"cpu_mhz"` - CpuCache int `json:"cpu_cache"` - CpuReserved int `json:"cpu_reserved"` - CpuCmtbound float32 `json:"cpu_cmtbound"` - CpuMicrocode string `json:"cpu_microcode"` - CpuArchitecture string `json:"cpu_architecture"` - MemSize int `json:"mem_size"` - MemReserved int `json:"mem_reserved"` - MemCmtbound float32 `json:"mem_cmtbound"` - StorageSize int `json:"storage_size"` - StorageType string `json:"storage_type"` - StorageDriver string `json:"storage_driver"` - StorageInfo interface{} `json:"storage_info"` - IpmiIp string `json:"ipmi_ip"` - IpmiInfo interface{} `json:"ipmi_info"` - HostStatus string `json:"host_status"` - HostType string `json:"host_type"` - Version string `json:"version"` - OvnVersion string `json:"ovn_version"` - IsBaremetal bool `json:"is_baremetal"` - IsMaintenance bool `json:"is_maintenance"` - LastPingAt time.Time `json:"last_ping_at"` - ResourceType string `json:"resource_type"` - RealExternalId string `json:"real_external_id"` - IsImport bool `json:"is_import"` - EnablePxeBoot *bool `json:"enable_pxe_boot,omitempty"` - Uuid string `json:"uuid"` - BootMode string `json:"boot_mode"` + // 机架 + Rack string `json:"rack"` + // 机位 + Slots string `json:"slots"` + // 管理口MAC + AccessMac string `json:"access_mac"` + // 管理口Ip地址 + AccessIp string `json:"access_ip"` + // 管理地址 + ManagerUri string `json:"manager_uri"` + // 系统信息 + SysInfo interface{} `json:"sys_info"` + // 物理机序列号信息 + SN string `json:"sn"` + // CPU大小 + CpuCount int `json:"cpu_count"` + // 物理CPU颗数 + NodeCount byte `json:"node_count"` + // CPU描述信息 + CpuDesc string `json:"cpu_desc"` + // CPU频率 + CpuMhz int `json:"cpu_mhz"` + // CPU缓存大小,单位KB + CpuCache int `json:"cpu_cache"` + // 预留CPU大小 + CpuReserved int `json:"cpu_reserved"` + // CPU超分比 + CpuCmtbound float32 `json:"cpu_cmtbound"` + // CPUMicrocode + CpuMicrocode string `json:"cpu_microcode"` + // CPU架构 + CpuArchitecture string `json:"cpu_architecture"` + // 内存大小,单位Mb + MemSize int `json:"mem_size"` + // 预留内存大小 + MemReserved int `json:"mem_reserved"` + // 内存超分比 + MemCmtbound float32 `json:"mem_cmtbound"` + // 存储大小,单位Mb + StorageSize int `json:"storage_size"` + // 存储类型 + StorageType string `json:"storage_type"` + // 存储驱动类型 + StorageDriver string `json:"storage_driver"` + // 存储详情 + StorageInfo interface{} `json:"storage_info"` + // IPMI地址 + IpmiIp string `json:"ipmi_ip"` + // IPMI详情 + IpmiInfo interface{} `json:"ipmi_info"` + // 宿主机状态 + // example: online + HostStatus string `json:"host_status"` + // 宿主机类型 + HostType string `json:"host_type"` + // host服务软件版本 + Version string `json:"version"` + // OVN软件版本 + OvnVersion string `json:"ovn_version"` + IsBaremetal bool `json:"is_baremetal"` + // 是否处于维护状态 + IsMaintenance bool `json:"is_maintenance"` + LastPingAt time.Time `json:"last_ping_at"` + ResourceType string `json:"resource_type"` + RealExternalId string `json:"real_external_id"` + // 是否为导入的宿主机 + IsImport bool `json:"is_import"` + // 是否允许PXE启动 + EnablePxeBoot *bool `json:"enable_pxe_boot,omitempty"` + // 主机UUID + Uuid string `json:"uuid"` + // 主机启动模式, 可能值位PXE和ISO + BootMode string `json:"boot_mode"` } // SHostJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHostJointsBase. @@ -726,10 +1007,14 @@ type SHostResourceBase struct { // SHostnetwork is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHostnetwork. type SHostnetwork struct { SHostJointsBase + // 宿主机ID BaremetalId string `json:"baremetal_id"` - NetworkId string `json:"network_id"` - IpAddr string `json:"ip_addr"` - MacAddr string `json:"mac_addr"` + // 网络ID + NetworkId string `json:"network_id"` + // IP地址 + IpAddr string `json:"ip_addr"` + // MAC地址 + MacAddr string `json:"mac_addr"` } // SHostschedtag is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHostschedtag. @@ -741,22 +1026,32 @@ type SHostschedtag struct { // SHoststorage is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHoststorage. type SHoststorage struct { SHostJointsBase - HostId string `json:"host_id"` - StorageId string `json:"storage_id"` - MountPoint string `json:"mount_point"` - Config interface{} `json:"config"` - RealCapacity int64 `json:"real_capacity"` + // 宿主机Id + HostId string `json:"host_id"` + // 存储Id + StorageId string `json:"storage_id"` + // 挂载点 + MountPoint string `json:"mount_point"` + // 配置信息 + Config interface{} `json:"config"` + // 真实容量大小 + RealCapacity int64 `json:"real_capacity"` } // SHostwire is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHostwire. type SHostwire struct { SHostJointsBase - Bridge string `json:"bridge"` + Bridge string `json:"bridge"` + // 接口名称 Interface string `json:"interface"` - IsMaster bool `json:"is_master"` - MacAddr string `json:"mac_addr"` - HostId string `json:"host_id"` - WireId string `json:"wire_id"` + // 是否是主地址 + IsMaster bool `json:"is_master"` + // MAC地址 + MacAddr string `json:"mac_addr"` + // 宿主机Id + HostId string `json:"host_id"` + // 二层网络Id + WireId string `json:"wire_id"` } // SHuaweiCachedLb is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHuaweiCachedLb. @@ -765,8 +1060,10 @@ type SHuaweiCachedLb struct { apis.SExternalizedResourceBase SManagedResourceBase SCloudregionResourceBase - BackendServerId string `json:"backend_server_id"` - BackendId string `json:"backend_id"` + BackendServerId string `json:"backend_server_id"` + // 后端服务器 实例ID + BackendId string `json:"backend_id"` + // 本地loadbalancebackend id CachedBackendGroupId string `json:"cached_backend_group_id"` } @@ -779,22 +1076,33 @@ type SHuaweiCachedLbbg struct { LoadbalancerId string `json:"loadbalancer_id"` BackendGroupId string `json:"backend_group_id"` AssociatedId string `json:"associated_id"` + // 关联ID AssociatedType string `json:"associated_type"` - ProtocolType string `json:"protocol_type"` + // 关联类型, listener || rule + ProtocolType string `json:"protocol_type"` } // SInstanceSnapshot is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SInstanceSnapshot. type SInstanceSnapshot struct { apis.SVirtualResourceBase - GuestId string `json:"guest_id"` - ServerConfig interface{} `json:"server_config"` + // 云主机Id + GuestId string `json:"guest_id"` + // 云主机配置 + ServerConfig interface{} `json:"server_config"` + // 云主机标签 ServerMetadata interface{} `json:"server_metadata"` - AutoDelete bool `json:"auto_delete"` - RefCount int `json:"ref_count"` - SecGroups interface{} `json:"sec_groups"` - KeypairId string `json:"keypair_id"` - OsType string `json:"os_type"` - InstanceType string `json:"instance_type"` + // 是否自动删除 + AutoDelete bool `json:"auto_delete"` + // 引用次数 + RefCount int `json:"ref_count"` + // 安全组 + SecGroups interface{} `json:"sec_groups"` + // 秘钥Id + KeypairId string `json:"keypair_id"` + // 操作系统类型 + OsType string `json:"os_type"` + // 套餐名称 + InstanceType string `json:"instance_type"` } // SInstanceSnapshotJoint is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SInstanceSnapshotJoint. @@ -809,9 +1117,14 @@ type SInstanceSnapshotJoint struct { type SIsolatedDevice struct { apis.SStandaloneResourceBase SHostResourceBase - DevType string `json:"dev_type"` - Model string `json:"model"` - GuestId string `json:"guest_id"` + // # PCI / GPU-HPC / GPU-VGA / USB / NIC + // 设备类型 + DevType string `json:"dev_type"` + // # Specific device name read from lspci command, e.g. `Tesla K40m` ... + Model string `json:"model"` + // 云主机Id + GuestId string `json:"guest_id"` + // # pci address of `Bus:Device.Function` format, or usb bus address of `bus.addr` Addr string `json:"addr"` VendorDeviceId string `json:"vendor_device_id"` } @@ -819,11 +1132,18 @@ type SIsolatedDevice struct { // SKeypair is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SKeypair. type SKeypair struct { apis.SStandaloneResourceBase - Scheme string `json:"scheme"` + // 加密类型 + // example: RSA + Scheme string `json:"scheme"` + // 指纹信息 + // example: 1d:3a:83:4a:a1:f3:75:97:ec:d1:ef:f8:3f:a7:5d:9e Fingerprint string `json:"fingerprint"` - PrivateKey string `json:"private_key"` - PublicKey string `json:"public_key"` - OwnerId string `json:"owner_id"` + // 私钥 + PrivateKey string `json:"private_key"` + // 公钥 + PublicKey string `json:"public_key"` + // 用户Id + OwnerId string `json:"owner_id"` } // SLoadbalancer is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancer. @@ -834,17 +1154,27 @@ type SLoadbalancer struct { SCloudregionResourceBase // LB might optionally be in a VPC, vpc_id, manager_id, cloudregion_id SVpcResourceBase + // zone_id SZoneResourceBase + // optional network_id SNetworkResourceBase SLoadbalancerRateLimiter - Address string `json:"address"` - AddressType string `json:"address_type"` - NetworkType string `json:"network_type"` - ClusterId string `json:"cluster_id"` - ChargeType string `json:"charge_type"` - LoadbalancerSpec string `json:"loadbalancer_spec"` - BackendGroupId string `json:"backend_group_id"` - LBInfo interface{} `json:"lb_info"` + // IP地址 + Address string `json:"address"` + // 地址类型 + AddressType string `json:"address_type"` + // 网络类型 + NetworkType string `json:"network_type"` + // 负载均衡集群Id + ClusterId string `json:"cluster_id"` + // 计费类型 + ChargeType string `json:"charge_type"` + // 套餐名称 + LoadbalancerSpec string `json:"loadbalancer_spec"` + // 默认后端服务器组Id + BackendGroupId string `json:"backend_group_id"` + // LB的其他配置信息 + LBInfo interface{} `json:"lb_info"` } // SLoadbalancerAcl is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerAcl. @@ -870,9 +1200,10 @@ type SLoadbalancerAclEntry struct { type SLoadbalancerAgent struct { apis.SStandaloneResourceBase SLoadbalancerClusterResourceBase - Version string `json:"version"` - IP string `json:"ip"` - HaState string `json:"ha_state"` + Version string `json:"version"` + IP string `json:"ip"` + HaState string `json:"ha_state"` + // LB_HA_STATE_UNKNOWN HbLastSeen time.Time `json:"hb_last_seen"` HbTimeout int `json:"hb_timeout"` Params *SLoadbalancerAgentParams `json:"params"` @@ -936,7 +1267,10 @@ type SLoadbalancerAgentParamsVrrp struct { type SLoadbalancerBackend struct { apis.SVirtualResourceBase apis.SExternalizedResourceBase + // SManagedResourceBase + // SCloudregionResourceBase SLoadbalancerBackendgroupResourceBase + // BackendGroupId string `width:"36" charset:"ascii" nullable:"true" list:"user" create:"optional"` BackendId string `json:"backend_id"` BackendType string `json:"backend_type"` BackendRole string `json:"backend_role"` @@ -957,6 +1291,7 @@ type SLoadbalancerBackendGroup struct { // SLoadbalancerBackendgroupResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerBackendgroupResourceBase. type SLoadbalancerBackendgroupResourceBase struct { + // 负载均衡后端组ID BackendGroupId string `json:"backend_group_id"` } @@ -964,8 +1299,9 @@ type SLoadbalancerBackendgroupResourceBase struct { type SLoadbalancerCertificate struct { apis.SVirtualResourceBase apis.SExternalizedResourceBase - Certificate string `json:"certificate"` - PrivateKey string `json:"private_key"` + Certificate string `json:"certificate"` + PrivateKey string `json:"private_key"` + // derived attributes PublicKeyAlgorithm string `json:"public_key_algorithm"` PublicKeyBitLen int `json:"public_key_bit_len"` SignatureAlgorithm string `json:"signature_algorithm"` @@ -978,6 +1314,7 @@ type SLoadbalancerCertificate struct { // SLoadbalancerCertificateResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerCertificateResourceBase. type SLoadbalancerCertificateResourceBase struct { + // 本地负载均衡证书ID CertificateId string `json:"certificate_id"` } @@ -990,32 +1327,42 @@ type SLoadbalancerCluster struct { // SLoadbalancerClusterResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerClusterResourceBase. type SLoadbalancerClusterResourceBase struct { + // 归属LB集群 ClusterId string `json:"cluster_id"` } // SLoadbalancerHTTPListener is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerHTTPListener. type SLoadbalancerHTTPListener struct { - StickySession string `json:"sticky_session"` - StickySessionType string `json:"sticky_session_type"` - StickySessionCookie string `json:"sticky_session_cookie"` - StickySessionCookieTimeout int `json:"sticky_session_cookie_timeout"` - XForwardedFor bool `json:"xforwarded_for"` - Gzip bool `json:"gzip"` + StickySession string `json:"sticky_session"` + // 会话保持开启状态 on|off + StickySessionType string `json:"sticky_session_type"` + // Cookie处理方式 insert(植入cookie)|server(重写cookie) + StickySessionCookie string `json:"sticky_session_cookie"` + // Cookie名称 + StickySessionCookieTimeout int `json:"sticky_session_cookie_timeout"` + XForwardedFor bool `json:"xforwarded_for"` + // 获取客户端真实IP + Gzip bool `json:"gzip"` } // SLoadbalancerHTTPRateLimiter is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerHTTPRateLimiter. type SLoadbalancerHTTPRateLimiter struct { - HTTPRequestRate int `json:"http_request_rate"` + HTTPRequestRate int `json:"http_request_rate"` + // 限定监听接收请示速率 HTTPRequestRatePerSrc int `json:"http_request_rate_per_src"` } // SLoadbalancerHTTPRedirect is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerHTTPRedirect. type SLoadbalancerHTTPRedirect struct { - Redirect string `json:"redirect"` - RedirectCode int `json:"redirect_code"` + Redirect string `json:"redirect"` + // 跳转类型 + RedirectCode int `json:"redirect_code"` + // 跳转HTTP code RedirectScheme string `json:"redirect_scheme"` - RedirectHost string `json:"redirect_host"` - RedirectPath string `json:"redirect_path"` + // 跳转uri scheme + RedirectHost string `json:"redirect_host"` + // 跳转时变更Host + RedirectPath string `json:"redirect_path"` } // SLoadbalancerHTTPSListener is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerHTTPSListener. @@ -1028,17 +1375,24 @@ type SLoadbalancerHTTPSListener struct { // SLoadbalancerHealthCheck is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerHealthCheck. type SLoadbalancerHealthCheck struct { - HealthCheck string `json:"health_check"` - HealthCheckType string `json:"health_check_type"` - HealthCheckDomain string `json:"health_check_domain"` - HealthCheckURI string `json:"health_check_uri"` + HealthCheck string `json:"health_check"` + // 健康检查开启状态 on|off + HealthCheckType string `json:"health_check_type"` + HealthCheckDomain string `json:"health_check_domain"` + // 健康检查域名 yunion.cn + HealthCheckURI string `json:"health_check_uri"` + // 健康检查路径 / HealthCheckHttpCode string `json:"health_check_http_code"` HealthCheckRise int `json:"health_check_rise"` - HealthCheckFall int `json:"health_check_fall"` - HealthCheckTimeout int `json:"health_check_timeout"` + // 健康检查健康阈值 3秒 + HealthCheckFall int `json:"health_check_fall"` + // 健康检查不健康阈值 15秒 + HealthCheckTimeout int `json:"health_check_timeout"` + // 健康检查超时时间 10秒 HealthCheckInterval int `json:"health_check_interval"` HealthCheckReq string `json:"health_check_req"` - HealthCheckExp string `json:"health_check_exp"` + // UDP监听健康检查的请求串 + HealthCheckExp string `json:"health_check_exp"` } // SLoadbalancerListener is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerListener. @@ -1046,20 +1400,23 @@ type SLoadbalancerListener struct { apis.SVirtualResourceBase apis.SExternalizedResourceBase SLoadbalancerResourceBase - ListenerType string `json:"listener_type"` - ListenerPort int `json:"listener_port"` - BackendGroupId string `json:"backend_group_id"` - BackendServerPort int `json:"backend_server_port"` - Scheduler string `json:"scheduler"` - SendProxy string `json:"send_proxy"` - ClientRequestTimeout int `json:"client_request_timeout"` - ClientIdleTimeout int `json:"client_idle_timeout"` - BackendConnectTimeout int `json:"backend_connect_timeout"` - BackendIdleTimeout int `json:"backend_idle_timeout"` - AclStatus string `json:"acl_status"` - AclType string `json:"acl_type"` - AclId string `json:"acl_id"` - CachedAclId string `json:"cached_acl_id"` + ListenerType string `json:"listener_type"` + ListenerPort int `json:"listener_port"` + BackendGroupId string `json:"backend_group_id"` + BackendServerPort int `json:"backend_server_port"` + Scheduler string `json:"scheduler"` + SendProxy string `json:"send_proxy"` + ClientRequestTimeout int `json:"client_request_timeout"` + // 连接请求超时时间 + ClientIdleTimeout int `json:"client_idle_timeout"` + // 连接空闲超时时间 + BackendConnectTimeout int `json:"backend_connect_timeout"` + // 后端连接超时时间 + BackendIdleTimeout int `json:"backend_idle_timeout"` + AclStatus string `json:"acl_status"` + AclType string `json:"acl_type"` + AclId string `json:"acl_id"` + CachedAclId string `json:"cached_acl_id"` SLoadbalancerRateLimiter SLoadbalancerTCPListener SLoadbalancerUDPListener @@ -1072,6 +1429,7 @@ type SLoadbalancerListener struct { // SLoadbalancerListenerResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerListenerResourceBase. type SLoadbalancerListenerResourceBase struct { + // 负载均衡监听器ID ListenerId string `json:"listener_id"` } @@ -1080,12 +1438,14 @@ type SLoadbalancerListenerRule struct { apis.SVirtualResourceBase apis.SExternalizedResourceBase SLoadbalancerListenerResourceBase + // 默认转发策略,目前只有aws用到其它云都是false IsDefault bool `json:"is_default"` BackendGroupId string `json:"backend_group_id"` Domain string `json:"domain"` Path string `json:"path"` Condition string `json:"condition"` SLoadbalancerHealthCheck + // 目前只有腾讯云HTTP、HTTPS类型的健康检查是和规则绑定的。 SLoadbalancerHTTPRateLimiter SLoadbalancerHTTPRedirect } @@ -1105,6 +1465,7 @@ type SLoadbalancerRateLimiter struct { // SLoadbalancerResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerResourceBase. type SLoadbalancerResourceBase struct { + // 负载均衡ID LoadbalancerId string `json:"loadbalancer_id"` } @@ -1118,6 +1479,7 @@ type SLoadbalancerUDPListener struct { // SManagedResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SManagedResourceBase. type SManagedResourceBase struct { + // 云订阅ID ManagerId string `json:"manager_id"` } @@ -1132,6 +1494,7 @@ type SNatEntry struct { type SNatGateway struct { apis.SStatusInfrasResourceBase apis.SExternalizedResourceBase + // SManagedResourceBase SBillingResourceBase SVpcResourceBase NatSpec string `json:"nat_spec"` @@ -1190,9 +1553,12 @@ type SNetworkInterface struct { apis.SExternalizedResourceBase SManagedResourceBase SCloudregionResourceBase - Mac string `json:"mac"` + // MAC地址 + Mac string `json:"mac"` + // 绑定资源类型 AssociateType string `json:"associate_type"` - AssociateId string `json:"associate_id"` + // 绑定资源Id + AssociateId string `json:"associate_id"` } // SNetworkResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetworkResourceBase. @@ -1206,7 +1572,8 @@ type SNetworkinterfacenetwork struct { Primary bool `json:"primary"` IpAddr string `json:"ip_addr"` NetworkinterfaceId string `json:"networkinterface_id"` - NetworkId string `json:"network_id"` + // Column(VARCHAR(36, charset='ascii'), nullable=False) + NetworkId string `json:"network_id"` } // SNetworkschedtag is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetworkschedtag. @@ -1221,8 +1588,10 @@ type SQcloudCachedLb struct { apis.SExternalizedResourceBase SManagedResourceBase SCloudregionResourceBase - BackendServerId string `json:"backend_server_id"` - BackendId string `json:"backend_id"` + BackendServerId string `json:"backend_server_id"` + // 后端服务器 实例ID + BackendId string `json:"backend_id"` + // 本地loadbalancebackend id CachedBackendGroupId string `json:"cached_backend_group_id"` } @@ -1235,6 +1604,7 @@ type SQcloudCachedLbbg struct { LoadbalancerId string `json:"loadbalancer_id"` BackendGroupId string `json:"backend_group_id"` AssociatedId string `json:"associated_id"` + // 关联ID AssociatedType string `json:"associated_type"` } @@ -1242,11 +1612,16 @@ type SQcloudCachedLbbg struct { type SReservedip struct { apis.SResourceBase SNetworkResourceBase - Id int64 `json:"id"` - IpAddr string `json:"ip_addr"` - Notes string `json:"notes"` + // 自增Id + Id int64 `json:"id"` + // IP地址 + IpAddr string `json:"ip_addr"` + // 预留原因或描述 + Notes string `json:"notes"` + // 过期时间 ExpiredAt time.Time `json:"expired_at"` - Status string `json:"status"` + // 状态 + Status string `json:"status"` } // SRouteTable is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SRouteTable. @@ -1262,26 +1637,33 @@ type SRouteTable struct { type SScalingActivity struct { apis.SStatusStandaloneResourceBase SScalingGroupResourceBase - InstanceNumber int `json:"instance_number"` - TriggerDesc string `json:"trigger_desc"` - ActionDesc string `json:"action_desc"` - StartTime time.Time `json:"start_time"` - EndTime time.Time `json:"end_time"` - Reason string `json:"reason"` + InstanceNumber int `json:"instance_number"` + // 起因描述 + TriggerDesc string `json:"trigger_desc"` + // 行为描述 + ActionDesc string `json:"action_desc"` + StartTime time.Time `json:"start_time"` + EndTime time.Time `json:"end_time"` + Reason string `json:"reason"` } // SScalingAlarm is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingAlarm. type SScalingAlarm struct { apis.SStandaloneResourceBase SScalingPolicyBase - AlarmId string `json:"alarm_id"` - Cumulate int `json:"cumulate"` - Cycle int `json:"cycle"` - Indicator string `json:"indicator"` - Wrapper string `json:"wrapper"` - Operator string `json:"operator"` - Value int `json:"value"` - RealCumulate int `json:"real_cumulate"` + // ID of alarm config in alarm service + AlarmId string `json:"alarm_id"` + // Trigger when the cumulative count is reached + Cumulate int `json:"cumulate"` + Cycle int `json:"cycle"` + Indicator string `json:"indicator"` + // Wrapper instruct how to calculate collective data based on individual data + Wrapper string `json:"wrapper"` + Operator string `json:"operator"` + Value float64 `json:"value"` + // Real-time cumulate number + RealCumulate int `json:"real_cumulate"` + // Last trigger time LastTriggerTime time.Time `json:"last_trigger_time"` } @@ -1291,14 +1673,22 @@ type SScalingGroup struct { SCloudregionResourceBase SVpcResourceBase SLoadbalancerBackendgroupResourceBase + // GuestGroupId represent the guest gropu related to this scaling group. + // Every scaling group will have only one guest group related to itself. SGroupResourceBase SGuestTemplateResourceBase apis.SEnabledResourceBase - Hypervisor string `json:"hypervisor"` - MinInstanceNumber int `json:"min_instance_number"` - MaxInstanceNumber int `json:"max_instance_number"` - DesireInstanceNumber int `json:"desire_instance_number"` - ExpansionPrinciple string `json:"expansion_principle"` + Hypervisor string `json:"hypervisor"` + MinInstanceNumber int `json:"min_instance_number"` + MaxInstanceNumber int `json:"max_instance_number"` + // DesireInstanceNumber represent the number of instances that should exist in the scaling group. + // Scaling controller will monitor and ensure this in real time. + // Scaling activities triggered by various policies will also modify this value. + // This value should between MinInstanceNumber and MaxInstanceNumber + DesireInstanceNumber int `json:"desire_instance_number"` + // ExpansionPrinciple represent the principle when creating new instance to join in. + ExpansionPrinciple string `json:"expansion_principle"` + // ShrinkPrinciple represent the principle when removing instance from scaling group. ShrinkPrinciple string `json:"shrink_principle"` HealthCheckMode string `json:"health_check_mode"` HealthCheckCycle int `json:"health_check_cycle"` @@ -1324,6 +1714,7 @@ type SScalingGroupNetwork struct { // SScalingGroupResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingGroupResourceBase. type SScalingGroupResourceBase struct { + // ScalingGroupId ScalingGroupId string `json:"scaling_group_id"` } @@ -1334,10 +1725,13 @@ type SScalingPolicy struct { apis.SEnabledResourceBase TriggerType string `json:"trigger_type"` TriggerId string `json:"trigger_id"` - Action string `json:"action"` - Number int `json:"number"` - Unit string `json:"unit"` - CoolingTime int `json:"cooling_time"` + // Action of scaling activity + Action string `json:"action"` + Number int `json:"number"` + // Unit of Number + Unit string `json:"unit"` + // Scaling activity triggered by alarms will be rejected during this period about CoolingTime + CoolingTime int `json:"cooling_time"` } // SScalingPolicyBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingPolicyBase. @@ -1349,13 +1743,21 @@ type SScalingPolicyBase struct { type SScalingTimer struct { apis.SStandaloneResourceBase SScalingPolicyBase - Type string `json:"type"` - Minute int `json:"minute"` - Hour int `json:"hour"` - WeekDays byte `json:"week_days"` - MonthDays uint32 `json:"month_days"` + // Timer type + Type string `json:"type"` + // 0-59 + Minute int `json:"minute"` + // 0-23 + Hour int `json:"hour"` + // 0-7 1 is Monday 0 is unlimited + WeekDays byte `json:"week_days"` + // 0-31 0 is unlimited + MonthDays uint32 `json:"month_days"` + // StartTime represent the start time of this timer StartTime time.Time `json:"start_time"` - EndTime time.Time `json:"end_time"` + // EndTime represent deadline of this timer + EndTime time.Time `json:"end_time"` + // NextTime represent the time timer should bell NextTime time.Time `json:"next_time"` IsExpired bool `json:"is_expired"` } @@ -1374,7 +1776,8 @@ type SSchedtag struct { apis.SStandaloneResourceBase apis.SScopedResourceBase DefaultStrategy string `json:"default_strategy"` - ResourceType string `json:"resource_type"` + // Column(VARCHAR(16, charset='ascii'), nullable=True, default='') + ResourceType string `json:"resource_type"` } // SSchedtagJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SSchedtagJointsBase. @@ -1385,6 +1788,7 @@ type SSchedtagJointsBase struct { // SSchedtagResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SSchedtagResourceBase. type SSchedtagResourceBase struct { + // 归属调度标签ID SchedtagId string `json:"schedtag_id"` } @@ -1401,11 +1805,13 @@ type SSecurityGroupCache struct { SCloudregionResourceBase SManagedResourceBase SSecurityGroupResourceBase + // 虚拟私有网络外部Id VpcId string `json:"vpc_id"` } // SSecurityGroupResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SSecurityGroupResourceBase. type SSecurityGroupResourceBase struct { + // 本地安全组ID SecgroupId string `json:"secgroup_id"` } @@ -1429,31 +1835,36 @@ type SServerSku struct { apis.SExternalizedResourceBase SCloudregionResourceBase SZoneResourceBase - Enabled bool `json:"enabled"` - InstanceTypeFamily string `json:"instance_type_family"` + Enabled bool `json:"enabled"` + // SkuId string `width:"64" charset:"ascii" nullable:"false" list:"user" create:"admin_required"` // x2.large + InstanceTypeFamily string `json:"instance_type_family"` + // x2 InstanceTypeCategory string `json:"instance_type_category"` - LocalCategory string `json:"local_category"` - PrepaidStatus string `json:"prepaid_status"` - PostpaidStatus string `json:"postpaid_status"` - CpuCoreCount int `json:"cpu_core_count"` - MemorySizeMB int `json:"memory_size_mb"` - OsName string `json:"os_name"` - SysDiskResizable *bool `json:"omitempty,sys_disk_resizable"` - SysDiskType string `json:"sys_disk_type"` - SysDiskMinSizeGB int `json:"sys_disk_min_size_gb"` - SysDiskMaxSizeGB int `json:"sys_disk_max_size_gb"` - AttachedDiskType string `json:"attached_disk_type"` - AttachedDiskSizeGB int `json:"attached_disk_size_gb"` - AttachedDiskCount int `json:"attached_disk_count"` - DataDiskTypes string `json:"data_disk_types"` - DataDiskMaxCount int `json:"data_disk_max_count"` - NicType string `json:"nic_type"` - NicMaxCount int `json:"nic_max_count"` - GpuAttachable *bool `json:"gpu_attachable,omitempty"` - GpuSpec string `json:"gpu_spec"` - GpuCount int `json:"gpu_count"` - GpuMaxCount int `json:"gpu_max_count"` - Provider string `json:"provider"` + // 通用型 + LocalCategory string `json:"local_category"` + PrepaidStatus string `json:"prepaid_status"` + // 预付费资源状态 available|soldout + PostpaidStatus string `json:"postpaid_status"` + CpuCoreCount int `json:"cpu_core_count"` + MemorySizeMB int `json:"memory_size_mb"` + OsName string `json:"os_name"` + SysDiskResizable *bool `json:"sys_disk_resizable,omitempty"` + SysDiskType string `json:"sys_disk_type"` + SysDiskMinSizeGB int `json:"sys_disk_min_size_gb"` + // not required。 windows比较新的版本都是50G左右。 + SysDiskMaxSizeGB int `json:"sys_disk_max_size_gb"` + AttachedDiskType string `json:"attached_disk_type"` + AttachedDiskSizeGB int `json:"attached_disk_size_gb"` + AttachedDiskCount int `json:"attached_disk_count"` + DataDiskTypes string `json:"data_disk_types"` + DataDiskMaxCount int `json:"data_disk_max_count"` + NicType string `json:"nic_type"` + NicMaxCount int `json:"nic_max_count"` + GpuAttachable *bool `json:"gpu_attachable,omitempty"` + GpuSpec string `json:"gpu_spec"` + GpuCount int `json:"gpu_count"` + GpuMaxCount int `json:"gpu_max_count"` + Provider string `json:"provider"` } // SServiceCatalog is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SServiceCatalog. @@ -1469,15 +1880,20 @@ type SSnapshot struct { apis.SExternalizedResourceBase SManagedResourceBase SCloudregionResourceBase - DiskId string `json:"disk_id"` - StorageId string `json:"storage_id"` - CreatedBy string `json:"created_by"` - Location string `json:"location"` - Size int `json:"size"` - OutOfChain bool `json:"out_of_chain"` - FakeDeleted bool `json:"fake_deleted"` - DiskType string `json:"disk_type"` - OsType string `json:"os_type"` + // 磁盘Id + DiskId string `json:"disk_id"` + // Only onecloud has StorageId + StorageId string `json:"storage_id"` + CreatedBy string `json:"created_by"` + Location string `json:"location"` + // 快照大小,单位Mb + Size int `json:"size"` + OutOfChain bool `json:"out_of_chain"` + FakeDeleted bool `json:"fake_deleted"` + DiskType string `json:"disk_type"` + // 操作系统类型 + OsType string `json:"os_type"` + // create disk from snapshot, snapshot as disk backing file RefCount int `json:"ref_count"` BackingDiskId string `json:"backing_disk_id"` ExpiredAt time.Time `json:"expired_at"` @@ -1486,10 +1902,12 @@ type SSnapshot struct { // SSnapshotPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SSnapshotPolicy. type SSnapshotPolicy struct { apis.SVirtualResourceBase - RetentionDays int `json:"retention_days"` - RepeatWeekdays byte `json:"repeat_weekdays"` - TimePoints uint32 `json:"time_points"` - IsActivated *bool `json:"is_activated,omitempty"` + RetentionDays int `json:"retention_days"` + // 1~7, 1 is Monday + RepeatWeekdays byte `json:"repeat_weekdays"` + // 0~23 + TimePoints uint32 `json:"time_points"` + IsActivated *bool `json:"is_activated,omitempty"` } // SSnapshotPolicyCache is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SSnapshotPolicyCache. @@ -1506,11 +1924,14 @@ type SSnapshotPolicyDisk struct { apis.SVirtualJointResourceBase SSnapshotPolicyResourceBase SDiskResourceBase + // SnapshotpolicyId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"` + // DiskId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"` Status string `json:"status"` } // SSnapshotPolicyResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SSnapshotPolicyResourceBase. type SSnapshotPolicyResourceBase struct { + // 本地快照策略ID SnapshotpolicyId string `json:"snapshotpolicy_id"` } @@ -1520,14 +1941,26 @@ type SStorage struct { apis.SExternalizedResourceBase SManagedResourceBase SZoneResourceBase - Capacity int64 `json:"capacity"` - Reserved int64 `json:"reserved"` - StorageType string `json:"storage_type"` - MediumType string `json:"medium_type"` - Cmtbound float32 `json:"cmtbound"` - StorageConf interface{} `json:"storage_conf"` - StoragecacheId string `json:"storagecache_id"` - IsSysDiskStore *bool `json:"is_sys_disk_store,omitempty"` + // 容量大小,单位Mb + Capacity int64 `json:"capacity"` + // 预留容量大小 + Reserved int64 `json:"reserved"` + // 存储类型 + // example: local + StorageType string `json:"storage_type"` + // 介质类型 + // example: ssd + MediumType string `json:"medium_type"` + // 超售比 + Cmtbound float32 `json:"cmtbound"` + // 存储配置信息 + StorageConf interface{} `json:"storage_conf"` + // 存储缓存Id + StoragecacheId string `json:"storagecache_id"` + // indicating whether system disk can be allocated in this storage + // 是否可以用作系统盘存储 + // example: true + IsSysDiskStore *bool `json:"is_sys_disk_store,omitempty"` } // SStorageResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SStorageResourceBase. @@ -1540,6 +1973,7 @@ type SStoragecache struct { apis.SStandaloneResourceBase apis.SExternalizedResourceBase SManagedResourceBase + // 镜像存储地址 Path string `json:"path"` } @@ -1547,12 +1981,17 @@ type SStoragecache struct { type SStoragecachedimage struct { apis.SJointResourceBase apis.SExternalizedResourceBase - StoragecacheId string `json:"storagecache_id"` - CachedimageId string `json:"cachedimage_id"` - Status string `json:"status"` - Path string `json:"path"` - LastDownload time.Time `json:"last_download"` - DownloadRefcnt int `json:"download_refcnt"` + // 存储缓存Id + StoragecacheId string `json:"storagecache_id"` + // 镜像缓存Id + CachedimageId string `json:"cachedimage_id"` + // 镜像状态 + Status string `json:"status"` + Path string `json:"path"` + // 上次下载时间 + LastDownload time.Time `json:"last_download"` + // 下载引用次数 + DownloadRefcnt int `json:"download_refcnt"` } // SStorageschedtag is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SStorageschedtag. @@ -1563,17 +2002,21 @@ type SStorageschedtag struct { // SSyncableBaseResource is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SSyncableBaseResource. type SSyncableBaseResource struct { - SyncStatus string `json:"sync_status"` - LastSync time.Time `json:"last_sync"` + SyncStatus string `json:"sync_status"` + LastSync time.Time `json:"last_sync"` + // = Column(DateTime, nullable=True) LastSyncEndAt time.Time `json:"last_sync_end_at"` } // SVCenter is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SVCenter. type SVCenter struct { apis.SEnabledStatusStandaloneResourceBase - Hostname string `json:"hostname"` - Port int `json:"port"` - Account string `json:"account"` + Hostname string `json:"hostname"` + // = Column(VARCHAR(64, charset='ascii'), nullable=False) + Port int `json:"port"` + // = Column(Integer, nullable=False) + Account string `json:"account"` + // = Column(VARCHAR(64, charset='ascii'), nullable=False) Password string `json:"password"` LastSync time.Time `json:"last_sync"` Version string `json:"version"` @@ -1587,7 +2030,11 @@ type SVpc struct { SManagedResourceBase SCloudregionResourceBase SGlobalVpcResourceBase - IsDefault bool `json:"is_default"` + // 是否是默认VPC + // example: true + IsDefault bool `json:"is_default"` + // CIDR地址段 + // example: 192.168.222.0/24 CidrBlock string `json:"cidr_block"` } @@ -1602,13 +2049,19 @@ type SWire struct { apis.SExternalizedResourceBase SVpcResourceBase SZoneResourceBase - Bandwidth int `json:"bandwidth"` - Mtu int `json:"mtu"` + // 带宽大小, 单位Mbps + // example: 1000 + Bandwidth int `json:"bandwidth"` + // MTU + // example: 1500 + Mtu int `json:"mtu"` + // swagger:ignore ScheduleRank int `json:"schedule_rank"` } // SWireResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SWireResourceBase. type SWireResourceBase struct { + // 二层网络ID WireId string `json:"wire_id"` } diff --git a/pkg/compute/models/scaling_policy.go b/pkg/compute/models/scaling_policy.go index 1b8ae09c33..8d92e0ca95 100644 --- a/pkg/compute/models/scaling_policy.go +++ b/pkg/compute/models/scaling_policy.go @@ -19,7 +19,6 @@ import ( "database/sql" "fmt" "time" - "yunion.io/x/onecloud/pkg/util/logclient" "yunion.io/x/jsonutils" "yunion.io/x/log" @@ -32,6 +31,7 @@ import ( "yunion.io/x/onecloud/pkg/cloudcommon/db" "yunion.io/x/onecloud/pkg/httperrors" "yunion.io/x/onecloud/pkg/mcclient" + "yunion.io/x/onecloud/pkg/util/logclient" "yunion.io/x/onecloud/pkg/util/stringutils2" ) diff --git a/pkg/util/logclient/consts.go b/pkg/util/logclient/consts.go index 03269ee0e2..ad53ab7d8b 100644 --- a/pkg/util/logclient/consts.go +++ b/pkg/util/logclient/consts.go @@ -187,7 +187,7 @@ const ( ACT_UPDATE_STATUS = "更新状态" - ACT_REMOVE_GUEST = "移除实例" + ACT_REMOVE_GUEST = "移除实例" ACT_CREATE_SCALING_POLICY = "创建伸缩策略" ACT_DELETE_SCALING_POLICY = "删除伸缩策略" )