From 48e40fa5a9e7c6384fb4a53edc9aef76b104c7e0 Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Mon, 26 Oct 2020 23:57:10 +0800 Subject: [PATCH] update api models --- pkg/apis/compute/zz_generated.model.go | 107 +++++++++++++++------- pkg/apis/identity/zz_generated.model.go | 107 +++++++++++++++++++--- pkg/apis/image/zz_generated.model.go | 35 +++++++ pkg/apis/monitor/zz_generated.model.go | 52 ++++++++++- pkg/apis/notify/zz_generated.model.go | 1 + pkg/apis/yunionconf/input.go | 4 + pkg/apis/yunionconf/zz_generated.model.go | 56 +++++++++++ pkg/apis/zz_generated.model.go | 58 +++++++++++- scripts/codegen.py | 10 ++ 9 files changed, 376 insertions(+), 54 deletions(-) create mode 100644 pkg/apis/yunionconf/zz_generated.model.go diff --git a/pkg/apis/compute/zz_generated.model.go b/pkg/apis/compute/zz_generated.model.go index 7ce26d1d9f..c65a0019ab 100644 --- a/pkg/apis/compute/zz_generated.model.go +++ b/pkg/apis/compute/zz_generated.model.go @@ -330,9 +330,6 @@ type SDBInstance struct { 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"` @@ -351,7 +348,7 @@ type SDBInstance struct { // SDBInstanceAccount is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstanceAccount. type SDBInstanceAccount struct { apis.SStatusStandaloneResourceBase - apis.SExternalizedResourceBase + Host string `json:"host"` SDBInstanceResourceBase // 数据库密码 Secret string `json:"secret"` @@ -432,6 +429,12 @@ type SDBInstanceResourceBase struct { DBInstanceId string `json:"dbinstance_id"` } +// SDBInstanceSecgroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstanceSecgroup. +type SDBInstanceSecgroup struct { + SDBInstanceJointsBase + SSecurityGroupResourceBase +} + // SDBInstanceSku is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstanceSku. type SDBInstanceSku struct { apis.SEnabledStatusStandaloneResourceBase @@ -779,7 +782,7 @@ type SElasticip struct { // 计费类型: 流量、带宽 // example: bandwidth ChargeType string `json:"charge_type"` - // 目前只有华为云此字段是必需填写的 + // 线路类型 BgpType string `json:"bgp_type"` // 是否跟随主机删除而自动释放 AutoDellocate *bool `json:"auto_dellocate,omitempty"` @@ -916,8 +919,7 @@ type SGuestTemplate struct { // 计费方式 BillingType string `json:"billing_type"` // 其他配置信息 - Content interface{} `json:"content"` - LastCheckTime time.Time `json:"last_check_time"` + Content interface{} `json:"content"` } // SGuestTemplateResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestTemplateResourceBase. @@ -926,6 +928,20 @@ type SGuestTemplateResourceBase struct { GuestTemplateId string `json:"guest_template_id"` } +// SGuestcdrom is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestcdrom. +type SGuestcdrom struct { + Id string `json:"id"` + // = Column(VARCHAR(36, charset='ascii'), primary_key=True) + ImageId string `json:"image_id"` + // Column(VARCHAR(36, charset='ascii'), nullable=True) + Name string `json:"name"` + // Column(VARCHAR(64, charset='ascii'), nullable=True) + Path string `json:"path"` + // Column(VARCHAR(256, charset='ascii'), nullable=True) + Size int64 `json:"size"` + UpdateVersion int `json:"update_version"` +} + // SGuestdisk is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestdisk. type SGuestdisk struct { SGuestJointsBase @@ -1045,11 +1061,10 @@ type SHost struct { OvnVersion string `json:"ovn_version"` IsBaremetal bool `json:"is_baremetal"` // 是否处于维护状态 - IsMaintenance bool `json:"is_maintenance"` - LastPingAt time.Time `json:"last_ping_at"` - EnableHealthCheck bool `json:"enable_health_check"` - ResourceType string `json:"resource_type"` - RealExternalId string `json:"real_external_id"` + IsMaintenance bool `json:"is_maintenance"` + EnableHealthCheck bool `json:"enable_health_check"` + ResourceType string `json:"resource_type"` + RealExternalId string `json:"real_external_id"` // 是否为导入的宿主机 IsImport bool `json:"is_import"` // 是否允许PXE启动 @@ -1233,6 +1248,8 @@ type SLoadbalancer struct { // optional network_id SNetworkResourceBase SLoadbalancerRateLimiter + // 备可用区 + Zone1 string `json:"zone_1"` // IP地址 Address string `json:"address"` // 地址类型 @@ -1305,12 +1322,9 @@ type SLoadbalancerAgentDeployment struct { // SLoadbalancerAgentParams is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerAgentParams. type SLoadbalancerAgentParams struct { - KeepalivedConfTmpl string `json:"keepalived_conf_tmpl"` - HaproxyConfTmpl string `json:"haproxy_conf_tmpl"` - TelegrafConfTmpl string `json:"telegraf_conf_tmpl"` - Vrrp SLoadbalancerAgentParamsVrrp `json:"vrrp"` - Haproxy SLoadbalancerAgentParamsHaproxy `json:"haproxy"` - Telegraf SLoadbalancerAgentParamsTelegraf `json:"telegraf"` + KeepalivedConfTmpl string `json:"keepalived_conf_tmpl"` + HaproxyConfTmpl string `json:"haproxy_conf_tmpl"` + TelegrafConfTmpl string `json:"telegraf_conf_tmpl"` } // SLoadbalancerAgentParamsHaproxy is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerAgentParamsHaproxy. @@ -1552,6 +1566,16 @@ type SManagedResourceBase struct { ManagerId string `json:"manager_id"` } +// SNatDEntry is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatDEntry. +type SNatDEntry struct { + SNatEntry + ExternalIP string `json:"external_ip"` + ExternalPort int `json:"external_port"` + InternalIP string `json:"internal_ip"` + InternalPort int `json:"internal_port"` + IpProtocol string `json:"ip_protocol"` +} + // SNatEntry is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatEntry. type SNatEntry struct { apis.SStatusInfrasResourceBase @@ -1582,6 +1606,25 @@ type SNatgatewayResourceBase struct { NatgatewayId string `json:"natgateway_id"` } +// SNetInterface is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetInterface. +type SNetInterface struct { + Mac string `json:"mac"` + // Column(VARCHAR(36, charset='ascii'), primary_key=True) + BaremetalId string `json:"baremetal_id"` + // Column(VARCHAR(36, charset='ascii'), nullable=True) + WireId string `json:"wire_id"` + // Column(VARCHAR(36, charset='ascii'), nullable=True) + Rate int `json:"rate"` + // Column(Integer, nullable=True) # Mbps + NicType string `json:"nic_type"` + // Column(VARCHAR(36, charset='ascii'), nullable=True) + Index byte `json:"index"` + // Column(TINYINT, nullable=True) + LinkUp bool `json:"link_up"` + // Column(Boolean, nullable=True) + Mtu int16 `json:"mtu"` +} + // SNetwork is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetwork. type SNetwork struct { apis.SSharableVirtualResourceBase @@ -1617,6 +1660,8 @@ type SNetwork struct { // 该网段是否用于自动分配IP地址,如果为false,则用户需要明确选择该网段,才会使用该网段分配IP, // 如果为true,则用户不指定网段时,则自动从该值为true的网络中选择一个分配地址 IsAutoAlloc *bool `json:"is_auto_alloc,omitempty"` + // 线路类型 + BgpType string `json:"bgp_type"` } // SNetworkInterface is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetworkInterface. @@ -1787,8 +1832,6 @@ type SScalingAlarm struct { Value float64 `json:"value"` // Real-time cumulate number RealCumulate int `json:"real_cumulate"` - // Last trigger time - LastTriggerTime time.Time `json:"last_trigger_time"` } // SScalingGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingGroup. @@ -1819,10 +1862,6 @@ type SScalingGroup struct { HealthCheckGov int `json:"health_check_gov"` LoadbalancerBackendPort int `json:"loadbalancer_backend_port"` LoadbalancerBackendWeight int `json:"loadbalancer_backend_weight"` - // Time to allow scale - AllowScaleTime time.Time `json:"allow_scale_time"` - // NextCheckTime descripe the next time to check instance's health - NextCheckTime time.Time `json:"next_check_time"` } // SScalingGroupGuest is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingGroupGuest. @@ -2065,8 +2104,6 @@ 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"` } @@ -2164,13 +2201,7 @@ type STimer struct { 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 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"` + IsExpired bool `json:"is_expired"` } // SVCenter is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SVCenter. @@ -2205,6 +2236,16 @@ type SVpc struct { ExternalAccessMode string `json:"external_access_mode"` } +// SVpcPeeringConnection is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SVpcPeeringConnection. +type SVpcPeeringConnection struct { + apis.SEnabledStatusInfrasResourceBase + apis.SExternalizedResourceBase + SVpcResourceBase + PeerVpcId string `json:"peer_vpc_id"` + PeerAccountId string `json:"peer_account_id"` + Bandwidth int `json:"bandwidth"` +} + // SVpcResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SVpcResourceBase. type SVpcResourceBase struct { VpcId string `json:"vpc_id"` diff --git a/pkg/apis/identity/zz_generated.model.go b/pkg/apis/identity/zz_generated.model.go index d671a85283..e2b6722a32 100644 --- a/pkg/apis/identity/zz_generated.model.go +++ b/pkg/apis/identity/zz_generated.model.go @@ -92,6 +92,20 @@ type SFederatedUser struct { DisplayName string `json:"display_name"` } +// SFederationProtocol is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SFederationProtocol. +type SFederationProtocol struct { + Id string `json:"id"` + IdpId string `json:"idp_id"` + MappingId string `json:"mapping_id"` +} + +// SFernetKey is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SFernetKey. +type SFernetKey struct { + Type string `json:"type"` + Index int `json:"index"` + Key string `json:"key"` +} + // SGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SGroup. type SGroup struct { SIdentityBaseResource @@ -137,36 +151,60 @@ type SIdmapping struct { EntityType string `json:"entity_type"` } +// SIdpRemoteIds is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SIdpRemoteIds. +type SIdpRemoteIds struct { + IdpId string `json:"idp_id"` + RemoteId string `json:"remote_id"` +} + +// SImpliedRole is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SImpliedRole. +type SImpliedRole struct { + PriorRoleId string `json:"prior_role_id"` + ImpliedRoleId string `json:"implied_role_id"` +} + // SLocalUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SLocalUser. type SLocalUser struct { apis.SResourceBase - Id int `json:"id"` - UserId string `json:"user_id"` - DomainId string `json:"domain_id"` - Name string `json:"name"` - FailedAuthCount int `json:"failed_auth_count"` - FailedAuthAt time.Time `json:"failed_auth_at"` + Id int `json:"id"` + UserId string `json:"user_id"` + DomainId string `json:"domain_id"` + Name string `json:"name"` + FailedAuthCount int `json:"failed_auth_count"` +} + +// SNonlocalUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SNonlocalUser. +type SNonlocalUser struct { + DomainId string `json:"domain_id"` + Name string `json:"name"` + UserId string `json:"user_id"` } // SPassword is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SPassword. type SPassword struct { apis.SResourceBase - Id int `json:"id"` - LocalUserId int `json:"local_user_id"` - Password string `json:"password"` - ExpiresAt time.Time `json:"expires_at"` - SelfService bool `json:"self_service"` - PasswordHash string `json:"password_hash"` - CreatedAtInt int64 `json:"created_at_int"` - ExpiresAtInt int64 `json:"expires_at_int"` + Id int `json:"id"` + LocalUserId int `json:"local_user_id"` + Password string `json:"password"` + SelfService bool `json:"self_service"` + PasswordHash string `json:"password_hash"` + CreatedAtInt int64 `json:"created_at_int"` + ExpiresAtInt int64 `json:"expires_at_int"` } // SPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SPolicy. type SPolicy struct { SEnabledIdentityBaseResource apis.SSharableBaseResource - Type string `json:"type"` + // swagger:ignore + // Deprecated + Type string `json:"type"` + // 权限定义 Blob interface{} `json:"blob"` + // 权限范围 + Scope string `json:"scope"` + // 是否为系统权限 + IsSystem *bool `json:"is_system,omitempty"` } // SProject is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SProject. @@ -176,6 +214,12 @@ type SProject struct { IsDomain *bool `json:"is_domain,omitempty"` } +// SProjectExtended is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SProjectExtended. +type SProjectExtended struct { + SProject + DomainName string `json:"domain_name"` +} + // SRegion is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SRegion. type SRegion struct { apis.SStandaloneResourceBase @@ -189,6 +233,32 @@ type SRole struct { apis.SSharableBaseResource } +// SRolePolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SRolePolicy. +type SRolePolicy struct { + apis.SResourceBase + // 角色ID, 主键 + RoleId string `json:"role_id"` + // 项目ID,主键 + ProjectId string `json:"project_id"` + // 权限ID, 主键 + PolicyId string `json:"policy_id"` + // 是否需要认证 + Auth *bool `json:"auth,omitempty"` + // 匹配的IP白名单 + Ips string `json:"ips"` +} + +// SScopeResource is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SScopeResource. +type SScopeResource struct { + DomainId string `json:"domain_id"` + ProjectId string `json:"project_id"` + OwnerId string `json:"owner_id"` + RegionId string `json:"region_id"` + ServiceId string `json:"service_id"` + Resource string `json:"resource"` + Count int `json:"count"` +} + // SService is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SService. type SService struct { apis.SStandaloneResourceBase @@ -222,6 +292,13 @@ type SUser struct { EnableMfa *bool `json:"enable_mfa,omitempty"` } +// SUserOption is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SUserOption. +type SUserOption struct { + UserId string `json:"user_id"` + OptionId string `json:"option_id"` + OptionValue string `json:"option_value"` +} + // SUsergroupMembership is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SUsergroupMembership. type SUsergroupMembership struct { apis.SResourceBase diff --git a/pkg/apis/image/zz_generated.model.go b/pkg/apis/image/zz_generated.model.go index 386a5237c2..6c8b5ab717 100644 --- a/pkg/apis/image/zz_generated.model.go +++ b/pkg/apis/image/zz_generated.model.go @@ -62,9 +62,44 @@ type SImage struct { OssChecksum string `json:"oss_checksum"` } +// SImageMember is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageMember. +type SImageMember struct { + SImagePeripheral + Member string `json:"member"` + CanShare bool `json:"can_share"` +} + // SImagePeripheral is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImagePeripheral. type SImagePeripheral struct { apis.SResourceBase Id int `json:"id"` ImageId string `json:"image_id"` } + +// SImageProperty is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageProperty. +type SImageProperty struct { + SImagePeripheral + Name string `json:"name"` + Value string `json:"value"` +} + +// SImageSubformat is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageSubformat. +type SImageSubformat struct { + SImagePeripheral + Format string `json:"format"` + Size int64 `json:"size"` + Location string `json:"location"` + Checksum string `json:"checksum"` + FastHash string `json:"fast_hash"` + Status string `json:"status"` + TorrentSize int64 `json:"torrent_size"` + TorrentLocation string `json:"torrent_location"` + TorrentChecksum string `json:"torrent_checksum"` + TorrentStatus string `json:"torrent_status"` +} + +// SImageTag is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageTag. +type SImageTag struct { + SImagePeripheral + Value string `json:"value"` +} diff --git a/pkg/apis/monitor/zz_generated.model.go b/pkg/apis/monitor/zz_generated.model.go index 056943ec73..d428ddadf0 100644 --- a/pkg/apis/monitor/zz_generated.model.go +++ b/pkg/apis/monitor/zz_generated.model.go @@ -25,7 +25,7 @@ type SAlert struct { // db.SVirtualResourceBase apis.SEnabledResourceBase apis.SStatusStandaloneResourceBase - apis.SScopedResourceBase + SMonitorScopedResource // Frequency is evaluate period Frequency int64 `json:"frequency"` Settings interface{} `json:"settings"` @@ -69,7 +69,7 @@ type SAlertRecord struct { // db.SVirtualResourceBase apis.SEnabledResourceBase apis.SStatusStandaloneResourceBase - apis.SScopedResourceBase + SMonitorScopedResource AlertId string `json:"alert_id"` Level string `json:"level"` State string `json:"state"` @@ -77,6 +77,27 @@ type SAlertRecord struct { AlertRule interface{} `json:"alert_rule"` } +// SAlertResource is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertResource. +type SAlertResource struct { + apis.SStandaloneResourceBase + Type string `json:"type"` +} + +// SAlertResourceAlert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertResourceAlert. +type SAlertResourceAlert struct { + SAlertResourceJointsBase + AlertId string `json:"alert_id"` + AlertRecordId string `json:"alert_record_id"` + TriggerTime time.Time `json:"trigger_time"` + Data interface{} `json:"data"` +} + +// SAlertResourceJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertResourceJointsBase. +type SAlertResourceJointsBase struct { + apis.SJointResourceBase + AlertResourceId string `json:"alert_resource_id"` +} + // SAlertnotification is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertnotification. type SAlertnotification struct { SAlertJointsBase @@ -87,6 +108,11 @@ type SAlertnotification struct { Params interface{} `json:"params"` } +// SCommonAlert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SCommonAlert. +type SCommonAlert struct { + SAlert +} + // SDataSource is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SDataSource. type SDataSource struct { apis.SStandaloneResourceBase @@ -98,6 +124,11 @@ type SDataSource struct { IsDefault *bool `json:"is_default,omitempty"` } +// SMeterAlert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SMeterAlert. +type SMeterAlert struct { + SV1Alert +} + // SMetric is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SMetric. type SMetric struct { apis.SVirtualJointResourceBase @@ -127,6 +158,16 @@ type SMetricMeasurement struct { DisplayName string `json:"display_name"` } +// SMonitorScopedResource is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SMonitorScopedResource. +type SMonitorScopedResource struct { + apis.SScopedResourceBase +} + +// SNodeAlert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SNodeAlert. +type SNodeAlert struct { + SV1Alert +} + // SNotification is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SNotification. type SNotification struct { apis.SVirtualResourceBase @@ -177,7 +218,7 @@ type SSuggestSysRule struct { // SSuggestSysRuleConfig is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SSuggestSysRuleConfig. type SSuggestSysRuleConfig struct { apis.SStandaloneResourceBase - apis.SScopedResourceBase + SMonitorScopedResource // RuleId is SSuggestSysRule model object id // RuleId string `width:"36" charset:"ascii" nullable:"true" list:"user" create:"optional"` // Type is suggestsysrules driver type @@ -189,3 +230,8 @@ type SSuggestSysRuleConfig struct { // IgnoreAlert means whether or not show SSuggestSysAlert results for current scope IgnoreAlert bool `json:"ignore_alert"` } + +// SV1Alert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SV1Alert. +type SV1Alert struct { + SAlert +} diff --git a/pkg/apis/notify/zz_generated.model.go b/pkg/apis/notify/zz_generated.model.go index b73fd95f79..6462a6d954 100644 --- a/pkg/apis/notify/zz_generated.model.go +++ b/pkg/apis/notify/zz_generated.model.go @@ -79,6 +79,7 @@ type SSubContact struct { ParentContactType string `json:"parent_contact_type"` Enabled *bool `json:"enabled,omitempty"` Verified *bool `json:"verified,omitempty"` + VerifiedNote string `json:"verified_note"` } // STemplate is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.STemplate. diff --git a/pkg/apis/yunionconf/input.go b/pkg/apis/yunionconf/input.go index b8c6b55937..95cb7f2508 100644 --- a/pkg/apis/yunionconf/input.go +++ b/pkg/apis/yunionconf/input.go @@ -72,6 +72,8 @@ type ScopedPolicyDetails struct { apis.InfrasResourceBaseDetails RefCount int `json:"ref_count"` + + SScopedPolicy } type ScopedPolicyBindingListInput struct { @@ -100,6 +102,8 @@ type ScopedPolicyBindingDetails struct { ProjectDomain string `json:"project_domain"` Project string `json:"project"` + + SScopedPolicyBinding } type ScopedPolicyBindInput struct { diff --git a/pkg/apis/yunionconf/zz_generated.model.go b/pkg/apis/yunionconf/zz_generated.model.go new file mode 100644 index 0000000000..d06f306b7f --- /dev/null +++ b/pkg/apis/yunionconf/zz_generated.model.go @@ -0,0 +1,56 @@ +// 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. + +// Code generated by model-api-gen. DO NOT EDIT. + +package yunionconf + +import ( + "yunion.io/x/onecloud/pkg/apis" +) + +// SParameter is an autogenerated struct via yunion.io/x/onecloud/pkg/yunionconf/models.SParameter. +type SParameter struct { + apis.SResourceBase + Id int64 `json:"id"` + // = Column(BigInteger, primary_key=True) + CreatedBy string `json:"created_by"` + // Column(VARCHAR(length=128, charset='ascii'), nullable=False) + UpdatedBy string `json:"updated_by"` + // Column(VARCHAR(length=128, charset='ascii'), nullable=False) "user"/ serviceName/ "admin" + Namespace string `json:"namespace"` + // Column(VARCHAR(length=128, charset='ascii'), nullable=False) user_id / serviceid + NamespaceId string `json:"namespace_id"` + // Column(VARCHAR(length=128, charset='ascii'), nullable=False) + Name string `json:"name"` + // Column(VARCHAR(length=128, charset='ascii'), nullable=false) + Value interface{} `json:"value"` +} + +// SScopedPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/yunionconf/models.SScopedPolicy. +type SScopedPolicy struct { + apis.SInfrasResourceBase + // 策略类别 + Category string `json:"category"` + // 策略内容 + Policies interface{} `json:"policies"` +} + +// SScopedPolicyBinding is an autogenerated struct via yunion.io/x/onecloud/pkg/yunionconf/models.SScopedPolicyBinding. +type SScopedPolicyBinding struct { + apis.SResourceBase + Category string `json:"category"` + DomainId string `json:"domain_id"` + ProjectId string `json:"project_id"` + PolicyId string `json:"policy_id"` + Priority int `json:"priority"` +} diff --git a/pkg/apis/zz_generated.model.go b/pkg/apis/zz_generated.model.go index 92b871b62b..a6e7aaefe0 100644 --- a/pkg/apis/zz_generated.model.go +++ b/pkg/apis/zz_generated.model.go @@ -99,9 +99,51 @@ type SJointResourceBase struct { // SKeystoneCacheObject is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SKeystoneCacheObject. type SKeystoneCacheObject struct { SStandaloneResourceBase - DomainId string `json:"domain_id"` - Domain string `json:"domain"` - LastCheck time.Time `json:"last_check"` + DomainId string `json:"domain_id"` + Domain string `json:"domain"` +} + +// SMetadata is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SMetadata. +type SMetadata struct { + // 资源类型 + // example: network + ObjType string `json:"obj_type"` + // 资源ID + // example: 87321a70-1ecb-422a-8b0c-c9aa632a46a7 + ObjId string `json:"obj_id"` + // 资源组合ID + // example: network::87321a70-1ecb-422a-8b0c-c9aa632a46a7 + Id string `json:"id"` + // 标签KEY + // exmaple: 部门 + Key string `json:"key"` + // 标签值 + // example: 技术部 + Value string `json:"value"` + // 是否被删除 + Deleted bool `json:"deleted"` +} + +// SOpsLog is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SOpsLog. +type SOpsLog struct { + Id int64 `json:"id"` + ObjType string `json:"obj_type"` + ObjId string `json:"obj_id"` + ObjName string `json:"obj_name"` + Action string `json:"action"` + Notes string `json:"notes"` + ProjectId string `json:"tenant_id"` + Project string `json:"tenant"` + ProjectDomainId string `json:"project_domain_id"` + ProjectDomain string `json:"project_domain"` + UserId string `json:"user_id"` + User string `json:"user"` + DomainId string `json:"domain_id"` + Domain string `json:"domain"` + Roles string `json:"roles"` + OpsTime time.Time `json:"ops_time"` + OwnerDomainId string `json:"owner_domain_id"` + OwnerProjectId string `json:"owner_tenant_id"` } // SProjectizedResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SProjectizedResourceBase. @@ -203,6 +245,16 @@ type SStatusStandaloneResourceBase struct { SStatusResourceBase } +// STenant is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.STenant. +type STenant struct { + SKeystoneCacheObject +} + +// SUser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SUser. +type SUser struct { + SKeystoneCacheObject +} + // SUserResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SUserResourceBase. type SUserResourceBase struct { SStandaloneResourceBase diff --git a/scripts/codegen.py b/scripts/codegen.py index bbf849f1f9..bf8eff2562 100755 --- a/scripts/codegen.py +++ b/scripts/codegen.py @@ -138,6 +138,10 @@ class ModelAPI(FuncDispatcher): def gen_monitor(self): self.run(pkg=["monitor", "models"], out=["monitor"]) + def gen_yunionconf(self): + self.run(pkg=["yunionconf", "models"], out=["yunionconf"]) + + class SwaggerCode(FuncDispatcher): def __init__(self, pkg_dir, pkg_swagger): @@ -177,6 +181,9 @@ class SwaggerCode(FuncDispatcher): def gen_monitor(self): self.run("monitor", pkg=["models"], out="monitor") + def gen_yunionconf(self): + self.run("yunionconf", pkg=["models"], out="yunionconf") + def gen_notify(self): self.run("notify", pkg=["models"], out="notify") @@ -209,6 +216,9 @@ class SwaggerYAML(FuncDispatcher): def gen_monitor(self): self.run("monitor") + def gen_yunionconf(self): + self.run("yunionconf") + def gen_notify(self): self.run("notify")