Class SnmpTargetResourceTemplate
java.lang.Object
org.snmp4j.mcp.resource.snmp.SnmpTargetResourceTemplate
Provides an MCP
McpServerFeatures.SyncResourceTemplateSpecification and a
McpServerFeatures.SyncCompletionSpecification that expose each configured
SnmpMcpServer.ServerConfiguration.SnmpTargetConfig as a JSON resource addressed
by its unique targetName.
The JSON representation of each target has all properties whose name ends in
"Passphrase", "Password", or "Key" removed before the response
is sent, so credentials are never exposed through the MCP interface.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionSnmpTargetResourceTemplate(Supplier<List<SnmpMcpServer.ServerConfiguration.SnmpTargetConfig>> snmpTargetsSupplier) Creates a resource template backed by the given supplier. -
Method Summary
Modifier and TypeMethodDescriptionio.modelcontextprotocol.server.McpServerFeatures.SyncCompletionSpecificationReturns the completion specification that completes thetargetNameparameter ofsnmp/target/{targetName}against all configured target names.io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecificationReturns the resource template specification forsnmp/target/{targetName}.
-
Constructor Details
-
SnmpTargetResourceTemplate
public SnmpTargetResourceTemplate(Supplier<List<SnmpMcpServer.ServerConfiguration.SnmpTargetConfig>> snmpTargetsSupplier) Creates a resource template backed by the given supplier. The supplier is resolved lazily at request time.- Parameters:
snmpTargetsSupplier- provides the current list ofSnmpTargetConfiginstances; may returnnullor an empty list when no targets are configured
-
-
Method Details
-
templateSpec
public io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecification templateSpec()Returns the resource template specification forsnmp/target/{targetName}.- Returns:
- sync resource template specification for SNMP target configuration lookup
-
completionSpec
public io.modelcontextprotocol.server.McpServerFeatures.SyncCompletionSpecification completionSpec()Returns the completion specification that completes thetargetNameparameter ofsnmp/target/{targetName}against all configured target names.- Returns:
- sync completion specification for the target name template
-