fix: cleanup compute options 20240615 (#20548)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2024-06-17 00:42:30 +08:00
committed by GitHub
parent bae7791792
commit 04d4e084b1
30 changed files with 159 additions and 101 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
@@ -17,13 +17,14 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
cmd := shell.NewResourceCmd(&modules.DBInstanceAccounts).WithKeyword("dbinstance-account")
cmd.List(&options.DBInstanceAccountListOptions{})
cmd.Update(&options.BaseUpdateOptions{})
cmd.Update(&baseoptions.BaseUpdateOptions{})
cmd.Show(&options.DBInstanceAccountIdOptions{})
cmd.Delete(&options.DBInstanceAccountIdOptions{})
}
@@ -17,13 +17,14 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
cmd := shell.NewResourceCmd(&modules.DBInstanceDatabases).WithKeyword("dbinstance-database")
cmd.List(&options.DBInstanceDatabaseListOptions{})
cmd.Update(&options.BaseUpdateOptions{})
cmd.Update(&baseoptions.BaseUpdateOptions{})
cmd.Delete(&options.DBInstanceDatabaseIdOptions{})
cmd.Show(&options.DBInstanceDatabaseIdOptions{})
cmd.Create(&options.DBInstanceDatabaseCreateOptions{})
+1 -1
View File
@@ -17,7 +17,7 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
+13 -13
View File
@@ -41,7 +41,7 @@ func init() {
cmd.PerformWithKeyword("disable-auth", "update-auth-mode", &compute.ElasticCacheDisableAuthOptions{})
type ElasticCacheAccountResetPasswordOptions struct {
options.ElasticCacheIdOptions
compute.ElasticCacheIdOptions
PASSWORD string `help:"elastic cache account password."`
}
@@ -77,7 +77,7 @@ func init() {
return nil
})
R(&options.ElasticCacheAccountCreateOptions{}, "elastic-cache-account-create", "Create elastisc cache account", func(s *mcclient.ClientSession, opts *options.ElasticCacheAccountCreateOptions) error {
R(&compute.ElasticCacheAccountCreateOptions{}, "elastic-cache-account-create", "Create elastisc cache account", func(s *mcclient.ClientSession, opts *compute.ElasticCacheAccountCreateOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
@@ -92,7 +92,7 @@ func init() {
return nil
})
R(&options.ElasticCacheIdOptions{}, "elastic-cache-account-delete", "Delete elastisc cache account", func(s *mcclient.ClientSession, opts *options.ElasticCacheIdOptions) error {
R(&compute.ElasticCacheIdOptions{}, "elastic-cache-account-delete", "Delete elastisc cache account", func(s *mcclient.ClientSession, opts *compute.ElasticCacheIdOptions) error {
result, err := modules.ElasticCacheAccount.Delete(s, opts.ID, nil)
if err != nil {
return err
@@ -102,7 +102,7 @@ func init() {
return nil
})
R(&options.ElasticCacheBackupCreateOptions{}, "elastic-cache-backup-create", "Create elastisc cache backup", func(s *mcclient.ClientSession, opts *options.ElasticCacheBackupCreateOptions) error {
R(&compute.ElasticCacheBackupCreateOptions{}, "elastic-cache-backup-create", "Create elastisc cache backup", func(s *mcclient.ClientSession, opts *compute.ElasticCacheBackupCreateOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
@@ -132,7 +132,7 @@ func init() {
return nil
})
R(&options.ElasticCacheIdOptions{}, "elastic-cache-backup-delete", "Delete elastisc cache backup", func(s *mcclient.ClientSession, opts *options.ElasticCacheIdOptions) error {
R(&compute.ElasticCacheIdOptions{}, "elastic-cache-backup-delete", "Delete elastisc cache backup", func(s *mcclient.ClientSession, opts *compute.ElasticCacheIdOptions) error {
result, err := modules.ElasticCacheBackup.Delete(s, opts.ID, nil)
if err != nil {
return err
@@ -142,7 +142,7 @@ func init() {
return nil
})
R(&options.ElasticCacheIdOptions{}, "elastic-cache-backup-restore", "Restore elastisc cache backup", func(s *mcclient.ClientSession, opts *options.ElasticCacheIdOptions) error {
R(&compute.ElasticCacheIdOptions{}, "elastic-cache-backup-restore", "Restore elastisc cache backup", func(s *mcclient.ClientSession, opts *compute.ElasticCacheIdOptions) error {
result, err := modules.ElasticCacheBackup.PerformAction(s, opts.ID, "restore-instance", nil)
if err != nil {
return err
@@ -152,7 +152,7 @@ func init() {
return nil
})
R(&options.ElasticCacheAclCreateOptions{}, "elastic-cache-acl-create", "Create elastisc cache acl", func(s *mcclient.ClientSession, opts *options.ElasticCacheAclCreateOptions) error {
R(&compute.ElasticCacheAclCreateOptions{}, "elastic-cache-acl-create", "Create elastisc cache acl", func(s *mcclient.ClientSession, opts *compute.ElasticCacheAclCreateOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
@@ -167,7 +167,7 @@ func init() {
return nil
})
R(&options.ElasticCacheIdOptions{}, "elastic-cache-acl-delete", "Delete elastisc cache acl", func(s *mcclient.ClientSession, opts *options.ElasticCacheIdOptions) error {
R(&compute.ElasticCacheIdOptions{}, "elastic-cache-acl-delete", "Delete elastisc cache acl", func(s *mcclient.ClientSession, opts *compute.ElasticCacheIdOptions) error {
result, err := modules.ElasticCacheAcl.Delete(s, opts.ID, nil)
if err != nil {
return err
@@ -192,7 +192,7 @@ func init() {
return nil
})
R(&options.ElasticCacheAclUpdateOptions{}, "elastic-cache-acl-update", "Update elastisc cache acl", func(s *mcclient.ClientSession, opts *options.ElasticCacheAclUpdateOptions) error {
R(&compute.ElasticCacheAclUpdateOptions{}, "elastic-cache-acl-update", "Update elastisc cache acl", func(s *mcclient.ClientSession, opts *compute.ElasticCacheAclUpdateOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
@@ -223,7 +223,7 @@ func init() {
return nil
})
R(&options.ElasticCacheParameterUpdateOptions{}, "elastic-cache-parameter-update", "Update elastisc cache parameter", func(s *mcclient.ClientSession, opts *options.ElasticCacheParameterUpdateOptions) error {
R(&compute.ElasticCacheParameterUpdateOptions{}, "elastic-cache-parameter-update", "Update elastisc cache parameter", func(s *mcclient.ClientSession, opts *compute.ElasticCacheParameterUpdateOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
@@ -293,7 +293,7 @@ func init() {
return nil
})
R(&options.ElasticCacheRemoteUpdateOptions{}, "elastic-cache-remote-update", "Restore elastisc cache backup", func(s *mcclient.ClientSession, opts *options.ElasticCacheRemoteUpdateOptions) error {
R(&compute.ElasticCacheRemoteUpdateOptions{}, "elastic-cache-remote-update", "Restore elastisc cache backup", func(s *mcclient.ClientSession, opts *compute.ElasticCacheRemoteUpdateOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
@@ -307,7 +307,7 @@ func init() {
return nil
})
R(&options.ElasticCacheAutoRenewOptions{}, "elastic-cache-auto-renew", "Set elastisc cache auto renew", func(s *mcclient.ClientSession, opts *options.ElasticCacheAutoRenewOptions) error {
R(&compute.ElasticCacheAutoRenewOptions{}, "elastic-cache-auto-renew", "Set elastisc cache auto renew", func(s *mcclient.ClientSession, opts *compute.ElasticCacheAutoRenewOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
@@ -321,7 +321,7 @@ func init() {
return nil
})
R(&options.ElasticCacheRenewOptions{}, "elastic-cache-renew", "Renew elastisc cache", func(s *mcclient.ClientSession, opts *options.ElasticCacheRenewOptions) error {
R(&compute.ElasticCacheRenewOptions{}, "elastic-cache-renew", "Renew elastisc cache", func(s *mcclient.ClientSession, opts *compute.ElasticCacheRenewOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
+1 -1
View File
@@ -17,7 +17,7 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
@@ -17,7 +17,7 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
@@ -17,7 +17,7 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
+1 -1
View File
@@ -17,7 +17,7 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
+1 -1
View File
@@ -22,7 +22,7 @@ import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
type schedtagModelHelper struct {
+3 -2
View File
@@ -17,7 +17,8 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
@@ -29,6 +30,6 @@ func init() {
cmd.Create(new(options.SchedtagCreateOptions))
cmd.Update(new(options.SchedtagUpdateOptions))
cmd.BatchPerform("set-scope", new(options.SchedtagSetScopeOptions))
cmd.PerformWithKeyword("set-user-metadata", "user-metadata", new(options.ResourceMetadataOptions))
cmd.PerformWithKeyword("set-user-metadata", "user-metadata", new(baseoptions.ResourceMetadataOptions))
cmd.Perform("set-resource", new(options.SchedtagSetResource))
}
+3 -2
View File
@@ -17,7 +17,8 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
@@ -25,7 +26,7 @@ func init() {
cmd.List(&options.SecgroupListOptions{})
cmd.Create(&options.SecgroupCreateOptions{})
cmd.Show(&options.SecgroupIdOptions{})
cmd.Update(&options.BaseUpdateOptions{})
cmd.Update(&baseoptions.BaseUpdateOptions{})
cmd.Delete(&options.SecgroupIdOptions{})
cmd.Perform("public", &options.SecgroupIdOptions{})
cmd.Perform("syncstatus", &options.SecgroupIdOptions{})
+1 -1
View File
@@ -17,7 +17,7 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
@@ -17,7 +17,7 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
+4 -3
View File
@@ -18,7 +18,8 @@ import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
@@ -33,12 +34,12 @@ func init() {
cmd.Perform("sync", &options.VpcIdOptions{})
cmd.Perform("syncstatus", &options.VpcIdOptions{})
cmd.Perform("private", &options.VpcIdOptions{})
cmd.Perform("public", &options.BasePublicOptions{})
cmd.Perform("public", &baseoptions.BasePublicOptions{})
cmd.Perform("change-owner", &options.VpcChangeOwnerOptions{})
cmd.Get("vpc-change-owner-candidate-domains", &options.VpcIdOptions{})
cmd.Get("topology", &options.VpcIdOptions{})
R(&options.ResourceMetadataOptions{}, "vpc-set-user-metadata", "Set metadata of a vpc", func(s *mcclient.ClientSession, opts *options.ResourceMetadataOptions) error {
R(&baseoptions.ResourceMetadataOptions{}, "vpc-set-user-metadata", "Set metadata of a vpc", func(s *mcclient.ClientSession, opts *baseoptions.ResourceMetadataOptions) error {
params, err := opts.Params()
if err != nil {
return err
+26 -10
View File
@@ -123,9 +123,20 @@ type SNotificationLog struct {
SendTimes int `json:"send_times"`
}
// SNotifyAction is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SNotifyAction.
type SNotifyAction struct {
apis.SEnabledStatusStandaloneResourceBase
}
// SNotifyResource is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SNotifyResource.
type SNotifyResource struct {
apis.SEnabledStatusStandaloneResourceBase
}
// SReceiver is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SReceiver.
type SReceiver struct {
apis.SEnabledStatusDomainLevelResourceBase
apis.SVirtualResourceBase
apis.SEnabledResourceBase
Email string `json:"email"`
// swagger:ignore
Mobile string `json:"mobile"`
@@ -170,13 +181,6 @@ type SSubscriber struct {
GroupTimes uint32 `json:"group_times"`
}
// SSubscriberDis is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SSubscriberDis.
type SSubscriberDis struct {
SSubscriber
ReceiverName string `json:"receiver_name"`
RoleName string `json:"role_name"`
}
// SSubscriberReceiver is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SSubscriberReceiver.
type SSubscriberReceiver struct {
apis.SJointResourceBase
@@ -200,8 +204,6 @@ type STemplate struct {
type STopic struct {
apis.SEnabledStatusStandaloneResourceBase
Type string `json:"type"`
Resources uint64 `json:"resources"`
Actions uint64 `json:"actions"`
Results *bool `json:"results,omitempty"`
TitleCn string `json:"title_cn"`
TitleEn string `json:"title_en"`
@@ -211,3 +213,17 @@ type STopic struct {
AdvanceDays []int `json:"advance_days"`
WebconsoleDisable *bool `json:"webconsole_disable,omitempty"`
}
// STopicAction is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.STopicAction.
type STopicAction struct {
apis.SJointResourceBase
ActionId string `json:"action_id"`
TopicId string `json:"topic_id"`
}
// STopicResource is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.STopicResource.
type STopicResource struct {
apis.SJointResourceBase
ResourceId string `json:"resource_id"`
TopicId string `json:"topic_id"`
}
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import (
"fmt"
@@ -22,10 +22,11 @@ import (
"yunion.io/x/jsonutils"
api "yunion.io/x/onecloud/pkg/apis/compute"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type CloudaccountListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event|tablestore"`
ReadOnly *bool `help:"filter read only account" negative:"no-read-only"`
@@ -38,7 +39,7 @@ type CloudaccountListOptions struct {
}
func (opts *CloudaccountListOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type SUserPasswordCredential struct {
@@ -1162,7 +1163,7 @@ type CloudaccountEnableAutoSyncOptions struct {
}
func (opts *CloudaccountEnableAutoSyncOptions) Params() (jsonutils.JSONObject, error) {
return StructToParams(opts)
return baseoptions.StructToParams(opts)
}
type CloudaccountPublicOptions struct {
@@ -12,17 +12,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import "yunion.io/x/jsonutils"
import (
"yunion.io/x/jsonutils"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type DBInstanceAccountListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
DBInstance string `help:"ID or Name of DBInstance" json:"dbinstance"`
}
func (opts *DBInstanceAccountListOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type DBInstanceAccountIdOptions struct {
@@ -12,17 +12,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import "yunion.io/x/jsonutils"
import (
"yunion.io/x/jsonutils"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type DBInstanceDatabaseListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
DBInstance string `help:"ID or Name of DBInstance" json:"dbinstance"`
}
func (opts *DBInstanceDatabaseListOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type DBInstanceDatabaseIdOptions struct {
@@ -44,5 +48,5 @@ type DBInstanceDatabaseCreateOptions struct {
}
func (opts *DBInstanceDatabaseCreateOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
@@ -12,12 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import "yunion.io/x/jsonutils"
import (
"yunion.io/x/jsonutils"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type DBInstanceSkuListOption struct {
BaseListOptions
baseoptions.BaseListOptions
Engine string
EngineVersion string
Category string
@@ -28,7 +32,7 @@ type DBInstanceSkuListOption struct {
}
func (opts *DBInstanceSkuListOption) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type DBInstanceSkuIdOption struct {
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import (
"yunion.io/x/jsonutils"
@@ -12,11 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type NetworkAddressCreateOptions struct {
@@ -39,7 +41,7 @@ func (opts *NetworkAddressCreateOptions) Params() (jsonutils.JSONObject, error)
} else {
return nil, errors.Error("requires parent spec, try --guest, etc.")
}
return StructToParams(opts)
return baseoptions.StructToParams(opts)
}
func (opts *NetworkAddressCreateOptions) GetCountParam() int {
@@ -47,7 +49,7 @@ func (opts *NetworkAddressCreateOptions) GetCountParam() int {
}
type NetworkAddressListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
Type string
ParentType string
@@ -59,7 +61,7 @@ type NetworkAddressListOptions struct {
}
func (opts *NetworkAddressListOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type NetworkAddressIdOptions struct {
@@ -12,18 +12,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import "yunion.io/x/jsonutils"
import (
"yunion.io/x/jsonutils"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type RouteTableAssociationListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
RouteTableId string
VpcId string
}
func (opts *RouteTableAssociationListOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type RouteTableAssociationIdOptions struct {
@@ -12,12 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import "yunion.io/x/jsonutils"
import (
"yunion.io/x/jsonutils"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type RouteTableRouteSetListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
RouteTableId string
VpcId string
Type string
@@ -27,7 +31,7 @@ type RouteTableRouteSetListOptions struct {
}
func (opts *RouteTableRouteSetListOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type RouteTableRouteSetIdOptions struct {
@@ -12,12 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import (
"fmt"
"yunion.io/x/jsonutils"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type Route struct {
@@ -63,7 +65,7 @@ type RouteTableCreateOptions struct {
}
func (opts *RouteTableCreateOptions) Params() (jsonutils.JSONObject, error) {
params, err := optionsStructToParams(opts)
params, err := baseoptions.StructToParams(opts)
if err != nil {
return nil, err
}
@@ -103,7 +105,7 @@ func (opts *RouteTableUpdateOptions) GetId() string {
}
func (opts *RouteTableUpdateOptions) Params() (jsonutils.JSONObject, error) {
params, err := optionsStructToParams(opts)
params, err := baseoptions.StructToParams(opts)
if err != nil {
return nil, err
}
@@ -171,11 +173,11 @@ type RouteTableListOptions struct {
Vpc string
Cloudregion string
BaseListOptions
baseoptions.BaseListOptions
}
func (opts *RouteTableListOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type RouteTableSyncstatusOptions struct {
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import (
"fmt"
@@ -20,10 +20,11 @@ import (
"yunion.io/x/jsonutils"
api "yunion.io/x/onecloud/pkg/apis/compute"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type SchedtagModelListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
Schedtag string `help:"ID or Name of schedtag"`
}
@@ -54,7 +55,7 @@ func (o SchedtagSetOptions) Params() (jsonutils.JSONObject, error) {
}
type SchedtagListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
Type string `help:"Filter by resource type"`
CloudproviderId string `help:"Filter by cloudprovider id"`
}
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import (
"fmt"
@@ -24,10 +24,11 @@ import (
"yunion.io/x/pkg/util/secrules"
"yunion.io/x/onecloud/pkg/apis"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type SecgroupListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
Equals string `help:"Secgroup ID or Name, filter secgroups whose rules equals the specified one"`
Server string `help:"Filter secgroups bound to specified server"`
@@ -42,11 +43,11 @@ type SecgroupListOptions struct {
}
func (opts *SecgroupListOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type SecgroupCreateOptions struct {
BaseCreateOptions
baseoptions.BaseCreateOptions
VpcId string
Tags []string
Rules []string `help:"security rule to create"`
@@ -12,12 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import "yunion.io/x/jsonutils"
import (
"yunion.io/x/jsonutils"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type ServerSkusListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
Cloudregion string `help:"region Id or name"`
Usable bool `help:"Filter usable sku"`
Zone string `help:"zone Id or name"`
@@ -38,7 +42,7 @@ func (opts *ServerSkusListOptions) GetId() string {
}
func (opts *ServerSkusListOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type ServerSkusIdOptions struct {
@@ -85,7 +89,7 @@ type ServerSkusCreateOptions struct {
}
func (opts *ServerSkusCreateOptions) Params() (jsonutils.JSONObject, error) {
return StructToParams(opts)
return baseoptions.StructToParams(opts)
}
type ServerSkusUpdateOptions struct {
@@ -119,5 +123,5 @@ type ServerSkusUpdateOptions struct {
}
func (opts *ServerSkusUpdateOptions) Params() (jsonutils.JSONObject, error) {
return StructToParams(opts)
return baseoptions.StructToParams(opts)
}
@@ -12,16 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import (
"fmt"
"yunion.io/x/jsonutils"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type VpcListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
Usable *bool `help:"Filter usable vpcs"`
Region string `help:"ID or Name of region" json:"-"`
@@ -41,7 +43,7 @@ func (opts *VpcListOptions) GetContextId() string {
}
func (opts *VpcListOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type VpcCreateOptions struct {
@@ -99,8 +101,8 @@ func (opts *VpcIdOptions) Params() (jsonutils.JSONObject, error) {
}
type VpcUpdateOptions struct {
BaseUpdateOptions
ExternalAccessMode string `help:"Filter by external access mode" choices:"distgw|eip|eip-distgw"`
baseoptions.BaseUpdateOptions
ExternalAccessMode string `help:"Filter by external access mode" choices:"distgw|eip|eip-distgw|none"`
Direct bool `help:"Can it be connected directly"`
CidrBlock string `help:"IPv4 CIDR block"`
@@ -12,16 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package options
package compute
import "yunion.io/x/jsonutils"
import (
"yunion.io/x/jsonutils"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
)
type VpcPeeringConnectionListOptions struct {
BaseListOptions
baseoptions.BaseListOptions
}
func (opts *VpcPeeringConnectionListOptions) Params() (jsonutils.JSONObject, error) {
return ListStructToParams(opts)
return baseoptions.ListStructToParams(opts)
}
type VpcPeeringConnectionIdOptions struct {
@@ -37,7 +41,7 @@ func (opts *VpcPeeringConnectionIdOptions) Params() (jsonutils.JSONObject, error
}
type VpcPeeringConnectionCreateOptions struct {
EnabledStatusCreateOptions
baseoptions.EnabledStatusCreateOptions
VpcId string
PeerVpcId string
Bandwidth int