mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
feat(region): add direct field for vpc
This field describes whether the VPC can be connected directly
This commit is contained in:
@@ -143,8 +143,7 @@ func (guest *SGuest) sshableTryEach(
|
||||
if vpc == nil {
|
||||
continue
|
||||
}
|
||||
if vpc.Id == compute_api.DEFAULT_VPC_ID {
|
||||
// - vpc_id == "default"
|
||||
if vpc.Id == compute_api.DEFAULT_VPC_ID || vpc.Direct {
|
||||
if ok := guest.sshableTryDefaultVPC(ctx, tryData, gn); ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -86,6 +86,9 @@ type SVpc struct {
|
||||
|
||||
// Vpc外网访问模式
|
||||
ExternalAccessMode string `width:"16" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"`
|
||||
|
||||
// Can it be connected directly
|
||||
Direct bool `default:"false" list:"user" update:"user"`
|
||||
}
|
||||
|
||||
func (manager *SVpcManager) GetContextManagers() [][]db.IModelManager {
|
||||
|
||||
@@ -88,6 +88,7 @@ func (opts *VpcIdOptions) Params() (jsonutils.JSONObject, error) {
|
||||
type VpcUpdateOptions struct {
|
||||
BaseUpdateOptions
|
||||
ExternalAccessMode string `help:"Filter by external access mode" choices:"distgw|eip|eip-distgw"`
|
||||
Direct bool `help:"Can it be connected directly"`
|
||||
}
|
||||
|
||||
func (opts *VpcUpdateOptions) Params() (jsonutils.JSONObject, error) {
|
||||
|
||||
Reference in New Issue
Block a user