Skip to content

Commit

Permalink
regenerate remote access code
Browse files Browse the repository at this point in the history
  • Loading branch information
reubenmiller committed May 16, 2024
1 parent 61b1901 commit 613ee06
Show file tree
Hide file tree
Showing 31 changed files with 124 additions and 104 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
package configuration
package configurations

import (
cmdCreatePassthrough "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configuration/create_passthrough"
cmdCreateTelnet "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configuration/create_telnet"
cmdCreateVnc "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configuration/create_vnc"
cmdCreateWebssh "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configuration/create_webssh"
cmdDelete "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configuration/delete"
cmdGet "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configuration/get"
cmdList "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configuration/list"
cmdUpdate "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configuration/update"
cmdCreatePassthrough "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configurations/create_passthrough"
cmdCreateTelnet "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configurations/create_telnet"
cmdCreateVnc "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configurations/create_vnc"
cmdCreateWebssh "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configurations/create_webssh"
cmdDelete "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configurations/delete"
cmdGet "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configurations/get"
cmdList "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configurations/list"
cmdUpdate "github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configurations/update"
"github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/subcommand"
"github.com/reubenmiller/go-c8y-cli/v2/pkg/cmdutil"
"github.com/spf13/cobra"
)

type SubCmdConfiguration struct {
type SubCmdConfigurations struct {
*subcommand.SubCommand
}

func NewSubCommand(f *cmdutil.Factory) *SubCmdConfiguration {
ccmd := &SubCmdConfiguration{}
func NewSubCommand(f *cmdutil.Factory) *SubCmdConfigurations {
ccmd := &SubCmdConfigurations{}

cmd := &cobra.Command{
Use: "configuration",
Use: "configurations",
Short: "Manage Cloud Remote Access configuration",
Long: `Cloud Remote Access configuration management`,
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/cmd/remoteaccess/remoteaccess.manual.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package remoteaccess

import (
"github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configuration"
"github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/configurations"
"github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/connect"
"github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/remoteaccess/server"
"github.com/reubenmiller/go-c8y-cli/v2/pkg/cmd/subcommand"
Expand All @@ -25,7 +25,7 @@ func NewSubCommand(f *cmdutil.Factory) *SubCmdRemoteAccess {
// Subcommands
cmd.AddCommand(connect.NewSubCommand(f).GetCommand())
cmd.AddCommand(server.NewCmdServer(f).GetCommand())
cmd.AddCommand(configuration.NewSubCommand(f).GetCommand())
cmd.AddCommand(configurations.NewSubCommand(f).GetCommand())

ccmd.SubCommand = subcommand.NewSubCommand(cmd)

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
tests:
remoteaccess/configuration_create-passthrough_Create a SSH passthrough configuration to the localhost:
remoteaccess/configurations_create-passthrough_Create a SSH passthrough configuration to the localhost:
command: |
c8y remoteaccess configurations create-passthrough --device mydevice
c8y remoteaccess configurations create-passthrough --device device01
exit-code: 0
stdout:
json:
method: POST
path: /service/remoteaccess/devices/mydevice/configurations
remoteaccess/configuration_create-passthrough_Create a SSH passthrough configuration with custom details:
path: /service/remoteaccess/devices/device01/configurations
remoteaccess/configurations_create-passthrough_Create a SSH passthrough configuration with custom details:
command: |
c8y remoteaccess configurations create-passthrough --device mydevice --hostname customhost --port 1234 --name "My custom configuration"
c8y remoteaccess configurations create-passthrough --device device01 --hostname customhost --port 1234 --name "My custom configuration"
exit-code: 0
stdout:
json:
body.hostname: customhost
body.name: My custom configuration
body.port: "1234"
method: POST
path: /service/remoteaccess/devices/mydevice/configurations
path: /service/remoteaccess/devices/device01/configurations
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests:
remoteaccess/configuration_create-telnet_Create a telnet configuration:
remoteaccess/configurations_create-telnet_Create a telnet configuration:
command: |
c8y remoteaccess configurations create-telnet
exit-code: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
tests:
remoteaccess/configuration_create-vnc_Create a VNC configuration that does not require a password:
remoteaccess/configurations_create-vnc_Create a VNC configuration that does not require a password:
command: |
c8y remoteaccess configurations create-vnc
exit-code: 0
stdout:
json:
method: POST
path: /service/remoteaccess/devices/{device}/configurations
remoteaccess/configuration_create-vnc_Create a VNC configuration that requires a password:
remoteaccess/configurations_create-vnc_Create a VNC configuration that requires a password:
command: c8y remoteaccess configurations create-vnc --password 'asd08dcj23dsf{@#9}'
exit-code: 0
stdout:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
tests:
remoteaccess/configuration_create-webssh_Create a webssh configuration:
remoteaccess/configurations_create-webssh_Create a webssh configuration:
command: |
c8y remoteaccess configurations create-webssh
exit-code: 0
stdout:
json:
method: POST
path: /service/remoteaccess/devices/{device}/configurations
remoteaccess/configuration_create-webssh_Create a webssh configuration with a custom hostname and port:
remoteaccess/configurations_create-webssh_Create a webssh configuration with a custom hostname and port:
command: c8y remoteaccess configurations create-webssh --hostname 127.0.0.1 --port 2222
exit-code: 0
stdout:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tests:
remoteaccess/configuration_delete_Delete an existing remote access configuration:
command: c8y remoteaccess configurations delete --device mydevice --id 1
remoteaccess/configurations_delete_Delete an existing remote access configuration:
command: c8y remoteaccess configurations delete --device device01 --id 1
exit-code: 0
stdout:
json:
method: DELETE
path: /service/remoteaccess/devices/mydevice/configurations/1
path: /service/remoteaccess/devices/device01/configurations/1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests:
remoteaccess/configurations_get_Get existing remote access configuration:
command: c8y remoteaccess configurations get --device device01 --id 1
exit-code: 0
stdout:
json:
method: GET
path: /service/remoteaccess/devices/device01/configurations/1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests:
remoteaccess/configurations_list_List remote access configurations for a given device:
command: c8y remoteaccess configurations list --device device01
exit-code: 0
stdout:
json:
method: GET
path: /service/remoteaccess/devices/device01/configurations
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tests:
remoteaccess/configuration_update_Update an existing remote access configuration:
command: c8y remoteaccess configurations update --device mydevice --id 1
remoteaccess/configurations_update_Update an existing remote access configuration:
command: c8y remoteaccess configurations update --device device01 --id 1
exit-code: 0
stdout:
json:
method: PUT
path: /service/remoteaccess/devices/mydevice/configurations/1
path: /service/remoteaccess/devices/device01/configurations/1
10 changes: 5 additions & 5 deletions tools/PSc8y/Public/Get-RemoteAccessConfiguration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Get remote access configuration
Get an existing remote access configuration for a device
.LINK
https://reubenmiller.github.io/go-c8y-cli/docs/cli/c8y/remoteaccess_configuration_get
https://reubenmiller.github.io/go-c8y-cli/docs/cli/c8y/remoteaccess_configurations_get
.EXAMPLE
PS> Get-RemoteAccessConfiguration -Device mydevice -Id 1
PS> Get-RemoteAccessConfiguration -Device device01 -Id 1
Get existing remote access configuration
Expand Down Expand Up @@ -44,7 +44,7 @@ Get existing remote access configuration
Use-CallerPreference -Cmdlet $PSCmdlet -SessionState $ExecutionContext.SessionState
}

$c8yargs = New-ClientArgument -Parameters $PSBoundParameters -Command "remoteaccess configuration get"
$c8yargs = New-ClientArgument -Parameters $PSBoundParameters -Command "remoteaccess configurations get"
$ClientOptions = Get-ClientOutputOption $PSBoundParameters
$TypeOptions = @{
Type = ""
Expand All @@ -58,13 +58,13 @@ Get existing remote access configuration
if ($ClientOptions.ConvertToPS) {
$Id `
| Group-ClientRequests `
| c8y remoteaccess configuration get $c8yargs `
| c8y remoteaccess configurations get $c8yargs `
| ConvertFrom-ClientOutput @TypeOptions
}
else {
$Id `
| Group-ClientRequests `
| c8y remoteaccess configuration get $c8yargs
| c8y remoteaccess configurations get $c8yargs
}

}
Expand Down
12 changes: 6 additions & 6 deletions tools/PSc8y/Public/Get-RemoteAccessConfigurationCollection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Function Get-RemoteAccessConfigurationCollection {
List remote access configurations
.DESCRIPTION
List the remote access configurations already configured for the device
List the remote access configurations already configured for a device
.LINK
https://reubenmiller.github.io/go-c8y-cli/docs/cli/c8y/remoteaccess_configuration_list
https://reubenmiller.github.io/go-c8y-cli/docs/cli/c8y/remoteaccess_configurations_list
.EXAMPLE
PS> Get-RemoteAccessConfigurationCollection -Device mydevice
PS> Get-RemoteAccessConfigurationCollection -Device device01
List remote access configurations for a given device
Expand Down Expand Up @@ -40,7 +40,7 @@ List remote access configurations for a given device
Use-CallerPreference -Cmdlet $PSCmdlet -SessionState $ExecutionContext.SessionState
}

$c8yargs = New-ClientArgument -Parameters $PSBoundParameters -Command "remoteaccess configuration list"
$c8yargs = New-ClientArgument -Parameters $PSBoundParameters -Command "remoteaccess configurations list"
$ClientOptions = Get-ClientOutputOption $PSBoundParameters
$TypeOptions = @{
Type = ""
Expand All @@ -54,13 +54,13 @@ List remote access configurations for a given device
if ($ClientOptions.ConvertToPS) {
$Device `
| Group-ClientRequests `
| c8y remoteaccess configuration list $c8yargs `
| c8y remoteaccess configurations list $c8yargs `
| ConvertFrom-ClientOutput @TypeOptions
}
else {
$Device `
| Group-ClientRequests `
| c8y remoteaccess configuration list $c8yargs
| c8y remoteaccess configurations list $c8yargs
}

}
Expand Down
Loading

0 comments on commit 613ee06

Please sign in to comment.