Skip to content

Commit

Permalink
🧹 update opcua subcommand help
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock committed Oct 1, 2023
1 parent 6f7c407 commit 0ab6bb0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
14 changes: 10 additions & 4 deletions providers/opcua/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,22 @@ var Config = plugin.Provider{
ConnectionTypes: []string{provider.ConnectionType},
Connectors: []plugin.Connector{
{
Name: "opcua",
Use: "opcua",
Short: "OPC UA",
Name: "opcua",
Use: "opcua [--endpoint <endpoint>]",
Short: "OPC UA",
Long: `The opcua sub-command is designed for interfacing with resources on an OPC UA (Open Platform
Communications Unified Architecture) server, a protocol facilitating machine-to-machine communications within
the realm of industrial automation.
`,

Discovery: []string{},
Flags: []plugin.Flag{
{
Long: "endpoint",
Type: plugin.FlagType_String,
Default: "",
Desc: "OPC UA service endpoint",
Desc: "OPC UA endpoint URL of the OPC UA server in the format opc.tcp://<host>:<port>",
Option: plugin.FlagOption_Required,
},
},
},
Expand Down
7 changes: 7 additions & 0 deletions providers/opcua/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import (
"go.mondoo.com/cnquery/providers/opcua/provider"
)

// This is the entry point for the OPCUA provider.
//
// To test the provider, start the simulator:
// docker run --rm -it -p 50000:50000 -p 8080:8080 --name opcplc mcr.microsoft.com/iotedge/opc-plc:latest --pn=50000 --autoaccept --sph --sn=5 --sr=10 --st=uint --fn=5 --fr=1 --ft=uint --gn=5 --ut --dca
//
// Once the simulator is running, you can query it:
// cnquery shell opcua --endpoint opc.tcp://localhost:50000
func main() {
plugin.Start(os.Args, provider.Init())
}

0 comments on commit 0ab6bb0

Please sign in to comment.