Documentation
¶
Index ¶
- type Detail
- type Image
- func (i *Image) Equal(o *Image) bool
- func (i Image) MarshalJSON() ([]byte, error)
- func (i Image) MarshalYAML() (interface{}, error)
- func (i *Image) Parse(s string) error
- func (i *Image) String() string
- func (i *Image) UnmarshalJSON(b []byte) error
- func (i *Image) UnmarshalYAML(node *yaml.Node) error
- type LogPoint
- type Mountpoint
- type OnNode
- type OnSpecLabel
- func (l OnSpecLabel) Equal(o OnSpecLabel) bool
- func (l OnSpecLabel) MarshalJSON() ([]byte, error)
- func (l OnSpecLabel) MarshalYAML() (interface{}, error)
- func (l *OnSpecLabel) Parse(s string) error
- func (l OnSpecLabel) String() string
- func (l *OnSpecLabel) UnmarshalJSON(value []byte) error
- func (l *OnSpecLabel) UnmarshalYAML(node *yaml.Node) error
- type PlanSpec
- type ResourceLimitChange
- type Resources
- type Summary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detail ¶
type Detail struct {
Summary
// Inputs are the input mountpoints of the plan.
Inputs []Mountpoint `json:"inputs"`
// Outputs are the output mountpoints of the plan.
Outputs []Mountpoint `json:"outputs"`
// Log is the log point of the plan.
//
// If nil, the plan does not record logs.
Log *LogPoint `json:"log,omitempty"`
// Active shows Plan's activeness.
//
// It is true if the plan is active and new runs can be created.
Active bool `json:"active"`
// OnNode is the node affinity/torelance of the plan.
//
// If nil, the plan does not have node affinity/torelance.
OnNode *OnNode `json:"on_node,omitempty"`
// Resources is the resource limits and requiremnts of the plan.
Resources Resources `json:"resources,omitempty"`
}
Detail is the format for the response body from Knitfab APIs below:
- GET /api/plans/ (as list)
- POST /api/plans/
- GET /api/plans/{planId}
- PUT /api/plans/{planId}/active
- PUT /api/plans/{planId}/resources
type Image ¶
func (Image) MarshalJSON ¶
func (Image) MarshalYAML ¶
func (*Image) Parse ¶
parse string as Image Tag, and upgate itself.
this spec is based on docker image tag spec^1.
func (*Image) UnmarshalJSON ¶
type Mountpoint ¶
func (Mountpoint) Equal ¶
func (m Mountpoint) Equal(o Mountpoint) bool
type OnNode ¶
type OnNode struct {
May []OnSpecLabel `json:"may,omitempty" yaml:"may,omitempty"`
Prefer []OnSpecLabel `json:"prefer,omitempty" yaml:"prefer,omitempty"`
Must []OnSpecLabel `json:"must,omitempty" yaml:"must,omitempty"`
}
type OnSpecLabel ¶
func (OnSpecLabel) Equal ¶
func (l OnSpecLabel) Equal(o OnSpecLabel) bool
func (OnSpecLabel) MarshalJSON ¶
func (l OnSpecLabel) MarshalJSON() ([]byte, error)
func (OnSpecLabel) MarshalYAML ¶
func (l OnSpecLabel) MarshalYAML() (interface{}, error)
func (*OnSpecLabel) Parse ¶
func (l *OnSpecLabel) Parse(s string) error
func (OnSpecLabel) String ¶
func (l OnSpecLabel) String() string
func (*OnSpecLabel) UnmarshalJSON ¶
func (l *OnSpecLabel) UnmarshalJSON(value []byte) error
func (*OnSpecLabel) UnmarshalYAML ¶
func (l *OnSpecLabel) UnmarshalYAML(node *yaml.Node) error
type PlanSpec ¶
type PlanSpec struct {
Image Image `json:"image" yaml:"image"`
Inputs []Mountpoint `json:"inputs" yaml:"inputs"`
Outputs []Mountpoint `json:"outputs" yaml:"outputs"`
Log *LogPoint `json:"log,omitempty" yaml:"log,omitempty"`
OnNode *OnNode `json:"on_node,omitempty" yaml:"on_node,omitempty"`
Resources Resources `json:"resources,omitempty" yaml:"resources,omitempty"`
Active *bool `json:"active" yaml:"active,omitempty"`
}
PlanSpec is the format for request body to Knitfab APIs below:
- POST /api/plans/
type ResourceLimitChange ¶
type ResourceLimitChange struct {
// Resource to be set.
Set Resources `json:"set,omitempty" yaml:"set,omitempty"`
// Resource types to be unset.
//
// If same type Set and Unset, Unset is affected.
Unset []string `json:"unset,omitempty" yaml:"unset,omitempty"`
}
ResourceLimitChange is a change of resource limit of plan.
type Resources ¶
func (Resources) MarshalJSON ¶
func (Resources) MarshalYAML ¶
func (*Resources) UnmarshalJSON ¶
type Summary ¶
type Summary struct {
// PlanId is the id of the Plan.
PlanId string `json:"planId"`
// Image is the container image of the Plan.
//
// This is exclusive with Name.
Image *Image `json:"image,omitempty"`
// Name is the name of the Plan.
//
// This is exclusive with Image, and used only for the system-builtin Plan with no image.
Name string `json:"name,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.