(item *metadbmodel.Host)
| 275 | } |
| 276 | |
| 277 | func (t *DataSet) AddHost(item *metadbmodel.Host) { |
| 278 | t.hostLcuuidToID[item.Lcuuid] = item.ID |
| 279 | t.hostIDToLcuuid[item.ID] = item.Lcuuid |
| 280 | t.hostIPToID[item.IP] = item.ID |
| 281 | t.hostIDtoInfo[item.ID] = &hostInfo{Name: item.Name} |
| 282 | if regionID, ok := t.GetRegionIDByLcuuid(item.Region); ok { |
| 283 | t.hostIDtoInfo[item.ID].RegionID = regionID |
| 284 | } |
| 285 | if azID, ok := t.GetAZIDByLcuuid(item.AZ); ok { |
| 286 | t.hostIDtoInfo[item.ID].AZID = azID |
| 287 | } |
| 288 | t.GetLogFunc()(addToToolMap(ctrlrcommon.RESOURCE_TYPE_HOST_EN, item.Lcuuid), t.metadata.LogPrefixes) |
| 289 | } |
| 290 | |
| 291 | func (t *DataSet) DeleteHost(lcuuid string) { |
| 292 | id, _ := t.GetHostIDByLcuuid(lcuuid) |
no test coverage detected