{"modulePath":"github.com/threefoldtech/zos_base","version":"v1.1.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package debugcmd\n\n## Functions\n\n```go\nfunc ParseDeploymentID(deploymentStr string) (uint32, uint64, error)\n```\nParseDeploymentID parses a deployment identifier in the format \"twin-id:contract-id\" and returns the twin ID and contract ID.\n\n## Types\n\n```go\ntype Deps struct {\n\tProvision Provision\n\tVM        VM\n\tNetwork   Network\n}\n```\n\n```go\ntype GetRequest struct {\n\tDeployment string `json:\"deployment\"` // Format: \"twin-id:contract-id\"\n}\n```\n\n```go\nfunc ParseGetRequest(payload []byte) (GetRequest, error)\n```\n\n```go\ntype GetResponse struct {\n\tDeployment gridtypes.Deployment `json:\"deployment\"`\n}\n```\n\n```go\nfunc Get(ctx context.Context, deps Deps, req GetRequest) (GetResponse, error)\n```\n\n```go\ntype HealthRequest struct {\n\tDeployment string                 `json:\"deployment\"`\n\tOptions    map[string]interface{} `json:\"options,omitempty\"`\n}\n```\n\n```go\nfunc ParseHealthRequest(payload []byte) (HealthRequest, error)\n```\n\n```go\ntype HealthResponse struct {\n\tTwinID     uint32           `json:\"twin_id\"`\n\tContractID uint64           `json:\"contract_id\"`\n\tWorkloads  []WorkloadHealth `json:\"workloads\"`\n}\n```\n\n```go\nfunc Health(ctx context.Context, deps Deps, req HealthRequest) (HealthResponse, error)\n```\n\n```go\ntype HealthStatus string\n```\n\n```go\nconst (\n\tHealthHealthy   HealthStatus = \"healthy\"\n\tHealthUnhealthy HealthStatus = \"unhealthy\"\n)\n```\n\n```go\ntype HistoryRequest struct {\n\tDeployment string `json:\"deployment\"` // Format: \"twin-id:contract-id\"\n}\n```\n\n```go\nfunc ParseHistoryRequest(payload []byte) (HistoryRequest, error)\n```\n\n```go\ntype HistoryResponse struct {\n\tDeployment string                `json:\"deployment\"`\n\tHistory    []WorkloadTransaction `json:\"history\"`\n}\n```\n\n```go\nfunc History(ctx context.Context, deps Deps, req HistoryRequest) (HistoryResponse, error)\n```\n\n```go\ntype InfoRequest struct {\n\tDeployment string `json:\"deployment\"` // Format: \"twin-id:contract-id\"\n\tWorkload   string `json:\"workload\"`   // Workload name\n\tVerbose    bool   `json:\"verbose\"`    // If true, return full logs\n}\n```\n\n```go\nfunc ParseInfoRequest(payload []byte) (InfoRequest, error)\n```\n\n```go\ntype InfoResponse struct {\n\tWorkloadID string      `json:\"workload_id\"`\n\tType       string      `json:\"type\"`\n\tName       string      `json:\"name\"`\n\tInfo       interface{} `json:\"info,omitempty\"`\n\tLogs       string      `json:\"logs,omitempty\"`\n}\n```\n\n```go\nfunc Info(ctx context.Context, deps Deps, req InfoRequest) (InfoResponse, error)\n```\n\n```go\ntype ListDeployment struct {\n\tTwinID     uint32         `json:\"twin_id\"`\n\tContractID uint64         `json:\"contract_id\"`\n\tWorkloads  []ListWorkload `json:\"workloads\"`\n}\n```\n\n```go\ntype ListRequest struct {\n\tTwinID uint32 `json:\"twin_id\"` // optional, if not provided lists for all twins\n}\n```\n\n```go\nfunc ParseListRequest(payload []byte) (ListRequest, error)\n```\n\n```go\ntype ListResponse struct {\n\tDeployments []ListDeployment `json:\"deployments\"`\n}\n```\n\n```go\nfunc List(ctx context.Context, deps Deps, req ListRequest) (ListResponse, error)\n```\n\n```go\ntype ListWorkload struct {\n\tType  string `json:\"type\"`\n\tName  string `json:\"name\"`\n\tState string `json:\"state\"`\n}\n```\n\n```go\ntype Network interface {\n\tNamespace(ctx context.Context, id zos.NetID) string\n}\n```\nNetwork is the subset of the network zbus interface used by debug commands.\n\n```go\ntype Provision interface {\n\tListTwins(ctx context.Context) ([]uint32, error)\n\tList(ctx context.Context, twin uint32) ([]gridtypes.Deployment, error)\n\tGet(ctx context.Context, twin uint32, contract uint64) (gridtypes.Deployment, error)\n\tChanges(ctx context.Context, twin uint32, contract uint64) ([]gridtypes.Workload, error)\n}\n```\nProvision is the subset of the provision zbus interface used by debug commands.\n\n```go\ntype VM interface {\n\tExists(ctx context.Context, id string) bool\n\tInspect(ctx context.Context, id string) (pkg.VMInfo, error)\n\tLogs(ctx context.Context, id string) (string, error)\n\tLogsFull(ctx context.Context, id string) (string, error)\n}\n```\nVM is the subset of the vmd zbus interface used by debug commands.\n\n```go\ntype WorkloadHealth struct {\n\tWorkloadID string               `json:\"workload_id\"`\n\tType       string               `json:\"type\"`\n\tName       string               `json:\"name\"`\n\tStatus     HealthStatus         `json:\"status\"`\n\tChecks     []checks.HealthCheck `json:\"checks\"`\n}\n```\n\n```go\ntype WorkloadTransaction struct {\n\tSeq     int                   `json:\"seq\"`\n\tType    string                `json:\"type\"`\n\tName    string                `json:\"name\"`\n\tCreated gridtypes.Timestamp   `json:\"created\"`\n\tState   gridtypes.ResultState `json:\"state\"`\n\tMessage string                `json:\"message\"`\n}\n```\n\n","path":"github.com/threefoldtech/zos_base/pkg/debugcmd","name":"debugcmd","synopsis":"","isRedistributable":true}
