├── .circleci.settings.xml ├── .circleci └── config.yml ├── .github ├── PULL_REQUEST_TEMPLATE.md ├── assign-by-files.yml ├── dependabot.yml └── workflows │ └── auto-assign.yml ├── .gitignore ├── .tool-versions ├── DEVEL.md ├── LICENSE.md ├── README.md ├── RELEASING.md ├── api ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── opennms │ └── integration │ └── api │ └── v1 │ ├── alarms │ ├── AlarmLifecycleListener.java │ └── AlarmPersisterExtension.java │ ├── annotations │ ├── Consumable.java │ ├── Exposable.java │ └── Model.java │ ├── collectors │ ├── CollectionRequest.java │ ├── CollectionSet.java │ ├── CollectionSetPersistenceService.java │ ├── CollectorRequestBuilder.java │ ├── RrdRepository.java │ ├── ServiceCollector.java │ ├── ServiceCollectorClient.java │ ├── ServiceCollectorFactory.java │ └── resource │ │ ├── CollectionSetResource.java │ │ ├── GenericTypeResource.java │ │ ├── IpInterfaceResource.java │ │ ├── NodeResource.java │ │ ├── NumericAttribute.java │ │ ├── Resource.java │ │ └── StringAttribute.java │ ├── config │ ├── collector │ │ ├── AddressRange.java │ │ ├── Collector.java │ │ ├── CollectorConfigurationExtension.java │ │ ├── Package.java │ │ ├── Parameter.java │ │ └── Service.java │ ├── datacollection │ │ ├── Collect.java │ │ ├── Group.java │ │ ├── IpList.java │ │ ├── MibObj.java │ │ ├── MibObjProperty.java │ │ ├── Parameter.java │ │ ├── ResourceType.java │ │ ├── ResourceTypesExtension.java │ │ ├── SnmpCollectionExtension.java │ │ ├── SnmpDataCollection.java │ │ ├── StrategyDefinition.java │ │ ├── SystemDef.java │ │ └── graphs │ │ │ ├── GraphPropertiesExtension.java │ │ │ └── PrefabGraph.java │ ├── events │ │ ├── AlarmData.java │ │ ├── AlarmType.java │ │ ├── AttributeType.java │ │ ├── CollectionGroup.java │ │ ├── EventConfExtension.java │ │ ├── EventDefinition.java │ │ ├── LogMessage.java │ │ ├── LogMsgDestType.java │ │ ├── ManagedObject.java │ │ ├── Mask.java │ │ ├── MaskElement.java │ │ ├── Parameter.java │ │ ├── UpdateField.java │ │ └── Varbind.java │ ├── poller │ │ ├── AddressRange.java │ │ ├── Downtime.java │ │ ├── Monitor.java │ │ ├── Package.java │ │ ├── Parameter.java │ │ ├── PollerConfigurationExtension.java │ │ ├── Rrd.java │ │ └── Service.java │ ├── requisition │ │ ├── Requisition.java │ │ ├── RequisitionAsset.java │ │ ├── RequisitionInterface.java │ │ ├── RequisitionMetaData.java │ │ ├── RequisitionMonitoredService.java │ │ ├── RequisitionNode.java │ │ └── SnmpPrimaryType.java │ ├── syslog │ │ ├── ParameterAssignment.java │ │ ├── SyslogMatch.java │ │ └── SyslogMatchExtension.java │ └── thresholding │ │ ├── Basethresholddef.java │ │ ├── ExcludeRange.java │ │ ├── Expression.java │ │ ├── Filter.java │ │ ├── FilterOperator.java │ │ ├── GroupDefinition.java │ │ ├── IncludeRange.java │ │ ├── PackageDefinition.java │ │ ├── Parameter.java │ │ ├── ResourceFilter.java │ │ ├── Service.java │ │ ├── ServiceStatus.java │ │ ├── ThreshdConfigurationExtension.java │ │ ├── Threshold.java │ │ ├── ThresholdType.java │ │ └── ThresholdingConfigExtension.java │ ├── coordination │ ├── DomainManager.java │ ├── DomainManagerFactory.java │ ├── Role.java │ └── RoleChangeHandler.java │ ├── dao │ ├── AlarmDao.java │ ├── AlarmFeedbackDao.java │ ├── EdgeDao.java │ ├── InterfaceToNodeCache.java │ ├── NodeDao.java │ └── SnmpInterfaceDao.java │ ├── detectors │ ├── DetectRequest.java │ ├── DetectResults.java │ ├── DetectorClient.java │ ├── ServiceDetector.java │ └── ServiceDetectorFactory.java │ ├── distributed │ └── KeyValueStore.java │ ├── events │ ├── EventForwarder.java │ ├── EventListener.java │ └── EventSubscriptionService.java │ ├── feedback │ └── AlarmFeedbackListener.java │ ├── flows │ ├── Flow.java │ ├── FlowException.java │ └── FlowRepository.java │ ├── graph │ ├── Edge.java │ ├── Graph.java │ ├── GraphContainer.java │ ├── GraphContainerCache.java │ ├── GraphContainerInfo.java │ ├── GraphContainerProvider.java │ ├── GraphInfo.java │ ├── GraphProvider.java │ ├── NodeRef.java │ ├── Properties.java │ ├── Vertex.java │ ├── VertexRef.java │ ├── configuration │ │ ├── GraphCacheStrategy.java │ │ ├── GraphConfiguration.java │ │ └── TopologyConfiguration.java │ └── status │ │ ├── LegacyStatusProvider.java │ │ ├── StatusInfo.java │ │ └── StatusProvider.java │ ├── health │ ├── Context.java │ ├── HealthCheck.java │ ├── Response.java │ └── Status.java │ ├── model │ ├── Alarm.java │ ├── AlarmFeedback.java │ ├── DatabaseEvent.java │ ├── EventParameter.java │ ├── Geolocation.java │ ├── InMemoryEvent.java │ ├── IpInterface.java │ ├── MetaData.java │ ├── MonitoredService.java │ ├── Node.java │ ├── NodeAssetRecord.java │ ├── NodeCriteria.java │ ├── Severity.java │ ├── SnmpInterface.java │ ├── TopologyEdge.java │ ├── TopologyPort.java │ ├── TopologyProtocol.java │ ├── TopologyRef.java │ └── TopologySegment.java │ ├── pollers │ ├── PollerRequest.java │ ├── PollerRequestBuilder.java │ ├── PollerResult.java │ ├── ServicePoller.java │ ├── ServicePollerClient.java │ ├── ServicePollerFactory.java │ └── Status.java │ ├── requisition │ ├── RequisitionProvider.java │ ├── RequisitionRepository.java │ └── RequisitionRequest.java │ ├── runtime │ ├── Container.java │ ├── RuntimeInfo.java │ └── Version.java │ ├── scv │ ├── Credentials.java │ └── SecureCredentialsVault.java │ ├── ticketing │ ├── Ticket.java │ └── TicketingPlugin.java │ ├── timeseries │ ├── Aggregation.java │ ├── DataPoint.java │ ├── IntrinsicTagNames.java │ ├── MetaTagNames.java │ ├── Metric.java │ ├── README.md │ ├── Sample.java │ ├── StorageException.java │ ├── Tag.java │ ├── TagMatcher.java │ ├── TimeSeriesData.java │ ├── TimeSeriesFetchRequest.java │ ├── TimeSeriesStorage.java │ └── package-info.java │ ├── topology │ ├── IconIds.java │ ├── TopologyEdgeConsumer.java │ ├── UserDefinedLink.java │ └── UserDefinedLinkDao.java │ └── ui │ └── UIExtension.java ├── archetypes ├── example-kar-plugin │ ├── pom.xml │ └── src │ │ ├── main │ │ └── resources │ │ │ ├── META-INF │ │ │ └── maven │ │ │ │ └── archetype-metadata.xml │ │ │ └── archetype-resources │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── assembly │ │ │ ├── kar │ │ │ │ └── pom.xml │ │ │ └── pom.xml │ │ │ ├── karaf-features │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── features.xml │ │ │ ├── plugin │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ ├── main │ │ │ │ ├── java │ │ │ │ │ ├── AlarmForwarder.java │ │ │ │ │ ├── ApiClient.java │ │ │ │ │ ├── EventConfExtension.java │ │ │ │ │ ├── TopologyForwarder.java │ │ │ │ │ ├── WebhookHandler.java │ │ │ │ │ ├── WebhookHandlerImpl.java │ │ │ │ │ ├── model │ │ │ │ │ │ ├── Alert.java │ │ │ │ │ │ ├── Link.java │ │ │ │ │ │ └── Topology.java │ │ │ │ │ └── shell │ │ │ │ │ │ ├── StatsCommand.java │ │ │ │ │ │ └── TopologyCommand.java │ │ │ │ └── resources │ │ │ │ │ ├── OSGI-INF │ │ │ │ │ └── blueprint │ │ │ │ │ │ └── blueprint.xml │ │ │ │ │ └── events │ │ │ │ │ └── plugin.ext.events.xml │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ ├── AlarmForwarderIT.java │ │ │ │ ├── AlarmForwarderTest.java │ │ │ │ ├── AlertTest.java │ │ │ │ └── TopologyTest.java │ │ │ └── pom.xml │ │ └── test │ │ └── resources │ │ └── projects │ │ └── basic │ │ ├── archetype.properties │ │ └── goal.txt └── pom.xml ├── common ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── opennms │ │ └── integration │ │ └── api │ │ └── v1 │ │ ├── collectors │ │ ├── immutables │ │ │ ├── ImmutableNumericAttribute.java │ │ │ ├── ImmutableRrdRepository.java │ │ │ └── ImmutableStringAttribute.java │ │ └── resource │ │ │ └── immutables │ │ │ ├── ImmutableCollectionSet.java │ │ │ ├── ImmutableCollectionSetResource.java │ │ │ ├── ImmutableGenericTypeResource.java │ │ │ ├── ImmutableIpInterfaceResource.java │ │ │ └── ImmutableNodeResource.java │ │ ├── config │ │ ├── datacollection │ │ │ └── graphs │ │ │ │ └── immutables │ │ │ │ └── ImmutablePrefabGraph.java │ │ └── requisition │ │ │ └── immutables │ │ │ ├── ImmutableRequisition.java │ │ │ ├── ImmutableRequisitionAsset.java │ │ │ ├── ImmutableRequisitionInterface.java │ │ │ ├── ImmutableRequisitionMetaData.java │ │ │ ├── ImmutableRequisitionMonitoredService.java │ │ │ └── ImmutableRequisitionNode.java │ │ ├── graph │ │ ├── immutables │ │ │ ├── ImmutableEdge.java │ │ │ ├── ImmutableElement.java │ │ │ ├── ImmutableGraph.java │ │ │ ├── ImmutableGraphContainer.java │ │ │ ├── ImmutableGraphContainerInfo.java │ │ │ ├── ImmutableGraphInfo.java │ │ │ ├── ImmutableNodeRef.java │ │ │ ├── ImmutableVertex.java │ │ │ └── ImmutableVertexRef.java │ │ └── status │ │ │ └── immutables │ │ │ └── StatusInfoImmutable.java │ │ ├── health │ │ └── immutables │ │ │ └── ImmutableResponse.java │ │ ├── model │ │ └── immutables │ │ │ ├── ImmutableAlarm.java │ │ │ ├── ImmutableAlarmFeedback.java │ │ │ ├── ImmutableDatabaseEvent.java │ │ │ ├── ImmutableEventParameter.java │ │ │ ├── ImmutableGeolocation.java │ │ │ ├── ImmutableIPAddress.java │ │ │ ├── ImmutableInMemoryEvent.java │ │ │ ├── ImmutableIpInterface.java │ │ │ ├── ImmutableMetaData.java │ │ │ ├── ImmutableMonitoredService.java │ │ │ ├── ImmutableNode.java │ │ │ ├── ImmutableNodeAssetRecord.java │ │ │ ├── ImmutableNodeCriteria.java │ │ │ ├── ImmutableSnmpInterface.java │ │ │ ├── ImmutableTopologyEdge.java │ │ │ ├── ImmutableTopologyPort.java │ │ │ └── ImmutableTopologySegment.java │ │ ├── pollers │ │ └── immutables │ │ │ └── ImmutablePollerResult.java │ │ ├── scv │ │ └── immutables │ │ │ └── ImmutableCredentials.java │ │ ├── ticketing │ │ └── immutables │ │ │ └── ImmutableTicket.java │ │ ├── timeseries │ │ └── immutables │ │ │ ├── ImmutableDataPoint.java │ │ │ ├── ImmutableMetric.java │ │ │ ├── ImmutableSample.java │ │ │ ├── ImmutableTag.java │ │ │ ├── ImmutableTagMatcher.java │ │ │ ├── ImmutableTimeSeriesData.java │ │ │ ├── ImmutableTimeSeriesFetchRequest.java │ │ │ └── MetricValidator.java │ │ ├── topology │ │ └── immutables │ │ │ └── ImmutableUserDefinedLink.java │ │ └── util │ │ ├── ImmutableCollections.java │ │ └── MutableCollections.java │ └── test │ └── java │ └── org │ └── opennms │ └── integration │ └── api │ └── v1 │ ├── graph │ └── configuration │ │ └── GraphCacheStrategyTest.java │ ├── timeseries │ └── immutables │ │ └── ImmutableMetricTest.java │ └── util │ ├── ImmutableCollectionsTest.java │ └── MutableCollectionsTest.java ├── config ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── opennms │ │ └── integration │ │ └── api │ │ └── xml │ │ ├── ClassPathGraphPropertiesLoader.java │ │ ├── ClassPathResourceTypesLoader.java │ │ ├── ClasspathCollectorConfigurationLoader.java │ │ ├── ClasspathEventDefinitionLoader.java │ │ ├── ClasspathPollerConfigurationLoader.java │ │ ├── ClasspathSnmpDataCollectionLoader.java │ │ ├── ClasspathSyslogMatchLoader.java │ │ ├── ClasspathThreshdConfigurationLoader.java │ │ ├── ClasspathThresholdingConfigLoader.java │ │ ├── ClasspathXmlLoader.java │ │ ├── ConfigUtils.java │ │ ├── GraphPropertiesParser.java │ │ ├── JaxbUtils.java │ │ └── schema │ │ ├── collector │ │ ├── AddressRangeXml.java │ │ ├── CollectorConfigurationXml.java │ │ ├── CollectorXml.java │ │ ├── PackageXml.java │ │ ├── ParameterXml.java │ │ ├── ServiceXml.java │ │ └── package-info.java │ │ ├── datacollection │ │ ├── Collect.java │ │ ├── DatacollectionGroup.java │ │ ├── Group.java │ │ ├── IpList.java │ │ ├── MibObj.java │ │ ├── MibObjProperty.java │ │ ├── Parameter.java │ │ ├── PersistenceSelectorStrategy.java │ │ ├── ResourceType.java │ │ ├── ResourceTypes.java │ │ ├── StorageStrategy.java │ │ ├── SystemDef.java │ │ ├── SystemDefChoice.java │ │ └── package-info.java │ │ ├── eventconf │ │ ├── AlarmData.java │ │ ├── Autoacknowledge.java │ │ ├── Autoaction.java │ │ ├── CollectionGroup.java │ │ ├── Correlation.java │ │ ├── Decode.java │ │ ├── Event.java │ │ ├── EventLabelComparator.java │ │ ├── EventOrdering.java │ │ ├── Events.java │ │ ├── Filter.java │ │ ├── Forward.java │ │ ├── Global.java │ │ ├── LogDestType.java │ │ ├── Logmsg.java │ │ ├── ManagedObject.java │ │ ├── Mask.java │ │ ├── Maskelement.java │ │ ├── MechanismType.java │ │ ├── Operaction.java │ │ ├── Parameter.java │ │ ├── PathType.java │ │ ├── PathTypeAdapter.java │ │ ├── Script.java │ │ ├── Security.java │ │ ├── Snmp.java │ │ ├── StateType.java │ │ ├── Tticket.java │ │ ├── UpdateField.java │ │ ├── Varbind.java │ │ ├── Varbindsdecode.java │ │ └── package-info.java │ │ ├── poller │ │ ├── AddressRangeXml.java │ │ ├── DowntimeXml.java │ │ ├── MonitorXml.java │ │ ├── PackageXml.java │ │ ├── ParameterXml.java │ │ ├── PollerConfigurationXml.java │ │ ├── RrdXml.java │ │ ├── ServiceXml.java │ │ └── package-info.java │ │ ├── syslog │ │ ├── Configuration.java │ │ ├── HideMatch.java │ │ ├── HostaddrMatch.java │ │ ├── HostnameMatch.java │ │ ├── Match.java │ │ ├── ParameterAssignment.java │ │ ├── ProcessMatch.java │ │ ├── SyslogdConfiguration.java │ │ ├── SyslogdConfigurationGroup.java │ │ ├── UeiMatch.java │ │ └── package-info.java │ │ └── thresholding │ │ ├── Basethresholddef.java │ │ ├── ExcludeRange.java │ │ ├── Expression.java │ │ ├── Filter.java │ │ ├── FilterOperator.java │ │ ├── FilterOperatorAdapter.java │ │ ├── Group.java │ │ ├── IncludeRange.java │ │ ├── Package.java │ │ ├── Parameter.java │ │ ├── ResourceFilter.java │ │ ├── Service.java │ │ ├── ServiceStatus.java │ │ ├── ThreshdConfiguration.java │ │ ├── Threshold.java │ │ ├── ThresholdType.java │ │ ├── Thresholder.java │ │ └── ThresholdingConfig.java │ └── xsds │ ├── datacollection-config.xsd │ ├── eventconf.xsd │ ├── poller-configuration.xsd │ └── syslog.xsd ├── karaf-features ├── pom.xml └── src │ └── main │ └── resources │ ├── features.xml │ └── sample.xml ├── pom.xml ├── sample ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── opennms │ │ │ └── integration │ │ │ └── api │ │ │ └── sample │ │ │ ├── AlarmTestContextManager.java │ │ │ ├── KeyValueStoreClient.java │ │ │ ├── MyAlarmFeedbackListener.java │ │ │ ├── MyAlarmLifecycleListener.java │ │ │ ├── MyAlarmPersisterExtension.java │ │ │ ├── MyCollectorConfigurationExtension.java │ │ │ ├── MyCustomStatusProvider.java │ │ │ ├── MyEventConfExtension.java │ │ │ ├── MyGraphContainerProvider.java │ │ │ ├── MyGraphPropertiesExtension.java │ │ │ ├── MyInfoLogger.java │ │ │ ├── MyPollerConfigurationExtension.java │ │ │ ├── MyRequisitionProvider.java │ │ │ ├── MyResourceTypesExtension.java │ │ │ ├── MySnmpCollectionExtension.java │ │ │ ├── MySyslogMatchExtension.java │ │ │ ├── MyThreshdConfigurationExtension.java │ │ │ ├── MyThresholdingConfigExtension.java │ │ │ ├── MyTopologyEdgeConsumer.java │ │ │ ├── RequisitionTestContextManager.java │ │ │ ├── RuntimeInfoLogger.java │ │ │ ├── SampleCollector.java │ │ │ ├── SampleCollectorFactory.java │ │ │ ├── SampleDetector.java │ │ │ ├── SampleDetectorFactory.java │ │ │ ├── SamplePoller.java │ │ │ ├── SamplePollerFactory.java │ │ │ ├── SampleTicketerPlugin.java │ │ │ ├── SampleUIExtension.java │ │ │ └── health │ │ │ ├── AlarmLifecyleHealthCheck.java │ │ │ ├── ChainedHealthCheck.java │ │ │ ├── MinionHealthCheck.java │ │ │ ├── MyHealthCheck.java │ │ │ ├── RequisitionHealthCheck.java │ │ │ ├── ServiceExtensionHealthCheck.java │ │ │ ├── ServiceExtensionOnMinionHealthCheck.java │ │ │ └── UserDefinedLinkHealthCheck.java │ └── resources │ │ ├── blueprint-core.xml │ │ ├── blueprint-minion.xml │ │ ├── blueprint-sentinel.xml │ │ ├── collector │ │ ├── collector-configuration1.xml │ │ └── collector-configuration2.xml │ │ ├── datacollection │ │ ├── ciscoNexus.xml │ │ └── netsnmp.xml │ │ ├── events │ │ ├── SNMP_Link_UpDown.xml │ │ └── sample.xml │ │ ├── graphs │ │ └── netsnmp-graph.properties │ │ ├── poller │ │ ├── poller-configuration1.xml │ │ └── poller-configuration2.xml │ │ ├── resource-types │ │ ├── jmx-resource.xml │ │ └── nxos-cpu-resource.xml │ │ ├── syslog │ │ └── Cisco.syslog.xml │ │ ├── thresholding │ │ ├── threshd-configuration.1.xml │ │ ├── threshd-configuration.2.xml │ │ ├── thresholds.1.xml │ │ └── thresholds.2.xml │ │ ├── ui-ext │ │ ├── style.css │ │ └── uiextension.es.js │ │ └── web-ui │ │ ├── .gitignore │ │ ├── .vscode │ │ └── extensions.json │ │ ├── RedPlugin.es.js │ │ └── style.css │ └── test │ └── java │ └── org │ └── opennms │ └── integration │ └── api │ └── sample │ ├── MyCollectorConfigurationExtensionTest.java │ ├── MyEventConfExtensionTest.java │ ├── MyGraphPropertiesExtensionTest.java │ ├── MyPollerConfigurationExtensionTest.java │ ├── MyResourceTypesExtensionTest.java │ ├── MySnmpCollectionExtensionTest.java │ ├── MySyslogMatchExtensionTest.java │ ├── MyThreshdConfigurationExtensionTest.java │ └── MyThresholdingConfigExtensionTest.java ├── test-api ├── pom.xml └── src │ └── main │ └── resources │ └── log4j2.xml ├── test-suites ├── pom.xml └── tss-tests │ ├── README.md │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── org │ │ └── opennms │ │ └── integration │ │ └── api │ │ └── v1 │ │ └── timeseries │ │ ├── AbstractStorageIntegrationTest.java │ │ └── InMemoryStorage.java │ └── test │ └── java │ └── org │ └── opennms │ └── integration │ └── api │ └── v1 │ └── timeseries │ └── InMemoryStorageTest.java ├── ui-extension-test ├── README.md ├── index.html ├── package.json ├── public │ └── favicon.ico ├── src │ ├── App.vue │ ├── Plugin.vue │ ├── PluginContainer.vue │ ├── assets │ │ └── logo.png │ ├── env.d.ts │ ├── main.ts │ ├── router │ │ └── index.ts │ └── utils │ │ ├── externalComponent.ts │ │ └── externalStyles.ts ├── tsconfig.json └── vite.config.ts ├── ui-extension ├── .env.development ├── README.md ├── index.html ├── package.json ├── public │ └── favicon.ico ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── components │ │ └── HelloWorld.vue │ ├── composables │ │ └── useRouter.ts │ ├── env.d.ts │ ├── main.ts │ └── router │ │ └── index.ts ├── tsconfig.json ├── vite.config.dev.ts └── vite.config.ts └── utils ├── pom.xml └── src ├── main └── java │ └── org │ └── opennms │ └── integration │ └── api │ └── utils │ ├── ByteArrayComparator.java │ ├── IPLike.java │ └── InetAddressUtils.java └── test └── java └── org └── opennms └── integration └── api └── utils └── InetAddressUtilsTest.java /.circleci.settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | opennms-ossrh 5 | ${env.OPENNMS_OSSRH_USERNAME} 6 | ${env.OPENNMS_OSSRH_PASSWORD} 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.github/assign-by-files.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ".circleci/**/*": 3 | - RangerRick 4 | - mershad-manesh 5 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | 4 | - package-ecosystem: "maven" 5 | directory: "/" 6 | target-branch: "release-1.x" 7 | reviewers: 8 | - "OpenNMS/dependabot-reviewers-maven" 9 | labels: 10 | - "dependencies" 11 | commit-message: 12 | prefix: "build" 13 | include: "scope" 14 | schedule: 15 | interval: "daily" 16 | -------------------------------------------------------------------------------- /.github/workflows/auto-assign.yml: -------------------------------------------------------------------------------- 1 | name: "Auto Assign Pull Request" 2 | on: 3 | pull_request_target: 4 | # types: [review_requested, ready_for_review, opened, synchronize, reopened] 5 | branches: 6 | - master 7 | jobs: 8 | assign_reviewer: 9 | if: github.event.pull_request.draft == false 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: shufo/auto-assign-reviewer-by-files@v1.1.4 13 | with: 14 | config: ".github/assign-by-files.yml" 15 | token: ${{ secrets.GITHUB_TOKEN }} 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.versionsBackup 3 | 4 | # Mobile Tools for Java (J2ME) 5 | .mtj.tmp/ 6 | 7 | # Package Files # 8 | *.jar 9 | *.war 10 | *.ear 11 | 12 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 13 | hs_err_pid* 14 | 15 | # Build/target folders 16 | build/ 17 | dist/ 18 | tmp/ 19 | target 20 | bin/ 21 | 22 | # generated by maven-shade-plugin 23 | dependency-reduced-pom.xml 24 | 25 | # Editors 26 | .idea 27 | .settings 28 | .classpath 29 | .project 30 | java/bin/ 31 | *.swp 32 | *.iml 33 | .vscode 34 | node_modules 35 | *.lock 36 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | java liberica-11.0.15+10 adoptopenjdk-11.0.15+10 2 | -------------------------------------------------------------------------------- /DEVEL.md: -------------------------------------------------------------------------------- 1 | 2 | # API Development Guidelines 3 | 4 | * All interfaces in the 'api' module should contain the version in which they were introduced using a `@since` tag in the interface's Javadoc 5 | * Interfaces which are expected to be exposed in the OSGi registry by the API users should be annotated with the `org.opennms.integration.api.v1.annotations.Exposable` annotation 6 | * Interfaces which are expected to be consumed from the OSGi registry by the API users should be annotated with the `org.opennms.integration.api.v1.annotations.Consumable` annotation 7 | * Interfaces which have associated builder implementations in the common module should be annotated with the 'org.opennms.integration.api.v1.annotations.Model' annotation 8 | 9 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | OpenNMS License 2 | =============== 3 | 4 | This file is part of OpenNMS(R). 5 | 6 | Copyright (C) 2019 The OpenNMS Group, Inc. 7 | OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 8 | 9 | OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 10 | 11 | OpenNMS(R) is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU Affero General Public License as published 13 | by the Free Software Foundation, either version 3 of the License, 14 | or (at your option) any later version. 15 | 16 | OpenNMS(R) is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU Affero General Public License for more details. 20 | 21 | You should have received a copy of the GNU Affero General Public License 22 | along with OpenNMS(R). If not, see: 23 | http://www.gnu.org/licenses/ 24 | 25 | For more information contact: 26 | OpenNMS(R) Licensing 27 | http://www.opennms.org/ 28 | http://www.opennms.com/ 29 | 30 | -------------------------------------------------------------------------------- /RELEASING.md: -------------------------------------------------------------------------------- 1 | # Releasing 2 | 3 | Update pom versions: 4 | ``` 5 | mvn versions:set -DnewVersion=0.1.1 6 | ``` 7 | 8 | Commit pom update: 9 | ``` 10 | git commit 11 | ``` 12 | 13 | Tag: 14 | ``` 15 | git tag -u opennms@opennms.org -s v0.1.1 16 | ``` 17 | 18 | Deploy: 19 | ``` 20 | mvn -Prelease -Darguments=-Dgpg.keyname="opennms@opennms.org" -Dgpg.keyname="opennms@opennms.org" clean deploy 21 | ``` 22 | 23 | > The `release` profile enables GPG signing of the artifacts. 24 | 25 | Update pom versions again: 26 | ``` 27 | mvn versions:set -DnewVersion=0.1.2-SNAPSHOT 28 | ``` 29 | 30 | Commit pom update: 31 | ``` 32 | git commit 33 | ``` 34 | 35 | Push commits and tags: 36 | ``` 37 | git push 38 | git push --tags 39 | 40 | ``` 41 | -------------------------------------------------------------------------------- /api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.opennms.integration.api 4 | api-project 5 | 2.0.0-SNAPSHOT 6 | 7 | 4.0.0 8 | api 9 | OpenNMS Integration API :: API 10 | bundle 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/annotations/Consumable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.annotations; 30 | 31 | /** 32 | * Interfaces marked with this annotation are made available for consumption for users of the API. 33 | * 34 | * Support for the different containers will vary on the implementation. 35 | * 36 | * @author jwhite 37 | * @since 1.0.0 38 | */ 39 | public @interface Consumable { } -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/annotations/Exposable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.annotations; 30 | 31 | /** 32 | * Interfaces marked with this annotation can be exposed by users of the API. 33 | * 34 | * These should be exposed in the OSGi registry, and will be automatically registered with the corresponding processes. 35 | * 36 | * Support for the different containers will vary on the implementation. 37 | * 38 | * @author jwhite 39 | * @since 1.0.0 40 | */ 41 | public @interface Exposable { } 42 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/annotations/Model.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.annotations; 30 | 31 | /** 32 | * Interfaces marked with this annotation have an implementation included in the API's common package. These interfaces 33 | * are likely to have additional methods added in the future. 34 | * 35 | * It is recommended to use the provided implementations whenever possible to avoid breaking changes in future API 36 | * updates. 37 | * 38 | * @author mbrooks 39 | * @since 1.0.0 40 | */ 41 | public @interface Model { 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/collectors/CollectionRequest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.collectors; 30 | 31 | import java.net.InetAddress; 32 | 33 | /** 34 | * Encapsulates collection request details for the collector to perform collect. 35 | */ 36 | public interface CollectionRequest { 37 | 38 | InetAddress getAddress(); 39 | 40 | int getNodeId(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/collectors/ServiceCollectorClient.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.collectors; 30 | 31 | import org.opennms.integration.api.v1.annotations.Consumable; 32 | 33 | /** 34 | * Runs collector 35 | */ 36 | @Consumable 37 | public interface ServiceCollectorClient { 38 | 39 | /** 40 | * Performs collect using {@link CollectorRequestBuilder} 41 | * @return 42 | */ 43 | CollectorRequestBuilder collect(); 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/collectors/resource/CollectionSetResource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.collectors.resource; 30 | 31 | import java.util.List; 32 | 33 | public interface CollectionSetResource { 34 | 35 | T getResource(); 36 | 37 | List getStringAttributes(); 38 | 39 | List getNumericAttributes(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/collectors/resource/GenericTypeResource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.collectors.resource; 30 | 31 | public interface GenericTypeResource extends Resource { 32 | 33 | NodeResource getNodeResource(); 34 | 35 | String getType(); 36 | 37 | String getInstance(); 38 | } 39 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/collectors/resource/IpInterfaceResource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.collectors.resource; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * @see "The provided model implementation can be found in the class ImmutableIpInterfaceResource" 35 | * @since 1.0.0 36 | */ 37 | @Model 38 | public interface IpInterfaceResource extends Resource { 39 | 40 | NodeResource getNodeResource(); 41 | 42 | String getInstance(); 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/collectors/resource/Resource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.collectors.resource; 30 | 31 | public interface Resource { 32 | 33 | public enum Type { 34 | NODE, 35 | INTERFACE, 36 | GENERIC; 37 | }; 38 | 39 | Type getResourceType(); 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/collectors/resource/StringAttribute.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.collectors.resource; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * @see "The provided model implementation can be found in the class ImmutableStringAttribute" 35 | * @since 1.0.0 36 | */ 37 | @Model 38 | public interface StringAttribute { 39 | 40 | String getName(); 41 | 42 | String getValue(); 43 | 44 | String getGroup(); 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/collector/AddressRange.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2022 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2022 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.collector; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * Range of addresses 35 | */ 36 | @Model 37 | public interface AddressRange { 38 | 39 | /** 40 | * Starting address of the range. 41 | */ 42 | String getBegin(); 43 | 44 | /** 45 | * Ending address of the range. 46 | */ 47 | String getEnd(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/collector/Parameter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2022 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2022 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.collector; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * Parameter of a collector. 35 | */ 36 | @Model 37 | public interface Parameter { 38 | 39 | String getKey(); 40 | 41 | String getValue(); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/datacollection/Collect.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.datacollection; 30 | 31 | import java.util.List; 32 | 33 | public interface Collect { 34 | 35 | List getIncludeGroups(); 36 | } 37 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/datacollection/Group.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.datacollection; 30 | 31 | import java.util.List; 32 | 33 | public interface Group { 34 | 35 | String getName(); 36 | 37 | String getIfType(); 38 | 39 | List getMibObjs(); 40 | 41 | List getProperties(); 42 | 43 | List getIncludeGroups(); 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/datacollection/IpList.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.datacollection; 30 | 31 | import java.util.List; 32 | 33 | public interface IpList { 34 | 35 | List getIpAddresses(); 36 | 37 | List getIpAddressMasks(); 38 | } 39 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/datacollection/MibObj.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.datacollection; 30 | 31 | public interface MibObj { 32 | 33 | String getOid(); 34 | 35 | String getInstance(); 36 | 37 | String getAlias(); 38 | 39 | String getType(); 40 | 41 | String getMaxval(); 42 | 43 | String getMinval(); 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/datacollection/MibObjProperty.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.datacollection; 30 | 31 | import java.util.List; 32 | 33 | public interface MibObjProperty { 34 | 35 | String getInstance(); 36 | 37 | String getAlias(); 38 | 39 | String getClassName(); 40 | 41 | List getParameters(); 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/datacollection/Parameter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2017-2017 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2017 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.datacollection; 30 | 31 | /** 32 | * A simple key/value pair. 33 | * 34 | * This is defined as interface in order to avoid depending 35 | * on the model objects directly in the API package. 36 | * 37 | * @author jwhite 38 | */ 39 | public interface Parameter { 40 | 41 | String getKey(); 42 | 43 | String getValue(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/datacollection/ResourceTypesExtension.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.datacollection; 30 | 31 | import java.util.List; 32 | 33 | import org.opennms.integration.api.v1.annotations.Exposable; 34 | 35 | /** 36 | * Expose resource types. 37 | */ 38 | @Exposable 39 | public interface ResourceTypesExtension { 40 | 41 | List getResourceTypes(); 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/datacollection/SnmpDataCollection.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.datacollection; 30 | 31 | import java.util.List; 32 | 33 | public interface SnmpDataCollection { 34 | 35 | String getName(); 36 | 37 | List getResourceTypes(); 38 | 39 | List getGroups(); 40 | 41 | List getSystemDefs(); 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/datacollection/StrategyDefinition.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2017-2017 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2017 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.datacollection; 30 | 31 | import java.util.List; 32 | 33 | /** 34 | * Used to define the strategy implementation (class) 35 | * and related attributes (parameters) to be used by the strategy. 36 | * 37 | * @author jesse 38 | */ 39 | public interface StrategyDefinition { 40 | 41 | String getClazz(); 42 | 43 | List getParameters(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/datacollection/SystemDef.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.datacollection; 30 | 31 | public interface SystemDef { 32 | 33 | String getName(); 34 | 35 | String getSysoid(); 36 | 37 | String getSysoidMask(); 38 | 39 | IpList getIpList(); 40 | 41 | Collect getCollect(); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/datacollection/graphs/GraphPropertiesExtension.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.datacollection.graphs; 30 | 31 | import java.util.List; 32 | 33 | public interface GraphPropertiesExtension { 34 | 35 | List getPrefabGraphs(); 36 | } 37 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/events/AlarmData.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.events; 30 | 31 | import java.util.List; 32 | 33 | /** 34 | * Defines the alarm for a given event definition. 35 | * 36 | * @since 1.0.0 37 | */ 38 | public interface AlarmData { 39 | 40 | String getReductionKey(); 41 | 42 | AlarmType getType(); 43 | 44 | String getClearKey(); 45 | 46 | boolean isAutoClean(); 47 | 48 | List getUpdateFields(); 49 | 50 | ManagedObject getManagedObject(); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/events/EventConfExtension.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.events; 30 | 31 | import java.util.List; 32 | 33 | import org.opennms.integration.api.v1.annotations.Exposable; 34 | 35 | /** 36 | * Used to expose event definitions. 37 | * 38 | * @since 1.0.0 39 | */ 40 | @Exposable 41 | public interface EventConfExtension { 42 | 43 | List getEventDefinitions(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/events/LogMessage.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.events; 30 | 31 | /** 32 | * The log message to use for a given event definition. 33 | * 34 | * @since 1.0.0 35 | */ 36 | public interface LogMessage { 37 | 38 | String getContent(); 39 | 40 | LogMsgDestType getDestination(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/events/LogMsgDestType.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.events; 30 | 31 | /** 32 | * Log message destinations. 33 | * 34 | * @since 1.0.0 35 | */ 36 | public enum LogMsgDestType { 37 | LOGNDISPLAY, 38 | DISPLAYONLY, 39 | LOGONLY, 40 | SUPPRESS, 41 | DONOTPERSIST, 42 | DISCARDTRAPS; 43 | 44 | @Override 45 | public String toString() { 46 | return this.name().toLowerCase(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/events/ManagedObject.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.events; 30 | 31 | /** 32 | * Managed object to which the alarms should be associated. 33 | * 34 | * @since 1.0.0 35 | */ 36 | public interface ManagedObject { 37 | 38 | String getType(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/events/Mask.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.events; 30 | 31 | import java.util.List; 32 | 33 | /** 34 | * A mask (i.e. filter) to use for a given event definition. 35 | * 36 | * @since 1.0.0 37 | */ 38 | public interface Mask { 39 | 40 | List getMaskElements(); 41 | 42 | List getVarbinds(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/events/MaskElement.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.events; 30 | 31 | import java.util.List; 32 | 33 | /** 34 | * Mask element. 35 | * 36 | * @since 1.0.0 37 | */ 38 | public interface MaskElement { 39 | 40 | String getName(); 41 | 42 | List getValues(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/events/Parameter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.events; 30 | 31 | /** 32 | * Parameters which are automatically added to the event. 33 | * 34 | * @since 1.0.0 35 | */ 36 | public interface Parameter { 37 | 38 | String getName(); 39 | 40 | String getValue(); 41 | 42 | boolean shouldExpand(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/events/UpdateField.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.events; 30 | 31 | /** 32 | * Fields to update when reducing a new event on the alarm. 33 | * 34 | * @since 1.0.0 35 | */ 36 | public interface UpdateField { 37 | 38 | String getName(); 39 | 40 | boolean isUpdatedOnReduction(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/events/Varbind.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.events; 30 | 31 | import java.util.List; 32 | 33 | /** 34 | * Varbind against which to filter the event. 35 | * 36 | * @since 1.0.0 37 | */ 38 | public interface Varbind { 39 | 40 | String getTextualConvention(); 41 | 42 | Integer getNumber(); 43 | 44 | List getValues(); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/poller/AddressRange.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2022 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2022 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.poller; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * Range of addresses 35 | */ 36 | @Model 37 | public interface AddressRange { 38 | 39 | /** 40 | * Starting address of the range. 41 | */ 42 | String getBegin(); 43 | 44 | /** 45 | * Ending address of the range. 46 | */ 47 | String getEnd(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/poller/Parameter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2022 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2022 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.poller; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * Parameters to be used for polling this service. E.g.: for polling HTTP, the 35 | * URL to hit is configurable via a parameter. Parameters are specific to the 36 | * service monitor. 37 | */ 38 | @Model 39 | public interface Parameter { 40 | 41 | String getKey(); 42 | 43 | String getValue(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/poller/Rrd.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2011-2014 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2022 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.poller; 30 | 31 | import java.util.List; 32 | 33 | import org.opennms.integration.api.v1.annotations.Model; 34 | 35 | /** 36 | * RRD parameters 37 | */ 38 | @Model 39 | public interface Rrd { 40 | 41 | /** 42 | * Step size for the RRD, in seconds. 43 | */ 44 | int getStep(); 45 | 46 | /** 47 | * Round Robin Archive definitions. Format: "RRA:(AVERAGE|MIN|MAX|LAST):.*" 48 | */ 49 | List getRras(); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/requisition/RequisitionAsset.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.requisition; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * @see "The provided model implementation can be found in the class ImmutableRequisitionAsset" 35 | * @since 1.0.0 36 | */ 37 | @Model 38 | public interface RequisitionAsset { 39 | 40 | String getName(); 41 | 42 | String getValue(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/requisition/RequisitionMetaData.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.requisition; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * @see "The provided model implementation can be found in the class ImmutableRequisitionMetaData" 35 | * @since 1.0.0 36 | */ 37 | @Model 38 | public interface RequisitionMetaData { 39 | 40 | String getContext(); 41 | 42 | String getKey(); 43 | 44 | String getValue(); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/requisition/RequisitionMonitoredService.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.requisition; 30 | 31 | import java.util.List; 32 | 33 | import org.opennms.integration.api.v1.annotations.Model; 34 | 35 | /** 36 | * @see "The provided model implementation can be found in the class ImmutableRequisitionMonitoredService" 37 | * @since 1.0.0 38 | */ 39 | @Model 40 | public interface RequisitionMonitoredService { 41 | 42 | String getName(); 43 | 44 | List getMetaData(); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/requisition/SnmpPrimaryType.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.requisition; 30 | 31 | public enum SnmpPrimaryType { 32 | NOT_ELIGIBLE, 33 | SECONDARY, 34 | PRIMARY 35 | } 36 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/syslog/ParameterAssignment.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.syslog; 30 | 31 | /** 32 | * Assign a group extracted from the regex to a parameter. 33 | * 34 | * @since 1.0.0 35 | */ 36 | public interface ParameterAssignment { 37 | 38 | int getGroupNumber(); 39 | 40 | String getParameterName(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/syslog/SyslogMatchExtension.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.syslog; 30 | 31 | import java.util.List; 32 | 33 | import org.opennms.integration.api.v1.annotations.Exposable; 34 | 35 | /** 36 | * Used to expose syslog matches. 37 | * 38 | * @since 1.0.0 39 | */ 40 | @Exposable 41 | public interface SyslogMatchExtension { 42 | 43 | List getSyslogMatches(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/ExcludeRange.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | /** 32 | * @since 1.0.0 33 | */ 34 | public interface ExcludeRange { 35 | 36 | String getBegin(); 37 | 38 | String getEnd(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/Expression.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | /** 32 | * Threhsolding expression. 33 | * 34 | * @since 1.0.0 35 | */ 36 | public interface Expression extends Basethresholddef { 37 | 38 | String getExpression(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/Filter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | import java.util.Optional; 32 | 33 | /** 34 | * @since 1.0.0 35 | */ 36 | public interface Filter { 37 | 38 | Optional getContent(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/FilterOperator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | /** 32 | * @since 1.0.0 33 | */ 34 | public enum FilterOperator { 35 | 36 | AND, 37 | 38 | OR; 39 | 40 | public String getEnumName() { 41 | return this.toString().toLowerCase(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/GroupDefinition.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | import java.util.List; 32 | 33 | /** 34 | * A thresholding group definition. 35 | * 36 | * @since 1.0.0 37 | */ 38 | public interface GroupDefinition { 39 | 40 | String getName(); 41 | 42 | String getRrdRepository(); 43 | 44 | List getThresholds(); 45 | 46 | List getExpressions(); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/IncludeRange.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | /** 32 | * @since 1.0.0 33 | */ 34 | public interface IncludeRange { 35 | 36 | String getBegin(); 37 | 38 | String getEnd(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/Parameter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | /** 32 | * @since 1.0.0 33 | */ 34 | public interface Parameter { 35 | 36 | String getKey(); 37 | 38 | String getValue(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/ResourceFilter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | import java.util.Optional; 32 | 33 | /** 34 | * @since 1.0.0 35 | */ 36 | public interface ResourceFilter { 37 | 38 | Optional getContent(); 39 | 40 | String getField(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/Service.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | import java.util.List; 32 | import java.util.Optional; 33 | 34 | /** 35 | * @since 1.0.0 36 | */ 37 | public interface Service { 38 | 39 | String getName(); 40 | 41 | Long getInterval(); 42 | 43 | Boolean getUserDefined(); 44 | 45 | Optional getStatus(); 46 | 47 | List getParameters(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/ServiceStatus.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | /** 32 | * @since 1.0.0 33 | */ 34 | public enum ServiceStatus { 35 | ON, 36 | OFF 37 | } 38 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/ThreshdConfigurationExtension.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | import java.util.List; 32 | 33 | import org.opennms.integration.api.v1.annotations.Exposable; 34 | 35 | /** 36 | * Used to expose thresholding package and thresholder definitions. 37 | * 38 | * @since 1.0.0 39 | */ 40 | @Exposable 41 | public interface ThreshdConfigurationExtension { 42 | 43 | List getPackages(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/Threshold.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | /** 32 | * @since 1.0.0 33 | */ 34 | public interface Threshold extends Basethresholddef { 35 | 36 | String getDsName(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/config/thresholding/ThresholdingConfigExtension.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.config.thresholding; 30 | 31 | import java.util.List; 32 | 33 | import org.opennms.integration.api.v1.annotations.Exposable; 34 | 35 | /** 36 | * Used to expose thresholding group definitions. 37 | * 38 | * @since 1.0.0 39 | */ 40 | @Exposable 41 | public interface ThresholdingConfigExtension { 42 | 43 | List getGroupDefinitions(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/coordination/Role.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.coordination; 30 | 31 | /** 32 | * The valid roles when participating in a redundant cluster. 33 | * 34 | * @author mbrooks 35 | * @since 1.0.0 36 | */ 37 | public enum Role { 38 | UNKNOWN, 39 | ACTIVE, 40 | STANDBY 41 | } 42 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/detectors/DetectResults.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.detectors; 30 | 31 | /** 32 | * Encapsulate service detection results. 33 | */ 34 | public interface DetectResults { 35 | 36 | /** 37 | * @return true if the service was detected, false otherwise 38 | */ 39 | boolean isServiceDetected(); 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/flows/FlowException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2022 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2022 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.flows; 30 | 31 | public class FlowException extends Exception { 32 | 33 | public FlowException(final String message) { 34 | super(message); 35 | } 36 | 37 | public FlowException(final String message, final Throwable cause) { 38 | super(message, cause); 39 | } 40 | 41 | public FlowException(final Throwable cause) { 42 | super(cause); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/graph/GraphContainerCache.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2020-2020 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2020 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.graph; 30 | 31 | import org.opennms.integration.api.v1.annotations.Consumable; 32 | 33 | /** 34 | * Provides access to the underlying cache of all graph containers to manually invalidate a cached entry of {@link GraphContainer}. 35 | * 36 | * @author mvrueden 37 | * @since 1.0.0 38 | */ 39 | @Consumable 40 | public interface GraphContainerCache { 41 | void invalidate(String containerId); 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/graph/NodeRef.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2020-2020 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2020 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.graph; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * Reference to a node. 35 | * 36 | * @author mvrueden 37 | * @since 1.0.0 38 | */ 39 | @Model 40 | public interface NodeRef { 41 | String getForeignSource(); 42 | String getForeignId(); 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/graph/VertexRef.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2020-2020 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2020 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.graph; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * Describes a reference to a {@link Vertex}. 35 | * Each {@link Vertex} is uniquely identifiable by its namespace and id. 36 | * 37 | * @author mvrueden 38 | * @since 1.0.0 39 | */ 40 | @Model 41 | public interface VertexRef { 42 | String getNamespace(); 43 | String getId(); 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/graph/status/StatusInfo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2020-2020 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2020 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.graph.status; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | import org.opennms.integration.api.v1.model.Severity; 33 | 34 | /** 35 | * Holds information about the status of a graph element. 36 | * 37 | * @author mvrueden 38 | * @since 1.0.0 39 | */ 40 | @Model 41 | public interface StatusInfo { 42 | Severity getSeverity(); 43 | long getCount(); 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/health/Context.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018-2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.health; 30 | 31 | /** 32 | * Context related to the health check that is being performed. 33 | * 34 | * @author mvrueden 35 | * @since 1.0.0 36 | */ 37 | public interface Context { 38 | 39 | long getTimeout(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/health/Response.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018-2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.health; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * The response of a health check. 35 | * 36 | * @see "The provided model implementation can be found in the class ImmutableResponse" 37 | * @author mvrueden 38 | * @since 1.0.0 39 | */ 40 | @Model 41 | public interface Response { 42 | 43 | Status getStatus(); 44 | 45 | String getMessage(); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/model/EventParameter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.model; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * An event parameter. 35 | * 36 | * @see "The provided model implementation can be found in the class ImmutableEventParameter" 37 | * @author jwhite 38 | * @since 1.0.0 39 | */ 40 | @Model 41 | public interface EventParameter { 42 | 43 | String getName(); 44 | 45 | String getValue(); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/model/MetaData.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.model; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * Meta-data. 35 | * 36 | * @see "The provided model implementation can be found in the class ImmutableMetaData" 37 | * @author jwhite 38 | * @since 1.0.0 39 | */ 40 | @Model 41 | public interface MetaData { 42 | 43 | String getContext(); 44 | 45 | String getKey(); 46 | 47 | String getValue(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/model/MonitoredService.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2022 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2022 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.model; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | import java.util.List; 34 | 35 | @Model 36 | public interface MonitoredService { 37 | 38 | String getName(); 39 | 40 | List getMetaData(); 41 | 42 | boolean getStatus(); 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/model/SnmpInterface.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.model; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * An SNMP interface. 35 | * 36 | * @see "The provided model implementation can be found in the class ImmutableSnmpInterface" 37 | * @author jwhite 38 | * @since 1.0.0 39 | */ 40 | @Model 41 | public interface SnmpInterface { 42 | 43 | String getIfDescr(); 44 | 45 | String getIfName(); 46 | 47 | Integer getIfIndex(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/model/TopologyPort.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.model; 30 | 31 | import org.opennms.integration.api.v1.annotations.Model; 32 | 33 | /** 34 | * @see "The provided model implementation can be found in the class ImmutableTopologyPort" 35 | * @author mbrooks 36 | * @since 1.0.0 37 | */ 38 | @Model 39 | public interface TopologyPort extends TopologyRef { 40 | Integer getIfIndex(); 41 | 42 | String getIfName(); 43 | 44 | String getIfAddress(); 45 | 46 | NodeCriteria getNodeCriteria(); 47 | } 48 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/model/TopologyRef.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.model; 30 | 31 | /** 32 | * @author mbrooks 33 | * @since 1.0.0 34 | */ 35 | interface TopologyRef { 36 | String getId(); 37 | 38 | String getTooltipText(); 39 | } 40 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/pollers/ServicePollerClient.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.pollers; 30 | 31 | import org.opennms.integration.api.v1.annotations.Consumable; 32 | 33 | /** 34 | * Runs the poller. 35 | */ 36 | @Consumable 37 | public interface ServicePollerClient { 38 | 39 | PollerRequestBuilder poll(); 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/requisition/RequisitionRepository.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.requisition; 30 | 31 | import org.opennms.integration.api.v1.annotations.Consumable; 32 | import org.opennms.integration.api.v1.config.requisition.Requisition; 33 | 34 | @Consumable 35 | public interface RequisitionRepository { 36 | 37 | Requisition getDeployedRequisition(String foreignSource); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/requisition/RequisitionRequest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2017-2017 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2017 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.requisition; 30 | 31 | /** 32 | * Marker interface used for requests in the {@link RequisitionProvider}. 33 | * 34 | * @author jwhite 35 | */ 36 | public interface RequisitionRequest { } 37 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/runtime/Container.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.runtime; 30 | 31 | /** 32 | * Enumeration of the container (JVM) in which the API is currently running. 33 | * 34 | * @author jwhite 35 | * @since 1.0.0 36 | */ 37 | public enum Container { 38 | OPENNMS, 39 | MINION, 40 | SENTINEL, 41 | OTHER; 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/runtime/Version.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2018 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2018 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.runtime; 30 | 31 | /** 32 | * Product version. 33 | * 34 | * @author jwhite 35 | * @since 1.0.0 36 | */ 37 | public interface Version extends Comparable { 38 | 39 | int getMajor(); 40 | 41 | int getMinor(); 42 | 43 | int getPatch(); 44 | 45 | boolean isSnapshot(); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/scv/Credentials.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2022 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2022 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | package org.opennms.integration.api.v1.scv; 29 | 30 | import java.util.Map; 31 | import java.util.Set; 32 | 33 | import org.opennms.integration.api.v1.annotations.Model; 34 | 35 | @Model 36 | public interface Credentials { 37 | String getUsername(); 38 | String getPassword(); 39 | String getAttribute(String key); 40 | Set getAttributeKeys(); 41 | Map getAttributes(); 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/scv/SecureCredentialsVault.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2022 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2022 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | package org.opennms.integration.api.v1.scv; 29 | 30 | import java.util.Set; 31 | 32 | import org.opennms.integration.api.v1.annotations.Consumable; 33 | 34 | @Consumable 35 | public interface SecureCredentialsVault { 36 | 37 | Set getAliases(); 38 | Credentials getCredentials(String alias); 39 | void setCredentials(String alias, Credentials credentials); 40 | 41 | void deleteCredentials(String alias); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/timeseries/DataPoint.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2020 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.timeseries; 30 | 31 | import java.time.Instant; 32 | 33 | /** A value at a specific time for a specific metric. */ 34 | public interface DataPoint { 35 | 36 | Instant getTime(); 37 | 38 | Double getValue(); 39 | } 40 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/timeseries/IntrinsicTagNames.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2010-2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.timeseries; 30 | 31 | /** common tag names used to define the intrinsic tags of a metric. */ 32 | public interface IntrinsicTagNames { 33 | String name = "name"; 34 | String resourceId = "resourceId"; 35 | @Deprecated // moved to meta tag names 36 | String mtype = "mtype"; 37 | } 38 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/timeseries/MetaTagNames.java: -------------------------------------------------------------------------------- 1 | package org.opennms.integration.api.v1.timeseries; 2 | 3 | /** tag names that are used for meta tags. There can be more. */ 4 | public interface MetaTagNames { 5 | /** 6 | * according to http://metrics20.org/spec/ this should be an intrinsic tag name. But OpenNMS can't provide it 7 | * currently during read time. Thus we moved it to meta tags. 8 | * */ 9 | String mtype = "mtype"; 10 | } 11 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/timeseries/Sample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2020 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.timeseries; 30 | 31 | import java.time.Instant; 32 | 33 | /** A datapoint at a specific time for a specific metric. */ 34 | public interface Sample { 35 | 36 | Metric getMetric(); 37 | 38 | Instant getTime(); 39 | 40 | Double getValue(); 41 | } 42 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/timeseries/StorageException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2020 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.timeseries; 30 | 31 | public class StorageException extends Exception { 32 | 33 | public StorageException(final String message) { 34 | super(message); 35 | } 36 | 37 | public StorageException (final Throwable e) { 38 | super(e); 39 | } 40 | 41 | public StorageException (final String message, Throwable e) { 42 | super(e); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/timeseries/Tag.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2020 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.timeseries; 30 | 31 | /** 32 | * A key-value object describing an aspect of a Metric. 33 | * The value is mandatory, the key may be null. 34 | * 35 | * It is inspired by Metrics 2.0, 36 | * @see http://metrics20.org/spec/ 37 | */ 38 | public interface Tag extends Comparable { 39 | String getKey(); 40 | 41 | String getValue(); 42 | 43 | @Override 44 | int compareTo(Tag other); 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/timeseries/TimeSeriesData.java: -------------------------------------------------------------------------------- 1 | package org.opennms.integration.api.v1.timeseries; 2 | 3 | import java.util.List; 4 | 5 | /** The return value for a TimeSeriesFetchRequest. */ 6 | public interface TimeSeriesData { 7 | 8 | /** The full metric with all tags (not only intrinsic tags). */ 9 | Metric getMetric(); 10 | 11 | /** DataPoints for the queried metric and time range. */ 12 | List getDataPoints(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/timeseries/TimeSeriesFetchRequest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2020 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.timeseries; 30 | 31 | import java.time.Duration; 32 | import java.time.Instant; 33 | 34 | public interface TimeSeriesFetchRequest { 35 | 36 | Metric getMetric(); 37 | 38 | Instant getStart(); 39 | 40 | Instant getEnd(); 41 | 42 | /** the results can be aggregated (depending on the given aggregation function). They are bucketed in buckets the size of the step. */ 43 | Duration getStep(); 44 | 45 | Aggregation getAggregation(); 46 | } 47 | -------------------------------------------------------------------------------- /api/src/main/java/org/opennms/integration/api/v1/timeseries/package-info.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2020 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing <license@opennms.org> 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.timeseries; 30 | 31 | /** 32 | * Contains the classes to be used by a timeseries implementation. 33 | * Opennms allows the storage of timeseries data in any timeseries database. 34 | * In order to add a new timeseries database implement 35 | * @{@link org.opennms.integration.api.v1.timeseries.TimeSeriesStorage}. 36 | */ 37 | 38 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.versionsBackup 3 | 4 | # Mobile Tools for Java (J2ME) 5 | .mtj.tmp/ 6 | 7 | # Package Files # 8 | *.jar 9 | *.war 10 | *.ear 11 | 12 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 13 | hs_err_pid* 14 | 15 | # Build/target folders 16 | build/ 17 | dist/ 18 | tmp/ 19 | target 20 | bin/ 21 | 22 | # Editors 23 | .idea 24 | .settings 25 | .classpath 26 | .project 27 | java/bin/ 28 | *.swp 29 | *.iml 30 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/README.md: -------------------------------------------------------------------------------- 1 | # OpenNMS ${pluginName} Plugin 2 | 3 | ## Overview 4 | 5 | This plugin was generated by the OPA archetype and is used as example project layout. 6 | 7 | The generated plugin contains code examples to demonstrate how to create a: 8 | * Karaf Shell Command (see StatsCommand & TopologyCommand) 9 | * REST Endpoint (see WebhookHandler & WebhookHandlerImpl) 10 | * Event Configuration Extension (see EventConfExtension) 11 | * Alarm Lifecycle Listener (see AlarmForwarder) 12 | 13 | ## Developing 14 | 15 | 16 | Build and install the plugin into your local Maven repository using: 17 | 18 | ``` 19 | mvn clean install 20 | ``` 21 | 22 | ## Deploying through features file 23 | 24 | From the OpenNMS Karaf shell: 25 | ``` 26 | feature:repo-add mvn:${groupId}/karaf-features/${version}/xml 27 | feature:install opennms-plugins-${pluginId} 28 | ``` 29 | 30 | ## Deploying through kar file 31 | 32 | ``` 33 | cp assembly/kar/target/opennms-${pluginId}-plugin.kar /opt/opennms/deploy/ 34 | feature:install opennms-plugins-${pluginId} 35 | ``` 36 | 37 | ## Update automatically: 38 | ``` 39 | bundle:watch * 40 | ``` 41 | 42 | ## Features 43 | 44 | Once installed, the plugin makes the following Karaf shell commands available: 45 | * opennms-${pluginId}:stats 46 | * opennms-${pluginId}:push-topology 47 | 48 | You can also access the REST endpoint mounted by the plugin at `http://localhost:8980/opennms/rest/${pluginId}/ping` 49 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/assembly/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ${groupId} 5 | ${rootArtifactId} 6 | ${version} 7 | 8 | 4.0.0 9 | ${artifactId} 10 | OpenNMS :: Plugins :: ${pluginName} :: Assembly 11 | pom 12 | 13 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/plugin/src/main/java/EventConfExtension.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}; 5 | 6 | import java.util.List; 7 | 8 | import org.opennms.integration.api.v1.config.events.EventDefinition; 9 | import org.opennms.integration.api.xml.ClasspathEventDefinitionLoader; 10 | 11 | public class EventConfExtension implements org.opennms.integration.api.v1.config.events.EventConfExtension { 12 | 13 | private final ClasspathEventDefinitionLoader classpathEventDefinitionLoader = new ClasspathEventDefinitionLoader( 14 | EventConfExtension.class, 15 | "plugin.ext.events.xml" 16 | ); 17 | 18 | @Override 19 | public List getEventDefinitions() { 20 | return classpathEventDefinitionLoader.getEventDefinitions(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/plugin/src/main/java/WebhookHandler.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}; 5 | 6 | import javax.ws.rs.Consumes; 7 | import javax.ws.rs.GET; 8 | import javax.ws.rs.POST; 9 | import javax.ws.rs.Path; 10 | import javax.ws.rs.Produces; 11 | import javax.ws.rs.core.MediaType; 12 | import javax.ws.rs.core.Response; 13 | 14 | @Path("${pluginId}") 15 | public interface WebhookHandler { 16 | 17 | @GET 18 | @Path("/ping") 19 | Response ping(); 20 | 21 | @POST 22 | @Path("/hook") 23 | @Produces({MediaType.APPLICATION_JSON}) 24 | @Consumes({MediaType.APPLICATION_JSON}) 25 | Response handleWebhook(String body); 26 | } 27 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/plugin/src/main/java/WebhookHandlerImpl.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}; 5 | 6 | import javax.ws.rs.core.Response; 7 | 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | public class WebhookHandlerImpl implements WebhookHandler { 12 | private static final Logger LOG = LoggerFactory.getLogger(WebhookHandlerImpl.class); 13 | 14 | @Override 15 | public Response ping() { 16 | return Response.ok("pong").build(); 17 | } 18 | 19 | @Override 20 | public Response handleWebhook(String body) { 21 | LOG.debug("Got payload: {}", body); 22 | return Response.ok().build(); 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/plugin/src/main/java/model/Link.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.model; 5 | 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonProperty; 9 | 10 | @JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) 11 | @JsonInclude(JsonInclude.Include.NON_NULL) 12 | public class Link { 13 | 14 | @JsonProperty("source") 15 | private String source; 16 | 17 | @JsonProperty("target") 18 | private String target; 19 | 20 | public Link() { } 21 | 22 | public Link(String source, String target) { 23 | this.source = source; 24 | this.target = target; 25 | } 26 | 27 | public String getSource() { 28 | return source; 29 | } 30 | 31 | public void setSource(String source) { 32 | this.source = source; 33 | } 34 | 35 | public String getTarget() { 36 | return target; 37 | } 38 | 39 | public void setTarget(String target) { 40 | this.target = target; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/plugin/src/main/java/shell/StatsCommand.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.shell; 5 | 6 | import java.util.concurrent.TimeUnit; 7 | 8 | import org.apache.karaf.shell.api.action.Action; 9 | import org.apache.karaf.shell.api.action.Command; 10 | import org.apache.karaf.shell.api.action.lifecycle.Reference; 11 | import org.apache.karaf.shell.api.action.lifecycle.Service; 12 | import ${package}.AlarmForwarder; 13 | 14 | import com.codahale.metrics.ConsoleReporter; 15 | import com.codahale.metrics.MetricRegistry; 16 | 17 | @Command(scope = "opennms-${pluginId}", name = "stats", description = "Show statistics.") 18 | @Service 19 | public class StatsCommand implements Action { 20 | 21 | @Reference 22 | private AlarmForwarder forwarder; 23 | 24 | @Override 25 | public Object execute() { 26 | final MetricRegistry metrics = forwarder.getMetrics(); 27 | final ConsoleReporter reporter = ConsoleReporter.forRegistry(metrics) 28 | .convertRatesTo(TimeUnit.SECONDS) 29 | .convertDurationsTo(TimeUnit.MILLISECONDS) 30 | .build(); 31 | reporter.report(); 32 | return null; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/plugin/src/main/java/shell/TopologyCommand.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.shell; 5 | 6 | import java.util.List; 7 | import java.util.concurrent.CompletableFuture; 8 | 9 | import org.apache.karaf.shell.api.action.Action; 10 | import org.apache.karaf.shell.api.action.Command; 11 | import org.apache.karaf.shell.api.action.lifecycle.Reference; 12 | import org.apache.karaf.shell.api.action.lifecycle.Service; 13 | import ${package}.TopologyForwarder; 14 | import ${package}.model.Topology; 15 | 16 | @Command(scope = "opennms-${pluginId}", name = "push-topology", description = "Push the topology") 17 | @Service 18 | public class TopologyCommand implements Action { 19 | 20 | @Reference 21 | private TopologyForwarder forwarder; 22 | 23 | @Override 24 | public Object execute() { 25 | System.out.println("Forwarding topologies..."); 26 | final CompletableFuture> future = forwarder.forwardTopologies(); 27 | future.whenComplete((topologies,ex) -> { 28 | if (ex == null) { 29 | System.out.printf("Successfully forwarded %d topologies.", topologies.size()); 30 | } else { 31 | System.out.println("Error occurred forwarding topologies: " + ex); 32 | ex.printStackTrace(); 33 | } 34 | }); 35 | try { 36 | future.get(); 37 | } catch (Exception e) { 38 | // pass 39 | } 40 | return null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/plugin/src/main/resources/events/plugin.ext.events.xml: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | 5 | 6 | uei.opennms.org/${pluginId}Plugin/sendEventSuccessful 7 | ${pluginName}: Successfully sent event 8 | Successfully sent event via REST API for alarm with reduction key: %parm[reductionKey]% 9 | ${pluginName}: Successfully sent event for alarm: %parm[reductionKey]% 10 | Normal 11 | 13 | 14 | 15 | uei.opennms.org/${pluginId}Plugin/sendEventFailed 16 | ${pluginName}: Failed to forward event 17 | Failed to sent event via REST API for alarm with reduction key: %parm[reductionKey]%. Message is: %parm[message]% 18 | ${pluginName}: Failed to sent event for alarm: %parm[reductionKey]% 19 | Critical 20 | 21 | 22 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/plugin/src/test/java/AlarmForwarderTest.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}; 5 | 6 | import static org.hamcrest.CoreMatchers.equalTo; 7 | import static org.hamcrest.MatcherAssert.assertThat; 8 | 9 | import org.junit.Test; 10 | import org.opennms.integration.api.v1.model.Alarm; 11 | import org.opennms.integration.api.v1.model.Severity; 12 | import org.opennms.integration.api.v1.model.immutables.ImmutableAlarm; 13 | import ${package}.model.Alert; 14 | 15 | public class AlarmForwarderTest { 16 | 17 | @Test 18 | public void canConvertAlarmToAlert() { 19 | Alarm alarm = ImmutableAlarm.newBuilder() 20 | .setId(1) 21 | .setReductionKey("hey:oh") 22 | .setSeverity(Severity.CRITICAL) 23 | .build(); 24 | 25 | Alert alert = AlarmForwarder.toAlert(alarm); 26 | 27 | assertThat(alert.getStatus(), equalTo(Alert.Status.CRITICAL)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/plugin/src/test/java/AlertTest.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}; 5 | 6 | import java.time.Instant; 7 | 8 | import org.json.JSONException; 9 | import org.junit.Test; 10 | import ${package}.model.Alert; 11 | import org.skyscreamer.jsonassert.JSONAssert; 12 | 13 | import com.fasterxml.jackson.core.JsonProcessingException; 14 | import com.fasterxml.jackson.databind.ObjectMapper; 15 | 16 | public class AlertTest { 17 | 18 | private ObjectMapper mapper = new ObjectMapper(); 19 | 20 | /** 21 | * Verifies that the object is serialized to JSON as expected. 22 | */ 23 | @Test 24 | public void canSerializeToJson() throws JsonProcessingException, JSONException { 25 | Alert alert = new Alert(); 26 | alert.setStatus(Alert.Status.CRITICAL); 27 | alert.setTimestamp(Instant.ofEpochSecond(1402302570)); 28 | alert.setDescription("CPU is above upper limit (91%)"); 29 | alert.setAttribute("my_unique_attribute", "my_unique_value"); 30 | 31 | String expectedJson = "{\n" + 32 | " \"status\": \"critical\",\n" + 33 | " \"timestamp\": 1402302570,\n" + 34 | " \"description\": \"CPU is above upper limit (91%)\",\n" + 35 | " \"my_unique_attribute\": \"my_unique_value\"\n" + 36 | "}"; 37 | JSONAssert.assertEquals(expectedJson, mapper.writeValueAsString(alert), false); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/main/resources/archetype-resources/plugin/src/test/java/TopologyTest.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}; 5 | 6 | import org.json.JSONException; 7 | import org.junit.Test; 8 | import ${package}.model.Topology; 9 | import org.skyscreamer.jsonassert.JSONAssert; 10 | 11 | import com.fasterxml.jackson.core.JsonProcessingException; 12 | import com.fasterxml.jackson.databind.ObjectMapper; 13 | 14 | public class TopologyTest { 15 | 16 | private ObjectMapper mapper = new ObjectMapper(); 17 | 18 | /** 19 | * Verifies that the object is serialized to JSON as expected. 20 | */ 21 | @Test 22 | public void canSerializeToJson() throws JsonProcessingException, JSONException { 23 | Topology topology = new Topology(); 24 | topology.addLink("host", "check"); 25 | topology.addLink("host", "cluster"); 26 | 27 | String expectedJson = "{ \n" + 28 | " \"links\":[ \n" + 29 | " { \n" + 30 | " \"source\":\"host\",\n" + 31 | " \"target\":\"check\"\n" + 32 | " },\n" + 33 | " { \n" + 34 | " \"source\":\"host\",\n" + 35 | " \"target\":\"cluster\"\n" + 36 | " }\n" + 37 | " ]\n" + 38 | "}"; 39 | JSONAssert.assertEquals(expectedJson, mapper.writeValueAsString(topology), false); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/test/resources/projects/basic/archetype.properties: -------------------------------------------------------------------------------- 1 | #Tue Aug 18 14:37:53 EDT 2020 2 | package=it.pkg 3 | version=0.1-SNAPSHOT 4 | groupId=archetype.it 5 | artifactId=basic 6 | pluginId=some-plugin 7 | pluginName=Some Plugin 8 | oiaVersion=0.5.1 -------------------------------------------------------------------------------- /archetypes/example-kar-plugin/src/test/resources/projects/basic/goal.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/opennms-integration-api/140ce1b05fa07ea057c3d407bfec94df6b862d11/archetypes/example-kar-plugin/src/test/resources/projects/basic/goal.txt -------------------------------------------------------------------------------- /archetypes/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.opennms.integration.api 4 | api-project 5 | 2.0.0-SNAPSHOT 6 | 7 | 4.0.0 8 | archetypes 9 | OpenNMS Integration API :: Archetypes 10 | pom 11 | 12 | 13 | example-kar-plugin 14 | 15 | 16 | 17 | 18 | 19 | org.apache.maven.archetype 20 | archetype-packaging 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.opennms.integration.api 4 | api-project 5 | 2.0.0-SNAPSHOT 6 | 7 | 4.0.0 8 | common 9 | OpenNMS Integration API :: Common 10 | bundle 11 | 12 | 13 | 14 | org.opennms.integration.api 15 | api 16 | 17 | 18 | junit 19 | junit 20 | test 21 | 22 | 23 | org.hamcrest 24 | hamcrest-all 25 | test 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /config/src/main/java/org/opennms/integration/api/xml/schema/collector/package-info.java: -------------------------------------------------------------------------------- 1 | @XmlSchema( 2 | namespace = "http://xmlns.opennms.org/xsd/config/collector/api", 3 | elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED, 4 | xmlns={ 5 | @XmlNs(prefix="", namespaceURI="http://xmlns.opennms.org/xsd/collectorconf") 6 | } 7 | ) 8 | package org.opennms.integration.api.xml.schema.collector; 9 | 10 | import javax.xml.bind.annotation.XmlNs; 11 | import javax.xml.bind.annotation.XmlSchema; 12 | 13 | -------------------------------------------------------------------------------- /config/src/main/java/org/opennms/integration/api/xml/schema/datacollection/package-info.java: -------------------------------------------------------------------------------- 1 | @XmlSchema( 2 | namespace = "http://xmlns.opennms.org/xsd/config/datacollection", 3 | elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED, 4 | xmlns={ 5 | @XmlNs(prefix="", namespaceURI="http://xmlns.opennms.org/xsd/config/datacollection") 6 | } 7 | ) 8 | package org.opennms.integration.api.xml.schema.datacollection; 9 | import javax.xml.bind.annotation.XmlNs; 10 | import javax.xml.bind.annotation.XmlSchema; 11 | 12 | -------------------------------------------------------------------------------- /config/src/main/java/org/opennms/integration/api/xml/schema/eventconf/package-info.java: -------------------------------------------------------------------------------- 1 | @XmlSchema( 2 | namespace = "http://xmlns.opennms.org/xsd/eventconf", 3 | elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED, 4 | xmlns={ 5 | @XmlNs(prefix="", namespaceURI="http://xmlns.opennms.org/xsd/eventconf") 6 | } 7 | ) 8 | package org.opennms.integration.api.xml.schema.eventconf; 9 | 10 | import javax.xml.bind.annotation.XmlNs; 11 | import javax.xml.bind.annotation.XmlSchema; 12 | 13 | -------------------------------------------------------------------------------- /config/src/main/java/org/opennms/integration/api/xml/schema/poller/package-info.java: -------------------------------------------------------------------------------- 1 | @XmlSchema( 2 | namespace = "http://xmlns.opennms.org/xsd/config/poller/api", 3 | elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED, 4 | xmlns={ 5 | @XmlNs(prefix="", namespaceURI="http://xmlns.opennms.org/xsd/pollerconf") 6 | } 7 | ) 8 | package org.opennms.integration.api.xml.schema.poller; 9 | 10 | import javax.xml.bind.annotation.XmlNs; 11 | import javax.xml.bind.annotation.XmlSchema; 12 | 13 | -------------------------------------------------------------------------------- /config/src/main/java/org/opennms/integration/api/xml/schema/syslog/package-info.java: -------------------------------------------------------------------------------- 1 | @XmlSchema( 2 | namespace = "http://xmlns.opennms.org/xsd/config/syslog", 3 | elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED, 4 | xmlns={ 5 | @XmlNs(prefix="", namespaceURI="http://xmlns.opennms.org/xsd/config/syslog"), 6 | } 7 | ) 8 | package org.opennms.integration.api.xml.schema.syslog; 9 | import javax.xml.bind.annotation.XmlNs; 10 | import javax.xml.bind.annotation.XmlSchema; 11 | -------------------------------------------------------------------------------- /config/src/main/java/org/opennms/integration/api/xml/schema/thresholding/ServiceStatus.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2019 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2019 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.xml.schema.thresholding; 30 | 31 | import javax.xml.bind.annotation.XmlEnum; 32 | import javax.xml.bind.annotation.XmlEnumValue; 33 | import javax.xml.bind.annotation.XmlRootElement; 34 | 35 | @XmlRootElement(name="status") 36 | @XmlEnum 37 | public enum ServiceStatus { 38 | @XmlEnumValue("on") 39 | ON, 40 | @XmlEnumValue("off") 41 | OFF 42 | } 43 | -------------------------------------------------------------------------------- /karaf-features/src/main/resources/sample.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | mvn:org.opennms.integration.api/karaf-features/${project.version}/xml 4 | 5 | 6 | opennms-integration-api 7 | mvn:commons-io/commons-io/${commonsIoVersion} 8 | mvn:org.opennms.integration.api.sample/sample-project/${project.version} 9 | 10 | 11 | 12 | sample-plugin-common 13 | blueprint:mvn:org.opennms.integration.api.sample/sample-project/${project.version}/xml/blueprint-core 14 | 15 | 16 | 17 | sample-plugin-common 18 | blueprint:mvn:org.opennms.integration.api.sample/sample-project/${project.version}/xml/blueprint-minion 19 | 20 | 21 | 22 | sample-plugin-common 23 | blueprint:mvn:org.opennms.integration.api.sample/sample-project/${project.version}/xml/blueprint-sentinel 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /sample/README.md: -------------------------------------------------------------------------------- 1 | # Sample Project 2 | This project provides samples to development different OpenNMS Plugin API Extensions which can be deployed at 3 | runtime to OpenNMS platform as plugins. 4 | 5 | ## UI Extension 6 | UI extension is a plugin to be deployed as WEB UI dynamic component at runtime. 7 | 8 | ### Steps to create UI extension 9 | - Create UI Extension Vue3 project, build it as external component. Refer [ui-extension](../ui-extension/README.md) for 10 | more information 11 | - Create a subfolder under resource folder for example ui-ext used as UI component folder 12 | - Copy the style.css and .es.js to the ui-ext folder 13 | - Create an extension class implements **UIExtension** interface, e.g. **SampleUIExtension** 14 | - Initial the UI extension class in the blueprint file as the following 15 | ``` 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | ``` 25 | - After the bundle and feature build succeed, install **opennms-plugin-sample** Karaf feature to the running OpenNMS 26 | platform. The extension UI will be rendered and available in the browser 27 | -------------------------------------------------------------------------------- /sample/src/main/resources/blueprint-minion.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /sample/src/main/resources/blueprint-sentinel.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /sample/src/main/resources/collector/collector-configuration1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IPADDR IPLIKE 2.*.*.* 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sample/src/main/resources/collector/collector-configuration2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IPADDR != '0.0.0.0' 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /sample/src/main/resources/poller/poller-configuration1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IPADDR IPLIKE 2.*.*.* 5 | 6 | 7 | RRA:AVERAGE:0.5:1:2016 8 | RRA:AVERAGE:0.5:12:1488 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | zzz from poll-outages.xml zzz 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /sample/src/main/resources/resource-types/jmx-resource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/src/main/resources/resource-types/nxos-cpu-resource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sample/src/main/resources/syslog/Cisco.syslog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | uei.opennms.org/vendor/cisco/syslog/nativeVlanMismatch 6 | 20 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/src/main/resources/thresholding/threshd-configuration.1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | IPADDR != '0.0.0.0' 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /sample/src/main/resources/thresholding/threshd-configuration.2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | IPADDR != '0.0.0.0' 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /sample/src/main/resources/thresholding/thresholds.1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/resources/thresholding/thresholds.2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/resources/ui-ext/style.css: -------------------------------------------------------------------------------- 1 | #app[data-v-a62ce854]{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50;margin-top:60px}a[data-v-5ac905a0]{color:#42b983}code[data-v-5ac905a0]{background-color:#eee;padding:2px 4px;border-radius:4px;color:#304455}table[data-v-5ac905a0],th[data-v-5ac905a0],td[data-v-5ac905a0]{border:2px solid black;border-collapse:collapse}th[data-v-5ac905a0]{background-color:#228b22} 2 | -------------------------------------------------------------------------------- /sample/src/main/resources/web-ui/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /sample/src/main/resources/web-ui/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["johnsoncodehk.volar"] 3 | } 4 | -------------------------------------------------------------------------------- /test-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.opennms.integration.api 4 | api-project 5 | 2.0.0-SNAPSHOT 6 | 7 | 4.0.0 8 | test-api 9 | OpenNMS Integration API :: Test API 10 | bundle 11 | 12 | 13 | 14 | junit 15 | junit 16 | compile 17 | 18 | 19 | org.hamcrest 20 | hamcrest-all 21 | compile 22 | 23 | 24 | org.apache.logging.log4j 25 | log4j-slf4j-impl 26 | compile 27 | 28 | 29 | org.apache.logging.log4j 30 | log4j-core 31 | compile 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /test-api/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test-suites/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.opennms.integration.api 4 | api-project 5 | 2.0.0-SNAPSHOT 6 | 7 | 4.0.0 8 | test-suites 9 | pom 10 | OpenNMS Integration API :: Test Suites 11 | 12 | tss-tests 13 | 14 | 15 | -------------------------------------------------------------------------------- /test-suites/tss-tests/README.md: -------------------------------------------------------------------------------- 1 | # Time Series Storage Plugin Tests 2 | 3 | This module contains tools to test TimeSeriesStorage plugins. 4 | 5 | We have developed a set of test cases to check if a plugin implementation works properly. 6 | In order to create a test for your plugin do the following: 7 | * add a dependency to this jar: 8 | 9 | ```xml 10 | 11 | org.opennms.integration.api 12 | tss-tests 13 | 2.0.0-SNAPSHOT 14 | test 15 | 16 | ``` 17 | * extend `AbstractStorageIntegrationTest` like `InMemoryStorageTest` does. 18 | 19 | For another example with docker containers see: https://github.com/OpenNMS/opennms-cortex-tss-plugin 20 | -------------------------------------------------------------------------------- /test-suites/tss-tests/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | org.opennms.integration.api 5 | test-suites 6 | 2.0.0-SNAPSHOT 7 | 8 | 4.0.0 9 | tss-tests 10 | jar 11 | OpenNMS Integration API :: Test Suites :: TimeSeriesStorage Tests 12 | 13 | 14 | 15 | org.opennms.integration.api 16 | common 17 | ${project.version} 18 | 19 | 20 | com.google.re2j 21 | re2j 22 | 23 | 24 | junit 25 | junit 26 | ${junit.version} 27 | compile 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /test-suites/tss-tests/src/test/java/org/opennms/integration/api/v1/timeseries/InMemoryStorageTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This file is part of OpenNMS(R). 3 | * 4 | * Copyright (C) 2006-2020 The OpenNMS Group, Inc. 5 | * OpenNMS(R) is Copyright (C) 1999-2020 The OpenNMS Group, Inc. 6 | * 7 | * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. 8 | * 9 | * OpenNMS(R) is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Affero General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * OpenNMS(R) is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Affero General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Affero General Public License 20 | * along with OpenNMS(R). If not, see: 21 | * http://www.gnu.org/licenses/ 22 | * 23 | * For more information contact: 24 | * OpenNMS(R) Licensing 25 | * http://www.opennms.org/ 26 | * http://www.opennms.com/ 27 | *******************************************************************************/ 28 | 29 | package org.opennms.integration.api.v1.timeseries; 30 | 31 | /** An example how a plugin could be tested. */ 32 | public class InMemoryStorageTest extends AbstractStorageIntegrationTest { 33 | 34 | @Override 35 | protected TimeSeriesStorage createStorage() { 36 | return new InMemoryStorage(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ui-extension-test/README.md: -------------------------------------------------------------------------------- 1 | # UI Extension Test APP 2 | This is a tool to test the UI Extension works as external Vue3 component can can be loaded into the main application 3 | through HTTP web protocol. 4 | 5 | ## Build and Test 6 | 7 | - Build and start the ui-extension app first 8 | - *yarn* 9 | - *yarn dev* (port 3000) 10 | - Open browser with http://localhost:3000 11 | - Make sure the ui-extension component rendered 12 | -------------------------------------------------------------------------------- /ui-extension-test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ui-extension-test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app-main", 3 | "version": "0.0.0", 4 | "target": "esnext", 5 | "module": "esnext", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vue-tsc --noEmit && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "pinia": "^2.0.14", 13 | "sass": "^1.49.7", 14 | "sass-loader": "^12.4.0", 15 | "vue": "^3.2.25", 16 | "vue-router": "^4.0.16" 17 | }, 18 | "devDependencies": { 19 | "@vitejs/plugin-vue": "^2.0.0", 20 | "typescript": "^4.4.4", 21 | "vite": "^2.7.2", 22 | "vue-tsc": "^0.29.8" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ui-extension-test/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/opennms-integration-api/140ce1b05fa07ea057c3d407bfec94df6b862d11/ui-extension-test/public/favicon.ico -------------------------------------------------------------------------------- /ui-extension-test/src/App.vue: -------------------------------------------------------------------------------- 1 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /ui-extension-test/src/Plugin.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | -------------------------------------------------------------------------------- /ui-extension-test/src/PluginContainer.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /ui-extension-test/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/opennms-integration-api/140ce1b05fa07ea057c3d407bfec94df6b862d11/ui-extension-test/src/assets/logo.png -------------------------------------------------------------------------------- /ui-extension-test/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import { DefineComponent } from 'vue' 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /ui-extension-test/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import { createPinia } from 'pinia' 4 | import * as Vue from 'vue/dist/vue.esm-bundler' 5 | import * as Pinia from 'pinia' 6 | import * as VueRouter from 'vue-router' 7 | import externalComponent from './utils/externalComponent' 8 | import Router from './router' 9 | 10 | (window as any)['VRouter'] = Router; 11 | (window as any).Vue = Vue; 12 | (window as any).Pinia = Pinia; 13 | (window as any).VueRouter = VueRouter; 14 | 15 | await externalComponent('http://localhost:5002/uiextension.es.js') 16 | 17 | createApp(App) 18 | .use(createPinia()) 19 | .use(Router) 20 | .mount('#app') 21 | 22 | -------------------------------------------------------------------------------- /ui-extension-test/src/router/index.ts: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHistory } from 'vue-router' 2 | import PluginVue from '../Plugin.vue' 3 | 4 | const router = createRouter({ 5 | history: createWebHistory(), 6 | routes: [ 7 | { 8 | path: '/', 9 | name: 'Plugin', 10 | component: PluginVue, 11 | }, 12 | { 13 | path: '/:pathMatch(.*)*', // catch other paths and redirect 14 | redirect: '/' 15 | } 16 | ] 17 | }) 18 | 19 | export default router 20 | -------------------------------------------------------------------------------- /ui-extension-test/src/utils/externalComponent.ts: -------------------------------------------------------------------------------- 1 | export default async function externalComponent(url: string) { 2 | //@ts-ignore 3 | const name: any = url.split('/').reverse()[0].match(/^(.*?)\.es/)[1]; 4 | 5 | if (window[name]) return window[name] 6 | 7 | //@ts-ignore 8 | window[name] = new Promise((resolve, reject) => { 9 | const script = document.createElement('script') 10 | script.type = 'module' 11 | script.async = true 12 | //@ts-ignore 13 | script.addEventListener('load', () => { 14 | resolve(window[name]) 15 | }) 16 | script.addEventListener('error', () => { 17 | reject(new Error(`Error loading ${url}`)) 18 | }) 19 | script.src = url 20 | document.head.appendChild(script) 21 | }) 22 | 23 | return window[name] 24 | } 25 | -------------------------------------------------------------------------------- /ui-extension-test/src/utils/externalStyles.ts: -------------------------------------------------------------------------------- 1 | const addStylesheet = (url: string) => { 2 | const head = document.head 3 | const link = document.createElement("link") 4 | 5 | link.type = "text/css" 6 | link.rel = "stylesheet" 7 | link.href = url 8 | 9 | head.appendChild(link) 10 | } 11 | 12 | export default addStylesheet 13 | -------------------------------------------------------------------------------- /ui-extension-test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "esModuleInterop": true, 12 | "lib": ["esnext", "dom"] 13 | }, 14 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/utils/externalComponent.ts"] 15 | } 16 | -------------------------------------------------------------------------------- /ui-extension-test/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [vue()] 7 | }) 8 | -------------------------------------------------------------------------------- /ui-extension/.env.development: -------------------------------------------------------------------------------- 1 | VITE_BASE_V2_URL=http://localhost:8980/opennms/api/v2 2 | VITE_BASE_REST_URL=http://localhost:8980/opennms/rest 3 | VITE_BASE_URL=http://localhost:8980 4 | -------------------------------------------------------------------------------- /ui-extension/README.md: -------------------------------------------------------------------------------- 1 | # UI Extension 2 | 3 | This is an example UI Extension will be built as an external Vue3 component. I can be deployed with Karaf feature to 4 | OpenNMS platform at runtime. 5 | 6 | ## Build and Test 7 | 8 | - *yarn* 9 | - *yarn build* 10 | - *yarn preview*: this will start web app and listen to 5002 11 | - start [ui-extension-test](../ui-extension-test/README.md) app to see the plugin is loaded into the test app via http 12 | 13 | ## Include UI extension in Karaf bundle 14 | 15 | Please refer to the [sample project](../sample/README.md) 16 | -------------------------------------------------------------------------------- /ui-extension/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ui-extension/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui-extension", 3 | "version": "0.0.0", 4 | "files": [ 5 | "dist" 6 | ], 7 | "main": "./dist/uiextension.umd.js", 8 | "module": "./dist/uiextension.es.js", 9 | "exports": { 10 | ".": { 11 | "import": "./dist/uiextension.es.js", 12 | "require": "./dist/uiextension.umd.js" 13 | } 14 | }, 15 | "scripts": { 16 | "dev": "vite --config vite.config.dev.ts", 17 | "build": "vue-tsc --noEmit && vite build", 18 | "preview": "vite build && vite preview --port 5002" 19 | }, 20 | "dependencies": { 21 | "pinia": "^2.0.14", 22 | "vite-plugin-externals": "^0.5.0", 23 | "vue": "^3.2.37", 24 | "vue-router": "^4.0.16" 25 | }, 26 | "devDependencies": { 27 | "@types/node": "^18.0.0", 28 | "@vitejs/plugin-vue": "^2.2.0", 29 | "typescript": "^4.5.4", 30 | "vite": "^2.8.0", 31 | "vue-tsc": "^0.38.1" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ui-extension/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/opennms-integration-api/140ce1b05fa07ea057c3d407bfec94df6b862d11/ui-extension/public/favicon.ico -------------------------------------------------------------------------------- /ui-extension/src/App.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 18 | -------------------------------------------------------------------------------- /ui-extension/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/opennms-integration-api/140ce1b05fa07ea057c3d407bfec94df6b862d11/ui-extension/src/assets/logo.png -------------------------------------------------------------------------------- /ui-extension/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 32 | 33 | 54 | -------------------------------------------------------------------------------- /ui-extension/src/composables/useRouter.ts: -------------------------------------------------------------------------------- 1 | import router from '../router' 2 | import { Router } from 'vue-router' 3 | 4 | // for plugin routing, use this hook 5 | const useRouter = (): Router => { 6 | return (window as any).VRouter || router 7 | } 8 | 9 | export default useRouter 10 | -------------------------------------------------------------------------------- /ui-extension/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import type { DefineComponent } from 'vue' 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /ui-extension/src/main.ts: -------------------------------------------------------------------------------- 1 | import App from './App.vue' 2 | import { createApp } from 'vue' 3 | import router from './router' 4 | import { createPinia } from 'pinia' 5 | 6 | const envMode = import.meta.env.MODE 7 | 8 | //@ts-ignore 9 | window['uiextension'] = App 10 | 11 | // used to run plugin by itself 12 | if (envMode === 'development') { 13 | createApp(App).use(router).use(createPinia()).mount('#app') 14 | } 15 | -------------------------------------------------------------------------------- /ui-extension/src/router/index.ts: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHistory, Router } from 'vue-router' 2 | import HelloWorld from '../components/HelloWorld.vue' 3 | 4 | const routes = [ 5 | { 6 | path: '/', 7 | name: 'hello', 8 | component: HelloWorld, 9 | }, 10 | ] 11 | 12 | const VRouter: Router = (window as any).VRouter 13 | if (VRouter) { 14 | for (const route of routes) { 15 | const { path, name, component } = route 16 | VRouter.addRoute('Plugin', { path: path.slice(1), name, component }) 17 | } 18 | } 19 | 20 | const router = createRouter({ 21 | history: createWebHistory(), 22 | routes, 23 | }) 24 | 25 | export default router 26 | -------------------------------------------------------------------------------- /ui-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "esModuleInterop": true, 12 | "lib": ["esnext", "dom"], 13 | "skipLibCheck": true 14 | }, 15 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] 16 | } 17 | -------------------------------------------------------------------------------- /ui-extension/vite.config.dev.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | 4 | export default defineConfig({ 5 | plugins: [vue()] 6 | }) 7 | -------------------------------------------------------------------------------- /ui-extension/vite.config.ts: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import { defineConfig } from 'vite' 3 | import vue from '@vitejs/plugin-vue' 4 | import {viteExternalsPlugin} from 'vite-plugin-externals' 5 | 6 | // https://vitejs.dev/config/ 7 | export default defineConfig({ 8 | plugins: [ 9 | vue(), 10 | viteExternalsPlugin({ 11 | vue: 'Vue', 12 | pinia: 'Pinia', 13 | 'vue-router': 'VueRouter' 14 | }) 15 | ], 16 | build: { 17 | cssCodeSplit: false, // keep css in one chunk 18 | lib: { 19 | entry: path.resolve(__dirname, 'src/main.ts'), 20 | name: 'uiextension', 21 | fileName: (format) => `uiextension.${format}.js` 22 | }, 23 | rollupOptions: { 24 | // make sure to externalize deps that shouldn't be bundled 25 | // into your library 26 | external: ['vue', 'pinia', 'vue-router'], 27 | output: { 28 | // Provide global variables to use in the UMD build 29 | // for externalized deps 30 | globals: { 31 | vue: 'Vue', 32 | pinia: 'Pinia', 33 | 'vue-router': 'VueRouer' 34 | } 35 | } 36 | } 37 | } 38 | }) 39 | -------------------------------------------------------------------------------- /utils/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.opennms.integration.api 4 | api-project 5 | 2.0.0-SNAPSHOT 6 | 7 | 4.0.0 8 | org.opennms.integration.api.utils 9 | OpenNMS Integration API :: Utils 10 | bundle 11 | 12 | 13 | 14 | org.slf4j 15 | slf4j-api 16 | 17 | 18 | 19 | org.opennms.integration.api 20 | api 21 | 22 | 23 | org.opennms.integration.api 24 | common 25 | 26 | 27 | 28 | junit 29 | junit 30 | test 31 | 32 | 33 | org.hamcrest 34 | hamcrest-all 35 | test 36 | 37 | 38 | 39 | 40 | --------------------------------------------------------------------------------