sessions

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 sessions is the resource module for tenant deployment sessions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyInput

type ApplyInput struct {
	// SessionID is the session to re-apply. Required.
	SessionID string
}

ApplyInput describes a sessions.apply request.

type Client

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

Client is the resource module. Build it via vxsdk.Client.Sessions().

func (*Client) Apply

func (c *Client) Apply(ctx context.Context, input ApplyInput) (map[string]any, error)

Apply re-runs a previously planned deploy from a saved session (typically: promote a --dry-run to apply).

Maps to POST {NodeURL}/api/v2/tenant/sessions/apply.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, sessionID string) error

Delete tears down a previously-provisioned resource by session id.

Maps to POST {NodeURL}/api/v2/tenant/sessions/delete. The convenience form takes just the session id; for force-delete construct a DeleteInput and call DeleteWith.

func (*Client) DeleteWith

func (c *Client) DeleteWith(ctx context.Context, input DeleteInput) error

DeleteWith is Delete with a full input struct (lets the caller request force=true).

func (*Client) List

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

List returns recent deployment sessions for the authenticated tenant.

Maps to GET {NodeURL}/api/v3/sessions/list (the same endpoint vxcli's "sessions list" command exercises today).

func (*Client) Pull

func (c *Client) Pull(ctx context.Context, input PullInput) (map[string]any, error)

Pull fetches terraform state and generated artifacts for a session as a JSON payload.

Maps to POST {NodeURL}/api/v2/tenant/sessions/pull.

func (*Client) Show

func (c *Client) Show(ctx context.Context, sessionID string) (map[string]any, error)

Show returns the full detail / staged files / entrypoint output for a single session.

Maps to GET {NodeURL}/api/v2/tenant/sessions/{sessionID}.

type DeleteInput

type DeleteInput struct {
	// SessionID is the session to tear down. Required.
	SessionID string
	// Force, if true, bypasses interactive confirmation server-side.
	Force bool
}

DeleteInput describes a sessions.delete request.

type PullInput

type PullInput struct {
	// SessionID is the session whose terraform state + generated artifacts
	// should be fetched. Required.
	SessionID string
}

PullInput describes a sessions.pull request.

type Session

type Session struct {
	ID         string    `json:"session_id"`
	Status     string    `json:"status"`
	Hostname   string    `json:"hostname,omitempty"`
	Username   string    `json:"username,omitempty"`
	Script     string    `json:"script,omitempty"`
	ResourceID string    `json:"resource_id,omitempty"`
	StartedAt  time.Time `json:"started_at,omitempty"`
	EndedAt    time.Time `json:"ended_at,omitempty"`
}

Session is a deployment / install session record.

Field names mirror the wire format (snake_case) so the SDK is a faithful view of what FastAPI returns. Callers in Go-land receive the exported CamelCase identifiers normally.

Jump to

Keyboard shortcuts

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