1
0
mirror of https://github.com/rancher/types.git synced 2025-08-31 12:48:45 +00:00

Move mappers

This commit is contained in:
Darren Shepherd
2017-11-29 14:37:09 -07:00
parent bf0a2b9e43
commit e76df53327
12 changed files with 0 additions and 0 deletions

37
mapper/status.go Normal file
View File

@@ -0,0 +1,37 @@
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{
CodeName: "State",
Type: "string",
}
schema.ResourceFields["transitioning"] = types.Field{
CodeName: "Transitioning",
Type: "enum",
Options: []string{
"yes",
"no",
"error",
},
}
schema.ResourceFields["transitioningMessage"] = types.Field{
CodeName: "TransitioningMessage",
Type: "string",
}
return nil
}