Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Opcenterx InteropNew to Visual Studio Code? Get it now.
Opcenterx Interop

Opcenterx Interop

Dan Bailey

|
21 installs
| (1) | Free
Explore OpcenterX integration topology (RIC, connectors, topics, services)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Opcenterx Interop

Visualize and explore your Siemens Opcenter X integration topology directly inside VS Code — see RICs, connectors, topics, and services at a glance, query live NATS JetStream data, call any Interop REST API, and let GitHub Copilot autonomously discover and execute APIs on your behalf.


Features

  • Integration Explorer — interactive graph view of your Opcenter X integration landscape: Remote Interop Connectors (RICs), their connectors, topics, and downstream services.
  • API Explorer — browse the full Interop API catalog, select endpoints, edit payloads, and execute calls with a visual response viewer.
  • Copilot Agent Tools — three native language model tools let GitHub Copilot discover available APIs, execute them on your tenant, and interact with NATS JetStream — all autonomously with automatic pagination support.
  • NATS JetStream tool — list streams, inspect consumers, publish messages, subscribe to fetch recent messages, and peek at stored messages — directly from Copilot chat.
  • Live NATS topic query — click any topic node to query JetStream stream and consumer details in real time.
  • Two NATS connection modes — connect via a local leaf node (TCP) or directly to the cloud hub over WebSocket with .creds-based authentication.
  • Secure credential storage — the OAuth2 client secret is stored in VS Code's encrypted Secret Storage and never written to settings.json.

Getting Started

  1. Install the extension from the VS Code Marketplace.
  2. Open the Command Palette (Ctrl+Shift+P) and run Opcenterx Interop: Open Integration Explorer.
  3. If prompted, open Settings and fill in the connection details (see Settings below).
  4. The topology graph will load. Click any topic node to query NATS JetStream details.

Copilot Integration

This extension provides four language model tools that GitHub Copilot can invoke in agent mode (@workspace or Chat with tools enabled):

Discover APIs (#discoverInteropApis)

Search the built-in API catalog to find available endpoints by name, category, or keyword. Returns paths, HTTP methods, descriptions, and example payloads.

Call REST API (#opcenterxRestApi)

Execute any Interop REST API call. Supports GET, POST, PUT, PATCH, and DELETE. Authentication is handled automatically using your configured credentials.

NATS JetStream (#nats)

Interact with NATS JetStream on your configured tenant. All connection settings (URL, credentials, JetStream domain) are resolved from extension configuration automatically.

Action Required params Description
listStreams — List all JetStream streams with subject patterns, message counts, and storage info.
streamInfo streamName Get detailed configuration and state for a specific stream.
listConsumers streamName List all consumers on a stream with filter subjects, pending counts, and ack state.
publish subject (+ optional payload, headers) Publish a message to a subject. Returns JetStream ack with stream name and sequence number.
getLastMessage subject Read-only peek at the last stored message on a subject. Does not affect consumers. Note: may return empty on interest-based retention streams where messages are deleted after all consumers ack.
subscribe streamName, subject (+ optional maxMessages) Creates a temporary ephemeral consumer to fetch the most recent N messages (default 5, max 50). The consumer is always deleted immediately after use — no resources are left behind. Ideal for interest-based retention streams where getLastMessage may be empty.
queryTopic topicLabel Find the stream and matching consumers for an Interop topic name.

Kubernetes (#kubectl)

Execute kubectl commands against the Kubernetes cluster configured for the active profile. The kubeconfig path and context are resolved automatically from profile settings — no manual configuration per command.

Action Required params Description
getPods — List pods (all namespaces if namespace omitted).
getLogs podName (+ optional container, tail) Fetch pod logs (default 100 lines).
getServices — List services.
getNamespaces — List all namespaces.
getDeployments — List deployments.
describe resourceType, resourceName Describe any Kubernetes resource.
getEvents — Get recent cluster events sorted by time.
raw args (string array) Run a custom read-only kubectl command. First arg must be a read-only verb.

Security: Only read-only verbs (get, describe, logs, top, explain, etc.) are permitted. Write operations (apply, delete, create, scale, patch) are blocked. The kubeconfig and context are injected programmatically — never from LLM input.

Pagination

Inquiry services and modeling GetAll (POST) endpoints support pagination via QueryOptions.Skip and QueryOptions.Limit in the request payload. Copilot will automatically call the tool multiple times, incrementing Skip, until all results are retrieved.

Tip: Always prefer POST /GetAll with explicit QueryOptions over bare GET /GetAll — the GET variant silently truncates at 10 results.

Example prompts

  • "How many RICs are configured on my tenant?"
  • "Show me all connectors of type OPCUA"
  • "What services are available for trace data?"
  • "Get the topology graph for my environment"
  • "List all NATS streams"
  • "Show me the consumers on the events stream"
  • "Get the latest messages on subject modmom.events.MyTopic.>"
  • "Publish a test message to subject modmom.events.TestTopic"
  • "List all pods in the interop namespace"
  • "Show me the logs for the RIC pod"
  • "Describe the interop-connector deployment"
  • "What events happened in the last hour on the cluster?"

Commands

All commands are available via the Command Palette (Ctrl+Shift+P). Type Opcenterx Interop to filter.

Command Description
Open Integration Explorer Opens the integration topology graph webview.
Refresh Integration Explorer Reloads topology data from the API.
Open API Explorer Opens the interactive API catalog and execution panel.
Call REST API Manually call any REST API path with a chosen method and payload.
Switch Profile Shows a quick-pick to switch between configured profiles.
Open Settings Opens the Opcenterx Interop settings page directly.
Set Client Secret Stores the OAuth2 client secret in Secret Storage for the active profile.

Settings

Configure these via File → Preferences → Settings and search for Opcenterx Interop, or use the Open Settings command.

Multi-Profile Support

The extension supports up to 9 named profiles, allowing you to switch between different Opcenter X environments (e.g. dev, staging, production) without re-entering credentials each time.

Setting Default Description
opcenterxInterop.activeProfile 1 The currently active profile (1–9). Switch via the status bar or Switch Profile command.

Each profile (profile1 through profile9) contains the following settings:

Per-Profile Settings

Setting Default Description
profileN.name (empty) Display name shown in the status bar and profile picker (e.g. "DEV", "STAGING").
profileN.apiBaseUrl (empty) Base URL for the OpcenterX Interop API. The extension appends service paths automatically.
profileN.tokenEndpoint (empty) OAuth2 client-credentials token URL for your tenant.
profileN.clientId (empty) OAuth2 client_id for your tenant.
profileN.clientSecret (secure) OAuth2 client secret — stored in VS Code encrypted Secret Storage. Use the Set Client Secret command to set this value. It is never written to settings.json.
profileN.natsConnectionMode leafNode leafNode connects to a local NATS leaf node over TCP. direct connects to the cloud NATS hub over WebSocket.
profileN.natsUrl nats://localhost:4224 NATS leaf node URL. Used when mode is leafNode.
profileN.natsWsUrl (empty) Base WebSocket URL for direct cloud NATS connection. Extension appends /leafnode.
profileN.natsCredsFile (empty) Absolute path to the .creds file for direct NATS connection.
profileN.natsJetstreamDomain modmom JetStream domain name. Used by both connection modes.
profileN.kubeconfigPath (empty) Absolute path to the kubeconfig file for this profile's Kubernetes cluster. If set, KUBECONFIG is injected into terminals automatically.
profileN.kubeContext (empty) Kubernetes context name within the kubeconfig file. If set, passed as --context to all kubectl operations.
profileN.kubeNamespace (empty) Default Kubernetes namespace for this profile (typically the tenant environment name from GetTenantEnvironmentName). Used automatically when no namespace is specified in a kubectl command.

Tip: The status bar (bottom-left) shows $(plug) <profile name>. Click it to quickly switch between configured profiles.

Mandatory Settings Per Tool

Each tool validates that required settings are present in the active profile before executing. If a required setting is missing, the tool returns a clear error message indicating which profile setting needs to be configured.

Tool Required settings
REST API (#opcenterxRestApi) apiBaseUrl
NATS (#nats) natsUrl (leafNode mode) or natsWsUrl + natsCredsFile (direct mode)
kubectl (#kubectl) kubeconfigPath, kubeNamespace

Connection Mode Details

Leaf Node (default)

Suitable for local development or when you have a NATS leaf node running on your machine that connects to the Opcenter X cloud hub.

nats://localhost:4224   ←   your local nats-server leaf node   →   cloud hub

Set natsConnectionMode to leafNode and configure natsUrl to point to your local leaf node.

Direct (cloud WebSocket)

Connects directly to the Opcenter X cloud NATS hub over a secure WebSocket without requiring a local NATS server. Requires a .creds file for authentication.

VS Code extension   →   wss://<host>/<tenant-path>/leafnode   (cloud hub)

Set natsConnectionMode to direct, set natsWsUrl to your tenant's WebSocket base URL, and set natsCredsFile to the absolute path of your .creds file.


Requirements

  • VS Code 1.85 or later.
  • An accessible Opcenter X environment with the Integration Explorer service running.
  • For NATS topic queries: either a local NATS leaf node (leaf node mode) or a .creds file and direct WebSocket access to the NATS hub (direct mode).
  • For Kubernetes: kubectl installed and on PATH, plus a valid kubeconfig file.
  • For Copilot tools: GitHub Copilot Chat extension with agent mode / tool support.

Terminal Token Injection

The extension automatically injects a valid OAuth2 bearer token (from the active profile) into all VS Code terminal sessions via environment variables. This allows PowerShell/bash scripts to authenticate against the cloud API without ever exposing credentials to the LLM or shell history.

Environment Variables

Variable Description
OPCENTERX_TOKEN Short-lived OAuth2 bearer token (auto-refreshed every 50 minutes)
OPCENTERX_API_ENDPOINT The configured API base URL
KUBECONFIG Path to the kubeconfig file for the active profile (if configured). All kubectl commands in the terminal automatically target the correct cluster.

Usage in Scripts

# Scripts automatically pick up the token — no manual auth needed
$headers = @{ "Content-Type" = "application/json" }
if ($env:OPCENTERX_TOKEN) {
    $headers["Authorization"] = "Bearer $env:OPCENTERX_TOKEN"
}
$baseUrl = if ($env:OPCENTERX_API_ENDPOINT) { $env:OPCENTERX_API_ENDPOINT } else { "http://localhost:60522" }

The simulate-production.ps1 helper tool script already supports this — it will use the injected token when available, or fall back to unauthenticated localhost for local development.

How It Works

  1. On activation, the extension fetches an OAuth2 token using the configured credentials (stored in VS Code Secret Storage).
  2. The token is injected into terminals via EnvironmentVariableCollection — it never appears in command arguments, shell history, or terminal output.
  3. The token is auto-refreshed every 50 minutes (before the typical 60-minute expiry).
  4. When credentials change (secret updated, settings changed), the token refreshes immediately.

Security

  • The client secret is stored in VS Code's encrypted Secret Storage (OS credential manager).
  • The bearer token is injected at the process level — invisible to the LLM and shell history.
  • Tokens are short-lived (~60 min) and auto-rotated.
  • Scripts should never print $env:OPCENTERX_TOKEN to output.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft