debugcmd

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDeploymentID

func ParseDeploymentID(deploymentStr string) (uint32, uint64, error)

ParseDeploymentID parses a deployment identifier in the format "twin-id:contract-id" and returns the twin ID and contract ID.

Types

type Deps

type Deps struct {
	Provision Provision
	VM        VM
	Network   Network
}

type GetRequest

type GetRequest struct {
	Deployment string `json:"deployment"` // Format: "twin-id:contract-id"
}

func ParseGetRequest

func ParseGetRequest(payload []byte) (GetRequest, error)

type GetResponse

type GetResponse struct {
	Deployment gridtypes.Deployment `json:"deployment"`
}

func Get

func Get(ctx context.Context, deps Deps, req GetRequest) (GetResponse, error)

type HealthRequest

type HealthRequest struct {
	Deployment string                 `json:"deployment"`
	Options    map[string]interface{} `json:"options,omitempty"`
}

func ParseHealthRequest

func ParseHealthRequest(payload []byte) (HealthRequest, error)

type HealthResponse

type HealthResponse struct {
	TwinID     uint32           `json:"twin_id"`
	ContractID uint64           `json:"contract_id"`
	Workloads  []WorkloadHealth `json:"workloads"`
}

func Health

func Health(ctx context.Context, deps Deps, req HealthRequest) (HealthResponse, error)

type HealthStatus

type HealthStatus string
const (
	HealthHealthy   HealthStatus = "healthy"
	HealthUnhealthy HealthStatus = "unhealthy"
)

type HistoryRequest

type HistoryRequest struct {
	Deployment string `json:"deployment"` // Format: "twin-id:contract-id"
}

func ParseHistoryRequest

func ParseHistoryRequest(payload []byte) (HistoryRequest, error)

type HistoryResponse

type HistoryResponse struct {
	Deployment string                `json:"deployment"`
	History    []WorkloadTransaction `json:"history"`
}

func History

func History(ctx context.Context, deps Deps, req HistoryRequest) (HistoryResponse, error)

type InfoRequest

type InfoRequest struct {
	Deployment string `json:"deployment"` // Format: "twin-id:contract-id"
	Workload   string `json:"workload"`   // Workload name
	Verbose    bool   `json:"verbose"`    // If true, return full logs
}

func ParseInfoRequest

func ParseInfoRequest(payload []byte) (InfoRequest, error)

type InfoResponse

type InfoResponse struct {
	WorkloadID string      `json:"workload_id"`
	Type       string      `json:"type"`
	Name       string      `json:"name"`
	Info       interface{} `json:"info,omitempty"`
	Logs       string      `json:"logs,omitempty"`
}

func Info

func Info(ctx context.Context, deps Deps, req InfoRequest) (InfoResponse, error)

type ListDeployment

type ListDeployment struct {
	TwinID     uint32         `json:"twin_id"`
	ContractID uint64         `json:"contract_id"`
	Workloads  []ListWorkload `json:"workloads"`
}

type ListRequest

type ListRequest struct {
	TwinID uint32 `json:"twin_id"` // optional, if not provided lists for all twins
}

func ParseListRequest

func ParseListRequest(payload []byte) (ListRequest, error)

type ListResponse

type ListResponse struct {
	Deployments []ListDeployment `json:"deployments"`
}

func List

func List(ctx context.Context, deps Deps, req ListRequest) (ListResponse, error)

type ListWorkload

type ListWorkload struct {
	Type  string `json:"type"`
	Name  string `json:"name"`
	State string `json:"state"`
}

type Network

type Network interface {
	Namespace(ctx context.Context, id zos.NetID) string
}

Network is the subset of the network zbus interface used by debug commands.

type Provision

type Provision interface {
	ListTwins(ctx context.Context) ([]uint32, error)
	List(ctx context.Context, twin uint32) ([]gridtypes.Deployment, error)
	Get(ctx context.Context, twin uint32, contract uint64) (gridtypes.Deployment, error)
	Changes(ctx context.Context, twin uint32, contract uint64) ([]gridtypes.Workload, error)
}

Provision is the subset of the provision zbus interface used by debug commands.

type VM

type VM interface {
	Exists(ctx context.Context, id string) bool
	Inspect(ctx context.Context, id string) (pkg.VMInfo, error)
	Logs(ctx context.Context, id string) (string, error)
	LogsFull(ctx context.Context, id string) (string, error)
}

VM is the subset of the vmd zbus interface used by debug commands.

type WorkloadHealth

type WorkloadHealth struct {
	WorkloadID string               `json:"workload_id"`
	Type       string               `json:"type"`
	Name       string               `json:"name"`
	Status     HealthStatus         `json:"status"`
	Checks     []checks.HealthCheck `json:"checks"`
}

type WorkloadTransaction

type WorkloadTransaction struct {
	Seq     int                   `json:"seq"`
	Type    string                `json:"type"`
	Name    string                `json:"name"`
	Created gridtypes.Timestamp   `json:"created"`
	State   gridtypes.ResultState `json:"state"`
	Message string                `json:"message"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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