networks

package
v0.1.0-preview Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package networks is the resource module for vxcli's network-diagnostic scripts (DNS, bandwidth, port checks, security audits).

Two execution modes:

  • Local: caller supplies (or fetches) the script and runs it on the user's host. SDK consumers do this themselves; this package only surfaces the catalog.
  • Remote: ships the script to a remote VM via the install.script flow. The SDK delegates to /api/v2/tenant/install/script under the hood, so all the same auth/SSH machinery applies.

vxcli embeds the script catalog in its binary; the SDK does NOT. Callers either supply the script bytes or fetch the catalog from the /api/v2/tenant/networks/scripts endpoint (planned in BIG_PLAN M3).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	T              *transport.Transport
	NodeURL        string
	AuthedUsername string
}

Client is the entry point. Construct via the parent SDK client:

c.Networks()

func (*Client) List

func (c *Client) List(ctx context.Context) ([]ScriptCatalogEntry, error)

List returns the catalog of available network-diagnostic scripts. Falls back to an empty list if the server doesn't yet expose the catalog endpoint (vxcli embeds it client-side today).

func (*Client) RunRemote

func (c *Client) RunRemote(ctx context.Context, opts RunRemoteOpts) (map[string]interface{}, error)

RunRemote executes a network-diagnostic script on a remote VM.

This is a thin wrapper over POST /api/v2/tenant/install/script — it's the same pipeline vxcli uses when --host is passed to `vxcli networks <script>`.

type RunRemoteOpts

type RunRemoteOpts struct {
	SSH SSH

	// Script bytes (e.g. an embedded catalog entry from the caller).
	Script []byte
	// ScriptName as it appears on the remote host.
	ScriptName string
	// Args appended to the script invocation (NUL-separated server-side).
	Args []string
}

RunRemoteOpts ships an arbitrary network-diagnostic script to a remote VM via the install.script flow.

type SSH

type SSH struct {
	Host          string
	User          string
	KeyPairName   string
	WorkspaceUser string
	Organization  string
}

SSH is the common SSH target shared with install/services/deploy.

type ScriptCatalogEntry

type ScriptCatalogEntry struct {
	Name        string   `json:"name"`
	FileName    string   `json:"file_name"`
	Description string   `json:"description"`
	Aliases     []string `json:"aliases,omitempty"`
}

ScriptCatalogEntry is one row in the embedded networks-script catalog. Returned by List once the server endpoint lands; today this is empty unless the operator has populated /api/v2/tenant/networks/scripts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL