yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/multicloud/incloudsphere/nic.go (about) 1 // Copyright 2019 Yunion 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package incloudsphere 16 17 import ( 18 "strings" 19 20 "yunion.io/x/cloudmux/pkg/cloudprovider" 21 ) 22 23 type SInstanceNic struct { 24 cloudprovider.DummyICloudNic 25 ins *SInstance 26 27 Id string `json:"id"` 28 AutoGenerated bool `json:"autoGenerated"` 29 Name string `json:"name"` 30 NolocalName string `json:"nolocalName"` 31 InnerName string `json:"innerName"` 32 DevName string `json:"devName"` 33 IP string `json:"ip"` 34 Netmask string `json:"netmask"` 35 Gateway string `json:"gateway"` 36 Mac string `json:"mac"` 37 Model string `json:"model"` 38 DeviceId string `json:"deviceId"` 39 DeviceName string `json:"deviceName"` 40 DeviceType string `json:"deviceType"` 41 SwitchType string `json:"switchType"` 42 VswitchId string `json:"vswitchId"` 43 UplinkRate int `json:"uplinkRate"` 44 UplinkBurst int `json:"uplinkBurst"` 45 DownlinkRate int `json:"downlinkRate"` 46 DownlinkBurst int `json:"downlinkBurst"` 47 DownlinkQueue string `json:"downlinkQueue"` 48 Enable bool `json:"enable"` 49 Status string `json:"status"` 50 InboundRate float64 `json:"inboundRate"` 51 OutboundRate float64 `json:"outboundRate"` 52 ConnectStatus bool `json:"connectStatus"` 53 VMName string `json:"vmName"` 54 VMId string `json:"vmId"` 55 VMStatus string `json:"vmStatus"` 56 VMTemplate bool `json:"vmTemplate"` 57 NetworkName string `json:"networkName"` 58 NetworkVlan string `json:"networkVlan"` 59 VlanRange string `json:"vlanRange"` 60 NetworkId string `json:"networkId"` 61 NetworkType string `json:"networkType"` 62 HostIP string `json:"hostIp"` 63 HostStatus string `json:"hostStatus"` 64 HostId string `json:"hostId"` 65 DirectObjName string `json:"directObjName"` 66 TotalOctets float64 `json:"totalOctets"` 67 TotalDropped float64 `json:"totalDropped"` 68 TotalPackets float64 `json:"totalPackets"` 69 TotalBytes float64 `json:"totalBytes"` 70 TotalErrors float64 `json:"totalErrors"` 71 WriteOctets float64 `json:"writeOctets"` 72 WriteDropped float64 `json:"writeDropped"` 73 WritePackets float64 `json:"writePackets"` 74 WriteBytes float64 `json:"writeBytes"` 75 WriteErrors float64 `json:"writeErrors"` 76 ReadOctets float64 `json:"readOctets"` 77 ReadDropped float64 `json:"readDropped"` 78 ReadPackets float64 `json:"readPackets"` 79 ReadBytes float64 `json:"readBytes"` 80 ReadErrors float64 `json:"readErrors"` 81 SecurityGroups string `json:"securityGroups"` 82 AdvancedNetIP string `json:"advancedNetIp"` 83 PortId string `json:"portId"` 84 SdnVFId string `json:"sdnVFId"` 85 OpenstackId string `json:"openstackId"` 86 BindIPEnable bool `json:"bindIpEnable"` 87 BindIP string `json:"bindIp"` 88 PriorityEnabled bool `json:"priorityEnabled"` 89 NetPriority string `json:"netPriority"` 90 VMType string `json:"vmType"` 91 SystemVMType string `json:"systemVmType"` 92 Dhcp bool `json:"dhcp"` 93 DhcpIP string `json:"dhcpIp"` 94 DhcpEnabled bool `json:"dhcpEnabled"` 95 UsedDpdk bool `json:"usedDpdk"` 96 Queues int `json:"queues"` 97 } 98 99 func (self *SInstanceNic) GetId() string { 100 return self.Id 101 } 102 103 func (self *SInstanceNic) GetIP() string { 104 return self.IP 105 } 106 107 func (self *SInstanceNic) GetMAC() string { 108 return self.Mac 109 } 110 111 func (self *SInstanceNic) GetDriver() string { 112 return strings.ToLower(self.Model) 113 } 114 115 func (self *SInstanceNic) InClassicNetwork() bool { 116 return true 117 } 118 119 func (self *SInstanceNic) GetSubAddress() ([]string, error) { 120 return []string{}, nil 121 } 122 123 func (self *SInstanceNic) GetINetworkId() string { 124 return self.NetworkId 125 } 126 127 func (self *SInstanceNic) AssignAddress(ipAddrs []string) error { 128 return cloudprovider.ErrNotSupported 129 }