(e *et.Event, asset *oamnet.IPAddress, src *et.Source)
| 188 | } |
| 189 | |
| 190 | func (h *horizPlugin) submitIPAddress(e *et.Event, asset *oamnet.IPAddress, src *et.Source) { |
| 191 | ctx, cancel := context.WithTimeout(e.Session.Ctx(), 30*time.Second) |
| 192 | defer cancel() |
| 193 | |
| 194 | // ensure we do not work on an IP address that was processed previously |
| 195 | _, err := e.Session.DB().FindEntitiesByContent(ctx, oam.IPAddress, e.Session.StartTime(), 1, dbt.ContentFilters{ |
| 196 | "address": asset.Address.String(), |
| 197 | }) |
| 198 | if err == nil { |
| 199 | return |
| 200 | } |
| 201 | |
| 202 | addr, err := e.Session.DB().CreateAsset(ctx, asset) |
| 203 | if err == nil && addr != nil { |
| 204 | _, _ = e.Session.DB().CreateEntityProperty(ctx, addr, &oamgen.SourceProperty{ |
| 205 | Source: src.Name, |
| 206 | Confidence: src.Confidence, |
| 207 | }) |
| 208 | _ = e.Dispatcher.DispatchEvent(&et.Event{ |
| 209 | Name: addr.Asset.Key(), |
| 210 | Entity: addr, |
| 211 | Session: e.Session, |
| 212 | }) |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | func (h *horizPlugin) getContactRecord(sess et.Session, ent *dbt.Entity, label string) (*dbt.Entity, error) { |
| 217 | since, err := support.TTLStartTime(sess.Config(), |
nothing calls this directly
no test coverage detected