Documentation
¶
Index ¶
- func ParseDeploymentID(deploymentStr string) (uint32, uint64, error)
- type Deps
- type GetRequest
- type GetResponse
- type HealthRequest
- type HealthResponse
- type HealthStatus
- type HistoryRequest
- type HistoryResponse
- type InfoRequest
- type InfoResponse
- type ListDeployment
- type ListRequest
- type ListResponse
- type ListWorkload
- type Network
- type Provision
- type VM
- type WorkloadHealth
- type WorkloadTransaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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 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 ¶
Click to show internal directories.
Click to hide internal directories.