Documentation
¶
Overview ¶
Package nodes is the resource module for tenant-node management.
Tenant nodes are per-customer provisioning environments — each customer has at least one, and SDK calls target one specific node at a time.
All endpoints in this module live on the Infinity control plane (api.vxcloud.io), not on a tenant node, because the node registry is a control-plane concern.
Index ¶
- type Client
- func (c *Client) Default(ctx context.Context) (*Node, error)
- func (c *Client) Delete(ctx context.Context, id int) error
- func (c *Client) List(ctx context.Context) ([]Node, error)
- func (c *Client) RegisterSelfHosted(ctx context.Context, in RegisterSelfHostedInput) (*Node, error)
- func (c *Client) SetDefault(ctx context.Context, id int) error
- func (c *Client) Update(ctx context.Context, id int, in UpdateInput) (*Node, error)
- type Node
- type RegisterSelfHostedInput
- type UpdateInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the nodes resource module facade. Constructed by the parent vxsdk.Client; callers obtain it from c.Nodes().
func (*Client) Default ¶
Default returns the node currently marked as the workspace default, or nil if none exists.
func (*Client) Delete ¶
Delete removes a node record. Only deletes the row — the caller is responsible for terminating any underlying VM first.
Endpoint: DELETE {InfinityURL}/api/v1/auth/nodes/{id}.
func (*Client) List ¶
List returns all tenant nodes registered to the authenticated principal.
Endpoint: GET {InfinityURL}/api/v1/auth/nodes/.
Note: vxcli's `node list` command returned 401 for some tokens during preview testing. The SDK's auto-refresh-on-401 handles that case transparently when an API key is configured on the Client.
func (*Client) RegisterSelfHosted ¶
RegisterSelfHosted registers a vxnode container the caller is running themselves (BYO hardware). No VM is provisioned on our side — the row is created with cloud_provider=self-hosted, status=active.
Endpoint: POST {InfinityURL}/api/v1/auth/nodes/self-hosted.
func (*Client) SetDefault ¶
SetDefault marks the given node ID as the user's default. Subsequent API key exchanges will resolve this node as the tenant target.
Endpoint: POST {InfinityURL}/api/v1/auth/nodes/{id}/set-default.
type Node ¶
type Node struct {
ID int `json:"id"`
UserID int `json:"user_id,omitempty"`
OrganizationID string `json:"organization_id,omitempty"`
Hostname string `json:"hostname"`
Status string `json:"status"`
IsDefaultNode bool `json:"is_default_node"`
PublicIP string `json:"public_ip,omitempty"`
PrivateIP string `json:"private_ip,omitempty"`
InstanceID string `json:"instance_id,omitempty"`
LoadBalancer string `json:"load_balancer,omitempty"`
CustomDomainName string `json:"custom_domain_name,omitempty"`
OSType string `json:"os_type,omitempty"`
BoxType string `json:"box_type,omitempty"`
StorageGB float64 `json:"storage_gb,omitempty"`
Category string `json:"category,omitempty"`
License string `json:"license,omitempty"`
SessionID string `json:"session_id,omitempty"`
StatePath string `json:"state_path,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
Node mirrors infinity's NodeResponse pydantic model.
type RegisterSelfHostedInput ¶
type RegisterSelfHostedInput struct {
Hostname string `json:"hostname"`
CustomDomainName string `json:"custom_domain_name"`
Port int `json:"port,omitempty"`
PublicIP string `json:"public_ip,omitempty"`
PrivateIP string `json:"private_ip,omitempty"`
TunnelProvider string `json:"tunnel_provider,omitempty"`
KeyPairName string `json:"key_pair_name,omitempty"`
IDEConnectionToken string `json:"ide_connection_token,omitempty"`
Agent1ConnectionToken string `json:"agent1_connection_token,omitempty"`
StorageType string `json:"storage_type,omitempty"`
StorageBackupMode string `json:"storage_backup_mode,omitempty"`
Description string `json:"description,omitempty"`
SSHUsername string `json:"ssh_username,omitempty"`
}
RegisterSelfHostedInput mirrors SelfHostedNodeRegisterRequest in app/auth/node.py:772 — the dashboard's "Self-Hosted" form payload.
type UpdateInput ¶
type UpdateInput struct {
Hostname *string `json:"hostname,omitempty"`
CustomDomainName *string `json:"custom_domain_name,omitempty"`
LoadBalancer *string `json:"load_balancer,omitempty"`
PrivateIP *string `json:"private_ip,omitempty"`
Status *string `json:"status,omitempty"`
IsDefaultNode *bool `json:"is_default_node,omitempty"`
ProviderComputeType *string `json:"provider_compute_type,omitempty"`
StorageType *string `json:"storage_type,omitempty"`
StorageBackupMode *string `json:"storage_backup_mode,omitempty"`
StorageBackupAddress *string `json:"storage_backup_address,omitempty"`
InstallationChecklist []map[string]interface{} `json:"installation_checklist,omitempty"`
EnabledFeatures []interface{} `json:"enabled_features,omitempty"`
VPNAccessDetails map[string]interface{} `json:"vpn_access_details,omitempty"`
TunnelVM map[string]interface{} `json:"tunnel_vm,omitempty"`
}
UpdateInput mirrors NodeUpdateRequest in app/auth/node.py:81. All fields are pointer/slice/map so the zero value can be distinguished from "not set" — only non-nil fields are sent in the PATCH body. Backend rejects any field not in its EDITABLE_FIELDS whitelist (public_ip is read-only).