From fa5d5a6eb99e1dfc736b4c69e8493e3fd52bf4a5 Mon Sep 17 00:00:00 2001 From: Qu Xuan Date: Wed, 30 Jun 2021 19:49:44 +0800 Subject: [PATCH] fix(region): update swagger api --- pkg/apis/cloudevent/zz_generated.model.go | 30 +- pkg/apis/cloudid/zz_generated.model.go | 8 +- pkg/apis/cloudprovider/zz_generated.model.go | 83 ++++ pkg/apis/compute/waf_instance.go | 8 +- pkg/apis/compute/waf_ipsets.go | 6 +- pkg/apis/compute/waf_regexsets.go | 6 +- pkg/apis/compute/waf_rule_groups.go | 2 + pkg/apis/compute/waf_rules.go | 1 + pkg/apis/compute/zz_generated.model.go | 453 ++++++++++++++++-- pkg/apis/identity/zz_generated.model.go | 68 +-- pkg/apis/monitor/zz_generated.model.go | 106 ++-- pkg/apis/notify/event.go | 22 +- pkg/apis/notify/zz_generated.model.go | 45 +- pkg/apis/yunionconf/zz_generated.model.go | 6 +- pkg/cloudcommon/db/adminsharablevirtual.go | 9 - pkg/cloudcommon/db/caller.go | 14 - pkg/cloudcommon/db/domainresource.go | 9 - .../db/enabledstatusdomainresource.go | 9 - .../db/enabledstatusinfrasresource.go | 9 - pkg/cloudcommon/db/enabledstatusstandalone.go | 9 - pkg/cloudcommon/db/infraresource.go | 4 - pkg/cloudcommon/db/interface.go | 2 - pkg/cloudcommon/db/jointbase.go | 9 - pkg/cloudcommon/db/modelbase.go | 4 - pkg/cloudcommon/db/models.go | 17 - pkg/cloudcommon/db/resourcebase.go | 4 - pkg/cloudcommon/db/sharablevirtual.go | 4 - pkg/cloudcommon/db/standalone.go | 4 - pkg/cloudcommon/db/standalone_anon.go | 4 - pkg/cloudcommon/db/statusdomainresource.go | 9 - pkg/cloudcommon/db/statusinfrasresource.go | 9 - .../db/statusinfrasuserresource.go | 9 - pkg/cloudcommon/db/statusstandalone.go | 9 - pkg/cloudcommon/db/virtualjointbase.go | 9 - pkg/cloudcommon/db/virtualresource.go | 4 - pkg/cloudevent/models/cloudevents.go | 9 - pkg/cloudid/models/cloudgroup.go | 9 - pkg/cloudid/models/cloudgroup_policies.go | 9 - pkg/cloudid/models/cloudgroup_users.go | 9 - pkg/cloudid/models/cloudgroupcaches.go | 9 - pkg/cloudid/models/cloudgroupjoints.go | 9 - pkg/cloudid/models/cloudpolicy.go | 9 - pkg/cloudid/models/cloudpolicycaches.go | 9 - pkg/cloudid/models/cloudrole.go | 9 - pkg/cloudid/models/clouduser.go | 9 - pkg/cloudid/models/clouduser_policies.go | 9 - pkg/cloudid/models/clouduserjoints.go | 9 - pkg/cloudprovider/waf.go | 4 + pkg/compute/models/baremetalagents.go | 4 - pkg/compute/models/billingresource.go | 8 - pkg/compute/models/buckets.go | 4 - pkg/compute/models/cachedimages.go | 4 - pkg/compute/models/cloudaccounts.go | 4 - pkg/compute/models/cloudprovider_quotas.go | 9 - pkg/compute/models/cloudproviderregions.go | 4 - pkg/compute/models/cloudproviders.go | 10 - pkg/compute/models/cloudproviderschedtags.go | 10 - pkg/compute/models/cloudregionresource.go | 9 - pkg/compute/models/cloudregions.go | 4 - pkg/compute/models/dbinstance_accounts.go | 4 - pkg/compute/models/dbinstance_backups.go | 9 - pkg/compute/models/dbinstance_databases.go | 4 - pkg/compute/models/dbinstance_parameters.go | 4 - pkg/compute/models/dbinstance_secgroups.go | 9 - pkg/compute/models/dbinstance_skus.go | 4 - pkg/compute/models/dbinstanceresource.go | 8 - pkg/compute/models/dbinstances.go | 9 - pkg/compute/models/diskresource.go | 4 - pkg/compute/models/disks.go | 4 - pkg/compute/models/dns_recordsets.go | 9 - pkg/compute/models/dns_trafficpolicy.go | 9 - pkg/compute/models/dns_zonecaches.go | 9 - pkg/compute/models/dns_zones.go | 9 - pkg/compute/models/dnsrecords.go | 4 - pkg/compute/models/dynamicschedtags.go | 9 - pkg/compute/models/elasticcache_accounts.go | 9 - pkg/compute/models/elasticcache_acls.go | 9 - pkg/compute/models/elasticcache_backups.go | 9 - pkg/compute/models/elasticcache_instances.go | 4 - pkg/compute/models/elasticcache_joints.go | 9 - pkg/compute/models/elasticcache_parameters.go | 9 - pkg/compute/models/elasticcache_secgroups.go | 9 - pkg/compute/models/elasticcache_skus.go | 4 - pkg/compute/models/elasticcacheresource.go | 8 - pkg/compute/models/elasticips.go | 9 - pkg/compute/models/external_projects.go | 9 - pkg/compute/models/globalvpcresource.go | 4 - pkg/compute/models/globalvpcs.go | 4 - pkg/compute/models/groupguests.go | 9 - pkg/compute/models/groupjoints.go | 9 - pkg/compute/models/groupnetworks.go | 9 - pkg/compute/models/groupresource.go | 4 - pkg/compute/models/groups.go | 9 - pkg/compute/models/guest_template.go | 9 - pkg/compute/models/guestdisks.go | 9 - pkg/compute/models/guestjoints.go | 9 - pkg/compute/models/guestnetworks.go | 9 - pkg/compute/models/guestresource.go | 4 - pkg/compute/models/guests.go | 4 - pkg/compute/models/guestsecgroups.go | 9 - pkg/compute/models/hostjoints.go | 9 - pkg/compute/models/hostnetworks.go | 9 - pkg/compute/models/hostresource.go | 4 - pkg/compute/models/hosts.go | 4 - pkg/compute/models/hostschedtags.go | 10 - pkg/compute/models/hoststorages.go | 9 - pkg/compute/models/hostwires.go | 4 - pkg/compute/models/instance_snapshots.go | 4 - pkg/compute/models/inter_vpc_network.go | 9 - .../models/inter_vpc_network_routeset.go | 9 - pkg/compute/models/isolated_devices.go | 4 - pkg/compute/models/keypairs.go | 9 - pkg/compute/models/loadbalanceraclresource.go | 9 - pkg/compute/models/loadbalanceracls.go | 9 - pkg/compute/models/loadbalanceragents.go | 9 - .../loadbalancerbackendgroupresource.go | 8 - .../models/loadbalancerbackendgroups.go | 9 - pkg/compute/models/loadbalancerbackends.go | 9 - pkg/compute/models/loadbalancercachedacls.go | 9 - .../models/loadbalancercachedcertificates.go | 9 - .../models/loadbalancercertificateresource.go | 9 - .../models/loadbalancercertificates.go | 9 - .../models/loadbalancerclusterresource.go | 9 - pkg/compute/models/loadbalancerclusters.go | 9 - .../models/loadbalancerlistenerresource.go | 9 - .../models/loadbalancerlistenerrules.go | 9 - pkg/compute/models/loadbalancerlisteners.go | 9 - pkg/compute/models/loadbalancernetworks.go | 9 - pkg/compute/models/loadbalancerresource.go | 4 - pkg/compute/models/loadbalancers.go | 9 - pkg/compute/models/managedresource.go | 4 - pkg/compute/models/natdtable.go | 9 - pkg/compute/models/natgatewayresource.go | 4 - pkg/compute/models/natgateways.go | 13 - pkg/compute/models/natstable.go | 4 - pkg/compute/models/networkinterfaces.go | 9 - pkg/compute/models/networkresource.go | 4 - pkg/compute/models/networks.go | 9 - pkg/compute/models/networkschedtags.go | 10 - pkg/compute/models/policy_definition.go | 4 - pkg/compute/models/reservedips.go | 4 - pkg/compute/models/routetables.go | 4 - pkg/compute/models/scaling_activity.go | 5 - pkg/compute/models/scaling_group.go | 5 - pkg/compute/models/scaling_policy.go | 5 - pkg/compute/models/schedpolicies.go | 4 - pkg/compute/models/schedtagjoint.go | 10 - pkg/compute/models/schedtagresource.go | 9 - pkg/compute/models/schedtags.go | 9 - pkg/compute/models/scheduled_tasks.go | 5 - pkg/compute/models/scheduledtask_activity.go | 4 - pkg/compute/models/secgroupcache.go | 9 - pkg/compute/models/secgroupresource.go | 9 - pkg/compute/models/secgrouprules.go | 9 - pkg/compute/models/secgroups.go | 9 - pkg/compute/models/service_catalog.go | 9 - pkg/compute/models/skus.go | 4 - pkg/compute/models/snapshotpolicy.go | 9 - pkg/compute/models/snapshotpolicycache.go | 9 - pkg/compute/models/snapshotpolicydisks.go | 12 +- pkg/compute/models/snapshotpolicyresource.go | 9 - pkg/compute/models/snapshots.go | 9 - pkg/compute/models/storagecachedimages.go | 9 - pkg/compute/models/storagecaches.go | 9 - pkg/compute/models/storageresource.go | 4 - pkg/compute/models/storages.go | 4 - pkg/compute/models/storageschedtags.go | 10 - pkg/compute/models/vpc_peering_connections.go | 9 - pkg/compute/models/vpcresource.go | 4 - pkg/compute/models/vpcs.go | 9 - pkg/compute/models/wireresource.go | 4 - pkg/compute/models/wires.go | 4 - pkg/compute/models/zoneresource.go | 4 - pkg/compute/models/zones.go | 4 - pkg/compute/models/zoneschedtags.go | 10 - pkg/image/models/image_guest.go | 9 - pkg/image/models/images.go | 9 - pkg/keystone/models/credentials.go | 9 - pkg/keystone/models/domains.go | 9 - pkg/keystone/models/endpoints.go | 13 - pkg/keystone/models/groups.go | 9 - pkg/keystone/models/identity_provider.go | 9 - pkg/keystone/models/identitybase.go | 18 - pkg/keystone/models/policies.go | 9 - pkg/keystone/models/projects.go | 9 - pkg/keystone/models/regions.go | 4 - pkg/keystone/models/rolepolicies.go | 9 - pkg/keystone/models/roles.go | 9 - pkg/keystone/models/services.go | 9 - pkg/keystone/models/users.go | 9 - pkg/monitor/models/alert.go | 9 - pkg/monitor/models/alertnotification.go | 9 - pkg/monitor/models/nodealert.go | 18 - pkg/notify/interface.go | 2 +- pkg/notify/models/config.go | 4 - pkg/notify/models/event_template.go | 4 +- pkg/notify/models/notification.go | 9 - pkg/notify/models/receiver.go | 9 - pkg/notify/models/template.go | 4 - pkg/notify/models/topic.go | 4 +- pkg/yunionconf/models/scopedpolicies.go | 4 - pkg/yunionconf/models/scopedpolicybindings.go | 4 - 202 files changed, 682 insertions(+), 1579 deletions(-) diff --git a/pkg/apis/cloudevent/zz_generated.model.go b/pkg/apis/cloudevent/zz_generated.model.go index 29b72181e7..799fbbfb49 100644 --- a/pkg/apis/cloudevent/zz_generated.model.go +++ b/pkg/apis/cloudevent/zz_generated.model.go @@ -17,26 +17,28 @@ package cloudevent import ( time "time" + jsonutils "yunion.io/x/jsonutils" + "yunion.io/x/onecloud/pkg/apis" ) // SCloudevent is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudevent/models.SCloudevent. type SCloudevent struct { apis.SDomainizedResourceBase - EventId int64 `json:"event_id"` - Name string `json:"name"` - Service string `json:"service"` - ResourceType string `json:"resource_type"` - Action string `json:"action"` - RequestId string `json:"request_id"` - Request interface{} `json:"request"` - Account string `json:"account"` - Success bool `json:"success"` - CreatedAt time.Time `json:"created_at"` - CloudproviderId string `json:"cloudprovider_id"` - Manager string `json:"manager"` - Provider string `json:"provider"` - Brand string `json:"brand"` + EventId int64 `json:"event_id"` + Name string `json:"name"` + Service string `json:"service"` + ResourceType string `json:"resource_type"` + Action string `json:"action"` + RequestId string `json:"request_id"` + Request jsonutils.JSONObject `json:"request"` + Account string `json:"account"` + Success bool `json:"success"` + CreatedAt time.Time `json:"created_at"` + CloudproviderId string `json:"cloudprovider_id"` + Manager string `json:"manager"` + Provider string `json:"provider"` + Brand string `json:"brand"` } // SCloudprovider is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudevent/models.SCloudprovider. diff --git a/pkg/apis/cloudid/zz_generated.model.go b/pkg/apis/cloudid/zz_generated.model.go index 7d7c120a35..ab86b7d140 100644 --- a/pkg/apis/cloudid/zz_generated.model.go +++ b/pkg/apis/cloudid/zz_generated.model.go @@ -15,6 +15,8 @@ package cloudid import ( + jsonutils "yunion.io/x/jsonutils" + "yunion.io/x/onecloud/pkg/apis" ) @@ -100,7 +102,7 @@ type SCloudpolicy struct { // | 腾讯云 | 支持 | Provider string `json:"provider"` // 策略内容 - Document interface{} `json:"document"` + Document *jsonutils.JSONDict `json:"document"` // 是否锁定, 若锁定后, 此策略不允许被绑定到用户或权限组, 仅管理员可以设置是否锁定 Locked *bool `json:"locked,omitempty"` CloudEnv string `json:"cloud_env"` @@ -142,8 +144,8 @@ type SCloudrole struct { SCloudaccountResourceBase SAMLProviderResourceBase SCloudgroupResourceBase - Document interface{} `json:"document"` - OwnerId string `json:"owner_id"` + Document *jsonutils.JSONDict `json:"document"` + OwnerId string `json:"owner_id"` } // SClouduser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SClouduser. diff --git a/pkg/apis/cloudprovider/zz_generated.model.go b/pkg/apis/cloudprovider/zz_generated.model.go index 882a099b28..eeaf89b450 100644 --- a/pkg/apis/cloudprovider/zz_generated.model.go +++ b/pkg/apis/cloudprovider/zz_generated.model.go @@ -14,6 +14,28 @@ package cloudprovider +// DefaultAction is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.DefaultAction. +type DefaultAction struct { + // Allow, Block, Log, Count, Alert, Detection, Prevention + Action string `json:"action"` + // 仅Action为Allow时生效 + InsertHeaders map[string]string `json:"insert_headers"` + // 仅Action为Block时生效 + Response string `json:"response"` + // 仅Action为Block时生效 + ResponseCode *int `json:"response_code"` + // 仅Action为Block时生效 + ResponseHeaders map[string]string `json:"response_headers"` +} + +// SExcludeRule is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.SExcludeRule. +type SExcludeRule struct { + Name string `json:"name"` +} + +// SExcludeRules is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.SExcludeRules. +type SExcludeRules []SExcludeRule + // SGeographicInfo is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.SGeographicInfo. type SGeographicInfo struct { // 纬度 @@ -29,3 +51,64 @@ type SGeographicInfo struct { // example: CN CountryCode string `json:"country_code"` } + +// SWafStatement is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.SWafStatement. +type SWafStatement struct { + // 管理规则组名称 + ManagedRuleGroupName string `json:"managed_rule_group_name"` + // 不包含的规则列表 + ExcludeRules *SExcludeRules `json:"exclude_rules"` + // 表达式类别 + // enmu: ByteMatch, GeoMatch, IPSet, LabelMatch, ManagedRuleGroup, Rate, RegexSet, RuleGroup, Size, SqliMatch, XssMatch + Type string `json:"type"` + // 是否取反操作, 仅对Azure生效 + Negation bool `json:"negation"` + // 操作类型 + // enum: EQ, NE, LE, LT, GE, GT + Operator string `json:"operator"` + // 匹配字段 + // enmu: Body, JsonBody, Query, Method, Header, UriPath, PostArgs, Cookie + MatchField string `json:"match_field"` + // 匹配字段的key + MatchFieldKey string `json:"match_field_key"` + // 匹配字段的值列表 + MatchFieldValues *TWafMatchFieldValues `json:"match_field_values"` + // 进行转换操作 + // enmu: CompressWithSpace, HtmlEntityDecode, Lowercase, CmdLine, UrlDecode, Trim, UrlEncode, RemoveNulls + Transformations *TextTransformations `json:"transformations"` + ForwardedIPHeader string `json:"forwarded_ip_header"` + // 搜索字段, 仅Aws有用 + SearchString string `json:"search_string"` + IPSetId string `json:"ip_set_id"` + // 正则表达式Id, 目前只读 + RegexSetId string `json:"regex_set_id"` + // 自定义规则组Id, 目前只读 + RuleGroupId string `json:"rule_group_id"` +} + +// TWafAction is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.TWafAction. +type TWafAction string + +// TWafMatchField is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.TWafMatchField. +type TWafMatchField string + +// TWafMatchFieldValues is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.TWafMatchFieldValues. +type TWafMatchFieldValues []string + +// TWafOperator is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.TWafOperator. +type TWafOperator string + +// TWafStatementType is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.TWafStatementType. +type TWafStatementType string + +// TWafTextTransformation is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.TWafTextTransformation. +type TWafTextTransformation string + +// TextTransformations is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.TextTransformations. +type TextTransformations []TWafTextTransformation + +// WafAddresses is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.WafAddresses. +type WafAddresses []string + +// WafRegexPatterns is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.WafRegexPatterns. +type WafRegexPatterns []string diff --git a/pkg/apis/compute/waf_instance.go b/pkg/apis/compute/waf_instance.go index f73ad0ad28..f501adfb19 100644 --- a/pkg/apis/compute/waf_instance.go +++ b/pkg/apis/compute/waf_instance.go @@ -57,17 +57,11 @@ type WafInstanceDetails struct { apis.EnabledStatusInfrasResourceBaseDetails ManagedResourceInfo CloudregionResourceInfo + SWafInstance Rules []SWafRule } -type SWafRule struct { - Id string - Name string - Priority int - Action *cloudprovider.DefaultAction -} - type WafInstanceListInput struct { apis.EnabledStatusInfrasResourceBaseListInput apis.ExternalizedResourceBaseListInput diff --git a/pkg/apis/compute/waf_ipsets.go b/pkg/apis/compute/waf_ipsets.go index 160e1e6322..50f2c40ac8 100644 --- a/pkg/apis/compute/waf_ipsets.go +++ b/pkg/apis/compute/waf_ipsets.go @@ -14,7 +14,9 @@ package compute -import "yunion.io/x/onecloud/pkg/apis" +import ( + "yunion.io/x/onecloud/pkg/apis" +) const ( WAF_IPSET_STATUS_AVAILABLE = "available" @@ -24,6 +26,7 @@ const ( type WafIPSetDetails struct { apis.StatusInfrasResourceBaseDetails + SWafIPSet } type WafIPSetListInput struct { @@ -34,6 +37,7 @@ type WafIPSetCacheDetails struct { apis.StatusStandaloneResourceDetails ManagedResourceInfo CloudregionResourceInfo + SWafIPSetCache } type WafIPSetCacheListInput struct { diff --git a/pkg/apis/compute/waf_regexsets.go b/pkg/apis/compute/waf_regexsets.go index d6fbcfd5d7..2174dbfb6a 100644 --- a/pkg/apis/compute/waf_regexsets.go +++ b/pkg/apis/compute/waf_regexsets.go @@ -14,7 +14,9 @@ package compute -import "yunion.io/x/onecloud/pkg/apis" +import ( + "yunion.io/x/onecloud/pkg/apis" +) const ( WAF_REGEX_SET_STATUS_AVAILABLE = "available" @@ -24,6 +26,7 @@ const ( type WafRegexSetDetails struct { apis.StatusInfrasResourceBaseDetails + SWafRegexSet } type WafRegexSetListInput struct { @@ -34,6 +37,7 @@ type WafRegexSetCacheDetails struct { apis.StatusStandaloneResourceDetails ManagedResourceInfo CloudregionResourceInfo + SWafRegexSetCache } type WafRegexSetCacheListInput struct { diff --git a/pkg/apis/compute/waf_rule_groups.go b/pkg/apis/compute/waf_rule_groups.go index f721bd1f5b..d31babfda1 100644 --- a/pkg/apis/compute/waf_rule_groups.go +++ b/pkg/apis/compute/waf_rule_groups.go @@ -23,6 +23,7 @@ const ( type WafRuleGroupDetails struct { apis.StatusInfrasResourceBaseDetails + SWafRuleGroup } type WafRuleGroupListInput struct { @@ -40,6 +41,7 @@ type WafRuleGroupCacheDetails struct { apis.StatusStandaloneResourceDetails ManagedResourceInfo CloudregionResourceInfo + SWafRuleGroupCache } type WafRuleGroupCacheListInput struct { diff --git a/pkg/apis/compute/waf_rules.go b/pkg/apis/compute/waf_rules.go index 220294f031..0a69d1e203 100644 --- a/pkg/apis/compute/waf_rules.go +++ b/pkg/apis/compute/waf_rules.go @@ -65,6 +65,7 @@ type WafRuleCreateInput struct { type WafRuleDetails struct { apis.StatusStandaloneResourceDetails + SWafRule Statements []cloudprovider.SWafStatement } diff --git a/pkg/apis/compute/zz_generated.model.go b/pkg/apis/compute/zz_generated.model.go index e1489139de..3d403afb63 100644 --- a/pkg/apis/compute/zz_generated.model.go +++ b/pkg/apis/compute/zz_generated.model.go @@ -17,10 +17,49 @@ package compute import ( time "time" + jsonutils "yunion.io/x/jsonutils" + "yunion.io/x/onecloud/pkg/apis" "yunion.io/x/onecloud/pkg/apis/cloudprovider" ) +// SAccessGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SAccessGroup. +type SAccessGroup struct { + apis.SStatusInfrasResourceBase + IsDirty bool `json:"is_dirty"` +} + +// SAccessGroupCache is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SAccessGroupCache. +type SAccessGroupCache struct { + apis.SStatusStandaloneResourceBase + apis.SExternalizedResourceBase + SCloudregionResourceBase + SManagedResourceBase + SAccessGroupResourceBase + // 已关联的挂载点数量 + MountTargetCount int `json:"mount_target_count"` + FileSystemType string `json:"file_system_type"` + NetworkType string `json:"network_type"` +} + +// SAccessGroupResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SAccessGroupResourceBase. +type SAccessGroupResourceBase struct { + // 权限组Id + AccessGroupId string `json:"access_group_id"` +} + +// SAccessGroupRule is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SAccessGroupRule. +type SAccessGroupRule struct { + apis.SResourceBase + SAccessGroupResourceBase + Id string `json:"id"` + Priority int `json:"priority"` + Source string `json:"source"` + RWAccessType string `json:"rw_access_type"` + UserAccessType string `json:"user_access_type"` + Description string `json:"description"` +} + // SAwsCachedLb is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SAwsCachedLb. type SAwsCachedLb struct { apis.SVirtualResourceBase @@ -78,20 +117,28 @@ type SBillingResourceBase struct { AutoRenew bool `json:"auto_renew"` } +// SBillingResourceCheck is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SBillingResourceCheck. +type SBillingResourceCheck struct { + apis.SResourceBase + ResourceId string `json:"resource_id"` + ResourceType string `json:"resource_type"` + AdvanceDays int `json:"advance_days"` +} + // SBucket is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SBucket. type SBucket struct { apis.SSharableVirtualResourceBase apis.SExternalizedResourceBase SCloudregionResourceBase SManagedResourceBase - StorageClass string `json:"storage_class"` - Location string `json:"location"` - Acl string `json:"acl"` - SizeBytes int64 `json:"size_bytes"` - ObjectCnt int `json:"object_cnt"` - SizeBytesLimit int64 `json:"size_bytes_limit"` - ObjectCntLimit int `json:"object_cnt_limit"` - AccessUrls interface{} `json:"access_urls"` + StorageClass string `json:"storage_class"` + Location string `json:"location"` + Acl string `json:"acl"` + SizeBytes int64 `json:"size_bytes"` + ObjectCnt int `json:"object_cnt"` + SizeBytesLimit int64 `json:"size_bytes_limit"` + ObjectCntLimit int `json:"object_cnt_limit"` + AccessUrls jsonutils.JSONObject `json:"access_urls"` } // SCachedLoadbalancerAcl is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCachedLoadbalancerAcl. @@ -123,7 +170,7 @@ type SCachedimage struct { 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"` + Info jsonutils.JSONObject `json:"info"` // 上此同步时间 // example: 2020-01-17T05:28:54.000000Z LastSync time.Time `json:"last_sync"` @@ -188,12 +235,12 @@ type SCloudaccount struct { // 云API版本 Version string `json:"version"` // 云系统信息 - Sysinfo interface{} `json:"sysinfo"` + Sysinfo jsonutils.JSONObject `json:"sysinfo"` // 品牌信息, 一般和provider相同 // example: DStack Brand string `json:"brand"` // 额外信息 - Options interface{} `json:"options"` + Options *jsonutils.JSONDict `json:"options"` // for backward compatiblity, keep is_public field, but not usable // IsPublic bool `default:"false" nullable:"false"` // add share_mode field to indicate the share range of this account @@ -203,6 +250,7 @@ type SCloudaccount struct { // 公有云子账号登录地址 IamLoginUrl string `json:"iam_login_url"` SAMLAuth *bool `json:"saml_auth,omitempty"` + SProjectMappingResourceBase } // SCloudimage is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudimage. @@ -236,6 +284,7 @@ type SCloudprovider struct { CloudaccountId string `json:"cloudaccount_id"` // 云账号的平台信息 Provider string `json:"provider"` + SProjectMappingResourceBase } // SCloudproviderCapability is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudproviderCapability. @@ -279,9 +328,9 @@ type SCloudproviderregion struct { 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"` - LastAutoSyncAt time.Time `json:"last_auto_sync_at"` + SyncResults jsonutils.JSONObject `json:"sync_results"` + LastDeepSyncAt time.Time `json:"last_deep_sync_at"` + LastAutoSyncAt time.Time `json:"last_auto_sync_at"` } // SCloudproviderschedtag is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudproviderschedtag. @@ -293,6 +342,7 @@ type SCloudproviderschedtag struct { // SCloudregion is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudregion. type SCloudregion struct { apis.SEnabledStatusStandaloneResourceBase + SI18nResourceBase SManagedResourceBase apis.SExternalizedResourceBase cloudprovider.SGeographicInfo @@ -504,6 +554,7 @@ type SDisk struct { SBillingResourceBase SStorageResourceBase apis.SMultiArchResourceBase + apis.SAutoDeleteResourceBase // 磁盘存储类型 // example: qcow2 DiskFormat string `json:"disk_format"` @@ -512,9 +563,6 @@ type SDisk struct { DiskSize int `json:"disk_size"` // 磁盘路径 AccessPath string `json:"access_path"` - // 是否跟随云主机自动删除, 仅绑定到云主机时才生效 - // example: false - AutoDelete bool `json:"auto_delete"` // 备份磁盘实例的存储ID BackupStorageId string `json:"backup_storage_id"` // 镜像Id @@ -569,18 +617,18 @@ type SDnsRecordSetTrafficPolicy struct { // SDnsTrafficPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDnsTrafficPolicy. type SDnsTrafficPolicy struct { apis.SEnabledStatusInfrasResourceBase - Provider string `json:"provider"` - PolicyType string `json:"policy_type"` - PolicyValue string `json:"policy_value"` - Options interface{} `json:"options"` + Provider string `json:"provider"` + PolicyType string `json:"policy_type"` + PolicyValue string `json:"policy_value"` + Options *jsonutils.JSONDict `json:"options"` } // SDnsZone is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDnsZone. type SDnsZone struct { apis.SEnabledStatusInfrasResourceBase - IsDirty bool `json:"is_dirty"` - ZoneType string `json:"zone_type"` - Options interface{} `json:"options"` + IsDirty bool `json:"is_dirty"` + ZoneType string `json:"zone_type"` + Options *jsonutils.JSONDict `json:"options"` } // SDnsZoneCache is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDnsZoneCache. @@ -615,6 +663,42 @@ type SDynamicschedtag struct { Enabled *bool `json:"enabled,omitempty"` } +// SElasticSearch is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SElasticSearch. +type SElasticSearch struct { + apis.SVirtualResourceBase + apis.SExternalizedResourceBase + SManagedResourceBase + SBillingResourceBase + SCloudregionResourceBase + SDeletePreventableResourceBase + // 版本 + Version string `json:"version"` + // 套餐名称 + // example: elasticsearch.sn2ne.xlarge + InstanceType string `json:"instance_type"` + // CPU数量 + // example: 1 + VcpuCount int `json:"vcpu_count"` + // 内存大小 + // example: 1024 + VmemSizeGb int `json:"vmem_size_gb"` + // 存储类型 + // example: local_ssd + StorageType string `json:"storage_type"` + // 存储大小 + // example: 1024 + DiskSizeGb int `json:"disk_size_gb"` + // 实例类型 + // example: ha + Category string `json:"category"` + VpcId string `json:"vpc_id"` + NetworkId string `json:"network_id"` + // 可用区Id + ZoneId string `json:"zone_id"` + // 是否是多可用区部署 + IsMultiAz bool `json:"is_multi_az"` +} + // SElasticcache is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SElasticcache. type SElasticcache struct { apis.SVirtualResourceBase @@ -839,6 +923,32 @@ type SExternalProject struct { CloudaccountId string `json:"cloudaccount_id"` } +// SFileSystem is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SFileSystem. +type SFileSystem struct { + apis.SStatusInfrasResourceBase + apis.SExternalizedResourceBase + SManagedResourceBase + SBillingResourceBase + SCloudregionResourceBase + SZoneResourceBase + SDeletePreventableResourceBase + // 文件系统类型 + // enmu: extreme, standard, cpfs + FileSystemType string `json:"file_system_type"` + // 存储类型 + // enmu: performance, capacity, standard, advance, advance_100, advance_200 + StorageType string `json:"storage_type"` + // 协议类型 + // enum: NFS, SMB, cpfs + Protocol string `json:"protocol"` + // 容量, 单位Gb + Capacity int64 `json:"capacity"` + // 已使用容量, 单位Gb + UsedCapacity int64 `json:"used_capacity"` + // 最多支持挂载点数量, -1代表无限制 + MountTargetCountLimit int `json:"mount_target_count_limit"` +} + // SGlobalVpc is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGlobalVpc. type SGlobalVpc struct { apis.SEnabledStatusInfrasResourceBase @@ -932,7 +1042,8 @@ type SGuest struct { // example: kvm Hypervisor string `json:"hypervisor"` // 套餐名称 - InstanceType string `json:"instance_type"` + InstanceType string `json:"instance_type"` + SshableLastState *bool `json:"sshable_last_state,omitempty"` } // SGuestJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestJointsBase. @@ -962,7 +1073,7 @@ type SGuestTemplate struct { // 计费方式 BillingType string `json:"billing_type"` // 其他配置信息 - Content interface{} `json:"content"` + Content jsonutils.JSONObject `json:"content"` } // SGuestTemplateResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestTemplateResourceBase. @@ -1054,7 +1165,7 @@ type SHost struct { // 管理地址 ManagerUri string `json:"manager_uri"` // 系统信息 - SysInfo interface{} `json:"sys_info"` + SysInfo jsonutils.JSONObject `json:"sys_info"` // 物理机序列号信息 SN string `json:"sn"` // CPU核数 @@ -1088,11 +1199,11 @@ type SHost struct { // 存储驱动类型 StorageDriver string `json:"storage_driver"` // 存储详情 - StorageInfo interface{} `json:"storage_info"` + StorageInfo jsonutils.JSONObject `json:"storage_info"` // IPMI地址 IpmiIp string `json:"ipmi_ip"` // IPMI详情 - IpmiInfo interface{} `json:"ipmi_info"` + IpmiInfo jsonutils.JSONObject `json:"ipmi_info"` // 宿主机状态 // example: online HostStatus string `json:"host_status"` @@ -1118,6 +1229,8 @@ type SHost struct { BootMode string `json:"boot_mode"` // IPv4地址,作为么有云vpc访问外网时的网关 OvnMappedIpAddr string `json:"ovn_mapped_ip_addr"` + // UEFI详情 + UefiInfo jsonutils.JSONObject `json:"uefi_info"` } // SHostJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHostJointsBase. @@ -1161,7 +1274,7 @@ type SHoststorage struct { // 是否是根分区 IsRootPartition bool `json:"is_root_partition"` // 配置信息 - Config interface{} `json:"config"` + Config *jsonutils.JSONArray `json:"config"` // 真实容量大小 RealCapacity int64 `json:"real_capacity"` } @@ -1210,6 +1323,10 @@ type SHuaweiCachedLbbg struct { ProtocolType string `json:"protocol_type"` } +// SI18nResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SI18nResourceBase. +type SI18nResourceBase struct { +} + // SInstanceSnapshot is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SInstanceSnapshot. type SInstanceSnapshot struct { apis.SVirtualResourceBase @@ -1220,15 +1337,15 @@ type SInstanceSnapshot struct { // 云主机Id GuestId string `json:"guest_id"` // 云主机配置 - ServerConfig interface{} `json:"server_config"` + ServerConfig jsonutils.JSONObject `json:"server_config"` // 云主机标签 - ServerMetadata interface{} `json:"server_metadata"` + ServerMetadata jsonutils.JSONObject `json:"server_metadata"` // 是否自动删除 AutoDelete bool `json:"auto_delete"` // 引用次数 RefCount int `json:"ref_count"` // 安全组 - SecGroups interface{} `json:"sec_groups"` + SecGroups jsonutils.JSONObject `json:"sec_groups"` // 秘钥Id KeypairId string `json:"keypair_id"` // 操作系统类型 @@ -1300,6 +1417,40 @@ type SIsolatedDevice struct { ReservedStorage int `json:"reserved_storage"` } +// SKafka is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SKafka. +type SKafka struct { + apis.SVirtualResourceBase + apis.SExternalizedResourceBase + SManagedResourceBase + SBillingResourceBase + SCloudregionResourceBase + SDeletePreventableResourceBase + // 版本 + Version string `json:"version"` + // 套餐名称 + // example: elasticsearch.sn2ne.xlarge + InstanceType string `json:"instance_type"` + // 存储类型 + // example: local_ssd + StorageType string `json:"storage_type"` + // 存储大小 + // example: 1024 + DiskSizeGb int `json:"disk_size_gb"` + // 带宽峰值 + // example: 1024 + BandwidthMb int `json:"bandwidth_mb"` + // 消息保留时长 + MsgRetentionMinute int `json:"msg_retention_minute"` + // 连接端点 + Endpoint string `json:"endpoint"` + VpcId string `json:"vpc_id"` + NetworkId string `json:"network_id"` + // 可用区Id + ZoneId string `json:"zone_id"` + // 是否是多可用区部署 + IsMultiAz bool `json:"is_multi_az"` +} + // SKeypair is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SKeypair. type SKeypair struct { apis.SUserResourceBase @@ -1345,7 +1496,7 @@ type SLoadbalancer struct { // 默认后端服务器组Id BackendGroupId string `json:"backend_group_id"` // LB的其他配置信息 - LBInfo interface{} `json:"lb_info"` + LBInfo jsonutils.JSONObject `json:"lb_info"` } // SLoadbalancerAcl is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerAcl. @@ -1647,6 +1798,85 @@ type SManagedResourceBase struct { ManagerId string `json:"manager_id"` } +// SMongoDB is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SMongoDB. +type SMongoDB struct { + apis.SVirtualResourceBase + apis.SExternalizedResourceBase + SManagedResourceBase + SBillingResourceBase + SCloudregionResourceBase + SZoneResourceBase + SDeletePreventableResourceBase + // CPU数量 + // example: 1 + VcpuCount int `json:"vcpu_count"` + // 内存大小 + // example: 1024 + VmemSizeMb int `json:"vmem_size_mb"` + // 存储大小, 单位Mb + // example: 10240 + DiskSizeMb int `json:"disk_size_mb"` + // 端口 + // example: 3306 + Port int `json:"port"` + // 实例类型 + // example: ha + Category string `json:"category"` + // 分片数量 + // example: 3 + ReplicationNum int `json:"replication_num"` + // 实例IP地址 + IpAddr string `json:"ip_addr"` + // 引擎 + // 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: ed20d84e-3158-41b1-870c-1725e412e8b6 + VpcId string `json:"vpc_id"` + // 所属网络ID + NetworkId string `json:"network_id"` +} + +// SMountTarget is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SMountTarget. +type SMountTarget struct { + apis.SStatusStandaloneResourceBase + apis.SExternalizedResourceBase + SVpcResourceBase + SNetworkResourceBase + SAccessGroupResourceBase + NetworkType string `json:"network_type"` + DomainName string `json:"domain_name"` + FileSystemId string `json:"file_system_id"` +} + +// SNasSku is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNasSku. +type SNasSku struct { + apis.SEnabledStatusStandaloneResourceBase + apis.SExternalizedResourceBase + SCloudregionResourceBase + PrepaidStatus string `json:"prepaid_status"` + // 预付费资源状态 available|soldout + PostpaidStatus string `json:"postpaid_status"` + 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"` + NetworkTypes string `json:"network_types"` + FileSystemType string `json:"file_system_type"` + Protocol string `json:"protocol"` + Provider string `json:"provider"` + ZoneIds string `json:"zone_ids"` +} + // SNatDEntry is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatDEntry. type SNatDEntry struct { SNatEntry @@ -1668,10 +1898,13 @@ type SNatEntry struct { type SNatGateway struct { apis.SStatusInfrasResourceBase apis.SExternalizedResourceBase - // SManagedResourceBase SBillingResourceBase SVpcResourceBase - NatSpec string `json:"nat_spec"` + SDeletePreventableResourceBase + NetworkId string `json:"network_id"` + IpAddr string `json:"ip_addr"` + BandwidthMb int `json:"bandwidth_mb"` + NatSpec string `json:"nat_spec"` } // SNatSEntry is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatSEntry. @@ -1682,6 +1915,18 @@ type SNatSEntry struct { SourceCIDR string `json:"source_cidr"` } +// SNatSku is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatSku. +type SNatSku struct { + apis.SEnabledStatusStandaloneResourceBase + apis.SExternalizedResourceBase + SCloudregionResourceBase + PrepaidStatus string `json:"prepaid_status"` + // 预付费资源状态 available|soldout + PostpaidStatus string `json:"postpaid_status"` + Provider string `json:"provider"` + ZoneIds string `json:"zone_ids"` +} + // SNatgatewayResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatgatewayResourceBase. type SNatgatewayResourceBase struct { NatgatewayId string `json:"natgateway_id"` @@ -1830,7 +2075,7 @@ type SPolicyDefinition struct { apis.SStatusStandaloneResourceBase apis.SExternalizedResourceBase // 参数 - Parameters interface{} `json:"parameters"` + Parameters *jsonutils.JSONDict `json:"parameters"` // 条件 Condition string `json:"condition"` // 类别 @@ -1843,6 +2088,17 @@ type SPolicyDefinitionResourceBase struct { PolicydefinitionId string `json:"policydefinition_id"` } +// SProjectMapping is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SProjectMapping. +type SProjectMapping struct { + apis.SEnabledStatusInfrasResourceBase + Rules *MappingRules `json:"rules"` +} + +// SProjectMappingResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SProjectMappingResourceBase. +type SProjectMappingResourceBase struct { + ProjectMappingId string `json:"project_mapping_id"` +} + // SQcloudCachedLb is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SQcloudCachedLb. type SQcloudCachedLb struct { apis.SVirtualResourceBase @@ -2102,6 +2358,8 @@ type SSecurityGroupCache struct { SCloudregionResourceBase SManagedResourceBase SSecurityGroupResourceBase + // 被其他安全组引用的次数 + ReferenceCount int `json:"reference_count"` // 虚拟私有网络外部Id VpcId string `json:"vpc_id"` ExternalProjectId string `json:"external_project_id"` @@ -2117,14 +2375,15 @@ type SSecurityGroupResourceBase struct { type SSecurityGroupRule struct { apis.SResourceBase SSecurityGroupResourceBase - Id string `json:"id"` - Priority int64 `json:"priority"` - Protocol string `json:"protocol"` - Ports string `json:"ports"` - Direction string `json:"direction"` - CIDR string `json:"cidr"` - Action string `json:"action"` - Description string `json:"description"` + Id string `json:"id"` + Priority int64 `json:"priority"` + Protocol string `json:"protocol"` + Ports string `json:"ports"` + Direction string `json:"direction"` + CIDR string `json:"cidr"` + Action string `json:"action"` + Description string `json:"description"` + PeerSecgroupId string `json:"peer_secgroup_id"` } // SServerSku is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SServerSku. @@ -2141,7 +2400,9 @@ type SServerSku struct { LocalCategory string `json:"local_category"` PrepaidStatus string `json:"prepaid_status"` // 预付费资源状态 available|soldout - PostpaidStatus string `json:"postpaid_status"` + PostpaidStatus string `json:"postpaid_status"` + CpuArch string `json:"cpu_arch"` + // CPU 架构 x86|xarm CpuCoreCount int `json:"cpu_core_count"` MemorySizeMB int `json:"memory_size_mb"` OsName string `json:"os_name"` @@ -2253,7 +2514,7 @@ type SStorage struct { // 超售比 Cmtbound float32 `json:"cmtbound"` // 存储配置信息 - StorageConf interface{} `json:"storage_conf"` + StorageConf jsonutils.JSONObject `json:"storage_conf"` // 存储缓存Id StoragecacheId string `json:"storagecache_id"` // indicating whether system disk can be allocated in this storage @@ -2331,10 +2592,10 @@ type SVCenter struct { // = 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"` - Sysinfo interface{} `json:"sysinfo"` + Password string `json:"password"` + LastSync time.Time `json:"last_sync"` + Version string `json:"version"` + Sysinfo jsonutils.JSONObject `json:"sysinfo"` } // SVpc is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SVpc. @@ -2371,10 +2632,99 @@ type SVpcResourceBase struct { VpcId string `json:"vpc_id"` } +// SWafIPSet is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SWafIPSet. +type SWafIPSet struct { + apis.SStatusInfrasResourceBase + Addresses *cloudprovider.WafAddresses `json:"addresses"` +} + +// SWafIPSetCache is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SWafIPSetCache. +type SWafIPSetCache struct { + apis.SStatusStandaloneResourceBase + apis.SExternalizedResourceBase + SManagedResourceBase + SCloudregionResourceBase + Type string `json:"type"` + WafIPSetId string `json:"waf_ip_set_id"` +} + +// SWafInstance is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SWafInstance. +type SWafInstance struct { + apis.SEnabledStatusInfrasResourceBase + apis.SExternalizedResourceBase + SManagedResourceBase + SCloudregionResourceBase + Type string `json:"type"` + DefaultAction *cloudprovider.DefaultAction `json:"default_action"` +} + +// SWafRegexSet is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SWafRegexSet. +type SWafRegexSet struct { + apis.SStatusInfrasResourceBase + RegexPatterns *cloudprovider.WafRegexPatterns `json:"regex_patterns"` +} + +// SWafRegexSetCache is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SWafRegexSetCache. +type SWafRegexSetCache struct { + apis.SStatusStandaloneResourceBase + apis.SExternalizedResourceBase + SManagedResourceBase + SCloudregionResourceBase + Type string `json:"type"` + WafRegexSetId string `json:"waf_regex_set_id"` +} + +// SWafRule is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SWafRule. +type SWafRule struct { + apis.SStatusStandaloneResourceBase + apis.SExternalizedResourceBase + // 规则优先级 + Priority int `json:"priority"` + // 规则默认行为 + Action *cloudprovider.DefaultAction `json:"action"` + // 条件 + StatementConditon string `json:"statement_conditon"` + // 规则组的id + WafRuleGroupId string `json:"waf_rule_group_id"` + // 所属waf实例id + WafInstanceId string `json:"waf_instance_id"` +} + +// SWafRuleGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SWafRuleGroup. +type SWafRuleGroup struct { + apis.SStatusInfrasResourceBase + apis.SExternalizedResourceBase + // 支持的WAF类型,仅is_system=true时有效 + WafType string `json:"waf_type"` + Provider string `json:"provider"` + CloudEnv string `json:"cloud_env"` + IsSystem bool `json:"is_system"` +} + +// SWafRuleGroupCache is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SWafRuleGroupCache. +type SWafRuleGroupCache struct { + apis.SStatusStandaloneResourceBase + apis.SExternalizedResourceBase + SManagedResourceBase + SCloudregionResourceBase + Type string `json:"type"` + WafRuleGroupId string `json:"waf_rule_group_id"` +} + +// SWafRuleStatement is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SWafRuleStatement. +type SWafRuleStatement struct { + apis.SResourceBase + Id string `json:"id"` + cloudprovider.SWafStatement + WafRuleId string `json:"waf_rule_id"` +} + // SWire is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SWire. type SWire struct { apis.SInfrasResourceBase apis.SExternalizedResourceBase + apis.SStatusResourceBase + // SManagedResourceBase SVpcResourceBase SZoneResourceBase // 带宽大小, 单位Mbps @@ -2397,6 +2747,7 @@ type SWireResourceBase struct { type SZone struct { apis.SStatusStandaloneResourceBase apis.SExternalizedResourceBase + SI18nResourceBase SCloudregionResourceBase Location string `json:"location"` Contacts string `json:"contacts"` diff --git a/pkg/apis/identity/zz_generated.model.go b/pkg/apis/identity/zz_generated.model.go index 7b1228ec09..945d093b3f 100644 --- a/pkg/apis/identity/zz_generated.model.go +++ b/pkg/apis/identity/zz_generated.model.go @@ -17,6 +17,8 @@ package identity import ( time "time" + jsonutils "yunion.io/x/jsonutils" + "yunion.io/x/onecloud/pkg/apis" ) @@ -33,33 +35,33 @@ type SAssignment struct { // SConfigOption is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SConfigOption. type SConfigOption struct { apis.SResourceBase - ResType string `json:"res_type"` - ResId string `json:"domain_id"` - Group string `json:"group"` - Option string `json:"option"` - Value interface{} `json:"value"` + ResType string `json:"res_type"` + ResId string `json:"domain_id"` + Group string `json:"group"` + Option string `json:"option"` + Value jsonutils.JSONObject `json:"value"` } // SCredential is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SCredential. type SCredential struct { apis.SStandaloneResourceBase - UserId string `json:"user_id"` - ProjectId string `json:"project_id"` - Type string `json:"type"` - KeyHash string `json:"key_hash"` - Extra interface{} `json:"extra"` - EncryptedBlob string `json:"encrypted_blob"` - Enabled *bool `json:"enabled,omitempty"` + UserId string `json:"user_id"` + ProjectId string `json:"project_id"` + Type string `json:"type"` + KeyHash string `json:"key_hash"` + Extra *jsonutils.JSONDict `json:"extra"` + EncryptedBlob string `json:"encrypted_blob"` + Enabled *bool `json:"enabled,omitempty"` } // SDomain is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SDomain. type SDomain struct { apis.SStandaloneResourceBase - Extra interface{} `json:"extra"` - Enabled *bool `json:"enabled,omitempty"` - IsDomain *bool `json:"is_domain,omitempty"` - DomainId string `json:"domain_id"` - ParentId string `json:"parent_id"` + Extra *jsonutils.JSONDict `json:"extra"` + Enabled *bool `json:"enabled,omitempty"` + IsDomain *bool `json:"is_domain,omitempty"` + DomainId string `json:"domain_id"` + ParentId string `json:"parent_id"` } // SEnabledIdentityBaseResource is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SEnabledIdentityBaseResource. @@ -71,14 +73,14 @@ type SEnabledIdentityBaseResource struct { // SEndpoint is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SEndpoint. type SEndpoint struct { apis.SStandaloneResourceBase - LegacyEndpointId string `json:"legacy_endpoint_id"` - Interface string `json:"interface"` - ServiceId string `json:"service_id"` - Url string `json:"url"` - Extra interface{} `json:"extra"` - Enabled *bool `json:"enabled,omitempty"` - RegionId string `json:"region_id"` - ServiceCertificateId string `json:"service_certificate_id"` + LegacyEndpointId string `json:"legacy_endpoint_id"` + Interface string `json:"interface"` + ServiceId string `json:"service_id"` + Url string `json:"url"` + Extra *jsonutils.JSONDict `json:"extra"` + Enabled *bool `json:"enabled,omitempty"` + RegionId string `json:"region_id"` + ServiceCertificateId string `json:"service_certificate_id"` } // SFederatedUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SFederatedUser. @@ -116,7 +118,7 @@ type SGroup struct { type SIdentityBaseResource struct { apis.SStandaloneResourceBase apis.SDomainizedResourceBase - Extra interface{} `json:"extra"` + Extra *jsonutils.JSONDict `json:"extra"` } // SIdentityProvider is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SIdentityProvider. @@ -202,7 +204,7 @@ type SPolicy struct { // Deprecated Type string `json:"type"` // 权限定义 - Blob interface{} `json:"blob"` + Blob jsonutils.JSONObject `json:"blob"` // 权限范围 Scope string `json:"scope"` // 是否为系统权限 @@ -225,8 +227,8 @@ type SProjectExtended struct { // SRegion is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SRegion. type SRegion struct { apis.SStandaloneResourceBase - ParentRegionId string `json:"parent_region_id"` - Extra interface{} `json:"extra"` + ParentRegionId string `json:"parent_region_id"` + Extra *jsonutils.JSONDict `json:"extra"` } // SRole is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SRole. @@ -264,10 +266,10 @@ type SScopeResource struct { // SService is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SService. type SService struct { apis.SStandaloneResourceBase - Type string `json:"type"` - Enabled *bool `json:"enabled,omitempty"` - Extra interface{} `json:"extra"` - ConfigVersion int `json:"config_version"` + Type string `json:"type"` + Enabled *bool `json:"enabled,omitempty"` + Extra *jsonutils.JSONDict `json:"extra"` + ConfigVersion int `json:"config_version"` } // SServiceCertificate is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SServiceCertificate. diff --git a/pkg/apis/monitor/zz_generated.model.go b/pkg/apis/monitor/zz_generated.model.go index 4b9f9d2c99..7a9b536c99 100644 --- a/pkg/apis/monitor/zz_generated.model.go +++ b/pkg/apis/monitor/zz_generated.model.go @@ -17,6 +17,8 @@ package monitor import ( time "time" + jsonutils "yunion.io/x/jsonutils" + "yunion.io/x/onecloud/pkg/apis" ) @@ -27,25 +29,26 @@ type SAlert struct { apis.SStatusStandaloneResourceBase SMonitorScopedResource // Frequency is evaluate period - Frequency int64 `json:"frequency"` - Settings interface{} `json:"settings"` - Level string `json:"level"` - Message string `json:"message"` - UsedBy string `json:"used_by"` + Frequency int64 `json:"frequency"` + Settings jsonutils.JSONObject `json:"settings"` + Level string `json:"level"` + Message string `json:"message"` + UsedBy string `json:"used_by"` // Silenced bool ExecutionError string `json:"execution_error"` // If an alert rule has a configured `For` and the query violates the configured threshold // it will first go from `OK` to `Pending`. Going from `OK` to `Pending` will not send any // notifications. Once the alert rule has been firing for more than `For` duration, it will // change to `Alerting` and send alert notifications. - For int64 `json:"for"` - EvalData interface{} `json:"eval_data"` - State string `json:"state"` - NoDataState string `json:"no_data_state"` - ExecutionErrorState string `json:"execution_error_state"` - LastStateChange time.Time `json:"last_state_change"` - StateChanges int `json:"state_changes"` - CustomizeConfig interface{} `json:"customize_config"` + For int64 `json:"for"` + EvalData jsonutils.JSONObject `json:"eval_data"` + State string `json:"state"` + NoDataState string `json:"no_data_state"` + ExecutionErrorState string `json:"execution_error_state"` + LastStateChange time.Time `json:"last_state_change"` + StateChanges int `json:"state_changes"` + CustomizeConfig jsonutils.JSONObject `json:"customize_config"` + ResType string `json:"res_type"` } // SAlertDashBoard is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertDashBoard. @@ -74,8 +77,8 @@ type SAlertJointsBase struct { type SAlertPanel struct { apis.SStatusStandaloneResourceBase apis.SScopedResourceBase - Settings interface{} `json:"settings"` - Message string `json:"message"` + Settings jsonutils.JSONObject `json:"settings"` + Message string `json:"message"` } // SAlertRecord is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertRecord. @@ -84,13 +87,26 @@ type SAlertRecord struct { apis.SEnabledResourceBase apis.SStatusStandaloneResourceBase SMonitorScopedResource - AlertId string `json:"alert_id"` - Level string `json:"level"` - State string `json:"state"` - SendState string `json:"send_state"` - EvalData interface{} `json:"eval_data"` - AlertRule interface{} `json:"alert_rule"` - ResType string `json:"res_type"` + AlertId string `json:"alert_id"` + Level string `json:"level"` + State string `json:"state"` + SendState string `json:"send_state"` + EvalData jsonutils.JSONObject `json:"eval_data"` + AlertRule jsonutils.JSONObject `json:"alert_rule"` + ResType string `json:"res_type"` +} + +// SAlertRecordShield is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertRecordShield. +type SAlertRecordShield struct { + // db.SVirtualResourceBase + apis.SEnabledResourceBase + apis.SStatusStandaloneResourceBase + SMonitorScopedResource + AlertId string `json:"alert_id"` + ResId string `json:"res_id"` + ResType string `json:"res_type"` + StartTime time.Time `json:"start_time"` + EndTime time.Time `json:"end_time"` } // SAlertResource is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertResource. @@ -102,10 +118,10 @@ type SAlertResource struct { // 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"` + AlertId string `json:"alert_id"` + AlertRecordId string `json:"alert_record_id"` + TriggerTime time.Time `json:"trigger_time"` + Data jsonutils.JSONObject `json:"data"` } // SAlertResourceJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertResourceJointsBase. @@ -117,11 +133,11 @@ type SAlertResourceJointsBase struct { // SAlertnotification is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertnotification. type SAlertnotification struct { SAlertJointsBase - NotificationId string `json:"notification_id"` - State string `json:"state"` - Index byte `json:"index"` - UsedBy string `json:"used_by"` - Params interface{} `json:"params"` + NotificationId string `json:"notification_id"` + State string `json:"state"` + Index byte `json:"index"` + UsedBy string `json:"used_by"` + Params jsonutils.JSONObject `json:"params"` } // SCommonAlert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SCommonAlert. @@ -176,6 +192,28 @@ type SMetricMeasurement struct { Score int `json:"score"` } +// SMonitorResource is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SMonitorResource. +type SMonitorResource struct { + apis.SVirtualResourceBase + apis.SEnabledResourceBase + AlertState string `json:"alert_state"` + ResId string `json:"res_id"` + ResType string `json:"res_type"` +} + +// SMonitorResourceAlert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SMonitorResourceAlert. +type SMonitorResourceAlert struct { + apis.SJointResourceBase + MonitorResourceId string `json:"monitor_resource_id"` + AlertId string `json:"alert_id"` + AlertRecordId string `json:"alert_record_id"` + ResType string `json:"res_type"` + AlertState string `json:"alert_state"` + SendState string `json:"send_state"` + TriggerTime time.Time `json:"trigger_time"` + Data jsonutils.JSONObject `json:"data"` +} + // SMonitorScopedResource is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SMonitorScopedResource. type SMonitorScopedResource struct { apis.SScopedResourceBase @@ -194,9 +232,9 @@ type SNotification struct { SendReminder bool `json:"send_reminder"` DisableResolveMessage bool `json:"disable_resolve_message"` // unit is second - Frequency int64 `json:"frequency"` - Settings interface{} `json:"settings"` - LastSendNotification time.Time `json:"last_send_notification"` + Frequency int64 `json:"frequency"` + Settings jsonutils.JSONObject `json:"settings"` + LastSendNotification time.Time `json:"last_send_notification"` } // SV1Alert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SV1Alert. diff --git a/pkg/apis/notify/event.go b/pkg/apis/notify/event.go index a3a6b30b2c..fce8c12ab8 100644 --- a/pkg/apis/notify/event.go +++ b/pkg/apis/notify/event.go @@ -20,7 +20,7 @@ import ( ) var ( - Event SEvent + Event SNotifyEvent ActionCreate SAction = "create" ActionDelete SAction = "delete" @@ -52,36 +52,36 @@ type SAction string type SResult string -type SEvent struct { +type SNotifyEvent struct { resourceType string action SAction result SResult } -func (se SEvent) WithResourceType(rt string) SEvent { +func (se SNotifyEvent) WithResourceType(rt string) SNotifyEvent { se.resourceType = rt return se } -func (se SEvent) WithAction(a SAction) SEvent { +func (se SNotifyEvent) WithAction(a SAction) SNotifyEvent { se.action = a return se } -func (se SEvent) WithResult(r SResult) SEvent { +func (se SNotifyEvent) WithResult(r SResult) SNotifyEvent { se.result = r return se } -func (se SEvent) ResourceType() string { +func (se SNotifyEvent) ResourceType() string { return se.resourceType } -func (se SEvent) Action() SAction { +func (se SNotifyEvent) Action() SAction { return se.action } -func (se SEvent) ActionWithResult(delimiter string) string { +func (se SNotifyEvent) ActionWithResult(delimiter string) string { ar := string(se.action) if len(se.result) > 0 { ar += delimiter + string(se.result) @@ -89,18 +89,18 @@ func (se SEvent) ActionWithResult(delimiter string) string { return strings.ToUpper(ar) } -func (se SEvent) Result() SResult { +func (se SNotifyEvent) Result() SResult { if se.result == "" { return ResultSucceed } return se.result } -func (se SEvent) String() string { +func (se SNotifyEvent) String() string { return se.StringWithDeli(DelimiterInEvent) } -func (se SEvent) StringWithDeli(delimiter string) string { +func (se SNotifyEvent) StringWithDeli(delimiter string) string { str := strings.ToUpper(fmt.Sprintf("%s%s%s", se.ResourceType(), delimiter, se.Action())) if se.result != "" { str += delimiter + strings.ToUpper(string(se.result)) diff --git a/pkg/apis/notify/zz_generated.model.go b/pkg/apis/notify/zz_generated.model.go index fbfbd81a7a..a4d26223a2 100644 --- a/pkg/apis/notify/zz_generated.model.go +++ b/pkg/apis/notify/zz_generated.model.go @@ -17,6 +17,8 @@ package notify import ( time "time" + jsonutils "yunion.io/x/jsonutils" + "yunion.io/x/onecloud/pkg/apis" ) @@ -24,9 +26,17 @@ import ( type SConfig struct { apis.SStandaloneResourceBase apis.SDomainizedResourceBase - Type string `json:"type"` - Content interface{} `json:"content"` - Attribution string `json:"attribution"` + Type string `json:"type"` + Content jsonutils.JSONObject `json:"content"` + Attribution string `json:"attribution"` +} + +// SEvent is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SEvent. +type SEvent struct { + apis.SStandaloneAnonResourceBase + Message string `json:"message"` + Event string `json:"event"` + AdvanceDays int `json:"advance_days"` } // SNotification is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SNotification. @@ -37,12 +47,11 @@ type SNotification struct { Topic string `json:"topic"` Priority string `json:"priority"` // swagger:ignore - Message string `json:"message"` - ReceivedAt time.Time `json:"received_at"` - Event string `json:"event"` - AdvanceDays int `json:"advance_days"` - SendTimes int `json:"send_times"` - Tag string `json:"tag"` + Message string `json:"message"` + ReceivedAt time.Time `json:"received_at"` + EventId string `json:"event_id"` + SendTimes int `json:"send_times"` + Tag string `json:"tag"` } // SReceiver is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SReceiver. @@ -101,13 +110,16 @@ type SSubContact struct { // SSubscriber is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SSubscriber. type SSubscriber struct { - apis.SVirtualResourceBase + apis.SStandaloneAnonResourceBase apis.SEnabledResourceBase - TopicID string `json:"topic_id"` - Type string `json:"type"` - Identification string `json:"identification"` - RoleScope string `json:"role_scope"` - ResourceScope string `json:"resource_scope"` + TopicID string `json:"topic_id"` + Type string `json:"type"` + Identification string `json:"identification"` + RoleScope string `json:"role_scope"` + ResourceScope string `json:"resource_scope"` + ResourceAttributionId string `json:"resource_attribution_id"` + Scope string `json:"scope"` + DomainId string `json:"domain_id"` } // SSubscriberDis is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SSubscriberDis. @@ -126,7 +138,7 @@ type SSubscriberReceiver struct { // STemplate is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.STemplate. type STemplate struct { - apis.SStandaloneResourceBase + apis.SStandaloneAnonResourceBase ContactType string `json:"contact_type"` Topic string `json:"topic"` // title | content | remote @@ -143,6 +155,7 @@ type STopic struct { Type string `json:"type"` Resources uint64 `json:"resources"` Actions uint32 `json:"actions"` + Results byte `json:"results"` AdvanceDays int `json:"advance_days"` } diff --git a/pkg/apis/yunionconf/zz_generated.model.go b/pkg/apis/yunionconf/zz_generated.model.go index d06f306b7f..4183657a3a 100644 --- a/pkg/apis/yunionconf/zz_generated.model.go +++ b/pkg/apis/yunionconf/zz_generated.model.go @@ -15,6 +15,8 @@ package yunionconf import ( + jsonutils "yunion.io/x/jsonutils" + "yunion.io/x/onecloud/pkg/apis" ) @@ -33,7 +35,7 @@ type SParameter struct { // Column(VARCHAR(length=128, charset='ascii'), nullable=False) Name string `json:"name"` // Column(VARCHAR(length=128, charset='ascii'), nullable=false) - Value interface{} `json:"value"` + Value jsonutils.JSONObject `json:"value"` } // SScopedPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/yunionconf/models.SScopedPolicy. @@ -42,7 +44,7 @@ type SScopedPolicy struct { // 策略类别 Category string `json:"category"` // 策略内容 - Policies interface{} `json:"policies"` + Policies jsonutils.JSONObject `json:"policies"` } // SScopedPolicyBinding is an autogenerated struct via yunion.io/x/onecloud/pkg/yunionconf/models.SScopedPolicyBinding. diff --git a/pkg/cloudcommon/db/adminsharablevirtual.go b/pkg/cloudcommon/db/adminsharablevirtual.go index accd525af7..c24e543629 100644 --- a/pkg/cloudcommon/db/adminsharablevirtual.go +++ b/pkg/cloudcommon/db/adminsharablevirtual.go @@ -215,15 +215,6 @@ func (manager *SAdminSharableVirtualResourceBaseManager) OrderByExtraFields( return q, nil } -func (model *SAdminSharableVirtualResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (apis.AdminSharableVirtualResourceDetails, error) { - return apis.AdminSharableVirtualResourceDetails{}, nil -} - func (manager *SAdminSharableVirtualResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/caller.go b/pkg/cloudcommon/db/caller.go index 503775f367..d57dcb6eba 100644 --- a/pkg/cloudcommon/db/caller.go +++ b/pkg/cloudcommon/db/caller.go @@ -259,20 +259,6 @@ func OrderByExtraFields( return ret[0].Interface().(*sqlchemy.SQuery), nil } -func GetExtraDetails(model IModel, ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (*jsonutils.JSONDict, error) { - ret, err := call(model, "GetExtraDetails", ctx, userCred, query, isList) - if err != nil { - return nil, httperrors.NewGeneralError(err) - } - if len(ret) != 2 { - return nil, httperrors.NewInternalServerError("Invalid GetExtraDetails return value count %d", len(ret)) - } - if err := ValueToError(ret[1]); err != nil { - return nil, err - } - return ValueToJSONDict(ret[0]), nil -} - func FetchCustomizeColumns( manager IModelManager, ctx context.Context, diff --git a/pkg/cloudcommon/db/domainresource.go b/pkg/cloudcommon/db/domainresource.go index 8e70a56f81..1f5bbcff8b 100644 --- a/pkg/cloudcommon/db/domainresource.go +++ b/pkg/cloudcommon/db/domainresource.go @@ -252,15 +252,6 @@ func (manager *SDomainLevelResourceBaseManager) FetchCustomizeColumns( return rows } -func (model *SDomainLevelResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (apis.DomainLevelResourceDetails, error) { - return apis.DomainLevelResourceDetails{}, nil -} - func (manager *SDomainLevelResourceBaseManager) GetIDomainLevelModelManager() IDomainLevelModelManager { return manager.GetVirtualObject().(IDomainLevelModelManager) } diff --git a/pkg/cloudcommon/db/enabledstatusdomainresource.go b/pkg/cloudcommon/db/enabledstatusdomainresource.go index af10722cd1..5d3928afe9 100644 --- a/pkg/cloudcommon/db/enabledstatusdomainresource.go +++ b/pkg/cloudcommon/db/enabledstatusdomainresource.go @@ -140,15 +140,6 @@ func (manager *SEnabledStatusDomainLevelResourceBaseManager) FetchCustomizeColum return rows } -func (model *SEnabledStatusDomainLevelResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (apis.EnabledStatusDomainLevelResourceDetails, error) { - return apis.EnabledStatusDomainLevelResourceDetails{}, nil -} - func (model *SEnabledStatusDomainLevelResourceBase) ValidateUpdateData( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/enabledstatusinfrasresource.go b/pkg/cloudcommon/db/enabledstatusinfrasresource.go index 88b4f7fd24..eae2b6b72e 100644 --- a/pkg/cloudcommon/db/enabledstatusinfrasresource.go +++ b/pkg/cloudcommon/db/enabledstatusinfrasresource.go @@ -186,15 +186,6 @@ func (manager *SEnabledStatusInfrasResourceBaseManager) FetchCustomizeColumns( return rows } -func (model *SEnabledStatusInfrasResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (apis.EnabledStatusInfrasResourceBaseDetails, error) { - return apis.EnabledStatusInfrasResourceBaseDetails{}, nil -} - func (model *SEnabledStatusInfrasResourceBase) ValidateUpdateData( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/enabledstatusstandalone.go b/pkg/cloudcommon/db/enabledstatusstandalone.go index 1c11c827f2..a2b361f90c 100644 --- a/pkg/cloudcommon/db/enabledstatusstandalone.go +++ b/pkg/cloudcommon/db/enabledstatusstandalone.go @@ -134,15 +134,6 @@ func (manager *SEnabledStatusStandaloneResourceBaseManager) FetchCustomizeColumn return rows } -func (model *SEnabledStatusStandaloneResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (apis.EnabledStatusStandaloneResourceDetails, error) { - return apis.EnabledStatusStandaloneResourceDetails{}, nil -} - func (model *SEnabledStatusStandaloneResourceBase) ValidateUpdateData( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/infraresource.go b/pkg/cloudcommon/db/infraresource.go index 71f45b6124..0d2fbfd272 100644 --- a/pkg/cloudcommon/db/infraresource.go +++ b/pkg/cloudcommon/db/infraresource.go @@ -150,10 +150,6 @@ func (manager *SInfrasResourceBaseManager) OrderByExtraFields(ctx context.Contex return q, nil } -func (model *SInfrasResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (apis.InfrasResourceBaseDetails, error) { - return apis.InfrasResourceBaseDetails{}, nil -} - func (manager *SInfrasResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/interface.go b/pkg/cloudcommon/db/interface.go index 5ec78ab8f1..be60542486 100644 --- a/pkg/cloudcommon/db/interface.go +++ b/pkg/cloudcommon/db/interface.go @@ -158,8 +158,6 @@ type IModel interface { // get hooks AllowGetDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool - // GetExtraDetails dynamic call by model dispatcher - // GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*jsonutils.JSONDict, error) GetExtraDetailsHeaders(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) map[string]string // create hooks diff --git a/pkg/cloudcommon/db/jointbase.go b/pkg/cloudcommon/db/jointbase.go index 7d8d063d15..668c28e27c 100644 --- a/pkg/cloudcommon/db/jointbase.go +++ b/pkg/cloudcommon/db/jointbase.go @@ -220,15 +220,6 @@ func (manager *SJointResourceBaseManager) ValidateCreateData(ctx context.Context return input, nil } -func (model *SJointResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (apis.JointResourceBaseDetails, error) { - return apis.JointResourceBaseDetails{}, nil -} - func (manager *SJointResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/modelbase.go b/pkg/cloudcommon/db/modelbase.go index bf0d7d1879..6a379df533 100644 --- a/pkg/cloudcommon/db/modelbase.go +++ b/pkg/cloudcommon/db/modelbase.go @@ -298,10 +298,6 @@ func (manager *SModelBaseManager) GetSkipLog(ctx context.Context, userCred mccli return false } -func (model *SModelBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (apis.ModelBaseDetails, error) { - return apis.ModelBaseDetails{}, nil -} - func (manager *SModelBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/models.go b/pkg/cloudcommon/db/models.go index 44ad3ce9a0..3960ca31cb 100644 --- a/pkg/cloudcommon/db/models.go +++ b/pkg/cloudcommon/db/models.go @@ -91,23 +91,6 @@ func mustCheckModelManager(modelMan IModelManager) { panic(msg) } } - requiredModelFuncNames := []string{ - "GetExtraDetails", - } - for _, name := range requiredModelFuncNames { - model, err := NewModelObject(modelMan) - if err != nil { - msg := fmt.Sprintf("model manager %T: new model object: %v", modelMan, err) - panic(msg) - } - modelV := reflect.ValueOf(model) - methV := modelV.MethodByName(name) - if !methV.IsValid() { - msg := fmt.Sprintf("model %T: has no valid %s, likely caused by ambiguity", - model, name) - panic(msg) - } - } } } diff --git a/pkg/cloudcommon/db/resourcebase.go b/pkg/cloudcommon/db/resourcebase.go index a2a20413cc..a405ba2fb9 100644 --- a/pkg/cloudcommon/db/resourcebase.go +++ b/pkg/cloudcommon/db/resourcebase.go @@ -173,10 +173,6 @@ func (manager *SResourceBaseManager) FetchCustomizeColumns( return ret } -func (model *SResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (apis.ResourceBaseDetails, error) { - return apis.ResourceBaseDetails{}, nil -} - func (model *SResourceBase) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.ResourceBaseUpdateInput) (apis.ResourceBaseUpdateInput, error) { var err error input.ModelBaseUpdateInput, err = model.SModelBase.ValidateUpdateData(ctx, userCred, query, input.ModelBaseUpdateInput) diff --git a/pkg/cloudcommon/db/sharablevirtual.go b/pkg/cloudcommon/db/sharablevirtual.go index 504199d028..1c5f72b24d 100644 --- a/pkg/cloudcommon/db/sharablevirtual.go +++ b/pkg/cloudcommon/db/sharablevirtual.go @@ -138,10 +138,6 @@ func (manager *SSharableVirtualResourceBaseManager) OrderByExtraFields(ctx conte return q, nil } -func (model *SSharableVirtualResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (apis.SharableVirtualResourceDetails, error) { - return apis.SharableVirtualResourceDetails{}, nil -} - func (manager *SSharableVirtualResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/standalone.go b/pkg/cloudcommon/db/standalone.go index 9bdbdbffdf..ae9e772678 100644 --- a/pkg/cloudcommon/db/standalone.go +++ b/pkg/cloudcommon/db/standalone.go @@ -144,10 +144,6 @@ func (manager *SStandaloneResourceBaseManager) ValidateCreateData(ctx context.Co return input, nil } -func (model *SStandaloneResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (apis.StandaloneResourceDetails, error) { - return apis.StandaloneResourceDetails{}, nil -} - func (manager *SStandaloneResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/standalone_anon.go b/pkg/cloudcommon/db/standalone_anon.go index c63ae03492..5e913cc02d 100644 --- a/pkg/cloudcommon/db/standalone_anon.go +++ b/pkg/cloudcommon/db/standalone_anon.go @@ -491,10 +491,6 @@ func (manager *SStandaloneAnonResourceBaseManager) ValidateCreateData(ctx contex return input, nil } -func (model *SStandaloneAnonResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (apis.StandaloneAnonResourceDetails, error) { - return apis.StandaloneAnonResourceDetails{}, nil -} - func (manager *SStandaloneAnonResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/statusdomainresource.go b/pkg/cloudcommon/db/statusdomainresource.go index a7bc76922d..e1ee59467a 100644 --- a/pkg/cloudcommon/db/statusdomainresource.go +++ b/pkg/cloudcommon/db/statusdomainresource.go @@ -143,15 +143,6 @@ func (manager *SStatusDomainLevelResourceBaseManager) FetchCustomizeColumns( return rows } -func (model *SStatusDomainLevelResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (apis.StatusDomainLevelResourceDetails, error) { - return apis.StatusDomainLevelResourceDetails{}, nil -} - func (model *SStatusDomainLevelResourceBase) ValidateUpdateData( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/statusinfrasresource.go b/pkg/cloudcommon/db/statusinfrasresource.go index db73acda74..6828a175e2 100644 --- a/pkg/cloudcommon/db/statusinfrasresource.go +++ b/pkg/cloudcommon/db/statusinfrasresource.go @@ -189,15 +189,6 @@ func (manager *SStatusInfrasResourceBaseManager) FetchCustomizeColumns( return rows } -func (model *SStatusInfrasResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (apis.StatusInfrasResourceBaseDetails, error) { - return apis.StatusInfrasResourceBaseDetails{}, nil -} - func (model *SStatusInfrasResourceBase) ValidateUpdateData( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/statusinfrasuserresource.go b/pkg/cloudcommon/db/statusinfrasuserresource.go index 23362f1ec2..64136d84b7 100644 --- a/pkg/cloudcommon/db/statusinfrasuserresource.go +++ b/pkg/cloudcommon/db/statusinfrasuserresource.go @@ -172,12 +172,3 @@ func (manager *SStatusDomainLevelUserResourceBaseManager) FetchCustomizeColumns( return rows } - -func (model *SStatusDomainLevelUserResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (apis.StatusDomainLevelUserResourceDetails, error) { - return apis.StatusDomainLevelUserResourceDetails{}, nil -} diff --git a/pkg/cloudcommon/db/statusstandalone.go b/pkg/cloudcommon/db/statusstandalone.go index 7cd27917a9..f6d5c23e3d 100644 --- a/pkg/cloudcommon/db/statusstandalone.go +++ b/pkg/cloudcommon/db/statusstandalone.go @@ -178,15 +178,6 @@ func (manager *SStatusStandaloneResourceBaseManager) FetchCustomizeColumns( return rows } -func (model *SStatusStandaloneResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (apis.StatusStandaloneResourceDetails, error) { - return apis.StatusStandaloneResourceDetails{}, nil -} - func (model *SStatusStandaloneResourceBase) ValidateUpdateData( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/virtualjointbase.go b/pkg/cloudcommon/db/virtualjointbase.go index de8f73a09f..eb8f80665a 100644 --- a/pkg/cloudcommon/db/virtualjointbase.go +++ b/pkg/cloudcommon/db/virtualjointbase.go @@ -112,15 +112,6 @@ func (manager *SVirtualJointResourceBaseManager) FilterByHiddenSystemAttributes( return q } -func (model *SVirtualJointResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (apis.VirtualJointResourceBaseDetails, error) { - return apis.VirtualJointResourceBaseDetails{}, nil -} - func (manager *SVirtualJointResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudcommon/db/virtualresource.go b/pkg/cloudcommon/db/virtualresource.go index 86d4693183..708ce2f1e1 100644 --- a/pkg/cloudcommon/db/virtualresource.go +++ b/pkg/cloudcommon/db/virtualresource.go @@ -264,10 +264,6 @@ func (manager *SVirtualResourceBaseManager) AllowCreateItem(ctx context.Context, return true } -func (model *SVirtualResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (apis.VirtualResourceDetails, error) { - return apis.VirtualResourceDetails{}, nil -} - func (manager *SVirtualResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudevent/models/cloudevents.go b/pkg/cloudevent/models/cloudevents.go index 61db9b5897..f1eb3ea1d3 100644 --- a/pkg/cloudevent/models/cloudevents.go +++ b/pkg/cloudevent/models/cloudevents.go @@ -155,15 +155,6 @@ func (manager *SCloudeventManager) ListItemFilter( return q, nil } -func (self *SCloudevent) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudeventDetails, error) { - return api.CloudeventDetails{}, nil -} - func (manager *SCloudeventManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudid/models/cloudgroup.go b/pkg/cloudid/models/cloudgroup.go index 417402674d..606073db97 100644 --- a/pkg/cloudid/models/cloudgroup.go +++ b/pkg/cloudid/models/cloudgroup.go @@ -127,15 +127,6 @@ func (self *SCloudgroup) ValidateUpdateData(ctx context.Context, userCred mcclie } // 获取权限组详情 -func (self *SCloudgroup) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudgroupDetails, error) { - return api.CloudgroupDetails{}, nil -} - func (manager *SCloudgroupManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudid/models/cloudgroup_policies.go b/pkg/cloudid/models/cloudgroup_policies.go index 21e910d203..ff88b77d2e 100644 --- a/pkg/cloudid/models/cloudgroup_policies.go +++ b/pkg/cloudid/models/cloudgroup_policies.go @@ -86,15 +86,6 @@ func (self *SCloudgroupPolicy) ValidateUpdateData(ctx context.Context, userCred } // 用户组中权限详情 -func (self *SCloudgroupPolicy) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudgroupPolicyDetails, error) { - return api.CloudgroupPolicyDetails{}, nil -} - func (manager *SCloudgroupPolicyManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudid/models/cloudgroup_users.go b/pkg/cloudid/models/cloudgroup_users.go index 1576c1bc4c..9fdcb26a6a 100644 --- a/pkg/cloudid/models/cloudgroup_users.go +++ b/pkg/cloudid/models/cloudgroup_users.go @@ -87,15 +87,6 @@ func (self *SCloudgroupUser) ValidateUpdateData(ctx context.Context, userCred mc } // 获取用户组中用户详情 -func (self *SCloudgroupUser) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudgroupUserDetails, error) { - return api.CloudgroupUserDetails{}, nil -} - func (manager *SCloudgroupUserManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudid/models/cloudgroupcaches.go b/pkg/cloudid/models/cloudgroupcaches.go index 08242e7322..92c4159eac 100644 --- a/pkg/cloudid/models/cloudgroupcaches.go +++ b/pkg/cloudid/models/cloudgroupcaches.go @@ -181,15 +181,6 @@ func (manager *SCloudgroupcacheManager) Register(group *SCloudgroup, account *SC } // 获取权限组缓存详情 -func (self *SCloudgroupcache) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudgroupcacheDetails, error) { - return api.CloudgroupcacheDetails{}, nil -} - func (manager *SCloudgroupcacheManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudid/models/cloudgroupjoints.go b/pkg/cloudid/models/cloudgroupjoints.go index f61e107c95..a3b1765bea 100644 --- a/pkg/cloudid/models/cloudgroupjoints.go +++ b/pkg/cloudid/models/cloudgroupjoints.go @@ -67,15 +67,6 @@ func (manager *SCloudgroupJointsManager) GetMasterFieldName() string { return "cloudgroup_id" } -func (self *SCloudgroupJointsBase) GetExtraDetails( - ctx context.Context, - groupCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudgroupJointResourceDetails, error) { - return api.CloudgroupJointResourceDetails{}, nil -} - func (manager *SCloudgroupJointsManager) FetchCustomizeColumns( ctx context.Context, groupCred mcclient.TokenCredential, diff --git a/pkg/cloudid/models/cloudpolicy.go b/pkg/cloudid/models/cloudpolicy.go index f0259e324d..70bf180756 100644 --- a/pkg/cloudid/models/cloudpolicy.go +++ b/pkg/cloudid/models/cloudpolicy.go @@ -432,15 +432,6 @@ func (self *SCloudpolicy) AllowGetDetails(ctx context.Context, userCred mcclient } // 获取公有云权限详情 -func (self *SCloudpolicy) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudpolicyDetails, error) { - return api.CloudpolicyDetails{}, nil -} - func (manager *SCloudpolicyManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudid/models/cloudpolicycaches.go b/pkg/cloudid/models/cloudpolicycaches.go index 1ca67cbabf..51c32c4f60 100644 --- a/pkg/cloudid/models/cloudpolicycaches.go +++ b/pkg/cloudid/models/cloudpolicycaches.go @@ -97,15 +97,6 @@ func (manager *SCloudpolicycacheManager) ListItemFilter(ctx context.Context, q * } // 获取公有云权限缓存详情 -func (self *SCloudpolicycache) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudpolicycacheDetails, error) { - return api.CloudpolicycacheDetails{}, nil -} - func (manager *SCloudpolicycacheManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudid/models/cloudrole.go b/pkg/cloudid/models/cloudrole.go index fe97090491..0d99f2964a 100644 --- a/pkg/cloudid/models/cloudrole.go +++ b/pkg/cloudid/models/cloudrole.go @@ -91,15 +91,6 @@ func (manager *SCloudroleManager) ListItemFilter(ctx context.Context, q *sqlchem } // 获取公有云角色详情 -func (self *SCloudrole) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudroleDetails, error) { - return api.CloudroleDetails{}, nil -} - func (manager *SCloudroleManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudid/models/clouduser.go b/pkg/cloudid/models/clouduser.go index 341303f3d4..f3b279fc3c 100644 --- a/pkg/cloudid/models/clouduser.go +++ b/pkg/cloudid/models/clouduser.go @@ -188,15 +188,6 @@ func (manager *SClouduserManager) QueryDistinctExtraField(q *sqlchemy.SQuery, fi } // 获取公有云用户详情 -func (self *SClouduser) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ClouduserDetails, error) { - return api.ClouduserDetails{}, nil -} - func (manager *SClouduserManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudid/models/clouduser_policies.go b/pkg/cloudid/models/clouduser_policies.go index 73024500ee..f8cb96057c 100644 --- a/pkg/cloudid/models/clouduser_policies.go +++ b/pkg/cloudid/models/clouduser_policies.go @@ -91,15 +91,6 @@ func (self *SClouduserPolicy) ValidateUpdateData(ctx context.Context, userCred m } // 获取公有云用户权限详情 -func (self *SClouduserPolicy) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ClouduserPolicyDetails, error) { - return api.ClouduserPolicyDetails{}, nil -} - func (manager *SClouduserPolicyManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudid/models/clouduserjoints.go b/pkg/cloudid/models/clouduserjoints.go index f66a2328cd..2af1fc89f5 100644 --- a/pkg/cloudid/models/clouduserjoints.go +++ b/pkg/cloudid/models/clouduserjoints.go @@ -55,15 +55,6 @@ func (manager *SClouduserJointsManager) GetMasterFieldName() string { return "clouduser_id" } -func (self *SClouduserJointsBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ClouduserJointResourceDetails, error) { - return api.ClouduserJointResourceDetails{}, nil -} - func (manager *SClouduserJointsManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/cloudprovider/waf.go b/pkg/cloudprovider/waf.go index 10eb740758..14b3a77103 100644 --- a/pkg/cloudprovider/waf.go +++ b/pkg/cloudprovider/waf.go @@ -144,6 +144,7 @@ type SWafRule struct { Statements []SWafStatement } +// +onecloud:model-api-gen type SWafStatement struct { // 管理规则组名称 ManagedRuleGroupName string `width:"64" charset:"utf8" nullable:"false" list:"user"` @@ -195,6 +196,7 @@ func (self SWafStatement) GetExternalId() string { return self.GetGlobalId() } +// +onecloud:model-api-gen type DefaultAction struct { // Allow, Block, Log, Count, Alert, Detection, Prevention Action TWafAction @@ -211,6 +213,7 @@ type DefaultAction struct { type WafSourceIps []string +// +onecloud:model-api-gen type WafRegexPatterns []string func (self WafRegexPatterns) IsZero() bool { @@ -221,6 +224,7 @@ func (self WafRegexPatterns) String() string { return jsonutils.Marshal(self).String() } +// +onecloud:model-api-gen type WafAddresses []string func (self WafAddresses) IsZero() bool { diff --git a/pkg/compute/models/baremetalagents.go b/pkg/compute/models/baremetalagents.go index 00da4d7f24..44f04b4eec 100644 --- a/pkg/compute/models/baremetalagents.go +++ b/pkg/compute/models/baremetalagents.go @@ -199,10 +199,6 @@ func (self *SBaremetalagent) GetZone() *SZone { return nil } -func (self *SBaremetalagent) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.BaremetalagentDetails, error) { - return api.BaremetalagentDetails{}, nil -} - func (manager *SBaremetalagentManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/billingresource.go b/pkg/compute/models/billingresource.go index 3326363481..52300afa29 100644 --- a/pkg/compute/models/billingresource.go +++ b/pkg/compute/models/billingresource.go @@ -109,14 +109,6 @@ type SCloudBillingInfo struct { InternetChargeType string `json:",omitempty"` } -func (self *SBillingResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, -) api.BillingDetailsInfo { - return api.BillingDetailsInfo{} -} - func (manager *SBillingResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/buckets.go b/pkg/compute/models/buckets.go index 06ca3615bd..d26310b6ab 100644 --- a/pkg/compute/models/buckets.go +++ b/pkg/compute/models/buckets.go @@ -559,10 +559,6 @@ func (bucket *SBucket) RemoteCreate(ctx context.Context, userCred mcclient.Token return nil } -func (bucket *SBucket) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.BucketDetails, error) { - return api.BucketDetails{}, nil -} - func (manager *SBucketManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/cachedimages.go b/pkg/compute/models/cachedimages.go index 4a2018eb16..00f06ecd7a 100644 --- a/pkg/compute/models/cachedimages.go +++ b/pkg/compute/models/cachedimages.go @@ -356,10 +356,6 @@ func (manager *SCachedimageManager) getImageInfo(ctx context.Context, userCred m return manager.getImageByName(ctx, userCred, imageId, refresh) } -func (self *SCachedimage) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.CachedimageDetails, error) { - return api.CachedimageDetails{}, nil -} - func (manager *SCachedimageManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/cloudaccounts.go b/pkg/compute/models/cloudaccounts.go index cb9fd43dc0..26688064d3 100644 --- a/pkg/compute/models/cloudaccounts.go +++ b/pkg/compute/models/cloudaccounts.go @@ -1188,10 +1188,6 @@ func (self *SCloudaccount) getMoreDetails(out api.CloudaccountDetail) api.Clouda return out } -func (self *SCloudaccount) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.CloudaccountDetail, error) { - return api.CloudaccountDetail{}, nil -} - func (manager *SCloudaccountManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/cloudprovider_quotas.go b/pkg/compute/models/cloudprovider_quotas.go index fb14bc2879..d49cb295de 100644 --- a/pkg/compute/models/cloudprovider_quotas.go +++ b/pkg/compute/models/cloudprovider_quotas.go @@ -154,15 +154,6 @@ func (man *SCloudproviderQuotaManager) QueryDistinctExtraField(q *sqlchemy.SQuer return q, httperrors.ErrNotFound } -func (self *SCloudproviderQuota) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudproviderQuotaDetails, error) { - return api.CloudproviderQuotaDetails{}, nil -} - func (manager *SCloudproviderQuotaManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/cloudproviderregions.go b/pkg/compute/models/cloudproviderregions.go index e56440fbc5..2b7651aab7 100644 --- a/pkg/compute/models/cloudproviderregions.go +++ b/pkg/compute/models/cloudproviderregions.go @@ -120,10 +120,6 @@ func (self *SCloudproviderregion) GetRegion() *SCloudregion { return regionObj.(*SCloudregion) } -func (self *SCloudproviderregion) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.CloudproviderregionDetails, error) { - return api.CloudproviderregionDetails{}, nil -} - func (manager *SCloudproviderregionManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/cloudproviders.go b/pkg/compute/models/cloudproviders.go index d5a9f9ca9d..95031f8976 100644 --- a/pkg/compute/models/cloudproviders.go +++ b/pkg/compute/models/cloudproviders.go @@ -974,16 +974,6 @@ func (self *SCloudprovider) getProject(ctx context.Context) *db.STenant { return proj } -func (self *SCloudprovider) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudproviderDetails, error) { - - return api.CloudproviderDetails{}, nil -} - func (manager *SCloudproviderManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/cloudproviderschedtags.go b/pkg/compute/models/cloudproviderschedtags.go index 096a4f4788..3b9986cff8 100644 --- a/pkg/compute/models/cloudproviderschedtags.go +++ b/pkg/compute/models/cloudproviderschedtags.go @@ -17,7 +17,6 @@ package models import ( "context" - "yunion.io/x/jsonutils" "yunion.io/x/pkg/errors" "yunion.io/x/sqlchemy" @@ -64,15 +63,6 @@ func (obj *SCloudproviderschedtag) GetResourceId() string { return obj.CloudproviderId } -func (obj *SCloudproviderschedtag) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CloudproviderschedtagDetails, error) { - return api.CloudproviderschedtagDetails{}, nil -} - func (obj *SCloudproviderschedtag) Delete(ctx context.Context, userCred mcclient.TokenCredential) error { return obj.SSchedtagJointsBase.delete(obj, ctx, userCred) } diff --git a/pkg/compute/models/cloudregionresource.go b/pkg/compute/models/cloudregionresource.go index f4c6630ab0..311051763e 100644 --- a/pkg/compute/models/cloudregionresource.go +++ b/pkg/compute/models/cloudregionresource.go @@ -60,15 +60,6 @@ func (self *SCloudregionResourceBase) GetRegion() *SCloudregion { return region.(*SCloudregion) } -func (self *SCloudregionResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) api.CloudregionResourceInfo { - return api.CloudregionResourceInfo{} -} - func (manager *SCloudregionResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/cloudregions.go b/pkg/compute/models/cloudregions.go index 3c22ae83d2..bc139ea3ac 100644 --- a/pkg/compute/models/cloudregions.go +++ b/pkg/compute/models/cloudregions.go @@ -301,10 +301,6 @@ func (self *SCloudregion) getUsage() api.SCloudregionUsage { return out } -func (self *SCloudregion) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.CloudregionDetails, error) { - return api.CloudregionDetails{}, nil -} - func (manager *SCloudregionManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dbinstance_accounts.go b/pkg/compute/models/dbinstance_accounts.go index 32fffb0d1a..5512f8deba 100644 --- a/pkg/compute/models/dbinstance_accounts.go +++ b/pkg/compute/models/dbinstance_accounts.go @@ -174,10 +174,6 @@ func (self *SDBInstanceAccount) getMoreDetails(ctx context.Context, userCred mcc return out, nil } -func (self *SDBInstanceAccount) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.DBInstanceAccountDetails, error) { - return api.DBInstanceAccountDetails{}, nil -} - func (manager *SDBInstanceAccountManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dbinstance_backups.go b/pkg/compute/models/dbinstance_backups.go index 5a3709290e..78cf62de55 100644 --- a/pkg/compute/models/dbinstance_backups.go +++ b/pkg/compute/models/dbinstance_backups.go @@ -302,15 +302,6 @@ func (self *SDBInstanceBackup) GetDBInstance() (*SDBInstance, error) { return nil, fmt.Errorf("empty dbinstance id") } -func (self *SDBInstanceBackup) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.DBInstanceBackupDetails, error) { - return api.DBInstanceBackupDetails{}, nil -} - func (manager *SDBInstanceBackupManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dbinstance_databases.go b/pkg/compute/models/dbinstance_databases.go index 14b2afbb4d..e0f9917987 100644 --- a/pkg/compute/models/dbinstance_databases.go +++ b/pkg/compute/models/dbinstance_databases.go @@ -295,10 +295,6 @@ func (self *SDBInstanceDatabase) GetDBInstance() (*SDBInstance, error) { return instance.(*SDBInstance), nil } -func (self *SDBInstanceDatabase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.DBInstancedatabaseDetails, error) { - return api.DBInstancedatabaseDetails{}, nil -} - func (manager *SDBInstanceDatabaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dbinstance_parameters.go b/pkg/compute/models/dbinstance_parameters.go index 55e377dec0..e05bd6c649 100644 --- a/pkg/compute/models/dbinstance_parameters.go +++ b/pkg/compute/models/dbinstance_parameters.go @@ -218,10 +218,6 @@ func (manager *SDBInstanceParameterManager) newFromCloudDBInstanceParameter(ctx return nil } -func (self *SDBInstanceParameter) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.DBInstanceparameterDetails, error) { - return api.DBInstanceparameterDetails{}, nil -} - func (manager *SDBInstanceParameterManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dbinstance_secgroups.go b/pkg/compute/models/dbinstance_secgroups.go index b540b767b0..7c4ff29ac9 100644 --- a/pkg/compute/models/dbinstance_secgroups.go +++ b/pkg/compute/models/dbinstance_secgroups.go @@ -128,15 +128,6 @@ func (manager *SDBInstanceSecgroupManager) ListItemExportKeys(ctx context.Contex return q, nil } -func (self *SDBInstanceSecgroup) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.DBInstanceSecgroupDetails, error) { - return api.DBInstanceSecgroupDetails{}, nil -} - func (manager *SDBInstanceSecgroupManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dbinstance_skus.go b/pkg/compute/models/dbinstance_skus.go index f7be84919d..b0d13cae16 100644 --- a/pkg/compute/models/dbinstance_skus.go +++ b/pkg/compute/models/dbinstance_skus.go @@ -189,10 +189,6 @@ func (manager *SDBInstanceSkuManager) ListItemFilter( return q, nil } -func (self *SDBInstanceSku) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.DBInstanceSkuDetails, error) { - return api.DBInstanceSkuDetails{}, nil -} - func (manager *SDBInstanceSkuManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dbinstanceresource.go b/pkg/compute/models/dbinstanceresource.go index 3c6ae96556..7491736f29 100644 --- a/pkg/compute/models/dbinstanceresource.go +++ b/pkg/compute/models/dbinstanceresource.go @@ -76,14 +76,6 @@ func (self *SDBInstanceResourceBase) GetCloudprovider() *SCloudprovider { return vpc.GetCloudprovider() } -func (self *SDBInstanceResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, -) api.DBInstanceResourceInfo { - return api.DBInstanceResourceInfo{} -} - func (manager *SDBInstanceResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dbinstances.go b/pkg/compute/models/dbinstances.go index 9d623b0718..4988d144e2 100644 --- a/pkg/compute/models/dbinstances.go +++ b/pkg/compute/models/dbinstances.go @@ -516,15 +516,6 @@ func (self *SDBInstance) StartDBInstanceCreateTask(ctx context.Context, userCred return nil } -func (self *SDBInstance) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.DBInstanceDetails, error) { - return api.DBInstanceDetails{}, nil -} - func (manager *SDBInstanceManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/diskresource.go b/pkg/compute/models/diskresource.go index 71e879cce4..d97a4d16de 100644 --- a/pkg/compute/models/diskresource.go +++ b/pkg/compute/models/diskresource.go @@ -85,10 +85,6 @@ func (self *SDiskResourceBase) GetRegion() *SCloudregion { return region } -func (self *SDiskResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) api.DiskResourceInfo { - return api.DiskResourceInfo{} -} - func (manager *SDiskResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/disks.go b/pkg/compute/models/disks.go index 3d50cee959..8af785e043 100644 --- a/pkg/compute/models/disks.go +++ b/pkg/compute/models/disks.go @@ -1996,10 +1996,6 @@ func (self *SDisk) getMoreDetails(ctx context.Context, userCred mcclient.TokenCr return out } -func (self *SDisk) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.DiskDetails, error) { - return api.DiskDetails{}, nil -} - func (manager *SDiskManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dns_recordsets.go b/pkg/compute/models/dns_recordsets.go index 0181b53276..ca615a2ea0 100644 --- a/pkg/compute/models/dns_recordsets.go +++ b/pkg/compute/models/dns_recordsets.go @@ -275,15 +275,6 @@ func (manager *SDnsRecordSetManager) ListItemFilter( } // 解析详情 -func (self *SDnsRecordSet) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.DnsRecordSetDetails, error) { - return api.DnsRecordSetDetails{}, nil -} - func (manager *SDnsRecordSetManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dns_trafficpolicy.go b/pkg/compute/models/dns_trafficpolicy.go index 63ba0ae570..40103aba37 100644 --- a/pkg/compute/models/dns_trafficpolicy.go +++ b/pkg/compute/models/dns_trafficpolicy.go @@ -117,15 +117,6 @@ func (self *SDnsTrafficPolicy) AllowUpdateItem(ctx context.Context, userCred mcc } // 详情 -func (self *SDnsTrafficPolicy) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.DnsTrafficPolicyDetails, error) { - return api.DnsTrafficPolicyDetails{}, nil -} - func (manager *SDnsTrafficPolicyManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dns_zonecaches.go b/pkg/compute/models/dns_zonecaches.go index 9bbceffb92..99709f1ba0 100644 --- a/pkg/compute/models/dns_zonecaches.go +++ b/pkg/compute/models/dns_zonecaches.go @@ -138,15 +138,6 @@ func (manager *SDnsZoneCacheManager) ListItemFilter( return q, nil } -func (self *SDnsZoneCache) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.DnsZoneCacheDetails, error) { - return api.DnsZoneCacheDetails{}, nil -} - func (manager *SDnsZoneCacheManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dns_zones.go b/pkg/compute/models/dns_zones.go index 4c6b198b13..45f394dbef 100644 --- a/pkg/compute/models/dns_zones.go +++ b/pkg/compute/models/dns_zones.go @@ -234,15 +234,6 @@ func (self *SDnsZone) PostUpdate(ctx context.Context, userCred mcclient.TokenCre } // 解析详情 -func (self *SDnsZone) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.DnsZoneDetails, error) { - return api.DnsZoneDetails{}, nil -} - func (manager *SDnsZoneManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dnsrecords.go b/pkg/compute/models/dnsrecords.go index 294be4e454..3483ca4ca7 100644 --- a/pkg/compute/models/dnsrecords.go +++ b/pkg/compute/models/dnsrecords.go @@ -543,10 +543,6 @@ func (manager *SDnsRecordManager) QueryDistinctExtraField(q *sqlchemy.SQuery, fi return q, httperrors.ErrNotFound } -func (record *SDnsRecord) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.DnsRecordDetails, error) { - return api.DnsRecordDetails{}, nil -} - func (manager *SDnsRecordManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/dynamicschedtags.go b/pkg/compute/models/dynamicschedtags.go index 276206ef83..cf0532152f 100644 --- a/pkg/compute/models/dynamicschedtags.go +++ b/pkg/compute/models/dynamicschedtags.go @@ -181,15 +181,6 @@ func (self *SDynamicschedtag) ValidateUpdateData(ctx context.Context, userCred m return data, nil } -func (self *SDynamicschedtag) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.DynamicschedtagDetails, error) { - return api.DynamicschedtagDetails{}, nil -} - func (manager *SDynamicschedtagManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/elasticcache_accounts.go b/pkg/compute/models/elasticcache_accounts.go index 11f98e4e9a..6f476dfc90 100644 --- a/pkg/compute/models/elasticcache_accounts.go +++ b/pkg/compute/models/elasticcache_accounts.go @@ -585,15 +585,6 @@ func (manager *SElasticcacheAccountManager) QueryDistinctExtraField(q *sqlchemy. return q, httperrors.ErrNotFound } -func (self *SElasticcacheAccount) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ElasticcacheAccountDetails, error) { - return api.ElasticcacheAccountDetails{}, nil -} - func (manager *SElasticcacheAccountManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/elasticcache_acls.go b/pkg/compute/models/elasticcache_acls.go index 6dae51132f..95f95a52b7 100644 --- a/pkg/compute/models/elasticcache_acls.go +++ b/pkg/compute/models/elasticcache_acls.go @@ -404,15 +404,6 @@ func (manager *SElasticcacheAclManager) QueryDistinctExtraField(q *sqlchemy.SQue return q, httperrors.ErrNotFound } -func (self *SElasticcacheAcl) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ElasticcacheAclDetails, error) { - return api.ElasticcacheAclDetails{}, nil -} - func (manager *SElasticcacheAclManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/elasticcache_backups.go b/pkg/compute/models/elasticcache_backups.go index 07f7d1cb63..f87533be92 100644 --- a/pkg/compute/models/elasticcache_backups.go +++ b/pkg/compute/models/elasticcache_backups.go @@ -418,15 +418,6 @@ func (manager *SElasticcacheBackupManager) QueryDistinctExtraField(q *sqlchemy.S return q, httperrors.ErrNotFound } -func (self *SElasticcacheBackup) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ElasticcacheBackupDetails, error) { - return api.ElasticcacheBackupDetails{}, nil -} - func (manager *SElasticcacheBackupManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/elasticcache_instances.go b/pkg/compute/models/elasticcache_instances.go index 2799285158..a53f0ca44f 100644 --- a/pkg/compute/models/elasticcache_instances.go +++ b/pkg/compute/models/elasticcache_instances.go @@ -198,10 +198,6 @@ func (self *SElasticcache) getCloudProviderInfo() SCloudProviderInfo { return MakeCloudProviderInfo(region, zone, provider) } -func (self *SElasticcache) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.ElasticcacheDetails, error) { - return api.ElasticcacheDetails{}, nil -} - func (manager *SElasticcacheManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/elasticcache_joints.go b/pkg/compute/models/elasticcache_joints.go index f06fa22c8c..cb71fde509 100644 --- a/pkg/compute/models/elasticcache_joints.go +++ b/pkg/compute/models/elasticcache_joints.go @@ -61,15 +61,6 @@ func (manager *SElasticcacheJointsManager) GetMasterFieldName() string { return "elasticcache_id" } -func (self *SElasticcacheJointsBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ElasticcacheJointResourceDetails, error) { - return api.ElasticcacheJointResourceDetails{}, nil -} - func (manager *SElasticcacheJointsManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/elasticcache_parameters.go b/pkg/compute/models/elasticcache_parameters.go index 4267e706e5..70be2cb545 100644 --- a/pkg/compute/models/elasticcache_parameters.go +++ b/pkg/compute/models/elasticcache_parameters.go @@ -317,15 +317,6 @@ func (manager *SElasticcacheParameterManager) QueryDistinctExtraField(q *sqlchem return q, httperrors.ErrNotFound } -func (self *SElasticcacheParameter) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ElasticcacheParameterDetails, error) { - return api.ElasticcacheParameterDetails{}, nil -} - func (manager *SElasticcacheParameterManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/elasticcache_secgroups.go b/pkg/compute/models/elasticcache_secgroups.go index 3087e04e04..06f69054d1 100644 --- a/pkg/compute/models/elasticcache_secgroups.go +++ b/pkg/compute/models/elasticcache_secgroups.go @@ -137,15 +137,6 @@ func (manager *SElasticcachesecgroupManager) ListItemExportKeys(ctx context.Cont return q, nil } -func (self *SElasticcachesecgroup) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ElasticcachesecgroupDetails, error) { - return api.ElasticcachesecgroupDetails{}, nil -} - func (manager *SElasticcachesecgroupManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/elasticcache_skus.go b/pkg/compute/models/elasticcache_skus.go index 31e492f8ba..3c0af0e1e8 100644 --- a/pkg/compute/models/elasticcache_skus.go +++ b/pkg/compute/models/elasticcache_skus.go @@ -119,10 +119,6 @@ func (self SElasticcacheSku) GetGlobalId() string { return self.ExternalId } -func (self *SElasticcacheSku) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.ElasticcacheSkuDetails, error) { - return api.ElasticcacheSkuDetails{}, nil -} - func (manager *SElasticcacheSkuManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/elasticcacheresource.go b/pkg/compute/models/elasticcacheresource.go index b28a27cc5c..132fc9ee25 100644 --- a/pkg/compute/models/elasticcacheresource.go +++ b/pkg/compute/models/elasticcacheresource.go @@ -80,14 +80,6 @@ func (self *SElasticcacheResourceBase) GetIRegion() (cloudprovider.ICloudRegion, return vpc.GetIRegion() } -func (self *SElasticcacheResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, -) api.ElasticcacheResourceInfo { - return api.ElasticcacheResourceInfo{} -} - func (manager *SElasticcacheResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/elasticips.go b/pkg/compute/models/elasticips.go index 9797778fe3..d07221d5f4 100644 --- a/pkg/compute/models/elasticips.go +++ b/pkg/compute/models/elasticips.go @@ -1180,15 +1180,6 @@ func (self *SElasticip) PerformSync(ctx context.Context, userCred mcclient.Token return nil, nil } -func (self *SElasticip) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ElasticipDetails, error) { - return api.ElasticipDetails{}, nil -} - func (manager *SElasticipManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/external_projects.go b/pkg/compute/models/external_projects.go index 895fe3fd48..f2bb4dc699 100644 --- a/pkg/compute/models/external_projects.go +++ b/pkg/compute/models/external_projects.go @@ -78,15 +78,6 @@ func (self *SExternalProject) AllowUpdateItem(ctx context.Context, userCred mccl return false } -func (self *SExternalProject) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ExternalProjectDetails, error) { - return api.ExternalProjectDetails{}, nil -} - func (manager *SExternalProjectManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/globalvpcresource.go b/pkg/compute/models/globalvpcresource.go index 6c5be78ff0..267d86ecbf 100644 --- a/pkg/compute/models/globalvpcresource.go +++ b/pkg/compute/models/globalvpcresource.go @@ -61,10 +61,6 @@ func (self *SGlobalVpcResourceBase) GetGlobalVpc() (*SGlobalVpc, error) { return gv.(*SGlobalVpc), nil } -func (self *SGlobalVpcResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) api.GlobalVpcResourceInfo { - return api.GlobalVpcResourceInfo{} -} - func (manager *SGlobalVpcResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/globalvpcs.go b/pkg/compute/models/globalvpcs.go index 25076eeda8..ba710b31a8 100644 --- a/pkg/compute/models/globalvpcs.go +++ b/pkg/compute/models/globalvpcs.go @@ -87,10 +87,6 @@ func (self *SGlobalVpc) GetVpcCount() (int, error) { return self.GetVpcQuery().CountWithError() } -func (self *SGlobalVpc) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.GlobalVpcDetails, error) { - return api.GlobalVpcDetails{}, nil -} - func (manager *SGlobalVpcManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/groupguests.go b/pkg/compute/models/groupguests.go index 5fe7625486..2ae8b38c9e 100644 --- a/pkg/compute/models/groupguests.go +++ b/pkg/compute/models/groupguests.go @@ -62,15 +62,6 @@ func (manager *SGroupguestManager) GetSlaveFieldName() string { return "guest_id" } -func (self *SGroupguest) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.GroupguestDetails, error) { - return api.GroupguestDetails{}, nil -} - func (manager *SGroupguestManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/groupjoints.go b/pkg/compute/models/groupjoints.go index 08564dd94b..762f537e4f 100644 --- a/pkg/compute/models/groupjoints.go +++ b/pkg/compute/models/groupjoints.go @@ -62,15 +62,6 @@ func (self *SGroupJointsBase) GetGroup() *SGroup { return guest.(*SGroup) } -func (self *SGroupJointsBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.GroupJointResourceDetails, error) { - return api.GroupJointResourceDetails{}, nil -} - func (manager *SGroupJointsManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/groupnetworks.go b/pkg/compute/models/groupnetworks.go index 271ba2b27a..993cb81de3 100644 --- a/pkg/compute/models/groupnetworks.go +++ b/pkg/compute/models/groupnetworks.go @@ -67,15 +67,6 @@ func (manager *SGroupnetworkManager) GetSlaveFieldName() string { return "network_id" } -func (self *SGroupnetwork) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.GroupnetworkDetails, error) { - return api.GroupnetworkDetails{}, nil -} - func (manager *SGroupnetworkManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/groupresource.go b/pkg/compute/models/groupresource.go index 330014eaae..09d3cb0e82 100644 --- a/pkg/compute/models/groupresource.go +++ b/pkg/compute/models/groupresource.go @@ -60,10 +60,6 @@ func (self *SGroupResourceBase) GetGroup() *SGroup { return nil } -func (self *SGroupResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) api.GroupResourceInfo { - return api.GroupResourceInfo{} -} - func (manager *SGroupResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/groups.go b/pkg/compute/models/groups.go index 563c93f63c..b408985c06 100644 --- a/pkg/compute/models/groups.go +++ b/pkg/compute/models/groups.go @@ -192,15 +192,6 @@ func (sm *SGroupManager) FetchCustomizeColumns( return rows } -func (group *SGroup) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.InstanceGroupDetail, error) { - return api.InstanceGroupDetail{}, nil -} - func (group *SGroup) GetGuestCount() int { q := GroupguestManager.Query().Equals("group_id", group.Id) count, _ := q.CountWithError() diff --git a/pkg/compute/models/guest_template.go b/pkg/compute/models/guest_template.go index 42197bdb6c..b023dcdc72 100644 --- a/pkg/compute/models/guest_template.go +++ b/pkg/compute/models/guest_template.go @@ -328,15 +328,6 @@ func (manager *SGuestTemplateManager) FetchCustomizeColumns( return rows } -func (gt *SGuestTemplate) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (computeapis.GuestTemplateDetails, error) { - return computeapis.GuestTemplateDetails{}, nil -} - func (gt *SGuestTemplate) getMoreDetails(ctx context.Context, userCred mcclient.TokenCredential, out computeapis.GuestTemplateDetails) (computeapis.GuestTemplateDetails, error) { diff --git a/pkg/compute/models/guestdisks.go b/pkg/compute/models/guestdisks.go index 3a01fb4394..88b08cc5b0 100644 --- a/pkg/compute/models/guestdisks.go +++ b/pkg/compute/models/guestdisks.go @@ -106,15 +106,6 @@ func (self *SGuestdisk) ValidateUpdateData(ctx context.Context, userCred mcclien return input, nil } -func (self *SGuestdisk) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.GuestDiskDetails, error) { - return api.GuestDiskDetails{}, nil -} - func (manager *SGuestdiskManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/guestjoints.go b/pkg/compute/models/guestjoints.go index 25e26d4ce9..ec64fde8be 100644 --- a/pkg/compute/models/guestjoints.go +++ b/pkg/compute/models/guestjoints.go @@ -62,15 +62,6 @@ func (manager *SGuestJointsManager) GetMasterFieldName() string { return "guest_id" } -func (self *SGuestJointsBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.GuestJointResourceDetails, error) { - return api.GuestJointResourceDetails{}, nil -} - func (manager *SGuestJointsManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/guestnetworks.go b/pkg/compute/models/guestnetworks.go index e2543d446e..bb1755ac96 100644 --- a/pkg/compute/models/guestnetworks.go +++ b/pkg/compute/models/guestnetworks.go @@ -108,15 +108,6 @@ func (manager *SGuestnetworkManager) GetSlaveFieldName() string { return "network_id" } -func (self *SGuestnetwork) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.GuestnetworkDetails, error) { - return api.GuestnetworkDetails{}, nil -} - func (manager *SGuestnetworkManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/guestresource.go b/pkg/compute/models/guestresource.go index 26663fb73f..e738924d9b 100644 --- a/pkg/compute/models/guestresource.go +++ b/pkg/compute/models/guestresource.go @@ -85,10 +85,6 @@ func (self *SGuestResourceBase) GetRegion() *SCloudregion { return region } -func (self *SGuestResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) api.GuestResourceInfo { - return api.GuestResourceInfo{} -} - func (manager *SGuestResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/guests.go b/pkg/compute/models/guests.go index 484eb08364..ad0a67093f 100644 --- a/pkg/compute/models/guests.go +++ b/pkg/compute/models/guests.go @@ -2012,10 +2012,6 @@ func (self *SGuestManager) GetMetadataHiddenKeys() []string { } } -func (self *SGuest) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.ServerDetails, error) { - return api.ServerDetails{}, nil -} - func (manager *SGuestManager) ListItemExportKeys(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, keys stringutils2.SSortedStrings) (*sqlchemy.SQuery, error) { var err error q, err = manager.SVirtualResourceBaseManager.ListItemExportKeys(ctx, q, userCred, keys) diff --git a/pkg/compute/models/guestsecgroups.go b/pkg/compute/models/guestsecgroups.go index 97a7c5e265..db7e7d6e1e 100644 --- a/pkg/compute/models/guestsecgroups.go +++ b/pkg/compute/models/guestsecgroups.go @@ -136,15 +136,6 @@ func (manager *SGuestsecgroupManager) ListItemExportKeys(ctx context.Context, return q, nil } -func (self *SGuestsecgroup) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.GuestsecgroupDetails, error) { - return api.GuestsecgroupDetails{}, nil -} - func (manager *SGuestsecgroupManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/hostjoints.go b/pkg/compute/models/hostjoints.go index 3ae5bc43c7..128187b069 100644 --- a/pkg/compute/models/hostjoints.go +++ b/pkg/compute/models/hostjoints.go @@ -80,15 +80,6 @@ func (self *SHostJointsBase) AllowDeleteItem(ctx context.Context, userCred mccli return db.IsAdminAllowDelete(userCred, self) } -func (self *SHostJointsBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.HostJointResourceDetails, error) { - return api.HostJointResourceDetails{}, nil -} - func (manager *SHostJointsManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/hostnetworks.go b/pkg/compute/models/hostnetworks.go index bb6e0a3b93..9e3ce66ba2 100644 --- a/pkg/compute/models/hostnetworks.go +++ b/pkg/compute/models/hostnetworks.go @@ -72,15 +72,6 @@ func (manager *SHostnetworkManager) GetSlaveFieldName() string { return "network_id" } -func (bn *SHostnetwork) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.HostnetworkDetails, error) { - return api.HostnetworkDetails{}, nil -} - func (manager *SHostnetworkManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/hostresource.go b/pkg/compute/models/hostresource.go index 172f22c932..db1bd1dcd9 100644 --- a/pkg/compute/models/hostresource.go +++ b/pkg/compute/models/hostresource.go @@ -70,10 +70,6 @@ func (manager *SHostResourceBaseManager) getHostIdFieldName() string { return "host_id" } -func (self *SHostResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) api.HostResourceInfo { - return api.HostResourceInfo{} -} - func (manager *SHostResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/hosts.go b/pkg/compute/models/hosts.go index 2485043228..514c254f3f 100644 --- a/pkg/compute/models/hosts.go +++ b/pkg/compute/models/hosts.go @@ -2994,10 +2994,6 @@ func (self *SHost) GetMetadataHiddenKeys() []string { return []string{} } -func (self *SHost) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.HostDetails, error) { - return api.HostDetails{}, nil -} - func (manager *SHostManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/hostschedtags.go b/pkg/compute/models/hostschedtags.go index 0404d85b77..0af541e118 100644 --- a/pkg/compute/models/hostschedtags.go +++ b/pkg/compute/models/hostschedtags.go @@ -17,7 +17,6 @@ package models import ( "context" - "yunion.io/x/jsonutils" "yunion.io/x/pkg/errors" "yunion.io/x/sqlchemy" @@ -61,15 +60,6 @@ func (manager *SHostschedtagManager) GetMasterFieldName() string { return "host_id" } -func (self *SHostschedtag) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.HostschedtagDetails, error) { - return api.HostschedtagDetails{}, nil -} - func (self *SHostschedtag) GetDetails(base api.SchedtagJointResourceDetails, resourceName string, isList bool) interface{} { out := api.HostschedtagDetails{ SchedtagJointResourceDetails: base, diff --git a/pkg/compute/models/hoststorages.go b/pkg/compute/models/hoststorages.go index 7315e7a62f..5806733566 100644 --- a/pkg/compute/models/hoststorages.go +++ b/pkg/compute/models/hoststorages.go @@ -85,15 +85,6 @@ func (manager *SHoststorageManager) GetSlaveFieldName() string { return "storage_id" } -func (self *SHoststorage) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.HoststorageDetails, error) { - return api.HoststorageDetails{}, nil -} - func (manager *SHoststorageManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/hostwires.go b/pkg/compute/models/hostwires.go index 037e0debae..b71c4f9a3b 100644 --- a/pkg/compute/models/hostwires.go +++ b/pkg/compute/models/hostwires.go @@ -77,10 +77,6 @@ func (manager *SHostwireManager) GetSlaveFieldName() string { return "wire_id" } -func (self *SHostwire) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.HostwireDetails, error) { - return api.HostwireDetails{}, nil -} - func (manager *SHostwireManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/instance_snapshots.go b/pkg/compute/models/instance_snapshots.go index 69ab9f1d1c..81c9497275 100644 --- a/pkg/compute/models/instance_snapshots.go +++ b/pkg/compute/models/instance_snapshots.go @@ -257,10 +257,6 @@ func (self *SInstanceSnapshot) getMoreDetails(userCred mcclient.TokenCredential, return out } -func (self *SInstanceSnapshot) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.InstanceSnapshotDetails, error) { - return api.InstanceSnapshotDetails{}, nil -} - func (manager *SInstanceSnapshotManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/inter_vpc_network.go b/pkg/compute/models/inter_vpc_network.go index c8042cf078..ad747c1732 100644 --- a/pkg/compute/models/inter_vpc_network.go +++ b/pkg/compute/models/inter_vpc_network.go @@ -131,15 +131,6 @@ func (self *SInterVpcNetwork) PostCreate(ctx context.Context, userCred mcclient. task.ScheduleRun(nil) } -func (self *SInterVpcNetwork) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.InterVpcNetworkDetails, error) { - return api.InterVpcNetworkDetails{}, nil -} - func (manager *SInterVpcNetworkManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/inter_vpc_network_routeset.go b/pkg/compute/models/inter_vpc_network_routeset.go index fab0322b3b..91bcc4596b 100644 --- a/pkg/compute/models/inter_vpc_network_routeset.go +++ b/pkg/compute/models/inter_vpc_network_routeset.go @@ -230,15 +230,6 @@ func (manager *SInterVpcNetworkRouteSetManager) QueryDistinctExtraField(q *sqlch return q, httperrors.ErrNotFound } -func (self *SInterVpcNetworkRouteSet) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.InterVpcNetworkRouteSetDetails, error) { - return api.InterVpcNetworkRouteSetDetails{}, nil -} - func (manager *SInterVpcNetworkRouteSetManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/isolated_devices.go b/pkg/compute/models/isolated_devices.go index db79d3a3c4..6c17b8f8b6 100644 --- a/pkg/compute/models/isolated_devices.go +++ b/pkg/compute/models/isolated_devices.go @@ -658,10 +658,6 @@ func (self *SIsolatedDevice) getGuest() *SGuest { return nil } -func (self *SIsolatedDevice) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.IsolateDeviceDetails, error) { - return api.IsolateDeviceDetails{}, nil -} - func (manager *SIsolatedDeviceManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/keypairs.go b/pkg/compute/models/keypairs.go index 621a7ac6d2..c84128eea1 100644 --- a/pkg/compute/models/keypairs.go +++ b/pkg/compute/models/keypairs.go @@ -113,15 +113,6 @@ func (manager *SKeypairManager) QueryDistinctExtraField(q *sqlchemy.SQuery, fiel return q, httperrors.ErrNotFound } -func (self *SKeypair) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.KeypairDetails, error) { - return api.KeypairDetails{}, nil -} - func (manager *SKeypairManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalanceraclresource.go b/pkg/compute/models/loadbalanceraclresource.go index f29cfcb21a..e69341266c 100644 --- a/pkg/compute/models/loadbalanceraclresource.go +++ b/pkg/compute/models/loadbalanceraclresource.go @@ -60,15 +60,6 @@ func (self *SLoadbalancerAclResourceBase) GetAcl() *SLoadbalancerAcl { return acl.(*SLoadbalancerAcl) } -func (self *SLoadbalancerAclResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) api.LoadbalancerAclResourceInfo { - return api.LoadbalancerAclResourceInfo{} -} - func (manager *SLoadbalancerAclResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalanceracls.go b/pkg/compute/models/loadbalanceracls.go index 8ba3aa88a4..0b6a55979f 100644 --- a/pkg/compute/models/loadbalanceracls.go +++ b/pkg/compute/models/loadbalanceracls.go @@ -288,15 +288,6 @@ func (lbacl *SLoadbalancerAcl) PostCreate(ctx context.Context, userCred mcclient lbacl.SetStatus(userCred, api.LB_STATUS_ENABLED, "") } -func (lbacl *SLoadbalancerAcl) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.LoadbalancerAclDetails, error) { - return api.LoadbalancerAclDetails{}, nil -} - func (manager *SLoadbalancerAclManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalanceragents.go b/pkg/compute/models/loadbalanceragents.go index b120776ed0..27a1c520ab 100644 --- a/pkg/compute/models/loadbalanceragents.go +++ b/pkg/compute/models/loadbalanceragents.go @@ -727,15 +727,6 @@ func (lbagent *SLoadbalancerAgent) ValidateUpdateData(ctx context.Context, userC return data, nil } -func (lbagent *SLoadbalancerAgent) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.LoadbalancerAgentDetails, error) { - return api.LoadbalancerAgentDetails{}, nil -} - func (manager *SLoadbalancerAgentManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancerbackendgroupresource.go b/pkg/compute/models/loadbalancerbackendgroupresource.go index 10982a0612..1c739f37fb 100644 --- a/pkg/compute/models/loadbalancerbackendgroupresource.go +++ b/pkg/compute/models/loadbalancerbackendgroupresource.go @@ -110,14 +110,6 @@ func (self *SLoadbalancerBackendgroupResourceBase) GetZone() *SZone { return nil } -func (self *SLoadbalancerBackendgroupResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, -) api.LoadbalancerBackendGroupResourceInfo { - return api.LoadbalancerBackendGroupResourceInfo{} -} - func (manager *SLoadbalancerBackendgroupResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancerbackendgroups.go b/pkg/compute/models/loadbalancerbackendgroups.go index b63237b4e0..754d350536 100644 --- a/pkg/compute/models/loadbalancerbackendgroups.go +++ b/pkg/compute/models/loadbalancerbackendgroups.go @@ -464,15 +464,6 @@ func (lbbg *SLoadbalancerBackendGroup) ValidatePurgeCondition(ctx context.Contex return nil } -func (lbbg *SLoadbalancerBackendGroup) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.LoadbalancerBackendGroupDetails, error) { - return api.LoadbalancerBackendGroupDetails{}, nil -} - func (man *SLoadbalancerBackendGroupManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancerbackends.go b/pkg/compute/models/loadbalancerbackends.go index f493841980..020d3c53e9 100644 --- a/pkg/compute/models/loadbalancerbackends.go +++ b/pkg/compute/models/loadbalancerbackends.go @@ -389,15 +389,6 @@ func (lbb *SLoadbalancerBackend) getVpc(ctx context.Context) (*SVpc, error) { return vpc, nil } -func (lbb *SLoadbalancerBackend) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.LoadbalancerBackendDetails, error) { - return api.LoadbalancerBackendDetails{}, nil -} - func (manager *SLoadbalancerBackendManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancercachedacls.go b/pkg/compute/models/loadbalancercachedacls.go index f654b28a4b..2357340c0b 100644 --- a/pkg/compute/models/loadbalancercachedacls.go +++ b/pkg/compute/models/loadbalancercachedacls.go @@ -218,15 +218,6 @@ func (lbacl *SCachedLoadbalancerAcl) GetListener() (*SLoadbalancerListener, erro return listener.(*SLoadbalancerListener), nil } -func (lbacl *SCachedLoadbalancerAcl) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CachedLoadbalancerAclDetails, error) { - return api.CachedLoadbalancerAclDetails{}, nil -} - func (man *SCachedLoadbalancerAclManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancercachedcertificates.go b/pkg/compute/models/loadbalancercachedcertificates.go index b15dbfb084..6041fd5662 100644 --- a/pkg/compute/models/loadbalancercachedcertificates.go +++ b/pkg/compute/models/loadbalancercachedcertificates.go @@ -201,15 +201,6 @@ func (self *SCachedLoadbalancerCertificate) PostCreate(ctx context.Context, user return } -func (self *SCachedLoadbalancerCertificate) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CachedLoadbalancerCertificateDetails, error) { - return api.CachedLoadbalancerCertificateDetails{}, nil -} - func (man *SCachedLoadbalancerCertificateManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancercertificateresource.go b/pkg/compute/models/loadbalancercertificateresource.go index 67819c85f4..f2258115ac 100644 --- a/pkg/compute/models/loadbalancercertificateresource.go +++ b/pkg/compute/models/loadbalancercertificateresource.go @@ -60,15 +60,6 @@ func (self *SLoadbalancerCertificateResourceBase) GetCertificate() *SLoadbalance return cert.(*SLoadbalancerCertificate) } -func (self *SLoadbalancerCertificateResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) api.LoadbalancerCertificateResourceInfo { - return api.LoadbalancerCertificateResourceInfo{} -} - func (manager *SLoadbalancerCertificateResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancercertificates.go b/pkg/compute/models/loadbalancercertificates.go index 05536e7c10..dcebe6a67f 100644 --- a/pkg/compute/models/loadbalancercertificates.go +++ b/pkg/compute/models/loadbalancercertificates.go @@ -122,15 +122,6 @@ func (lbcert *SLoadbalancerCertificate) PostCreate(ctx context.Context, userCred lbcert.SetStatus(userCred, api.LB_STATUS_ENABLED, "") } -func (lbcert *SLoadbalancerCertificate) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.LoadbalancerCertificateDetails, error) { - return api.LoadbalancerCertificateDetails{}, nil -} - func (lbcert *SLoadbalancerCertificate) IsComplete() bool { return lbcert.PrivateKey != "" && lbcert.Certificate != "" } diff --git a/pkg/compute/models/loadbalancerclusterresource.go b/pkg/compute/models/loadbalancerclusterresource.go index 7a446ec31c..3f34b89ddb 100644 --- a/pkg/compute/models/loadbalancerclusterresource.go +++ b/pkg/compute/models/loadbalancerclusterresource.go @@ -63,15 +63,6 @@ func (self *SLoadbalancerClusterResourceBase) GetLoadbalancerCluster() *SLoadbal return cluster.(*SLoadbalancerCluster) } -func (self *SLoadbalancerClusterResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) api.LoadbalancerClusterResourceInfo { - return api.LoadbalancerClusterResourceInfo{} -} - func (manager *SLoadbalancerClusterResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancerclusters.go b/pkg/compute/models/loadbalancerclusters.go index 275bd1e104..6b289587b0 100644 --- a/pkg/compute/models/loadbalancerclusters.go +++ b/pkg/compute/models/loadbalancerclusters.go @@ -225,15 +225,6 @@ func (lbc *SLoadbalancerCluster) ValidateDeleteCondition(ctx context.Context) er return lbc.SStandaloneResourceBase.ValidateDeleteCondition(ctx) } -func (lbc *SLoadbalancerCluster) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.LoadbalancerClusterDetails, error) { - return api.LoadbalancerClusterDetails{}, nil -} - func (man *SLoadbalancerClusterManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancerlistenerresource.go b/pkg/compute/models/loadbalancerlistenerresource.go index 38f0bce945..ddbe3c4a0e 100644 --- a/pkg/compute/models/loadbalancerlistenerresource.go +++ b/pkg/compute/models/loadbalancerlistenerresource.go @@ -86,15 +86,6 @@ func (self *SLoadbalancerListenerResourceBase) GetProviderName() string { return "" } -func (self *SLoadbalancerListenerResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) api.LoadbalancerListenerResourceInfo { - return api.LoadbalancerListenerResourceInfo{} -} - func (manager *SLoadbalancerListenerResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancerlistenerrules.go b/pkg/compute/models/loadbalancerlistenerrules.go index 3a588792d6..7582808512 100644 --- a/pkg/compute/models/loadbalancerlistenerrules.go +++ b/pkg/compute/models/loadbalancerlistenerrules.go @@ -588,15 +588,6 @@ func (lbr *SLoadbalancerListenerRule) ValidateUpdateData(ctx context.Context, us return region.GetDriver().ValidateUpdateLoadbalancerListenerRuleData(ctx, userCred, data, backendGroupV.Model) } -func (lbr *SLoadbalancerListenerRule) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.LoadbalancerListenerRuleDetails, error) { - return api.LoadbalancerListenerRuleDetails{}, nil -} - func (lbr *SLoadbalancerListenerRule) getMoreDetails(out api.LoadbalancerListenerRuleDetails) (api.LoadbalancerListenerRuleDetails, error) { if lbr.BackendGroupId == "" { log.Errorf("loadbalancer listener rule %s(%s): empty backend group field", lbr.Name, lbr.Id) diff --git a/pkg/compute/models/loadbalancerlisteners.go b/pkg/compute/models/loadbalancerlisteners.go index bef2f76c9e..850a738aee 100644 --- a/pkg/compute/models/loadbalancerlisteners.go +++ b/pkg/compute/models/loadbalancerlisteners.go @@ -493,15 +493,6 @@ func (lblis *SLoadbalancerListener) StartLoadBalancerListenerSyncTask(ctx contex return nil } -func (lblis *SLoadbalancerListener) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.LoadbalancerListenerDetails, error) { - return api.LoadbalancerListenerDetails{}, nil -} - func (lblis *SLoadbalancerListener) getMoreDetails(out api.LoadbalancerListenerDetails) (api.LoadbalancerListenerDetails, error) { { if lblis.BackendGroupId != "" { diff --git a/pkg/compute/models/loadbalancernetworks.go b/pkg/compute/models/loadbalancernetworks.go index 2392c12cde..f7dc44c2b3 100644 --- a/pkg/compute/models/loadbalancernetworks.go +++ b/pkg/compute/models/loadbalancernetworks.go @@ -208,15 +208,6 @@ func (ln *SLoadbalancerNetwork) Detach(ctx context.Context, userCred mcclient.To return db.DetachJoint(ctx, userCred, ln) } -func (ln *SLoadbalancerNetwork) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.LoadbalancernetworkDetails, error) { - return api.LoadbalancernetworkDetails{}, nil -} - func (manager *SLoadbalancernetworkManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancerresource.go b/pkg/compute/models/loadbalancerresource.go index 7d6b2d60ed..3ae1610b1d 100644 --- a/pkg/compute/models/loadbalancerresource.go +++ b/pkg/compute/models/loadbalancerresource.go @@ -133,10 +133,6 @@ func (self *SLoadbalancerResourceBase) GetZone() *SZone { return nil } -func (self *SLoadbalancerResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) api.LoadbalancerResourceInfo { - return api.LoadbalancerResourceInfo{} -} - func (manager *SLoadbalancerResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/loadbalancers.go b/pkg/compute/models/loadbalancers.go index 11edee5fdd..d804c546f7 100644 --- a/pkg/compute/models/loadbalancers.go +++ b/pkg/compute/models/loadbalancers.go @@ -686,15 +686,6 @@ func (lb *SLoadbalancerManager) FetchZone1ResourceInfos(ctx context.Context, return rows } -func (lb *SLoadbalancer) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.LoadbalancerDetails, error) { - return api.LoadbalancerDetails{}, nil -} - func (lb *SLoadbalancer) getMoreDetails(out api.LoadbalancerDetails) (api.LoadbalancerDetails, error) { eip, _ := lb.GetEip() if eip != nil { diff --git a/pkg/compute/models/managedresource.go b/pkg/compute/models/managedresource.go index 45794df85a..a257d117e3 100644 --- a/pkg/compute/models/managedresource.go +++ b/pkg/compute/models/managedresource.go @@ -181,10 +181,6 @@ func (self *SManagedResourceBase) CanShareToDomain(domainId string) bool { } } -func (self *SManagedResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) api.ManagedResourceInfo { - return api.ManagedResourceInfo{} -} - func (manager *SManagedResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/natdtable.go b/pkg/compute/models/natdtable.go index da1d9e0e58..36c4faf606 100644 --- a/pkg/compute/models/natdtable.go +++ b/pkg/compute/models/natdtable.go @@ -305,15 +305,6 @@ func (manager *SNatDEntryManager) newFromCloudNatDTable(ctx context.Context, use return &table, nil } -func (self *SNatDEntry) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.NatDEntryDetails, error) { - return api.NatDEntryDetails{}, nil -} - func (manager *SNatDEntryManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/natgatewayresource.go b/pkg/compute/models/natgatewayresource.go index ad5e412fbd..42782e7231 100644 --- a/pkg/compute/models/natgatewayresource.go +++ b/pkg/compute/models/natgatewayresource.go @@ -68,10 +68,6 @@ func (self *SNatgatewayResourceBase) GetVpc() (*SVpc, error) { return nat.GetVpc() } -func (self *SNatgatewayResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) api.NatGatewayResourceInfo { - return api.NatGatewayResourceInfo{} -} - func (manager *SNatgatewayResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/natgateways.go b/pkg/compute/models/natgateways.go index 25bb589896..251e3bdbe2 100644 --- a/pkg/compute/models/natgateways.go +++ b/pkg/compute/models/natgateways.go @@ -356,10 +356,6 @@ func (self *SNatGateway) GetDTableSize(filter func(q *sqlchemy.SQuery) *sqlchemy return q.CountWithError() } -func (self *SNatGateway) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.NatgatewayDetails, error) { - return api.NatgatewayDetails{}, nil -} - func (manager SNatGatewayManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, @@ -846,15 +842,6 @@ func (man *SNatEntryManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field s return q, httperrors.ErrNotFound } -func (entry *SNatEntry) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.NatEntryDetails, error) { - return api.NatEntryDetails{}, nil -} - func (manager *SNatEntryManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/natstable.go b/pkg/compute/models/natstable.go index e61a8d6523..050e1c46d1 100644 --- a/pkg/compute/models/natstable.go +++ b/pkg/compute/models/natstable.go @@ -372,10 +372,6 @@ func (manager *SNatSEntryManager) newFromCloudNatSTable(ctx context.Context, use return &table, nil } -func (self *SNatSEntry) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.NatSEntryDetails, error) { - return api.NatSEntryDetails{}, nil -} - func (manager *SNatSEntryManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/networkinterfaces.go b/pkg/compute/models/networkinterfaces.go index f85e5788de..8eaca4f67a 100644 --- a/pkg/compute/models/networkinterfaces.go +++ b/pkg/compute/models/networkinterfaces.go @@ -156,15 +156,6 @@ func (manager *SNetworkInterfaceManager) QueryDistinctExtraField(q *sqlchemy.SQu return q, httperrors.ErrNotFound } -func (self *SNetworkInterface) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.NetworkInterfaceDetails, error) { - return api.NetworkInterfaceDetails{}, nil -} - func (self *SNetworkInterface) getMoreDetails(out api.NetworkInterfaceDetails) (api.NetworkInterfaceDetails, error) { networks, err := self.GetNetworks() if err != nil { diff --git a/pkg/compute/models/networkresource.go b/pkg/compute/models/networkresource.go index 9e38cc5b1d..5e8e9b7692 100644 --- a/pkg/compute/models/networkresource.go +++ b/pkg/compute/models/networkresource.go @@ -93,10 +93,6 @@ func (self *SNetworkResourceBase) GetRegion() *SCloudregion { return region } -func (self *SNetworkResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.NetworkResourceInfo, error) { - return api.NetworkResourceInfo{}, nil -} - func (manager *SNetworkResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/networks.go b/pkg/compute/models/networks.go index ecf4079d05..6a547027a1 100644 --- a/pkg/compute/models/networks.go +++ b/pkg/compute/models/networks.go @@ -1196,15 +1196,6 @@ func (self *SNetwork) getMoreDetails(ctx context.Context, out api.NetworkDetails return out, nil } -func (self *SNetwork) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.NetworkDetails, error) { - return api.NetworkDetails{}, nil -} - func (manager *SNetworkManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/networkschedtags.go b/pkg/compute/models/networkschedtags.go index 945472306c..54877ddde3 100644 --- a/pkg/compute/models/networkschedtags.go +++ b/pkg/compute/models/networkschedtags.go @@ -17,7 +17,6 @@ package models import ( "context" - "yunion.io/x/jsonutils" "yunion.io/x/pkg/errors" "yunion.io/x/sqlchemy" @@ -65,15 +64,6 @@ func (s *SNetworkschedtag) GetResourceId() string { return s.NetworkId } -func (s *SNetworkschedtag) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.NetworkschedtagDetails, error) { - return api.NetworkschedtagDetails{}, nil -} - func (s *SNetworkschedtag) GetDetails(base api.SchedtagJointResourceDetails, resourceName string, isList bool) interface{} { out := api.NetworkschedtagDetails{ SchedtagJointResourceDetails: base, diff --git a/pkg/compute/models/policy_definition.go b/pkg/compute/models/policy_definition.go index 872658ede0..ac7276eaaa 100644 --- a/pkg/compute/models/policy_definition.go +++ b/pkg/compute/models/policy_definition.go @@ -95,10 +95,6 @@ func (manager *SPolicyDefinitionManager) QueryDistinctExtraField(q *sqlchemy.SQu return q, httperrors.ErrNotFound } -func (self *SPolicyDefinition) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.PolicyDefinitionDetails, error) { - return api.PolicyDefinitionDetails{}, nil -} - func (manager *SPolicyDefinitionManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool) []api.PolicyDefinitionDetails { rows := make([]api.PolicyDefinitionDetails, len(objs)) statusRows := manager.SStatusStandaloneResourceBaseManager.FetchCustomizeColumns(ctx, userCred, query, objs, fields, isList) diff --git a/pkg/compute/models/reservedips.go b/pkg/compute/models/reservedips.go index e7a70e5b79..0cc042ea3c 100644 --- a/pkg/compute/models/reservedips.go +++ b/pkg/compute/models/reservedips.go @@ -197,10 +197,6 @@ func (self *SReservedip) Release(ctx context.Context, userCred mcclient.TokenCre return err } -func (self *SReservedip) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.ReservedipDetails, error) { - return api.ReservedipDetails{}, nil -} - func (manager *SReservedipManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/routetables.go b/pkg/compute/models/routetables.go index 39dd83e213..c8b6535c06 100644 --- a/pkg/compute/models/routetables.go +++ b/pkg/compute/models/routetables.go @@ -310,10 +310,6 @@ func (rt *SRouteTable) PerformDelRoutes(ctx context.Context, userCred mcclient.T return nil, nil } -func (rt *SRouteTable) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.RouteTableDetails, error) { - return api.RouteTableDetails{}, nil -} - func (manager *SRouteTableManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/scaling_activity.go b/pkg/compute/models/scaling_activity.go index 00bb8391b2..2f878272c6 100644 --- a/pkg/compute/models/scaling_activity.go +++ b/pkg/compute/models/scaling_activity.go @@ -167,11 +167,6 @@ func (sam *SScalingActivityManager) FetchCustomizeColumns( return rows } -func (sam *SScalingActivity) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, - query jsonutils.JSONObject, isList bool) (compute.ScalingActivityDetails, error) { - return compute.ScalingActivityDetails{}, nil -} - func (sam *SScalingActivityManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, input compute.ScalingActivityListInput) (*sqlchemy.SQuery, error) { diff --git a/pkg/compute/models/scaling_group.go b/pkg/compute/models/scaling_group.go index d7e971b31b..b273f11013 100644 --- a/pkg/compute/models/scaling_group.go +++ b/pkg/compute/models/scaling_group.go @@ -339,11 +339,6 @@ func (sgm *SScalingGroupManager) ListItemFilter(ctx context.Context, q *sqlchemy return q, nil } -func (sgm *SScalingGroup) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, - query jsonutils.JSONObject, isList bool) (api.ScalingGroupDetails, error) { - return api.ScalingGroupDetails{}, nil -} - func (sgm *SScalingGroupManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/scaling_policy.go b/pkg/compute/models/scaling_policy.go index 8569e03f9b..2b26dbc5b1 100644 --- a/pkg/compute/models/scaling_policy.go +++ b/pkg/compute/models/scaling_policy.go @@ -134,11 +134,6 @@ func (spm *SScalingPolicyManager) OrderByExtraFields(ctx context.Context, q *sql return spm.SVirtualResourceBaseManager.OrderByExtraFields(ctx, q, userCred, query.VirtualResourceListInput) } -func (sgm *SScalingPolicy) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, - query jsonutils.JSONObject, isList bool) (api.ScalingGroupDetails, error) { - return api.ScalingGroupDetails{}, nil -} - func (spm *SScalingPolicyManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/schedpolicies.go b/pkg/compute/models/schedpolicies.go index bdd2e75b17..e2b15386c6 100644 --- a/pkg/compute/models/schedpolicies.go +++ b/pkg/compute/models/schedpolicies.go @@ -130,10 +130,6 @@ func (self *SSchedpolicy) getSchedtag() *SSchedtag { return obj.(*SSchedtag) } -func (self *SSchedpolicy) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.SchedpolicyDetails, error) { - return api.SchedpolicyDetails{}, nil -} - func (manager *SSchedpolicyManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/schedtagjoint.go b/pkg/compute/models/schedtagjoint.go index 65087a826d..32f1d0ae2f 100644 --- a/pkg/compute/models/schedtagjoint.go +++ b/pkg/compute/models/schedtagjoint.go @@ -140,16 +140,6 @@ func (joint *SSchedtagJointsBase) GetSchedtagId() string { return joint.SchedtagId } -func (joint *SSchedtagJointsBase) GetExtraDetails( - obj db.IJointModel, - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.SchedtagJointResourceDetails, error) { - return api.SchedtagJointResourceDetails{}, nil -} - func (manager *SSchedtagJointsManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/schedtagresource.go b/pkg/compute/models/schedtagresource.go index e4c75fa971..97e647c0a7 100644 --- a/pkg/compute/models/schedtagresource.go +++ b/pkg/compute/models/schedtagresource.go @@ -60,15 +60,6 @@ func (self *SSchedtagResourceBase) GetSchedtag() *SSchedtag { return obj.(*SSchedtag) } -func (self *SSchedtagResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) api.SchedtagResourceInfo { - return api.SchedtagResourceInfo{} -} - func (manager *SSchedtagResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/schedtags.go b/pkg/compute/models/schedtags.go index a65dafd4b0..61ffe6a722 100644 --- a/pkg/compute/models/schedtags.go +++ b/pkg/compute/models/schedtags.go @@ -500,15 +500,6 @@ func (self *SSchedtag) getMoreColumns(out api.SchedtagDetails) api.SchedtagDetai return out } -func (self *SSchedtag) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.SchedtagDetails, error) { - return api.SchedtagDetails{}, nil -} - func (manager *SSchedtagManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/scheduled_tasks.go b/pkg/compute/models/scheduled_tasks.go index e10cbab97f..367bad3d3e 100644 --- a/pkg/compute/models/scheduled_tasks.go +++ b/pkg/compute/models/scheduled_tasks.go @@ -105,11 +105,6 @@ func (stm *SScheduledTaskManager) OrderByExtraFields(ctx context.Context, q *sql return stm.SVirtualResourceBaseManager.OrderByExtraFields(ctx, q, userCred, query.VirtualResourceListInput) } -func (stm *SScheduledTask) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, - query jsonutils.JSONObject, isList bool) (api.ScheduledTaskDetails, error) { - return api.ScheduledTaskDetails{}, nil -} - func (stm *SScheduledTaskManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/scheduledtask_activity.go b/pkg/compute/models/scheduledtask_activity.go index 6c82d08e92..847effaa8f 100644 --- a/pkg/compute/models/scheduledtask_activity.go +++ b/pkg/compute/models/scheduledtask_activity.go @@ -97,10 +97,6 @@ func (sam *SScheduledTaskActivityManager) FetchCustomizeColumns( return rows } -func (sa *SScheduledTaskActivity) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.ScheduledTaskActivityDetails, error) { - return api.ScheduledTaskActivityDetails{}, nil -} - func (sam *SScheduledTaskActivityManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, input api.ScheduledTaskActivityListInput) (*sqlchemy.SQuery, error) { q, err := sam.SStatusStandaloneResourceBaseManager.ListItemFilter(ctx, q, userCred, input.StatusStandaloneResourceListInput) if err != nil { diff --git a/pkg/compute/models/secgroupcache.go b/pkg/compute/models/secgroupcache.go index 70148374fe..3df8617561 100644 --- a/pkg/compute/models/secgroupcache.go +++ b/pkg/compute/models/secgroupcache.go @@ -225,15 +225,6 @@ func (self *SSecurityGroupCache) GetVpc() (*SVpc, error) { return vpc.(*SVpc), nil } -func (self *SSecurityGroupCache) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.SecurityGroupCacheDetails, error) { - return api.SecurityGroupCacheDetails{}, nil -} - func (manager *SSecurityGroupCacheManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/secgroupresource.go b/pkg/compute/models/secgroupresource.go index 9162ed496f..b7a3021366 100644 --- a/pkg/compute/models/secgroupresource.go +++ b/pkg/compute/models/secgroupresource.go @@ -60,15 +60,6 @@ func (self *SSecurityGroupResourceBase) GetSecGroup() *SSecurityGroup { return secgrp.(*SSecurityGroup) } -func (self *SSecurityGroupResourceBaseManager) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) api.SecurityGroupResourceInfo { - return api.SecurityGroupResourceInfo{} -} - func (manager *SSecurityGroupResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/secgrouprules.go b/pkg/compute/models/secgrouprules.go index 6bb2f8b91d..bee17b3c75 100644 --- a/pkg/compute/models/secgrouprules.go +++ b/pkg/compute/models/secgrouprules.go @@ -177,15 +177,6 @@ func (manager *SSecurityGroupRuleManager) ListItemFilter( return sql, nil } -func (self *SSecurityGroupRule) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.SecgroupRuleDetails, error) { - return api.SecgroupRuleDetails{}, nil -} - func (manager *SSecurityGroupRuleManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/secgroups.go b/pkg/compute/models/secgroups.go index fadcc44b28..8fa6f9d0a8 100644 --- a/pkg/compute/models/secgroups.go +++ b/pkg/compute/models/secgroups.go @@ -519,15 +519,6 @@ func (manager *SSecurityGroupManager) FetchCustomizeColumns( return rows } -func (self *SSecurityGroup) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.SecgroupDetails, error) { - return api.SecgroupDetails{}, nil -} - func (manager *SSecurityGroupManager) ValidateCreateData( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/service_catalog.go b/pkg/compute/models/service_catalog.go index 3a144d7a1a..42d6e0ad39 100644 --- a/pkg/compute/models/service_catalog.go +++ b/pkg/compute/models/service_catalog.go @@ -239,12 +239,3 @@ func (manager *SServiceCatalogManager) FetchCustomizeColumns( return rows } - -func (self *SServiceCatalog) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (computeapis.ServiceCatalogDetails, error) { - return computeapis.ServiceCatalogDetails{}, nil -} diff --git a/pkg/compute/models/skus.go b/pkg/compute/models/skus.go index e985d9776e..3d83fb4321 100644 --- a/pkg/compute/models/skus.go +++ b/pkg/compute/models/skus.go @@ -238,10 +238,6 @@ func (self *SServerSku) AllowGetDetails(ctx context.Context, userCred mcclient.T return true } -func (self *SServerSku) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.ServerSkuDetails, error) { - return api.ServerSkuDetails{}, nil -} - func (self *SServerSku) getTotalGuestCount() int { // count var count int diff --git a/pkg/compute/models/snapshotpolicy.go b/pkg/compute/models/snapshotpolicy.go index 4e3b802eb2..b965e74292 100644 --- a/pkg/compute/models/snapshotpolicy.go +++ b/pkg/compute/models/snapshotpolicy.go @@ -369,15 +369,6 @@ func (manager *SSnapshotPolicyManager) FetchCustomizeColumns( return rows } -func (sp *SSnapshotPolicy) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.SnapshotPolicyDetails, error) { - return api.SnapshotPolicyDetails{}, nil -} - func (sp *SSnapshotPolicy) ExecuteNotify(ctx context.Context, userCred mcclient.TokenCredential, diskName string) { notifyclient.EventNotify(ctx, userCred, notifyclient.SEventNotifyParam{ Obj: sp, diff --git a/pkg/compute/models/snapshotpolicycache.go b/pkg/compute/models/snapshotpolicycache.go index f638788f08..042d0d39b9 100644 --- a/pkg/compute/models/snapshotpolicycache.go +++ b/pkg/compute/models/snapshotpolicycache.go @@ -227,15 +227,6 @@ func (spcm *SSnapshotPolicyCacheManager) FetchCustomizeColumns( return rows } -func (spc *SSnapshotPolicyCache) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.SnapshotPolicyCacheDetails, error) { - return api.SnapshotPolicyCacheDetails{}, nil -} - // =============================================== detach and delete =================================================== func (spc *SSnapshotPolicyCache) RealDetele(ctx context.Context, userCred mcclient.TokenCredential) error { diff --git a/pkg/compute/models/snapshotpolicydisks.go b/pkg/compute/models/snapshotpolicydisks.go index e49eb43387..ef3f6494ea 100644 --- a/pkg/compute/models/snapshotpolicydisks.go +++ b/pkg/compute/models/snapshotpolicydisks.go @@ -101,15 +101,6 @@ func (sd *SSnapshotPolicyDisk) SetStatus(userCred mcclient.TokenCredential, stat return nil } -func (self *SSnapshotPolicyDisk) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.SnapshotPolicyDiskDetails, error) { - return api.SnapshotPolicyDiskDetails{}, nil -} - func (manager *SSnapshotPolicyDiskManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, @@ -150,7 +141,8 @@ func (manager *SSnapshotPolicyDiskManager) FetchCustomizeColumns( rows[i].Snapshotpolicy = name } if disk, ok := disks[diskIds[i]]; ok { - rows[i].Disk, _ = disk.GetExtraDetails(ctx, userCred, query, isList) + rows[i].Disk = api.DiskDetails{} + jsonutils.Update(&rows[i].Disk, disk) } } diff --git a/pkg/compute/models/snapshotpolicyresource.go b/pkg/compute/models/snapshotpolicyresource.go index 0b7cf82819..e76faab308 100644 --- a/pkg/compute/models/snapshotpolicyresource.go +++ b/pkg/compute/models/snapshotpolicyresource.go @@ -60,15 +60,6 @@ func (self *SSnapshotPolicyResourceBase) GetSnapshotPolicy() *SSnapshotPolicy { return spObj.(*SSnapshotPolicy) } -func (self *SSnapshotPolicyResourceBase) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) api.SnapshotPolicyResourceInfo { - return api.SnapshotPolicyResourceInfo{} -} - func (manager *SSnapshotPolicyResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/snapshots.go b/pkg/compute/models/snapshots.go index 7423b842fe..dc861a0f7a 100644 --- a/pkg/compute/models/snapshots.go +++ b/pkg/compute/models/snapshots.go @@ -296,15 +296,6 @@ func (manager *SSnapshotManager) FetchCustomizeColumns( return rows } -func (self *SSnapshot) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.SnapshotDetails, error) { - return api.SnapshotDetails{}, nil -} - func (self *SSnapshot) getMoreDetails(out api.SnapshotDetails) api.SnapshotDetails { if IStorage, _ := StorageManager.FetchById(self.StorageId); IStorage != nil { storage := IStorage.(*SStorage) diff --git a/pkg/compute/models/storagecachedimages.go b/pkg/compute/models/storagecachedimages.go index 44b588d53e..2110be4623 100644 --- a/pkg/compute/models/storagecachedimages.go +++ b/pkg/compute/models/storagecachedimages.go @@ -140,15 +140,6 @@ func (self *SStoragecachedimage) GetHost() (*SHost, error) { return sc.GetHost() } -func (self *SStoragecachedimage) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.StoragecachedimageDetails, error) { - return api.StoragecachedimageDetails{}, nil -} - func (manager *SStoragecachedimageManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/storagecaches.go b/pkg/compute/models/storagecaches.go index 96e1b31fa6..3f19d22cb3 100644 --- a/pkg/compute/models/storagecaches.go +++ b/pkg/compute/models/storagecaches.go @@ -297,15 +297,6 @@ func (manager *SStoragecacheManager) FetchCustomizeColumns( return rows } -func (self *SStoragecache) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.StoragecacheDetails, error) { - return api.StoragecacheDetails{}, nil -} - func (self *SStoragecache) getMoreDetails(ctx context.Context, out api.StoragecacheDetails) api.StoragecacheDetails { out.Storages = self.getStorageNames() out.Size = self.getCachedImageSize() diff --git a/pkg/compute/models/storageresource.go b/pkg/compute/models/storageresource.go index e43bc3b0cf..25a82e9afb 100644 --- a/pkg/compute/models/storageresource.go +++ b/pkg/compute/models/storageresource.go @@ -62,10 +62,6 @@ func (self *SStorageResourceBase) GetStorage() *SStorage { return obj.(*SStorage) } -func (self *SStorageResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) api.StorageResourceInfo { - return api.StorageResourceInfo{} -} - func (manager *SStorageResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/storages.go b/pkg/compute/models/storages.go index 8d19efad2f..1134570dd3 100644 --- a/pkg/compute/models/storages.go +++ b/pkg/compute/models/storages.go @@ -437,10 +437,6 @@ func (self *SStorage) getMoreDetails(ctx context.Context, out api.StorageDetails return out } -func (self *SStorage) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.StorageDetails, error) { - return api.StorageDetails{}, nil -} - func (manager *SStorageManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/storageschedtags.go b/pkg/compute/models/storageschedtags.go index 4d4aed6dfd..8f6b8654b5 100644 --- a/pkg/compute/models/storageschedtags.go +++ b/pkg/compute/models/storageschedtags.go @@ -17,7 +17,6 @@ package models import ( "context" - "yunion.io/x/jsonutils" "yunion.io/x/pkg/errors" "yunion.io/x/sqlchemy" @@ -65,15 +64,6 @@ func (joint *SStorageschedtag) GetResourceId() string { return joint.StorageId } -func (joint *SStorageschedtag) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.StorageschedtagDetails, error) { - return api.StorageschedtagDetails{}, nil -} - func (joint *SStorageschedtag) GetDetails(base api.SchedtagJointResourceDetails, resourceName string, isList bool) interface{} { out := api.StorageschedtagDetails{ SchedtagJointResourceDetails: base, diff --git a/pkg/compute/models/vpc_peering_connections.go b/pkg/compute/models/vpc_peering_connections.go index 4c3cb44207..b6db16b065 100644 --- a/pkg/compute/models/vpc_peering_connections.go +++ b/pkg/compute/models/vpc_peering_connections.go @@ -243,15 +243,6 @@ func (manager *SVpcPeeringConnectionManager) QueryDistinctExtraField(q *sqlchemy return q, httperrors.ErrNotFound } -func (self *SVpcPeeringConnection) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.VpcPeeringConnectionDetails, error) { - return api.VpcPeeringConnectionDetails{}, nil -} - func (manager *SVpcPeeringConnectionManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/vpcresource.go b/pkg/compute/models/vpcresource.go index f5d8e436dd..247e995c8d 100644 --- a/pkg/compute/models/vpcresource.go +++ b/pkg/compute/models/vpcresource.go @@ -103,10 +103,6 @@ func (self *SVpcResourceBase) GetProviderName() string { return vpc.GetProviderName() } -func (self *SVpcResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) api.VpcResourceInfo { - return api.VpcResourceInfo{} -} - func (manager *SVpcResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/vpcs.go b/pkg/compute/models/vpcs.go index f5e6eed3a5..d227468e39 100644 --- a/pkg/compute/models/vpcs.go +++ b/pkg/compute/models/vpcs.go @@ -392,15 +392,6 @@ func (self *SVpc) getZoneByExternalId(externalId string) (*SZone, error) { return nil, fmt.Errorf("found %d duplicate zones by externalId %s in cloudregion %s(%s)", len(zones), externalId, region.Name, region.Id) } -func (self *SVpc) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.VpcDetails, error) { - return api.VpcDetails{}, nil -} - func (manager *SVpcManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/wireresource.go b/pkg/compute/models/wireresource.go index ae5a2ac7ea..6ad6b1f122 100644 --- a/pkg/compute/models/wireresource.go +++ b/pkg/compute/models/wireresource.go @@ -96,10 +96,6 @@ func (self *SWireResourceBase) GetZone() *SZone { return nil } -func (self *SWireResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) api.WireResourceInfo { - return api.WireResourceInfo{} -} - func (manager *SWireResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/wires.go b/pkg/compute/models/wires.go index 5a2be9c3c2..23e34b3dc7 100644 --- a/pkg/compute/models/wires.go +++ b/pkg/compute/models/wires.go @@ -1375,10 +1375,6 @@ func (manager *SWireManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field s return nil }*/ -func (self *SWire) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.WireDetails, error) { - return api.WireDetails{}, nil -} - func (manager *SWireManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/zoneresource.go b/pkg/compute/models/zoneresource.go index 5b564c7619..0ad999d399 100644 --- a/pkg/compute/models/zoneresource.go +++ b/pkg/compute/models/zoneresource.go @@ -56,10 +56,6 @@ func (self *SZoneResourceBase) GetZone() *SZone { return ZoneManager.FetchZoneById(self.ZoneId) } -func (self *SZoneResourceBase) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) api.ZoneResourceInfo { - return api.ZoneResourceInfo{} -} - func (manager *SZoneResourceBaseManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/compute/models/zones.go b/pkg/compute/models/zones.go index 33628bd97c..29346d616e 100644 --- a/pkg/compute/models/zones.go +++ b/pkg/compute/models/zones.go @@ -170,10 +170,6 @@ func (manager *SZoneManager) FetchCustomizeColumns( return rows } -func (zone *SZone) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.ZoneDetails, error) { - return api.ZoneDetails{}, nil -} - func (zone *SZone) GetCloudproviderId() string { return "" } diff --git a/pkg/compute/models/zoneschedtags.go b/pkg/compute/models/zoneschedtags.go index 4e4a01ffdb..855304d2f9 100644 --- a/pkg/compute/models/zoneschedtags.go +++ b/pkg/compute/models/zoneschedtags.go @@ -17,7 +17,6 @@ package models import ( "context" - "yunion.io/x/jsonutils" "yunion.io/x/pkg/errors" "yunion.io/x/sqlchemy" @@ -72,15 +71,6 @@ func (obj *SZoneschedtag) GetResourceId() string { return obj.ZoneId } -func (obj *SZoneschedtag) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ZoneschedtagDetails, error) { - return api.ZoneschedtagDetails{}, nil -} - func (m *SZoneschedtagManager) ListItemFilter( ctx context.Context, q *sqlchemy.SQuery, diff --git a/pkg/image/models/image_guest.go b/pkg/image/models/image_guest.go index fcfe1aa8ed..0fbe5c7d69 100644 --- a/pkg/image/models/image_guest.go +++ b/pkg/image/models/image_guest.go @@ -344,15 +344,6 @@ func (self *SGuestImage) getMoreDetails(ctx context.Context, userCred mcclient.T return out } -func (self *SGuestImage) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.GuestImageDetails, error) { - return api.GuestImageDetails{}, nil -} - func (manager *SGuestImageManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/image/models/images.go b/pkg/image/models/images.go index c2de39740b..ac73fcbf77 100644 --- a/pkg/image/models/images.go +++ b/pkg/image/models/images.go @@ -300,15 +300,6 @@ func (manager *SImageManager) FetchCustomizeColumns( return rows } -func (self *SImage) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ImageDetails, error) { - return api.ImageDetails{}, nil -} - func (self *SImage) GetExtraDetailsHeaders(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) map[string]string { headers := make(map[string]string) diff --git a/pkg/keystone/models/credentials.go b/pkg/keystone/models/credentials.go index 1e4043946d..205b3dc272 100644 --- a/pkg/keystone/models/credentials.go +++ b/pkg/keystone/models/credentials.go @@ -179,15 +179,6 @@ func (self *SCredential) ValidateUpdateData(ctx context.Context, userCred mcclie return input, nil } -func (self *SCredential) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.CredentialDetails, error) { - return api.CredentialDetails{}, nil -} - func (manager *SCredentialManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/keystone/models/domains.go b/pkg/keystone/models/domains.go index c3bf91d17b..8ebe9c78b6 100644 --- a/pkg/keystone/models/domains.go +++ b/pkg/keystone/models/domains.go @@ -347,15 +347,6 @@ func (domain *SDomain) ValidateUpdateData(ctx context.Context, userCred mcclient return input, nil } -func (domain *SDomain) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.DomainDetails, error) { - return api.DomainDetails{}, nil -} - func (manager *SDomainManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/keystone/models/endpoints.go b/pkg/keystone/models/endpoints.go index cdf01ddbd7..e02c5a63dc 100644 --- a/pkg/keystone/models/endpoints.go +++ b/pkg/keystone/models/endpoints.go @@ -389,19 +389,6 @@ func (cata SServiceCatalog) GetKeystoneCatalogV2() mcclient.KeystoneServiceCatal return results } -func (endpoint *SEndpoint) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.EndpointDetails, error) { - res, err := endpoint.getMoreDetails(api.EndpointDetails{}) - if err != nil { - return api.EndpointDetails{}, err - } - return res, nil -} - func (endpoint *SEndpoint) getMoreDetails(details api.EndpointDetails) (api.EndpointDetails, error) { if len(endpoint.ServiceCertificateId) > 0 { cert, _ := endpoint.getServiceCertificate() diff --git a/pkg/keystone/models/groups.go b/pkg/keystone/models/groups.go index b4698c3894..799f94eb72 100644 --- a/pkg/keystone/models/groups.go +++ b/pkg/keystone/models/groups.go @@ -194,15 +194,6 @@ func (group *SGroup) Delete(ctx context.Context, userCred mcclient.TokenCredenti return group.SIdentityBaseResource.Delete(ctx, userCred) } -func (group *SGroup) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.GroupDetails, error) { - return api.GroupDetails{}, nil -} - func (manager *SGroupManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/keystone/models/identity_provider.go b/pkg/keystone/models/identity_provider.go index 6585b22f8d..11d3c09ecc 100644 --- a/pkg/keystone/models/identity_provider.go +++ b/pkg/keystone/models/identity_provider.go @@ -586,15 +586,6 @@ func (self *SIdentityProvider) PerformSync(ctx context.Context, userCred mcclien return nil, nil } -func (self *SIdentityProvider) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.IdentityProviderDetails, error) { - return api.IdentityProviderDetails{}, nil -} - func (manager *SIdentityProviderManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/keystone/models/identitybase.go b/pkg/keystone/models/identitybase.go index ef804ba628..50d10ee013 100644 --- a/pkg/keystone/models/identitybase.go +++ b/pkg/keystone/models/identitybase.go @@ -301,15 +301,6 @@ func (model *SEnabledIdentityBaseResource) ValidateUpdateData( return rbacutils.ScopeSystem }*/ -func (model *SIdentityBaseResource) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.IdentityBaseResourceDetails, error) { - return api.IdentityBaseResourceDetails{}, nil -} - func (manager *SIdentityBaseResourceManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, @@ -353,15 +344,6 @@ func (manager *SIdentityBaseResourceManager) FetchCustomizeColumns( return rows } -func (model *SEnabledIdentityBaseResource) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.EnabledIdentityBaseResourceDetails, error) { - return api.EnabledIdentityBaseResourceDetails{}, nil -} - func (manager *SEnabledIdentityBaseResourceManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/keystone/models/policies.go b/pkg/keystone/models/policies.go index 35ba3c3383..83e71684d9 100644 --- a/pkg/keystone/models/policies.go +++ b/pkg/keystone/models/policies.go @@ -525,15 +525,6 @@ func (manager *SPolicyManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field return q, httperrors.ErrNotFound } -func (policy *SPolicy) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.PolicyDetails, error) { - return api.PolicyDetails{}, nil -} - func (manager *SPolicyManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/keystone/models/projects.go b/pkg/keystone/models/projects.go index 8dbf0f0765..d5f2d63ecf 100644 --- a/pkg/keystone/models/projects.go +++ b/pkg/keystone/models/projects.go @@ -375,15 +375,6 @@ func (manager *SProjectManager) FetchCustomizeColumns( return rows } -func (proj *SProject) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ProjectDetails, error) { - return api.ProjectDetails{}, nil -} - func projectExtra(proj *SProject, out api.ProjectDetails) api.ProjectDetails { out.GroupCount, _ = proj.GetGroupCount() out.UserCount, _ = proj.GetUserCount() diff --git a/pkg/keystone/models/regions.go b/pkg/keystone/models/regions.go index fff4f2d643..fc84eaa9d7 100644 --- a/pkg/keystone/models/regions.go +++ b/pkg/keystone/models/regions.go @@ -104,10 +104,6 @@ func (region *SRegion) ValidateDeleteCondition(ctx context.Context) error { return region.SStandaloneResourceBase.ValidateDeleteCondition(ctx) } -func (region *SRegion) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.RegionDetails, error) { - return api.RegionDetails{}, nil -} - func (manager *SRegionManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/keystone/models/rolepolicies.go b/pkg/keystone/models/rolepolicies.go index fb8b97c646..fc304c00ef 100644 --- a/pkg/keystone/models/rolepolicies.go +++ b/pkg/keystone/models/rolepolicies.go @@ -267,15 +267,6 @@ func (manager *SRolePolicyManager) QueryDistinctExtraField(q *sqlchemy.SQuery, f return q, httperrors.ErrNotFound } -func (policy *SRolePolicy) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.RolePolicyDetails, error) { - return api.RolePolicyDetails{}, nil -} - func (manager *SRolePolicyManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/keystone/models/roles.go b/pkg/keystone/models/roles.go index e28a0e1531..c24364942b 100644 --- a/pkg/keystone/models/roles.go +++ b/pkg/keystone/models/roles.go @@ -213,15 +213,6 @@ func (role *SRole) ValidateDeleteCondition(ctx context.Context) error { return role.SIdentityBaseResource.ValidateDeleteCondition(ctx) } -func (role *SRole) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.RoleDetails, error) { - return api.RoleDetails{}, nil -} - func (manager *SRoleManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/keystone/models/services.go b/pkg/keystone/models/services.go index 0c545160b9..01f07c8ac1 100644 --- a/pkg/keystone/models/services.go +++ b/pkg/keystone/models/services.go @@ -138,15 +138,6 @@ func (manager *SServiceManager) FetchCustomizeColumns( return rows } -func (service *SService) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ServiceDetails, error) { - return api.ServiceDetails{}, nil -} - func (service *SService) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) { service.SStandaloneResourceBase.PostCreate(ctx, userCred, ownerId, query, data) logclient.AddActionLogWithContext(ctx, service, logclient.ACT_CREATE, data, userCred, true) diff --git a/pkg/keystone/models/users.go b/pkg/keystone/models/users.go index 5aa7bd5677..b5801c9787 100644 --- a/pkg/keystone/models/users.go +++ b/pkg/keystone/models/users.go @@ -633,15 +633,6 @@ func (manager *SUserManager) FetchCustomizeColumns( return rows } -func (user *SUser) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.UserDetails, error) { - return api.UserDetails{}, nil -} - func userExtra(user *SUser, out api.UserDetails) api.UserDetails { out.GroupCount, _ = user.GetGroupCount() out.ProjectCount, _ = user.GetProjectCount() diff --git a/pkg/monitor/models/alert.go b/pkg/monitor/models/alert.go index f27a9b9761..8e305e0b4e 100644 --- a/pkg/monitor/models/alert.go +++ b/pkg/monitor/models/alert.go @@ -336,15 +336,6 @@ func (man *SAlertManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field stri return q, httperrors.ErrNotFound } -func (a *SAlert) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (monitor.AlertDetails, error) { - return monitor.AlertDetails{}, nil -} - func (man *SAlertManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/monitor/models/alertnotification.go b/pkg/monitor/models/alertnotification.go index 216b6b13b1..6d3a228804 100644 --- a/pkg/monitor/models/alertnotification.go +++ b/pkg/monitor/models/alertnotification.go @@ -153,15 +153,6 @@ func (joint *SAlertnotification) getExtraDetails(noti SNotification, out monitor return out } -func (joint *SAlertnotification) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (monitor.AlertnotificationDetails, error) { - return monitor.AlertnotificationDetails{}, nil -} - func (joint *SAlertnotification) DoSave(ctx context.Context, userCred mcclient.TokenCredential) error { if err := AlertNotificationManager.TableSpec().Insert(ctx, joint); err != nil { return err diff --git a/pkg/monitor/models/nodealert.go b/pkg/monitor/models/nodealert.go index af01851a29..2cf8744549 100644 --- a/pkg/monitor/models/nodealert.go +++ b/pkg/monitor/models/nodealert.go @@ -486,15 +486,6 @@ func (man *SV1AlertManager) FetchCustomizeColumns( return rows } -func (alert *SV1Alert) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (monitor.AlertV1Details, error) { - return monitor.AlertV1Details{}, nil -} - const ( V1AlertDisabledStatus = "Disabled" V1AlertEnabledStatus = "Enabled" @@ -582,15 +573,6 @@ func (man *SNodeAlertManager) FetchCustomizeColumns( return rows } -func (alert *SNodeAlert) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (monitor.NodeAlertDetails, error) { - return monitor.NodeAlertDetails{}, nil -} - func (alert *SNodeAlert) getMoreDetails(out monitor.NodeAlertDetails) (monitor.NodeAlertDetails, error) { var err error out.AlertV1Details, err = alert.SV1Alert.getMoreDetails(out.AlertV1Details, AlertNotificationUsedByNodeAlert) diff --git a/pkg/notify/interface.go b/pkg/notify/interface.go index 41929669b0..02514599f1 100644 --- a/pkg/notify/interface.go +++ b/pkg/notify/interface.go @@ -68,7 +68,7 @@ type SNotification struct { ContactType string Topic string Message string - Event notify_apis.SEvent + Event notify_apis.SNotifyEvent AdvanceDays int } diff --git a/pkg/notify/models/config.go b/pkg/notify/models/config.go index 7b58b7cb46..a79978126e 100644 --- a/pkg/notify/models/config.go +++ b/pkg/notify/models/config.go @@ -299,10 +299,6 @@ func (self *SConfigManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQue return q, nil } -func (cm *SConfigManager) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.ConfigDetails, error) { - return api.ConfigDetails{}, nil -} - func (cm *SConfigManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/notify/models/event_template.go b/pkg/notify/models/event_template.go index f16729fa69..f86c3d146f 100644 --- a/pkg/notify/models/event_template.go +++ b/pkg/notify/models/event_template.go @@ -164,7 +164,7 @@ func (lt *SLocalTemplateManager) FillWithTemplate(ctx context.Context, lang stri var action2Topic = make(map[string]string, 0) -func specTopic(event api.SEvent) string { +func specTopic(event api.SNotifyEvent) string { switch event.Action() { case api.ActionRebuildRoot, api.ActionChangeIpaddr, api.ActionResetPassword: return string(api.ActionUpdate) @@ -183,7 +183,7 @@ func init() { action2Topic[string(api.ActionChangeIpaddr)] = string(api.ActionUpdate) } -func (lt *SLocalTemplateManager) fillWithTemplate(ctx context.Context, titleOrContent string, contactType string, lang string, event api.SEvent, dis jsonutils.JSONObject) (string, error) { +func (lt *SLocalTemplateManager) fillWithTemplate(ctx context.Context, titleOrContent string, contactType string, lang string, event api.SNotifyEvent, dis jsonutils.JSONObject) (string, error) { var ( tmpl *template.Template err error diff --git a/pkg/notify/models/notification.go b/pkg/notify/models/notification.go index 65c2b156e4..a081245027 100644 --- a/pkg/notify/models/notification.go +++ b/pkg/notify/models/notification.go @@ -476,15 +476,6 @@ func (nm *SNotificationManager) FetchCustomizeColumns( return rows } -func (n *SNotification) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.NotificationDetails, error) { - return api.NotificationDetails{}, nil -} - func (n *SNotification) ReceiverNotificationsNotOK() ([]SReceiverNotification, error) { rnq := ReceiverNotificationManager.Query().Equals("notification_id", n.Id).NotEquals("status", api.RECEIVER_NOTIFICATION_OK) rns := make([]SReceiverNotification, 0, 1) diff --git a/pkg/notify/models/receiver.go b/pkg/notify/models/receiver.go index 3f91d69b37..d4378c42fc 100644 --- a/pkg/notify/models/receiver.go +++ b/pkg/notify/models/receiver.go @@ -1302,15 +1302,6 @@ func (rm *SReceiverManager) FetchByIdOrNames(ctx context.Context, idOrNames ...s return receivers, nil } -func (r *SReceiver) GetExtraDetails( - ctx context.Context, - userCred mcclient.TokenCredential, - query jsonutils.JSONObject, - isList bool, -) (api.ReceiverDetails, error) { - return api.ReceiverDetails{}, nil -} - func (r *SReceiver) SetContact(cType string, contact string) error { if err := r.PullCache(false); err != nil { return err diff --git a/pkg/notify/models/template.go b/pkg/notify/models/template.go index 14ad66e3c7..deafbc960c 100644 --- a/pkg/notify/models/template.go +++ b/pkg/notify/models/template.go @@ -455,7 +455,3 @@ func (t *STemplate) ValidateUpdateData(ctx context.Context, userCred mcclient.To } return input, nil } - -func (t *STemplate) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.TemplateDetails, error) { - return api.TemplateDetails{}, nil -} diff --git a/pkg/notify/models/topic.go b/pkg/notify/models/topic.go index 9c13350718..bcfa6da62d 100644 --- a/pkg/notify/models/topic.go +++ b/pkg/notify/models/topic.go @@ -35,11 +35,11 @@ import ( "yunion.io/x/onecloud/pkg/util/stringutils2" ) -func parseEvent(es string) (notify.SEvent, error) { +func parseEvent(es string) (notify.SNotifyEvent, error) { es = strings.ToLower(es) ess := strings.Split(es, notify.DelimiterInEvent) if len(ess) != 2 && len(ess) != 3 { - return notify.SEvent{}, fmt.Errorf("invalid event string %q", es) + return notify.SNotifyEvent{}, fmt.Errorf("invalid event string %q", es) } event := notify.Event.WithResourceType(ess[0]).WithAction(notify.SAction(ess[1])) if len(ess) == 3 { diff --git a/pkg/yunionconf/models/scopedpolicies.go b/pkg/yunionconf/models/scopedpolicies.go index da34422bce..f75b9c1cde 100644 --- a/pkg/yunionconf/models/scopedpolicies.go +++ b/pkg/yunionconf/models/scopedpolicies.go @@ -152,10 +152,6 @@ func (manager *SScopedPolicyManager) QueryDistinctExtraField(q *sqlchemy.SQuery, return q, httperrors.ErrNotFound } -func (self *SScopedPolicy) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.ScopedPolicyDetails, error) { - return api.ScopedPolicyDetails{}, nil -} - func (manager *SScopedPolicyManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, diff --git a/pkg/yunionconf/models/scopedpolicybindings.go b/pkg/yunionconf/models/scopedpolicybindings.go index e5b9c3f4b8..e45e06adce 100644 --- a/pkg/yunionconf/models/scopedpolicybindings.go +++ b/pkg/yunionconf/models/scopedpolicybindings.go @@ -326,10 +326,6 @@ func (manager *SScopedPolicyBindingManager) QueryDistinctExtraField(q *sqlchemy. return q, httperrors.ErrNotFound } -func (self *SScopedPolicyBinding) GetExtraDetails(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, isList bool) (api.ScopedPolicyBindingDetails, error) { - return api.ScopedPolicyBindingDetails{}, nil -} - func (manager *SScopedPolicyBindingManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential,