1
0
mirror of https://github.com/rancher/types.git synced 2025-06-20 19:01:53 +00:00
types/mapper/status.go

38 lines
741 B
Go
Raw Normal View History

2017-11-15 23:59:47 +00:00
package mapper
import (
"github.com/rancher/norman/types"
"github.com/rancher/types/status"
)
type Status struct {
}
func (s Status) FromInternal(data map[string]interface{}) {
status.Set(data)
}
func (s Status) ToInternal(data map[string]interface{}) {
}
func (s Status) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
schema.ResourceFields["state"] = types.Field{
2017-11-21 23:24:00 +00:00
CodeName: "State",
Type: "string",
2017-11-15 23:59:47 +00:00
}
schema.ResourceFields["transitioning"] = types.Field{
2017-11-21 23:24:00 +00:00
CodeName: "Transitioning",
Type: "enum",
2017-11-15 23:59:47 +00:00
Options: []string{
"yes",
"no",
"error",
},
}
schema.ResourceFields["transitioningMessage"] = types.Field{
2017-11-21 23:24:00 +00:00
CodeName: "TransitioningMessage",
Type: "string",
2017-11-15 23:59:47 +00:00
}
return nil
}