update vendor

This commit is contained in:
Qiu Jian
2020-04-13 15:27:11 +08:00
parent cae9564f29
commit df00cdbd04
6 changed files with 9 additions and 42 deletions
-20
View File
@@ -15,8 +15,6 @@
package shell
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
@@ -80,22 +78,4 @@ func init() {
printObject(proxysetting)
return nil
})
R(&options.ProxySettingPublicOptions{}, "proxysetting-public", "Make proxysetting public", func(s *mcclient.ClientSession, opts *options.ProxySettingPublicOptions) error {
params := jsonutils.Marshal(opts)
result, err := modules.ProxySettings.PerformAction(s, opts.ID, "public", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.ProxySettingPrivateOptions{}, "proxysetting-private", "Make proxysetting private", func(s *mcclient.ClientSession, opts *options.ProxySettingPrivateOptions) error {
params := jsonutils.Marshal(opts)
result, err := modules.ProxySettings.PerformAction(s, opts.ID, "private", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}
+1 -4
View File
@@ -42,10 +42,7 @@ func (ps *SProxySetting) IsZero() bool {
type ProxySettingResourceInput struct {
// 代理配置
ProxySetting string `json:"proxy_setting"`
// Deprecated
// swagger:ignore
ProxySettingId string `json:"proxy_setting_id" deprecated-by:"proxy_setting"`
ProxySettingId string `json:"proxy_setting_id"`
}
type ProxySettingTestInput struct {
+3 -3
View File
@@ -206,14 +206,14 @@ func RegisterReferrer(man db.IModelManager) {
}
func ValidateProxySettingResourceInput(userCred mcclient.TokenCredential, input proxyapi.ProxySettingResourceInput) (*SProxySetting, proxyapi.ProxySettingResourceInput, error) {
m, err := ProxySettingManager.FetchByIdOrName(userCred, input.ProxySetting)
m, err := ProxySettingManager.FetchByIdOrName(userCred, input.ProxySettingId)
if err != nil {
if errors.Cause(err) == sql.ErrNoRows {
return nil, input, errors.Wrapf(httperrors.ErrResourceNotFound, "%s %s", ProxySettingManager.Keyword(), input.ProxySetting)
return nil, input, errors.Wrapf(httperrors.ErrResourceNotFound, "%s %s", ProxySettingManager.Keyword(), input.ProxySettingId)
} else {
return nil, input, errors.Wrapf(err, "ProxySettingManager.FetchByIdOrName")
}
}
input.ProxySetting = m.GetId()
input.ProxySettingId = m.GetId()
return m.(*SProxySetting), input, nil
}
+3 -3
View File
@@ -401,13 +401,13 @@ func (manager *SCloudaccountManager) ValidateCreateData(ctx context.Context, use
var proxyFunc httputils.TransportProxyFunc
{
if input.ProxySetting == "" {
input.ProxySetting = proxyapi.ProxySettingId_DIRECT
if input.ProxySettingId == "" {
input.ProxySettingId = proxyapi.ProxySettingId_DIRECT
}
var proxySetting *proxy.SProxySetting
proxySetting, input.ProxySettingResourceInput, err = proxy.ValidateProxySettingResourceInput(userCred, input.ProxySettingResourceInput)
if err != nil {
return input, httperrors.NewInputParameterError("fetch proxysetting %s: %s", input.ProxySetting, err)
return input, httperrors.NewInputParameterError("ValidateProxySettingResourceInput %s", err)
}
proxyFunc = proxySetting.HttpTransportProxyFunc()
}
+2 -2
View File
@@ -84,7 +84,7 @@ type SCloudAccountCreateBaseOptions struct {
ProjectDomain string `help:"domain for this account"`
ProxySetting string `help:"proxy setting id or name" json:"proxy_setting"`
ProxySettingId string `help:"proxy setting id or name" json:"proxy_setting_id"`
}
type SVMwareCloudAccountCreateOptions struct {
@@ -231,7 +231,7 @@ type SCloudAccountUpdateBaseOptions struct {
SyncIntervalSeconds int `help:"auto synchornize interval in seconds"`
AutoCreateProject *bool `help:"automatically create local project for new remote project"`
ProxySetting string `help:"proxy setting name or id" json:"proxy_setting"`
ProxySettingId string `help:"proxy setting name or id" json:"proxy_setting_id"`
Desc string `help:"Description" json:"description" token:"desc"`
}
-10
View File
@@ -46,13 +46,3 @@ type ProxySettingTestOptions struct {
type ProxySettingListOptions struct {
BaseListOptions
}
type ProxySettingPublicOptions struct {
ProxySettingGetOptions
Scope string `json:"scope" help:"share scope" choices:"domain|system"`
SharedDomain []string `json:"share"`
}
type ProxySettingPrivateOptions struct {
ProxySettingGetOptions
}