Documentation
¶
Overview ¶
Package sessions is the resource module for tenant deployment sessions.
Index ¶
- type ApplyInput
- type Client
- func (c *Client) Apply(ctx context.Context, input ApplyInput) (map[string]any, error)
- func (c *Client) Delete(ctx context.Context, sessionID string) error
- func (c *Client) DeleteWith(ctx context.Context, input DeleteInput) error
- func (c *Client) List(ctx context.Context) ([]Session, error)
- func (c *Client) Pull(ctx context.Context, input PullInput) (map[string]any, error)
- func (c *Client) Show(ctx context.Context, sessionID string) (map[string]any, error)
- type DeleteInput
- type PullInput
- type Session
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 ¶
Client is the resource module. Build it via vxsdk.Client.Sessions().
func (*Client) Apply ¶
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 ¶
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 ¶
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).
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.