mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
The region service adds restful-list to display zone and zone_id information.
This commit is contained in:
@@ -861,6 +861,11 @@ func (self *SNetwork) GetPorts() int {
|
||||
|
||||
func (self *SNetwork) getMoreDetails(ctx context.Context, extra *jsonutils.JSONDict) *jsonutils.JSONDict {
|
||||
wire := self.GetWire()
|
||||
zone := self.getZone()
|
||||
if zone != nil {
|
||||
extra.Add(jsonutils.NewString(zone.Name), "zone")
|
||||
extra.Add(jsonutils.NewString(zone.Id), "zone_id")
|
||||
}
|
||||
extra.Add(jsonutils.NewString(wire.Name), "wire")
|
||||
if self.IsExitNetwork() {
|
||||
extra.Add(jsonutils.JSONTrue, "exit")
|
||||
|
||||
@@ -669,7 +669,6 @@ func (manager *SWireManager) GetOnPremiseWireOfIp(ipAddr string) (*SWire, error)
|
||||
|
||||
func (manager *SWireManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error) {
|
||||
var err error
|
||||
|
||||
q, err = managedResourceFilterByAccount(q, query, "vpc_id", func() *sqlchemy.SQuery {
|
||||
vpcs := VpcManager.Query().SubQuery()
|
||||
subq := vpcs.Query(vpcs.Field("id"))
|
||||
@@ -786,6 +785,10 @@ func (self *SWire) GetExtraDetails(ctx context.Context, userCred mcclient.TokenC
|
||||
|
||||
func (self *SWire) getMoreDetails(extra *jsonutils.JSONDict) *jsonutils.JSONDict {
|
||||
cnt, _ := self.NetworkCount()
|
||||
zone := self.GetZone()
|
||||
if zone != nil {
|
||||
extra.Add(jsonutils.NewString(string(zone.Name)), "zone")
|
||||
}
|
||||
extra.Add(jsonutils.NewInt(int64(cnt)), "networks")
|
||||
vpc := self.getVpc()
|
||||
if vpc != nil {
|
||||
|
||||
@@ -20,7 +20,7 @@ var (
|
||||
|
||||
func init() {
|
||||
Networks = NewComputeManager("network", "networks",
|
||||
[]string{"ID", "Name", "Guest_ip_start",
|
||||
[]string{"ID", "Name", "Guest_ip_start", "zone", "zone_id",
|
||||
"Guest_ip_end", "Guest_ip_mask",
|
||||
"wire_id", "wire", "is_public", "exit", "Ports",
|
||||
"vnics", "guest_gateway",
|
||||
|
||||
Reference in New Issue
Block a user