diff --git a/.drone.yml b/.drone.yml index b0f0e2ebd..4898e8fc6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,4 +1,9 @@ -image: rancher/dind:v1.10.0-rancher1 -script: - - wrapdocker - - make ci +--- +pipeline: + build: + privileged: true + image: rancher/dapper:1.10.3 + volumes: + - /var/run/docker.sock:/var/run/docker.sock + commands: + - dapper ci diff --git a/cmd/common.go b/cmd/common.go index 822059f8b..2c4ed57b2 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -4,6 +4,7 @@ import ( "bytes" "errors" "fmt" + "github.com/rancher/go-rancher/v2" "io" "os" "os/exec" @@ -12,7 +13,6 @@ import ( "text/template" "github.com/docker/docker/pkg/namesgenerator" - "github.com/rancher/go-rancher/client" "github.com/urfave/cli" ) @@ -129,12 +129,12 @@ func LookupEnvironment(c *client.RancherClient, name string) (*client.Project, e return c.Project.ById(env.Id) } -func GetOrCreateDefaultStack(c *client.RancherClient, name string) (*client.Environment, error) { +func GetOrCreateDefaultStack(c *client.RancherClient, name string) (*client.Stack, error) { if name == "" { name = "Default" } - resp, err := c.Environment.List(&client.ListOpts{ + resp, err := c.Stack.List(&client.ListOpts{ Filters: map[string]interface{}{ "name": name, "removed_null": 1, @@ -148,7 +148,7 @@ func GetOrCreateDefaultStack(c *client.RancherClient, name string) (*client.Envi return &resp.Data[0], nil } - return c.Environment.Create(&client.Environment{ + return c.Stack.Create(&client.Stack{ Name: name, }) } @@ -175,12 +175,12 @@ func RandomName() string { func getServiceByName(c *client.RancherClient, name string) (client.ResourceCollection, error) { var result client.ResourceCollection - env, serviceName, err := ParseName(c, name) + stack, serviceName, err := ParseName(c, name) services, err := c.Service.List(&client.ListOpts{ Filters: map[string]interface{}{ - "environmentId": env.Id, - "name": serviceName, + "stackId": stack.Id, + "name": serviceName, }, }) if err != nil { diff --git a/cmd/config.go b/cmd/config.go index 8e841d8f1..11bef924f 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -10,8 +10,9 @@ import ( "path" "strings" + "github.com/rancher/go-rancher/v2" + "github.com/Sirupsen/logrus" - "github.com/rancher/go-rancher/client" "github.com/urfave/cli" ) @@ -24,7 +25,7 @@ type Config struct { } func baseURL(fullURL string) (string, error) { - idx := strings.LastIndex(fullURL, "/v1") + idx := strings.LastIndex(fullURL, "/v2-beta") if idx == -1 { u, err := url.Parse(fullURL) if err != nil { @@ -61,7 +62,7 @@ func (c Config) EnvironmentURL() (string, error) { if err != nil { return "", err } - url = url + "/v1/projects/" + projectID + "/schemas" + url = url + "/v2-beta/projects/" + projectID + "/schemas" return url, nil } diff --git a/cmd/docker.go b/cmd/docker.go index efd967734..efe61c82b 100644 --- a/cmd/docker.go +++ b/cmd/docker.go @@ -11,7 +11,7 @@ import ( "strings" "github.com/Sirupsen/logrus" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/rancher/rancher-docker-api-proxy" "github.com/urfave/cli" ) diff --git a/cmd/env.go b/cmd/env.go index 06201f943..f88f46bff 100644 --- a/cmd/env.go +++ b/cmd/env.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) diff --git a/cmd/events.go b/cmd/events.go index fd2b8efd1..3746da729 100644 --- a/cmd/events.go +++ b/cmd/events.go @@ -6,6 +6,7 @@ import ( "github.com/Sirupsen/logrus" "github.com/rancher/cli/monitor" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) @@ -17,10 +18,10 @@ func EventsCommand() cli.Command { ArgsUsage: "None", Action: events, Flags: []cli.Flag{ - //cli.StringFlag{ - // Name: "format", - // Usage: "'json' or Custom format: {{.Id}} {{.Name}}", - //}, + cli.StringFlag{ + Name: "format", + Usage: "'json' or Custom format: {{.Id}} {{.Name}}", + }, cli.BoolFlag{ Name: "reconnect,r", Usage: "Reconnect on error", @@ -29,40 +30,63 @@ func EventsCommand() cli.Command { } } -func events(ctx *cli.Context) error { - c, err := GetClient(ctx) - if err != nil { - return err +func getClientForSubscribe(ctx *cli.Context) (*client.RancherClient, error) { + if ctx.Bool("all") { + return GetRawClient(ctx) } + return GetClient(ctx) +} - m := monitor.New(c) - sub := m.Subscribe() - go func() { - if ctx.Bool("reconnect") { - for { - if err := m.Start(); err != nil { - logrus.Error(err) - } +func events(ctx *cli.Context) error { + reconnect := ctx.Bool("reconnect") + + for { + c, err := getClientForSubscribe(ctx) + if err != nil { + if reconnect { + logrus.Error(err) time.Sleep(time.Second) + continue + } else { + return err } - } else { - logrus.Fatal(m.Start()) } - }() - for event := range sub.C { - resource, _ := event.Data["resource"].(map[string]interface{}) - state, _ := resource["state"].(string) - name, _ := resource["name"].(string) + m := monitor.New(c) + sub := m.Subscribe() + go func() { + if ctx.Bool("reconnect") { + for { + if err := m.Start(); err != nil { + logrus.Error(err) + } + time.Sleep(time.Second) + } + } else { + logrus.Fatal(m.Start()) + } + }() + + format := ctx.String("format") + for event := range sub.C { + if format == "" { + resource, _ := event.Data["resource"].(map[string]interface{}) + name, _ := resource["name"].(string) + state, _ := resource["state"].(string) + + if name == "ping" { + continue + } - if len(state) > 0 { - message := resource["transitioningMessage"] - if message == nil { - message = "" + message, _ := resource["transitioningMessage"].(string) + fmt.Printf("%s %s %s [%s] %v\n", event.ResourceType, event.ResourceID, state, name, message) + } else { + writer := NewTableWriter(nil, ctx) + writer.Write(event) + if err := writer.Err(); err != nil { + logrus.Error(err) + } } - fmt.Printf("%s %s %s [%s] %v\n", event.ResourceType, event.ResourceID, state, name, message) } } - - return nil } diff --git a/cmd/exec.go b/cmd/exec.go index f86472979..b82ae13ca 100644 --- a/cmd/exec.go +++ b/cmd/exec.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) diff --git a/cmd/export.go b/cmd/export.go index 4fc821e27..dc06d794f 100644 --- a/cmd/export.go +++ b/cmd/export.go @@ -48,12 +48,12 @@ func exportService(ctx *cli.Context) error { return err } - env, err := c.Environment.ById(resource.Id) + env, err := c.Stack.ById(resource.Id) if err != nil { return err } - config, err := c.Environment.ActionExportconfig(env, nil) + config, err := c.Stack.ActionExportconfig(env, nil) if err != nil { return err } diff --git a/cmd/format.go b/cmd/format.go index 9aa5bbadf..3853b3754 100644 --- a/cmd/format.go +++ b/cmd/format.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" ) func FormatEndpoint(data interface{}) string { diff --git a/cmd/host.go b/cmd/host.go index 17491b512..2c791f803 100644 --- a/cmd/host.go +++ b/cmd/host.go @@ -1,7 +1,7 @@ package cmd import ( - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) diff --git a/cmd/host_create.go b/cmd/host_create.go index 3fb27c9a4..2915fb42f 100644 --- a/cmd/host_create.go +++ b/cmd/host_create.go @@ -9,7 +9,7 @@ import ( "strings" "github.com/Sirupsen/logrus" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) diff --git a/cmd/inspect.go b/cmd/inspect.go index 3daa00191..777af74c9 100644 --- a/cmd/inspect.go +++ b/cmd/inspect.go @@ -3,12 +3,12 @@ package cmd import ( "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) var ( - inspectTypes = []string{"service", "container", "host", "project", "environment"} + inspectTypes = []string{"service", "container", "host", "project", "stack"} ) func InspectCommand() cli.Command { @@ -44,14 +44,14 @@ func inspectResources(ctx *cli.Context) error { mapResource := map[string]interface{}{} err := c.ById(resource.Type, resource.Id, &mapResource) if err != nil { - return "", err + return "-", err } if !ctx.Bool("links") { delete(mapResource, "links") delete(mapResource, "actions") } writer.Write(mapResource) - return "", nil + return "-", nil }) return writer.Err() } diff --git a/cmd/logs.go b/cmd/logs.go index 9ee4e8550..9645cdcc6 100644 --- a/cmd/logs.go +++ b/cmd/logs.go @@ -5,7 +5,9 @@ import ( "io" "io/ioutil" "os" + "strings" "sync" + "time" "golang.org/x/net/context" @@ -14,7 +16,9 @@ import ( dclient "github.com/docker/engine-api/client" "github.com/docker/engine-api/types" "github.com/docker/libcompose/cli/logger" - "github.com/rancher/go-rancher/client" + "github.com/mitchellh/mapstructure" + "github.com/rancher/cli/monitor" + "github.com/rancher/go-rancher/v2" "github.com/rancher/rancher-docker-api-proxy" "github.com/urfave/cli" ) @@ -26,9 +30,17 @@ func LogsCommand() cli.Command { Name: "logs", Usage: "Fetch the logs of a container", Description: "\nExample:\n\t$ rancher logs web\n", - ArgsUsage: "[CONTAINERNAME CONTAINERID...]", + ArgsUsage: "[CONTAINERNAME CONTAINERID...] or [SERVICENAME SERVICEID...]", Action: logsCommand, Flags: []cli.Flag{ + cli.BoolFlag{ + Name: "service,s", + Usage: "Show service logs", + }, + cli.BoolTFlag{ + Name: "sub-log", + Usage: "Show service sub logs", + }, cli.BoolFlag{ Name: "follow,f", Usage: "Follow log output", @@ -42,10 +54,6 @@ func LogsCommand() cli.Command { Name: "since", Usage: "Show logs since timestamp", }, - //cli.BoolFlag{ - // Name: "details", - // Usage: "Show extra details provided to logs", - //}, cli.BoolFlag{ Name: "timestamps,t", Usage: "Show timestamps", @@ -54,6 +62,119 @@ func LogsCommand() cli.Command { } } +func printPastLogs(c *client.RancherClient, nameCache map[string]string, services map[string]bool, ctx *cli.Context) (map[string]bool, error) { + printed := map[string]bool{} + + listOpts := defaultListOpts(nil) + listOpts.Filters["sort"] = "id" + listOpts.Filters["order"] = "desc" + if !ctx.Bool("sub-log") { + listOpts.Filters["subLog"] = "0" + } + + limit := ctx.Int("tail") + if limit == 0 { + return printed, nil + } + + if limit > 0 { + listOpts.Filters["limit"] = limit + } + + logs, err := c.ServiceLog.List(listOpts) + if err != nil { + return nil, err + } + + for i := len(logs.Data); i > 0; i-- { + l := logs.Data[i-1] + printed[l.Id] = true + printServiceLog(c, nameCache, services, l) + } + + return printed, nil +} + +func printServiceLog(c *client.RancherClient, nameCache map[string]string, services map[string]bool, log client.ServiceLog) { + if len(services) > 0 && !services[log.ServiceId] { + return + } + + created, _ := time.Parse(time.RFC3339, log.Created) + endTime, _ := time.Parse(time.RFC3339, log.EndTime) + duration := endTime.Sub(created) + durationStr := duration.String() + if durationStr == "0" || strings.HasPrefix(durationStr, "-") { + durationStr = "-" + } + if log.EndTime == "" { + durationStr = "?" + } + if log.InstanceId == "" { + log.InstanceId = "-" + } + + if nameCache[log.ServiceId] == "" { + service, err := c.Service.ById(log.ServiceId) + if nameCache[service.StackId] == "" { + stack, err := c.Stack.ById(service.StackId) + if err == nil { + nameCache[service.StackId] = stack.Name + } + } + if err == nil { + nameCache[log.ServiceId] = service.Name + } + nameCache[log.ServiceId] = fmt.Sprintf("%s/%s(%s)", nameCache[service.StackId], nameCache[log.ServiceId], log.ServiceId) + } + + fmt.Printf("%s %4s %s %s %s %6s %s: %s\n", log.Created, durationStr, strings.SplitN(log.TransactionId, "-", 2)[0], + strings.ToUpper(log.Level), nameCache[log.ServiceId], log.InstanceId, log.EventType, log.Description) +} + +func serviceLogs(c *client.RancherClient, ctx *cli.Context) error { + nameCache := map[string]string{} + var sub *monitor.Subscription + follow := ctx.Bool("follow") + + if follow { + m := monitor.New(c) + sub = m.Subscribe() + go func() { + logrus.Fatal(m.Start()) + }() + } + + services, err := resolveServices(c, ctx.Args()) + if err != nil { + return err + } + + printed, err := printPastLogs(c, nameCache, services, ctx) + if err != nil { + return err + } + + if follow { + for event := range sub.C { + if event.ResourceType != "serviceLog" { + continue + } + if printed[event.ResourceID] { + continue + } + var log client.ServiceLog + err := mapstructure.Decode(event.Data["resource"], &log) + if err != nil { + logrus.Errorf("Failed to convert %#v: %v", event.Data["resource"], err) + } + printServiceLog(c, nameCache, services, log) + } + } + + return nil +} + func logsCommand(ctx *cli.Context) error { wg := sync.WaitGroup{} @@ -62,6 +183,10 @@ func logsCommand(ctx *cli.Context) error { return err } + if ctx.Bool("service") { + return serviceLogs(c, ctx) + } + if len(ctx.Args()) == 0 { return fmt.Errorf("Please pass a container name") } @@ -167,7 +292,7 @@ func doLog(single bool, ctx *cli.Context, instance client.Instance, dockerClient } else if single { _, err = stdcopy.StdCopy(os.Stdout, os.Stderr, responseBody) } else { - l := loggerFactory.Create(instance.Name) + l := loggerFactory.CreateContainerLogger(instance.Name) _, err = stdcopy.StdCopy(writerFunc(l.Out), writerFunc(l.Err), responseBody) } return err @@ -180,11 +305,23 @@ func (f writerFunc) Write(p []byte) (n int, err error) { return len(p), nil } +func resolveServices(c *client.RancherClient, names []string) (map[string]bool, error) { + services := map[string]bool{} + for _, name := range names { + resource, err := Lookup(c, name, "service") + if err != nil { + return nil, err + } + services[resource.Id] = true + } + return services, nil +} + func resolveContainers(c *client.RancherClient, names []string) ([]client.Instance, error) { result := []client.Instance{} for _, name := range names { - resource, err := Lookup(c, name, "container", "service", "environment") + resource, err := Lookup(c, name, "container", "service", "stack") if err != nil { return nil, err } diff --git a/cmd/ps.go b/cmd/ps.go index 01024fd4b..5900e4d7e 100644 --- a/cmd/ps.go +++ b/cmd/ps.go @@ -1,10 +1,12 @@ package cmd import ( + "fmt" "strings" + "github.com/mitchellh/mapstructure" "github.com/pkg/errors" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) @@ -33,9 +35,9 @@ func PsCommand() cli.Command { } } -func GetStackMap(c *client.RancherClient) map[string]client.Environment { - result := map[string]client.Environment{} - stacks, err := c.Environment.List(defaultListOpts(nil)) +func GetStackMap(c *client.RancherClient) map[string]client.Stack { + result := map[string]client.Stack{} + stacks, err := c.Stack.List(defaultListOpts(nil)) if err != nil { return result } @@ -49,7 +51,9 @@ func GetStackMap(c *client.RancherClient) map[string]client.Environment { type PsData struct { Service client.Service - Stack client.Environment + Name string + LaunchConfig client.LaunchConfig + Stack client.Stack CombinedState string ID string } @@ -85,8 +89,8 @@ func servicePs(ctx *cli.Context) error { writer := NewTableWriter([][]string{ {"ID", "Service.Id"}, {"TYPE", "Service.Type"}, - {"NAME", "{{.Stack.Name}}/{{.Service.Name}}"}, - {"IMAGE", "Service.LaunchConfig.ImageUuid"}, + {"NAME", "Name"}, + {"IMAGE", "LaunchConfig.ImageUuid"}, {"STATE", "CombinedState"}, {"SCALE", "Service.Scale"}, {"ENDPOINTS", "{{endpoint .Service.PublicEndpoints}}"}, @@ -110,9 +114,32 @@ func servicePs(ctx *cli.Context) error { writer.Write(PsData{ ID: item.Id, Service: item, - Stack: stackMap[item.EnvironmentId], + Name: fmt.Sprintf("%s/%s", stackMap[item.StackId].Name, item.Name), + LaunchConfig: *item.LaunchConfig, + Stack: stackMap[item.StackId], CombinedState: combined, }) + for _, sidekick := range item.SecondaryLaunchConfigs { + var sidekickLaunchConfig client.LaunchConfig + var sidekickSecondaryLaunchConfig client.SecondaryLaunchConfig + if err := mapstructure.Decode(sidekick, &sidekickLaunchConfig); err != nil { + return err + } + if err := mapstructure.Decode(sidekick, &sidekickSecondaryLaunchConfig); err != nil { + return err + } + sidekickLaunchConfig.ImageUuid = strings.TrimPrefix(sidekickLaunchConfig.ImageUuid, "docker:") + item.Type = "sidekick" + writer.Write(PsData{ + ID: item.Id, + Service: item, + Name: fmt.Sprintf("%s/%s/%s", stackMap[item.StackId].Name, item.Name, + sidekickSecondaryLaunchConfig.Name), + LaunchConfig: sidekickLaunchConfig, + Stack: stackMap[item.StackId], + CombinedState: combined, + }) + } } return writer.Err() diff --git a/cmd/restart.go b/cmd/restart.go index cd1741b54..0f5f776c5 100644 --- a/cmd/restart.go +++ b/cmd/restart.go @@ -3,7 +3,7 @@ package cmd import ( "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) diff --git a/cmd/rm.go b/cmd/rm.go index 91177370c..769eb73bc 100644 --- a/cmd/rm.go +++ b/cmd/rm.go @@ -3,12 +3,12 @@ package cmd import ( "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) var ( - rmTypes = []string{"service", "container", "host", "machine"} + rmTypes = []string{"service", "container", "stack", "host", "machine"} ) func RmCommand() cli.Command { diff --git a/cmd/run.go b/cmd/run.go index 7ff8cedd5..0086bf70c 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -1,9 +1,9 @@ package cmd import ( + "github.com/rancher/go-rancher/v2" "strings" - "github.com/rancher/go-rancher/client" "github.com/urfave/cli" ) @@ -174,7 +174,7 @@ func RunCommand() cli.Command { } } -func ParseName(c *client.RancherClient, name string) (*client.Environment, string, error) { +func ParseName(c *client.RancherClient, name string) (*client.Stack, string, error) { stackName := "" serviceName := name @@ -267,7 +267,7 @@ func serviceRun(ctx *cli.Context) error { service := &client.Service{ Name: name, - EnvironmentId: stack.Id, + StackId: stack.Id, LaunchConfig: launchConfig, StartOnCreate: true, } diff --git a/cmd/scale.go b/cmd/scale.go index da4dce0fb..4e6d0fcf0 100644 --- a/cmd/scale.go +++ b/cmd/scale.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) diff --git a/cmd/ssh.go b/cmd/ssh.go index 82736ef76..0653cde21 100644 --- a/cmd/ssh.go +++ b/cmd/ssh.go @@ -12,7 +12,7 @@ import ( "path" "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) diff --git a/cmd/stack.go b/cmd/stack.go index c666e1674..037467a37 100644 --- a/cmd/stack.go +++ b/cmd/stack.go @@ -3,7 +3,7 @@ package cmd import ( "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) @@ -38,7 +38,7 @@ func StackCommand() cli.Command { type StackData struct { ID string Catalog string - Stack client.Environment + Stack client.Stack State string System bool } @@ -49,7 +49,7 @@ func stackLs(ctx *cli.Context) error { return err } - collection, err := c.Environment.List(nil) + collection, err := c.Stack.List(defaultListOpts(nil)) if err != nil { return err } diff --git a/cmd/start.go b/cmd/start.go index b0bf71801..0bceb2754 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -3,7 +3,7 @@ package cmd import ( "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) diff --git a/cmd/stop.go b/cmd/stop.go index cf39aca0a..65a2dc804 100644 --- a/cmd/stop.go +++ b/cmd/stop.go @@ -3,7 +3,7 @@ package cmd import ( "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) diff --git a/cmd/util_actions.go b/cmd/util_actions.go index 5f4debe55..95b75efc1 100644 --- a/cmd/util_actions.go +++ b/cmd/util_actions.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" ) func pickAction(resource *client.Resource, actions ...string) (string, error) { @@ -19,6 +19,5 @@ func pickAction(resource *client.Resource, actions ...string) (string, error) { } func replaceTypeNames(msg string) string { - msg = strings.Replace(msg, "environment", "stack", -1) return strings.Replace(msg, "project", "enviroment", -1) } diff --git a/cmd/util_foreach.go b/cmd/util_foreach.go index ad38b66df..7595a1f21 100644 --- a/cmd/util_foreach.go +++ b/cmd/util_foreach.go @@ -3,7 +3,7 @@ package cmd import ( "fmt" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) @@ -35,7 +35,7 @@ func forEachResourceWithClient(c *client.RancherClient, ctx *cli.Context, types resourceID = resource.Id } lastErr = printErr(resource.Id, lastErr, err) - if resourceID != "" { + if resourceID != "" && resourceID != "-" { w.Add(resourceID) } } diff --git a/cmd/util_ls.go b/cmd/util_ls.go index ead05bbec..84c5e21c1 100644 --- a/cmd/util_ls.go +++ b/cmd/util_ls.go @@ -1,7 +1,7 @@ package cmd import ( - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) @@ -16,6 +16,7 @@ func defaultListOpts(ctx *cli.Context) *client.ListOpts { listOpts := &client.ListOpts{ Filters: map[string]interface{}{ "limit": -2, + "all": true, }, } if ctx != nil && !ctx.Bool("all") { @@ -25,6 +26,7 @@ func defaultListOpts(ctx *cli.Context) *client.ListOpts { "stopped", "removing", } + delete(listOpts.Filters, "all") } return listOpts } diff --git a/cmd/volume.go b/cmd/volume.go index 35e3ce55a..e5431f2f7 100644 --- a/cmd/volume.go +++ b/cmd/volume.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/Sirupsen/logrus" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) diff --git a/cmd/wait.go b/cmd/wait.go index 217cd50de..6adea8d03 100644 --- a/cmd/wait.go +++ b/cmd/wait.go @@ -7,12 +7,12 @@ import ( "github.com/Sirupsen/logrus" "github.com/rancher/cli/monitor" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/urfave/cli" ) var ( - waitTypes = []string{"service", "container", "host", "environment", "machine"} + waitTypes = []string{"service", "container", "host", "stack", "machine"} ) func WaitCommand() cli.Command { diff --git a/monitor/monitor.go b/monitor/monitor.go index f123ccfc4..efc4128de 100644 --- a/monitor/monitor.go +++ b/monitor/monitor.go @@ -10,7 +10,7 @@ import ( "github.com/Sirupsen/logrus" "github.com/gorilla/websocket" "github.com/patrickmn/go-cache" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" ) type Event struct { diff --git a/trash.conf b/trash.conf index a3ce7e0b9..67f690145 100644 --- a/trash.conf +++ b/trash.conf @@ -1,25 +1,25 @@ github.com/awslabs/aws-sdk-go 75d65bc91a02d9f67cf4a5297c46d4d2c4c09c6c github.com/Azure/go-ansiterm 388960b655244e76e24c75f48631564eaefade62 -github.com/cloudfoundry-incubator/candiedyaml 5cef21e2e4f0fd147973b558d4db7395176bcd95 github.com/docker/distribution 5bbf65499960b184fe8e0f045397375e1a6722b8 github.com/docker/docker 534753663161334baba06f13b8efa4cad22b5bc5 github.com/docker/engine-api 62043eb79d581a32ea849645277023c550732e52 github.com/docker/go-connections 990a1a1a70b0da4c4cb70e117971a4f0babfbf1a github.com/docker/go-units f2d77a61e3c169b43402a0a1e84f06daf29b8190 -github.com/docker/libcompose 8afd773e5531623d91f62c332dd5b72bcf310e6a https://github.com/joshwget/libcompose/ +github.com/docker/libcompose 444fe501e251841740281be421449f1551cde8dd https://github.com/rancher/libcompose github.com/flynn/go-shlex 3f9db97f856818214da2e1057f8ad84803971cff github.com/gorilla/context 14f550f51a github.com/gorilla/mux e444e69cbd github.com/gorilla/websocket 1551221275a7bd42978745a376b2531f791d88f3 github.com/hashicorp/go-version 2b9865f60ce11e527bd1255ba82036d465570aa3 github.com/Microsoft/go-winio v0.3.0 +github.com/mitchellh/mapstructure ca63d7c062ee3c9f34db231e352b60012b4fd0c1 github.com/opencontainers/runc cc29e3dded8e27ba8f65738f40d251c885030a28 github.com/patrickmn/go-cache 1881a9bccb818787f68c52bfba648c6cf34c34fa github.com/pkg/errors 1d2e60385a13aaa66134984235061c2f9302520e -github.com/rancher/go-rancher 96dc0b0438660397a2119fb2fd8ead1d6d56608f +github.com/rancher/go-rancher 4a0d294ee53a66a8d33614d20793d799fe12faf0 github.com/rancher/rancher-catalog-service a3a8b500adceb82b3a0387b2c7b06a60e7eeee9a -github.com/rancher/rancher-compose ea72f323fb6b7f2b457b919b10e530fc823f9679 -github.com/rancher/rancher-docker-api-proxy 152712a566dbdb8b809ee42b20d9d18f15d7ece0 +github.com/rancher/rancher-compose 2093d693d5f4eb866d74ffff0fe404d04d3e8caa +github.com/rancher/rancher-docker-api-proxy 461b5e7022698283030495cf5693680699ce9c28 github.com/Sirupsen/logrus 26709e2714106fb8ad40b773b711ebce25b78914 github.com/spf13/pflag cb88ea77998c3f024757528e3305022ab50b43be github.com/urfave/cli v1.18.0 @@ -31,4 +31,4 @@ github.com/xeipuuv/gojsonreference e02fc20de94c78484cd5ffb007f8af96be030a45 github.com/xeipuuv/gojsonschema ac452913faa25c08bb78810d3e6f88b8a39f8f25 golang.org/x/crypto 4d48e5fa3d62b5e6e71260571bf76c767198ca02 golang.org/x/net 3a29182c25eeabbaaf94daaeecbc7823d86261e7 -gopkg.in/yaml.v2 49c95bdc21843256fb6c4e0d370a05f24a0bf213 +gopkg.in/yaml.v2 e4d366fc3c7938e2958e662b4258c7a89e1f0e3e diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/.gitignore b/vendor/github.com/cloudfoundry-incubator/candiedyaml/.gitignore deleted file mode 100644 index 782377890..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.coverprofile diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/.travis.yml b/vendor/github.com/cloudfoundry-incubator/candiedyaml/.travis.yml deleted file mode 100644 index b39955e53..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go - -go: - - 1.4.1 - -install: - - go get -t -v ./... - - go install github.com/onsi/ginkgo/ginkgo - -script: - - export PATH=$HOME/gopath/bin:$PATH - - ginkgo -r -failOnPending -randomizeAllSpecs -race diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/LICENSE b/vendor/github.com/cloudfoundry-incubator/candiedyaml/LICENSE deleted file mode 100644 index d9a10c0d8..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/LICENSE +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/README.md b/vendor/github.com/cloudfoundry-incubator/candiedyaml/README.md deleted file mode 100644 index 266c28c79..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/README.md +++ /dev/null @@ -1,57 +0,0 @@ -[![Build Status](https://travis-ci.org/cloudfoundry-incubator/candiedyaml.svg)](https://travis-ci.org/cloudfoundry-incubator/candiedyaml) - -candiedyaml -=========== - -YAML for Go - -A YAML 1.1 parser with support for YAML 1.2 features - -Usage ------ - -```go -package myApp - -import ( - "github.com/cloudfoundry-incubator/candiedyaml" - "fmt" - "os" -) - -func main() { - file, err := os.Open("path/to/some/file.yml") - if err != nil { - println("File does not exist:", err.Error()) - os.Exit(1) - } - defer file.Close() - - document := new(interface{}) - decoder := candiedyaml.NewDecoder(file) - err = decoder.Decode(document) - - if err != nil { - println("Failed to decode document:", err.Error()) - } - - println("parsed yml into interface:", fmt.Sprintf("%#v", document)) - - fileToWrite, err := os.Create("path/to/some/new/file.yml") - if err != nil { - println("Failed to open file for writing:", err.Error()) - os.Exit(1) - } - defer fileToWrite.Close() - - encoder := candiedyaml.NewEncoder(fileToWrite) - err = encoder.Encode(document) - - if err != nil { - println("Failed to encode document:", err.Error()) - os.Exit(1) - } - - return -} -``` diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/api.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/api.go deleted file mode 100644 index 87c1043ea..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/api.go +++ /dev/null @@ -1,834 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -import ( - "io" -) - -/* - * Create a new parser object. - */ - -func yaml_parser_initialize(parser *yaml_parser_t) bool { - *parser = yaml_parser_t{ - raw_buffer: make([]byte, 0, INPUT_RAW_BUFFER_SIZE), - buffer: make([]byte, 0, INPUT_BUFFER_SIZE), - } - - return true -} - -/* - * Destroy a parser object. - */ -func yaml_parser_delete(parser *yaml_parser_t) { - *parser = yaml_parser_t{} -} - -/* - * String read handler. - */ - -func yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (int, error) { - if parser.input_pos == len(parser.input) { - return 0, io.EOF - } - - n := copy(buffer, parser.input[parser.input_pos:]) - parser.input_pos += n - return n, nil -} - -/* - * File read handler. - */ - -func yaml_file_read_handler(parser *yaml_parser_t, buffer []byte) (int, error) { - return parser.input_reader.Read(buffer) -} - -/* - * Set a string input. - */ - -func yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) { - if parser.read_handler != nil { - panic("input already set") - } - - parser.read_handler = yaml_string_read_handler - - parser.input = input - parser.input_pos = 0 -} - -/* - * Set a reader input - */ -func yaml_parser_set_input_reader(parser *yaml_parser_t, reader io.Reader) { - if parser.read_handler != nil { - panic("input already set") - } - - parser.read_handler = yaml_file_read_handler - parser.input_reader = reader -} - -/* - * Set a generic input. - */ - -func yaml_parser_set_input(parser *yaml_parser_t, handler yaml_read_handler_t) { - if parser.read_handler != nil { - panic("input already set") - } - - parser.read_handler = handler -} - -/* - * Set the source encoding. - */ - -func yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) { - if parser.encoding != yaml_ANY_ENCODING { - panic("encoding already set") - } - - parser.encoding = encoding -} - -/* - * Create a new emitter object. - */ - -func yaml_emitter_initialize(emitter *yaml_emitter_t) { - *emitter = yaml_emitter_t{ - buffer: make([]byte, OUTPUT_BUFFER_SIZE), - raw_buffer: make([]byte, 0, OUTPUT_RAW_BUFFER_SIZE), - states: make([]yaml_emitter_state_t, 0, INITIAL_STACK_SIZE), - events: make([]yaml_event_t, 0, INITIAL_QUEUE_SIZE), - } -} - -func yaml_emitter_delete(emitter *yaml_emitter_t) { - *emitter = yaml_emitter_t{} -} - -/* - * String write handler. - */ - -func yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) error { - *emitter.output_buffer = append(*emitter.output_buffer, buffer...) - return nil -} - -/* - * File write handler. - */ - -func yaml_writer_write_handler(emitter *yaml_emitter_t, buffer []byte) error { - _, err := emitter.output_writer.Write(buffer) - return err -} - -/* - * Set a string output. - */ - -func yaml_emitter_set_output_string(emitter *yaml_emitter_t, buffer *[]byte) { - if emitter.write_handler != nil { - panic("output already set") - } - - emitter.write_handler = yaml_string_write_handler - emitter.output_buffer = buffer -} - -/* - * Set a file output. - */ - -func yaml_emitter_set_output_writer(emitter *yaml_emitter_t, w io.Writer) { - if emitter.write_handler != nil { - panic("output already set") - } - - emitter.write_handler = yaml_writer_write_handler - emitter.output_writer = w -} - -/* - * Set a generic output handler. - */ - -func yaml_emitter_set_output(emitter *yaml_emitter_t, handler yaml_write_handler_t) { - if emitter.write_handler != nil { - panic("output already set") - } - - emitter.write_handler = handler -} - -/* - * Set the output encoding. - */ - -func yaml_emitter_set_encoding(emitter *yaml_emitter_t, encoding yaml_encoding_t) { - if emitter.encoding != yaml_ANY_ENCODING { - panic("encoding already set") - } - - emitter.encoding = encoding -} - -/* - * Set the canonical output style. - */ - -func yaml_emitter_set_canonical(emitter *yaml_emitter_t, canonical bool) { - emitter.canonical = canonical -} - -/* - * Set the indentation increment. - */ - -func yaml_emitter_set_indent(emitter *yaml_emitter_t, indent int) { - if indent < 2 || indent > 9 { - indent = 2 - } - emitter.best_indent = indent -} - -/* - * Set the preferred line width. - */ - -func yaml_emitter_set_width(emitter *yaml_emitter_t, width int) { - if width < 0 { - width = -1 - } - emitter.best_width = width -} - -/* - * Set if unescaped non-ASCII characters are allowed. - */ - -func yaml_emitter_set_unicode(emitter *yaml_emitter_t, unicode bool) { - emitter.unicode = unicode -} - -/* - * Set the preferred line break character. - */ - -func yaml_emitter_set_break(emitter *yaml_emitter_t, line_break yaml_break_t) { - emitter.line_break = line_break -} - -/* - * Destroy a token object. - */ - -// yaml_DECLARE(void) -// yaml_token_delete(yaml_token_t *token) -// { -// assert(token); /* Non-NULL token object expected. */ -// -// switch (token.type) -// { -// case yaml_TAG_DIRECTIVE_TOKEN: -// yaml_free(token.data.tag_directive.handle); -// yaml_free(token.data.tag_directive.prefix); -// break; -// -// case yaml_ALIAS_TOKEN: -// yaml_free(token.data.alias.value); -// break; -// -// case yaml_ANCHOR_TOKEN: -// yaml_free(token.data.anchor.value); -// break; -// -// case yaml_TAG_TOKEN: -// yaml_free(token.data.tag.handle); -// yaml_free(token.data.tag.suffix); -// break; -// -// case yaml_SCALAR_TOKEN: -// yaml_free(token.data.scalar.value); -// break; -// -// default: -// break; -// } -// -// memset(token, 0, sizeof(yaml_token_t)); -// } - -/* - * Check if a string is a valid UTF-8 sequence. - * - * Check 'reader.c' for more details on UTF-8 encoding. - */ - -// static int -// yaml_check_utf8(yaml_char_t *start, size_t length) -// { -// yaml_char_t *end = start+length; -// yaml_char_t *pointer = start; -// -// while (pointer < end) { -// unsigned char octet; -// unsigned int width; -// unsigned int value; -// size_t k; -// -// octet = pointer[0]; -// width = (octet & 0x80) == 0x00 ? 1 : -// (octet & 0xE0) == 0xC0 ? 2 : -// (octet & 0xF0) == 0xE0 ? 3 : -// (octet & 0xF8) == 0xF0 ? 4 : 0; -// value = (octet & 0x80) == 0x00 ? octet & 0x7F : -// (octet & 0xE0) == 0xC0 ? octet & 0x1F : -// (octet & 0xF0) == 0xE0 ? octet & 0x0F : -// (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0; -// if (!width) return 0; -// if (pointer+width > end) return 0; -// for (k = 1; k < width; k ++) { -// octet = pointer[k]; -// if ((octet & 0xC0) != 0x80) return 0; -// value = (value << 6) + (octet & 0x3F); -// } -// if (!((width == 1) || -// (width == 2 && value >= 0x80) || -// (width == 3 && value >= 0x800) || -// (width == 4 && value >= 0x10000))) return 0; -// -// pointer += width; -// } -// -// return 1; -// } - -/* - * Create STREAM-START. - */ - -func yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) { - *event = yaml_event_t{ - event_type: yaml_STREAM_START_EVENT, - encoding: encoding, - } -} - -/* - * Create STREAM-END. - */ - -func yaml_stream_end_event_initialize(event *yaml_event_t) { - *event = yaml_event_t{ - event_type: yaml_STREAM_END_EVENT, - } -} - -/* - * Create DOCUMENT-START. - */ - -func yaml_document_start_event_initialize(event *yaml_event_t, - version_directive *yaml_version_directive_t, - tag_directives []yaml_tag_directive_t, - implicit bool) { - *event = yaml_event_t{ - event_type: yaml_DOCUMENT_START_EVENT, - version_directive: version_directive, - tag_directives: tag_directives, - implicit: implicit, - } -} - -/* - * Create DOCUMENT-END. - */ - -func yaml_document_end_event_initialize(event *yaml_event_t, implicit bool) { - *event = yaml_event_t{ - event_type: yaml_DOCUMENT_END_EVENT, - implicit: implicit, - } -} - -/* - * Create ALIAS. - */ - -func yaml_alias_event_initialize(event *yaml_event_t, anchor []byte) { - *event = yaml_event_t{ - event_type: yaml_ALIAS_EVENT, - anchor: anchor, - } -} - -/* - * Create SCALAR. - */ - -func yaml_scalar_event_initialize(event *yaml_event_t, - anchor []byte, tag []byte, - value []byte, - plain_implicit bool, quoted_implicit bool, - style yaml_scalar_style_t) { - - *event = yaml_event_t{ - event_type: yaml_SCALAR_EVENT, - anchor: anchor, - tag: tag, - value: value, - implicit: plain_implicit, - quoted_implicit: quoted_implicit, - style: yaml_style_t(style), - } -} - -/* - * Create SEQUENCE-START. - */ - -func yaml_sequence_start_event_initialize(event *yaml_event_t, - anchor []byte, tag []byte, implicit bool, style yaml_sequence_style_t) { - *event = yaml_event_t{ - event_type: yaml_SEQUENCE_START_EVENT, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(style), - } -} - -/* - * Create SEQUENCE-END. - */ - -func yaml_sequence_end_event_initialize(event *yaml_event_t) { - *event = yaml_event_t{ - event_type: yaml_SEQUENCE_END_EVENT, - } -} - -/* - * Create MAPPING-START. - */ - -func yaml_mapping_start_event_initialize(event *yaml_event_t, - anchor []byte, tag []byte, implicit bool, style yaml_mapping_style_t) { - *event = yaml_event_t{ - event_type: yaml_MAPPING_START_EVENT, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(style), - } -} - -/* - * Create MAPPING-END. - */ - -func yaml_mapping_end_event_initialize(event *yaml_event_t) { - *event = yaml_event_t{ - event_type: yaml_MAPPING_END_EVENT, - } -} - -/* - * Destroy an event object. - */ - -func yaml_event_delete(event *yaml_event_t) { - *event = yaml_event_t{} -} - -// /* -// * Create a document object. -// */ -// -// func yaml_document_initialize(document *yaml_document_t, -// version_directive *yaml_version_directive_t, -// tag_directives []yaml_tag_directive_t, -// start_implicit, end_implicit bool) bool { -// -// -// { -// struct { -// YAML_error_type_t error; -// } context; -// struct { -// yaml_node_t *start; -// yaml_node_t *end; -// yaml_node_t *top; -// } nodes = { NULL, NULL, NULL }; -// yaml_version_directive_t *version_directive_copy = NULL; -// struct { -// yaml_tag_directive_t *start; -// yaml_tag_directive_t *end; -// yaml_tag_directive_t *top; -// } tag_directives_copy = { NULL, NULL, NULL }; -// yaml_tag_directive_t value = { NULL, NULL }; -// YAML_mark_t mark = { 0, 0, 0 }; -// -// assert(document); /* Non-NULL document object is expected. */ -// assert((tag_directives_start && tag_directives_end) || -// (tag_directives_start == tag_directives_end)); -// /* Valid tag directives are expected. */ -// -// if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error; -// -// if (version_directive) { -// version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t)); -// if (!version_directive_copy) goto error; -// version_directive_copy.major = version_directive.major; -// version_directive_copy.minor = version_directive.minor; -// } -// -// if (tag_directives_start != tag_directives_end) { -// yaml_tag_directive_t *tag_directive; -// if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE)) -// goto error; -// for (tag_directive = tag_directives_start; -// tag_directive != tag_directives_end; tag_directive ++) { -// assert(tag_directive.handle); -// assert(tag_directive.prefix); -// if (!yaml_check_utf8(tag_directive.handle, -// strlen((char *)tag_directive.handle))) -// goto error; -// if (!yaml_check_utf8(tag_directive.prefix, -// strlen((char *)tag_directive.prefix))) -// goto error; -// value.handle = yaml_strdup(tag_directive.handle); -// value.prefix = yaml_strdup(tag_directive.prefix); -// if (!value.handle || !value.prefix) goto error; -// if (!PUSH(&context, tag_directives_copy, value)) -// goto error; -// value.handle = NULL; -// value.prefix = NULL; -// } -// } -// -// DOCUMENT_INIT(*document, nodes.start, nodes.end, version_directive_copy, -// tag_directives_copy.start, tag_directives_copy.top, -// start_implicit, end_implicit, mark, mark); -// -// return 1; -// -// error: -// STACK_DEL(&context, nodes); -// yaml_free(version_directive_copy); -// while (!STACK_EMPTY(&context, tag_directives_copy)) { -// yaml_tag_directive_t value = POP(&context, tag_directives_copy); -// yaml_free(value.handle); -// yaml_free(value.prefix); -// } -// STACK_DEL(&context, tag_directives_copy); -// yaml_free(value.handle); -// yaml_free(value.prefix); -// -// return 0; -// } -// -// /* -// * Destroy a document object. -// */ -// -// yaml_DECLARE(void) -// yaml_document_delete(document *yaml_document_t) -// { -// struct { -// YAML_error_type_t error; -// } context; -// yaml_tag_directive_t *tag_directive; -// -// context.error = yaml_NO_ERROR; /* Eliminate a compliler warning. */ -// -// assert(document); /* Non-NULL document object is expected. */ -// -// while (!STACK_EMPTY(&context, document.nodes)) { -// yaml_node_t node = POP(&context, document.nodes); -// yaml_free(node.tag); -// switch (node.type) { -// case yaml_SCALAR_NODE: -// yaml_free(node.data.scalar.value); -// break; -// case yaml_SEQUENCE_NODE: -// STACK_DEL(&context, node.data.sequence.items); -// break; -// case yaml_MAPPING_NODE: -// STACK_DEL(&context, node.data.mapping.pairs); -// break; -// default: -// assert(0); /* Should not happen. */ -// } -// } -// STACK_DEL(&context, document.nodes); -// -// yaml_free(document.version_directive); -// for (tag_directive = document.tag_directives.start; -// tag_directive != document.tag_directives.end; -// tag_directive++) { -// yaml_free(tag_directive.handle); -// yaml_free(tag_directive.prefix); -// } -// yaml_free(document.tag_directives.start); -// -// memset(document, 0, sizeof(yaml_document_t)); -// } -// -// /** -// * Get a document node. -// */ -// -// yaml_DECLARE(yaml_node_t *) -// yaml_document_get_node(document *yaml_document_t, int index) -// { -// assert(document); /* Non-NULL document object is expected. */ -// -// if (index > 0 && document.nodes.start + index <= document.nodes.top) { -// return document.nodes.start + index - 1; -// } -// return NULL; -// } -// -// /** -// * Get the root object. -// */ -// -// yaml_DECLARE(yaml_node_t *) -// yaml_document_get_root_node(document *yaml_document_t) -// { -// assert(document); /* Non-NULL document object is expected. */ -// -// if (document.nodes.top != document.nodes.start) { -// return document.nodes.start; -// } -// return NULL; -// } -// -// /* -// * Add a scalar node to a document. -// */ -// -// yaml_DECLARE(int) -// yaml_document_add_scalar(document *yaml_document_t, -// yaml_char_t *tag, yaml_char_t *value, int length, -// yaml_scalar_style_t style) -// { -// struct { -// YAML_error_type_t error; -// } context; -// YAML_mark_t mark = { 0, 0, 0 }; -// yaml_char_t *tag_copy = NULL; -// yaml_char_t *value_copy = NULL; -// yaml_node_t node; -// -// assert(document); /* Non-NULL document object is expected. */ -// assert(value); /* Non-NULL value is expected. */ -// -// if (!tag) { -// tag = (yaml_char_t *)yaml_DEFAULT_SCALAR_TAG; -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; -// tag_copy = yaml_strdup(tag); -// if (!tag_copy) goto error; -// -// if (length < 0) { -// length = strlen((char *)value); -// } -// -// if (!yaml_check_utf8(value, length)) goto error; -// value_copy = yaml_malloc(length+1); -// if (!value_copy) goto error; -// memcpy(value_copy, value, length); -// value_copy[length] = '\0'; -// -// SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark); -// if (!PUSH(&context, document.nodes, node)) goto error; -// -// return document.nodes.top - document.nodes.start; -// -// error: -// yaml_free(tag_copy); -// yaml_free(value_copy); -// -// return 0; -// } -// -// /* -// * Add a sequence node to a document. -// */ -// -// yaml_DECLARE(int) -// yaml_document_add_sequence(document *yaml_document_t, -// yaml_char_t *tag, yaml_sequence_style_t style) -// { -// struct { -// YAML_error_type_t error; -// } context; -// YAML_mark_t mark = { 0, 0, 0 }; -// yaml_char_t *tag_copy = NULL; -// struct { -// yaml_node_item_t *start; -// yaml_node_item_t *end; -// yaml_node_item_t *top; -// } items = { NULL, NULL, NULL }; -// yaml_node_t node; -// -// assert(document); /* Non-NULL document object is expected. */ -// -// if (!tag) { -// tag = (yaml_char_t *)yaml_DEFAULT_SEQUENCE_TAG; -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; -// tag_copy = yaml_strdup(tag); -// if (!tag_copy) goto error; -// -// if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error; -// -// SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end, -// style, mark, mark); -// if (!PUSH(&context, document.nodes, node)) goto error; -// -// return document.nodes.top - document.nodes.start; -// -// error: -// STACK_DEL(&context, items); -// yaml_free(tag_copy); -// -// return 0; -// } -// -// /* -// * Add a mapping node to a document. -// */ -// -// yaml_DECLARE(int) -// yaml_document_add_mapping(document *yaml_document_t, -// yaml_char_t *tag, yaml_mapping_style_t style) -// { -// struct { -// YAML_error_type_t error; -// } context; -// YAML_mark_t mark = { 0, 0, 0 }; -// yaml_char_t *tag_copy = NULL; -// struct { -// yaml_node_pair_t *start; -// yaml_node_pair_t *end; -// yaml_node_pair_t *top; -// } pairs = { NULL, NULL, NULL }; -// yaml_node_t node; -// -// assert(document); /* Non-NULL document object is expected. */ -// -// if (!tag) { -// tag = (yaml_char_t *)yaml_DEFAULT_MAPPING_TAG; -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; -// tag_copy = yaml_strdup(tag); -// if (!tag_copy) goto error; -// -// if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error; -// -// MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end, -// style, mark, mark); -// if (!PUSH(&context, document.nodes, node)) goto error; -// -// return document.nodes.top - document.nodes.start; -// -// error: -// STACK_DEL(&context, pairs); -// yaml_free(tag_copy); -// -// return 0; -// } -// -// /* -// * Append an item to a sequence node. -// */ -// -// yaml_DECLARE(int) -// yaml_document_append_sequence_item(document *yaml_document_t, -// int sequence, int item) -// { -// struct { -// YAML_error_type_t error; -// } context; -// -// assert(document); /* Non-NULL document is required. */ -// assert(sequence > 0 -// && document.nodes.start + sequence <= document.nodes.top); -// /* Valid sequence id is required. */ -// assert(document.nodes.start[sequence-1].type == yaml_SEQUENCE_NODE); -// /* A sequence node is required. */ -// assert(item > 0 && document.nodes.start + item <= document.nodes.top); -// /* Valid item id is required. */ -// -// if (!PUSH(&context, -// document.nodes.start[sequence-1].data.sequence.items, item)) -// return 0; -// -// return 1; -// } -// -// /* -// * Append a pair of a key and a value to a mapping node. -// */ -// -// yaml_DECLARE(int) -// yaml_document_append_mapping_pair(document *yaml_document_t, -// int mapping, int key, int value) -// { -// struct { -// YAML_error_type_t error; -// } context; -// -// yaml_node_pair_t pair; -// -// assert(document); /* Non-NULL document is required. */ -// assert(mapping > 0 -// && document.nodes.start + mapping <= document.nodes.top); -// /* Valid mapping id is required. */ -// assert(document.nodes.start[mapping-1].type == yaml_MAPPING_NODE); -// /* A mapping node is required. */ -// assert(key > 0 && document.nodes.start + key <= document.nodes.top); -// /* Valid key id is required. */ -// assert(value > 0 && document.nodes.start + value <= document.nodes.top); -// /* Valid value id is required. */ -// -// pair.key = key; -// pair.value = value; -// -// if (!PUSH(&context, -// document.nodes.start[mapping-1].data.mapping.pairs, pair)) -// return 0; -// -// return 1; -// } -// diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/decode.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/decode.go deleted file mode 100644 index dcc1b89cf..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/decode.go +++ /dev/null @@ -1,622 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -import ( - "bytes" - "errors" - "fmt" - "io" - "reflect" - "runtime" - "strconv" - "strings" -) - -type Unmarshaler interface { - UnmarshalYAML(tag string, value interface{}) error -} - -// A Number represents a JSON number literal. -type Number string - -// String returns the literal text of the number. -func (n Number) String() string { return string(n) } - -// Float64 returns the number as a float64. -func (n Number) Float64() (float64, error) { - return strconv.ParseFloat(string(n), 64) -} - -// Int64 returns the number as an int64. -func (n Number) Int64() (int64, error) { - return strconv.ParseInt(string(n), 10, 64) -} - -type Decoder struct { - parser yaml_parser_t - event yaml_event_t - replay_events []yaml_event_t - useNumber bool - - anchors map[string][]yaml_event_t - tracking_anchors [][]yaml_event_t -} - -type ParserError struct { - ErrorType YAML_error_type_t - Context string - ContextMark YAML_mark_t - Problem string - ProblemMark YAML_mark_t -} - -func (e *ParserError) Error() string { - return fmt.Sprintf("yaml: [%s] %s at line %d, column %d", e.Context, e.Problem, e.ProblemMark.line+1, e.ProblemMark.column+1) -} - -type UnexpectedEventError struct { - Value string - EventType yaml_event_type_t - At YAML_mark_t -} - -func (e *UnexpectedEventError) Error() string { - return fmt.Sprintf("yaml: Unexpect event [%d]: '%s' at line %d, column %d", e.EventType, e.Value, e.At.line+1, e.At.column+1) -} - -func recovery(err *error) { - if r := recover(); r != nil { - if _, ok := r.(runtime.Error); ok { - panic(r) - } - - var tmpError error - switch r := r.(type) { - case error: - tmpError = r - case string: - tmpError = errors.New(r) - default: - tmpError = errors.New("Unknown panic: " + reflect.ValueOf(r).String()) - } - - *err = tmpError - } -} - -func Unmarshal(data []byte, v interface{}) error { - d := NewDecoder(bytes.NewBuffer(data)) - return d.Decode(v) -} - -func NewDecoder(r io.Reader) *Decoder { - d := &Decoder{ - anchors: make(map[string][]yaml_event_t), - tracking_anchors: make([][]yaml_event_t, 1), - } - yaml_parser_initialize(&d.parser) - yaml_parser_set_input_reader(&d.parser, r) - return d -} - -func (d *Decoder) Decode(v interface{}) (err error) { - defer recovery(&err) - - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return fmt.Errorf("Expected a pointer or nil but was a %s at %s", rv.String(), d.event.start_mark) - } - - if d.event.event_type == yaml_NO_EVENT { - d.nextEvent() - - if d.event.event_type != yaml_STREAM_START_EVENT { - return errors.New("Invalid stream") - } - - d.nextEvent() - } - - d.document(rv) - return nil -} - -func (d *Decoder) UseNumber() { d.useNumber = true } - -func (d *Decoder) error(err error) { - panic(err) -} - -func (d *Decoder) nextEvent() { - if d.event.event_type == yaml_STREAM_END_EVENT { - d.error(errors.New("The stream is closed")) - } - - if d.replay_events != nil { - d.event = d.replay_events[0] - if len(d.replay_events) == 1 { - d.replay_events = nil - } else { - d.replay_events = d.replay_events[1:] - } - } else { - if !yaml_parser_parse(&d.parser, &d.event) { - yaml_event_delete(&d.event) - - d.error(&ParserError{ - ErrorType: d.parser.error, - Context: d.parser.context, - ContextMark: d.parser.context_mark, - Problem: d.parser.problem, - ProblemMark: d.parser.problem_mark, - }) - } - } - - last := len(d.tracking_anchors) - // skip aliases when tracking an anchor - if last > 0 && d.event.event_type != yaml_ALIAS_EVENT { - d.tracking_anchors[last-1] = append(d.tracking_anchors[last-1], d.event) - } -} - -func (d *Decoder) document(rv reflect.Value) { - if d.event.event_type != yaml_DOCUMENT_START_EVENT { - d.error(fmt.Errorf("Expected document start at %s", d.event.start_mark)) - } - - d.nextEvent() - d.parse(rv) - - if d.event.event_type != yaml_DOCUMENT_END_EVENT { - d.error(fmt.Errorf("Expected document end at %s", d.event.start_mark)) - } - - d.nextEvent() -} - -func (d *Decoder) parse(rv reflect.Value) { - if !rv.IsValid() { - // skip ahead since we cannot store - d.valueInterface() - return - } - - anchor := string(d.event.anchor) - switch d.event.event_type { - case yaml_SEQUENCE_START_EVENT: - d.begin_anchor(anchor) - d.sequence(rv) - d.end_anchor(anchor) - case yaml_MAPPING_START_EVENT: - d.begin_anchor(anchor) - d.mapping(rv) - d.end_anchor(anchor) - case yaml_SCALAR_EVENT: - d.begin_anchor(anchor) - d.scalar(rv) - d.end_anchor(anchor) - case yaml_ALIAS_EVENT: - d.alias(rv) - case yaml_DOCUMENT_END_EVENT: - default: - d.error(&UnexpectedEventError{ - Value: string(d.event.value), - EventType: d.event.event_type, - At: d.event.start_mark, - }) - } -} - -func (d *Decoder) begin_anchor(anchor string) { - if anchor != "" { - events := []yaml_event_t{d.event} - d.tracking_anchors = append(d.tracking_anchors, events) - } -} - -func (d *Decoder) end_anchor(anchor string) { - if anchor != "" { - events := d.tracking_anchors[len(d.tracking_anchors)-1] - d.tracking_anchors = d.tracking_anchors[0 : len(d.tracking_anchors)-1] - // remove the anchor, replaying events shouldn't have anchors - events[0].anchor = nil - // we went one too many, remove the extra event - events = events[:len(events)-1] - // if nested, append to all the other anchors - for i, e := range d.tracking_anchors { - d.tracking_anchors[i] = append(e, events...) - } - d.anchors[anchor] = events - } -} - -func (d *Decoder) indirect(v reflect.Value, decodingNull bool) (Unmarshaler, reflect.Value) { - // If v is a named type and is addressable, - // start with its address, so that if the type has pointer methods, - // we find them. - if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { - v = v.Addr() - } - for { - // Load value from interface, but only if the result will be - // usefully addressable. - if v.Kind() == reflect.Interface && !v.IsNil() { - e := v.Elem() - if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) { - v = e - continue - } - } - - if v.Kind() != reflect.Ptr { - break - } - - if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() { - break - } - - if v.IsNil() { - v.Set(reflect.New(v.Type().Elem())) - } - - if v.Type().NumMethod() > 0 { - if u, ok := v.Interface().(Unmarshaler); ok { - var temp interface{} - return u, reflect.ValueOf(&temp) - } - } - - v = v.Elem() - } - - return nil, v -} - -func (d *Decoder) sequence(v reflect.Value) { - if d.event.event_type != yaml_SEQUENCE_START_EVENT { - d.error(fmt.Errorf("Expected sequence start at %s", d.event.start_mark)) - } - - u, pv := d.indirect(v, false) - if u != nil { - defer func() { - if err := u.UnmarshalYAML(yaml_SEQ_TAG, pv.Interface()); err != nil { - d.error(err) - } - }() - _, pv = d.indirect(pv, false) - } - - v = pv - - // Check type of target. - switch v.Kind() { - case reflect.Interface: - if v.NumMethod() == 0 { - // Decoding into nil interface? Switch to non-reflect code. - v.Set(reflect.ValueOf(d.sequenceInterface())) - return - } - // Otherwise it's invalid. - fallthrough - default: - d.error(fmt.Errorf("Expected an array, slice or interface{} but was a %s at %s", v, d.event.start_mark)) - case reflect.Array: - case reflect.Slice: - break - } - - d.nextEvent() - - i := 0 -done: - for { - switch d.event.event_type { - case yaml_SEQUENCE_END_EVENT, yaml_DOCUMENT_END_EVENT: - break done - } - - // Get element of array, growing if necessary. - if v.Kind() == reflect.Slice { - // Grow slice if necessary - if i >= v.Cap() { - newcap := v.Cap() + v.Cap()/2 - if newcap < 4 { - newcap = 4 - } - newv := reflect.MakeSlice(v.Type(), v.Len(), newcap) - reflect.Copy(newv, v) - v.Set(newv) - } - if i >= v.Len() { - v.SetLen(i + 1) - } - } - - if i < v.Len() { - // Decode into element. - d.parse(v.Index(i)) - } else { - // Ran out of fixed array: skip. - d.parse(reflect.Value{}) - } - i++ - } - - if i < v.Len() { - if v.Kind() == reflect.Array { - // Array. Zero the rest. - z := reflect.Zero(v.Type().Elem()) - for ; i < v.Len(); i++ { - v.Index(i).Set(z) - } - } else { - v.SetLen(i) - } - } - if i == 0 && v.Kind() == reflect.Slice { - v.Set(reflect.MakeSlice(v.Type(), 0, 0)) - } - - if d.event.event_type != yaml_DOCUMENT_END_EVENT { - d.nextEvent() - } -} - -func (d *Decoder) mapping(v reflect.Value) { - u, pv := d.indirect(v, false) - if u != nil { - defer func() { - if err := u.UnmarshalYAML(yaml_MAP_TAG, pv.Interface()); err != nil { - d.error(err) - } - }() - _, pv = d.indirect(pv, false) - } - v = pv - - // Decoding into nil interface? Switch to non-reflect code. - if v.Kind() == reflect.Interface && v.NumMethod() == 0 { - v.Set(reflect.ValueOf(d.mappingInterface())) - return - } - - // Check type of target: struct or map[X]Y - switch v.Kind() { - case reflect.Struct: - d.mappingStruct(v) - return - case reflect.Map: - default: - d.error(fmt.Errorf("Expected a struct or map but was a %s at %s ", v, d.event.start_mark)) - } - - mapt := v.Type() - if v.IsNil() { - v.Set(reflect.MakeMap(mapt)) - } - - d.nextEvent() - - keyt := mapt.Key() - mapElemt := mapt.Elem() - - var mapElem reflect.Value -done: - for { - switch d.event.event_type { - case yaml_MAPPING_END_EVENT: - break done - case yaml_DOCUMENT_END_EVENT: - return - } - - key := reflect.New(keyt) - d.parse(key.Elem()) - - if !mapElem.IsValid() { - mapElem = reflect.New(mapElemt).Elem() - } else { - mapElem.Set(reflect.Zero(mapElemt)) - } - - d.parse(mapElem) - - v.SetMapIndex(key.Elem(), mapElem) - } - - d.nextEvent() -} - -func (d *Decoder) mappingStruct(v reflect.Value) { - - structt := v.Type() - fields := cachedTypeFields(structt) - - d.nextEvent() - -done: - for { - switch d.event.event_type { - case yaml_MAPPING_END_EVENT: - break done - case yaml_DOCUMENT_END_EVENT: - return - } - - key := "" - d.parse(reflect.ValueOf(&key)) - - // Figure out field corresponding to key. - var subv reflect.Value - - var f *field - for i := range fields { - ff := &fields[i] - if ff.name == key { - f = ff - break - } - - if f == nil && strings.EqualFold(ff.name, key) { - f = ff - } - } - - if f != nil { - subv = v - for _, i := range f.index { - if subv.Kind() == reflect.Ptr { - if subv.IsNil() { - subv.Set(reflect.New(subv.Type().Elem())) - } - subv = subv.Elem() - } - subv = subv.Field(i) - } - } - d.parse(subv) - } - - d.nextEvent() -} - -func (d *Decoder) scalar(v reflect.Value) { - val := string(d.event.value) - wantptr := null_values[val] - - u, pv := d.indirect(v, wantptr) - - var tag string - if u != nil { - defer func() { - if err := u.UnmarshalYAML(tag, pv.Interface()); err != nil { - d.error(err) - } - }() - - _, pv = d.indirect(pv, wantptr) - } - v = pv - - var err error - tag, err = resolve(d.event, v, d.useNumber) - if err != nil { - d.error(err) - } - - d.nextEvent() -} - -func (d *Decoder) alias(rv reflect.Value) { - val, ok := d.anchors[string(d.event.anchor)] - if !ok { - d.error(fmt.Errorf("missing anchor: '%s' at %s", d.event.anchor, d.event.start_mark)) - } - - d.replay_events = val - d.nextEvent() - d.parse(rv) -} - -func (d *Decoder) valueInterface() interface{} { - var v interface{} - - anchor := string(d.event.anchor) - switch d.event.event_type { - case yaml_SEQUENCE_START_EVENT: - d.begin_anchor(anchor) - v = d.sequenceInterface() - case yaml_MAPPING_START_EVENT: - d.begin_anchor(anchor) - v = d.mappingInterface() - case yaml_SCALAR_EVENT: - d.begin_anchor(anchor) - v = d.scalarInterface() - case yaml_ALIAS_EVENT: - rv := reflect.ValueOf(&v) - d.alias(rv) - return v - case yaml_DOCUMENT_END_EVENT: - d.error(&UnexpectedEventError{ - Value: string(d.event.value), - EventType: d.event.event_type, - At: d.event.start_mark, - }) - - } - d.end_anchor(anchor) - - return v -} - -func (d *Decoder) scalarInterface() interface{} { - _, v := resolveInterface(d.event, d.useNumber) - - d.nextEvent() - return v -} - -// sequenceInterface is like sequence but returns []interface{}. -func (d *Decoder) sequenceInterface() []interface{} { - var v = make([]interface{}, 0) - - d.nextEvent() - -done: - for { - switch d.event.event_type { - case yaml_SEQUENCE_END_EVENT, yaml_DOCUMENT_END_EVENT: - break done - } - - v = append(v, d.valueInterface()) - } - - if d.event.event_type != yaml_DOCUMENT_END_EVENT { - d.nextEvent() - } - - return v -} - -// mappingInterface is like mapping but returns map[interface{}]interface{}. -func (d *Decoder) mappingInterface() map[interface{}]interface{} { - m := make(map[interface{}]interface{}) - - d.nextEvent() - -done: - for { - switch d.event.event_type { - case yaml_MAPPING_END_EVENT, yaml_DOCUMENT_END_EVENT: - break done - } - - key := d.valueInterface() - - // Read value. - m[key] = d.valueInterface() - } - - if d.event.event_type != yaml_DOCUMENT_END_EVENT { - d.nextEvent() - } - - return m -} diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/emitter.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/emitter.go deleted file mode 100644 index bd2014f34..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/emitter.go +++ /dev/null @@ -1,2072 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -import ( - "bytes" -) - -var default_tag_directives = []yaml_tag_directive_t{ - {[]byte("!"), []byte("!")}, - {[]byte("!!"), []byte("tag:yaml.org,2002:")}, -} - -/* - * Flush the buffer if needed. - */ - -func flush(emitter *yaml_emitter_t) bool { - if emitter.buffer_pos+5 >= len(emitter.buffer) { - return yaml_emitter_flush(emitter) - } - return true -} - -/* - * Put a character to the output buffer. - */ -func put(emitter *yaml_emitter_t, value byte) bool { - if !flush(emitter) { - return false - } - - emitter.buffer[emitter.buffer_pos] = value - emitter.buffer_pos++ - emitter.column++ - return true -} - -/* - * Put a line break to the output buffer. - */ - -func put_break(emitter *yaml_emitter_t) bool { - if !flush(emitter) { - return false - } - switch emitter.line_break { - case yaml_CR_BREAK: - emitter.buffer[emitter.buffer_pos] = '\r' - emitter.buffer_pos++ - case yaml_LN_BREAK: - emitter.buffer[emitter.buffer_pos] = '\n' - emitter.buffer_pos++ - case yaml_CRLN_BREAK: - emitter.buffer[emitter.buffer_pos] = '\r' - emitter.buffer[emitter.buffer_pos] = '\n' - emitter.buffer_pos += 2 - default: - return false - } - emitter.column = 0 - emitter.line++ - return true -} - -/* - * Copy a character from a string into buffer. - */ -func write(emitter *yaml_emitter_t, src []byte, src_pos *int) bool { - if !flush(emitter) { - return false - } - copy_bytes(emitter.buffer, &emitter.buffer_pos, src, src_pos) - emitter.column++ - return true -} - -/* - * Copy a line break character from a string into buffer. - */ - -func write_break(emitter *yaml_emitter_t, src []byte, src_pos *int) bool { - if src[*src_pos] == '\n' { - if !put_break(emitter) { - return false - } - *src_pos++ - } else { - if !write(emitter, src, src_pos) { - return false - } - emitter.column = 0 - emitter.line++ - } - - return true -} - -/* - * Set an emitter error and return 0. - */ - -func yaml_emitter_set_emitter_error(emitter *yaml_emitter_t, problem string) bool { - emitter.error = yaml_EMITTER_ERROR - emitter.problem = problem - return false -} - -/* - * Emit an event. - */ - -func yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool { - emitter.events = append(emitter.events, *event) - for !yaml_emitter_need_more_events(emitter) { - event := &emitter.events[emitter.events_head] - if !yaml_emitter_analyze_event(emitter, event) { - return false - } - if !yaml_emitter_state_machine(emitter, event) { - return false - } - yaml_event_delete(event) - emitter.events_head++ - } - return true -} - -/* - * Check if we need to accumulate more events before emitting. - * - * We accumulate extra - * - 1 event for DOCUMENT-START - * - 2 events for SEQUENCE-START - * - 3 events for MAPPING-START - */ - -func yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool { - if emitter.events_head == len(emitter.events) { - return true - } - - accumulate := 0 - switch emitter.events[emitter.events_head].event_type { - case yaml_DOCUMENT_START_EVENT: - accumulate = 1 - case yaml_SEQUENCE_START_EVENT: - accumulate = 2 - case yaml_MAPPING_START_EVENT: - accumulate = 3 - default: - return false - } - - if len(emitter.events)-emitter.events_head > accumulate { - return false - } - - level := 0 - for i := emitter.events_head; i < len(emitter.events); i++ { - switch emitter.events[i].event_type { - case yaml_STREAM_START_EVENT, yaml_DOCUMENT_START_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT: - level++ - case yaml_STREAM_END_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_END_EVENT, yaml_MAPPING_END_EVENT: - level-- - } - - if level == 0 { - return false - } - } - return true -} - -/* - * Append a directive to the directives stack. - */ - -func yaml_emitter_append_tag_directive(emitter *yaml_emitter_t, - value *yaml_tag_directive_t, allow_duplicates bool) bool { - - for i := range emitter.tag_directives { - - if bytes.Equal(value.handle, emitter.tag_directives[i].handle) { - if allow_duplicates { - return true - } - return yaml_emitter_set_emitter_error(emitter, "duplicat %TAG directive") - } - } - - tag_copy := yaml_tag_directive_t{ - handle: value.handle, - prefix: value.prefix, - } - - emitter.tag_directives = append(emitter.tag_directives, tag_copy) - - return true -} - -/* - * Increase the indentation level. - */ - -func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow bool, indentless bool) bool { - - emitter.indents = append(emitter.indents, emitter.indent) - - if emitter.indent < 0 { - if flow { - emitter.indent = emitter.best_indent - } else { - emitter.indent = 0 - } - } else if !indentless { - emitter.indent += emitter.best_indent - } - - return true -} - -/* - * State dispatcher. - */ - -func yaml_emitter_state_machine(emitter *yaml_emitter_t, event *yaml_event_t) bool { - switch emitter.state { - case yaml_EMIT_STREAM_START_STATE: - return yaml_emitter_emit_stream_start(emitter, event) - - case yaml_EMIT_FIRST_DOCUMENT_START_STATE: - return yaml_emitter_emit_document_start(emitter, event, true) - - case yaml_EMIT_DOCUMENT_START_STATE: - return yaml_emitter_emit_document_start(emitter, event, false) - - case yaml_EMIT_DOCUMENT_CONTENT_STATE: - return yaml_emitter_emit_document_content(emitter, event) - - case yaml_EMIT_DOCUMENT_END_STATE: - return yaml_emitter_emit_document_end(emitter, event) - - case yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE: - return yaml_emitter_emit_flow_sequence_item(emitter, event, true) - - case yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE: - return yaml_emitter_emit_flow_sequence_item(emitter, event, false) - - case yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE: - return yaml_emitter_emit_flow_mapping_key(emitter, event, true) - - case yaml_EMIT_FLOW_MAPPING_KEY_STATE: - return yaml_emitter_emit_flow_mapping_key(emitter, event, false) - - case yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE: - return yaml_emitter_emit_flow_mapping_value(emitter, event, true) - - case yaml_EMIT_FLOW_MAPPING_VALUE_STATE: - return yaml_emitter_emit_flow_mapping_value(emitter, event, false) - - case yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE: - return yaml_emitter_emit_block_sequence_item(emitter, event, true) - - case yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE: - return yaml_emitter_emit_block_sequence_item(emitter, event, false) - - case yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE: - return yaml_emitter_emit_block_mapping_key(emitter, event, true) - - case yaml_EMIT_BLOCK_MAPPING_KEY_STATE: - return yaml_emitter_emit_block_mapping_key(emitter, event, false) - - case yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE: - return yaml_emitter_emit_block_mapping_value(emitter, event, true) - - case yaml_EMIT_BLOCK_MAPPING_VALUE_STATE: - return yaml_emitter_emit_block_mapping_value(emitter, event, false) - - case yaml_EMIT_END_STATE: - return yaml_emitter_set_emitter_error(emitter, - "expected nothing after STREAM-END") - - } - - panic("invalid state") -} - -/* - * Expect STREAM-START. - */ - -func yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { - - if event.event_type != yaml_STREAM_START_EVENT { - return yaml_emitter_set_emitter_error(emitter, - "expected STREAM-START") - } - - if emitter.encoding == yaml_ANY_ENCODING { - emitter.encoding = event.encoding - - if emitter.encoding == yaml_ANY_ENCODING { - emitter.encoding = yaml_UTF8_ENCODING - } - } - - if emitter.best_indent < 2 || emitter.best_indent > 9 { - emitter.best_indent = 2 - } - - if emitter.best_width >= 0 && emitter.best_width <= emitter.best_indent*2 { - emitter.best_width = 80 - } - - if emitter.best_width < 0 { - emitter.best_width = 1<<31 - 1 - } - - if emitter.line_break == yaml_ANY_BREAK { - emitter.line_break = yaml_LN_BREAK - } - - emitter.indent = -1 - - emitter.line = 0 - emitter.column = 0 - emitter.whitespace = true - emitter.indention = true - - if emitter.encoding != yaml_UTF8_ENCODING { - if !yaml_emitter_write_bom(emitter) { - return false - } - } - - emitter.state = yaml_EMIT_FIRST_DOCUMENT_START_STATE - - return true -} - -/* - * Expect DOCUMENT-START or STREAM-END. - */ - -func yaml_emitter_emit_document_start(emitter *yaml_emitter_t, - event *yaml_event_t, first bool) bool { - - if event.event_type == yaml_DOCUMENT_START_EVENT { - if event.version_directive != nil { - if !yaml_emitter_analyze_version_directive(emitter, - *event.version_directive) { - return false - } - } - - for i := range event.tag_directives { - tag_directive := &event.tag_directives[i] - - if !yaml_emitter_analyze_tag_directive(emitter, tag_directive) { - return false - } - if !yaml_emitter_append_tag_directive(emitter, tag_directive, false) { - return false - } - } - - for i := range default_tag_directives { - if !yaml_emitter_append_tag_directive(emitter, &default_tag_directives[i], true) { - return false - } - } - - implicit := event.implicit - if !first || emitter.canonical { - implicit = false - } - - if (event.version_directive != nil || len(event.tag_directives) > 0) && - emitter.open_ended { - if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - - if event.version_directive != nil { - implicit = false - if !yaml_emitter_write_indicator(emitter, []byte("%YAML"), true, false, false) { - return false - } - - if !yaml_emitter_write_indicator(emitter, []byte("1.1"), true, false, false) { - return false - } - - if !yaml_emitter_write_indent(emitter) { - return false - } - } - - if len(event.tag_directives) > 0 { - implicit = false - for i := range event.tag_directives { - tag_directive := &event.tag_directives[i] - - if !yaml_emitter_write_indicator(emitter, []byte("%TAG"), true, false, false) { - return false - } - if !yaml_emitter_write_tag_handle(emitter, tag_directive.handle) { - return false - } - if !yaml_emitter_write_tag_content(emitter, tag_directive.prefix, true) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - } - - if yaml_emitter_check_empty_document(emitter) { - implicit = false - } - - if !implicit { - if !yaml_emitter_write_indent(emitter) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte("---"), true, false, false) { - return false - } - - if emitter.canonical { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - } - - emitter.state = yaml_EMIT_DOCUMENT_CONTENT_STATE - - return true - } else if event.event_type == yaml_STREAM_END_EVENT { - if emitter.open_ended { - if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - - if !yaml_emitter_flush(emitter) { - return false - } - - emitter.state = yaml_EMIT_END_STATE - - return true - } - - return yaml_emitter_set_emitter_error(emitter, - "expected DOCUMENT-START or STREAM-END") -} - -/* - * Expect the root node. - */ - -func yaml_emitter_emit_document_content(emitter *yaml_emitter_t, event *yaml_event_t) bool { - emitter.states = append(emitter.states, yaml_EMIT_DOCUMENT_END_STATE) - - return yaml_emitter_emit_node(emitter, event, true, false, false, false) -} - -/* - * Expect DOCUMENT-END. - */ - -func yaml_emitter_emit_document_end(emitter *yaml_emitter_t, event *yaml_event_t) bool { - - if event.event_type != yaml_DOCUMENT_END_EVENT { - return yaml_emitter_set_emitter_error(emitter, - "expected DOCUMENT-END") - } - - if !yaml_emitter_write_indent(emitter) { - return false - } - if !event.implicit { - if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_flush(emitter) { - return false - } - - emitter.state = yaml_EMIT_DOCUMENT_START_STATE - emitter.tag_directives = emitter.tag_directives[:0] - return true -} - -/* - * - * Expect a flow item node. - */ - -func yaml_emitter_emit_flow_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { - if first { - if !yaml_emitter_write_indicator(emitter, []byte("["), true, true, false) { - return false - } - if !yaml_emitter_increase_indent(emitter, true, false) { - return false - } - emitter.flow_level++ - } - - if event.event_type == yaml_SEQUENCE_END_EVENT { - emitter.flow_level-- - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - if emitter.canonical && !first { - if !yaml_emitter_write_indicator(emitter, []byte(","), false, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_write_indicator(emitter, []byte("]"), false, false, false) { - return false - } - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - - return true - } - - if !first { - if !yaml_emitter_write_indicator(emitter, []byte(","), false, false, false) { - return false - } - } - - if emitter.canonical || emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - - emitter.states = append(emitter.states, yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE) - return yaml_emitter_emit_node(emitter, event, false, true, false, false) -} - -/* - * Expect a flow key node. - */ - -func yaml_emitter_emit_flow_mapping_key(emitter *yaml_emitter_t, - event *yaml_event_t, first bool) bool { - - if first { - - if !yaml_emitter_write_indicator(emitter, []byte("{"), true, true, false) { - return false - } - if !yaml_emitter_increase_indent(emitter, true, false) { - return false - } - emitter.flow_level++ - } - - if event.event_type == yaml_MAPPING_END_EVENT { - emitter.flow_level-- - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - - if emitter.canonical && !first { - if !yaml_emitter_write_indicator(emitter, []byte(","), false, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_write_indicator(emitter, []byte("}"), false, false, false) { - return false - } - - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - - return true - } - - if !first { - if !yaml_emitter_write_indicator(emitter, []byte(","), false, false, false) { - return false - } - } - if emitter.canonical || emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - - if !emitter.canonical && yaml_emitter_check_simple_key(emitter) { - emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, true) - } else { - if !yaml_emitter_write_indicator(emitter, []byte("?"), true, false, false) { - return false - } - - emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_VALUE_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, false) - } -} - -/* - * Expect a flow value node. - */ - -func yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, - event *yaml_event_t, simple bool) bool { - - if simple { - if !yaml_emitter_write_indicator(emitter, []byte(":"), false, false, false) { - return false - } - } else { - if emitter.canonical || emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_write_indicator(emitter, []byte(":"), true, false, false) { - return false - } - } - emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_KEY_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, false) -} - -/* - * Expect a block item node. - */ - -func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, - event *yaml_event_t, first bool) bool { - - if first { - if !yaml_emitter_increase_indent(emitter, false, - (emitter.mapping_context && !emitter.indention)) { - return false - } - } - - if event.event_type == yaml_SEQUENCE_END_EVENT { - - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - - return true - } - - if !yaml_emitter_write_indent(emitter) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte("-"), true, false, true) { - return false - } - - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE) - return yaml_emitter_emit_node(emitter, event, false, true, false, false) -} - -/* - * Expect a block key node. - */ - -func yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t, - event *yaml_event_t, first bool) bool { - - if first { - if !yaml_emitter_increase_indent(emitter, false, false) { - return false - } - } - - if event.event_type == yaml_MAPPING_END_EVENT { - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - - return true - } - - if !yaml_emitter_write_indent(emitter) { - return false - } - - if yaml_emitter_check_simple_key(emitter) { - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE) - - return yaml_emitter_emit_node(emitter, event, false, false, true, true) - } else { - if !yaml_emitter_write_indicator(emitter, []byte("?"), true, false, true) { - return false - } - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_VALUE_STATE) - - return yaml_emitter_emit_node(emitter, event, false, false, true, false) - } -} - -/* - * Expect a block value node. - */ - -func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, - event *yaml_event_t, simple bool) bool { - - if simple { - if !yaml_emitter_write_indicator(emitter, []byte(":"), false, false, false) { - return false - } - } else { - if !yaml_emitter_write_indent(emitter) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte(":"), true, false, true) { - return false - } - } - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE) - - return yaml_emitter_emit_node(emitter, event, false, false, true, false) -} - -/* - * Expect a node. - */ - -func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t, - root bool, sequence bool, mapping bool, simple_key bool) bool { - emitter.root_context = root - emitter.sequence_context = sequence - emitter.mapping_context = mapping - emitter.simple_key_context = simple_key - - switch event.event_type { - case yaml_ALIAS_EVENT: - return yaml_emitter_emit_alias(emitter, event) - - case yaml_SCALAR_EVENT: - return yaml_emitter_emit_scalar(emitter, event) - - case yaml_SEQUENCE_START_EVENT: - return yaml_emitter_emit_sequence_start(emitter, event) - - case yaml_MAPPING_START_EVENT: - return yaml_emitter_emit_mapping_start(emitter, event) - - default: - return yaml_emitter_set_emitter_error(emitter, - "expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS") - } - - return false -} - -/* - * Expect ALIAS. - */ - -func yaml_emitter_emit_alias(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_process_anchor(emitter) { - return false - } - - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - - return true -} - -/* - * Expect SCALAR. - */ - -func yaml_emitter_emit_scalar(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_select_scalar_style(emitter, event) { - return false - } - if !yaml_emitter_process_anchor(emitter) { - return false - } - if !yaml_emitter_process_tag(emitter) { - return false - } - if !yaml_emitter_increase_indent(emitter, true, false) { - return false - } - if !yaml_emitter_process_scalar(emitter) { - return false - } - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - - return true -} - -/* - * Expect SEQUENCE-START. - */ - -func yaml_emitter_emit_sequence_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_process_anchor(emitter) { - return false - } - if !yaml_emitter_process_tag(emitter) { - return false - } - - if emitter.flow_level > 0 || emitter.canonical || - event.style == yaml_style_t(yaml_FLOW_SEQUENCE_STYLE) || - yaml_emitter_check_empty_sequence(emitter) { - emitter.state = yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE - } else { - emitter.state = yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE - } - - return true -} - -/* - * Expect MAPPING-START. - */ - -func yaml_emitter_emit_mapping_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_process_anchor(emitter) { - return false - } - if !yaml_emitter_process_tag(emitter) { - return false - } - - if emitter.flow_level > 0 || emitter.canonical || - event.style == yaml_style_t(yaml_FLOW_MAPPING_STYLE) || - yaml_emitter_check_empty_mapping(emitter) { - emitter.state = yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE - } else { - emitter.state = yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE - } - - return true -} - -/* - * Check if the document content is an empty scalar. - */ - -func yaml_emitter_check_empty_document(emitter *yaml_emitter_t) bool { - return false -} - -/* - * Check if the next events represent an empty sequence. - */ - -func yaml_emitter_check_empty_sequence(emitter *yaml_emitter_t) bool { - if len(emitter.events)-emitter.events_head < 2 { - return false - } - - return (emitter.events[emitter.events_head].event_type == yaml_SEQUENCE_START_EVENT && - emitter.events[emitter.events_head+1].event_type == yaml_SEQUENCE_END_EVENT) -} - -/* - * Check if the next events represent an empty mapping. - */ - -func yaml_emitter_check_empty_mapping(emitter *yaml_emitter_t) bool { - if len(emitter.events)-emitter.events_head < 2 { - return false - } - - return (emitter.events[emitter.events_head].event_type == yaml_MAPPING_START_EVENT && - emitter.events[emitter.events_head+1].event_type == yaml_MAPPING_END_EVENT) -} - -/* - * Check if the next node can be expressed as a simple key. - */ - -func yaml_emitter_check_simple_key(emitter *yaml_emitter_t) bool { - length := 0 - - switch emitter.events[emitter.events_head].event_type { - case yaml_ALIAS_EVENT: - length += len(emitter.anchor_data.anchor) - - case yaml_SCALAR_EVENT: - if emitter.scalar_data.multiline { - return false - } - length += len(emitter.anchor_data.anchor) + - len(emitter.tag_data.handle) + - len(emitter.tag_data.suffix) + - len(emitter.scalar_data.value) - - case yaml_SEQUENCE_START_EVENT: - if !yaml_emitter_check_empty_sequence(emitter) { - return false - } - - length += len(emitter.anchor_data.anchor) + - len(emitter.tag_data.handle) + - len(emitter.tag_data.suffix) - - case yaml_MAPPING_START_EVENT: - if !yaml_emitter_check_empty_mapping(emitter) { - return false - } - - length += len(emitter.anchor_data.anchor) + - len(emitter.tag_data.handle) + - len(emitter.tag_data.suffix) - - default: - return false - } - - if length > 128 { - return false - } - - return true -} - -/* - * Determine an acceptable scalar style. - */ - -func yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event_t) bool { - no_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 - - if no_tag && !event.implicit && !event.quoted_implicit { - return yaml_emitter_set_emitter_error(emitter, - "neither tag nor implicit flags are specified") - } - - style := yaml_scalar_style_t(event.style) - - if style == yaml_ANY_SCALAR_STYLE { - style = yaml_PLAIN_SCALAR_STYLE - } - - if emitter.canonical { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - - if emitter.simple_key_context && emitter.scalar_data.multiline { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - - if style == yaml_PLAIN_SCALAR_STYLE { - if (emitter.flow_level > 0 && !emitter.scalar_data.flow_plain_allowed) || - (emitter.flow_level == 0 && !emitter.scalar_data.block_plain_allowed) { - style = yaml_SINGLE_QUOTED_SCALAR_STYLE - } - if len(emitter.scalar_data.value) == 0 && - (emitter.flow_level > 0 || emitter.simple_key_context) { - style = yaml_SINGLE_QUOTED_SCALAR_STYLE - } - if no_tag && !event.implicit { - style = yaml_SINGLE_QUOTED_SCALAR_STYLE - } - } - - if style == yaml_SINGLE_QUOTED_SCALAR_STYLE { - if !emitter.scalar_data.single_quoted_allowed { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - } - - if style == yaml_LITERAL_SCALAR_STYLE || style == yaml_FOLDED_SCALAR_STYLE { - if !emitter.scalar_data.block_allowed || - emitter.flow_level > 0 || emitter.simple_key_context { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - } - - if no_tag && !event.quoted_implicit && - style != yaml_PLAIN_SCALAR_STYLE { - emitter.tag_data.handle = []byte("!") - } - - emitter.scalar_data.style = style - - return true -} - -/* - * Write an achor. - */ - -func yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool { - if emitter.anchor_data.anchor == nil { - return true - } - - indicator := "*" - if !emitter.anchor_data.alias { - indicator = "&" - } - if !yaml_emitter_write_indicator(emitter, []byte(indicator), true, false, false) { - return false - } - - return yaml_emitter_write_anchor(emitter, emitter.anchor_data.anchor) -} - -/* - * Write a tag. - */ - -func yaml_emitter_process_tag(emitter *yaml_emitter_t) bool { - if len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 { - return true - } - - if len(emitter.tag_data.handle) > 0 { - if !yaml_emitter_write_tag_handle(emitter, emitter.tag_data.handle) { - return false - } - - if len(emitter.tag_data.suffix) > 0 { - if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) { - return false - } - - } - } else { - if !yaml_emitter_write_indicator(emitter, []byte("!<"), true, false, false) { - return false - } - - if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) { - return false - } - - if !yaml_emitter_write_indicator(emitter, []byte(">"), false, false, false) { - return false - } - - } - - return true -} - -/* - * Write a scalar. - */ - -func yaml_emitter_process_scalar(emitter *yaml_emitter_t) bool { - switch emitter.scalar_data.style { - case yaml_PLAIN_SCALAR_STYLE: - return yaml_emitter_write_plain_scalar(emitter, - emitter.scalar_data.value, - !emitter.simple_key_context) - - case yaml_SINGLE_QUOTED_SCALAR_STYLE: - return yaml_emitter_write_single_quoted_scalar(emitter, - emitter.scalar_data.value, - !emitter.simple_key_context) - - case yaml_DOUBLE_QUOTED_SCALAR_STYLE: - return yaml_emitter_write_double_quoted_scalar(emitter, - emitter.scalar_data.value, - !emitter.simple_key_context) - - case yaml_LITERAL_SCALAR_STYLE: - return yaml_emitter_write_literal_scalar(emitter, - emitter.scalar_data.value) - - case yaml_FOLDED_SCALAR_STYLE: - return yaml_emitter_write_folded_scalar(emitter, - emitter.scalar_data.value) - - default: - panic("unknown scalar") - } - - return false -} - -/* - * Check if a %YAML directive is valid. - */ - -func yaml_emitter_analyze_version_directive(emitter *yaml_emitter_t, - version_directive yaml_version_directive_t) bool { - if version_directive.major != 1 || version_directive.minor != 1 { - return yaml_emitter_set_emitter_error(emitter, - "incompatible %YAML directive") - } - - return true -} - -/* - * Check if a %TAG directive is valid. - */ - -func yaml_emitter_analyze_tag_directive(emitter *yaml_emitter_t, - tag_directive *yaml_tag_directive_t) bool { - handle := tag_directive.handle - prefix := tag_directive.prefix - - if len(handle) == 0 { - return yaml_emitter_set_emitter_error(emitter, - "tag handle must not be empty") - } - - if handle[0] != '!' { - return yaml_emitter_set_emitter_error(emitter, - "tag handle must start with '!'") - } - - if handle[len(handle)-1] != '!' { - return yaml_emitter_set_emitter_error(emitter, - "tag handle must end with '!'") - } - - for i := 1; i < len(handle)-1; width(handle[i]) { - if !is_alpha(handle[i]) { - return yaml_emitter_set_emitter_error(emitter, - "tag handle must contain alphanumerical characters only") - } - } - - if len(prefix) == 0 { - return yaml_emitter_set_emitter_error(emitter, - "tag prefix must not be empty") - } - - return true -} - -/* - * Check if an anchor is valid. - */ - -func yaml_emitter_analyze_anchor(emitter *yaml_emitter_t, - anchor []byte, alias bool) bool { - if len(anchor) == 0 { - errmsg := "alias value must not be empty" - if !alias { - errmsg = "anchor value must not be empty" - } - return yaml_emitter_set_emitter_error(emitter, errmsg) - } - - for i := 0; i < len(anchor); i += width(anchor[i]) { - if !is_alpha(anchor[i]) { - errmsg := "alias value must contain alphanumerical characters only" - if !alias { - errmsg = "anchor value must contain alphanumerical characters only" - } - return yaml_emitter_set_emitter_error(emitter, errmsg) - } - } - - emitter.anchor_data.anchor = anchor - emitter.anchor_data.alias = alias - - return true -} - -/* - * Check if a tag is valid. - */ - -func yaml_emitter_analyze_tag(emitter *yaml_emitter_t, tag []byte) bool { - if len(tag) == 0 { - return yaml_emitter_set_emitter_error(emitter, - "tag value must not be empty") - } - - for i := range emitter.tag_directives { - tag_directive := &emitter.tag_directives[i] - if bytes.HasPrefix(tag, tag_directive.prefix) { - emitter.tag_data.handle = tag_directive.handle - emitter.tag_data.suffix = tag[len(tag_directive.prefix):] - return true - } - } - - emitter.tag_data.suffix = tag - - return true -} - -/* - * Check if a scalar is valid. - */ - -func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool { - block_indicators := false - flow_indicators := false - line_breaks := false - special_characters := false - - leading_space := false - leading_break := false - trailing_space := false - trailing_break := false - break_space := false - space_break := false - - preceeded_by_whitespace := false - followed_by_whitespace := false - previous_space := false - previous_break := false - - emitter.scalar_data.value = value - - if len(value) == 0 { - emitter.scalar_data.multiline = false - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = true - emitter.scalar_data.single_quoted_allowed = true - emitter.scalar_data.block_allowed = false - - return true - } - - if len(value) >= 3 && ((value[0] == '-' && value[1] == '-' && value[2] == '-') || - (value[0] == '.' && value[1] == '.' && value[2] == '.')) { - block_indicators = true - flow_indicators = true - } - - preceeded_by_whitespace = true - - for i, w := 0, 0; i < len(value); i += w { - w = width(value[i]) - followed_by_whitespace = i+w >= len(value) || is_blankz_at(value, i+w) - - if i == 0 { - switch value[i] { - case '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\'', '"', '%', '@', '`': - flow_indicators = true - block_indicators = true - case '?', ':': - flow_indicators = true - if followed_by_whitespace { - block_indicators = true - } - case '-': - if followed_by_whitespace { - flow_indicators = true - block_indicators = true - } - } - } else { - switch value[i] { - case ',', '?', '[', ']', '{', '}': - flow_indicators = true - case ':': - flow_indicators = true - if followed_by_whitespace { - block_indicators = true - } - case '#': - if preceeded_by_whitespace { - flow_indicators = true - block_indicators = true - } - } - } - - if !is_printable_at(value, i) || (!is_ascii(value[i]) && !emitter.unicode) { - special_characters = true - } - - if is_break_at(value, i) { - line_breaks = true - } - - if is_space(value[i]) { - if i == 0 { - leading_space = true - } - if i+w == len(value) { - trailing_space = true - } - if previous_break { - break_space = true - } - previous_space = true - previous_break = false - } else if is_break_at(value, i) { - if i == 0 { - leading_break = true - } - if i+width(value[i]) == len(value) { - trailing_break = true - } - if previous_space { - space_break = true - } - previous_space = false - previous_break = true - } else { - previous_space = false - previous_break = false - } - - preceeded_by_whitespace = is_blankz_at(value, i) - } - - emitter.scalar_data.multiline = line_breaks - - emitter.scalar_data.flow_plain_allowed = true - emitter.scalar_data.block_plain_allowed = true - emitter.scalar_data.single_quoted_allowed = true - emitter.scalar_data.block_allowed = true - - if leading_space || leading_break || trailing_space || trailing_break { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - } - - if trailing_space { - emitter.scalar_data.block_allowed = false - } - - if break_space { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - emitter.scalar_data.single_quoted_allowed = false - } - - if space_break || special_characters { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - emitter.scalar_data.single_quoted_allowed = false - emitter.scalar_data.block_allowed = false - } - - if line_breaks { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - } - - if flow_indicators { - emitter.scalar_data.flow_plain_allowed = false - } - - if block_indicators { - emitter.scalar_data.block_plain_allowed = false - } - - return true -} - -/* - * Check if the event data is valid. - */ - -func yaml_emitter_analyze_event(emitter *yaml_emitter_t, event *yaml_event_t) bool { - emitter.anchor_data.anchor = nil - emitter.tag_data.handle = nil - emitter.tag_data.suffix = nil - emitter.scalar_data.value = nil - - switch event.event_type { - case yaml_ALIAS_EVENT: - if !yaml_emitter_analyze_anchor(emitter, - event.anchor, true) { - return false - } - - case yaml_SCALAR_EVENT: - if len(event.anchor) > 0 { - if !yaml_emitter_analyze_anchor(emitter, - event.anchor, false) { - return false - } - } - if len(event.tag) > 0 && (emitter.canonical || - (!event.implicit && - !event.quoted_implicit)) { - if !yaml_emitter_analyze_tag(emitter, event.tag) { - return false - } - } - if !yaml_emitter_analyze_scalar(emitter, event.value) { - return false - } - case yaml_SEQUENCE_START_EVENT: - if len(event.anchor) > 0 { - if !yaml_emitter_analyze_anchor(emitter, - event.anchor, false) { - return false - } - } - if len(event.tag) > 0 && (emitter.canonical || - !event.implicit) { - if !yaml_emitter_analyze_tag(emitter, - event.tag) { - return false - } - } - case yaml_MAPPING_START_EVENT: - if len(event.anchor) > 0 { - if !yaml_emitter_analyze_anchor(emitter, - event.anchor, false) { - return false - } - } - if len(event.tag) > 0 && (emitter.canonical || - !event.implicit) { - if !yaml_emitter_analyze_tag(emitter, - event.tag) { - return false - } - } - - } - return true -} - -/* - * Write the BOM character. - */ - -func yaml_emitter_write_bom(emitter *yaml_emitter_t) bool { - if !flush(emitter) { - return false - } - - pos := emitter.buffer_pos - emitter.buffer[pos] = '\xEF' - emitter.buffer[pos+1] = '\xBB' - emitter.buffer[pos+2] = '\xBF' - emitter.buffer_pos += 3 - return true -} - -func yaml_emitter_write_indent(emitter *yaml_emitter_t) bool { - indent := emitter.indent - if indent < 0 { - indent = 0 - } - - if !emitter.indention || emitter.column > indent || - (emitter.column == indent && !emitter.whitespace) { - if !put_break(emitter) { - return false - } - } - - for emitter.column < indent { - if !put(emitter, ' ') { - return false - } - } - - emitter.whitespace = true - emitter.indention = true - - return true -} - -func yaml_emitter_write_indicator(emitter *yaml_emitter_t, - indicator []byte, need_whitespace bool, - is_whitespace bool, is_indention bool) bool { - if need_whitespace && !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - - ind_pos := 0 - for ind_pos < len(indicator) { - if !write(emitter, indicator, &ind_pos) { - return false - } - } - - emitter.whitespace = is_whitespace - emitter.indention = (emitter.indention && is_indention) - emitter.open_ended = false - - return true -} - -func yaml_emitter_write_anchor(emitter *yaml_emitter_t, value []byte) bool { - pos := 0 - for pos < len(value) { - if !write(emitter, value, &pos) { - return false - } - } - - emitter.whitespace = false - emitter.indention = false - - return true -} - -func yaml_emitter_write_tag_handle(emitter *yaml_emitter_t, value []byte) bool { - if !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - - pos := 0 - for pos < len(value) { - if !write(emitter, value, &pos) { - return false - } - } - - emitter.whitespace = false - emitter.indention = false - - return true -} - -func yaml_emitter_write_tag_content(emitter *yaml_emitter_t, value []byte, - need_whitespace bool) bool { - if need_whitespace && !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - - for i := 0; i < len(value); { - write_it := false - switch value[i] { - case ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '_', - '.', '!', '~', '*', '\'', '(', ')', '[', ']': - write_it = true - default: - write_it = is_alpha(value[i]) - } - if write_it { - if !write(emitter, value, &i) { - return false - } - } else { - w := width(value[i]) - for j := 0; j < w; j++ { - val := value[i] - i++ - - if !put(emitter, '%') { - return false - } - c := val >> 4 - if c < 10 { - c += '0' - } else { - c += 'A' - 10 - } - if !put(emitter, c) { - return false - } - - c = val & 0x0f - if c < 10 { - c += '0' - } else { - c += 'A' - 10 - } - if !put(emitter, c) { - return false - } - - } - } - } - - emitter.whitespace = false - emitter.indention = false - - return true -} - -func yaml_emitter_write_plain_scalar(emitter *yaml_emitter_t, value []byte, - allow_breaks bool) bool { - spaces := false - breaks := false - - if !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - - for i := 0; i < len(value); { - if is_space(value[i]) { - if allow_breaks && !spaces && - emitter.column > emitter.best_width && - !is_space(value[i+1]) { - if !yaml_emitter_write_indent(emitter) { - return false - } - i += width(value[i]) - } else { - if !write(emitter, value, &i) { - return false - } - } - spaces = true - } else if is_break_at(value, i) { - if !breaks && value[i] == '\n' { - if !put_break(emitter) { - return false - } - } - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !write(emitter, value, &i) { - return false - } - emitter.indention = false - spaces = false - breaks = false - } - } - - emitter.whitespace = false - emitter.indention = false - if emitter.root_context { - emitter.open_ended = true - } - - return true -} - -func yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, value []byte, - allow_breaks bool) bool { - spaces := false - breaks := false - - if !yaml_emitter_write_indicator(emitter, []byte("'"), true, false, false) { - return false - } - - for i := 0; i < len(value); { - if is_space(value[i]) { - if allow_breaks && !spaces && - emitter.column > emitter.best_width && - i > 0 && i < len(value)-1 && - !is_space(value[i+1]) { - if !yaml_emitter_write_indent(emitter) { - return false - } - i += width(value[i]) - } else { - if !write(emitter, value, &i) { - return false - } - } - spaces = true - } else if is_break_at(value, i) { - if !breaks && value[i] == '\n' { - if !put_break(emitter) { - return false - } - } - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if value[i] == '\'' { - if !put(emitter, '\'') { - return false - } - } - if !write(emitter, value, &i) { - return false - } - emitter.indention = false - spaces = false - breaks = false - } - } - - if !yaml_emitter_write_indicator(emitter, []byte("'"), false, false, false) { - return false - } - - emitter.whitespace = false - emitter.indention = false - - return true -} - -func yaml_emitter_write_double_quoted_scalar(emitter *yaml_emitter_t, value []byte, - allow_breaks bool) bool { - - spaces := false - - if !yaml_emitter_write_indicator(emitter, []byte("\""), true, false, false) { - return false - } - - for i := 0; i < len(value); { - if !is_printable_at(value, i) || (!emitter.unicode && !is_ascii(value[i])) || - is_bom_at(value, i) || is_break_at(value, i) || - value[i] == '"' || value[i] == '\\' { - octet := value[i] - - var w int - var v rune - switch { - case octet&0x80 == 0x00: - w, v = 1, rune(octet&0x7F) - case octet&0xE0 == 0xC0: - w, v = 2, rune(octet&0x1F) - case octet&0xF0 == 0xE0: - w, v = 3, rune(octet&0x0F) - case octet&0xF8 == 0xF0: - w, v = 4, rune(octet&0x07) - } - - for k := 1; k < w; k++ { - octet = value[i+k] - v = (v << 6) + (rune(octet) & 0x3F) - } - i += w - - if !put(emitter, '\\') { - return false - } - - switch v { - case 0x00: - if !put(emitter, '0') { - return false - } - case 0x07: - if !put(emitter, 'a') { - return false - } - case 0x08: - if !put(emitter, 'b') { - return false - } - case 0x09: - if !put(emitter, 't') { - return false - } - - case 0x0A: - if !put(emitter, 'n') { - return false - } - - case 0x0B: - if !put(emitter, 'v') { - return false - } - - case 0x0C: - if !put(emitter, 'f') { - return false - } - - case 0x0D: - if !put(emitter, 'r') { - return false - } - - case 0x1B: - if !put(emitter, 'e') { - return false - } - case 0x22: - if !put(emitter, '"') { - return false - } - case 0x5C: - if !put(emitter, '\\') { - return false - } - case 0x85: - if !put(emitter, 'N') { - return false - } - - case 0xA0: - if !put(emitter, '_') { - return false - } - - case 0x2028: - if !put(emitter, 'L') { - return false - } - - case 0x2029: - if !put(emitter, 'P') { - return false - } - default: - if v <= 0xFF { - if !put(emitter, 'x') { - return false - } - w = 2 - } else if v <= 0xFFFF { - if !put(emitter, 'u') { - return false - } - w = 4 - } else { - if !put(emitter, 'U') { - return false - } - w = 8 - } - for k := (w - 1) * 4; k >= 0; k -= 4 { - digit := byte((v >> uint(k)) & 0x0F) - c := digit + '0' - if c > 9 { - c = digit + 'A' - 10 - } - if !put(emitter, c) { - return false - } - } - } - spaces = false - } else if is_space(value[i]) { - if allow_breaks && !spaces && - emitter.column > emitter.best_width && - i > 0 && i < len(value)-1 { - if !yaml_emitter_write_indent(emitter) { - return false - } - if is_space(value[i+1]) { - if !put(emitter, '\\') { - return false - } - } - i += width(value[i]) - } else { - if !write(emitter, value, &i) { - return false - } - } - spaces = true - } else { - if !write(emitter, value, &i) { - return false - } - spaces = false - } - } - - if !yaml_emitter_write_indicator(emitter, []byte("\""), false, false, false) { - return false - } - - emitter.whitespace = false - emitter.indention = false - - return true -} - -func yaml_emitter_write_block_scalar_hints(emitter *yaml_emitter_t, value []byte) bool { - - if is_space(value[0]) || is_break_at(value, 0) { - indent_hint := []byte{'0' + byte(emitter.best_indent)} - if !yaml_emitter_write_indicator(emitter, indent_hint, false, false, false) { - return false - } - } - - emitter.open_ended = false - - var chomp_hint [1]byte - if len(value) == 0 { - chomp_hint[0] = '-' - } else { - i := len(value) - 1 - for value[i]&0xC0 == 0x80 { - i-- - } - - if !is_break_at(value, i) { - chomp_hint[0] = '-' - } else if i == 0 { - chomp_hint[0] = '+' - emitter.open_ended = true - } else { - for value[i]&0xC0 == 0x80 { - i-- - } - - if is_break_at(value, i) { - chomp_hint[0] = '+' - emitter.open_ended = true - } - } - } - - if chomp_hint[0] != 0 { - if !yaml_emitter_write_indicator(emitter, chomp_hint[:], false, false, false) { - return false - } - } - - return true -} - -func yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bool { - - breaks := true - - if !yaml_emitter_write_indicator(emitter, []byte("|"), true, false, false) { - return false - } - - if !yaml_emitter_write_block_scalar_hints(emitter, value) { - return false - } - - if !put_break(emitter) { - return false - } - - emitter.indention = true - emitter.whitespace = true - - for i := 0; i < len(value); { - if is_break_at(value, i) { - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !write(emitter, value, &i) { - return false - } - emitter.indention = false - breaks = false - } - } - - return true -} - -func yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) bool { - breaks := true - leading_spaces := true - - if !yaml_emitter_write_indicator(emitter, []byte(">"), true, false, false) { - return false - } - if !yaml_emitter_write_block_scalar_hints(emitter, value) { - return false - } - if !put_break(emitter) { - return false - } - emitter.indention = true - emitter.whitespace = true - - for i := 0; i < len(value); { - if is_break_at(value, i) { - if !breaks && !leading_spaces && value[i] == '\n' { - k := i - for is_break_at(value, k) { - k += width(value[k]) - } - if !is_blankz_at(value, k) { - if !put_break(emitter) { - return false - } - } - } - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - leading_spaces = is_blank(value[i]) - } - if !breaks && is_space(value[i]) && !is_space(value[i+1]) && - emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - i += width(value[i]) - } else { - if !write(emitter, value, &i) { - return false - } - } - emitter.indention = false - breaks = false - } - } - - return true -} diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/encode.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/encode.go deleted file mode 100644 index fd9918089..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/encode.go +++ /dev/null @@ -1,395 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -import ( - "bytes" - "encoding/base64" - "io" - "math" - "reflect" - "regexp" - "sort" - "strconv" - "time" -) - -var ( - timeTimeType = reflect.TypeOf(time.Time{}) - marshalerType = reflect.TypeOf(new(Marshaler)).Elem() - numberType = reflect.TypeOf(Number("")) - nonPrintable = regexp.MustCompile("[^\t\n\r\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD]") - multiline = regexp.MustCompile("\n|\u0085|\u2028|\u2029") - - shortTags = map[string]string{ - yaml_NULL_TAG: "!!null", - yaml_BOOL_TAG: "!!bool", - yaml_STR_TAG: "!!str", - yaml_INT_TAG: "!!int", - yaml_FLOAT_TAG: "!!float", - yaml_TIMESTAMP_TAG: "!!timestamp", - yaml_SEQ_TAG: "!!seq", - yaml_MAP_TAG: "!!map", - yaml_BINARY_TAG: "!!binary", - } -) - -type Marshaler interface { - MarshalYAML() (tag string, value interface{}, err error) -} - -// An Encoder writes JSON objects to an output stream. -type Encoder struct { - w io.Writer - emitter yaml_emitter_t - event yaml_event_t - flow bool - err error -} - -func Marshal(v interface{}) ([]byte, error) { - b := bytes.Buffer{} - e := NewEncoder(&b) - err := e.Encode(v) - return b.Bytes(), err -} - -// NewEncoder returns a new encoder that writes to w. -func NewEncoder(w io.Writer) *Encoder { - e := &Encoder{w: w} - yaml_emitter_initialize(&e.emitter) - yaml_emitter_set_output_writer(&e.emitter, e.w) - yaml_stream_start_event_initialize(&e.event, yaml_UTF8_ENCODING) - e.emit() - yaml_document_start_event_initialize(&e.event, nil, nil, true) - e.emit() - - return e -} - -func (e *Encoder) Encode(v interface{}) (err error) { - defer recovery(&err) - - if e.err != nil { - return e.err - } - - e.marshal("", reflect.ValueOf(v), true) - - yaml_document_end_event_initialize(&e.event, true) - e.emit() - e.emitter.open_ended = false - yaml_stream_end_event_initialize(&e.event) - e.emit() - - return nil -} - -func (e *Encoder) emit() { - if !yaml_emitter_emit(&e.emitter, &e.event) { - panic("bad emit") - } -} - -func (e *Encoder) marshal(tag string, v reflect.Value, allowAddr bool) { - vt := v.Type() - - if vt.Implements(marshalerType) { - e.emitMarshaler(tag, v) - return - } - - if vt.Kind() != reflect.Ptr && allowAddr { - if reflect.PtrTo(vt).Implements(marshalerType) { - e.emitAddrMarshaler(tag, v) - return - } - } - - switch v.Kind() { - case reflect.Interface: - if v.IsNil() { - e.emitNil() - } else { - e.marshal(tag, v.Elem(), allowAddr) - } - case reflect.Map: - e.emitMap(tag, v) - case reflect.Ptr: - if v.IsNil() { - e.emitNil() - } else { - e.marshal(tag, v.Elem(), true) - } - case reflect.Struct: - e.emitStruct(tag, v) - case reflect.Slice: - e.emitSlice(tag, v) - case reflect.String: - e.emitString(tag, v) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - e.emitInt(tag, v) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - e.emitUint(tag, v) - case reflect.Float32, reflect.Float64: - e.emitFloat(tag, v) - case reflect.Bool: - e.emitBool(tag, v) - default: - panic("Can't marshal type yet: " + v.Type().String()) - } -} - -func (e *Encoder) emitMap(tag string, v reflect.Value) { - e.mapping(tag, func() { - var keys stringValues = v.MapKeys() - sort.Sort(keys) - for _, k := range keys { - e.marshal("", k, true) - e.marshal("", v.MapIndex(k), true) - } - }) -} - -func (e *Encoder) emitStruct(tag string, v reflect.Value) { - if v.Type() == timeTimeType { - e.emitTime(tag, v) - return - } - - fields := cachedTypeFields(v.Type()) - - e.mapping(tag, func() { - for _, f := range fields { - fv := fieldByIndex(v, f.index) - if !fv.IsValid() || f.omitEmpty && isEmptyValue(fv) { - continue - } - - e.marshal("", reflect.ValueOf(f.name), true) - e.flow = f.flow - e.marshal("", fv, true) - } - }) -} - -func (e *Encoder) emitTime(tag string, v reflect.Value) { - t := v.Interface().(time.Time) - bytes, _ := t.MarshalText() - e.emitScalar(string(bytes), "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - return false -} - -func (e *Encoder) mapping(tag string, f func()) { - implicit := tag == "" - style := yaml_BLOCK_MAPPING_STYLE - if e.flow { - e.flow = false - style = yaml_FLOW_MAPPING_STYLE - } - yaml_mapping_start_event_initialize(&e.event, nil, []byte(tag), implicit, style) - e.emit() - - f() - - yaml_mapping_end_event_initialize(&e.event) - e.emit() -} - -func (e *Encoder) emitSlice(tag string, v reflect.Value) { - if v.Type() == byteSliceType { - e.emitBase64(tag, v) - return - } - - implicit := tag == "" - style := yaml_BLOCK_SEQUENCE_STYLE - if e.flow { - e.flow = false - style = yaml_FLOW_SEQUENCE_STYLE - } - yaml_sequence_start_event_initialize(&e.event, nil, []byte(tag), implicit, style) - e.emit() - - n := v.Len() - for i := 0; i < n; i++ { - e.marshal("", v.Index(i), true) - } - - yaml_sequence_end_event_initialize(&e.event) - e.emit() -} - -func (e *Encoder) emitBase64(tag string, v reflect.Value) { - if v.IsNil() { - e.emitNil() - return - } - - s := v.Bytes() - - dst := make([]byte, base64.StdEncoding.EncodedLen(len(s))) - - base64.StdEncoding.Encode(dst, s) - e.emitScalar(string(dst), "", yaml_BINARY_TAG, yaml_DOUBLE_QUOTED_SCALAR_STYLE) -} - -func (e *Encoder) emitString(tag string, v reflect.Value) { - var style yaml_scalar_style_t - s := v.String() - - if nonPrintable.MatchString(s) { - e.emitBase64(tag, v) - return - } - - if v.Type() == numberType { - style = yaml_PLAIN_SCALAR_STYLE - } else { - event := yaml_event_t{ - implicit: true, - value: []byte(s), - } - - rtag, _ := resolveInterface(event, false) - if tag == "" && rtag != yaml_STR_TAG { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } else if multiline.MatchString(s) { - style = yaml_LITERAL_SCALAR_STYLE - } else { - style = yaml_PLAIN_SCALAR_STYLE - } - } - - e.emitScalar(s, "", tag, style) -} - -func (e *Encoder) emitBool(tag string, v reflect.Value) { - s := strconv.FormatBool(v.Bool()) - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *Encoder) emitInt(tag string, v reflect.Value) { - s := strconv.FormatInt(v.Int(), 10) - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *Encoder) emitUint(tag string, v reflect.Value) { - s := strconv.FormatUint(v.Uint(), 10) - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *Encoder) emitFloat(tag string, v reflect.Value) { - f := v.Float() - - var s string - switch { - case math.IsNaN(f): - s = ".nan" - case math.IsInf(f, 1): - s = "+.inf" - case math.IsInf(f, -1): - s = "-.inf" - default: - s = strconv.FormatFloat(f, 'g', -1, v.Type().Bits()) - } - - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *Encoder) emitNil() { - e.emitScalar("null", "", "", yaml_PLAIN_SCALAR_STYLE) -} - -func (e *Encoder) emitScalar(value, anchor, tag string, style yaml_scalar_style_t) { - implicit := tag == "" - if !implicit { - style = yaml_PLAIN_SCALAR_STYLE - } - - stag := shortTags[tag] - if stag == "" { - stag = tag - } - - yaml_scalar_event_initialize(&e.event, []byte(anchor), []byte(stag), []byte(value), implicit, implicit, style) - e.emit() -} - -func (e *Encoder) emitMarshaler(tag string, v reflect.Value) { - if v.Kind() == reflect.Ptr && v.IsNil() { - e.emitNil() - return - } - - m := v.Interface().(Marshaler) - if m == nil { - e.emitNil() - return - } - t, val, err := m.MarshalYAML() - if err != nil { - panic(err) - } - if val == nil { - e.emitNil() - return - } - - e.marshal(t, reflect.ValueOf(val), false) -} - -func (e *Encoder) emitAddrMarshaler(tag string, v reflect.Value) { - if !v.CanAddr() { - e.marshal(tag, v, false) - return - } - - va := v.Addr() - if va.IsNil() { - e.emitNil() - return - } - - m := v.Interface().(Marshaler) - t, val, err := m.MarshalYAML() - if err != nil { - panic(err) - } - - if val == nil { - e.emitNil() - return - } - - e.marshal(t, reflect.ValueOf(val), false) -} diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/parser.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/parser.go deleted file mode 100644 index 8d38e3065..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/parser.go +++ /dev/null @@ -1,1230 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -import ( - "bytes" -) - -/* - * The parser implements the following grammar: - * - * stream ::= STREAM-START implicit_document? explicit_document* STREAM-END - * implicit_document ::= block_node DOCUMENT-END* - * explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - * block_node_or_indentless_sequence ::= - * ALIAS - * | properties (block_content | indentless_block_sequence)? - * | block_content - * | indentless_block_sequence - * block_node ::= ALIAS - * | properties block_content? - * | block_content - * flow_node ::= ALIAS - * | properties flow_content? - * | flow_content - * properties ::= TAG ANCHOR? | ANCHOR TAG? - * block_content ::= block_collection | flow_collection | SCALAR - * flow_content ::= flow_collection | SCALAR - * block_collection ::= block_sequence | block_mapping - * flow_collection ::= flow_sequence | flow_mapping - * block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END - * indentless_sequence ::= (BLOCK-ENTRY block_node?)+ - * block_mapping ::= BLOCK-MAPPING_START - * ((KEY block_node_or_indentless_sequence?)? - * (VALUE block_node_or_indentless_sequence?)?)* - * BLOCK-END - * flow_sequence ::= FLOW-SEQUENCE-START - * (flow_sequence_entry FLOW-ENTRY)* - * flow_sequence_entry? - * FLOW-SEQUENCE-END - * flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * flow_mapping ::= FLOW-MAPPING-START - * (flow_mapping_entry FLOW-ENTRY)* - * flow_mapping_entry? - * FLOW-MAPPING-END - * flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - */ - -/* - * Peek the next token in the token queue. - */ -func peek_token(parser *yaml_parser_t) *yaml_token_t { - if parser.token_available || yaml_parser_fetch_more_tokens(parser) { - return &parser.tokens[parser.tokens_head] - } - return nil -} - -/* - * Remove the next token from the queue (must be called after peek_token). - */ -func skip_token(parser *yaml_parser_t) { - parser.token_available = false - parser.tokens_parsed++ - parser.stream_end_produced = parser.tokens[parser.tokens_head].token_type == yaml_STREAM_END_TOKEN - parser.tokens_head++ -} - -/* - * Get the next event. - */ - -func yaml_parser_parse(parser *yaml_parser_t, event *yaml_event_t) bool { - /* Erase the event object. */ - *event = yaml_event_t{} - - /* No events after the end of the stream or error. */ - - if parser.stream_end_produced || parser.error != yaml_NO_ERROR || - parser.state == yaml_PARSE_END_STATE { - return true - } - - /* Generate the next event. */ - - return yaml_parser_state_machine(parser, event) -} - -/* - * Set parser error. - */ - -func yaml_parser_set_parser_error(parser *yaml_parser_t, - problem string, problem_mark YAML_mark_t) bool { - parser.error = yaml_PARSER_ERROR - parser.problem = problem - parser.problem_mark = problem_mark - - return false -} - -func yaml_parser_set_parser_error_context(parser *yaml_parser_t, - context string, context_mark YAML_mark_t, - problem string, problem_mark YAML_mark_t) bool { - parser.error = yaml_PARSER_ERROR - parser.context = context - parser.context_mark = context_mark - parser.problem = problem - parser.problem_mark = problem_mark - - return false -} - -/* - * State dispatcher. - */ - -func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool { - switch parser.state { - case yaml_PARSE_STREAM_START_STATE: - return yaml_parser_parse_stream_start(parser, event) - - case yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE: - return yaml_parser_parse_document_start(parser, event, true) - - case yaml_PARSE_DOCUMENT_START_STATE: - return yaml_parser_parse_document_start(parser, event, false) - - case yaml_PARSE_DOCUMENT_CONTENT_STATE: - return yaml_parser_parse_document_content(parser, event) - - case yaml_PARSE_DOCUMENT_END_STATE: - return yaml_parser_parse_document_end(parser, event) - - case yaml_PARSE_BLOCK_NODE_STATE: - return yaml_parser_parse_node(parser, event, true, false) - - case yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE: - return yaml_parser_parse_node(parser, event, true, true) - - case yaml_PARSE_FLOW_NODE_STATE: - return yaml_parser_parse_node(parser, event, false, false) - - case yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE: - return yaml_parser_parse_block_sequence_entry(parser, event, true) - - case yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE: - return yaml_parser_parse_block_sequence_entry(parser, event, false) - - case yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE: - return yaml_parser_parse_indentless_sequence_entry(parser, event) - - case yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE: - return yaml_parser_parse_block_mapping_key(parser, event, true) - - case yaml_PARSE_BLOCK_MAPPING_KEY_STATE: - return yaml_parser_parse_block_mapping_key(parser, event, false) - - case yaml_PARSE_BLOCK_MAPPING_VALUE_STATE: - return yaml_parser_parse_block_mapping_value(parser, event) - - case yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE: - return yaml_parser_parse_flow_sequence_entry(parser, event, true) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE: - return yaml_parser_parse_flow_sequence_entry(parser, event, false) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE: - return yaml_parser_parse_flow_sequence_entry_mapping_key(parser, event) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE: - return yaml_parser_parse_flow_sequence_entry_mapping_value(parser, event) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE: - return yaml_parser_parse_flow_sequence_entry_mapping_end(parser, event) - - case yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE: - return yaml_parser_parse_flow_mapping_key(parser, event, true) - - case yaml_PARSE_FLOW_MAPPING_KEY_STATE: - return yaml_parser_parse_flow_mapping_key(parser, event, false) - - case yaml_PARSE_FLOW_MAPPING_VALUE_STATE: - return yaml_parser_parse_flow_mapping_value(parser, event, false) - - case yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE: - return yaml_parser_parse_flow_mapping_value(parser, event, true) - } - - panic("invalid parser state") -} - -/* - * Parse the production: - * stream ::= STREAM-START implicit_document? explicit_document* STREAM-END - * ************ - */ - -func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - - if token.token_type != yaml_STREAM_START_TOKEN { - return yaml_parser_set_parser_error(parser, - "did not find expected ", token.start_mark) - } - - parser.state = yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE - *event = yaml_event_t{ - event_type: yaml_STREAM_START_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - encoding: token.encoding, - } - skip_token(parser) - - return true -} - -/* - * Parse the productions: - * implicit_document ::= block_node DOCUMENT-END* - * * - * explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - * ************************* - */ - -func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, - implicit bool) bool { - - token := peek_token(parser) - if token == nil { - return false - } - - /* Parse extra document end indicators. */ - - if !implicit { - for token.token_type == yaml_DOCUMENT_END_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } - } - - /* Parse an implicit document. */ - - if implicit && token.token_type != yaml_VERSION_DIRECTIVE_TOKEN && - token.token_type != yaml_TAG_DIRECTIVE_TOKEN && - token.token_type != yaml_DOCUMENT_START_TOKEN && - token.token_type != yaml_STREAM_END_TOKEN { - if !yaml_parser_process_directives(parser, nil, nil) { - return false - } - - parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE) - parser.state = yaml_PARSE_BLOCK_NODE_STATE - - *event = yaml_event_t{ - event_type: yaml_DOCUMENT_START_EVENT, - implicit: true, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - } else if token.token_type != yaml_STREAM_END_TOKEN { - /* Parse an explicit document. */ - var version_directive *yaml_version_directive_t - var tag_directives []yaml_tag_directive_t - - start_mark := token.start_mark - if !yaml_parser_process_directives(parser, &version_directive, - &tag_directives) { - return false - } - token = peek_token(parser) - if token == nil { - return false - } - if token.token_type != yaml_DOCUMENT_START_TOKEN { - yaml_parser_set_parser_error(parser, - "did not find expected ", token.start_mark) - return false - } - - parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE) - parser.state = yaml_PARSE_DOCUMENT_CONTENT_STATE - - end_mark := token.end_mark - - *event = yaml_event_t{ - event_type: yaml_DOCUMENT_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - version_directive: version_directive, - tag_directives: tag_directives, - implicit: false, - } - skip_token(parser) - } else { - /* Parse the stream end. */ - parser.state = yaml_PARSE_END_STATE - - *event = yaml_event_t{ - event_type: yaml_STREAM_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - skip_token(parser) - } - return true -} - -/* - * Parse the productions: - * explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - * *********** - */ - -func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - - if token.token_type == yaml_VERSION_DIRECTIVE_TOKEN || - token.token_type == yaml_TAG_DIRECTIVE_TOKEN || - token.token_type == yaml_DOCUMENT_START_TOKEN || - token.token_type == yaml_DOCUMENT_END_TOKEN || - token.token_type == yaml_STREAM_END_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - return yaml_parser_process_empty_scalar(parser, event, - token.start_mark) - } else { - return yaml_parser_parse_node(parser, event, true, false) - } -} - -/* - * Parse the productions: - * implicit_document ::= block_node DOCUMENT-END* - * ************* - * explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - * ************* - */ - -func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool { - implicit := true - - token := peek_token(parser) - if token == nil { - return false - } - - start_mark, end_mark := token.start_mark, token.start_mark - - if token.token_type == yaml_DOCUMENT_END_TOKEN { - end_mark = token.end_mark - skip_token(parser) - implicit = false - } - - parser.tag_directives = parser.tag_directives[:0] - - parser.state = yaml_PARSE_DOCUMENT_START_STATE - *event = yaml_event_t{ - event_type: yaml_DOCUMENT_END_EVENT, - start_mark: start_mark, - end_mark: end_mark, - implicit: implicit, - } - - return true -} - -/* - * Parse the productions: - * block_node_or_indentless_sequence ::= - * ALIAS - * ***** - * | properties (block_content | indentless_block_sequence)? - * ********** * - * | block_content | indentless_block_sequence - * * - * block_node ::= ALIAS - * ***** - * | properties block_content? - * ********** * - * | block_content - * * - * flow_node ::= ALIAS - * ***** - * | properties flow_content? - * ********** * - * | flow_content - * * - * properties ::= TAG ANCHOR? | ANCHOR TAG? - * ************************* - * block_content ::= block_collection | flow_collection | SCALAR - * ****** - * flow_content ::= flow_collection | SCALAR - * ****** - */ - -func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, - block bool, indentless_sequence bool) bool { - - token := peek_token(parser) - if token == nil { - return false - } - - if token.token_type == yaml_ALIAS_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - - *event = yaml_event_t{ - event_type: yaml_ALIAS_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - anchor: token.value, - } - skip_token(parser) - return true - } else { - start_mark, end_mark := token.start_mark, token.start_mark - - var tag_handle []byte - var tag_suffix, anchor []byte - var tag_mark YAML_mark_t - if token.token_type == yaml_ANCHOR_TOKEN { - anchor = token.value - start_mark = token.start_mark - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.token_type == yaml_TAG_TOKEN { - tag_handle = token.value - tag_suffix = token.suffix - tag_mark = token.start_mark - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } - } else if token.token_type == yaml_TAG_TOKEN { - tag_handle = token.value - tag_suffix = token.suffix - start_mark, tag_mark = token.start_mark, token.start_mark - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.token_type == yaml_ANCHOR_TOKEN { - anchor = token.value - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - - } - } - - var tag []byte - if tag_handle != nil { - if len(tag_handle) == 0 { - tag = tag_suffix - tag_handle = nil - tag_suffix = nil - } else { - for i := range parser.tag_directives { - tag_directive := &parser.tag_directives[i] - if bytes.Equal(tag_directive.handle, tag_handle) { - tag = append([]byte(nil), tag_directive.prefix...) - tag = append(tag, tag_suffix...) - tag_handle = nil - tag_suffix = nil - break - } - } - if len(tag) == 0 { - yaml_parser_set_parser_error_context(parser, - "while parsing a node", start_mark, - "found undefined tag handle", tag_mark) - return false - } - } - } - - implicit := len(tag) == 0 - if indentless_sequence && token.token_type == yaml_BLOCK_ENTRY_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE - - *event = yaml_event_t{ - event_type: yaml_SEQUENCE_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE), - } - - return true - } else { - if token.token_type == yaml_SCALAR_TOKEN { - plain_implicit := false - quoted_implicit := false - end_mark = token.end_mark - if (token.style == yaml_PLAIN_SCALAR_STYLE && len(tag) == 0) || - (len(tag) == 1 && tag[0] == '!') { - plain_implicit = true - } else if len(tag) == 0 { - quoted_implicit = true - } - - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - - *event = yaml_event_t{ - event_type: yaml_SCALAR_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - value: token.value, - implicit: plain_implicit, - quoted_implicit: quoted_implicit, - style: yaml_style_t(token.style), - } - - skip_token(parser) - return true - } else if token.token_type == yaml_FLOW_SEQUENCE_START_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE - - *event = yaml_event_t{ - event_type: yaml_SEQUENCE_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_FLOW_SEQUENCE_STYLE), - } - - return true - } else if token.token_type == yaml_FLOW_MAPPING_START_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE - - *event = yaml_event_t{ - event_type: yaml_MAPPING_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_FLOW_MAPPING_STYLE), - } - - return true - } else if block && token.token_type == yaml_BLOCK_SEQUENCE_START_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE - - *event = yaml_event_t{ - event_type: yaml_SEQUENCE_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE), - } - - return true - } else if block && token.token_type == yaml_BLOCK_MAPPING_START_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE - - *event = yaml_event_t{ - event_type: yaml_MAPPING_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_BLOCK_MAPPING_STYLE), - } - return true - } else if len(anchor) > 0 || len(tag) > 0 { - - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - - *event = yaml_event_t{ - event_type: yaml_SCALAR_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - quoted_implicit: false, - style: yaml_style_t(yaml_PLAIN_SCALAR_STYLE), - } - return true - } else { - msg := "while parsing a block node" - if !block { - msg = "while parsing a flow node" - } - yaml_parser_set_parser_error_context(parser, msg, start_mark, - "did not find expected node content", token.start_mark) - return false - } - } - } - - return false -} - -/* - * Parse the productions: - * block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END - * ******************** *********** * ********* - */ - -func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, - event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - - token := peek_token(parser) - if token == nil { - return false - } - - if token.token_type == yaml_BLOCK_ENTRY_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.token_type != yaml_BLOCK_ENTRY_TOKEN && - token.token_type != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE) - return yaml_parser_parse_node(parser, event, true, false) - } else { - parser.state = yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - } else if token.token_type == yaml_BLOCK_END_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - - *event = yaml_event_t{ - event_type: yaml_SEQUENCE_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - - skip_token(parser) - return true - } else { - mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - - return yaml_parser_set_parser_error_context(parser, - "while parsing a block collection", mark, - "did not find expected '-' indicator", token.start_mark) - } -} - -/* - * Parse the productions: - * indentless_sequence ::= (BLOCK-ENTRY block_node?)+ - * *********** * - */ - -func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, - event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - - if token.token_type == yaml_BLOCK_ENTRY_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.token_type != yaml_BLOCK_ENTRY_TOKEN && - token.token_type != yaml_KEY_TOKEN && - token.token_type != yaml_VALUE_TOKEN && - token.token_type != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE) - return yaml_parser_parse_node(parser, event, true, false) - } else { - parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - } else { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - - *event = yaml_event_t{ - event_type: yaml_SEQUENCE_END_EVENT, - start_mark: token.start_mark, - end_mark: token.start_mark, - } - return true - } -} - -/* - * Parse the productions: - * block_mapping ::= BLOCK-MAPPING_START - * ******************* - * ((KEY block_node_or_indentless_sequence?)? - * *** * - * (VALUE block_node_or_indentless_sequence?)?)* - * - * BLOCK-END - * ********* - */ - -func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, - event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - - token := peek_token(parser) - if token == nil { - return false - } - - if token.token_type == yaml_KEY_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.token_type != yaml_KEY_TOKEN && - token.token_type != yaml_VALUE_TOKEN && - token.token_type != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_VALUE_STATE) - return yaml_parser_parse_node(parser, event, true, true) - } else { - parser.state = yaml_PARSE_BLOCK_MAPPING_VALUE_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - } else if token.token_type == yaml_BLOCK_END_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - *event = yaml_event_t{ - event_type: yaml_MAPPING_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - skip_token(parser) - return true - } else { - mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - - return yaml_parser_set_parser_error_context(parser, - "while parsing a block mapping", mark, - "did not find expected key", token.start_mark) - } -} - -/* - * Parse the productions: - * block_mapping ::= BLOCK-MAPPING_START - * - * ((KEY block_node_or_indentless_sequence?)? - * - * (VALUE block_node_or_indentless_sequence?)?)* - * ***** * - * BLOCK-END - * - */ - -func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, - event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - - if token.token_type == yaml_VALUE_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.token_type != yaml_KEY_TOKEN && - token.token_type != yaml_VALUE_TOKEN && - token.token_type != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_KEY_STATE) - return yaml_parser_parse_node(parser, event, true, true) - } else { - parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - } else { - parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) - } -} - -/* - * Parse the productions: - * flow_sequence ::= FLOW-SEQUENCE-START - * ******************* - * (flow_sequence_entry FLOW-ENTRY)* - * * ********** - * flow_sequence_entry? - * * - * FLOW-SEQUENCE-END - * ***************** - * flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * * - */ - -func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, - event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - - token := peek_token(parser) - if token == nil { - return false - } - - if token.token_type != yaml_FLOW_SEQUENCE_END_TOKEN { - if !first { - if token.token_type == yaml_FLOW_ENTRY_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } else { - mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - - return yaml_parser_set_parser_error_context(parser, - "while parsing a flow sequence", mark, - "did not find expected ',' or ']'", token.start_mark) - } - } - - if token.token_type == yaml_KEY_TOKEN { - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE - *event = yaml_event_t{ - event_type: yaml_MAPPING_START_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - implicit: true, - style: yaml_style_t(yaml_FLOW_MAPPING_STYLE), - } - - skip_token(parser) - return true - } else if token.token_type != yaml_FLOW_SEQUENCE_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - - *event = yaml_event_t{ - event_type: yaml_SEQUENCE_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - - skip_token(parser) - return true -} - -/* - * Parse the productions: - * flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * *** * - */ - -func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, - event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - - if token.token_type != yaml_VALUE_TOKEN && - token.token_type != yaml_FLOW_ENTRY_TOKEN && - token.token_type != yaml_FLOW_SEQUENCE_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } else { - mark := token.end_mark - skip_token(parser) - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } -} - -/* - * Parse the productions: - * flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * ***** * - */ - -func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, - event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - - if token.token_type == yaml_VALUE_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.token_type != yaml_FLOW_ENTRY_TOKEN && - token.token_type != yaml_FLOW_SEQUENCE_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) -} - -/* - * Parse the productions: - * flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * * - */ - -func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, - event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE - *event = yaml_event_t{ - event_type: yaml_MAPPING_END_EVENT, - start_mark: token.start_mark, - end_mark: token.start_mark, - } - - return true -} - -/* - * Parse the productions: - * flow_mapping ::= FLOW-MAPPING-START - * ****************** - * (flow_mapping_entry FLOW-ENTRY)* - * * ********** - * flow_mapping_entry? - * ****************** - * FLOW-MAPPING-END - * **************** - * flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * * *** * - */ - -func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, - event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - - token := peek_token(parser) - if token == nil { - return false - } - - if token.token_type != yaml_FLOW_MAPPING_END_TOKEN { - if !first { - if token.token_type == yaml_FLOW_ENTRY_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } else { - mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - - return yaml_parser_set_parser_error_context(parser, - "while parsing a flow mapping", mark, - "did not find expected ',' or '}'", token.start_mark) - } - } - - if token.token_type == yaml_KEY_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.token_type != yaml_VALUE_TOKEN && - token.token_type != yaml_FLOW_ENTRY_TOKEN && - token.token_type != yaml_FLOW_MAPPING_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_VALUE_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } else { - parser.state = yaml_PARSE_FLOW_MAPPING_VALUE_STATE - return yaml_parser_process_empty_scalar(parser, event, - token.start_mark) - } - } else if token.token_type != yaml_FLOW_MAPPING_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - *event = yaml_event_t{ - event_type: yaml_MAPPING_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - - skip_token(parser) - return true -} - -/* - * Parse the productions: - * flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * * ***** * - */ - -func yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, - event *yaml_event_t, empty bool) bool { - token := peek_token(parser) - if token == nil { - return false - } - - if empty { - parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, - token.start_mark) - } - - if token.token_type == yaml_VALUE_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.token_type != yaml_FLOW_ENTRY_TOKEN && - token.token_type != yaml_FLOW_MAPPING_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_KEY_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - - parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) -} - -/* - * Generate an empty scalar event. - */ - -func yaml_parser_process_empty_scalar(parser *yaml_parser_t, event *yaml_event_t, - mark YAML_mark_t) bool { - *event = yaml_event_t{ - event_type: yaml_SCALAR_EVENT, - start_mark: mark, - end_mark: mark, - value: nil, - implicit: true, - style: yaml_style_t(yaml_PLAIN_SCALAR_STYLE), - } - - return true -} - -/* - * Parse directives. - */ - -func yaml_parser_process_directives(parser *yaml_parser_t, - version_directive_ref **yaml_version_directive_t, - tag_directives_ref *[]yaml_tag_directive_t) bool { - - token := peek_token(parser) - if token == nil { - return false - } - - var version_directive *yaml_version_directive_t - var tag_directives []yaml_tag_directive_t - - for token.token_type == yaml_VERSION_DIRECTIVE_TOKEN || - token.token_type == yaml_TAG_DIRECTIVE_TOKEN { - if token.token_type == yaml_VERSION_DIRECTIVE_TOKEN { - if version_directive != nil { - yaml_parser_set_parser_error(parser, - "found duplicate %YAML directive", token.start_mark) - return false - } - if token.major != 1 || - token.minor != 1 { - yaml_parser_set_parser_error(parser, - "found incompatible YAML document", token.start_mark) - return false - } - version_directive = &yaml_version_directive_t{ - major: token.major, - minor: token.minor, - } - } else if token.token_type == yaml_TAG_DIRECTIVE_TOKEN { - value := yaml_tag_directive_t{ - handle: token.value, - prefix: token.prefix, - } - - if !yaml_parser_append_tag_directive(parser, value, false, - token.start_mark) { - return false - } - tag_directives = append(tag_directives, value) - } - - skip_token(parser) - token := peek_token(parser) - if token == nil { - return false - } - } - - for i := range default_tag_directives { - if !yaml_parser_append_tag_directive(parser, default_tag_directives[i], true, token.start_mark) { - return false - } - } - - if version_directive_ref != nil { - *version_directive_ref = version_directive - } - if tag_directives_ref != nil { - *tag_directives_ref = tag_directives - } - - return true -} - -/* - * Append a tag directive to the directives stack. - */ - -func yaml_parser_append_tag_directive(parser *yaml_parser_t, - value yaml_tag_directive_t, allow_duplicates bool, mark YAML_mark_t) bool { - for i := range parser.tag_directives { - tag := &parser.tag_directives[i] - if bytes.Equal(value.handle, tag.handle) { - if allow_duplicates { - return true - } - return yaml_parser_set_parser_error(parser, "found duplicate %TAG directive", mark) - } - } - - parser.tag_directives = append(parser.tag_directives, value) - return true -} diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/reader.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/reader.go deleted file mode 100644 index 5631da2dc..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/reader.go +++ /dev/null @@ -1,465 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -import ( - "io" -) - -/* - * Set the reader error and return 0. - */ - -func yaml_parser_set_reader_error(parser *yaml_parser_t, problem string, - offset int, value int) bool { - parser.error = yaml_READER_ERROR - parser.problem = problem - parser.problem_offset = offset - parser.problem_value = value - - return false -} - -/* - * Byte order marks. - */ -const ( - BOM_UTF8 = "\xef\xbb\xbf" - BOM_UTF16LE = "\xff\xfe" - BOM_UTF16BE = "\xfe\xff" -) - -/* - * Determine the input stream encoding by checking the BOM symbol. If no BOM is - * found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure. - */ - -func yaml_parser_determine_encoding(parser *yaml_parser_t) bool { - /* Ensure that we had enough bytes in the raw buffer. */ - for !parser.eof && - len(parser.raw_buffer)-parser.raw_buffer_pos < 3 { - if !yaml_parser_update_raw_buffer(parser) { - return false - } - } - - /* Determine the encoding. */ - raw := parser.raw_buffer - pos := parser.raw_buffer_pos - remaining := len(raw) - pos - if remaining >= 2 && - raw[pos] == BOM_UTF16LE[0] && raw[pos+1] == BOM_UTF16LE[1] { - parser.encoding = yaml_UTF16LE_ENCODING - parser.raw_buffer_pos += 2 - parser.offset += 2 - } else if remaining >= 2 && - raw[pos] == BOM_UTF16BE[0] && raw[pos+1] == BOM_UTF16BE[1] { - parser.encoding = yaml_UTF16BE_ENCODING - parser.raw_buffer_pos += 2 - parser.offset += 2 - } else if remaining >= 3 && - raw[pos] == BOM_UTF8[0] && raw[pos+1] == BOM_UTF8[1] && raw[pos+2] == BOM_UTF8[2] { - parser.encoding = yaml_UTF8_ENCODING - parser.raw_buffer_pos += 3 - parser.offset += 3 - } else { - parser.encoding = yaml_UTF8_ENCODING - } - - return true -} - -/* - * Update the raw buffer. - */ - -func yaml_parser_update_raw_buffer(parser *yaml_parser_t) bool { - size_read := 0 - - /* Return if the raw buffer is full. */ - if parser.raw_buffer_pos == 0 && len(parser.raw_buffer) == cap(parser.raw_buffer) { - return true - } - - /* Return on EOF. */ - - if parser.eof { - return true - } - - /* Move the remaining bytes in the raw buffer to the beginning. */ - if parser.raw_buffer_pos > 0 && parser.raw_buffer_pos < len(parser.raw_buffer) { - copy(parser.raw_buffer, parser.raw_buffer[parser.raw_buffer_pos:]) - } - parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)-parser.raw_buffer_pos] - parser.raw_buffer_pos = 0 - - /* Call the read handler to fill the buffer. */ - size_read, err := parser.read_handler(parser, - parser.raw_buffer[len(parser.raw_buffer):cap(parser.raw_buffer)]) - parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)+size_read] - - if err == io.EOF { - parser.eof = true - } else if err != nil { - return yaml_parser_set_reader_error(parser, "input error: "+err.Error(), - parser.offset, -1) - } - - return true -} - -/* - * Ensure that the buffer contains at least `length` characters. - * Return 1 on success, 0 on failure. - * - * The length is supposed to be significantly less that the buffer size. - */ - -func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { - /* Read handler must be set. */ - if parser.read_handler == nil { - panic("read handler must be set") - } - - /* If the EOF flag is set and the raw buffer is empty, do nothing. */ - - if parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) { - return true - } - - /* Return if the buffer contains enough characters. */ - - if parser.unread >= length { - return true - } - - /* Determine the input encoding if it is not known yet. */ - - if parser.encoding == yaml_ANY_ENCODING { - if !yaml_parser_determine_encoding(parser) { - return false - } - } - - /* Move the unread characters to the beginning of the buffer. */ - buffer_end := len(parser.buffer) - if 0 < parser.buffer_pos && - parser.buffer_pos < buffer_end { - copy(parser.buffer, parser.buffer[parser.buffer_pos:]) - buffer_end -= parser.buffer_pos - parser.buffer_pos = 0 - } else if parser.buffer_pos == buffer_end { - buffer_end = 0 - parser.buffer_pos = 0 - } - - parser.buffer = parser.buffer[:cap(parser.buffer)] - - /* Fill the buffer until it has enough characters. */ - first := true - for parser.unread < length { - /* Fill the raw buffer if necessary. */ - - if !first || parser.raw_buffer_pos == len(parser.raw_buffer) { - if !yaml_parser_update_raw_buffer(parser) { - parser.buffer = parser.buffer[:buffer_end] - return false - } - } - first = false - - /* Decode the raw buffer. */ - for parser.raw_buffer_pos != len(parser.raw_buffer) { - var value rune - var w int - - raw_unread := len(parser.raw_buffer) - parser.raw_buffer_pos - incomplete := false - - /* Decode the next character. */ - - switch parser.encoding { - case yaml_UTF8_ENCODING: - - /* - * Decode a UTF-8 character. Check RFC 3629 - * (http://www.ietf.org/rfc/rfc3629.txt) for more details. - * - * The following table (taken from the RFC) is used for - * decoding. - * - * Char. number range | UTF-8 octet sequence - * (hexadecimal) | (binary) - * --------------------+------------------------------------ - * 0000 0000-0000 007F | 0xxxxxxx - * 0000 0080-0000 07FF | 110xxxxx 10xxxxxx - * 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx - * 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - * - * Additionally, the characters in the range 0xD800-0xDFFF - * are prohibited as they are reserved for use with UTF-16 - * surrogate pairs. - */ - - /* Determine the length of the UTF-8 sequence. */ - - octet := parser.raw_buffer[parser.raw_buffer_pos] - w = width(octet) - - /* Check if the leading octet is valid. */ - - if w == 0 { - return yaml_parser_set_reader_error(parser, - "invalid leading UTF-8 octet", - parser.offset, int(octet)) - } - - /* Check if the raw buffer contains an incomplete character. */ - - if w > raw_unread { - if parser.eof { - return yaml_parser_set_reader_error(parser, - "incomplete UTF-8 octet sequence", - parser.offset, -1) - } - incomplete = true - break - } - - /* Decode the leading octet. */ - switch { - case octet&0x80 == 0x00: - value = rune(octet & 0x7F) - case octet&0xE0 == 0xC0: - value = rune(octet & 0x1F) - case octet&0xF0 == 0xE0: - value = rune(octet & 0x0F) - case octet&0xF8 == 0xF0: - value = rune(octet & 0x07) - default: - value = 0 - } - - /* Check and decode the trailing octets. */ - - for k := 1; k < w; k++ { - octet = parser.raw_buffer[parser.raw_buffer_pos+k] - - /* Check if the octet is valid. */ - - if (octet & 0xC0) != 0x80 { - return yaml_parser_set_reader_error(parser, - "invalid trailing UTF-8 octet", - parser.offset+k, int(octet)) - } - - /* Decode the octet. */ - - value = (value << 6) + rune(octet&0x3F) - } - - /* Check the length of the sequence against the value. */ - switch { - case w == 1: - case w == 2 && value >= 0x80: - case w == 3 && value >= 0x800: - case w == 4 && value >= 0x10000: - default: - return yaml_parser_set_reader_error(parser, - "invalid length of a UTF-8 sequence", - parser.offset, -1) - } - - /* Check the range of the value. */ - - if (value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF { - return yaml_parser_set_reader_error(parser, - "invalid Unicode character", - parser.offset, int(value)) - } - case yaml_UTF16LE_ENCODING, - yaml_UTF16BE_ENCODING: - - var low, high int - if parser.encoding == yaml_UTF16LE_ENCODING { - low, high = 0, 1 - } else { - high, low = 1, 0 - } - - /* - * The UTF-16 encoding is not as simple as one might - * naively think. Check RFC 2781 - * (http://www.ietf.org/rfc/rfc2781.txt). - * - * Normally, two subsequent bytes describe a Unicode - * character. However a special technique (called a - * surrogate pair) is used for specifying character - * values larger than 0xFFFF. - * - * A surrogate pair consists of two pseudo-characters: - * high surrogate area (0xD800-0xDBFF) - * low surrogate area (0xDC00-0xDFFF) - * - * The following formulas are used for decoding - * and encoding characters using surrogate pairs: - * - * U = U' + 0x10000 (0x01 00 00 <= U <= 0x10 FF FF) - * U' = yyyyyyyyyyxxxxxxxxxx (0 <= U' <= 0x0F FF FF) - * W1 = 110110yyyyyyyyyy - * W2 = 110111xxxxxxxxxx - * - * where U is the character value, W1 is the high surrogate - * area, W2 is the low surrogate area. - */ - - /* Check for incomplete UTF-16 character. */ - - if raw_unread < 2 { - if parser.eof { - return yaml_parser_set_reader_error(parser, - "incomplete UTF-16 character", - parser.offset, -1) - } - incomplete = true - break - } - - /* Get the character. */ - value = rune(parser.raw_buffer[parser.raw_buffer_pos+low]) + - (rune(parser.raw_buffer[parser.raw_buffer_pos+high]) << 8) - - /* Check for unexpected low surrogate area. */ - - if (value & 0xFC00) == 0xDC00 { - return yaml_parser_set_reader_error(parser, - "unexpected low surrogate area", - parser.offset, int(value)) - } - - /* Check for a high surrogate area. */ - - if (value & 0xFC00) == 0xD800 { - - w = 4 - - /* Check for incomplete surrogate pair. */ - - if raw_unread < 4 { - if parser.eof { - return yaml_parser_set_reader_error(parser, - "incomplete UTF-16 surrogate pair", - parser.offset, -1) - } - incomplete = true - break - } - - /* Get the next character. */ - - value2 := rune(parser.raw_buffer[parser.raw_buffer_pos+low+2]) + - (rune(parser.raw_buffer[parser.raw_buffer_pos+high+2]) << 8) - - /* Check for a low surrogate area. */ - - if (value2 & 0xFC00) != 0xDC00 { - return yaml_parser_set_reader_error(parser, - "expected low surrogate area", - parser.offset+2, int(value2)) - } - - /* Generate the value of the surrogate pair. */ - - value = 0x10000 + ((value & 0x3FF) << 10) + (value2 & 0x3FF) - } else { - w = 2 - } - - break - - default: - panic("Impossible") /* Impossible. */ - } - - /* Check if the raw buffer contains enough bytes to form a character. */ - - if incomplete { - break - } - - /* - * Check if the character is in the allowed range: - * #x9 | #xA | #xD | [#x20-#x7E] (8 bit) - * | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD] (16 bit) - * | [#x10000-#x10FFFF] (32 bit) - */ - - if !(value == 0x09 || value == 0x0A || value == 0x0D || - (value >= 0x20 && value <= 0x7E) || - (value == 0x85) || (value >= 0xA0 && value <= 0xD7FF) || - (value >= 0xE000 && value <= 0xFFFD) || - (value >= 0x10000 && value <= 0x10FFFF)) { - return yaml_parser_set_reader_error(parser, - "control characters are not allowed", - parser.offset, int(value)) - } - - /* Move the raw pointers. */ - - parser.raw_buffer_pos += w - parser.offset += w - - /* Finally put the character into the buffer. */ - - /* 0000 0000-0000 007F . 0xxxxxxx */ - if value <= 0x7F { - parser.buffer[buffer_end] = byte(value) - } else if value <= 0x7FF { - /* 0000 0080-0000 07FF . 110xxxxx 10xxxxxx */ - parser.buffer[buffer_end] = byte(0xC0 + (value >> 6)) - parser.buffer[buffer_end+1] = byte(0x80 + (value & 0x3F)) - } else if value <= 0xFFFF { - /* 0000 0800-0000 FFFF . 1110xxxx 10xxxxxx 10xxxxxx */ - parser.buffer[buffer_end] = byte(0xE0 + (value >> 12)) - parser.buffer[buffer_end+1] = byte(0x80 + ((value >> 6) & 0x3F)) - parser.buffer[buffer_end+2] = byte(0x80 + (value & 0x3F)) - } else { - /* 0001 0000-0010 FFFF . 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ - parser.buffer[buffer_end] = byte(0xF0 + (value >> 18)) - parser.buffer[buffer_end+1] = byte(0x80 + ((value >> 12) & 0x3F)) - parser.buffer[buffer_end+2] = byte(0x80 + ((value >> 6) & 0x3F)) - parser.buffer[buffer_end+3] = byte(0x80 + (value & 0x3F)) - } - - buffer_end += w - parser.unread++ - } - - /* On EOF, put NUL into the buffer and return. */ - - if parser.eof { - parser.buffer[buffer_end] = 0 - buffer_end++ - parser.buffer = parser.buffer[:buffer_end] - parser.unread++ - return true - } - - } - - parser.buffer = parser.buffer[:buffer_end] - return true -} diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/resolver.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/resolver.go deleted file mode 100644 index fb9e8be89..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/resolver.go +++ /dev/null @@ -1,449 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -import ( - "bytes" - "encoding/base64" - "fmt" - "math" - "reflect" - "regexp" - "strconv" - "strings" - "time" -) - -var byteSliceType = reflect.TypeOf([]byte(nil)) - -var binary_tags = [][]byte{[]byte("!binary"), []byte(yaml_BINARY_TAG)} -var bool_values map[string]bool -var null_values map[string]bool - -var signs = []byte{'-', '+'} -var nulls = []byte{'~', 'n', 'N'} -var bools = []byte{'t', 'T', 'f', 'F', 'y', 'Y', 'n', 'N', 'o', 'O'} - -var timestamp_regexp *regexp.Regexp -var ymd_regexp *regexp.Regexp - -func init() { - bool_values = make(map[string]bool) - bool_values["y"] = true - bool_values["yes"] = true - bool_values["n"] = false - bool_values["no"] = false - bool_values["true"] = true - bool_values["false"] = false - bool_values["on"] = true - bool_values["off"] = false - - null_values = make(map[string]bool) - null_values["~"] = true - null_values["null"] = true - null_values["Null"] = true - null_values["NULL"] = true - - timestamp_regexp = regexp.MustCompile("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \t]*(?:Z|([-+][0-9][0-9]?)(?::([0-9][0-9])?)?))?)?$") - ymd_regexp = regexp.MustCompile("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)$") -} - -func resolve(event yaml_event_t, v reflect.Value, useNumber bool) (string, error) { - val := string(event.value) - - if null_values[val] { - v.Set(reflect.Zero(v.Type())) - return yaml_NULL_TAG, nil - } - - switch v.Kind() { - case reflect.String: - if useNumber && v.Type() == numberType { - tag, i := resolveInterface(event, useNumber) - if n, ok := i.(Number); ok { - v.Set(reflect.ValueOf(n)) - return tag, nil - } - return "", fmt.Errorf("Not a number: '%s' at %s", event.value, event.start_mark) - } - - return resolve_string(val, v, event) - case reflect.Bool: - return resolve_bool(val, v, event) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return resolve_int(val, v, useNumber, event) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return resolve_uint(val, v, useNumber, event) - case reflect.Float32, reflect.Float64: - return resolve_float(val, v, useNumber, event) - case reflect.Interface: - _, i := resolveInterface(event, useNumber) - if i != nil { - v.Set(reflect.ValueOf(i)) - } else { - v.Set(reflect.Zero(v.Type())) - } - - case reflect.Struct: - return resolve_time(val, v, event) - case reflect.Slice: - if v.Type() != byteSliceType { - return "", fmt.Errorf("Cannot resolve %s into %s at %s", val, v.String(), event.start_mark) - } - b, err := decode_binary(event.value, event) - if err != nil { - return "", err - } - - v.Set(reflect.ValueOf(b)) - default: - return "", fmt.Errorf("Unknown resolution for '%s' using %s at %s", val, v.String(), event.start_mark) - } - - return yaml_STR_TAG, nil -} - -func hasBinaryTag(event yaml_event_t) bool { - for _, tag := range binary_tags { - if bytes.Equal(event.tag, tag) { - return true - } - } - return false -} - -func decode_binary(value []byte, event yaml_event_t) ([]byte, error) { - b := make([]byte, base64.StdEncoding.DecodedLen(len(value))) - n, err := base64.StdEncoding.Decode(b, value) - if err != nil { - return nil, fmt.Errorf("Invalid base64 text: '%s' at %s", string(b), event.start_mark) - } - return b[:n], nil -} - -func resolve_string(val string, v reflect.Value, event yaml_event_t) (string, error) { - if len(event.tag) > 0 { - if hasBinaryTag(event) { - b, err := decode_binary(event.value, event) - if err != nil { - return "", err - } - val = string(b) - } - } - v.SetString(val) - return yaml_STR_TAG, nil -} - -func resolve_bool(val string, v reflect.Value, event yaml_event_t) (string, error) { - b, found := bool_values[strings.ToLower(val)] - if !found { - return "", fmt.Errorf("Invalid boolean: '%s' at %s", val, event.start_mark) - } - - v.SetBool(b) - return yaml_BOOL_TAG, nil -} - -func resolve_int(val string, v reflect.Value, useNumber bool, event yaml_event_t) (string, error) { - original := val - val = strings.Replace(val, "_", "", -1) - var value uint64 - - isNumberValue := v.Type() == numberType - - sign := int64(1) - if val[0] == '-' { - sign = -1 - val = val[1:] - } else if val[0] == '+' { - val = val[1:] - } - - base := 0 - if val == "0" { - if isNumberValue { - v.SetString("0") - } else { - v.Set(reflect.Zero(v.Type())) - } - - return yaml_INT_TAG, nil - } - - if strings.HasPrefix(val, "0o") { - base = 8 - val = val[2:] - } - - value, err := strconv.ParseUint(val, base, 64) - if err != nil { - return "", fmt.Errorf("Invalid integer: '%s' at %s", original, event.start_mark) - } - - var val64 int64 - if value <= math.MaxInt64 { - val64 = int64(value) - if sign == -1 { - val64 = -val64 - } - } else if sign == -1 && value == uint64(math.MaxInt64)+1 { - val64 = math.MinInt64 - } else { - return "", fmt.Errorf("Invalid integer: '%s' at %s", original, event.start_mark) - } - - if isNumberValue { - v.SetString(strconv.FormatInt(val64, 10)) - } else { - if v.OverflowInt(val64) { - return "", fmt.Errorf("Invalid integer: '%s' at %s", original, event.start_mark) - } - v.SetInt(val64) - } - - return yaml_INT_TAG, nil -} - -func resolve_uint(val string, v reflect.Value, useNumber bool, event yaml_event_t) (string, error) { - original := val - val = strings.Replace(val, "_", "", -1) - var value uint64 - - isNumberValue := v.Type() == numberType - - if val[0] == '-' { - return "", fmt.Errorf("Unsigned int with negative value: '%s' at %s", original, event.start_mark) - } - - if val[0] == '+' { - val = val[1:] - } - - base := 0 - if val == "0" { - if isNumberValue { - v.SetString("0") - } else { - v.Set(reflect.Zero(v.Type())) - } - - return yaml_INT_TAG, nil - } - - if strings.HasPrefix(val, "0o") { - base = 8 - val = val[2:] - } - - value, err := strconv.ParseUint(val, base, 64) - if err != nil { - return "", fmt.Errorf("Invalid unsigned integer: '%s' at %s", val, event.start_mark) - } - - if isNumberValue { - v.SetString(strconv.FormatUint(value, 10)) - } else { - if v.OverflowUint(value) { - return "", fmt.Errorf("Invalid unsigned integer: '%s' at %s", val, event.start_mark) - } - - v.SetUint(value) - } - - return yaml_INT_TAG, nil -} - -func resolve_float(val string, v reflect.Value, useNumber bool, event yaml_event_t) (string, error) { - val = strings.Replace(val, "_", "", -1) - var value float64 - - isNumberValue := v.Type() == numberType - typeBits := 64 - if !isNumberValue { - typeBits = v.Type().Bits() - } - - sign := 1 - if val[0] == '-' { - sign = -1 - val = val[1:] - } else if val[0] == '+' { - val = val[1:] - } - - valLower := strings.ToLower(val) - if valLower == ".inf" { - value = math.Inf(sign) - } else if valLower == ".nan" { - value = math.NaN() - } else { - var err error - value, err = strconv.ParseFloat(val, typeBits) - value *= float64(sign) - - if err != nil { - return "", fmt.Errorf("Invalid float: '%s' at %s", val, event.start_mark) - } - } - - if isNumberValue { - v.SetString(strconv.FormatFloat(value, 'g', -1, typeBits)) - } else { - if v.OverflowFloat(value) { - return "", fmt.Errorf("Invalid float: '%s' at %s", val, event.start_mark) - } - - v.SetFloat(value) - } - - return yaml_FLOAT_TAG, nil -} - -func resolve_time(val string, v reflect.Value, event yaml_event_t) (string, error) { - var parsedTime time.Time - matches := ymd_regexp.FindStringSubmatch(val) - if len(matches) > 0 { - year, _ := strconv.Atoi(matches[1]) - month, _ := strconv.Atoi(matches[2]) - day, _ := strconv.Atoi(matches[3]) - parsedTime = time.Date(year, time.Month(month), day, 0, 0, 0, 0, time.UTC) - } else { - matches = timestamp_regexp.FindStringSubmatch(val) - if len(matches) == 0 { - return "", fmt.Errorf("Invalid timestamp: '%s' at %s", val, event.start_mark) - } - - year, _ := strconv.Atoi(matches[1]) - month, _ := strconv.Atoi(matches[2]) - day, _ := strconv.Atoi(matches[3]) - hour, _ := strconv.Atoi(matches[4]) - min, _ := strconv.Atoi(matches[5]) - sec, _ := strconv.Atoi(matches[6]) - - nsec := 0 - if matches[7] != "" { - millis, _ := strconv.Atoi(matches[7]) - nsec = int(time.Duration(millis) * time.Millisecond) - } - - loc := time.UTC - if matches[8] != "" { - sign := matches[8][0] - hr, _ := strconv.Atoi(matches[8][1:]) - min := 0 - if matches[9] != "" { - min, _ = strconv.Atoi(matches[9]) - } - - zoneOffset := (hr*60 + min) * 60 - if sign == '-' { - zoneOffset = -zoneOffset - } - - loc = time.FixedZone("", zoneOffset) - } - parsedTime = time.Date(year, time.Month(month), day, hour, min, sec, nsec, loc) - } - - v.Set(reflect.ValueOf(parsedTime)) - return "", nil -} - -func resolveInterface(event yaml_event_t, useNumber bool) (string, interface{}) { - val := string(event.value) - if len(event.tag) == 0 && !event.implicit { - return "", val - } - - if len(val) == 0 { - return yaml_NULL_TAG, nil - } - - var result interface{} - - sign := false - c := val[0] - switch { - case bytes.IndexByte(signs, c) != -1: - sign = true - fallthrough - case c >= '0' && c <= '9': - i := int64(0) - result = &i - if useNumber { - var n Number - result = &n - } - - v := reflect.ValueOf(result).Elem() - if _, err := resolve_int(val, v, useNumber, event); err == nil { - return yaml_INT_TAG, v.Interface() - } - - f := float64(0) - result = &f - if useNumber { - var n Number - result = &n - } - - v = reflect.ValueOf(result).Elem() - if _, err := resolve_float(val, v, useNumber, event); err == nil { - return yaml_FLOAT_TAG, v.Interface() - } - - if !sign { - t := time.Time{} - if _, err := resolve_time(val, reflect.ValueOf(&t).Elem(), event); err == nil { - return "", t - } - } - case bytes.IndexByte(nulls, c) != -1: - if null_values[val] { - return yaml_NULL_TAG, nil - } - b := false - if _, err := resolve_bool(val, reflect.ValueOf(&b).Elem(), event); err == nil { - return yaml_BOOL_TAG, b - } - case c == '.': - f := float64(0) - result = &f - if useNumber { - var n Number - result = &n - } - - v := reflect.ValueOf(result).Elem() - if _, err := resolve_float(val, v, useNumber, event); err == nil { - return yaml_FLOAT_TAG, v.Interface() - } - case bytes.IndexByte(bools, c) != -1: - b := false - if _, err := resolve_bool(val, reflect.ValueOf(&b).Elem(), event); err == nil { - return yaml_BOOL_TAG, b - } - } - - if hasBinaryTag(event) { - bytes, err := decode_binary(event.value, event) - if err == nil { - return yaml_BINARY_TAG, bytes - } - } - - return yaml_STR_TAG, val -} diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/run_parser.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/run_parser.go deleted file mode 100644 index 25c29816e..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/run_parser.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -import ( - "fmt" - "os" -) - -func Run_parser(cmd string, args []string) { - for i := 0; i < len(args); i++ { - fmt.Printf("[%d] Scanning '%s'", i, args[i]) - file, err := os.Open(args[i]) - if err != nil { - panic(fmt.Sprintf("Invalid file '%s': %s", args[i], err.Error())) - } - - parser := yaml_parser_t{} - yaml_parser_initialize(&parser) - yaml_parser_set_input_reader(&parser, file) - - failed := false - token := yaml_token_t{} - count := 0 - for { - if !yaml_parser_scan(&parser, &token) { - failed = true - break - } - - if token.token_type == yaml_STREAM_END_TOKEN { - break - } - count++ - } - - file.Close() - - msg := "SUCCESS" - if failed { - msg = "FAILED" - if parser.error != yaml_NO_ERROR { - m := parser.problem_mark - fmt.Printf("ERROR: (%s) %s @ line: %d col: %d\n", - parser.context, parser.problem, m.line, m.column) - } - } - fmt.Printf("%s (%d tokens)\n", msg, count) - } -} diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/scanner.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/scanner.go deleted file mode 100644 index 5c080a063..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/scanner.go +++ /dev/null @@ -1,3318 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -import ( - "bytes" -) - -/* - * Introduction - * ************ - * - * The following notes assume that you are familiar with the YAML specification - * (http://yaml.org/spec/cvs/current.html). We mostly follow it, although in - * some cases we are less restrictive that it requires. - * - * The process of transforming a YAML stream into a sequence of events is - * divided on two steps: Scanning and Parsing. - * - * The Scanner transforms the input stream into a sequence of tokens, while the - * parser transform the sequence of tokens produced by the Scanner into a - * sequence of parsing events. - * - * The Scanner is rather clever and complicated. The Parser, on the contrary, - * is a straightforward implementation of a recursive-descendant parser (or, - * LL(1) parser, as it is usually called). - * - * Actually there are two issues of Scanning that might be called "clever", the - * rest is quite straightforward. The issues are "block collection start" and - * "simple keys". Both issues are explained below in details. - * - * Here the Scanning step is explained and implemented. We start with the list - * of all the tokens produced by the Scanner together with short descriptions. - * - * Now, tokens: - * - * STREAM-START(encoding) # The stream start. - * STREAM-END # The stream end. - * VERSION-DIRECTIVE(major,minor) # The '%YAML' directive. - * TAG-DIRECTIVE(handle,prefix) # The '%TAG' directive. - * DOCUMENT-START # '---' - * DOCUMENT-END # '...' - * BLOCK-SEQUENCE-START # Indentation increase denoting a block - * BLOCK-MAPPING-START # sequence or a block mapping. - * BLOCK-END # Indentation decrease. - * FLOW-SEQUENCE-START # '[' - * FLOW-SEQUENCE-END # ']' - * BLOCK-SEQUENCE-START # '{' - * BLOCK-SEQUENCE-END # '}' - * BLOCK-ENTRY # '-' - * FLOW-ENTRY # ',' - * KEY # '?' or nothing (simple keys). - * VALUE # ':' - * ALIAS(anchor) # '*anchor' - * ANCHOR(anchor) # '&anchor' - * TAG(handle,suffix) # '!handle!suffix' - * SCALAR(value,style) # A scalar. - * - * The following two tokens are "virtual" tokens denoting the beginning and the - * end of the stream: - * - * STREAM-START(encoding) - * STREAM-END - * - * We pass the information about the input stream encoding with the - * STREAM-START token. - * - * The next two tokens are responsible for tags: - * - * VERSION-DIRECTIVE(major,minor) - * TAG-DIRECTIVE(handle,prefix) - * - * Example: - * - * %YAML 1.1 - * %TAG ! !foo - * %TAG !yaml! tag:yaml.org,2002: - * --- - * - * The correspoding sequence of tokens: - * - * STREAM-START(utf-8) - * VERSION-DIRECTIVE(1,1) - * TAG-DIRECTIVE("!","!foo") - * TAG-DIRECTIVE("!yaml","tag:yaml.org,2002:") - * DOCUMENT-START - * STREAM-END - * - * Note that the VERSION-DIRECTIVE and TAG-DIRECTIVE tokens occupy a whole - * line. - * - * The document start and end indicators are represented by: - * - * DOCUMENT-START - * DOCUMENT-END - * - * Note that if a YAML stream contains an implicit document (without '---' - * and '...' indicators), no DOCUMENT-START and DOCUMENT-END tokens will be - * produced. - * - * In the following examples, we present whole documents together with the - * produced tokens. - * - * 1. An implicit document: - * - * 'a scalar' - * - * Tokens: - * - * STREAM-START(utf-8) - * SCALAR("a scalar",single-quoted) - * STREAM-END - * - * 2. An explicit document: - * - * --- - * 'a scalar' - * ... - * - * Tokens: - * - * STREAM-START(utf-8) - * DOCUMENT-START - * SCALAR("a scalar",single-quoted) - * DOCUMENT-END - * STREAM-END - * - * 3. Several documents in a stream: - * - * 'a scalar' - * --- - * 'another scalar' - * --- - * 'yet another scalar' - * - * Tokens: - * - * STREAM-START(utf-8) - * SCALAR("a scalar",single-quoted) - * DOCUMENT-START - * SCALAR("another scalar",single-quoted) - * DOCUMENT-START - * SCALAR("yet another scalar",single-quoted) - * STREAM-END - * - * We have already introduced the SCALAR token above. The following tokens are - * used to describe aliases, anchors, tag, and scalars: - * - * ALIAS(anchor) - * ANCHOR(anchor) - * TAG(handle,suffix) - * SCALAR(value,style) - * - * The following series of examples illustrate the usage of these tokens: - * - * 1. A recursive sequence: - * - * &A [ *A ] - * - * Tokens: - * - * STREAM-START(utf-8) - * ANCHOR("A") - * FLOW-SEQUENCE-START - * ALIAS("A") - * FLOW-SEQUENCE-END - * STREAM-END - * - * 2. A tagged scalar: - * - * !!float "3.14" # A good approximation. - * - * Tokens: - * - * STREAM-START(utf-8) - * TAG("!!","float") - * SCALAR("3.14",double-quoted) - * STREAM-END - * - * 3. Various scalar styles: - * - * --- # Implicit empty plain scalars do not produce tokens. - * --- a plain scalar - * --- 'a single-quoted scalar' - * --- "a double-quoted scalar" - * --- |- - * a literal scalar - * --- >- - * a folded - * scalar - * - * Tokens: - * - * STREAM-START(utf-8) - * DOCUMENT-START - * DOCUMENT-START - * SCALAR("a plain scalar",plain) - * DOCUMENT-START - * SCALAR("a single-quoted scalar",single-quoted) - * DOCUMENT-START - * SCALAR("a double-quoted scalar",double-quoted) - * DOCUMENT-START - * SCALAR("a literal scalar",literal) - * DOCUMENT-START - * SCALAR("a folded scalar",folded) - * STREAM-END - * - * Now it's time to review collection-related tokens. We will start with - * flow collections: - * - * FLOW-SEQUENCE-START - * FLOW-SEQUENCE-END - * FLOW-MAPPING-START - * FLOW-MAPPING-END - * FLOW-ENTRY - * KEY - * VALUE - * - * The tokens FLOW-SEQUENCE-START, FLOW-SEQUENCE-END, FLOW-MAPPING-START, and - * FLOW-MAPPING-END represent the indicators '[', ']', '{', and '}' - * correspondingly. FLOW-ENTRY represent the ',' indicator. Finally the - * indicators '?' and ':', which are used for denoting mapping keys and values, - * are represented by the KEY and VALUE tokens. - * - * The following examples show flow collections: - * - * 1. A flow sequence: - * - * [item 1, item 2, item 3] - * - * Tokens: - * - * STREAM-START(utf-8) - * FLOW-SEQUENCE-START - * SCALAR("item 1",plain) - * FLOW-ENTRY - * SCALAR("item 2",plain) - * FLOW-ENTRY - * SCALAR("item 3",plain) - * FLOW-SEQUENCE-END - * STREAM-END - * - * 2. A flow mapping: - * - * { - * a simple key: a value, # Note that the KEY token is produced. - * ? a complex key: another value, - * } - * - * Tokens: - * - * STREAM-START(utf-8) - * FLOW-MAPPING-START - * KEY - * SCALAR("a simple key",plain) - * VALUE - * SCALAR("a value",plain) - * FLOW-ENTRY - * KEY - * SCALAR("a complex key",plain) - * VALUE - * SCALAR("another value",plain) - * FLOW-ENTRY - * FLOW-MAPPING-END - * STREAM-END - * - * A simple key is a key which is not denoted by the '?' indicator. Note that - * the Scanner still produce the KEY token whenever it encounters a simple key. - * - * For scanning block collections, the following tokens are used (note that we - * repeat KEY and VALUE here): - * - * BLOCK-SEQUENCE-START - * BLOCK-MAPPING-START - * BLOCK-END - * BLOCK-ENTRY - * KEY - * VALUE - * - * The tokens BLOCK-SEQUENCE-START and BLOCK-MAPPING-START denote indentation - * increase that precedes a block collection (cf. the INDENT token in Python). - * The token BLOCK-END denote indentation decrease that ends a block collection - * (cf. the DEDENT token in Python). However YAML has some syntax pecularities - * that makes detections of these tokens more complex. - * - * The tokens BLOCK-ENTRY, KEY, and VALUE are used to represent the indicators - * '-', '?', and ':' correspondingly. - * - * The following examples show how the tokens BLOCK-SEQUENCE-START, - * BLOCK-MAPPING-START, and BLOCK-END are emitted by the Scanner: - * - * 1. Block sequences: - * - * - item 1 - * - item 2 - * - - * - item 3.1 - * - item 3.2 - * - - * key 1: value 1 - * key 2: value 2 - * - * Tokens: - * - * STREAM-START(utf-8) - * BLOCK-SEQUENCE-START - * BLOCK-ENTRY - * SCALAR("item 1",plain) - * BLOCK-ENTRY - * SCALAR("item 2",plain) - * BLOCK-ENTRY - * BLOCK-SEQUENCE-START - * BLOCK-ENTRY - * SCALAR("item 3.1",plain) - * BLOCK-ENTRY - * SCALAR("item 3.2",plain) - * BLOCK-END - * BLOCK-ENTRY - * BLOCK-MAPPING-START - * KEY - * SCALAR("key 1",plain) - * VALUE - * SCALAR("value 1",plain) - * KEY - * SCALAR("key 2",plain) - * VALUE - * SCALAR("value 2",plain) - * BLOCK-END - * BLOCK-END - * STREAM-END - * - * 2. Block mappings: - * - * a simple key: a value # The KEY token is produced here. - * ? a complex key - * : another value - * a mapping: - * key 1: value 1 - * key 2: value 2 - * a sequence: - * - item 1 - * - item 2 - * - * Tokens: - * - * STREAM-START(utf-8) - * BLOCK-MAPPING-START - * KEY - * SCALAR("a simple key",plain) - * VALUE - * SCALAR("a value",plain) - * KEY - * SCALAR("a complex key",plain) - * VALUE - * SCALAR("another value",plain) - * KEY - * SCALAR("a mapping",plain) - * BLOCK-MAPPING-START - * KEY - * SCALAR("key 1",plain) - * VALUE - * SCALAR("value 1",plain) - * KEY - * SCALAR("key 2",plain) - * VALUE - * SCALAR("value 2",plain) - * BLOCK-END - * KEY - * SCALAR("a sequence",plain) - * VALUE - * BLOCK-SEQUENCE-START - * BLOCK-ENTRY - * SCALAR("item 1",plain) - * BLOCK-ENTRY - * SCALAR("item 2",plain) - * BLOCK-END - * BLOCK-END - * STREAM-END - * - * YAML does not always require to start a new block collection from a new - * line. If the current line contains only '-', '?', and ':' indicators, a new - * block collection may start at the current line. The following examples - * illustrate this case: - * - * 1. Collections in a sequence: - * - * - - item 1 - * - item 2 - * - key 1: value 1 - * key 2: value 2 - * - ? complex key - * : complex value - * - * Tokens: - * - * STREAM-START(utf-8) - * BLOCK-SEQUENCE-START - * BLOCK-ENTRY - * BLOCK-SEQUENCE-START - * BLOCK-ENTRY - * SCALAR("item 1",plain) - * BLOCK-ENTRY - * SCALAR("item 2",plain) - * BLOCK-END - * BLOCK-ENTRY - * BLOCK-MAPPING-START - * KEY - * SCALAR("key 1",plain) - * VALUE - * SCALAR("value 1",plain) - * KEY - * SCALAR("key 2",plain) - * VALUE - * SCALAR("value 2",plain) - * BLOCK-END - * BLOCK-ENTRY - * BLOCK-MAPPING-START - * KEY - * SCALAR("complex key") - * VALUE - * SCALAR("complex value") - * BLOCK-END - * BLOCK-END - * STREAM-END - * - * 2. Collections in a mapping: - * - * ? a sequence - * : - item 1 - * - item 2 - * ? a mapping - * : key 1: value 1 - * key 2: value 2 - * - * Tokens: - * - * STREAM-START(utf-8) - * BLOCK-MAPPING-START - * KEY - * SCALAR("a sequence",plain) - * VALUE - * BLOCK-SEQUENCE-START - * BLOCK-ENTRY - * SCALAR("item 1",plain) - * BLOCK-ENTRY - * SCALAR("item 2",plain) - * BLOCK-END - * KEY - * SCALAR("a mapping",plain) - * VALUE - * BLOCK-MAPPING-START - * KEY - * SCALAR("key 1",plain) - * VALUE - * SCALAR("value 1",plain) - * KEY - * SCALAR("key 2",plain) - * VALUE - * SCALAR("value 2",plain) - * BLOCK-END - * BLOCK-END - * STREAM-END - * - * YAML also permits non-indented sequences if they are included into a block - * mapping. In this case, the token BLOCK-SEQUENCE-START is not produced: - * - * key: - * - item 1 # BLOCK-SEQUENCE-START is NOT produced here. - * - item 2 - * - * Tokens: - * - * STREAM-START(utf-8) - * BLOCK-MAPPING-START - * KEY - * SCALAR("key",plain) - * VALUE - * BLOCK-ENTRY - * SCALAR("item 1",plain) - * BLOCK-ENTRY - * SCALAR("item 2",plain) - * BLOCK-END - */ - -/* - * Ensure that the buffer contains the required number of characters. - * Return 1 on success, 0 on failure (reader error or memory error). - */ -func cache(parser *yaml_parser_t, length int) bool { - if parser.unread >= length { - return true - } - - return yaml_parser_update_buffer(parser, length) -} - -/* - * Advance the buffer pointer. - */ -func skip(parser *yaml_parser_t) { - parser.mark.index++ - parser.mark.column++ - parser.unread-- - parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) -} - -func skip_line(parser *yaml_parser_t) { - if is_crlf_at(parser.buffer, parser.buffer_pos) { - parser.mark.index += 2 - parser.mark.column = 0 - parser.mark.line++ - parser.unread -= 2 - parser.buffer_pos += 2 - } else if is_break_at(parser.buffer, parser.buffer_pos) { - parser.mark.index++ - parser.mark.column = 0 - parser.mark.line++ - parser.unread-- - parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) - } -} - -/* - * Copy a character to a string buffer and advance pointers. - */ - -func read(parser *yaml_parser_t, s []byte) []byte { - w := width(parser.buffer[parser.buffer_pos]) - if w == 0 { - panic("invalid character sequence") - } - if len(s) == 0 { - s = make([]byte, 0, 32) - } - if w == 1 && len(s)+w <= cap(s) { - s = s[:len(s)+1] - s[len(s)-1] = parser.buffer[parser.buffer_pos] - parser.buffer_pos++ - } else { - s = append(s, parser.buffer[parser.buffer_pos:parser.buffer_pos+w]...) - parser.buffer_pos += w - } - parser.mark.index++ - parser.mark.column++ - parser.unread-- - return s -} - -/* - * Copy a line break character to a string buffer and advance pointers. - */ -func read_line(parser *yaml_parser_t, s []byte) []byte { - buf := parser.buffer - pos := parser.buffer_pos - if buf[pos] == '\r' && buf[pos+1] == '\n' { - /* CR LF . LF */ - s = append(s, '\n') - parser.buffer_pos += 2 - parser.mark.index++ - parser.unread-- - } else if buf[pos] == '\r' || buf[pos] == '\n' { - /* CR|LF . LF */ - s = append(s, '\n') - parser.buffer_pos += 1 - } else if buf[pos] == '\xC2' && buf[pos+1] == '\x85' { - /* NEL . LF */ - s = append(s, '\n') - parser.buffer_pos += 2 - } else if buf[pos] == '\xE2' && buf[pos+1] == '\x80' && - (buf[pos+2] == '\xA8' || buf[pos+2] == '\xA9') { - // LS|PS . LS|PS - s = append(s, buf[parser.buffer_pos:pos+3]...) - parser.buffer_pos += 3 - } else { - return s - } - - parser.mark.index++ - parser.mark.column = 0 - parser.mark.line++ - parser.unread-- - return s -} - -/* - * Get the next token. - */ - -func yaml_parser_scan(parser *yaml_parser_t, token *yaml_token_t) bool { - /* Erase the token object. */ - *token = yaml_token_t{} - - /* No tokens after STREAM-END or error. */ - - if parser.stream_end_produced || parser.error != yaml_NO_ERROR { - return true - } - - /* Ensure that the tokens queue contains enough tokens. */ - - if !parser.token_available { - if !yaml_parser_fetch_more_tokens(parser) { - return false - } - } - - /* Fetch the next token from the queue. */ - - *token = parser.tokens[parser.tokens_head] - parser.tokens_head++ - parser.token_available = false - parser.tokens_parsed++ - - if token.token_type == yaml_STREAM_END_TOKEN { - parser.stream_end_produced = true - } - - return true -} - -/* - * Set the scanner error and return 0. - */ - -func yaml_parser_set_scanner_error(parser *yaml_parser_t, context string, - context_mark YAML_mark_t, problem string) bool { - parser.error = yaml_SCANNER_ERROR - parser.context = context - parser.context_mark = context_mark - parser.problem = problem - parser.problem_mark = parser.mark - - return false -} - -func yaml_parser_set_scanner_tag_error(parser *yaml_parser_t, directive bool, context_mark YAML_mark_t, problem string) bool { - context := "while parsing a %TAG directive" - if directive { - context = "while parsing a tag" - } - return yaml_parser_set_scanner_error(parser, context, context_mark, "did not find URI escaped octet") -} - -/* - * Ensure that the tokens queue contains at least one token which can be - * returned to the Parser. - */ - -func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool { - /* While we need more tokens to fetch, do it. */ - - for { - /* - * Check if we really need to fetch more tokens. - */ - - need_more_tokens := false - - if parser.tokens_head == len(parser.tokens) { - /* Queue is empty. */ - - need_more_tokens = true - } else { - - /* Check if any potential simple key may occupy the head position. */ - - if !yaml_parser_stale_simple_keys(parser) { - return false - } - - for i := range parser.simple_keys { - simple_key := &parser.simple_keys[i] - - if simple_key.possible && - simple_key.token_number == parser.tokens_parsed { - need_more_tokens = true - break - } - } - } - if len(parser.simple_keys) > 0 { - - } - /* We are finished. */ - - if !need_more_tokens { - break - } - - /* Fetch the next token. */ - - if !yaml_parser_fetch_next_token(parser) { - return false - } - - } - - parser.token_available = true - - return true -} - -/* - * The dispatcher for token fetchers. - */ - -func yaml_parser_fetch_next_token(parser *yaml_parser_t) bool { - /* Ensure that the buffer is initialized. */ - - if !cache(parser, 1) { - return false - } - - /* Check if we just started scanning. Fetch STREAM-START then. */ - - if !parser.stream_start_produced { - return yaml_parser_fetch_stream_start(parser) - } - - /* Eat whitespaces and comments until we reach the next token. */ - - if !yaml_parser_scan_to_next_token(parser) { - return false - } - - /* Remove obsolete potential simple keys. */ - - if !yaml_parser_stale_simple_keys(parser) { - return false - } - - /* Check the indentation level against the current column. */ - - if !yaml_parser_unroll_indent(parser, parser.mark.column) { - return false - } - - /* - * Ensure that the buffer contains at least 4 characters. 4 is the length - * of the longest indicators ('--- ' and '... '). - */ - - if !cache(parser, 4) { - return false - } - - /* Is it the end of the stream? */ - buf := parser.buffer - pos := parser.buffer_pos - - if is_z(buf[pos]) { - return yaml_parser_fetch_stream_end(parser) - } - - /* Is it a directive? */ - - if parser.mark.column == 0 && buf[pos] == '%' { - return yaml_parser_fetch_directive(parser) - } - - /* Is it the document start indicator? */ - - if parser.mark.column == 0 && - buf[pos] == '-' && buf[pos+1] == '-' && buf[pos+2] == '-' && - is_blankz_at(buf, pos+3) { - return yaml_parser_fetch_document_indicator(parser, - yaml_DOCUMENT_START_TOKEN) - } - - /* Is it the document end indicator? */ - - if parser.mark.column == 0 && - buf[pos] == '.' && buf[pos+1] == '.' && buf[pos+2] == '.' && - is_blankz_at(buf, pos+3) { - return yaml_parser_fetch_document_indicator(parser, - yaml_DOCUMENT_END_TOKEN) - } - - /* Is it the flow sequence start indicator? */ - - if buf[pos] == '[' { - return yaml_parser_fetch_flow_collection_start(parser, - yaml_FLOW_SEQUENCE_START_TOKEN) - } - - /* Is it the flow mapping start indicator? */ - - if buf[pos] == '{' { - return yaml_parser_fetch_flow_collection_start(parser, - yaml_FLOW_MAPPING_START_TOKEN) - } - - /* Is it the flow sequence end indicator? */ - - if buf[pos] == ']' { - return yaml_parser_fetch_flow_collection_end(parser, - yaml_FLOW_SEQUENCE_END_TOKEN) - } - - /* Is it the flow mapping end indicator? */ - - if buf[pos] == '}' { - return yaml_parser_fetch_flow_collection_end(parser, - yaml_FLOW_MAPPING_END_TOKEN) - } - - /* Is it the flow entry indicator? */ - - if buf[pos] == ',' { - return yaml_parser_fetch_flow_entry(parser) - } - - /* Is it the block entry indicator? */ - if buf[pos] == '-' && is_blankz_at(buf, pos+1) { - return yaml_parser_fetch_block_entry(parser) - } - - /* Is it the key indicator? */ - if buf[pos] == '?' && - (parser.flow_level > 0 || is_blankz_at(buf, pos+1)) { - return yaml_parser_fetch_key(parser) - } - - /* Is it the value indicator? */ - if buf[pos] == ':' && - (parser.flow_level > 0 || is_blankz_at(buf, pos+1)) { - return yaml_parser_fetch_value(parser) - } - - /* Is it an alias? */ - if buf[pos] == '*' { - return yaml_parser_fetch_anchor(parser, yaml_ALIAS_TOKEN) - } - - /* Is it an anchor? */ - - if buf[pos] == '&' { - return yaml_parser_fetch_anchor(parser, yaml_ANCHOR_TOKEN) - } - - /* Is it a tag? */ - - if buf[pos] == '!' { - return yaml_parser_fetch_tag(parser) - } - - /* Is it a literal scalar? */ - if buf[pos] == '|' && parser.flow_level == 0 { - return yaml_parser_fetch_block_scalar(parser, true) - } - - /* Is it a folded scalar? */ - if buf[pos] == '>' && parser.flow_level == 0 { - return yaml_parser_fetch_block_scalar(parser, false) - } - - /* Is it a single-quoted scalar? */ - - if buf[pos] == '\'' { - return yaml_parser_fetch_flow_scalar(parser, true) - } - - /* Is it a double-quoted scalar? */ - if buf[pos] == '"' { - return yaml_parser_fetch_flow_scalar(parser, false) - } - - /* - * Is it a plain scalar? - * - * A plain scalar may start with any non-blank characters except - * - * '-', '?', ':', ',', '[', ']', '{', '}', - * '#', '&', '*', '!', '|', '>', '\'', '\"', - * '%', '@', '`'. - * - * In the block context (and, for the '-' indicator, in the flow context - * too), it may also start with the characters - * - * '-', '?', ':' - * - * if it is followed by a non-space character. - * - * The last rule is more restrictive than the specification requires. - */ - - b := buf[pos] - if !(is_blankz_at(buf, pos) || b == '-' || - b == '?' || b == ':' || - b == ',' || b == '[' || - b == ']' || b == '{' || - b == '}' || b == '#' || - b == '&' || b == '*' || - b == '!' || b == '|' || - b == '>' || b == '\'' || - b == '"' || b == '%' || - b == '@' || b == '`') || - (b == '-' && !is_blank(buf[pos+1])) || - (parser.flow_level == 0 && - (buf[pos] == '?' || buf[pos] == ':') && - !is_blank(buf[pos+1])) { - return yaml_parser_fetch_plain_scalar(parser) - } - - /* - * If we don't determine the token type so far, it is an error. - */ - - return yaml_parser_set_scanner_error(parser, - "while scanning for the next token", parser.mark, - "found character that cannot start any token") -} - -/* - * Check the list of potential simple keys and remove the positions that - * cannot contain simple keys anymore. - */ - -func yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool { - /* Check for a potential simple key for each flow level. */ - - for i := range parser.simple_keys { - /* - * The specification requires that a simple key - * - * - is limited to a single line, - * - is shorter than 1024 characters. - */ - - simple_key := &parser.simple_keys[i] - if simple_key.possible && - (simple_key.mark.line < parser.mark.line || - simple_key.mark.index+1024 < parser.mark.index) { - - /* Check if the potential simple key to be removed is required. */ - - if simple_key.required { - return yaml_parser_set_scanner_error(parser, - "while scanning a simple key", simple_key.mark, - "could not find expected ':'") - } - - simple_key.possible = false - } - } - - return true -} - -/* - * Check if a simple key may start at the current position and add it if - * needed. - */ - -func yaml_parser_save_simple_key(parser *yaml_parser_t) bool { - /* - * A simple key is required at the current position if the scanner is in - * the block context and the current column coincides with the indentation - * level. - */ - - required := (parser.flow_level == 0 && - parser.indent == parser.mark.column) - - /* - * A simple key is required only when it is the first token in the current - * line. Therefore it is always allowed. But we add a check anyway. - */ - if required && !parser.simple_key_allowed { - panic("impossible") /* Impossible. */ - } - - /* - * If the current position may start a simple key, save it. - */ - - if parser.simple_key_allowed { - simple_key := yaml_simple_key_t{ - possible: true, - required: required, - token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head), - } - simple_key.mark = parser.mark - - if !yaml_parser_remove_simple_key(parser) { - return false - } - - parser.simple_keys[len(parser.simple_keys)-1] = simple_key - } - - return true -} - -/* - * Remove a potential simple key at the current flow level. - */ - -func yaml_parser_remove_simple_key(parser *yaml_parser_t) bool { - simple_key := &parser.simple_keys[len(parser.simple_keys)-1] - - if simple_key.possible { - /* If the key is required, it is an error. */ - - if simple_key.required { - return yaml_parser_set_scanner_error(parser, - "while scanning a simple key", simple_key.mark, - "could not find expected ':'") - } - } - - /* Remove the key from the stack. */ - - simple_key.possible = false - - return true -} - -/* - * Increase the flow level and resize the simple key list if needed. - */ - -func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool { - /* Reset the simple key on the next level. */ - - parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{}) - - /* Increase the flow level. */ - - parser.flow_level++ - - return true -} - -/* - * Decrease the flow level. - */ - -func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool { - if parser.flow_level > 0 { - parser.flow_level-- - parser.simple_keys = parser.simple_keys[:len(parser.simple_keys)-1] - } - - return true -} - -/* - * Push the current indentation level to the stack and set the new level - * the current column is greater than the indentation level. In this case, - * append or insert the specified token into the token queue. - * - */ - -func yaml_parser_roll_indent(parser *yaml_parser_t, column int, - number int, token_type yaml_token_type_t, mark YAML_mark_t) bool { - /* In the flow context, do nothing. */ - - if parser.flow_level > 0 { - return true - } - - if parser.indent == -1 || parser.indent < column { - /* - * Push the current indentation level to the stack and set the new - * indentation level. - */ - - parser.indents = append(parser.indents, parser.indent) - parser.indent = column - - /* Create a token and insert it into the queue. */ - token := yaml_token_t{ - token_type: token_type, - start_mark: mark, - end_mark: mark, - } - - // number == -1 -> enqueue otherwise insert - if number > -1 { - number -= parser.tokens_parsed - } - insert_token(parser, number, &token) - } - - return true -} - -/* - * Pop indentation levels from the indents stack until the current level - * becomes less or equal to the column. For each indentation level, append - * the BLOCK-END token. - */ - -func yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool { - /* In the flow context, do nothing. */ - - if parser.flow_level > 0 { - return true - } - - /* - * column is unsigned and parser->indent is signed, so if - * parser->indent is less than zero the conditional in the while - * loop below is incorrect. Guard against that. - */ - - if parser.indent < 0 { - return true - } - - /* Loop through the indentation levels in the stack. */ - - for parser.indent > column { - /* Create a token and append it to the queue. */ - token := yaml_token_t{ - token_type: yaml_BLOCK_END_TOKEN, - start_mark: parser.mark, - end_mark: parser.mark, - } - insert_token(parser, -1, &token) - - /* Pop the indentation level. */ - parser.indent = parser.indents[len(parser.indents)-1] - parser.indents = parser.indents[:len(parser.indents)-1] - - } - - return true -} - -/* - * Pop indentation levels from the indents stack until the current - * level resets to -1. For each indentation level, append the - * BLOCK-END token. - */ - -func yaml_parser_reset_indent(parser *yaml_parser_t) bool { - /* In the flow context, do nothing. */ - - if parser.flow_level > 0 { - return true - } - - /* Loop through the indentation levels in the stack. */ - - for parser.indent > -1 { - /* Create a token and append it to the queue. */ - - token := yaml_token_t{ - token_type: yaml_BLOCK_END_TOKEN, - start_mark: parser.mark, - end_mark: parser.mark, - } - insert_token(parser, -1, &token) - - /* Pop the indentation level. */ - parser.indent = parser.indents[len(parser.indents)-1] - parser.indents = parser.indents[:len(parser.indents)-1] - } - - return true -} - -/* - * Initialize the scanner and produce the STREAM-START token. - */ - -func yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool { - /* Set the initial indentation. */ - - parser.indent = -1 - - /* Initialize the simple key stack. */ - parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{}) - - /* A simple key is allowed at the beginning of the stream. */ - - parser.simple_key_allowed = true - - /* We have started. */ - - parser.stream_start_produced = true - - /* Create the STREAM-START token and append it to the queue. */ - token := yaml_token_t{ - token_type: yaml_STREAM_START_TOKEN, - start_mark: parser.mark, - end_mark: parser.mark, - encoding: parser.encoding, - } - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the STREAM-END token and shut down the scanner. - */ - -func yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool { - /* Force new line. */ - - if parser.mark.column != 0 { - parser.mark.column = 0 - parser.mark.line++ - } - - /* Reset the indentation level. */ - - if !yaml_parser_reset_indent(parser) { - return false - } - - /* Reset simple keys. */ - - if !yaml_parser_remove_simple_key(parser) { - return false - } - - parser.simple_key_allowed = false - - /* Create the STREAM-END token and append it to the queue. */ - token := yaml_token_t{ - token_type: yaml_STREAM_END_TOKEN, - start_mark: parser.mark, - end_mark: parser.mark, - } - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token. - */ - -func yaml_parser_fetch_directive(parser *yaml_parser_t) bool { - /* Reset the indentation level. */ - - if !yaml_parser_reset_indent(parser) { - return false - } - - /* Reset simple keys. */ - - if !yaml_parser_remove_simple_key(parser) { - return false - } - - parser.simple_key_allowed = false - - /* Create the YAML-DIRECTIVE or TAG-DIRECTIVE token. */ - var token yaml_token_t - if !yaml_parser_scan_directive(parser, &token) { - return false - } - - /* Append the token to the queue. */ - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the DOCUMENT-START or DOCUMENT-END token. - */ - -func yaml_parser_fetch_document_indicator(parser *yaml_parser_t, - token_type yaml_token_type_t) bool { - - /* Reset the indentation level. */ - - if !yaml_parser_reset_indent(parser) { - return false - } - - /* Reset simple keys. */ - - if !yaml_parser_remove_simple_key(parser) { - return false - } - - parser.simple_key_allowed = false - - /* Consume the token. */ - - start_mark := parser.mark - - skip(parser) - skip(parser) - skip(parser) - - end_mark := parser.mark - - /* Create the DOCUMENT-START or DOCUMENT-END token. */ - - token := yaml_token_t{ - token_type: token_type, - start_mark: start_mark, - end_mark: end_mark, - } - - /* Append the token to the queue. */ - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token. - */ - -func yaml_parser_fetch_flow_collection_start(parser *yaml_parser_t, - token_type yaml_token_type_t) bool { - - /* The indicators '[' and '{' may start a simple key. */ - - if !yaml_parser_save_simple_key(parser) { - return false - } - - /* Increase the flow level. */ - - if !yaml_parser_increase_flow_level(parser) { - return false - } - - /* A simple key may follow the indicators '[' and '{'. */ - - parser.simple_key_allowed = true - - /* Consume the token. */ - - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - /* Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token. */ - - token := yaml_token_t{ - token_type: token_type, - start_mark: start_mark, - end_mark: end_mark, - } - - /* Append the token to the queue. */ - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token. - */ - -func yaml_parser_fetch_flow_collection_end(parser *yaml_parser_t, - token_type yaml_token_type_t) bool { - - /* Reset any potential simple key on the current flow level. */ - - if !yaml_parser_remove_simple_key(parser) { - return false - } - - /* Decrease the flow level. */ - - if !yaml_parser_decrease_flow_level(parser) { - return false - } - - /* No simple keys after the indicators ']' and '}'. */ - - parser.simple_key_allowed = false - - /* Consume the token. */ - - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - /* Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token. */ - - token := yaml_token_t{ - token_type: token_type, - start_mark: start_mark, - end_mark: end_mark, - } - - /* Append the token to the queue. */ - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the FLOW-ENTRY token. - */ - -func yaml_parser_fetch_flow_entry(parser *yaml_parser_t) bool { - - /* Reset any potential simple keys on the current flow level. */ - - if !yaml_parser_remove_simple_key(parser) { - return false - } - - /* Simple keys are allowed after ','. */ - - parser.simple_key_allowed = true - - /* Consume the token. */ - - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - /* Create the FLOW-ENTRY token and append it to the queue. */ - - token := yaml_token_t{ - token_type: yaml_FLOW_ENTRY_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the BLOCK-ENTRY token. - */ - -func yaml_parser_fetch_block_entry(parser *yaml_parser_t) bool { - - /* Check if the scanner is in the block context. */ - - if parser.flow_level == 0 { - /* Check if we are allowed to start a new entry. */ - - if !parser.simple_key_allowed { - return yaml_parser_set_scanner_error(parser, "", parser.mark, - "block sequence entries are not allowed in this context") - } - - /* Add the BLOCK-SEQUENCE-START token if needed. */ - - if !yaml_parser_roll_indent(parser, parser.mark.column, -1, - yaml_BLOCK_SEQUENCE_START_TOKEN, parser.mark) { - return false - } - } else { - /* - * It is an error for the '-' indicator to occur in the flow context, - * but we let the Parser detect and report about it because the Parser - * is able to point to the context. - */ - } - - /* Reset any potential simple keys on the current flow level. */ - - if !yaml_parser_remove_simple_key(parser) { - return false - } - - /* Simple keys are allowed after '-'. */ - - parser.simple_key_allowed = true - - /* Consume the token. */ - - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - /* Create the BLOCK-ENTRY token and append it to the queue. */ - - token := yaml_token_t{ - token_type: yaml_BLOCK_ENTRY_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the KEY token. - */ - -func yaml_parser_fetch_key(parser *yaml_parser_t) bool { - /* In the block context, additional checks are required. */ - - if parser.flow_level == 0 { - /* Check if we are allowed to start a new key (not nessesary simple). */ - - if !parser.simple_key_allowed { - return yaml_parser_set_scanner_error(parser, "", parser.mark, - "mapping keys are not allowed in this context") - } - - /* Add the BLOCK-MAPPING-START token if needed. */ - - if !yaml_parser_roll_indent(parser, parser.mark.column, -1, - yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) { - return false - } - } - - /* Reset any potential simple keys on the current flow level. */ - - if !yaml_parser_remove_simple_key(parser) { - return false - } - - /* Simple keys are allowed after '?' in the block context. */ - - parser.simple_key_allowed = (parser.flow_level == 0) - - /* Consume the token. */ - - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - /* Create the KEY token and append it to the queue. */ - - token := yaml_token_t{ - token_type: yaml_KEY_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the VALUE token. - */ - -func yaml_parser_fetch_value(parser *yaml_parser_t) bool { - - simple_key := &parser.simple_keys[len(parser.simple_keys)-1] - - /* Have we found a simple key? */ - - if simple_key.possible { - - /* Create the KEY token and insert it into the queue. */ - - token := yaml_token_t{ - token_type: yaml_KEY_TOKEN, - start_mark: simple_key.mark, - end_mark: simple_key.mark, - } - - insert_token(parser, simple_key.token_number-parser.tokens_parsed, &token) - - /* In the block context, we may need to add the BLOCK-MAPPING-START token. */ - - if !yaml_parser_roll_indent(parser, simple_key.mark.column, - simple_key.token_number, - yaml_BLOCK_MAPPING_START_TOKEN, simple_key.mark) { - return false - } - - /* Remove the simple key. */ - - simple_key.possible = false - - /* A simple key cannot follow another simple key. */ - - parser.simple_key_allowed = false - } else { - /* The ':' indicator follows a complex key. */ - - /* In the block context, extra checks are required. */ - - if parser.flow_level == 0 { - /* Check if we are allowed to start a complex value. */ - - if !parser.simple_key_allowed { - return yaml_parser_set_scanner_error(parser, "", parser.mark, - "mapping values are not allowed in this context") - } - - /* Add the BLOCK-MAPPING-START token if needed. */ - - if !yaml_parser_roll_indent(parser, parser.mark.column, -1, - yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) { - return false - } - } - - /* Simple keys after ':' are allowed in the block context. */ - - parser.simple_key_allowed = (parser.flow_level == 0) - } - - /* Consume the token. */ - - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - /* Create the VALUE token and append it to the queue. */ - - token := yaml_token_t{ - token_type: yaml_VALUE_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the ALIAS or ANCHOR token. - */ - -func yaml_parser_fetch_anchor(parser *yaml_parser_t, token_type yaml_token_type_t) bool { - - /* An anchor or an alias could be a simple key. */ - - if !yaml_parser_save_simple_key(parser) { - return false - } - - /* A simple key cannot follow an anchor or an alias. */ - - parser.simple_key_allowed = false - - /* Create the ALIAS or ANCHOR token and append it to the queue. */ - var token yaml_token_t - if !yaml_parser_scan_anchor(parser, &token, token_type) { - return false - } - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the TAG token. - */ - -func yaml_parser_fetch_tag(parser *yaml_parser_t) bool { - /* A tag could be a simple key. */ - - if !yaml_parser_save_simple_key(parser) { - return false - } - - /* A simple key cannot follow a tag. */ - - parser.simple_key_allowed = false - - /* Create the TAG token and append it to the queue. */ - var token yaml_token_t - if !yaml_parser_scan_tag(parser, &token) { - return false - } - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens. - */ - -func yaml_parser_fetch_block_scalar(parser *yaml_parser_t, literal bool) bool { - /* Remove any potential simple keys. */ - - if !yaml_parser_remove_simple_key(parser) { - return false - } - - /* A simple key may follow a block scalar. */ - - parser.simple_key_allowed = true - - /* Create the SCALAR token and append it to the queue. */ - var token yaml_token_t - if !yaml_parser_scan_block_scalar(parser, &token, literal) { - return false - } - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens. - */ - -func yaml_parser_fetch_flow_scalar(parser *yaml_parser_t, single bool) bool { - - /* A plain scalar could be a simple key. */ - - if !yaml_parser_save_simple_key(parser) { - return false - } - - /* A simple key cannot follow a flow scalar. */ - - parser.simple_key_allowed = false - - /* Create the SCALAR token and append it to the queue. */ - var token yaml_token_t - if !yaml_parser_scan_flow_scalar(parser, &token, single) { - return false - } - - insert_token(parser, -1, &token) - - return true -} - -/* - * Produce the SCALAR(...,plain) token. - */ - -func yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool { - /* A plain scalar could be a simple key. */ - - if !yaml_parser_save_simple_key(parser) { - return false - } - - /* A simple key cannot follow a flow scalar. */ - - parser.simple_key_allowed = false - - /* Create the SCALAR token and append it to the queue. */ - var token yaml_token_t - if !yaml_parser_scan_plain_scalar(parser, &token) { - return false - } - - insert_token(parser, -1, &token) - - return true -} - -/* - * Eat whitespaces and comments until the next token is found. - */ - -func yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool { - /* Until the next token is not found. */ - - for { - /* Allow the BOM mark to start a line. */ - - if !cache(parser, 1) { - return false - } - - if parser.mark.column == 0 && is_bom_at(parser.buffer, parser.buffer_pos) { - skip(parser) - } - - /* - * Eat whitespaces. - * - * Tabs are allowed: - * - * - in the flow context; - * - in the block context, but not at the beginning of the line or - * after '-', '?', or ':' (complex value). - */ - - if !cache(parser, 1) { - return false - } - - for parser.buffer[parser.buffer_pos] == ' ' || - ((parser.flow_level > 0 || !parser.simple_key_allowed) && - parser.buffer[parser.buffer_pos] == '\t') { - skip(parser) - if !cache(parser, 1) { - return false - } - } - - /* Eat a comment until a line break. */ - - if parser.buffer[parser.buffer_pos] == '#' { - for !is_breakz_at(parser.buffer, parser.buffer_pos) { - skip(parser) - if !cache(parser, 1) { - return false - } - } - } - - /* If it is a line break, eat it. */ - - if is_break_at(parser.buffer, parser.buffer_pos) { - if !cache(parser, 2) { - return false - } - skip_line(parser) - - /* In the block context, a new line may start a simple key. */ - - if parser.flow_level == 0 { - parser.simple_key_allowed = true - } - } else { - /* We have found a token. */ - - break - } - } - - return true -} - -/* - * Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. - * - * Scope: - * %YAML 1.1 # a comment \n - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * %TAG !yaml! tag:yaml.org,2002: \n - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - */ - -func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool { - /* Eat '%'. */ - - start_mark := parser.mark - - skip(parser) - - /* Scan the directive name. */ - var name []byte - if !yaml_parser_scan_directive_name(parser, start_mark, &name) { - return false - } - - /* Is it a YAML directive? */ - var major, minor int - if bytes.Equal(name, []byte("YAML")) { - /* Scan the VERSION directive value. */ - - if !yaml_parser_scan_version_directive_value(parser, start_mark, - &major, &minor) { - return false - } - - end_mark := parser.mark - - /* Create a VERSION-DIRECTIVE token. */ - - *token = yaml_token_t{ - token_type: yaml_VERSION_DIRECTIVE_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - major: major, - minor: minor, - } - } else if bytes.Equal(name, []byte("TAG")) { - /* Is it a TAG directive? */ - /* Scan the TAG directive value. */ - var handle, prefix []byte - if !yaml_parser_scan_tag_directive_value(parser, start_mark, - &handle, &prefix) { - return false - } - - end_mark := parser.mark - - /* Create a TAG-DIRECTIVE token. */ - - *token = yaml_token_t{ - token_type: yaml_TAG_DIRECTIVE_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: handle, - prefix: prefix, - } - } else { - /* Unknown directive. */ - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "found uknown directive name") - return false - } - - /* Eat the rest of the line including any comments. */ - - if !cache(parser, 1) { - return false - } - - for is_blank(parser.buffer[parser.buffer_pos]) { - skip(parser) - if !cache(parser, 1) { - return false - } - } - - if parser.buffer[parser.buffer_pos] == '#' { - for !is_breakz_at(parser.buffer, parser.buffer_pos) { - skip(parser) - if !cache(parser, 1) { - return false - } - } - } - - /* Check if we are at the end of the line. */ - - if !is_breakz_at(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "did not find expected comment or line break") - return false - } - - /* Eat a line break. */ - - if is_break_at(parser.buffer, parser.buffer_pos) { - if !cache(parser, 2) { - return false - } - skip_line(parser) - } - - return true -} - -/* - * Scan the directive name. - * - * Scope: - * %YAML 1.1 # a comment \n - * ^^^^ - * %TAG !yaml! tag:yaml.org,2002: \n - * ^^^ - */ - -func yaml_parser_scan_directive_name(parser *yaml_parser_t, - start_mark YAML_mark_t, name *[]byte) bool { - - /* Consume the directive name. */ - - if !cache(parser, 1) { - return false - } - - var s []byte - for is_alpha(parser.buffer[parser.buffer_pos]) { - s = read(parser, s) - if !cache(parser, 1) { - return false - } - } - - /* Check if the name is empty. */ - - if len(s) == 0 { - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "could not find expected directive name") - return false - } - - /* Check for an blank character after the name. */ - - if !is_blankz_at(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "found unexpected non-alphabetical character") - return false - } - - *name = s - - return true -} - -/* - * Scan the value of VERSION-DIRECTIVE. - * - * Scope: - * %YAML 1.1 # a comment \n - * ^^^^^^ - */ - -func yaml_parser_scan_version_directive_value(parser *yaml_parser_t, - start_mark YAML_mark_t, major *int, minor *int) bool { - /* Eat whitespaces. */ - - if !cache(parser, 1) { - return false - } - - for is_blank(parser.buffer[parser.buffer_pos]) { - skip(parser) - if !cache(parser, 1) { - return false - } - } - - /* Consume the major version number. */ - - if !yaml_parser_scan_version_directive_number(parser, start_mark, major) { - return false - } - - /* Eat '.'. */ - - if parser.buffer[parser.buffer_pos] != '.' { - return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", - start_mark, "did not find expected digit or '.' character") - } - - skip(parser) - - /* Consume the minor version number. */ - - if !yaml_parser_scan_version_directive_number(parser, start_mark, minor) { - return false - } - - return true -} - -const MAX_NUMBER_LENGTH = 9 - -/* - * Scan the version number of VERSION-DIRECTIVE. - * - * Scope: - * %YAML 1.1 # a comment \n - * ^ - * %YAML 1.1 # a comment \n - * ^ - */ - -func yaml_parser_scan_version_directive_number(parser *yaml_parser_t, - start_mark YAML_mark_t, number *int) bool { - - /* Repeat while the next character is digit. */ - - if !cache(parser, 1) { - return false - } - - value := 0 - length := 0 - for is_digit(parser.buffer[parser.buffer_pos]) { - /* Check if the number is too long. */ - - length++ - if length > MAX_NUMBER_LENGTH { - return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", - start_mark, "found extremely long version number") - } - - value = value*10 + as_digit(parser.buffer[parser.buffer_pos]) - - skip(parser) - - if !cache(parser, 1) { - return false - } - } - - /* Check if the number was present. */ - - if length == 0 { - return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", - start_mark, "did not find expected version number") - } - - *number = value - - return true -} - -/* - * Scan the value of a TAG-DIRECTIVE token. - * - * Scope: - * %TAG !yaml! tag:yaml.org,2002: \n - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - */ - -func yaml_parser_scan_tag_directive_value(parser *yaml_parser_t, - start_mark YAML_mark_t, handle, prefix *[]byte) bool { - - /* Eat whitespaces. */ - - if !cache(parser, 1) { - return false - } - - for is_blank(parser.buffer[parser.buffer_pos]) { - skip(parser) - if !cache(parser, 1) { - return false - } - } - - /* Scan a handle. */ - var handle_value []byte - if !yaml_parser_scan_tag_handle(parser, true, start_mark, &handle_value) { - return false - } - - /* Expect a whitespace. */ - - if !cache(parser, 1) { - return false - } - - if !is_blank(parser.buffer[parser.buffer_pos]) { - yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive", - start_mark, "did not find expected whitespace") - return false - } - - /* Eat whitespaces. */ - - for is_blank(parser.buffer[parser.buffer_pos]) { - skip(parser) - if !cache(parser, 1) { - return false - } - } - - /* Scan a prefix. */ - var prefix_value []byte - if !yaml_parser_scan_tag_uri(parser, true, nil, start_mark, &prefix_value) { - return false - } - - /* Expect a whitespace or line break. */ - - if !cache(parser, 1) { - return false - } - - if !is_blankz_at(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive", - start_mark, "did not find expected whitespace or line break") - return false - } - - *handle = handle_value - *prefix = prefix_value - - return true -} - -func yaml_parser_scan_anchor(parser *yaml_parser_t, token *yaml_token_t, - token_type yaml_token_type_t) bool { - - /* Eat the indicator character. */ - - start_mark := parser.mark - - skip(parser) - - /* Consume the value. */ - - if !cache(parser, 1) { - return false - } - - var s []byte - for is_alpha(parser.buffer[parser.buffer_pos]) { - s = read(parser, s) - if !cache(parser, 1) { - return false - } - } - - end_mark := parser.mark - - /* - * Check if length of the anchor is greater than 0 and it is followed by - * a whitespace character or one of the indicators: - * - * '?', ':', ',', ']', '}', '%', '@', '`'. - */ - - b := parser.buffer[parser.buffer_pos] - if len(s) == 0 || !(is_blankz_at(parser.buffer, parser.buffer_pos) || b == '?' || - b == ':' || b == ',' || - b == ']' || b == '}' || - b == '%' || b == '@' || - b == '`') { - context := "while scanning an anchor" - if token_type != yaml_ANCHOR_TOKEN { - context = "while scanning an alias" - } - yaml_parser_set_scanner_error(parser, context, start_mark, - "did not find expected alphabetic or numeric character") - return false - } - - /* Create a token. */ - *token = yaml_token_t{ - token_type: token_type, - start_mark: start_mark, - end_mark: end_mark, - value: s, - } - - return true -} - -/* - * Scan a TAG token. - */ - -func yaml_parser_scan_tag(parser *yaml_parser_t, token *yaml_token_t) bool { - start_mark := parser.mark - - /* Check if the tag is in the canonical form. */ - - if !cache(parser, 2) { - return false - } - - var handle []byte - var suffix []byte - if parser.buffer[parser.buffer_pos+1] == '<' { - /* Set the handle to '' */ - - /* Eat '!<' */ - - skip(parser) - skip(parser) - - /* Consume the tag value. */ - - if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) { - return false - } - - /* Check for '>' and eat it. */ - - if parser.buffer[parser.buffer_pos] != '>' { - yaml_parser_set_scanner_error(parser, "while scanning a tag", - start_mark, "did not find the expected '>'") - return false - } - - skip(parser) - } else if is_blank(parser.buffer[parser.buffer_pos+1]) { - // NON-SPECIFIED - skip(parser) - } else { - /* The tag has either the '!suffix' or the '!handle!suffix' form. */ - - /* First, try to scan a handle. */ - - if !yaml_parser_scan_tag_handle(parser, false, start_mark, &handle) { - return false - } - - /* Check if it is, indeed, handle. */ - - if handle[0] == '!' && len(handle) > 1 && handle[len(handle)-1] == '!' { - /* Scan the suffix now. */ - - if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) { - return false - } - } else { - /* It wasn't a handle after all. Scan the rest of the tag. */ - - if !yaml_parser_scan_tag_uri(parser, false, handle, start_mark, &suffix) { - return false - } - - /* Set the handle to '!'. */ - - handle = []byte{'!'} - - /* - * A special case: the '!' tag. Set the handle to '' and the - * suffix to '!'. - */ - - if len(suffix) == 0 { - handle, suffix = suffix, handle - } - - } - } - - /* Check the character which ends the tag. */ - - if !cache(parser, 1) { - return false - } - - if !is_blankz_at(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a tag", - start_mark, "did not find expected whitespace or line break") - return false - } - - end_mark := parser.mark - - /* Create a token. */ - - *token = yaml_token_t{ - token_type: yaml_TAG_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: handle, - suffix: suffix, - } - - return true -} - -/* - * Scan a tag handle. - */ - -func yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool, - start_mark YAML_mark_t, handle *[]byte) bool { - - /* Check the initial '!' character. */ - - if !cache(parser, 1) { - return false - } - - if parser.buffer[parser.buffer_pos] != '!' { - yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find expected '!'") - return false - } - - /* Copy the '!' character. */ - var s []byte - s = read(parser, s) - - /* Copy all subsequent alphabetical and numerical characters. */ - - if !cache(parser, 1) { - return false - } - - for is_alpha(parser.buffer[parser.buffer_pos]) { - s = read(parser, s) - if !cache(parser, 1) { - return false - } - } - - /* Check if the trailing character is '!' and copy it. */ - - if parser.buffer[parser.buffer_pos] == '!' { - s = read(parser, s) - } else { - /* - * It's either the '!' tag or not really a tag handle. If it's a %TAG - * directive, it's an error. If it's a tag token, it must be a part of - * URI. - */ - - if directive && !(s[0] == '!' && len(s) == 1) { - yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find expected '!'") - return false - } - } - - *handle = s - - return true -} - -/* - * Scan a tag. - */ - -func yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, - head []byte, start_mark YAML_mark_t, uri *[]byte) bool { - - var s []byte - /* - * Copy the head if needed. - * - * Note that we don't copy the leading '!' character. - */ - if len(head) > 1 { - s = append(s, head[1:]...) - } - - /* Scan the tag. */ - if !cache(parser, 1) { - return false - } - - /* - * The set of characters that may appear in URI is as follows: - * - * '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&', - * '=', '+', '$', ',', '.', '!', '~', '*', '\'', '(', ')', '[', ']', - * '%'. - */ - - b := parser.buffer[parser.buffer_pos] - for is_alpha(b) || b == ';' || - b == '/' || b == '?' || - b == ':' || b == '@' || - b == '&' || b == '=' || - b == '+' || b == '$' || - b == ',' || b == '.' || - b == '!' || b == '~' || - b == '*' || b == '\'' || - b == '(' || b == ')' || - b == '[' || b == ']' || - b == '%' { - /* Check if it is a URI-escape sequence. */ - - if b == '%' { - if !yaml_parser_scan_uri_escapes(parser, - directive, start_mark, &s) { - return false - } - } else { - s = read(parser, s) - } - - if !cache(parser, 1) { - return false - } - b = parser.buffer[parser.buffer_pos] - } - - /* Check if the tag is non-empty. */ - - if len(s) == 0 { - yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find expected tag URI") - return false - } - - *uri = s - - return true -} - -/* - * Decode an URI-escape sequence corresponding to a single UTF-8 character. - */ - -func yaml_parser_scan_uri_escapes(parser *yaml_parser_t, directive bool, - start_mark YAML_mark_t, s *[]byte) bool { - - /* Decode the required number of characters. */ - w := 10 - for w > 0 { - - /* Check for a URI-escaped octet. */ - - if !cache(parser, 3) { - return false - } - - if !(parser.buffer[parser.buffer_pos] == '%' && - is_hex(parser.buffer[parser.buffer_pos+1]) && - is_hex(parser.buffer[parser.buffer_pos+2])) { - return yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find URI escaped octet") - } - - /* Get the octet. */ - octet := byte((as_hex(parser.buffer[parser.buffer_pos+1]) << 4) + - as_hex(parser.buffer[parser.buffer_pos+2])) - - /* If it is the leading octet, determine the length of the UTF-8 sequence. */ - - if w == 10 { - w = width(octet) - if w == 0 { - return yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "found an incorrect leading UTF-8 octet") - } - } else { - /* Check if the trailing octet is correct. */ - - if (octet & 0xC0) != 0x80 { - return yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "found an incorrect trailing UTF-8 octet") - } - } - - /* Copy the octet and move the pointers. */ - - *s = append(*s, octet) - skip(parser) - skip(parser) - skip(parser) - w-- - } - - return true -} - -/* - * Scan a block scalar. - */ - -func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, - literal bool) bool { - - /* Eat the indicator '|' or '>'. */ - - start_mark := parser.mark - - skip(parser) - - /* Scan the additional block scalar indicators. */ - - if !cache(parser, 1) { - return false - } - - /* Check for a chomping indicator. */ - chomping := 0 - increment := 0 - if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { - /* Set the chomping method and eat the indicator. */ - - if parser.buffer[parser.buffer_pos] == '+' { - chomping = +1 - } else { - chomping = -1 - } - - skip(parser) - - /* Check for an indentation indicator. */ - - if !cache(parser, 1) { - return false - } - - if is_digit(parser.buffer[parser.buffer_pos]) { - /* Check that the indentation is greater than 0. */ - - if parser.buffer[parser.buffer_pos] == '0' { - yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found an indentation indicator equal to 0") - return false - } - - /* Get the indentation level and eat the indicator. */ - - increment = as_digit(parser.buffer[parser.buffer_pos]) - - skip(parser) - } - } else if is_digit(parser.buffer[parser.buffer_pos]) { - - /* Do the same as above, but in the opposite order. */ - if parser.buffer[parser.buffer_pos] == '0' { - yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found an indentation indicator equal to 0") - return false - } - - increment = as_digit(parser.buffer[parser.buffer_pos]) - - skip(parser) - - if !cache(parser, 1) { - return false - } - - if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { - if parser.buffer[parser.buffer_pos] == '+' { - chomping = +1 - } else { - chomping = -1 - } - - skip(parser) - } - } - - /* Eat whitespaces and comments to the end of the line. */ - - if !cache(parser, 1) { - return false - } - - for is_blank(parser.buffer[parser.buffer_pos]) { - skip(parser) - if !cache(parser, 1) { - return false - } - } - - if parser.buffer[parser.buffer_pos] == '#' { - for !is_breakz_at(parser.buffer, parser.buffer_pos) { - skip(parser) - if !cache(parser, 1) { - return false - } - } - } - - /* Check if we are at the end of the line. */ - - if !is_breakz_at(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "did not find expected comment or line break") - return false - } - - /* Eat a line break. */ - - if is_break_at(parser.buffer, parser.buffer_pos) { - if !cache(parser, 2) { - return false - } - - skip_line(parser) - } - - end_mark := parser.mark - - /* Set the indentation level if it was specified. */ - indent := 0 - if increment > 0 { - if parser.indent >= 0 { - indent = parser.indent + increment - } else { - indent = increment - } - } - - /* Scan the leading line breaks and determine the indentation level if needed. */ - var trailing_breaks []byte - if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, - start_mark, &end_mark) { - return false - } - - /* Scan the block scalar content. */ - - if !cache(parser, 1) { - return false - } - - var s []byte - var leading_break []byte - leading_blank := false - trailing_blank := false - for parser.mark.column == indent && !is_z(parser.buffer[parser.buffer_pos]) { - - /* - * We are at the beginning of a non-empty line. - */ - - /* Is it a trailing whitespace? */ - - trailing_blank = is_blank(parser.buffer[parser.buffer_pos]) - - /* Check if we need to fold the leading line break. */ - - if !literal && len(leading_break) > 0 && leading_break[0] == '\n' && - !leading_blank && !trailing_blank { - /* Do we need to join the lines by space? */ - if len(trailing_breaks) == 0 { - s = append(s, ' ') - } - leading_break = leading_break[:0] - } else { - s = append(s, leading_break...) - leading_break = leading_break[:0] - } - - /* Append the remaining line breaks. */ - s = append(s, trailing_breaks...) - trailing_breaks = trailing_breaks[:0] - - /* Is it a leading whitespace? */ - - leading_blank = is_blank(parser.buffer[parser.buffer_pos]) - - /* Consume the current line. */ - - for !is_breakz_at(parser.buffer, parser.buffer_pos) { - s = read(parser, s) - if !cache(parser, 1) { - return false - } - } - - /* Consume the line break. */ - - if !cache(parser, 2) { - return false - } - - leading_break = read_line(parser, leading_break) - - /* Eat the following indentation spaces and line breaks. */ - - if !yaml_parser_scan_block_scalar_breaks(parser, - &indent, &trailing_breaks, start_mark, &end_mark) { - return false - } - } - - /* Chomp the tail. */ - - if chomping != -1 { - s = append(s, leading_break...) - } - if chomping == 1 { - s = append(s, trailing_breaks...) - } - - /* Create a token. */ - - *token = yaml_token_t{ - token_type: yaml_SCALAR_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: s, - style: yaml_LITERAL_SCALAR_STYLE, - } - if !literal { - token.style = yaml_FOLDED_SCALAR_STYLE - } - - return true -} - -/* - * Scan indentation spaces and line breaks for a block scalar. Determine the - * indentation level if needed. - */ - -func yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t, - indent *int, breaks *[]byte, - start_mark YAML_mark_t, end_mark *YAML_mark_t) bool { - - *end_mark = parser.mark - - /* Eat the indentation spaces and line breaks. */ - max_indent := 0 - for { - /* Eat the indentation spaces. */ - - if !cache(parser, 1) { - return false - } - - for (*indent == 0 || parser.mark.column < *indent) && - is_space(parser.buffer[parser.buffer_pos]) { - skip(parser) - if !cache(parser, 1) { - return false - } - } - if parser.mark.column > max_indent { - max_indent = parser.mark.column - } - - /* Check for a tab character messing the indentation. */ - - if (*indent == 0 || parser.mark.column < *indent) && - is_tab(parser.buffer[parser.buffer_pos]) { - return yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found a tab character where an indentation space is expected") - } - - /* Have we found a non-empty line? */ - - if !is_break_at(parser.buffer, parser.buffer_pos) { - break - } - - /* Consume the line break. */ - - if !cache(parser, 2) { - return false - } - - *breaks = read_line(parser, *breaks) - *end_mark = parser.mark - } - - /* Determine the indentation level if needed. */ - - if *indent == 0 { - *indent = max_indent - if *indent < parser.indent+1 { - *indent = parser.indent + 1 - } - if *indent < 1 { - *indent = 1 - } - } - - return true -} - -/* - * Scan a quoted scalar. - */ - -func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, - single bool) bool { - - /* Eat the left quote. */ - - start_mark := parser.mark - - skip(parser) - - /* Consume the content of the quoted scalar. */ - var s []byte - var leading_break []byte - var trailing_breaks []byte - var whitespaces []byte - for { - /* Check that there are no document indicators at the beginning of the line. */ - - if !cache(parser, 4) { - return false - } - - if parser.mark.column == 0 && - ((parser.buffer[parser.buffer_pos] == '-' && - parser.buffer[parser.buffer_pos+1] == '-' && - parser.buffer[parser.buffer_pos+2] == '-') || - (parser.buffer[parser.buffer_pos] == '.' && - parser.buffer[parser.buffer_pos+1] == '.' && - parser.buffer[parser.buffer_pos+2] == '.')) && - is_blankz_at(parser.buffer, parser.buffer_pos+3) { - yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar", - start_mark, "found unexpected document indicator") - return false - } - - /* Check for EOF. */ - - if is_z(parser.buffer[parser.buffer_pos]) { - yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar", - start_mark, "found unexpected end of stream") - return false - } - - /* Consume non-blank characters. */ - - if !cache(parser, 2) { - return false - } - - leading_blanks := false - - for !is_blankz_at(parser.buffer, parser.buffer_pos) { - /* Check for an escaped single quote. */ - - if single && parser.buffer[parser.buffer_pos] == '\'' && - parser.buffer[parser.buffer_pos+1] == '\'' { - // Is is an escaped single quote. - s = append(s, '\'') - skip(parser) - skip(parser) - } else if single && parser.buffer[parser.buffer_pos] == '\'' { - /* Check for the right quote. */ - break - } else if !single && parser.buffer[parser.buffer_pos] == '"' { - /* Check for the right quote. */ - break - } else if !single && parser.buffer[parser.buffer_pos] == '\\' && - is_break_at(parser.buffer, parser.buffer_pos+1) { - - /* Check for an escaped line break. */ - if !cache(parser, 3) { - return false - } - - skip(parser) - skip_line(parser) - leading_blanks = true - break - } else if !single && parser.buffer[parser.buffer_pos] == '\\' { - - /* Check for an escape sequence. */ - - code_length := 0 - - /* Check the escape character. */ - - switch parser.buffer[parser.buffer_pos+1] { - case '0': - s = append(s, 0) - case 'a': - s = append(s, '\x07') - case 'b': - s = append(s, '\x08') - case 't', '\t': - s = append(s, '\x09') - case 'n': - s = append(s, '\x0A') - case 'v': - s = append(s, '\x0B') - case 'f': - s = append(s, '\x0C') - case 'r': - s = append(s, '\x0D') - case 'e': - s = append(s, '\x1B') - case ' ': - s = append(s, '\x20') - case '"': - s = append(s, '"') - case '/': - s = append(s, '/') - case '\\': - s = append(s, '\\') - case 'N': /* NEL (#x85) */ - s = append(s, '\xC2') - s = append(s, '\x85') - case '_': /* #xA0 */ - s = append(s, '\xC2') - s = append(s, '\xA0') - case 'L': /* LS (#x2028) */ - s = append(s, '\xE2') - s = append(s, '\x80') - s = append(s, '\xA8') - case 'P': /* PS (#x2029) */ - s = append(s, '\xE2') - s = append(s, '\x80') - s = append(s, '\xA9') - case 'x': - code_length = 2 - case 'u': - code_length = 4 - case 'U': - code_length = 8 - default: - yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", - start_mark, "found unknown escape character") - return false - } - - skip(parser) - skip(parser) - - /* Consume an arbitrary escape code. */ - - if code_length > 0 { - value := 0 - - /* Scan the character value. */ - - if !cache(parser, code_length) { - return false - } - - for k := 0; k < code_length; k++ { - if !is_hex(parser.buffer[parser.buffer_pos+k]) { - yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", - start_mark, "did not find expected hexdecimal number") - return false - } - value = (value << 4) + as_hex(parser.buffer[parser.buffer_pos+k]) - } - - /* Check the value and write the character. */ - - if (value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF { - yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", - start_mark, "found invalid Unicode character escape code") - return false - } - - if value <= 0x7F { - s = append(s, byte(value)) - } else if value <= 0x7FF { - s = append(s, byte(0xC0+(value>>6))) - s = append(s, byte(0x80+(value&0x3F))) - } else if value <= 0xFFFF { - s = append(s, byte(0xE0+(value>>12))) - s = append(s, byte(0x80+((value>>6)&0x3F))) - s = append(s, byte(0x80+(value&0x3F))) - } else { - s = append(s, byte(0xF0+(value>>18))) - s = append(s, byte(0x80+((value>>12)&0x3F))) - s = append(s, byte(0x80+((value>>6)&0x3F))) - s = append(s, byte(0x80+(value&0x3F))) - } - - /* Advance the pointer. */ - - for k := 0; k < code_length; k++ { - skip(parser) - } - } - } else { - /* It is a non-escaped non-blank character. */ - - s = read(parser, s) - } - - if !cache(parser, 2) { - return false - } - } - - /* Check if we are at the end of the scalar. */ - b := parser.buffer[parser.buffer_pos] - if single { - if b == '\'' { - break - } - } else if b == '"' { - break - } - - /* Consume blank characters. */ - - if !cache(parser, 1) { - return false - } - - for is_blank(parser.buffer[parser.buffer_pos]) || is_break_at(parser.buffer, parser.buffer_pos) { - if is_blank(parser.buffer[parser.buffer_pos]) { - /* Consume a space or a tab character. */ - if !leading_blanks { - whitespaces = read(parser, whitespaces) - } else { - skip(parser) - } - } else { - if !cache(parser, 2) { - return false - } - - /* Check if it is a first line break. */ - if !leading_blanks { - whitespaces = whitespaces[:0] - leading_break = read_line(parser, leading_break) - leading_blanks = true - } else { - trailing_breaks = read_line(parser, trailing_breaks) - } - } - - if !cache(parser, 1) { - return false - } - } - - /* Join the whitespaces or fold line breaks. */ - - if leading_blanks { - /* Do we need to fold line breaks? */ - - if len(leading_break) > 0 && leading_break[0] == '\n' { - if len(trailing_breaks) == 0 { - s = append(s, ' ') - } else { - s = append(s, trailing_breaks...) - trailing_breaks = trailing_breaks[:0] - } - - leading_break = leading_break[:0] - } else { - s = append(s, leading_break...) - s = append(s, trailing_breaks...) - leading_break = leading_break[:0] - trailing_breaks = trailing_breaks[:0] - } - } else { - s = append(s, whitespaces...) - whitespaces = whitespaces[:0] - } - } - - /* Eat the right quote. */ - - skip(parser) - - end_mark := parser.mark - - /* Create a token. */ - - *token = yaml_token_t{ - token_type: yaml_SCALAR_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: s, - style: yaml_SINGLE_QUOTED_SCALAR_STYLE, - } - if !single { - token.style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - - return true -} - -/* - * Scan a plain scalar. - */ - -func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) bool { - var s []byte - var leading_break []byte - var trailing_breaks []byte - var whitespaces []byte - leading_blanks := false - indent := parser.indent + 1 - - start_mark := parser.mark - end_mark := parser.mark - - /* Consume the content of the plain scalar. */ - - for { - /* Check for a document indicator. */ - - if !cache(parser, 4) { - return false - } - - if parser.mark.column == 0 && - ((parser.buffer[parser.buffer_pos] == '-' && - parser.buffer[parser.buffer_pos+1] == '-' && - parser.buffer[parser.buffer_pos+2] == '-') || - (parser.buffer[parser.buffer_pos] == '.' && - parser.buffer[parser.buffer_pos+1] == '.' && - parser.buffer[parser.buffer_pos+2] == '.')) && - is_blankz_at(parser.buffer, parser.buffer_pos+3) { - break - } - - /* Check for a comment. */ - - if parser.buffer[parser.buffer_pos] == '#' { - break - } - - /* Consume non-blank characters. */ - - for !is_blankz_at(parser.buffer, parser.buffer_pos) { - /* Check for 'x:x' in the flow context. TODO: Fix the test "spec-08-13". */ - - if parser.flow_level > 0 && - parser.buffer[parser.buffer_pos] == ':' && - !is_blankz_at(parser.buffer, parser.buffer_pos+1) { - yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", - start_mark, "found unexpected ':'") - return false - } - - /* Check for indicators that may end a plain scalar. */ - b := parser.buffer[parser.buffer_pos] - if (b == ':' && is_blankz_at(parser.buffer, parser.buffer_pos+1)) || - (parser.flow_level > 0 && - (b == ',' || b == ':' || - b == '?' || b == '[' || - b == ']' || b == '{' || - b == '}')) { - break - } - - /* Check if we need to join whitespaces and breaks. */ - - if leading_blanks || len(whitespaces) > 0 { - if leading_blanks { - /* Do we need to fold line breaks? */ - - if leading_break[0] == '\n' { - if len(trailing_breaks) == 0 { - s = append(s, ' ') - } else { - s = append(s, trailing_breaks...) - trailing_breaks = trailing_breaks[:0] - } - leading_break = leading_break[:0] - } else { - s = append(s, leading_break...) - s = append(s, trailing_breaks...) - leading_break = leading_break[:0] - trailing_breaks = trailing_breaks[:0] - } - - leading_blanks = false - } else { - s = append(s, whitespaces...) - whitespaces = whitespaces[:0] - } - } - - /* Copy the character. */ - - s = read(parser, s) - end_mark = parser.mark - - if !cache(parser, 2) { - return false - } - } - - /* Is it the end? */ - - if !(is_blank(parser.buffer[parser.buffer_pos]) || - is_break_at(parser.buffer, parser.buffer_pos)) { - break - } - - /* Consume blank characters. */ - - if !cache(parser, 1) { - return false - } - - for is_blank(parser.buffer[parser.buffer_pos]) || - is_break_at(parser.buffer, parser.buffer_pos) { - - if is_blank(parser.buffer[parser.buffer_pos]) { - /* Check for tab character that abuse indentation. */ - - if leading_blanks && parser.mark.column < indent && - is_tab(parser.buffer[parser.buffer_pos]) { - yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", - start_mark, "found a tab character that violate indentation") - return false - } - - /* Consume a space or a tab character. */ - - if !leading_blanks { - whitespaces = read(parser, whitespaces) - } else { - skip(parser) - } - } else { - if !cache(parser, 2) { - return false - } - - /* Check if it is a first line break. */ - - if !leading_blanks { - whitespaces = whitespaces[:0] - leading_break = read_line(parser, leading_break) - leading_blanks = true - } else { - trailing_breaks = read_line(parser, trailing_breaks) - } - } - if !cache(parser, 1) { - return false - } - } - - /* Check indentation level. */ - - if parser.flow_level == 0 && parser.mark.column < indent { - break - } - } - - /* Create a token. */ - - *token = yaml_token_t{ - token_type: yaml_SCALAR_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: s, - style: yaml_PLAIN_SCALAR_STYLE, - } - - /* Note that we change the 'simple_key_allowed' flag. */ - - if leading_blanks { - parser.simple_key_allowed = true - } - - return true -} diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/tags.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/tags.go deleted file mode 100644 index f153aee46..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/tags.go +++ /dev/null @@ -1,360 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -import ( - "reflect" - "sort" - "strings" - "sync" - "unicode" -) - -// A field represents a single field found in a struct. -type field struct { - name string - tag bool - index []int - typ reflect.Type - omitEmpty bool - flow bool -} - -// byName sorts field by name, breaking ties with depth, -// then breaking ties with "name came from json tag", then -// breaking ties with index sequence. -type byName []field - -func (x byName) Len() int { return len(x) } - -func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x byName) Less(i, j int) bool { - if x[i].name != x[j].name { - return x[i].name < x[j].name - } - if len(x[i].index) != len(x[j].index) { - return len(x[i].index) < len(x[j].index) - } - if x[i].tag != x[j].tag { - return x[i].tag - } - return byIndex(x).Less(i, j) -} - -// byIndex sorts field by index sequence. -type byIndex []field - -func (x byIndex) Len() int { return len(x) } - -func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x byIndex) Less(i, j int) bool { - for k, xik := range x[i].index { - if k >= len(x[j].index) { - return false - } - if xik != x[j].index[k] { - return xik < x[j].index[k] - } - } - return len(x[i].index) < len(x[j].index) -} - -// typeFields returns a list of fields that JSON should recognize for the given type. -// The algorithm is breadth-first search over the set of structs to include - the top struct -// and then any reachable anonymous structs. -func typeFields(t reflect.Type) []field { - // Anonymous fields to explore at the current level and the next. - current := []field{} - next := []field{{typ: t}} - - // Count of queued names for current level and the next. - count := map[reflect.Type]int{} - nextCount := map[reflect.Type]int{} - - // Types already visited at an earlier level. - visited := map[reflect.Type]bool{} - - // Fields found. - var fields []field - - for len(next) > 0 { - current, next = next, current[:0] - count, nextCount = nextCount, map[reflect.Type]int{} - - for _, f := range current { - if visited[f.typ] { - continue - } - visited[f.typ] = true - - // Scan f.typ for fields to include. - for i := 0; i < f.typ.NumField(); i++ { - sf := f.typ.Field(i) - if sf.PkgPath != "" { // unexported - continue - } - tag := sf.Tag.Get("yaml") - if tag == "-" { - continue - } - name, opts := parseTag(tag) - if !isValidTag(name) { - name = "" - } - index := make([]int, len(f.index)+1) - copy(index, f.index) - index[len(f.index)] = i - - ft := sf.Type - if ft.Name() == "" && ft.Kind() == reflect.Ptr { - // Follow pointer. - ft = ft.Elem() - } - - // Record found field and index sequence. - if name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct { - tagged := name != "" - if name == "" { - name = sf.Name - } - fields = append(fields, field{name, tagged, index, ft, - opts.Contains("omitempty"), opts.Contains("flow")}) - if count[f.typ] > 1 { - // If there were multiple instances, add a second, - // so that the annihilation code will see a duplicate. - // It only cares about the distinction between 1 or 2, - // so don't bother generating any more copies. - fields = append(fields, fields[len(fields)-1]) - } - continue - } - - // Record new anonymous struct to explore in next round. - nextCount[ft]++ - if nextCount[ft] == 1 { - next = append(next, field{name: ft.Name(), index: index, typ: ft}) - } - } - } - } - - sort.Sort(byName(fields)) - - // Delete all fields that are hidden by the Go rules for embedded fields, - // except that fields with JSON tags are promoted. - - // The fields are sorted in primary order of name, secondary order - // of field index length. Loop over names; for each name, delete - // hidden fields by choosing the one dominant field that survives. - out := fields[:0] - for advance, i := 0, 0; i < len(fields); i += advance { - // One iteration per name. - // Find the sequence of fields with the name of this first field. - fi := fields[i] - name := fi.name - for advance = 1; i+advance < len(fields); advance++ { - fj := fields[i+advance] - if fj.name != name { - break - } - } - if advance == 1 { // Only one field with this name - out = append(out, fi) - continue - } - dominant, ok := dominantField(fields[i : i+advance]) - if ok { - out = append(out, dominant) - } - } - - fields = out - sort.Sort(byIndex(fields)) - - return fields -} - -// dominantField looks through the fields, all of which are known to -// have the same name, to find the single field that dominates the -// others using Go's embedding rules, modified by the presence of -// JSON tags. If there are multiple top-level fields, the boolean -// will be false: This condition is an error in Go and we skip all -// the fields. -func dominantField(fields []field) (field, bool) { - // The fields are sorted in increasing index-length order. The winner - // must therefore be one with the shortest index length. Drop all - // longer entries, which is easy: just truncate the slice. - length := len(fields[0].index) - tagged := -1 // Index of first tagged field. - for i, f := range fields { - if len(f.index) > length { - fields = fields[:i] - break - } - if f.tag { - if tagged >= 0 { - // Multiple tagged fields at the same level: conflict. - // Return no field. - return field{}, false - } - tagged = i - } - } - if tagged >= 0 { - return fields[tagged], true - } - // All remaining fields have the same length. If there's more than one, - // we have a conflict (two fields named "X" at the same level) and we - // return no field. - if len(fields) > 1 { - return field{}, false - } - return fields[0], true -} - -var fieldCache struct { - sync.RWMutex - m map[reflect.Type][]field -} - -// cachedTypeFields is like typeFields but uses a cache to avoid repeated work. -func cachedTypeFields(t reflect.Type) []field { - fieldCache.RLock() - f := fieldCache.m[t] - fieldCache.RUnlock() - if f != nil { - return f - } - - // Compute fields without lock. - // Might duplicate effort but won't hold other computations back. - f = typeFields(t) - if f == nil { - f = []field{} - } - - fieldCache.Lock() - if fieldCache.m == nil { - fieldCache.m = map[reflect.Type][]field{} - } - fieldCache.m[t] = f - fieldCache.Unlock() - return f -} - -// tagOptions is the string following a comma in a struct field's "json" -// tag, or the empty string. It does not include the leading comma. -type tagOptions string - -func isValidTag(s string) bool { - if s == "" { - return false - } - for _, c := range s { - switch { - case strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~ ", c): - // Backslash and quote chars are reserved, but - // otherwise any punctuation chars are allowed - // in a tag name. - default: - if !unicode.IsLetter(c) && !unicode.IsDigit(c) { - return false - } - } - } - return true -} - -func fieldByIndex(v reflect.Value, index []int) reflect.Value { - for _, i := range index { - if v.Kind() == reflect.Ptr { - if v.IsNil() { - return reflect.Value{} - } - v = v.Elem() - } - v = v.Field(i) - } - return v -} - -func typeByIndex(t reflect.Type, index []int) reflect.Type { - for _, i := range index { - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - t = t.Field(i).Type - } - return t -} - -// stringValues is a slice of reflect.Value holding *reflect.StringValue. -// It implements the methods to sort by string. -type stringValues []reflect.Value - -func (sv stringValues) Len() int { return len(sv) } -func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } -func (sv stringValues) Less(i, j int) bool { - av, ak := getElem(sv[i]) - bv, bk := getElem(sv[j]) - if ak == reflect.String && bk == reflect.String { - return av.String() < bv.String() - } - - return ak < bk -} - -func getElem(v reflect.Value) (reflect.Value, reflect.Kind) { - k := v.Kind() - for k == reflect.Interface || k == reflect.Ptr && !v.IsNil() { - v = v.Elem() - k = v.Kind() - } - - return v, k -} - -// parseTag splits a struct field's json tag into its name and -// comma-separated options. -func parseTag(tag string) (string, tagOptions) { - if idx := strings.Index(tag, ","); idx != -1 { - return tag[:idx], tagOptions(tag[idx+1:]) - } - return tag, tagOptions("") -} - -// Contains reports whether a comma-separated list of options -// contains a particular substr flag. substr must be surrounded by a -// string boundary or commas. -func (o tagOptions) Contains(optionName string) bool { - if len(o) == 0 { - return false - } - s := string(o) - for s != "" { - var next string - i := strings.Index(s, ",") - if i >= 0 { - s, next = s[:i], s[i+1:] - } - if s == optionName { - return true - } - s = next - } - return false -} diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/writer.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/writer.go deleted file mode 100644 index a76b63363..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/writer.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -/* - * Set the writer error and return 0. - */ - -func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { - emitter.error = yaml_WRITER_ERROR - emitter.problem = problem - - return false -} - -/* - * Flush the output buffer. - */ - -func yaml_emitter_flush(emitter *yaml_emitter_t) bool { - if emitter.write_handler == nil { - panic("Write handler must be set") /* Write handler must be set. */ - } - if emitter.encoding == yaml_ANY_ENCODING { - panic("Encoding must be set") /* Output encoding must be set. */ - } - - /* Check if the buffer is empty. */ - - if emitter.buffer_pos == 0 { - return true - } - - /* If the output encoding is UTF-8, we don't need to recode the buffer. */ - - if emitter.encoding == yaml_UTF8_ENCODING { - if err := emitter.write_handler(emitter, - emitter.buffer[:emitter.buffer_pos]); err != nil { - return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) - } - emitter.buffer_pos = 0 - return true - } - - /* Recode the buffer into the raw buffer. */ - - var low, high int - if emitter.encoding == yaml_UTF16LE_ENCODING { - low, high = 0, 1 - } else { - high, low = 1, 0 - } - - pos := 0 - for pos < emitter.buffer_pos { - - /* - * See the "reader.c" code for more details on UTF-8 encoding. Note - * that we assume that the buffer contains a valid UTF-8 sequence. - */ - - /* Read the next UTF-8 character. */ - - octet := emitter.buffer[pos] - - var w int - var value rune - switch { - case octet&0x80 == 0x00: - w, value = 1, rune(octet&0x7F) - case octet&0xE0 == 0xC0: - w, value = 2, rune(octet&0x1F) - case octet&0xF0 == 0xE0: - w, value = 3, rune(octet&0x0F) - case octet&0xF8 == 0xF0: - w, value = 4, rune(octet&0x07) - } - - for k := 1; k < w; k++ { - octet = emitter.buffer[pos+k] - value = (value << 6) + (rune(octet) & 0x3F) - } - - pos += w - - /* Write the character. */ - - if value < 0x10000 { - var b [2]byte - b[high] = byte(value >> 8) - b[low] = byte(value & 0xFF) - emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1]) - } else { - /* Write the character using a surrogate pair (check "reader.c"). */ - - var b [4]byte - value -= 0x10000 - b[high] = byte(0xD8 + (value >> 18)) - b[low] = byte((value >> 10) & 0xFF) - b[high+2] = byte(0xDC + ((value >> 8) & 0xFF)) - b[low+2] = byte(value & 0xFF) - emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1], b[2], b[3]) - } - } - - /* Write the raw buffer. */ - - // Write the raw buffer. - if err := emitter.write_handler(emitter, emitter.raw_buffer); err != nil { - return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) - } - - emitter.buffer_pos = 0 - emitter.raw_buffer = emitter.raw_buffer[:0] - return true -} diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/yaml_definesh.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/yaml_definesh.go deleted file mode 100644 index de4c05ad8..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/yaml_definesh.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -const ( - yaml_VERSION_MAJOR = 0 - yaml_VERSION_MINOR = 1 - yaml_VERSION_PATCH = 6 - yaml_VERSION_STRING = "0.1.6" -) diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/yaml_privateh.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/yaml_privateh.go deleted file mode 100644 index 2b3b7d749..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/yaml_privateh.go +++ /dev/null @@ -1,891 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -const ( - INPUT_RAW_BUFFER_SIZE = 1024 - - /* - * The size of the input buffer. - * - * It should be possible to decode the whole raw buffer. - */ - INPUT_BUFFER_SIZE = (INPUT_RAW_BUFFER_SIZE * 3) - - /* - * The size of the output buffer. - */ - - OUTPUT_BUFFER_SIZE = 512 - - /* - * The size of the output raw buffer. - * - * It should be possible to encode the whole output buffer. - */ - - OUTPUT_RAW_BUFFER_SIZE = (OUTPUT_BUFFER_SIZE*2 + 2) - - INITIAL_STACK_SIZE = 16 - INITIAL_QUEUE_SIZE = 16 -) - -func width(b byte) int { - if b&0x80 == 0 { - return 1 - } - - if b&0xE0 == 0xC0 { - return 2 - } - - if b&0xF0 == 0xE0 { - return 3 - } - - if b&0xF8 == 0xF0 { - return 4 - } - - return 0 -} - -func copy_bytes(dest []byte, dest_pos *int, src []byte, src_pos *int) { - w := width(src[*src_pos]) - switch w { - case 4: - dest[*dest_pos+3] = src[*src_pos+3] - fallthrough - case 3: - dest[*dest_pos+2] = src[*src_pos+2] - fallthrough - case 2: - dest[*dest_pos+1] = src[*src_pos+1] - fallthrough - case 1: - dest[*dest_pos] = src[*src_pos] - default: - panic("invalid width") - } - *dest_pos += w - *src_pos += w -} - -// /* -// * Check if the character at the specified position is an alphabetical -// * character, a digit, '_', or '-'. -// */ - -func is_alpha(b byte) bool { - return (b >= '0' && b <= '9') || - (b >= 'A' && b <= 'Z') || - (b >= 'a' && b <= 'z') || - b == '_' || b == '-' -} - -// /* -// * Check if the character at the specified position is a digit. -// */ -// -func is_digit(b byte) bool { - return b >= '0' && b <= '9' -} - -// /* -// * Get the value of a digit. -// */ -// -func as_digit(b byte) int { - return int(b) - '0' -} - -// /* -// * Check if the character at the specified position is a hex-digit. -// */ -// -func is_hex(b byte) bool { - return (b >= '0' && b <= '9') || - (b >= 'A' && b <= 'F') || - (b >= 'a' && b <= 'f') -} - -// -// /* -// * Get the value of a hex-digit. -// */ -// -func as_hex(b byte) int { - if b >= 'A' && b <= 'F' { - return int(b) - 'A' + 10 - } else if b >= 'a' && b <= 'f' { - return int(b) - 'a' + 10 - } - return int(b) - '0' -} - -// #define AS_HEX_AT(string,offset) \ -// (((string).pointer[offset] >= (yaml_char_t) 'A' && \ -// (string).pointer[offset] <= (yaml_char_t) 'F') ? \ -// ((string).pointer[offset] - (yaml_char_t) 'A' + 10) : \ -// ((string).pointer[offset] >= (yaml_char_t) 'a' && \ -// (string).pointer[offset] <= (yaml_char_t) 'f') ? \ -// ((string).pointer[offset] - (yaml_char_t) 'a' + 10) : \ -// ((string).pointer[offset] - (yaml_char_t) '0')) - -// /* -// * Check if the character is a line break, space, tab, or NUL. -// */ -func is_blankz_at(b []byte, i int) bool { - return is_blank(b[i]) || is_breakz_at(b, i) -} - -// /* -// * Check if the character at the specified position is a line break. -// */ -func is_break_at(b []byte, i int) bool { - return b[i] == '\r' || /* CR (#xD)*/ - b[i] == '\n' || /* LF (#xA) */ - (b[i] == 0xC2 && b[i+1] == 0x85) || /* NEL (#x85) */ - (b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8) || /* LS (#x2028) */ - (b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) /* PS (#x2029) */ -} - -func is_breakz_at(b []byte, i int) bool { - return is_break_at(b, i) || is_z(b[i]) -} - -func is_crlf_at(b []byte, i int) bool { - return b[i] == '\r' && b[i+1] == '\n' -} - -// /* -// * Check if the character at the specified position is NUL. -// */ -func is_z(b byte) bool { - return b == 0x0 -} - -// /* -// * Check if the character at the specified position is space. -// */ -func is_space(b byte) bool { - return b == ' ' -} - -// -// /* -// * Check if the character at the specified position is tab. -// */ -func is_tab(b byte) bool { - return b == '\t' -} - -// /* -// * Check if the character at the specified position is blank (space or tab). -// */ -func is_blank(b byte) bool { - return is_space(b) || is_tab(b) -} - -// /* -// * Check if the character is ASCII. -// */ -func is_ascii(b byte) bool { - return b <= '\x7f' -} - -// /* -// * Check if the character can be printed unescaped. -// */ -func is_printable_at(b []byte, i int) bool { - return ((b[i] == 0x0A) || /* . == #x0A */ - (b[i] >= 0x20 && b[i] <= 0x7E) || /* #x20 <= . <= #x7E */ - (b[i] == 0xC2 && b[i+1] >= 0xA0) || /* #0xA0 <= . <= #xD7FF */ - (b[i] > 0xC2 && b[i] < 0xED) || - (b[i] == 0xED && b[i+1] < 0xA0) || - (b[i] == 0xEE) || - (b[i] == 0xEF && /* && . != #xFEFF */ - !(b[i+1] == 0xBB && b[i+2] == 0xBF) && - !(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF)))) -} - -func insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) { - // collapse the slice - if parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) { - if parser.tokens_head != len(parser.tokens) { - // move the tokens down - copy(parser.tokens, parser.tokens[parser.tokens_head:]) - } - // readjust the length - parser.tokens = parser.tokens[:len(parser.tokens)-parser.tokens_head] - parser.tokens_head = 0 - } - - parser.tokens = append(parser.tokens, *token) - if pos < 0 { - return - } - copy(parser.tokens[parser.tokens_head+pos+1:], parser.tokens[parser.tokens_head+pos:]) - parser.tokens[parser.tokens_head+pos] = *token -} - -// /* -// * Check if the character at the specified position is BOM. -// */ -// -func is_bom_at(b []byte, i int) bool { - return b[i] == 0xEF && b[i+1] == 0xBB && b[i+2] == 0xBF -} - -// -// #ifdef HAVE_CONFIG_H -// #include -// #endif -// -// #include "./yaml.h" -// -// #include -// #include -// -// /* -// * Memory management. -// */ -// -// yaml_DECLARE(void *) -// yaml_malloc(size_t size); -// -// yaml_DECLARE(void *) -// yaml_realloc(void *ptr, size_t size); -// -// yaml_DECLARE(void) -// yaml_free(void *ptr); -// -// yaml_DECLARE(yaml_char_t *) -// yaml_strdup(const yaml_char_t *); -// -// /* -// * Reader: Ensure that the buffer contains at least `length` characters. -// */ -// -// yaml_DECLARE(int) -// yaml_parser_update_buffer(yaml_parser_t *parser, size_t length); -// -// /* -// * Scanner: Ensure that the token stack contains at least one token ready. -// */ -// -// yaml_DECLARE(int) -// yaml_parser_fetch_more_tokens(yaml_parser_t *parser); -// -// /* -// * The size of the input raw buffer. -// */ -// -// #define INPUT_RAW_BUFFER_SIZE 16384 -// -// /* -// * The size of the input buffer. -// * -// * It should be possible to decode the whole raw buffer. -// */ -// -// #define INPUT_BUFFER_SIZE (INPUT_RAW_BUFFER_SIZE*3) -// -// /* -// * The size of the output buffer. -// */ -// -// #define OUTPUT_BUFFER_SIZE 16384 -// -// /* -// * The size of the output raw buffer. -// * -// * It should be possible to encode the whole output buffer. -// */ -// -// #define OUTPUT_RAW_BUFFER_SIZE (OUTPUT_BUFFER_SIZE*2+2) -// -// /* -// * The size of other stacks and queues. -// */ -// -// #define INITIAL_STACK_SIZE 16 -// #define INITIAL_QUEUE_SIZE 16 -// #define INITIAL_STRING_SIZE 16 -// -// /* -// * Buffer management. -// */ -// -// #define BUFFER_INIT(context,buffer,size) \ -// (((buffer).start = yaml_malloc(size)) ? \ -// ((buffer).last = (buffer).pointer = (buffer).start, \ -// (buffer).end = (buffer).start+(size), \ -// 1) : \ -// ((context)->error = yaml_MEMORY_ERROR, \ -// 0)) -// -// #define BUFFER_DEL(context,buffer) \ -// (yaml_free((buffer).start), \ -// (buffer).start = (buffer).pointer = (buffer).end = 0) -// -// /* -// * String management. -// */ -// -// typedef struct { -// yaml_char_t *start; -// yaml_char_t *end; -// yaml_char_t *pointer; -// } yaml_string_t; -// -// yaml_DECLARE(int) -// yaml_string_extend(yaml_char_t **start, -// yaml_char_t **pointer, yaml_char_t **end); -// -// yaml_DECLARE(int) -// yaml_string_join( -// yaml_char_t **a_start, yaml_char_t **a_pointer, yaml_char_t **a_end, -// yaml_char_t **b_start, yaml_char_t **b_pointer, yaml_char_t **b_end); -// -// #define NULL_STRING { NULL, NULL, NULL } -// -// #define STRING(string,length) { (string), (string)+(length), (string) } -// -// #define STRING_ASSIGN(value,string,length) \ -// ((value).start = (string), \ -// (value).end = (string)+(length), \ -// (value).pointer = (string)) -// -// #define STRING_INIT(context,string,size) \ -// (((string).start = yaml_malloc(size)) ? \ -// ((string).pointer = (string).start, \ -// (string).end = (string).start+(size), \ -// memset((string).start, 0, (size)), \ -// 1) : \ -// ((context)->error = yaml_MEMORY_ERROR, \ -// 0)) -// -// #define STRING_DEL(context,string) \ -// (yaml_free((string).start), \ -// (string).start = (string).pointer = (string).end = 0) -// -// #define STRING_EXTEND(context,string) \ -// (((string).pointer+5 < (string).end) \ -// || yaml_string_extend(&(string).start, \ -// &(string).pointer, &(string).end)) -// -// #define CLEAR(context,string) \ -// ((string).pointer = (string).start, \ -// memset((string).start, 0, (string).end-(string).start)) -// -// #define JOIN(context,string_a,string_b) \ -// ((yaml_string_join(&(string_a).start, &(string_a).pointer, \ -// &(string_a).end, &(string_b).start, \ -// &(string_b).pointer, &(string_b).end)) ? \ -// ((string_b).pointer = (string_b).start, \ -// 1) : \ -// ((context)->error = yaml_MEMORY_ERROR, \ -// 0)) -// -// /* -// * String check operations. -// */ -// -// /* -// * Check the octet at the specified position. -// */ -// -// #define CHECK_AT(string,octet,offset) \ -// ((string).pointer[offset] == (yaml_char_t)(octet)) -// -// /* -// * Check the current octet in the buffer. -// */ -// -// #define CHECK(string,octet) CHECK_AT((string),(octet),0) -// -// /* -// * Check if the character at the specified position is an alphabetical -// * character, a digit, '_', or '-'. -// */ -// -// #define IS_ALPHA_AT(string,offset) \ -// (((string).pointer[offset] >= (yaml_char_t) '0' && \ -// (string).pointer[offset] <= (yaml_char_t) '9') || \ -// ((string).pointer[offset] >= (yaml_char_t) 'A' && \ -// (string).pointer[offset] <= (yaml_char_t) 'Z') || \ -// ((string).pointer[offset] >= (yaml_char_t) 'a' && \ -// (string).pointer[offset] <= (yaml_char_t) 'z') || \ -// (string).pointer[offset] == '_' || \ -// (string).pointer[offset] == '-') -// -// #define IS_ALPHA(string) IS_ALPHA_AT((string),0) -// -// /* -// * Check if the character at the specified position is a digit. -// */ -// -// #define IS_DIGIT_AT(string,offset) \ -// (((string).pointer[offset] >= (yaml_char_t) '0' && \ -// (string).pointer[offset] <= (yaml_char_t) '9')) -// -// #define IS_DIGIT(string) IS_DIGIT_AT((string),0) -// -// /* -// * Get the value of a digit. -// */ -// -// #define AS_DIGIT_AT(string,offset) \ -// ((string).pointer[offset] - (yaml_char_t) '0') -// -// #define AS_DIGIT(string) AS_DIGIT_AT((string),0) -// -// /* -// * Check if the character at the specified position is a hex-digit. -// */ -// -// #define IS_HEX_AT(string,offset) \ -// (((string).pointer[offset] >= (yaml_char_t) '0' && \ -// (string).pointer[offset] <= (yaml_char_t) '9') || \ -// ((string).pointer[offset] >= (yaml_char_t) 'A' && \ -// (string).pointer[offset] <= (yaml_char_t) 'F') || \ -// ((string).pointer[offset] >= (yaml_char_t) 'a' && \ -// (string).pointer[offset] <= (yaml_char_t) 'f')) -// -// #define IS_HEX(string) IS_HEX_AT((string),0) -// -// /* -// * Get the value of a hex-digit. -// */ -// -// #define AS_HEX_AT(string,offset) \ -// (((string).pointer[offset] >= (yaml_char_t) 'A' && \ -// (string).pointer[offset] <= (yaml_char_t) 'F') ? \ -// ((string).pointer[offset] - (yaml_char_t) 'A' + 10) : \ -// ((string).pointer[offset] >= (yaml_char_t) 'a' && \ -// (string).pointer[offset] <= (yaml_char_t) 'f') ? \ -// ((string).pointer[offset] - (yaml_char_t) 'a' + 10) : \ -// ((string).pointer[offset] - (yaml_char_t) '0')) -// -// #define AS_HEX(string) AS_HEX_AT((string),0) -// -// /* -// * Check if the character is ASCII. -// */ -// -// #define IS_ASCII_AT(string,offset) \ -// ((string).pointer[offset] <= (yaml_char_t) '\x7F') -// -// #define IS_ASCII(string) IS_ASCII_AT((string),0) -// -// /* -// * Check if the character can be printed unescaped. -// */ -// -// #define IS_PRINTABLE_AT(string,offset) \ -// (((string).pointer[offset] == 0x0A) /* . == #x0A */ \ -// || ((string).pointer[offset] >= 0x20 /* #x20 <= . <= #x7E */ \ -// && (string).pointer[offset] <= 0x7E) \ -// || ((string).pointer[offset] == 0xC2 /* #0xA0 <= . <= #xD7FF */ \ -// && (string).pointer[offset+1] >= 0xA0) \ -// || ((string).pointer[offset] > 0xC2 \ -// && (string).pointer[offset] < 0xED) \ -// || ((string).pointer[offset] == 0xED \ -// && (string).pointer[offset+1] < 0xA0) \ -// || ((string).pointer[offset] == 0xEE) \ -// || ((string).pointer[offset] == 0xEF /* #xE000 <= . <= #xFFFD */ \ -// && !((string).pointer[offset+1] == 0xBB /* && . != #xFEFF */ \ -// && (string).pointer[offset+2] == 0xBF) \ -// && !((string).pointer[offset+1] == 0xBF \ -// && ((string).pointer[offset+2] == 0xBE \ -// || (string).pointer[offset+2] == 0xBF)))) -// -// #define IS_PRINTABLE(string) IS_PRINTABLE_AT((string),0) -// -// /* -// * Check if the character at the specified position is NUL. -// */ -// -// #define IS_Z_AT(string,offset) CHECK_AT((string),'\0',(offset)) -// -// #define IS_Z(string) IS_Z_AT((string),0) -// -// /* -// * Check if the character at the specified position is BOM. -// */ -// -// #define IS_BOM_AT(string,offset) \ -// (CHECK_AT((string),'\xEF',(offset)) \ -// && CHECK_AT((string),'\xBB',(offset)+1) \ -// && CHECK_AT((string),'\xBF',(offset)+2)) /* BOM (#xFEFF) */ -// -// #define IS_BOM(string) IS_BOM_AT(string,0) -// -// /* -// * Check if the character at the specified position is space. -// */ -// -// #define IS_SPACE_AT(string,offset) CHECK_AT((string),' ',(offset)) -// -// #define IS_SPACE(string) IS_SPACE_AT((string),0) -// -// /* -// * Check if the character at the specified position is tab. -// */ -// -// #define IS_TAB_AT(string,offset) CHECK_AT((string),'\t',(offset)) -// -// #define IS_TAB(string) IS_TAB_AT((string),0) -// -// /* -// * Check if the character at the specified position is blank (space or tab). -// */ -// -// #define IS_BLANK_AT(string,offset) \ -// (IS_SPACE_AT((string),(offset)) || IS_TAB_AT((string),(offset))) -// -// #define IS_BLANK(string) IS_BLANK_AT((string),0) -// -// /* -// * Check if the character at the specified position is a line break. -// */ -// -// #define IS_BREAK_AT(string,offset) \ -// (CHECK_AT((string),'\r',(offset)) /* CR (#xD)*/ \ -// || CHECK_AT((string),'\n',(offset)) /* LF (#xA) */ \ -// || (CHECK_AT((string),'\xC2',(offset)) \ -// && CHECK_AT((string),'\x85',(offset)+1)) /* NEL (#x85) */ \ -// || (CHECK_AT((string),'\xE2',(offset)) \ -// && CHECK_AT((string),'\x80',(offset)+1) \ -// && CHECK_AT((string),'\xA8',(offset)+2)) /* LS (#x2028) */ \ -// || (CHECK_AT((string),'\xE2',(offset)) \ -// && CHECK_AT((string),'\x80',(offset)+1) \ -// && CHECK_AT((string),'\xA9',(offset)+2))) /* PS (#x2029) */ -// -// #define IS_BREAK(string) IS_BREAK_AT((string),0) -// -// #define IS_CRLF_AT(string,offset) \ -// (CHECK_AT((string),'\r',(offset)) && CHECK_AT((string),'\n',(offset)+1)) -// -// #define IS_CRLF(string) IS_CRLF_AT((string),0) -// -// /* -// * Check if the character is a line break or NUL. -// */ -// -// #define IS_BREAKZ_AT(string,offset) \ -// (IS_BREAK_AT((string),(offset)) || IS_Z_AT((string),(offset))) -// -// #define IS_BREAKZ(string) IS_BREAKZ_AT((string),0) -// -// /* -// * Check if the character is a line break, space, or NUL. -// */ -// -// #define IS_SPACEZ_AT(string,offset) \ -// (IS_SPACE_AT((string),(offset)) || IS_BREAKZ_AT((string),(offset))) -// -// #define IS_SPACEZ(string) IS_SPACEZ_AT((string),0) -// -// /* -// * Check if the character is a line break, space, tab, or NUL. -// */ -// -// #define IS_BLANKZ_AT(string,offset) \ -// (IS_BLANK_AT((string),(offset)) || IS_BREAKZ_AT((string),(offset))) -// -// #define IS_BLANKZ(string) IS_BLANKZ_AT((string),0) -// -// /* -// * Determine the width of the character. -// */ -// -// #define WIDTH_AT(string,offset) \ -// (((string).pointer[offset] & 0x80) == 0x00 ? 1 : \ -// ((string).pointer[offset] & 0xE0) == 0xC0 ? 2 : \ -// ((string).pointer[offset] & 0xF0) == 0xE0 ? 3 : \ -// ((string).pointer[offset] & 0xF8) == 0xF0 ? 4 : 0) -// -// #define WIDTH(string) WIDTH_AT((string),0) -// -// /* -// * Move the string pointer to the next character. -// */ -// -// #define MOVE(string) ((string).pointer += WIDTH((string))) -// -// /* -// * Copy a character and move the pointers of both strings. -// */ -// -// #define COPY(string_a,string_b) \ -// ((*(string_b).pointer & 0x80) == 0x00 ? \ -// (*((string_a).pointer++) = *((string_b).pointer++)) : \ -// (*(string_b).pointer & 0xE0) == 0xC0 ? \ -// (*((string_a).pointer++) = *((string_b).pointer++), \ -// *((string_a).pointer++) = *((string_b).pointer++)) : \ -// (*(string_b).pointer & 0xF0) == 0xE0 ? \ -// (*((string_a).pointer++) = *((string_b).pointer++), \ -// *((string_a).pointer++) = *((string_b).pointer++), \ -// *((string_a).pointer++) = *((string_b).pointer++)) : \ -// (*(string_b).pointer & 0xF8) == 0xF0 ? \ -// (*((string_a).pointer++) = *((string_b).pointer++), \ -// *((string_a).pointer++) = *((string_b).pointer++), \ -// *((string_a).pointer++) = *((string_b).pointer++), \ -// *((string_a).pointer++) = *((string_b).pointer++)) : 0) -// -// /* -// * Stack and queue management. -// */ -// -// yaml_DECLARE(int) -// yaml_stack_extend(void **start, void **top, void **end); -// -// yaml_DECLARE(int) -// yaml_queue_extend(void **start, void **head, void **tail, void **end); -// -// #define STACK_INIT(context,stack,size) \ -// (((stack).start = yaml_malloc((size)*sizeof(*(stack).start))) ? \ -// ((stack).top = (stack).start, \ -// (stack).end = (stack).start+(size), \ -// 1) : \ -// ((context)->error = yaml_MEMORY_ERROR, \ -// 0)) -// -// #define STACK_DEL(context,stack) \ -// (yaml_free((stack).start), \ -// (stack).start = (stack).top = (stack).end = 0) -// -// #define STACK_EMPTY(context,stack) \ -// ((stack).start == (stack).top) -// -// #define PUSH(context,stack,value) \ -// (((stack).top != (stack).end \ -// || yaml_stack_extend((void **)&(stack).start, \ -// (void **)&(stack).top, (void **)&(stack).end)) ? \ -// (*((stack).top++) = value, \ -// 1) : \ -// ((context)->error = yaml_MEMORY_ERROR, \ -// 0)) -// -// #define POP(context,stack) \ -// (*(--(stack).top)) -// -// #define QUEUE_INIT(context,queue,size) \ -// (((queue).start = yaml_malloc((size)*sizeof(*(queue).start))) ? \ -// ((queue).head = (queue).tail = (queue).start, \ -// (queue).end = (queue).start+(size), \ -// 1) : \ -// ((context)->error = yaml_MEMORY_ERROR, \ -// 0)) -// -// #define QUEUE_DEL(context,queue) \ -// (yaml_free((queue).start), \ -// (queue).start = (queue).head = (queue).tail = (queue).end = 0) -// -// #define QUEUE_EMPTY(context,queue) \ -// ((queue).head == (queue).tail) -// -// #define ENQUEUE(context,queue,value) \ -// (((queue).tail != (queue).end \ -// || yaml_queue_extend((void **)&(queue).start, (void **)&(queue).head, \ -// (void **)&(queue).tail, (void **)&(queue).end)) ? \ -// (*((queue).tail++) = value, \ -// 1) : \ -// ((context)->error = yaml_MEMORY_ERROR, \ -// 0)) -// -// #define DEQUEUE(context,queue) \ -// (*((queue).head++)) -// -// #define QUEUE_INSERT(context,queue,index,value) \ -// (((queue).tail != (queue).end \ -// || yaml_queue_extend((void **)&(queue).start, (void **)&(queue).head, \ -// (void **)&(queue).tail, (void **)&(queue).end)) ? \ -// (memmove((queue).head+(index)+1,(queue).head+(index), \ -// ((queue).tail-(queue).head-(index))*sizeof(*(queue).start)), \ -// *((queue).head+(index)) = value, \ -// (queue).tail++, \ -// 1) : \ -// ((context)->error = yaml_MEMORY_ERROR, \ -// 0)) -// -// /* -// * Token initializers. -// */ -// -// #define TOKEN_INIT(token,token_type,token_start_mark,token_end_mark) \ -// (memset(&(token), 0, sizeof(yaml_token_t)), \ -// (token).type = (token_type), \ -// (token).start_mark = (token_start_mark), \ -// (token).end_mark = (token_end_mark)) -// -// #define STREAM_START_TOKEN_INIT(token,token_encoding,start_mark,end_mark) \ -// (TOKEN_INIT((token),yaml_STREAM_START_TOKEN,(start_mark),(end_mark)), \ -// (token).data.stream_start.encoding = (token_encoding)) -// -// #define STREAM_END_TOKEN_INIT(token,start_mark,end_mark) \ -// (TOKEN_INIT((token),yaml_STREAM_END_TOKEN,(start_mark),(end_mark))) -// -// #define ALIAS_TOKEN_INIT(token,token_value,start_mark,end_mark) \ -// (TOKEN_INIT((token),yaml_ALIAS_TOKEN,(start_mark),(end_mark)), \ -// (token).data.alias.value = (token_value)) -// -// #define ANCHOR_TOKEN_INIT(token,token_value,start_mark,end_mark) \ -// (TOKEN_INIT((token),yaml_ANCHOR_TOKEN,(start_mark),(end_mark)), \ -// (token).data.anchor.value = (token_value)) -// -// #define TAG_TOKEN_INIT(token,token_handle,token_suffix,start_mark,end_mark) \ -// (TOKEN_INIT((token),yaml_TAG_TOKEN,(start_mark),(end_mark)), \ -// (token).data.tag.handle = (token_handle), \ -// (token).data.tag.suffix = (token_suffix)) -// -// #define SCALAR_TOKEN_INIT(token,token_value,token_length,token_style,start_mark,end_mark) \ -// (TOKEN_INIT((token),yaml_SCALAR_TOKEN,(start_mark),(end_mark)), \ -// (token).data.scalar.value = (token_value), \ -// (token).data.scalar.length = (token_length), \ -// (token).data.scalar.style = (token_style)) -// -// #define VERSION_DIRECTIVE_TOKEN_INIT(token,token_major,token_minor,start_mark,end_mark) \ -// (TOKEN_INIT((token),yaml_VERSION_DIRECTIVE_TOKEN,(start_mark),(end_mark)), \ -// (token).data.version_directive.major = (token_major), \ -// (token).data.version_directive.minor = (token_minor)) -// -// #define TAG_DIRECTIVE_TOKEN_INIT(token,token_handle,token_prefix,start_mark,end_mark) \ -// (TOKEN_INIT((token),yaml_TAG_DIRECTIVE_TOKEN,(start_mark),(end_mark)), \ -// (token).data.tag_directive.handle = (token_handle), \ -// (token).data.tag_directive.prefix = (token_prefix)) -// -// /* -// * Event initializers. -// */ -// -// #define EVENT_INIT(event,event_type,event_start_mark,event_end_mark) \ -// (memset(&(event), 0, sizeof(yaml_event_t)), \ -// (event).type = (event_type), \ -// (event).start_mark = (event_start_mark), \ -// (event).end_mark = (event_end_mark)) -// -// #define STREAM_START_EVENT_INIT(event,event_encoding,start_mark,end_mark) \ -// (EVENT_INIT((event),yaml_STREAM_START_EVENT,(start_mark),(end_mark)), \ -// (event).data.stream_start.encoding = (event_encoding)) -// -// #define STREAM_END_EVENT_INIT(event,start_mark,end_mark) \ -// (EVENT_INIT((event),yaml_STREAM_END_EVENT,(start_mark),(end_mark))) -// -// #define DOCUMENT_START_EVENT_INIT(event,event_version_directive, \ -// event_tag_directives_start,event_tag_directives_end,event_implicit,start_mark,end_mark) \ -// (EVENT_INIT((event),yaml_DOCUMENT_START_EVENT,(start_mark),(end_mark)), \ -// (event).data.document_start.version_directive = (event_version_directive), \ -// (event).data.document_start.tag_directives.start = (event_tag_directives_start), \ -// (event).data.document_start.tag_directives.end = (event_tag_directives_end), \ -// (event).data.document_start.implicit = (event_implicit)) -// -// #define DOCUMENT_END_EVENT_INIT(event,event_implicit,start_mark,end_mark) \ -// (EVENT_INIT((event),yaml_DOCUMENT_END_EVENT,(start_mark),(end_mark)), \ -// (event).data.document_end.implicit = (event_implicit)) -// -// #define ALIAS_EVENT_INIT(event,event_anchor,start_mark,end_mark) \ -// (EVENT_INIT((event),yaml_ALIAS_EVENT,(start_mark),(end_mark)), \ -// (event).data.alias.anchor = (event_anchor)) -// -// #define SCALAR_EVENT_INIT(event,event_anchor,event_tag,event_value,event_length, \ -// event_plain_implicit, event_quoted_implicit,event_style,start_mark,end_mark) \ -// (EVENT_INIT((event),yaml_SCALAR_EVENT,(start_mark),(end_mark)), \ -// (event).data.scalar.anchor = (event_anchor), \ -// (event).data.scalar.tag = (event_tag), \ -// (event).data.scalar.value = (event_value), \ -// (event).data.scalar.length = (event_length), \ -// (event).data.scalar.plain_implicit = (event_plain_implicit), \ -// (event).data.scalar.quoted_implicit = (event_quoted_implicit), \ -// (event).data.scalar.style = (event_style)) -// -// #define SEQUENCE_START_EVENT_INIT(event,event_anchor,event_tag, \ -// event_implicit,event_style,start_mark,end_mark) \ -// (EVENT_INIT((event),yaml_SEQUENCE_START_EVENT,(start_mark),(end_mark)), \ -// (event).data.sequence_start.anchor = (event_anchor), \ -// (event).data.sequence_start.tag = (event_tag), \ -// (event).data.sequence_start.implicit = (event_implicit), \ -// (event).data.sequence_start.style = (event_style)) -// -// #define SEQUENCE_END_EVENT_INIT(event,start_mark,end_mark) \ -// (EVENT_INIT((event),yaml_SEQUENCE_END_EVENT,(start_mark),(end_mark))) -// -// #define MAPPING_START_EVENT_INIT(event,event_anchor,event_tag, \ -// event_implicit,event_style,start_mark,end_mark) \ -// (EVENT_INIT((event),yaml_MAPPING_START_EVENT,(start_mark),(end_mark)), \ -// (event).data.mapping_start.anchor = (event_anchor), \ -// (event).data.mapping_start.tag = (event_tag), \ -// (event).data.mapping_start.implicit = (event_implicit), \ -// (event).data.mapping_start.style = (event_style)) -// -// #define MAPPING_END_EVENT_INIT(event,start_mark,end_mark) \ -// (EVENT_INIT((event),yaml_MAPPING_END_EVENT,(start_mark),(end_mark))) -// -// /* -// * Document initializer. -// */ -// -// #define DOCUMENT_INIT(document,document_nodes_start,document_nodes_end, \ -// document_version_directive,document_tag_directives_start, \ -// document_tag_directives_end,document_start_implicit, \ -// document_end_implicit,document_start_mark,document_end_mark) \ -// (memset(&(document), 0, sizeof(yaml_document_t)), \ -// (document).nodes.start = (document_nodes_start), \ -// (document).nodes.end = (document_nodes_end), \ -// (document).nodes.top = (document_nodes_start), \ -// (document).version_directive = (document_version_directive), \ -// (document).tag_directives.start = (document_tag_directives_start), \ -// (document).tag_directives.end = (document_tag_directives_end), \ -// (document).start_implicit = (document_start_implicit), \ -// (document).end_implicit = (document_end_implicit), \ -// (document).start_mark = (document_start_mark), \ -// (document).end_mark = (document_end_mark)) -// -// /* -// * Node initializers. -// */ -// -// #define NODE_INIT(node,node_type,node_tag,node_start_mark,node_end_mark) \ -// (memset(&(node), 0, sizeof(yaml_node_t)), \ -// (node).type = (node_type), \ -// (node).tag = (node_tag), \ -// (node).start_mark = (node_start_mark), \ -// (node).end_mark = (node_end_mark)) -// -// #define SCALAR_NODE_INIT(node,node_tag,node_value,node_length, \ -// node_style,start_mark,end_mark) \ -// (NODE_INIT((node),yaml_SCALAR_NODE,(node_tag),(start_mark),(end_mark)), \ -// (node).data.scalar.value = (node_value), \ -// (node).data.scalar.length = (node_length), \ -// (node).data.scalar.style = (node_style)) -// -// #define SEQUENCE_NODE_INIT(node,node_tag,node_items_start,node_items_end, \ -// node_style,start_mark,end_mark) \ -// (NODE_INIT((node),yaml_SEQUENCE_NODE,(node_tag),(start_mark),(end_mark)), \ -// (node).data.sequence.items.start = (node_items_start), \ -// (node).data.sequence.items.end = (node_items_end), \ -// (node).data.sequence.items.top = (node_items_start), \ -// (node).data.sequence.style = (node_style)) -// -// #define MAPPING_NODE_INIT(node,node_tag,node_pairs_start,node_pairs_end, \ -// node_style,start_mark,end_mark) \ -// (NODE_INIT((node),yaml_MAPPING_NODE,(node_tag),(start_mark),(end_mark)), \ -// (node).data.mapping.pairs.start = (node_pairs_start), \ -// (node).data.mapping.pairs.end = (node_pairs_end), \ -// (node).data.mapping.pairs.top = (node_pairs_start), \ -// (node).data.mapping.style = (node_style)) -// diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/yamlh.go b/vendor/github.com/cloudfoundry-incubator/candiedyaml/yamlh.go deleted file mode 100644 index d608dbb36..000000000 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/yamlh.go +++ /dev/null @@ -1,953 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package candiedyaml - -import ( - "fmt" - "io" -) - -/** The version directive data. */ -type yaml_version_directive_t struct { - major int // The major version number - minor int // The minor version number -} - -/** The tag directive data. */ -type yaml_tag_directive_t struct { - handle []byte // The tag handle - prefix []byte // The tag prefix -} - -/** The stream encoding. */ -type yaml_encoding_t int - -const ( - /** Let the parser choose the encoding. */ - yaml_ANY_ENCODING yaml_encoding_t = iota - /** The defau lt UTF-8 encoding. */ - yaml_UTF8_ENCODING - /** The UTF-16-LE encoding with BOM. */ - yaml_UTF16LE_ENCODING - /** The UTF-16-BE encoding with BOM. */ - yaml_UTF16BE_ENCODING -) - -/** Line break types. */ -type yaml_break_t int - -const ( - yaml_ANY_BREAK yaml_break_t = iota /** Let the parser choose the break type. */ - yaml_CR_BREAK /** Use CR for line breaks (Mac style). */ - yaml_LN_BREAK /** Use LN for line breaks (Unix style). */ - yaml_CRLN_BREAK /** Use CR LN for line breaks (DOS style). */ -) - -/** Many bad things could happen with the parser and emitter. */ -type YAML_error_type_t int - -const ( - /** No error is produced. */ - yaml_NO_ERROR YAML_error_type_t = iota - - /** Cannot allocate or reallocate a block of memory. */ - yaml_MEMORY_ERROR - - /** Cannot read or decode the input stream. */ - yaml_READER_ERROR - /** Cannot scan the input stream. */ - yaml_SCANNER_ERROR - /** Cannot parse the input stream. */ - yaml_PARSER_ERROR - /** Cannot compose a YAML document. */ - yaml_COMPOSER_ERROR - - /** Cannot write to the output stream. */ - yaml_WRITER_ERROR - /** Cannot emit a YAML stream. */ - yaml_EMITTER_ERROR -) - -/** The pointer position. */ -type YAML_mark_t struct { - /** The position index. */ - index int - - /** The position line. */ - line int - - /** The position column. */ - column int -} - -func (m YAML_mark_t) String() string { - return fmt.Sprintf("line %d, column %d", m.line, m.column) -} - -/** @} */ - -/** - * @defgroup styles Node Styles - * @{ - */ - -type yaml_style_t int - -/** Scalar styles. */ -type yaml_scalar_style_t yaml_style_t - -const ( - /** Let the emitter choose the style. */ - yaml_ANY_SCALAR_STYLE yaml_scalar_style_t = iota - - /** The plain scalar style. */ - yaml_PLAIN_SCALAR_STYLE - - /** The single-quoted scalar style. */ - yaml_SINGLE_QUOTED_SCALAR_STYLE - /** The double-quoted scalar style. */ - yaml_DOUBLE_QUOTED_SCALAR_STYLE - - /** The literal scalar style. */ - yaml_LITERAL_SCALAR_STYLE - /** The folded scalar style. */ - yaml_FOLDED_SCALAR_STYLE -) - -/** Sequence styles. */ -type yaml_sequence_style_t yaml_style_t - -const ( - /** Let the emitter choose the style. */ - yaml_ANY_SEQUENCE_STYLE yaml_sequence_style_t = iota - - /** The block sequence style. */ - yaml_BLOCK_SEQUENCE_STYLE - /** The flow sequence style. */ - yaml_FLOW_SEQUENCE_STYLE -) - -/** Mapping styles. */ -type yaml_mapping_style_t yaml_style_t - -const ( - /** Let the emitter choose the style. */ - yaml_ANY_MAPPING_STYLE yaml_mapping_style_t = iota - - /** The block mapping style. */ - yaml_BLOCK_MAPPING_STYLE - /** The flow mapping style. */ - yaml_FLOW_MAPPING_STYLE - -/* yaml_FLOW_SET_MAPPING_STYLE */ -) - -/** @} */ - -/** - * @defgroup tokens Tokens - * @{ - */ - -/** Token types. */ -type yaml_token_type_t int - -const ( - /** An empty token. */ - yaml_NO_TOKEN yaml_token_type_t = iota - - /** A STREAM-START token. */ - yaml_STREAM_START_TOKEN - /** A STREAM-END token. */ - yaml_STREAM_END_TOKEN - - /** A VERSION-DIRECTIVE token. */ - yaml_VERSION_DIRECTIVE_TOKEN - /** A TAG-DIRECTIVE token. */ - yaml_TAG_DIRECTIVE_TOKEN - /** A DOCUMENT-START token. */ - yaml_DOCUMENT_START_TOKEN - /** A DOCUMENT-END token. */ - yaml_DOCUMENT_END_TOKEN - - /** A BLOCK-SEQUENCE-START token. */ - yaml_BLOCK_SEQUENCE_START_TOKEN - /** A BLOCK-SEQUENCE-END token. */ - yaml_BLOCK_MAPPING_START_TOKEN - /** A BLOCK-END token. */ - yaml_BLOCK_END_TOKEN - - /** A FLOW-SEQUENCE-START token. */ - yaml_FLOW_SEQUENCE_START_TOKEN - /** A FLOW-SEQUENCE-END token. */ - yaml_FLOW_SEQUENCE_END_TOKEN - /** A FLOW-MAPPING-START token. */ - yaml_FLOW_MAPPING_START_TOKEN - /** A FLOW-MAPPING-END token. */ - yaml_FLOW_MAPPING_END_TOKEN - - /** A BLOCK-ENTRY token. */ - yaml_BLOCK_ENTRY_TOKEN - /** A FLOW-ENTRY token. */ - yaml_FLOW_ENTRY_TOKEN - /** A KEY token. */ - yaml_KEY_TOKEN - /** A VALUE token. */ - yaml_VALUE_TOKEN - - /** An ALIAS token. */ - yaml_ALIAS_TOKEN - /** An ANCHOR token. */ - yaml_ANCHOR_TOKEN - /** A TAG token. */ - yaml_TAG_TOKEN - /** A SCALAR token. */ - yaml_SCALAR_TOKEN -) - -/** The token structure. */ -type yaml_token_t struct { - - /** The token type. */ - token_type yaml_token_type_t - - /** The token data. */ - /** The stream start (for @c yaml_STREAM_START_TOKEN). */ - encoding yaml_encoding_t - - /** The alias (for @c yaml_ALIAS_TOKEN, yaml_ANCHOR_TOKEN, yaml_SCALAR_TOKEN,yaml_TAG_TOKEN ). */ - /** The anchor (for @c ). */ - /** The scalar value (for @c ). */ - value []byte - - /** The tag suffix. */ - suffix []byte - - /** The scalar value (for @c yaml_SCALAR_TOKEN). */ - /** The scalar style. */ - style yaml_scalar_style_t - - /** The version directive (for @c yaml_VERSION_DIRECTIVE_TOKEN). */ - version_directive yaml_version_directive_t - - /** The tag directive (for @c yaml_TAG_DIRECTIVE_TOKEN). */ - prefix []byte - - /** The beginning of the token. */ - start_mark YAML_mark_t - /** The end of the token. */ - end_mark YAML_mark_t - - major, minor int -} - -/** - * @defgroup events Events - * @{ - */ - -/** Event types. */ -type yaml_event_type_t int - -const ( - /** An empty event. */ - yaml_NO_EVENT yaml_event_type_t = iota - - /** A STREAM-START event. */ - yaml_STREAM_START_EVENT - /** A STREAM-END event. */ - yaml_STREAM_END_EVENT - - /** A DOCUMENT-START event. */ - yaml_DOCUMENT_START_EVENT - /** A DOCUMENT-END event. */ - yaml_DOCUMENT_END_EVENT - - /** An ALIAS event. */ - yaml_ALIAS_EVENT - /** A SCALAR event. */ - yaml_SCALAR_EVENT - - /** A SEQUENCE-START event. */ - yaml_SEQUENCE_START_EVENT - /** A SEQUENCE-END event. */ - yaml_SEQUENCE_END_EVENT - - /** A MAPPING-START event. */ - yaml_MAPPING_START_EVENT - /** A MAPPING-END event. */ - yaml_MAPPING_END_EVENT -) - -/** The event structure. */ -type yaml_event_t struct { - - /** The event type. */ - event_type yaml_event_type_t - - /** The stream parameters (for @c yaml_STREAM_START_EVENT). */ - encoding yaml_encoding_t - - /** The document parameters (for @c yaml_DOCUMENT_START_EVENT). */ - version_directive *yaml_version_directive_t - - /** The beginning and end of the tag directives list. */ - tag_directives []yaml_tag_directive_t - - /** The document parameters (for @c yaml_DOCUMENT_START_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_START_EVENT,yaml_MAPPING_START_EVENT). */ - /** Is the document indicator implicit? */ - implicit bool - - /** The alias parameters (for @c yaml_ALIAS_EVENT,yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). */ - /** The anchor. */ - anchor []byte - - /** The scalar parameters (for @c yaml_SCALAR_EVENT,yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). */ - /** The tag. */ - tag []byte - /** The scalar value. */ - value []byte - - /** Is the tag optional for the plain style? */ - plain_implicit bool - /** Is the tag optional for any non-plain style? */ - quoted_implicit bool - - /** The sequence parameters (for @c yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). */ - /** The sequence style. */ - /** The scalar style. */ - style yaml_style_t - - /** The beginning of the event. */ - start_mark, end_mark YAML_mark_t -} - -/** - * @defgroup nodes Nodes - * @{ - */ - -const ( - /** The tag @c !!null with the only possible value: @c null. */ - yaml_NULL_TAG = "tag:yaml.org,2002:null" - /** The tag @c !!bool with the values: @c true and @c falce. */ - yaml_BOOL_TAG = "tag:yaml.org,2002:bool" - /** The tag @c !!str for string values. */ - yaml_STR_TAG = "tag:yaml.org,2002:str" - /** The tag @c !!int for integer values. */ - yaml_INT_TAG = "tag:yaml.org,2002:int" - /** The tag @c !!float for float values. */ - yaml_FLOAT_TAG = "tag:yaml.org,2002:float" - /** The tag @c !!timestamp for date and time values. */ - yaml_TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp" - - /** The tag @c !!seq is used to denote sequences. */ - yaml_SEQ_TAG = "tag:yaml.org,2002:seq" - /** The tag @c !!map is used to denote mapping. */ - yaml_MAP_TAG = "tag:yaml.org,2002:map" - - /** The default scalar tag is @c !!str. */ - yaml_DEFAULT_SCALAR_TAG = yaml_STR_TAG - /** The default sequence tag is @c !!seq. */ - yaml_DEFAULT_SEQUENCE_TAG = yaml_SEQ_TAG - /** The default mapping tag is @c !!map. */ - yaml_DEFAULT_MAPPING_TAG = yaml_MAP_TAG - - yaml_BINARY_TAG = "tag:yaml.org,2002:binary" -) - -/** Node types. */ -type yaml_node_type_t int - -const ( - /** An empty node. */ - yaml_NO_NODE yaml_node_type_t = iota - - /** A scalar node. */ - yaml_SCALAR_NODE - /** A sequence node. */ - yaml_SEQUENCE_NODE - /** A mapping node. */ - yaml_MAPPING_NODE -) - -/** An element of a sequence node. */ -type yaml_node_item_t int - -/** An element of a mapping node. */ -type yaml_node_pair_t struct { - /** The key of the element. */ - key int - /** The value of the element. */ - value int -} - -/** The node structure. */ -type yaml_node_t struct { - - /** The node type. */ - node_type yaml_node_type_t - - /** The node tag. */ - tag []byte - - /** The scalar parameters (for @c yaml_SCALAR_NODE). */ - scalar struct { - /** The scalar value. */ - value []byte - /** The scalar style. */ - style yaml_scalar_style_t - } - - /** The sequence parameters (for @c yaml_SEQUENCE_NODE). */ - sequence struct { - /** The stack of sequence items. */ - items []yaml_node_item_t - /** The sequence style. */ - style yaml_sequence_style_t - } - - /** The mapping parameters (for @c yaml_MAPPING_NODE). */ - mapping struct { - /** The stack of mapping pairs (key, value). */ - pairs []yaml_node_pair_t - /** The mapping style. */ - style yaml_mapping_style_t - } - - /** The beginning of the node. */ - start_mark YAML_mark_t - /** The end of the node. */ - end_mark YAML_mark_t -} - -/** The document structure. */ -type yaml_document_t struct { - - /** The document nodes. */ - nodes []yaml_node_t - - /** The version directive. */ - version_directive *yaml_version_directive_t - - /** The list of tag directives. */ - tags []yaml_tag_directive_t - - /** Is the document start indicator implicit? */ - start_implicit bool - /** Is the document end indicator implicit? */ - end_implicit bool - - /** The beginning of the document. */ - start_mark YAML_mark_t - /** The end of the document. */ - end_mark YAML_mark_t -} - -/** - * The prototype of a read handler. - * - * The read handler is called when the parser needs to read more bytes from the - * source. The handler should write not more than @a size bytes to the @a - * buffer. The number of written bytes should be set to the @a length variable. - * - * @param[in,out] data A pointer to an application data specified by - * yaml_parser_set_input(). - * @param[out] buffer The buffer to write the data from the source. - * @param[in] size The size of the buffer. - * @param[out] size_read The actual number of bytes read from the source. - * - * @returns On success, the handler should return @c 1. If the handler failed, - * the returned value should be @c 0. On EOF, the handler should set the - * @a size_read to @c 0 and return @c 1. - */ - -type yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error) - -/** - * This structure holds information about a potential simple key. - */ - -type yaml_simple_key_t struct { - /** Is a simple key possible? */ - possible bool - - /** Is a simple key required? */ - required bool - - /** The number of the token. */ - token_number int - - /** The position mark. */ - mark YAML_mark_t -} - -/** - * The states of the parser. - */ -type yaml_parser_state_t int - -const ( - /** Expect STREAM-START. */ - yaml_PARSE_STREAM_START_STATE yaml_parser_state_t = iota - /** Expect the beginning of an implicit document. */ - yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE - /** Expect DOCUMENT-START. */ - yaml_PARSE_DOCUMENT_START_STATE - /** Expect the content of a document. */ - yaml_PARSE_DOCUMENT_CONTENT_STATE - /** Expect DOCUMENT-END. */ - yaml_PARSE_DOCUMENT_END_STATE - /** Expect a block node. */ - yaml_PARSE_BLOCK_NODE_STATE - /** Expect a block node or indentless sequence. */ - yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE - /** Expect a flow node. */ - yaml_PARSE_FLOW_NODE_STATE - /** Expect the first entry of a block sequence. */ - yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE - /** Expect an entry of a block sequence. */ - yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE - /** Expect an entry of an indentless sequence. */ - yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE - /** Expect the first key of a block mapping. */ - yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE - /** Expect a block mapping key. */ - yaml_PARSE_BLOCK_MAPPING_KEY_STATE - /** Expect a block mapping value. */ - yaml_PARSE_BLOCK_MAPPING_VALUE_STATE - /** Expect the first entry of a flow sequence. */ - yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE - /** Expect an entry of a flow sequence. */ - yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE - /** Expect a key of an ordered mapping. */ - yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE - /** Expect a value of an ordered mapping. */ - yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE - /** Expect the and of an ordered mapping entry. */ - yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE - /** Expect the first key of a flow mapping. */ - yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE - /** Expect a key of a flow mapping. */ - yaml_PARSE_FLOW_MAPPING_KEY_STATE - /** Expect a value of a flow mapping. */ - yaml_PARSE_FLOW_MAPPING_VALUE_STATE - /** Expect an empty value of a flow mapping. */ - yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE - /** Expect nothing. */ - yaml_PARSE_END_STATE -) - -/** - * This structure holds aliases data. - */ - -type yaml_alias_data_t struct { - /** The anchor. */ - anchor []byte - /** The node id. */ - index int - /** The anchor mark. */ - mark YAML_mark_t -} - -/** - * The parser structure. - * - * All members are internal. Manage the structure using the @c yaml_parser_ - * family of functions. - */ - -type yaml_parser_t struct { - - /** - * @name Error handling - * @{ - */ - - /** Error type. */ - error YAML_error_type_t - /** Error description. */ - problem string - /** The byte about which the problem occured. */ - problem_offset int - /** The problematic value (@c -1 is none). */ - problem_value int - /** The problem position. */ - problem_mark YAML_mark_t - /** The error context. */ - context string - /** The context position. */ - context_mark YAML_mark_t - - /** - * @} - */ - - /** - * @name Reader stuff - * @{ - */ - - /** Read handler. */ - read_handler yaml_read_handler_t - - /** Reader input data. */ - input_reader io.Reader - input []byte - input_pos int - - /** EOF flag */ - eof bool - - /** The working buffer. */ - buffer []byte - buffer_pos int - - /* The number of unread characters in the buffer. */ - unread int - - /** The raw buffer. */ - raw_buffer []byte - raw_buffer_pos int - - /** The input encoding. */ - encoding yaml_encoding_t - - /** The offset of the current position (in bytes). */ - offset int - - /** The mark of the current position. */ - mark YAML_mark_t - - /** - * @} - */ - - /** - * @name Scanner stuff - * @{ - */ - - /** Have we started to scan the input stream? */ - stream_start_produced bool - - /** Have we reached the end of the input stream? */ - stream_end_produced bool - - /** The number of unclosed '[' and '{' indicators. */ - flow_level int - - /** The tokens queue. */ - tokens []yaml_token_t - tokens_head int - - /** The number of tokens fetched from the queue. */ - tokens_parsed int - - /* Does the tokens queue contain a token ready for dequeueing. */ - token_available bool - - /** The indentation levels stack. */ - indents []int - - /** The current indentation level. */ - indent int - - /** May a simple key occur at the current position? */ - simple_key_allowed bool - - /** The stack of simple keys. */ - simple_keys []yaml_simple_key_t - - /** - * @} - */ - - /** - * @name Parser stuff - * @{ - */ - - /** The parser states stack. */ - states []yaml_parser_state_t - - /** The current parser state. */ - state yaml_parser_state_t - - /** The stack of marks. */ - marks []YAML_mark_t - - /** The list of TAG directives. */ - tag_directives []yaml_tag_directive_t - - /** - * @} - */ - - /** - * @name Dumper stuff - * @{ - */ - - /** The alias data. */ - aliases []yaml_alias_data_t - - /** The currently parsed document. */ - document *yaml_document_t - - /** - * @} - */ - -} - -/** - * The prototype of a write handler. - * - * The write handler is called when the emitter needs to flush the accumulated - * characters to the output. The handler should write @a size bytes of the - * @a buffer to the output. - * - * @param[in,out] data A pointer to an application data specified by - * yaml_emitter_set_output(). - * @param[in] buffer The buffer with bytes to be written. - * @param[in] size The size of the buffer. - * - * @returns On success, the handler should return @c 1. If the handler failed, - * the returned value should be @c 0. - */ - -type yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error - -/** The emitter states. */ -type yaml_emitter_state_t int - -const ( - /** Expect STREAM-START. */ - yaml_EMIT_STREAM_START_STATE yaml_emitter_state_t = iota - /** Expect the first DOCUMENT-START or STREAM-END. */ - yaml_EMIT_FIRST_DOCUMENT_START_STATE - /** Expect DOCUMENT-START or STREAM-END. */ - yaml_EMIT_DOCUMENT_START_STATE - /** Expect the content of a document. */ - yaml_EMIT_DOCUMENT_CONTENT_STATE - /** Expect DOCUMENT-END. */ - yaml_EMIT_DOCUMENT_END_STATE - /** Expect the first item of a flow sequence. */ - yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE - /** Expect an item of a flow sequence. */ - yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE - /** Expect the first key of a flow mapping. */ - yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE - /** Expect a key of a flow mapping. */ - yaml_EMIT_FLOW_MAPPING_KEY_STATE - /** Expect a value for a simple key of a flow mapping. */ - yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE - /** Expect a value of a flow mapping. */ - yaml_EMIT_FLOW_MAPPING_VALUE_STATE - /** Expect the first item of a block sequence. */ - yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE - /** Expect an item of a block sequence. */ - yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE - /** Expect the first key of a block mapping. */ - yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE - /** Expect the key of a block mapping. */ - yaml_EMIT_BLOCK_MAPPING_KEY_STATE - /** Expect a value for a simple key of a block mapping. */ - yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE - /** Expect a value of a block mapping. */ - yaml_EMIT_BLOCK_MAPPING_VALUE_STATE - /** Expect nothing. */ - yaml_EMIT_END_STATE -) - -/** - * The emitter structure. - * - * All members are internal. Manage the structure using the @c yaml_emitter_ - * family of functions. - */ - -type yaml_emitter_t struct { - - /** - * @name Error handling - * @{ - */ - - /** Error type. */ - error YAML_error_type_t - /** Error description. */ - problem string - - /** - * @} - */ - - /** - * @name Writer stuff - * @{ - */ - - /** Write handler. */ - write_handler yaml_write_handler_t - - /** Standard (string or file) output data. */ - output_buffer *[]byte - output_writer io.Writer - - /** The working buffer. */ - buffer []byte - buffer_pos int - - /** The raw buffer. */ - raw_buffer []byte - raw_buffer_pos int - - /** The stream encoding. */ - encoding yaml_encoding_t - - /** - * @} - */ - - /** - * @name Emitter stuff - * @{ - */ - - /** If the output is in the canonical style? */ - canonical bool - /** The number of indentation spaces. */ - best_indent int - /** The preferred width of the output lines. */ - best_width int - /** Allow unescaped non-ASCII characters? */ - unicode bool - /** The preferred line break. */ - line_break yaml_break_t - - /** The stack of states. */ - states []yaml_emitter_state_t - - /** The current emitter state. */ - state yaml_emitter_state_t - - /** The event queue. */ - events []yaml_event_t - events_head int - - /** The stack of indentation levels. */ - indents []int - - /** The list of tag directives. */ - tag_directives []yaml_tag_directive_t - - /** The current indentation level. */ - indent int - - /** The current flow level. */ - flow_level int - - /** Is it the document root context? */ - root_context bool - /** Is it a sequence context? */ - sequence_context bool - /** Is it a mapping context? */ - mapping_context bool - /** Is it a simple mapping key context? */ - simple_key_context bool - - /** The current line. */ - line int - /** The current column. */ - column int - /** If the last character was a whitespace? */ - whitespace bool - /** If the last character was an indentation character (' ', '-', '?', ':')? */ - indention bool - /** If an explicit document end is required? */ - open_ended bool - - /** Anchor analysis. */ - anchor_data struct { - /** The anchor value. */ - anchor []byte - /** Is it an alias? */ - alias bool - } - - /** Tag analysis. */ - tag_data struct { - /** The tag handle. */ - handle []byte - /** The tag suffix. */ - suffix []byte - } - - /** Scalar analysis. */ - scalar_data struct { - /** The scalar value. */ - value []byte - /** Does the scalar contain line breaks? */ - multiline bool - /** Can the scalar be expessed in the flow plain style? */ - flow_plain_allowed bool - /** Can the scalar be expressed in the block plain style? */ - block_plain_allowed bool - /** Can the scalar be expressed in the single quoted style? */ - single_quoted_allowed bool - /** Can the scalar be expressed in the literal or folded styles? */ - block_allowed bool - /** The output style. */ - style yaml_scalar_style_t - } - - /** - * @} - */ - - /** - * @name Dumper stuff - * @{ - */ - - /** If the stream was already opened? */ - opened bool - /** If the stream was already closed? */ - closed bool - - /** The information associated with the document nodes. */ - anchors *struct { - /** The number of references. */ - references int - /** The anchor id. */ - anchor int - /** If the node has been emitted? */ - serialized bool - } - - /** The last assigned anchor id. */ - last_anchor_id int - - /** The currently emitted document. */ - document *yaml_document_t - - /** - * @} - */ - -} diff --git a/vendor/github.com/docker/libcompose/Dockerfile b/vendor/github.com/docker/libcompose/Dockerfile index ef26e3141..34d160f46 100644 --- a/vendor/github.com/docker/libcompose/Dockerfile +++ b/vendor/github.com/docker/libcompose/Dockerfile @@ -1,5 +1,5 @@ # This file describes the standard way to build libcompose, using docker -FROM golang:1.6.2 +FROM golang:1.7.0 # virtualenv is necessary to run acceptance tests @@ -39,7 +39,7 @@ WORKDIR /go/src/github.com/docker/libcompose # Compose COMMIT for acceptance test version, update that commit when # you want to update the acceptance test version to support. -ENV COMPOSE_COMMIT 1.8.0-rc1 +ENV COMPOSE_COMMIT 1.8.0-rc2 RUN virtualenv venv && \ git clone https://github.com/docker/compose.git venv/compose && \ cd venv/compose && \ diff --git a/vendor/github.com/docker/libcompose/Makefile b/vendor/github.com/docker/libcompose/Makefile index ac1fe97a2..342c9a55c 100644 --- a/vendor/github.com/docker/libcompose/Makefile +++ b/vendor/github.com/docker/libcompose/Makefile @@ -1,4 +1,4 @@ -.PHONY: all test validate-dco validate-gofmt validate build +.PHONY: all build binary clean cross-binary help test test-unit test-integration test-acceptance validate LIBCOMPOSE_ENVS := \ -e OS_PLATFORM_ARG \ @@ -14,7 +14,8 @@ BIND_DIR := $(if $(DOCKER_HOST),,bundles) LIBCOMPOSE_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/docker/libcompose/$(BIND_DIR)") GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null) -LIBCOMPOSE_IMAGE := libcompose-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH)) +GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g") +LIBCOMPOSE_IMAGE := libcompose-dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN)) DAEMON_VERSION := $(if $(DAEMON_VERSION),$(DAEMON_VERSION),"default") TTY := $(shell [ -t 0 ] && echo "-t") diff --git a/vendor/github.com/docker/libcompose/README.md b/vendor/github.com/docker/libcompose/README.md index 2b2093655..1413702cc 100644 --- a/vendor/github.com/docker/libcompose/README.md +++ b/vendor/github.com/docker/libcompose/README.md @@ -7,6 +7,18 @@ A Go library for Docker Compose. It does everything the command-line tool does, **Note: This is experimental and not intended to replace the [Docker Compose](https://github.com/docker/compose) command-line tool. If you're looking to use Compose, head over to the [Compose installation instructions](http://docs.docker.com/compose/install/) to get started with it.** +Here is a list of known project that uses `libcompose`: + +- [rancher-compose](https://github.com/rancher/rancher-compose) and [rancher os](https://github.com/rancher/os) (by [Rancher](https://github.com/rancher)) +- [openshift](https://github.com/openshift/origin) (by [Red Hat](https://github.com/openshift)) +- [henge](https://github.com/redhat-developer/henge) (by [Red Hat](https://github.com/redhat-developer)) +- [kompose](https://github.com/skippbox/kompose2) (by [skippbox](https://github.com/skippbox)) +- [compose2kube](https://github.com/kelseyhightower/compose2kube) (by [kelseyhightower](https://github.com/kelseyhightower)) +- [amazon-ecs-cli](https://github.com/aws/amazon-ecs-cli) (by [Amazon AWS](https://github.com/aws)) +- [libkermit](https://github.com/libkermit/docker) (by [vdemeester](https://github.com/vdemeester)) + +## Usage + ```go package main @@ -40,6 +52,7 @@ func main() { } ``` + ## Building You need either [Docker](http://github.com/docker/docker) and `make`, @@ -132,4 +145,6 @@ The project is still being kickstarted... But it does a lot. Please try it out ## Contributing -Want to hack on libcompose? [Docker's contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) apply. +Want to hack on libcompose? [Docker's contributions guidelines](https://github.com/docker/libcompose/blob/master/CONTRIBUTING.md) apply. + +If you have comments, questions, or want to use your knowledge to help other, come join the conversation on IRC. You can reach us at #libcompose on Freenode. diff --git a/vendor/github.com/docker/libcompose/cli/app/app.go b/vendor/github.com/docker/libcompose/cli/app/app.go index d306e2f79..324bd5f08 100644 --- a/vendor/github.com/docker/libcompose/cli/app/app.go +++ b/vendor/github.com/docker/libcompose/cli/app/app.go @@ -32,6 +32,7 @@ func BeforeApp(c *cli.Context) error { if c.GlobalBool("verbose") { logrus.SetLevel(logrus.DebugLevel) } + if version.ShowWarning() { logrus.Warning("Note: This is an experimental alternate implementation of the Compose CLI (https://github.com/docker/compose)") } @@ -52,11 +53,15 @@ func WithProject(factory ProjectFactory, action ProjectAction) func(context *cli // ProjectPs lists the containers. func ProjectPs(p project.APIProject, c *cli.Context) error { qFlag := c.Bool("q") - allInfo, err := p.Ps(context.Background(), qFlag, c.Args()...) + allInfo, err := p.Ps(context.Background(), c.Args()...) if err != nil { return cli.NewExitError(err.Error(), 1) } - os.Stdout.WriteString(allInfo.String(!qFlag)) + columns := []string{"Name", "Command", "State", "Ports"} + if qFlag { + columns = []string{"Id"} + } + os.Stdout.WriteString(allInfo.String(columns, !qFlag)) return nil } @@ -137,6 +142,7 @@ func ProjectUp(p project.APIProject, c *cli.Context) error { NoRecreate: c.Bool("no-recreate"), ForceRecreate: c.Bool("force-recreate"), NoBuild: c.Bool("no-build"), + ForceBuild: c.Bool("build"), }, } ctx, cancelFun := context.WithCancel(context.Background()) @@ -174,7 +180,7 @@ func ProjectUp(p project.APIProject, c *cli.Context) error { // ProjectRun runs a given command within a service's container. func ProjectRun(p project.APIProject, c *cli.Context) error { - if len(c.Args()) == 1 { + if len(c.Args()) == 0 { logrus.Fatal("No service specified") } @@ -230,10 +236,10 @@ func ProjectPull(p project.APIProject, c *cli.Context) error { // ProjectDelete deletes services. func ProjectDelete(p project.APIProject, c *cli.Context) error { - if !c.Bool("force") && len(c.Args()) == 0 { - logrus.Fatal("Will not remove all services without --force") + options := options.Delete{ + RemoveVolume: c.Bool("v"), } - err := p.Delete(context.Background(), options.Delete{}, c.Args()...) + err := p.Delete(context.Background(), options, c.Args()...) if err != nil { return cli.NewExitError(err.Error(), 1) } @@ -249,6 +255,16 @@ func ProjectKill(p project.APIProject, c *cli.Context) error { return nil } +// ProjectConfig validates and print the compose file. +func ProjectConfig(p project.APIProject, c *cli.Context) error { + yaml, err := p.Config() + if err != nil { + return cli.NewExitError(err.Error(), 1) + } + fmt.Println(yaml) + return nil +} + // ProjectPause pauses service containers. func ProjectPause(p project.APIProject, c *cli.Context) error { err := p.Pause(context.Background(), c.Args()...) @@ -288,7 +304,7 @@ func ProjectScale(p project.APIProject, c *cli.Context) error { err := p.Scale(context.Background(), c.Int("timeout"), servicesScale) if err != nil { - return cli.NewExitError(err.Error(), 1) + return cli.NewExitError(err.Error(), 0) } return nil } diff --git a/vendor/github.com/docker/libcompose/cli/app/version.go b/vendor/github.com/docker/libcompose/cli/app/version.go index a25b8eaaf..1e77519f8 100644 --- a/vendor/github.com/docker/libcompose/cli/app/version.go +++ b/vendor/github.com/docker/libcompose/cli/app/version.go @@ -17,10 +17,10 @@ Built: {{.BuildTime}} OS/Arch: {{.Os}}/{{.Arch}}` // Version prints the libcompose version number and additionnal informations. -func Version(c *cli.Context) { +func Version(c *cli.Context) error { if c.Bool("short") { fmt.Println(version.VERSION) - return + return nil } tmpl, err := template.New("").Parse(versionTemplate) @@ -48,5 +48,5 @@ func Version(c *cli.Context) { logrus.Fatal(err) } fmt.Printf("\n") - return + return nil } diff --git a/vendor/github.com/docker/libcompose/cli/command/command.go b/vendor/github.com/docker/libcompose/cli/command/command.go index b3b8cc287..4e35a71af 100644 --- a/vendor/github.com/docker/libcompose/cli/command/command.go +++ b/vendor/github.com/docker/libcompose/cli/command/command.go @@ -2,6 +2,7 @@ package command import ( "os" + "strings" "github.com/docker/libcompose/cli/app" "github.com/docker/libcompose/project" @@ -10,7 +11,14 @@ import ( // Populate updates the specified project context based on command line arguments and subcommands. func Populate(context *project.Context, c *cli.Context) { - context.ComposeFiles = c.GlobalStringSlice("file") + // urfave/cli does not distinguish whether the first string in the slice comes from the envvar + // or is from a flag. Worse off, it appends the flag values to the envvar value instead of + // overriding it. To ensure the multifile envvar case is always handled, the first string + // must always be split. It gives a more consistent behavior, then, to split each string in + // the slice. + for _, v := range c.GlobalStringSlice("file") { + context.ComposeFiles = append(context.ComposeFiles, strings.Split(v, string(os.PathListSeparator))...) + } if len(context.ComposeFiles) == 0 { context.ComposeFiles = []string{"docker-compose.yml"} @@ -45,6 +53,15 @@ func CreateCommand(factory app.ProjectFactory) cli.Command { } } +// ConfigCommand defines the libcompose config subcommand +func ConfigCommand(factory app.ProjectFactory) cli.Command { + return cli.Command{ + Name: "config", + Usage: "Validate and view the compose file.", + Action: app.WithProject(factory, app.ProjectConfig), + } +} + // BuildCommand defines the libcompose build subcommand. func BuildCommand(factory app.ProjectFactory) cli.Command { return cli.Command{ @@ -127,6 +144,10 @@ func UpCommand(factory app.ProjectFactory) cli.Command { Name: "force-recreate", Usage: "Recreate containers even if their configuration and image haven't changed. Incompatible with --no-recreate.", }, + cli.BoolFlag{ + Name: "build", + Usage: "Build images before starting containers.", + }, }, } } diff --git a/vendor/github.com/docker/libcompose/cli/logger/color_logger.go b/vendor/github.com/docker/libcompose/cli/logger/color_logger.go index 51e59a602..f48230773 100644 --- a/vendor/github.com/docker/libcompose/cli/logger/color_logger.go +++ b/vendor/github.com/docker/libcompose/cli/logger/color_logger.go @@ -2,6 +2,7 @@ package logger import ( "fmt" + "io" "os" "strconv" @@ -29,8 +30,23 @@ func NewColorLoggerFactory() *ColorLoggerFactory { } } -// Create implements logger.Factory.Create. -func (c *ColorLoggerFactory) Create(name string) logger.Logger { +// CreateContainerLogger implements logger.Factory.CreateContainerLogger. +func (c *ColorLoggerFactory) CreateContainerLogger(name string) logger.Logger { + return c.create(name) +} + +// CreateBuildLogger implements logger.Factory.CreateBuildLogger. +func (c *ColorLoggerFactory) CreateBuildLogger(name string) logger.Logger { + return &logger.RawLogger{} +} + +// CreatePullLogger implements logger.Factory.CreatePullLogger. +func (c *ColorLoggerFactory) CreatePullLogger(name string) logger.Logger { + return &logger.NullLogger{} +} + +// CreateBuildLogger implements logger.Factory.CreateContainerLogger. +func (c *ColorLoggerFactory) create(name string) logger.Logger { if c.maxLength < len(name) { c.maxLength = len(name) } @@ -62,6 +78,16 @@ func (c *ColorLogger) Err(bytes []byte) { fmt.Fprint(os.Stderr, message) } +// OutWriter returns the base writer +func (c *ColorLogger) OutWriter() io.Writer { + return os.Stdout +} + +// ErrWriter returns the base writer +func (c *ColorLogger) ErrWriter() io.Writer { + return os.Stderr +} + func (c *ColorLogger) getLogFmt() (string, string) { pad := c.factory.maxLength diff --git a/vendor/github.com/docker/libcompose/config/merge.go b/vendor/github.com/docker/libcompose/config/merge.go index fb9142bfe..7b02ac357 100644 --- a/vendor/github.com/docker/libcompose/config/merge.go +++ b/vendor/github.com/docker/libcompose/config/merge.go @@ -6,10 +6,10 @@ import ( "fmt" "strings" - yaml "github.com/cloudfoundry-incubator/candiedyaml" "github.com/docker/docker/pkg/urlutil" "github.com/docker/libcompose/utils" composeYaml "github.com/docker/libcompose/yaml" + "gopkg.in/yaml.v2" ) var ( @@ -90,6 +90,7 @@ func readEnvFile(resourceLookup ResourceLookup, inFile string, serviceData RawSe } var envFiles composeYaml.Stringorslice + if err := utils.Convert(serviceData["env_file"], &envFiles); err != nil { return nil, err } @@ -103,6 +104,7 @@ func readEnvFile(resourceLookup ResourceLookup, inFile string, serviceData RawSe } var vars composeYaml.MaporEqualSlice + if _, ok := serviceData["environment"]; ok { if err := utils.Convert(serviceData["environment"], &vars); err != nil { return nil, err @@ -116,21 +118,28 @@ func readEnvFile(resourceLookup ResourceLookup, inFile string, serviceData RawSe return nil, err } + if err != nil { + return nil, err + } + scanner := bufio.NewScanner(bytes.NewBuffer(content)) for scanner.Scan() { line := strings.TrimSpace(scanner.Text()) - key := strings.SplitAfter(line, "=")[0] - found := false - for _, v := range vars { - if strings.HasPrefix(v, key) { - found = true - break + if len(line) > 0 && !strings.HasPrefix(line, "#") { + key := strings.SplitAfter(line, "=")[0] + + found := false + for _, v := range vars { + if strings.HasPrefix(v, key) { + found = true + break + } } - } - if !found { - vars = append(vars, line) + if !found { + vars = append(vars, line) + } } } diff --git a/vendor/github.com/docker/libcompose/config/merge_v1.go b/vendor/github.com/docker/libcompose/config/merge_v1.go index c3bf85454..6f6b8a4b3 100644 --- a/vendor/github.com/docker/libcompose/config/merge_v1.go +++ b/vendor/github.com/docker/libcompose/config/merge_v1.go @@ -5,8 +5,8 @@ import ( "path" "github.com/Sirupsen/logrus" - yaml "github.com/cloudfoundry-incubator/candiedyaml" "github.com/docker/libcompose/utils" + "gopkg.in/yaml.v2" ) // MergeServicesV1 merges a v1 compose file into an existing set of service configs diff --git a/vendor/github.com/docker/libcompose/config/merge_v2.go b/vendor/github.com/docker/libcompose/config/merge_v2.go index 919bd8eab..7ff627fa1 100644 --- a/vendor/github.com/docker/libcompose/config/merge_v2.go +++ b/vendor/github.com/docker/libcompose/config/merge_v2.go @@ -5,8 +5,8 @@ import ( "path" "github.com/Sirupsen/logrus" - yaml "github.com/cloudfoundry-incubator/candiedyaml" "github.com/docker/libcompose/utils" + "gopkg.in/yaml.v2" ) // MergeServicesV2 merges a v2 compose file into an existing set of service configs @@ -32,6 +32,12 @@ func MergeServicesV2(existingServices *ServiceConfigs, environmentLookup Environ } } + if options.Validate { + if err := validateV2(datas); err != nil { + return nil, err + } + } + for name, data := range datas { data, err := parseV2(resourceLookup, environmentLookup, file, data, datas, options) if err != nil { @@ -88,6 +94,12 @@ func ParseNetworks(bytes []byte) (map[string]*NetworkConfig, error) { return nil, err } + for key, value := range networkConfigs { + if value == nil { + networkConfigs[key] = &NetworkConfig{} + } + } + return networkConfigs, nil } @@ -149,6 +161,12 @@ func parseV2(resourceLookup ResourceLookup, environmentLookup EnvironmentLookup, } } + if options.Validate { + if err := validate(baseRawServices); err != nil { + return nil, err + } + } + baseService, ok = baseRawServices[service] if !ok { return nil, fmt.Errorf("Failed to find service %s in file %s", service, file) diff --git a/vendor/github.com/docker/libcompose/config/schema.go b/vendor/github.com/docker/libcompose/config/schema.go index c2b8e1719..bf8891293 100644 --- a/vendor/github.com/docker/libcompose/config/schema.go +++ b/vendor/github.com/docker/libcompose/config/schema.go @@ -1,6 +1,6 @@ package config -var schemaV1 = `{ +var schemaDataV1 = `{ "$schema": "http://json-schema.org/draft-04/schema#", "id": "config_schema_v1.json", @@ -87,6 +87,7 @@ var schemaV1 = `{ "mac_address": {"type": "string"}, "mem_limit": {"type": ["number", "string"]}, "memswap_limit": {"type": ["number", "string"]}, + "mem_swappiness": {"type": "integer"}, "net": {"type": "string"}, "pid": {"type": ["string", "null"]}, @@ -189,46 +190,14 @@ var schemaV1 = `{ } ` -var schemaV2 = `{ +var servicesSchemaDataV2 = `{ "$schema": "http://json-schema.org/draft-04/schema#", "id": "config_schema_v2.0.json", "type": "object", - "properties": { - "version": { - "type": "string" - }, - - "services": { - "id": "#/properties/services", - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9._-]+$": { - "$ref": "#/definitions/service" - } - }, - "additionalProperties": false - }, - - "networks": { - "id": "#/properties/networks", - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9._-]+$": { - "$ref": "#/definitions/network" - } - } - }, - - "volumes": { - "id": "#/properties/volumes", - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9._-]+$": { - "$ref": "#/definitions/volume" - } - }, - "additionalProperties": false + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/service" } }, @@ -330,6 +299,7 @@ var schemaV2 = `{ "mac_address": {"type": "string"}, "mem_limit": {"type": ["number", "string"]}, "memswap_limit": {"type": ["number", "string"]}, + "mem_swappiness": {"type": "integer"}, "network_mode": {"type": "string"}, "networks": { @@ -357,6 +327,7 @@ var schemaV2 = `{ } ] }, + "oom_score_adj": {"type": "integer", "minimum": -1000, "maximum": 1000}, "pid": {"type": ["string", "null"]}, "ports": { @@ -436,7 +407,8 @@ var schemaV2 = `{ "name": {"type": "string"} }, "additionalProperties": false - } + }, + "internal": {"type": "boolean"} }, "additionalProperties": false }, @@ -457,8 +429,7 @@ var schemaV2 = `{ "properties": { "name": {"type": "string"} } - }, - "additionalProperties": false + } }, "additionalProperties": false }, diff --git a/vendor/github.com/docker/libcompose/config/schema_helpers.go b/vendor/github.com/docker/libcompose/config/schema_helpers.go index 08e0ca3df..550e4cacf 100644 --- a/vendor/github.com/docker/libcompose/config/schema_helpers.go +++ b/vendor/github.com/docker/libcompose/config/schema_helpers.go @@ -9,9 +9,12 @@ import ( ) var ( - schemaLoader gojsonschema.JSONLoader - constraintSchemaLoader gojsonschema.JSONLoader - schema map[string]interface{} + schemaLoaderV1 gojsonschema.JSONLoader + constraintSchemaLoaderV1 gojsonschema.JSONLoader + schemaLoaderV2 gojsonschema.JSONLoader + constraintSchemaLoaderV2 gojsonschema.JSONLoader + schemaV1 map[string]interface{} + schemaV2 map[string]interface{} ) type ( @@ -31,28 +34,28 @@ func (checker portsFormatChecker) IsFormat(input string) bool { return err == nil } -func setupSchemaLoaders() error { - if schema != nil { +func setupSchemaLoaders(schemaData string, schema *map[string]interface{}, schemaLoader, constraintSchemaLoader *gojsonschema.JSONLoader) error { + if *schema != nil { return nil } var schemaRaw interface{} - err := json.Unmarshal([]byte(schemaV1), &schemaRaw) + err := json.Unmarshal([]byte(schemaData), &schemaRaw) if err != nil { return err } - schema = schemaRaw.(map[string]interface{}) + *schema = schemaRaw.(map[string]interface{}) gojsonschema.FormatCheckers.Add("environment", environmentFormatChecker{}) gojsonschema.FormatCheckers.Add("ports", portsFormatChecker{}) gojsonschema.FormatCheckers.Add("expose", portsFormatChecker{}) - schemaLoader = gojsonschema.NewGoLoader(schemaRaw) + *schemaLoader = gojsonschema.NewGoLoader(schemaRaw) - definitions := schema["definitions"].(map[string]interface{}) + definitions := (*schema)["definitions"].(map[string]interface{}) constraints := definitions["constraints"].(map[string]interface{}) service := constraints["service"].(map[string]interface{}) - constraintSchemaLoader = gojsonschema.NewGoLoader(service) + *constraintSchemaLoader = gojsonschema.NewGoLoader(service) return nil } diff --git a/vendor/github.com/docker/libcompose/config/types.go b/vendor/github.com/docker/libcompose/config/types.go index 0d9c65aaf..1651ee1c9 100644 --- a/vendor/github.com/docker/libcompose/config/types.go +++ b/vendor/github.com/docker/libcompose/config/types.go @@ -23,9 +23,9 @@ type ServiceConfigV1 struct { CapAdd []string `yaml:"cap_add,omitempty"` CapDrop []string `yaml:"cap_drop,omitempty"` CgroupParent string `yaml:"cgroup_parent,omitempty"` - CPUQuota int64 `yaml:"cpu_quota,omitempty"` + CPUQuota yaml.StringorInt `yaml:"cpu_quota,omitempty"` CPUSet string `yaml:"cpuset,omitempty"` - CPUShares int64 `yaml:"cpu_shares,omitempty"` + CPUShares yaml.StringorInt `yaml:"cpu_shares,omitempty"` Command yaml.Command `yaml:"command,flow,omitempty"` ContainerName string `yaml:"container_name,omitempty"` DeviceReadIOps yaml.MaporColonSlice `yaml:"device_read_iops,omitempty"` @@ -44,8 +44,8 @@ type ServiceConfigV1 struct { Links yaml.MaporColonSlice `yaml:"links,omitempty"` LogDriver string `yaml:"log_driver,omitempty"` MacAddress string `yaml:"mac_address,omitempty"` - MemLimit int64 `yaml:"mem_limit,omitempty"` - MemSwapLimit int64 `yaml:"memswap_limit,omitempty"` + MemLimit yaml.StringorInt `yaml:"mem_limit,omitempty"` + MemSwapLimit yaml.StringorInt `yaml:"memswap_limit,omitempty"` Name string `yaml:"name,omitempty"` Net string `yaml:"net,omitempty"` Pid string `yaml:"pid,omitempty"` @@ -55,7 +55,7 @@ type ServiceConfigV1 struct { Privileged bool `yaml:"privileged,omitempty"` Restart string `yaml:"restart,omitempty"` ReadOnly bool `yaml:"read_only,omitempty"` - ShmSize int64 `yaml:"shm_size,omitempty"` + ShmSize yaml.StringorInt `yaml:"shm_size,omitempty"` StdinOpen bool `yaml:"stdin_open,omitempty"` SecurityOpt []string `yaml:"security_opt,omitempty"` Tty bool `yaml:"tty,omitempty"` @@ -83,8 +83,8 @@ type ServiceConfig struct { CapAdd []string `yaml:"cap_add,omitempty"` CapDrop []string `yaml:"cap_drop,omitempty"` CPUSet string `yaml:"cpuset,omitempty"` - CPUShares int64 `yaml:"cpu_shares,omitempty"` - CPUQuota int64 `yaml:"cpu_quota,omitempty"` + CPUShares yaml.StringorInt `yaml:"cpu_shares,omitempty"` + CPUQuota yaml.StringorInt `yaml:"cpu_quota,omitempty"` Command yaml.Command `yaml:"command,flow,omitempty"` CgroupParent string `yaml:"cgroup_parent,omitempty"` ContainerName string `yaml:"container_name,omitempty"` @@ -109,18 +109,18 @@ type ServiceConfig struct { Links yaml.MaporColonSlice `yaml:"links,omitempty"` Logging Log `yaml:"logging,omitempty"` MacAddress string `yaml:"mac_address,omitempty"` - MemLimit int64 `yaml:"mem_limit,omitempty"` - MemSwapLimit int64 `yaml:"memswap_limit,omitempty"` + MemLimit yaml.StringorInt `yaml:"mem_limit,omitempty"` + MemSwapLimit yaml.StringorInt `yaml:"memswap_limit,omitempty"` NetworkMode string `yaml:"network_mode,omitempty"` Networks *yaml.Networks `yaml:"networks,omitempty"` Pid string `yaml:"pid,omitempty"` Ports []string `yaml:"ports,omitempty"` Privileged bool `yaml:"privileged,omitempty"` SecurityOpt []string `yaml:"security_opt,omitempty"` - ShmSize int64 `yaml:"shm_size,omitempty"` + ShmSize yaml.StringorInt `yaml:"shm_size,omitempty"` StopSignal string `yaml:"stop_signal,omitempty"` VolumeDriver string `yaml:"volume_driver,omitempty"` - Volumes []string `yaml:"volumes,omitempty"` + Volumes *yaml.Volumes `yaml:"volumes,omitempty"` VolumesFrom []string `yaml:"volumes_from,omitempty"` Uts string `yaml:"uts,omitempty"` Restart string `yaml:"restart,omitempty"` @@ -205,6 +205,13 @@ func (c *ServiceConfigs) Add(name string, service *ServiceConfig) { c.mu.Unlock() } +// Remove removes the config with the specified name +func (c *ServiceConfigs) Remove(name string) { + c.mu.Lock() + delete(c.m, name) + c.mu.Unlock() +} + // Len returns the len of the configs func (c *ServiceConfigs) Len() int { c.mu.RLock() @@ -223,6 +230,13 @@ func (c *ServiceConfigs) Keys() []string { return keys } +// All returns all the config at once +func (c *ServiceConfigs) All() map[string]*ServiceConfig { + c.mu.RLock() + defer c.mu.RUnlock() + return c.m +} + // RawService is represent a Service in map form unparsed type RawService map[string]interface{} diff --git a/vendor/github.com/docker/libcompose/config/validation.go b/vendor/github.com/docker/libcompose/config/validation.go index 177a64951..3f5c7c1ad 100644 --- a/vendor/github.com/docker/libcompose/config/validation.go +++ b/vendor/github.com/docker/libcompose/config/validation.go @@ -189,21 +189,42 @@ func invalidTypeMessage(service, key string, err gojsonschema.ResultError) strin } func validate(serviceMap RawServiceMap) error { - if err := setupSchemaLoaders(); err != nil { + if err := setupSchemaLoaders(schemaDataV1, &schemaV1, &schemaLoaderV1, &constraintSchemaLoaderV1); err != nil { return err } serviceMap = convertServiceMapKeysToStrings(serviceMap) - var validationErrors []string + dataLoader := gojsonschema.NewGoLoader(serviceMap) + + result, err := gojsonschema.Validate(schemaLoaderV1, dataLoader) + if err != nil { + return err + } + + return generateErrorMessages(serviceMap, schemaV1, result) +} + +func validateV2(serviceMap RawServiceMap) error { + if err := setupSchemaLoaders(servicesSchemaDataV2, &schemaV2, &schemaLoaderV2, &constraintSchemaLoaderV2); err != nil { + return err + } + + serviceMap = convertServiceMapKeysToStrings(serviceMap) dataLoader := gojsonschema.NewGoLoader(serviceMap) - result, err := gojsonschema.Validate(schemaLoader, dataLoader) + result, err := gojsonschema.Validate(schemaLoaderV2, dataLoader) if err != nil { return err } + return generateErrorMessages(serviceMap, schemaV2, result) +} + +func generateErrorMessages(serviceMap RawServiceMap, schema map[string]interface{}, result *gojsonschema.Result) error { + var validationErrors []string + // gojsonschema can create extraneous "additional_property_not_allowed" errors in some cases // If this is set, and the error is at root level, skip over that error skipRootAdditionalPropertyError := false @@ -261,7 +282,7 @@ func validate(serviceMap RawServiceMap) error { } func validateServiceConstraints(service RawService, serviceName string) error { - if err := setupSchemaLoaders(); err != nil { + if err := setupSchemaLoaders(schemaDataV1, &schemaV1, &schemaLoaderV1, &constraintSchemaLoaderV1); err != nil { return err } @@ -271,7 +292,7 @@ func validateServiceConstraints(service RawService, serviceName string) error { dataLoader := gojsonschema.NewGoLoader(service) - result, err := gojsonschema.Validate(constraintSchemaLoader, dataLoader) + result, err := gojsonschema.Validate(constraintSchemaLoaderV1, dataLoader) if err != nil { return err } diff --git a/vendor/github.com/docker/libcompose/docker/auth.go b/vendor/github.com/docker/libcompose/docker/auth.go deleted file mode 100644 index f50236368..000000000 --- a/vendor/github.com/docker/libcompose/docker/auth.go +++ /dev/null @@ -1,40 +0,0 @@ -package docker - -import ( - "github.com/docker/docker/registry" - "github.com/docker/engine-api/types" -) - -// AuthLookup defines a method for looking up authentication information -type AuthLookup interface { - All() map[string]types.AuthConfig - Lookup(repoInfo *registry.RepositoryInfo) types.AuthConfig -} - -// ConfigAuthLookup implements AuthLookup by reading a Docker config file -type ConfigAuthLookup struct { - context *Context -} - -// NewConfigAuthLookup creates a new ConfigAuthLookup for a given context -func NewConfigAuthLookup(context *Context) *ConfigAuthLookup { - return &ConfigAuthLookup{ - context: context, - } -} - -// Lookup uses a Docker config file to lookup authentication information -func (c *ConfigAuthLookup) Lookup(repoInfo *registry.RepositoryInfo) types.AuthConfig { - if c.context.ConfigFile == nil || repoInfo == nil || repoInfo.Index == nil { - return types.AuthConfig{} - } - return registry.ResolveAuthConfig(c.context.ConfigFile.AuthConfigs, repoInfo.Index) -} - -// All uses a Docker config file to get all authentication information -func (c *ConfigAuthLookup) All() map[string]types.AuthConfig { - if c.context.ConfigFile == nil { - return map[string]types.AuthConfig{} - } - return c.context.ConfigFile.AuthConfigs -} diff --git a/vendor/github.com/docker/libcompose/docker/auth/auth.go b/vendor/github.com/docker/libcompose/docker/auth/auth.go new file mode 100644 index 000000000..435af3848 --- /dev/null +++ b/vendor/github.com/docker/libcompose/docker/auth/auth.go @@ -0,0 +1,41 @@ +package auth + +import ( + "github.com/docker/docker/cliconfig/configfile" + "github.com/docker/docker/registry" + "github.com/docker/engine-api/types" +) + +// Lookup defines a method for looking up authentication information +type Lookup interface { + All() map[string]types.AuthConfig + Lookup(repoInfo *registry.RepositoryInfo) types.AuthConfig +} + +// ConfigLookup implements AuthLookup by reading a Docker config file +type ConfigLookup struct { + *configfile.ConfigFile +} + +// NewConfigLookup creates a new ConfigLookup for a given context +func NewConfigLookup(configfile *configfile.ConfigFile) *ConfigLookup { + return &ConfigLookup{ + ConfigFile: configfile, + } +} + +// Lookup uses a Docker config file to lookup authentication information +func (c *ConfigLookup) Lookup(repoInfo *registry.RepositoryInfo) types.AuthConfig { + if c.ConfigFile == nil || repoInfo == nil || repoInfo.Index == nil { + return types.AuthConfig{} + } + return registry.ResolveAuthConfig(c.ConfigFile.AuthConfigs, repoInfo.Index) +} + +// All uses a Docker config file to get all authentication information +func (c *ConfigLookup) All() map[string]types.AuthConfig { + if c.ConfigFile == nil { + return map[string]types.AuthConfig{} + } + return c.ConfigFile.AuthConfigs +} diff --git a/vendor/github.com/docker/libcompose/docker/builder/builder.go b/vendor/github.com/docker/libcompose/docker/builder/builder.go index 3c46d13df..e1eb6a9c2 100644 --- a/vendor/github.com/docker/libcompose/docker/builder/builder.go +++ b/vendor/github.com/docker/libcompose/docker/builder/builder.go @@ -21,6 +21,7 @@ import ( "github.com/docker/docker/pkg/term" "github.com/docker/engine-api/client" "github.com/docker/engine-api/types" + "github.com/docker/libcompose/logger" ) // DefaultDockerfileName is the default name of a Dockerfile @@ -42,6 +43,7 @@ type DaemonBuilder struct { ForceRemove bool Pull bool BuildArgs map[string]string + LoggerFactory logger.Factory } // Build implements Builder. It consumes the docker build API endpoint and sends @@ -52,9 +54,26 @@ func (d *DaemonBuilder) Build(ctx context.Context, imageName string) error { return err } defer buildCtx.Close() + if d.LoggerFactory == nil { + d.LoggerFactory = &logger.NullLogger{} + } + + l := d.LoggerFactory.CreateBuildLogger(imageName) + + progBuff := &logger.Wrapper{ + Err: false, + Logger: l, + } - var progBuff io.Writer = os.Stdout - var buildBuff io.Writer = os.Stdout + buildBuff := &logger.Wrapper{ + Err: false, + Logger: l, + } + + errBuff := &logger.Wrapper{ + Err: true, + Logger: l, + } // Setup an upload progress bar progressOutput := streamformatter.NewStreamFormatter().NewProgressOutput(progBuff, true) @@ -64,6 +83,10 @@ func (d *DaemonBuilder) Build(ctx context.Context, imageName string) error { logrus.Infof("Building %s...", imageName) outFd, isTerminalOut := term.GetFdInfo(os.Stdout) + w := l.OutWriter() + if w != nil { + outFd, isTerminalOut = term.GetFdInfo(w) + } response, err := d.Client.ImageBuild(ctx, body, types.ImageBuildOptions{ Tags: []string{imageName}, @@ -86,6 +109,7 @@ func (d *DaemonBuilder) Build(ctx context.Context, imageName string) error { if jerr.Code == 0 { jerr.Code = 1 } + errBuff.Write([]byte(jerr.Error())) return fmt.Errorf("Status: %s, Code: %d", jerr.Message, jerr.Code) } } diff --git a/vendor/github.com/docker/libcompose/docker/container.go b/vendor/github.com/docker/libcompose/docker/container.go deleted file mode 100644 index 42b929977..000000000 --- a/vendor/github.com/docker/libcompose/docker/container.go +++ /dev/null @@ -1,766 +0,0 @@ -package docker - -import ( - "fmt" - "io" - "math" - "os" - "strings" - "time" - - "golang.org/x/net/context" - - "github.com/Sirupsen/logrus" - "github.com/docker/docker/pkg/promise" - "github.com/docker/docker/pkg/stdcopy" - "github.com/docker/docker/pkg/term" - "github.com/docker/engine-api/client" - "github.com/docker/engine-api/types" - "github.com/docker/engine-api/types/container" - "github.com/docker/engine-api/types/network" - "github.com/docker/go-connections/nat" - "github.com/docker/libcompose/config" - "github.com/docker/libcompose/labels" - "github.com/docker/libcompose/logger" - "github.com/docker/libcompose/project" - "github.com/docker/libcompose/project/events" - util "github.com/docker/libcompose/utils" - "github.com/docker/libcompose/yaml" -) - -// Container holds information about a docker container and the service it is tied on. -type Container struct { - name string - serviceName string - projectName string - containerNumber int - oneOff bool - eventNotifier events.Notifier - loggerFactory logger.Factory - client client.APIClient - - // FIXME(vdemeester) Remove this dependency - service *Service -} - -// NewContainer creates a container struct with the specified docker client, name and service. -func NewContainer(client client.APIClient, name string, containerNumber int, service *Service) *Container { - return &Container{ - client: client, - name: name, - containerNumber: containerNumber, - - // TODO(vdemeester) Move these to arguments - serviceName: service.name, - projectName: service.project.Name, - eventNotifier: service.project, - loggerFactory: service.context.LoggerFactory, - - // TODO(vdemeester) Remove this dependency - service: service, - } -} - -// NewOneOffContainer creates a "oneoff" container struct with the specified docker client, name and service. -func NewOneOffContainer(client client.APIClient, name string, containerNumber int, service *Service) *Container { - c := NewContainer(client, name, containerNumber, service) - c.oneOff = true - return c -} - -func (c *Container) findExisting(ctx context.Context) (*types.ContainerJSON, error) { - return GetContainer(ctx, c.client, c.name) -} - -// Info returns info about the container, like name, command, state or ports. -func (c *Container) Info(ctx context.Context, qFlag bool) (project.Info, error) { - container, err := c.findExisting(ctx) - if err != nil || container == nil { - return nil, err - } - - infos, err := GetContainersByFilter(ctx, c.client, map[string][]string{ - "name": {container.Name}, - }) - if err != nil || len(infos) == 0 { - return nil, err - } - info := infos[0] - - result := project.Info{} - if qFlag { - result = append(result, project.InfoPart{Key: "Id", Value: container.ID}) - } else { - result = append(result, project.InfoPart{Key: "Name", Value: name(info.Names)}) - result = append(result, project.InfoPart{Key: "Command", Value: info.Command}) - result = append(result, project.InfoPart{Key: "State", Value: info.Status}) - result = append(result, project.InfoPart{Key: "Ports", Value: portString(info.Ports)}) - } - - return result, nil -} - -func portString(ports []types.Port) string { - result := []string{} - - for _, port := range ports { - if port.PublicPort > 0 { - result = append(result, fmt.Sprintf("%s:%d->%d/%s", port.IP, port.PublicPort, port.PrivatePort, port.Type)) - } else { - result = append(result, fmt.Sprintf("%d/%s", port.PrivatePort, port.Type)) - } - } - - return strings.Join(result, ", ") -} - -func name(names []string) string { - max := math.MaxInt32 - var current string - - for _, v := range names { - if len(v) < max { - max = len(v) - current = v - } - } - - return current[1:] -} - -// Recreate will not refresh the container by means of relaxation and enjoyment, -// just delete it and create a new one with the current configuration -func (c *Container) Recreate(ctx context.Context, imageName string) (*types.ContainerJSON, error) { - container, err := c.findExisting(ctx) - if err != nil || container == nil { - return nil, err - } - - hash := container.Config.Labels[labels.HASH.Str()] - if hash == "" { - return nil, fmt.Errorf("Failed to find hash on old container: %s", container.Name) - } - - name := container.Name[1:] - newName := fmt.Sprintf("%s_%s", name, container.ID[:12]) - logrus.Debugf("Renaming %s => %s", name, newName) - if err := c.client.ContainerRename(ctx, container.ID, newName); err != nil { - logrus.Errorf("Failed to rename old container %s", c.name) - return nil, err - } - - newContainer, err := c.createContainer(ctx, imageName, container.ID, nil) - if err != nil { - return nil, err - } - logrus.Debugf("Created replacement container %s", newContainer.ID) - - if err := c.client.ContainerRemove(ctx, container.ID, types.ContainerRemoveOptions{ - Force: true, - RemoveVolumes: false, - }); err != nil { - logrus.Errorf("Failed to remove old container %s", c.name) - return nil, err - } - logrus.Debugf("Removed old container %s %s", c.name, container.ID) - - return newContainer, nil -} - -// Create creates the container based on the specified image name and send an event -// to notify the container has been created. If the container already exists, does -// nothing. -func (c *Container) Create(ctx context.Context, imageName string) (*types.ContainerJSON, error) { - return c.CreateWithOverride(ctx, imageName, nil) -} - -// CreateWithOverride create container and override parts of the config to -// allow special situations to override the config generated from the compose -// file -func (c *Container) CreateWithOverride(ctx context.Context, imageName string, configOverride *config.ServiceConfig) (*types.ContainerJSON, error) { - container, err := c.findExisting(ctx) - if err != nil { - return nil, err - } - - if container == nil { - container, err = c.createContainer(ctx, imageName, "", configOverride) - if err != nil { - return nil, err - } - c.eventNotifier.Notify(events.ContainerCreated, c.serviceName, map[string]string{ - "name": c.Name(), - }) - } - - return container, err -} - -// Stop stops the container. -func (c *Container) Stop(ctx context.Context, timeout int) error { - return c.withContainer(ctx, func(container *types.ContainerJSON) error { - timeoutDuration := time.Duration(timeout) * time.Second - return c.client.ContainerStop(ctx, container.ID, &timeoutDuration) - }) -} - -// Pause pauses the container. If the containers are already paused, don't fail. -func (c *Container) Pause(ctx context.Context) error { - return c.withContainer(ctx, func(container *types.ContainerJSON) error { - if !container.State.Paused { - return c.client.ContainerPause(ctx, container.ID) - } - return nil - }) -} - -// Unpause unpauses the container. If the containers are not paused, don't fail. -func (c *Container) Unpause(ctx context.Context) error { - return c.withContainer(ctx, func(container *types.ContainerJSON) error { - if container.State.Paused { - return c.client.ContainerUnpause(ctx, container.ID) - } - return nil - }) -} - -// Kill kill the container. -func (c *Container) Kill(ctx context.Context, signal string) error { - return c.withContainer(ctx, func(container *types.ContainerJSON) error { - return c.client.ContainerKill(ctx, container.ID, signal) - }) -} - -// Delete removes the container if existing. If the container is running, it tries -// to stop it first. -func (c *Container) Delete(ctx context.Context, removeVolume bool) error { - container, err := c.findExisting(ctx) - if err != nil || container == nil { - return err - } - - info, err := c.client.ContainerInspect(ctx, container.ID) - if err != nil { - return err - } - - if !info.State.Running { - return c.client.ContainerRemove(ctx, container.ID, types.ContainerRemoveOptions{ - Force: true, - RemoveVolumes: removeVolume, - }) - } - - return nil -} - -// IsRunning returns the running state of the container. -func (c *Container) IsRunning(ctx context.Context) (bool, error) { - container, err := c.findExisting(ctx) - if err != nil || container == nil { - return false, err - } - - info, err := c.client.ContainerInspect(ctx, container.ID) - if err != nil { - return false, err - } - - return info.State.Running, nil -} - -// Run creates, start and attach to the container based on the image name, -// the specified configuration. -// It will always create a new container. -func (c *Container) Run(ctx context.Context, configOverride *config.ServiceConfig) (int, error) { - var ( - errCh chan error - out, stderr io.Writer - in io.ReadCloser - ) - - container, err := c.findExisting(ctx) - if err != nil || container == nil { - return -1, err - } - - if configOverride.StdinOpen { - in = os.Stdin - } - if configOverride.Tty { - out = os.Stdout - } - if configOverride.Tty { - stderr = os.Stderr - } - - options := types.ContainerAttachOptions{ - Stream: true, - Stdin: configOverride.StdinOpen, - Stdout: configOverride.Tty, - Stderr: configOverride.Tty, - } - - resp, err := c.client.ContainerAttach(ctx, container.ID, options) - if err != nil { - return -1, err - } - - // set raw terminal - inFd, _ := term.GetFdInfo(in) - state, err := term.SetRawTerminal(inFd) - if err != nil { - return -1, err - } - // restore raw terminal - defer term.RestoreTerminal(inFd, state) - // holdHijackedConnection (in goroutine) - errCh = promise.Go(func() error { - return holdHijackedConnection(configOverride.Tty, in, out, stderr, resp) - }) - - if err := c.client.ContainerStart(ctx, container.ID, types.ContainerStartOptions{}); err != nil { - return -1, err - } - - if err := <-errCh; err != nil { - logrus.Debugf("Error hijack: %s", err) - return -1, err - } - - exitedContainer, err := c.client.ContainerInspect(ctx, container.ID) - if err != nil { - return -1, err - } - - return exitedContainer.State.ExitCode, nil -} - -func holdHijackedConnection(tty bool, inputStream io.ReadCloser, outputStream, errorStream io.Writer, resp types.HijackedResponse) error { - var err error - receiveStdout := make(chan error, 1) - if outputStream != nil || errorStream != nil { - go func() { - // When TTY is ON, use regular copy - if tty && outputStream != nil { - _, err = io.Copy(outputStream, resp.Reader) - } else { - _, err = stdcopy.StdCopy(outputStream, errorStream, resp.Reader) - } - logrus.Debugf("[hijack] End of stdout") - receiveStdout <- err - }() - } - - stdinDone := make(chan struct{}) - go func() { - if inputStream != nil { - io.Copy(resp.Conn, inputStream) - logrus.Debugf("[hijack] End of stdin") - } - - if err := resp.CloseWrite(); err != nil { - logrus.Debugf("Couldn't send EOF: %s", err) - } - close(stdinDone) - }() - - select { - case err := <-receiveStdout: - if err != nil { - logrus.Debugf("Error receiveStdout: %s", err) - return err - } - case <-stdinDone: - if outputStream != nil || errorStream != nil { - if err := <-receiveStdout; err != nil { - logrus.Debugf("Error receiveStdout: %s", err) - return err - } - } - } - - return nil -} - -// Start the specified container with the specified host config -func (c *Container) Start(ctx context.Context) error { - container, err := c.findExisting(ctx) - if err != nil || container == nil { - return err - } - logrus.WithFields(logrus.Fields{"container.ID": container.ID, "c.name": c.name}).Debug("Starting container") - if err := c.client.ContainerStart(context.Background(), container.ID, types.ContainerStartOptions{}); err != nil { - logrus.WithFields(logrus.Fields{"container.ID": container.ID, "c.name": c.name}).Debug("Failed to start container") - return err - } - c.eventNotifier.Notify(events.ContainerStarted, c.serviceName, map[string]string{ - "name": c.Name(), - }) - return nil -} - -// OutOfSync checks if the container is out of sync with the service definition. -// It looks if the the service hash container label is the same as the computed one. -func (c *Container) OutOfSync(ctx context.Context, imageName string) (bool, error) { - container, err := c.findExisting(ctx) - if err != nil || container == nil { - return false, err - } - - if container.Config.Image != imageName { - logrus.Debugf("Images for %s do not match %s!=%s", c.name, container.Config.Image, imageName) - return true, nil - } - - if container.Config.Labels[labels.HASH.Str()] != c.getHash() { - logrus.Debugf("Hashes for %s do not match %s!=%s", c.name, container.Config.Labels[labels.HASH.Str()], c.getHash()) - return true, nil - } - - image, _, err := c.client.ImageInspectWithRaw(ctx, container.Config.Image, false) - if err != nil { - if client.IsErrImageNotFound(err) { - logrus.Debugf("Image %s do not exist, do not know if it's out of sync", container.Config.Image) - return false, nil - } - return false, err - } - - logrus.Debugf("Checking existing image name vs id: %s == %s", image.ID, container.Image) - return image.ID != container.Image, err -} - -func (c *Container) getHash() string { - return config.GetServiceHash(c.serviceName, c.service.Config()) -} - -func volumeBinds(volumes map[string]struct{}, container *types.ContainerJSON) []string { - result := make([]string, 0, len(container.Mounts)) - for _, mount := range container.Mounts { - if _, ok := volumes[mount.Destination]; ok { - result = append(result, fmt.Sprint(mount.Source, ":", mount.Destination)) - } - } - return result -} - -func (c *Container) createContainer(ctx context.Context, imageName, oldContainer string, configOverride *config.ServiceConfig) (*types.ContainerJSON, error) { - serviceConfig := c.service.serviceConfig - if configOverride != nil { - serviceConfig.Command = configOverride.Command - serviceConfig.Tty = configOverride.Tty - serviceConfig.StdinOpen = configOverride.StdinOpen - } - configWrapper, err := ConvertToAPI(c.service) - if err != nil { - return nil, err - } - - configWrapper.Config.Image = imageName - - if configWrapper.Config.Labels == nil { - configWrapper.Config.Labels = map[string]string{} - } - - oneOffString := "False" - if c.oneOff { - oneOffString = "True" - } - - configWrapper.Config.Labels[labels.SERVICE.Str()] = c.serviceName - configWrapper.Config.Labels[labels.PROJECT.Str()] = c.projectName - configWrapper.Config.Labels[labels.HASH.Str()] = c.getHash() - configWrapper.Config.Labels[labels.ONEOFF.Str()] = oneOffString - configWrapper.Config.Labels[labels.NUMBER.Str()] = fmt.Sprint(c.containerNumber) - configWrapper.Config.Labels[labels.VERSION.Str()] = ComposeVersion - - err = c.populateAdditionalHostConfig(configWrapper.HostConfig) - if err != nil { - return nil, err - } - - if oldContainer != "" { - info, err := c.client.ContainerInspect(ctx, oldContainer) - if err != nil { - return nil, err - } - configWrapper.HostConfig.Binds = util.Merge(configWrapper.HostConfig.Binds, volumeBinds(configWrapper.Config.Volumes, &info)) - } - - logrus.Debugf("Creating container %s %#v", c.name, configWrapper) - - container, err := c.client.ContainerCreate(ctx, configWrapper.Config, configWrapper.HostConfig, configWrapper.NetworkingConfig, c.name) - if err != nil { - logrus.Debugf("Failed to create container %s: %v", c.name, err) - return nil, err - } - - return GetContainer(ctx, c.client, container.ID) -} - -func (c *Container) populateAdditionalHostConfig(hostConfig *container.HostConfig) error { - links, err := c.getLinks() - if err != nil { - return err - } - - for _, link := range c.service.DependentServices() { - if !c.service.project.ServiceConfigs.Has(link.Target) { - continue - } - - service, err := c.service.project.CreateService(link.Target) - if err != nil { - return err - } - - // FIXME(vdemeester) container should not know service - containers, err := service.Containers(context.Background()) - if err != nil { - return err - } - - if link.Type == project.RelTypeIpcNamespace { - hostConfig, err = c.addIpc(hostConfig, service, containers) - } else if link.Type == project.RelTypeNetNamespace { - hostConfig, err = c.addNetNs(hostConfig, service, containers) - } - - if err != nil { - return err - } - } - - hostConfig.Links = []string{} - for k, v := range links { - hostConfig.Links = append(hostConfig.Links, strings.Join([]string{v, k}, ":")) - } - for _, v := range c.service.Config().ExternalLinks { - hostConfig.Links = append(hostConfig.Links, v) - } - - return nil -} - -// FIXME(vdemeester) this is temporary -func (c *Container) getLinks() (map[string]string, error) { - links := map[string]string{} - for _, link := range c.service.DependentServices() { - if !c.service.project.ServiceConfigs.Has(link.Target) { - continue - } - - service, err := c.service.project.CreateService(link.Target) - if err != nil { - return nil, err - } - - // FIXME(vdemeester) container should not know service - containers, err := service.Containers(context.Background()) - if err != nil { - return nil, err - } - - if link.Type == project.RelTypeLink { - c.addLinks(links, service, link, containers) - } - - if err != nil { - return nil, err - } - } - return links, nil -} - -func (c *Container) addLinks(links map[string]string, service project.Service, rel project.ServiceRelationship, containers []project.Container) { - for _, container := range containers { - if _, ok := links[rel.Alias]; !ok { - links[rel.Alias] = container.Name() - } - - links[container.Name()] = container.Name() - } -} - -func (c *Container) addIpc(config *container.HostConfig, service project.Service, containers []project.Container) (*container.HostConfig, error) { - if len(containers) == 0 { - return nil, fmt.Errorf("Failed to find container for IPC %v", c.service.Config().Ipc) - } - - id, err := containers[0].ID() - if err != nil { - return nil, err - } - - config.IpcMode = container.IpcMode("container:" + id) - return config, nil -} - -func (c *Container) addNetNs(config *container.HostConfig, service project.Service, containers []project.Container) (*container.HostConfig, error) { - if len(containers) == 0 { - return nil, fmt.Errorf("Failed to find container for networks ns %v", c.service.Config().NetworkMode) - } - - id, err := containers[0].ID() - if err != nil { - return nil, err - } - - config.NetworkMode = container.NetworkMode("container:" + id) - return config, nil -} - -// ID returns the container Id. -func (c *Container) ID() (string, error) { - // FIXME(vdemeester) container should not ask for his ID.. - container, err := c.findExisting(context.Background()) - if container == nil { - return "", err - } - return container.ID, err -} - -// Name returns the container name. -func (c *Container) Name() string { - return c.name -} - -// Restart restarts the container if existing, does nothing otherwise. -func (c *Container) Restart(ctx context.Context, timeout int) error { - container, err := c.findExisting(ctx) - if err != nil || container == nil { - return err - } - - timeoutDuration := time.Duration(timeout) * time.Second - return c.client.ContainerRestart(ctx, container.ID, &timeoutDuration) -} - -// Log forwards container logs to the project configured logger. -func (c *Container) Log(ctx context.Context, follow bool) error { - container, err := c.findExisting(ctx) - if container == nil || err != nil { - return err - } - - info, err := c.client.ContainerInspect(ctx, container.ID) - if err != nil { - return err - } - - // FIXME(vdemeester) update container struct to do less API calls - name := fmt.Sprintf("%s_%d", c.service.name, c.containerNumber) - l := c.loggerFactory.Create(name) - - options := types.ContainerLogsOptions{ - ShowStdout: true, - ShowStderr: true, - Follow: follow, - Tail: "all", - } - responseBody, err := c.client.ContainerLogs(ctx, c.name, options) - if err != nil { - return err - } - defer responseBody.Close() - - if info.Config.Tty { - _, err = io.Copy(&logger.Wrapper{Logger: l}, responseBody) - } else { - _, err = stdcopy.StdCopy(&logger.Wrapper{Logger: l}, &logger.Wrapper{Logger: l, Err: true}, responseBody) - } - logrus.WithFields(logrus.Fields{"Logger": l, "err": err}).Debug("c.client.Logs() returned error") - - return err -} - -func (c *Container) withContainer(ctx context.Context, action func(*types.ContainerJSON) error) error { - container, err := c.findExisting(ctx) - if err != nil { - return err - } - - if container != nil { - return action(container) - } - - return nil -} - -// Port returns the host port the specified port is mapped on. -func (c *Container) Port(ctx context.Context, port string) (string, error) { - container, err := c.findExisting(ctx) - if err != nil { - return "", err - } - - if bindings, ok := container.NetworkSettings.Ports[nat.Port(port)]; ok { - result := []string{} - for _, binding := range bindings { - result = append(result, binding.HostIP+":"+binding.HostPort) - } - - return strings.Join(result, "\n"), nil - } - return "", nil -} - -// Networks returns the containers network -// FIXME(vdemeester) should not need ctx or calling the API, will take care of it -// when refactoring Container. -func (c *Container) Networks(ctx context.Context) (map[string]*network.EndpointSettings, error) { - container, err := c.findExisting(ctx) - if err != nil { - return nil, err - } - if container == nil { - return map[string]*network.EndpointSettings{}, nil - } - return container.NetworkSettings.Networks, nil -} - -// NetworkDisconnect disconnects the container from the specified network -// FIXME(vdemeester) will be refactor with Container refactoring -func (c *Container) NetworkDisconnect(ctx context.Context, net *yaml.Network) error { - container, err := c.findExisting(ctx) - if err != nil || container == nil { - return err - } - return c.client.NetworkDisconnect(ctx, net.RealName, container.ID, true) -} - -// NetworkConnect connects the container to the specified network -// FIXME(vdemeester) will be refactor with Container refactoring -func (c *Container) NetworkConnect(ctx context.Context, net *yaml.Network) error { - container, err := c.findExisting(ctx) - if err != nil || container == nil { - return err - } - internalLinks, err := c.getLinks() - if err != nil { - return err - } - links := []string{} - // TODO(vdemeester) handle link to self (?) - for k, v := range internalLinks { - links = append(links, strings.Join([]string{v, k}, ":")) - } - for _, v := range c.service.Config().ExternalLinks { - links = append(links, v) - } - aliases := []string{} - if !c.oneOff { - aliases = []string{c.serviceName} - } - aliases = append(aliases, net.Aliases...) - return c.client.NetworkConnect(ctx, net.RealName, container.ID, &network.EndpointSettings{ - Aliases: aliases, - Links: links, - IPAddress: net.IPv4Address, - IPAMConfig: &network.EndpointIPAMConfig{ - IPv4Address: net.IPv4Address, - IPv6Address: net.IPv6Address, - }, - }) -} diff --git a/vendor/github.com/docker/libcompose/docker/container/container.go b/vendor/github.com/docker/libcompose/docker/container/container.go new file mode 100644 index 000000000..af4032ddb --- /dev/null +++ b/vendor/github.com/docker/libcompose/docker/container/container.go @@ -0,0 +1,379 @@ +package container + +import ( + "fmt" + "io" + "math" + "os" + "strconv" + "strings" + "time" + + "golang.org/x/net/context" + + "github.com/Sirupsen/logrus" + "github.com/docker/docker/pkg/promise" + "github.com/docker/docker/pkg/stdcopy" + "github.com/docker/docker/pkg/term" + "github.com/docker/engine-api/client" + "github.com/docker/engine-api/types" + "github.com/docker/engine-api/types/container" + "github.com/docker/engine-api/types/network" + "github.com/docker/go-connections/nat" + "github.com/docker/libcompose/config" + "github.com/docker/libcompose/labels" + "github.com/docker/libcompose/logger" + "github.com/docker/libcompose/project" +) + +// Container holds information about a docker container and the service it is tied on. +type Container struct { + client client.ContainerAPIClient + id string + container *types.ContainerJSON +} + +// Create creates a container and return a Container struct (and an error if any) +func Create(ctx context.Context, client client.ContainerAPIClient, name string, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig) (*Container, error) { + container, err := client.ContainerCreate(ctx, config, hostConfig, networkingConfig, name) + if err != nil { + return nil, err + } + return New(ctx, client, container.ID) +} + +// New creates a container struct with the specified client, id and name +func New(ctx context.Context, client client.ContainerAPIClient, id string) (*Container, error) { + container, err := Get(ctx, client, id) + if err != nil { + return nil, err + } + return &Container{ + client: client, + id: id, + container: container, + }, nil +} + +// NewInspected creates a container struct from an inspected container +func NewInspected(client client.ContainerAPIClient, container *types.ContainerJSON) *Container { + return &Container{ + client: client, + id: container.ID, + container: container, + } +} + +// Info returns info about the container, like name, command, state or ports. +func (c *Container) Info(ctx context.Context) (project.Info, error) { + infos, err := ListByFilter(ctx, c.client, map[string][]string{ + "name": {c.container.Name}, + }) + if err != nil || len(infos) == 0 { + return nil, err + } + info := infos[0] + + result := project.Info{} + result["Id"] = c.container.ID + result["Name"] = name(info.Names) + result["Command"] = info.Command + result["State"] = info.Status + result["Ports"] = portString(info.Ports) + + return result, nil +} + +func portString(ports []types.Port) string { + result := []string{} + + for _, port := range ports { + if port.PublicPort > 0 { + result = append(result, fmt.Sprintf("%s:%d->%d/%s", port.IP, port.PublicPort, port.PrivatePort, port.Type)) + } else { + result = append(result, fmt.Sprintf("%d/%s", port.PrivatePort, port.Type)) + } + } + + return strings.Join(result, ", ") +} + +func name(names []string) string { + max := math.MaxInt32 + var current string + + for _, v := range names { + if len(v) < max { + max = len(v) + current = v + } + } + + return current[1:] +} + +// Rename rename the container. +func (c *Container) Rename(ctx context.Context, newName string) error { + return c.client.ContainerRename(ctx, c.container.ID, newName) +} + +// Remove removes the container. +func (c *Container) Remove(ctx context.Context, removeVolume bool) error { + return c.client.ContainerRemove(ctx, c.container.ID, types.ContainerRemoveOptions{ + Force: true, + RemoveVolumes: removeVolume, + }) +} + +// Stop stops the container. +func (c *Container) Stop(ctx context.Context, timeout int) error { + timeoutDuration := time.Duration(timeout) * time.Second + return c.client.ContainerStop(ctx, c.container.ID, &timeoutDuration) +} + +// Pause pauses the container. If the containers are already paused, don't fail. +func (c *Container) Pause(ctx context.Context) error { + if !c.container.State.Paused { + if err := c.client.ContainerPause(ctx, c.container.ID); err != nil { + return err + } + return c.updateInnerContainer(ctx) + } + return nil +} + +// Unpause unpauses the container. If the containers are not paused, don't fail. +func (c *Container) Unpause(ctx context.Context) error { + if c.container.State.Paused { + if err := c.client.ContainerUnpause(ctx, c.container.ID); err != nil { + return err + } + return c.updateInnerContainer(ctx) + } + return nil +} + +func (c *Container) updateInnerContainer(ctx context.Context) error { + container, err := Get(ctx, c.client, c.container.ID) + if err != nil { + return err + } + c.container = container + return nil +} + +// Kill kill the container. +func (c *Container) Kill(ctx context.Context, signal string) error { + return c.client.ContainerKill(ctx, c.container.ID, signal) +} + +// IsRunning returns the running state of the container. +// FIXME(vdemeester): remove the nil error here +func (c *Container) IsRunning(ctx context.Context) (bool, error) { + return c.container.State.Running, nil +} + +// Run creates, start and attach to the container based on the image name, +// the specified configuration. +// It will always create a new container. +func (c *Container) Run(ctx context.Context, configOverride *config.ServiceConfig) (int, error) { + var ( + errCh chan error + out, stderr io.Writer + in io.ReadCloser + ) + + if configOverride.StdinOpen { + in = os.Stdin + } + if configOverride.Tty { + out = os.Stdout + } + if configOverride.Tty { + stderr = os.Stderr + } + + options := types.ContainerAttachOptions{ + Stream: true, + Stdin: configOverride.StdinOpen, + Stdout: configOverride.Tty, + Stderr: configOverride.Tty, + } + + resp, err := c.client.ContainerAttach(ctx, c.container.ID, options) + if err != nil { + return -1, err + } + + // set raw terminal + inFd, _ := term.GetFdInfo(in) + state, err := term.SetRawTerminal(inFd) + if err != nil { + return -1, err + } + // restore raw terminal + defer term.RestoreTerminal(inFd, state) + // holdHijackedConnection (in goroutine) + errCh = promise.Go(func() error { + return holdHijackedConnection(configOverride.Tty, in, out, stderr, resp) + }) + + if err := c.client.ContainerStart(ctx, c.container.ID, types.ContainerStartOptions{}); err != nil { + return -1, err + } + + if err := <-errCh; err != nil { + logrus.Debugf("Error hijack: %s", err) + return -1, err + } + + exitedContainer, err := c.client.ContainerInspect(ctx, c.container.ID) + if err != nil { + return -1, err + } + + return exitedContainer.State.ExitCode, nil +} + +func holdHijackedConnection(tty bool, inputStream io.ReadCloser, outputStream, errorStream io.Writer, resp types.HijackedResponse) error { + var err error + receiveStdout := make(chan error, 1) + if outputStream != nil || errorStream != nil { + go func() { + // When TTY is ON, use regular copy + if tty && outputStream != nil { + _, err = io.Copy(outputStream, resp.Reader) + } else { + _, err = stdcopy.StdCopy(outputStream, errorStream, resp.Reader) + } + logrus.Debugf("[hijack] End of stdout") + receiveStdout <- err + }() + } + + stdinDone := make(chan struct{}) + go func() { + if inputStream != nil { + io.Copy(resp.Conn, inputStream) + logrus.Debugf("[hijack] End of stdin") + } + + if err := resp.CloseWrite(); err != nil { + logrus.Debugf("Couldn't send EOF: %s", err) + } + close(stdinDone) + }() + + select { + case err := <-receiveStdout: + if err != nil { + logrus.Debugf("Error receiveStdout: %s", err) + return err + } + case <-stdinDone: + if outputStream != nil || errorStream != nil { + if err := <-receiveStdout; err != nil { + logrus.Debugf("Error receiveStdout: %s", err) + return err + } + } + } + + return nil +} + +// Start the specified container with the specified host config +func (c *Container) Start(ctx context.Context) error { + logrus.WithFields(logrus.Fields{"container.ID": c.container.ID, "container.Name": c.container.Name}).Debug("Starting container") + if err := c.client.ContainerStart(ctx, c.container.ID, types.ContainerStartOptions{}); err != nil { + logrus.WithFields(logrus.Fields{"container.ID": c.container.ID, "container.Name": c.container.Name}).Debug("Failed to start container") + return err + } + return nil +} + +// ID returns the container Id. +func (c *Container) ID() (string, error) { + return c.container.ID, nil +} + +// Name returns the container name. +func (c *Container) Name() string { + return c.container.Name +} + +// Restart restarts the container if existing, does nothing otherwise. +func (c *Container) Restart(ctx context.Context, timeout int) error { + timeoutDuration := time.Duration(timeout) * time.Second + return c.client.ContainerRestart(ctx, c.container.ID, &timeoutDuration) +} + +// Log forwards container logs to the project configured logger. +func (c *Container) Log(ctx context.Context, l logger.Logger, follow bool) error { + info, err := c.client.ContainerInspect(ctx, c.container.ID) + if err != nil { + return err + } + + options := types.ContainerLogsOptions{ + ShowStdout: true, + ShowStderr: true, + Follow: follow, + Tail: "all", + } + responseBody, err := c.client.ContainerLogs(ctx, c.container.ID, options) + if err != nil { + return err + } + defer responseBody.Close() + + if info.Config.Tty { + _, err = io.Copy(&logger.Wrapper{Logger: l}, responseBody) + } else { + _, err = stdcopy.StdCopy(&logger.Wrapper{Logger: l}, &logger.Wrapper{Logger: l, Err: true}, responseBody) + } + logrus.WithFields(logrus.Fields{"Logger": l, "err": err}).Debug("c.client.Logs() returned error") + + return err +} + +// Port returns the host port the specified port is mapped on. +func (c *Container) Port(ctx context.Context, port string) (string, error) { + if bindings, ok := c.container.NetworkSettings.Ports[nat.Port(port)]; ok { + result := []string{} + for _, binding := range bindings { + result = append(result, binding.HostIP+":"+binding.HostPort) + } + + return strings.Join(result, "\n"), nil + } + return "", nil +} + +// Networks returns the containers network +func (c *Container) Networks() (map[string]*network.EndpointSettings, error) { + return c.container.NetworkSettings.Networks, nil +} + +// Image returns the container image. Depending on the engine version its either +// the complete id or the digest reference the image. +func (c *Container) Image() string { + return c.container.Image +} + +// ImageConfig returns the container image stored in the config. It's the +// human-readable name of the image. +func (c *Container) ImageConfig() string { + return c.container.Config.Image +} + +// Hash returns the container hash stored as label. +func (c *Container) Hash() string { + return c.container.Config.Labels[labels.HASH.Str()] +} + +// Number returns the container number stored as label. +func (c *Container) Number() (int, error) { + numberStr := c.container.Config.Labels[labels.NUMBER.Str()] + return strconv.Atoi(numberStr) +} diff --git a/vendor/github.com/docker/libcompose/docker/functions.go b/vendor/github.com/docker/libcompose/docker/container/functions.go similarity index 71% rename from vendor/github.com/docker/libcompose/docker/functions.go rename to vendor/github.com/docker/libcompose/docker/container/functions.go index 1b5b90afd..f9fd806e2 100644 --- a/vendor/github.com/docker/libcompose/docker/functions.go +++ b/vendor/github.com/docker/libcompose/docker/container/functions.go @@ -1,4 +1,4 @@ -package docker +package container import ( "golang.org/x/net/context" @@ -8,9 +8,9 @@ import ( "github.com/docker/engine-api/types/filters" ) -// GetContainersByFilter looks up the hosts containers with the specified filters and +// ListByFilter looks up the hosts containers with the specified filters and // returns a list of container matching it, or an error. -func GetContainersByFilter(ctx context.Context, clientInstance client.APIClient, containerFilters ...map[string][]string) ([]types.Container, error) { +func ListByFilter(ctx context.Context, clientInstance client.ContainerAPIClient, containerFilters ...map[string][]string) ([]types.Container, error) { filterArgs := filters.NewArgs() // FIXME(vdemeester) I don't like 3 for loops >_< @@ -28,9 +28,9 @@ func GetContainersByFilter(ctx context.Context, clientInstance client.APIClient, }) } -// GetContainer looks up the hosts containers with the specified ID +// Get looks up the hosts containers with the specified ID // or name and returns it, or an error. -func GetContainer(ctx context.Context, clientInstance client.APIClient, id string) (*types.ContainerJSON, error) { +func Get(ctx context.Context, clientInstance client.ContainerAPIClient, id string) (*types.ContainerJSON, error) { container, err := clientInstance.ContainerInspect(ctx, id) if err != nil { if client.IsErrContainerNotFound(err) { diff --git a/vendor/github.com/docker/libcompose/docker/context.go b/vendor/github.com/docker/libcompose/docker/ctx/context.go similarity index 87% rename from vendor/github.com/docker/libcompose/docker/context.go rename to vendor/github.com/docker/libcompose/docker/ctx/context.go index a520eab92..3e001cedb 100644 --- a/vendor/github.com/docker/libcompose/docker/context.go +++ b/vendor/github.com/docker/libcompose/docker/ctx/context.go @@ -1,8 +1,9 @@ -package docker +package ctx import ( "github.com/docker/docker/cliconfig" "github.com/docker/docker/cliconfig/configfile" + "github.com/docker/libcompose/docker/auth" "github.com/docker/libcompose/docker/client" "github.com/docker/libcompose/project" ) @@ -14,11 +15,7 @@ type Context struct { ClientFactory client.Factory ConfigDir string ConfigFile *configfile.ConfigFile - AuthLookup AuthLookup -} - -func (c *Context) open() error { - return c.LookupConfig() + AuthLookup auth.Lookup } // LookupConfig tries to load the docker configuration files, if any. diff --git a/vendor/github.com/docker/libcompose/docker/image.go b/vendor/github.com/docker/libcompose/docker/image/image.go similarity index 62% rename from vendor/github.com/docker/libcompose/docker/image.go rename to vendor/github.com/docker/libcompose/docker/image/image.go index b0b35de9b..f404ed100 100644 --- a/vendor/github.com/docker/libcompose/docker/image.go +++ b/vendor/github.com/docker/libcompose/docker/image/image.go @@ -1,4 +1,4 @@ -package docker +package image import ( "encoding/base64" @@ -16,15 +16,27 @@ import ( "github.com/docker/docker/registry" "github.com/docker/engine-api/client" "github.com/docker/engine-api/types" + "github.com/docker/libcompose/docker/auth" ) -func removeImage(ctx context.Context, client client.APIClient, image string) error { +// InspectImage inspect the specified image (can be a name, an id or a digest) +// with the specified client. +func InspectImage(ctx context.Context, client client.ImageAPIClient, image string) (types.ImageInspect, error) { + imageInspect, _, err := client.ImageInspectWithRaw(ctx, image, false) + return imageInspect, err +} + +// RemoveImage removes the specified image (can be a name, an id or a digest) +// from the daemon store with the specified client. +func RemoveImage(ctx context.Context, client client.ImageAPIClient, image string) error { _, err := client.ImageRemove(ctx, image, types.ImageRemoveOptions{}) return err } -func pullImage(ctx context.Context, client client.APIClient, service *Service, image string) error { - fmt.Fprintf(os.Stderr, "Pulling %s (%s)...\n", service.name, image) +// PullImage pulls the specified image (can be a name, an id or a digest) +// to the daemon store with the specified client. +func PullImage(ctx context.Context, client client.ImageAPIClient, serviceName string, authLookup auth.Lookup, image string) error { + fmt.Fprintf(os.Stderr, "Pulling %s (%s)...\n", serviceName, image) distributionRef, err := reference.ParseNamed(image) if err != nil { return err @@ -35,8 +47,9 @@ func pullImage(ctx context.Context, client client.APIClient, service *Service, i return err } - authConfig := service.authLookup.Lookup(repoInfo) + authConfig := authLookup.Lookup(repoInfo) + // Use ConfigFile.SaveToWriter to not re-define encodeAuthToBase64 encodedAuth, err := encodeAuthToBase64(authConfig) if err != nil { return err diff --git a/vendor/github.com/docker/libcompose/docker/network/factory.go b/vendor/github.com/docker/libcompose/docker/network/factory.go deleted file mode 100644 index 158131f07..000000000 --- a/vendor/github.com/docker/libcompose/docker/network/factory.go +++ /dev/null @@ -1,19 +0,0 @@ -package network - -import ( - "github.com/docker/libcompose/config" - composeclient "github.com/docker/libcompose/docker/client" - "github.com/docker/libcompose/project" -) - -// DockerFactory implements project.NetworksFactory -type DockerFactory struct { - ClientFactory composeclient.Factory -} - -// Create implements project.NetworksFactory Create method. -// It creates a Networks (that implements project.Networks) from specified configurations. -func (f *DockerFactory) Create(projectName string, networkConfigs map[string]*config.NetworkConfig, serviceConfigs *config.ServiceConfigs, networkEnabled bool) (project.Networks, error) { - cli := f.ClientFactory.Create(nil) - return NetworksFromServices(cli, projectName, networkConfigs, serviceConfigs, networkEnabled) -} diff --git a/vendor/github.com/docker/libcompose/docker/network/network.go b/vendor/github.com/docker/libcompose/docker/network/network.go deleted file mode 100644 index a654fa1d7..000000000 --- a/vendor/github.com/docker/libcompose/docker/network/network.go +++ /dev/null @@ -1,194 +0,0 @@ -package network - -import ( - "fmt" - "reflect" - "strings" - - "golang.org/x/net/context" - - "github.com/docker/engine-api/client" - "github.com/docker/engine-api/types" - "github.com/docker/engine-api/types/network" - "github.com/docker/libcompose/config" - "github.com/docker/libcompose/yaml" -) - -// Network holds attributes and method for a network definition in compose -type Network struct { - client client.NetworkAPIClient - name string - projectName string - driver string - driverOptions map[string]string - ipam config.Ipam - external bool -} - -func (n *Network) fullName() string { - name := n.projectName + "_" + n.name - if n.external { - name = n.name - } - return name -} - -// Inspect inspect the current network -func (n *Network) Inspect(ctx context.Context) (types.NetworkResource, error) { - return n.client.NetworkInspect(ctx, n.fullName()) -} - -// Remove removes the current network (from docker engine) -func (n *Network) Remove(ctx context.Context) error { - if n.external { - fmt.Printf("Network %s is external, skipping", n.fullName()) - return nil - } - fmt.Printf("Removing network %q\n", n.fullName()) - return n.client.NetworkRemove(ctx, n.fullName()) -} - -// EnsureItExists make sure the network exists and return an error if it does not exists -// and cannot be created. -func (n *Network) EnsureItExists(ctx context.Context) error { - networkResource, err := n.Inspect(ctx) - if n.external { - if client.IsErrNetworkNotFound(err) { - // FIXME(vdemeester) introduce some libcompose error type - return fmt.Errorf("Network %s declared as external, but could not be found. Please create the network manually using docker network create %s and try again", n.fullName(), n.fullName()) - } - return err - } - if err != nil && client.IsErrNetworkNotFound(err) { - return n.create(ctx) - } - if n.driver != "" && networkResource.Driver != n.driver { - return fmt.Errorf("Network %q needs to be recreated - driver has changed", n.fullName()) - } - if len(n.driverOptions) != 0 && !reflect.DeepEqual(networkResource.Options, n.driverOptions) { - return fmt.Errorf("Network %q needs to be recreated - options have changed", n.fullName()) - } - return err -} - -func (n *Network) create(ctx context.Context) error { - fmt.Printf("Creating network %q with driver %q\n", n.fullName(), n.driver) - _, err := n.client.NetworkCreate(ctx, n.fullName(), types.NetworkCreate{ - Driver: n.driver, - Options: n.driverOptions, - IPAM: convertToAPIIpam(n.ipam), - }) - return err -} - -func convertToAPIIpam(ipam config.Ipam) network.IPAM { - ipamConfigs := []network.IPAMConfig{} - for _, config := range ipam.Config { - ipamConfigs = append(ipamConfigs, network.IPAMConfig{ - Subnet: config.Subnet, - IPRange: config.IPRange, - Gateway: config.Gateway, - AuxAddress: config.AuxAddress, - }) - } - return network.IPAM{ - Driver: ipam.Driver, - Config: ipamConfigs, - } -} - -// NewNetwork creates a new network from the specified name and config. -func NewNetwork(projectName, name string, config *config.NetworkConfig, client client.NetworkAPIClient) *Network { - networkName := name - if config.External.External { - networkName = config.External.Name - } - return &Network{ - client: client, - name: networkName, - projectName: projectName, - driver: config.Driver, - driverOptions: config.DriverOpts, - external: config.External.External, - ipam: config.Ipam, - } -} - -// Networks holds a list of network -type Networks struct { - networks []*Network - networkEnabled bool -} - -// Initialize make sure network exists if network is enabled -func (n *Networks) Initialize(ctx context.Context) error { - if !n.networkEnabled { - return nil - } - for _, network := range n.networks { - err := network.EnsureItExists(ctx) - if err != nil { - return err - } - } - return nil -} - -// Remove removes networks (clean-up) -func (n *Networks) Remove(ctx context.Context) error { - if !n.networkEnabled { - return nil - } - for _, network := range n.networks { - err := network.Remove(ctx) - if err != nil { - return err - } - } - return nil -} - -// NetworksFromServices creates a new Networks struct based on networks configurations and -// services configuration. If a network is defined but not used by any service, it will return -// an error along the Networks. -func NetworksFromServices(cli client.NetworkAPIClient, projectName string, networkConfigs map[string]*config.NetworkConfig, services *config.ServiceConfigs, networkEnabled bool) (*Networks, error) { - var err error - networks := make([]*Network, 0, len(networkConfigs)) - networkNames := map[string]*yaml.Network{} - for _, serviceName := range services.Keys() { - serviceConfig, _ := services.Get(serviceName) - if serviceConfig.NetworkMode != "" || serviceConfig.Networks == nil || len(serviceConfig.Networks.Networks) == 0 { - continue - } - for _, network := range serviceConfig.Networks.Networks { - if network.Name != "default" { - if _, ok := networkConfigs[network.Name]; !ok { - return nil, fmt.Errorf(`Service "%s" uses an undefined network "%s"`, serviceName, network.Name) - } - } - networkNames[network.Name] = network - } - } - for name, config := range networkConfigs { - network := NewNetwork(projectName, name, config, cli) - networks = append(networks, network) - } - if len(networkNames) != len(networks) { - unused := []string{} - for name := range networkConfigs { - if name == "default" { - continue - } - if _, ok := networkNames[name]; !ok { - unused = append(unused, name) - } - } - if len(unused) != 0 { - err = fmt.Errorf("Some networks were defined but are not used by any service: %v", strings.Join(unused, " ")) - } - } - return &Networks{ - networks: networks, - networkEnabled: networkEnabled, - }, err -} diff --git a/vendor/github.com/docker/libcompose/docker/project.go b/vendor/github.com/docker/libcompose/docker/project.go deleted file mode 100644 index 5b5b95383..000000000 --- a/vendor/github.com/docker/libcompose/docker/project.go +++ /dev/null @@ -1,123 +0,0 @@ -package docker - -import ( - "os" - "path/filepath" - - "golang.org/x/net/context" - - "github.com/Sirupsen/logrus" - "github.com/docker/engine-api/types" - "github.com/docker/engine-api/types/filters" - "github.com/docker/libcompose/config" - "github.com/docker/libcompose/docker/client" - "github.com/docker/libcompose/docker/network" - "github.com/docker/libcompose/labels" - "github.com/docker/libcompose/lookup" - "github.com/docker/libcompose/project" -) - -// ComposeVersion is name of docker-compose.yml file syntax supported version -const ComposeVersion = "1.5.0" - -// NewProject creates a Project with the specified context. -func NewProject(context *Context, parseOptions *config.ParseOptions) (project.APIProject, error) { - if context.ResourceLookup == nil { - context.ResourceLookup = &lookup.FileConfigLookup{} - } - - if context.EnvironmentLookup == nil { - cwd, err := os.Getwd() - if err != nil { - return nil, err - } - context.EnvironmentLookup = &lookup.ComposableEnvLookup{ - Lookups: []config.EnvironmentLookup{ - &lookup.EnvfileLookup{ - Path: filepath.Join(cwd, ".env"), - }, - &lookup.OsEnvLookup{}, - }, - } - } - - if context.AuthLookup == nil { - context.AuthLookup = NewConfigAuthLookup(context) - } - - if context.ServiceFactory == nil { - context.ServiceFactory = &ServiceFactory{ - context: context, - } - } - - if context.ClientFactory == nil { - factory, err := client.NewDefaultFactory(client.Options{}) - if err != nil { - return nil, err - } - context.ClientFactory = factory - } - - if context.NetworksFactory == nil { - networksFactory := &network.DockerFactory{ - ClientFactory: context.ClientFactory, - } - context.NetworksFactory = networksFactory - } - - // FIXME(vdemeester) Remove the context duplication ? - runtime := &Project{ - clientFactory: context.ClientFactory, - } - p := project.NewProject(&context.Context, runtime, parseOptions) - - err := p.Parse() - if err != nil { - return nil, err - } - - if err = context.open(); err != nil { - logrus.Errorf("Failed to open project %s: %v", p.Name, err) - return nil, err - } - - return p, err -} - -// Project implements project.RuntimeProject and define docker runtime specific methods. -type Project struct { - clientFactory client.Factory -} - -// RemoveOrphans implements project.RuntimeProject.RemoveOrphans. -// It will remove orphan containers that are part of the project but not to any services. -func (p *Project) RemoveOrphans(ctx context.Context, projectName string, serviceConfigs *config.ServiceConfigs) error { - client := p.clientFactory.Create(nil) - filter := filters.NewArgs() - filter.Add("label", labels.PROJECT.EqString(projectName)) - containers, err := client.ContainerList(ctx, types.ContainerListOptions{ - Filter: filter, - }) - if err != nil { - return err - } - currentServices := map[string]struct{}{} - for _, serviceName := range serviceConfigs.Keys() { - currentServices[serviceName] = struct{}{} - } - for _, container := range containers { - serviceLabel := container.Labels[labels.SERVICE.Str()] - if _, ok := currentServices[serviceLabel]; !ok { - if err := client.ContainerKill(ctx, container.ID, "SIGKILL"); err != nil { - return err - } - if err := client.ContainerRemove(ctx, container.ID, types.ContainerRemoveOptions{ - Force: true, - }); err != nil { - return err - } - } - } - return nil -} diff --git a/vendor/github.com/docker/libcompose/docker/convert.go b/vendor/github.com/docker/libcompose/docker/service/convert.go similarity index 85% rename from vendor/github.com/docker/libcompose/docker/convert.go rename to vendor/github.com/docker/libcompose/docker/service/convert.go index 3f3b97c99..7e41bc242 100644 --- a/vendor/github.com/docker/libcompose/docker/convert.go +++ b/vendor/github.com/docker/libcompose/docker/service/convert.go @@ -1,4 +1,4 @@ -package docker +package service import ( "fmt" @@ -35,6 +35,16 @@ func Filter(vs []string, f func(string) bool) []string { return r } +func toMap(vs []string) map[string]struct{} { + m := map[string]struct{}{} + for _, v := range vs { + if v != "" { + m[v] = struct{}{} + } + } + return m +} + func isBind(s string) bool { return strings.ContainsRune(s, ':') } @@ -44,8 +54,8 @@ func isVolume(s string) bool { } // ConvertToAPI converts a service configuration to a docker API container configuration. -func ConvertToAPI(s *Service) (*ConfigWrapper, error) { - config, hostConfig, err := Convert(s.serviceConfig, s.context.Context) +func ConvertToAPI(serviceConfig *config.ServiceConfig, ctx project.Context) (*ConfigWrapper, error) { + config, hostConfig, err := Convert(serviceConfig, ctx) if err != nil { return nil, err } @@ -57,21 +67,18 @@ func ConvertToAPI(s *Service) (*ConfigWrapper, error) { return &result, nil } -func isNamedVolume(volume string) bool { - return !strings.HasPrefix(volume, ".") && !strings.HasPrefix(volume, "/") && !strings.HasPrefix(volume, "~") -} - -func volumes(c *config.ServiceConfig, ctx project.Context) map[string]struct{} { - volumes := make(map[string]struct{}, len(c.Volumes)) - for k, v := range c.Volumes { - if len(ctx.ComposeFiles) > 0 && !isNamedVolume(v) { - v = ctx.ResourceLookup.ResolvePath(v, ctx.ComposeFiles[0]) - } - - c.Volumes[k] = v - if isVolume(v) { - volumes[v] = struct{}{} +func volumes(c *config.ServiceConfig, ctx project.Context) []string { + if c.Volumes == nil { + return []string{} + } + volumes := make([]string, len(c.Volumes.Volumes)) + for _, v := range c.Volumes.Volumes { + vol := v + if len(ctx.ComposeFiles) > 0 && !project.IsNamedVolume(v.Source) { + sourceVol := ctx.ResourceLookup.ResolvePath(v.String(), ctx.ComposeFiles[0]) + vol.Source = strings.SplitN(sourceVol, ":", 2)[0] } + volumes = append(volumes, vol.String()) } return volumes } @@ -140,6 +147,8 @@ func Convert(c *config.ServiceConfig, ctx project.Context) (*container.Config, * } } + vols := volumes(c, ctx) + config := &container.Config{ Entrypoint: strslice.StrSlice(utils.CopySlice(c.Entrypoint)), Hostname: c.Hostname, @@ -153,7 +162,7 @@ func Convert(c *config.ServiceConfig, ctx project.Context) (*container.Config, * Tty: c.Tty, OpenStdin: c.StdinOpen, WorkingDir: c.WorkingDir, - Volumes: volumes(c, ctx), + Volumes: toMap(Filter(vols, isVolume)), MacAddress: c.MacAddress, } @@ -198,10 +207,10 @@ func Convert(c *config.ServiceConfig, ctx project.Context) (*container.Config, * resources := container.Resources{ CgroupParent: c.CgroupParent, - Memory: c.MemLimit, - MemorySwap: c.MemSwapLimit, - CPUShares: c.CPUShares, - CPUQuota: c.CPUQuota, + Memory: int64(c.MemLimit), + MemorySwap: int64(c.MemSwapLimit), + CPUShares: int64(c.CPUShares), + CPUQuota: int64(c.CPUQuota), CpusetCpus: c.CPUSet, Ulimits: ulimits, Devices: deviceMappings, @@ -215,7 +224,7 @@ func Convert(c *config.ServiceConfig, ctx project.Context) (*container.Config, * CapDrop: strslice.StrSlice(utils.CopySlice(c.CapDrop)), ExtraHosts: utils.CopySlice(c.ExtraHosts), Privileged: c.Privileged, - Binds: Filter(c.Volumes, isBind), + Binds: Filter(vols, isBind), DNS: utils.CopySlice(c.DNS), DNSSearch: utils.CopySlice(c.DNSSearch), LogConfig: container.LogConfig{ @@ -229,12 +238,16 @@ func Convert(c *config.ServiceConfig, ctx project.Context) (*container.Config, * IpcMode: container.IpcMode(c.Ipc), PortBindings: portBindings, RestartPolicy: *restartPolicy, - ShmSize: c.ShmSize, + ShmSize: int64(c.ShmSize), SecurityOpt: utils.CopySlice(c.SecurityOpt), VolumeDriver: c.VolumeDriver, Resources: resources, } + if config.Labels == nil { + config.Labels = map[string]string{} + } + return config, hostConfig, nil } diff --git a/vendor/github.com/docker/libcompose/docker/name.go b/vendor/github.com/docker/libcompose/docker/service/name.go similarity index 99% rename from vendor/github.com/docker/libcompose/docker/name.go rename to vendor/github.com/docker/libcompose/docker/service/name.go index 52f243cc7..cc52c0597 100644 --- a/vendor/github.com/docker/libcompose/docker/name.go +++ b/vendor/github.com/docker/libcompose/docker/service/name.go @@ -1,4 +1,4 @@ -package docker +package service import ( "fmt" diff --git a/vendor/github.com/docker/libcompose/docker/service.go b/vendor/github.com/docker/libcompose/docker/service/service.go similarity index 57% rename from vendor/github.com/docker/libcompose/docker/service.go rename to vendor/github.com/docker/libcompose/docker/service/service.go index b1eb9bbe4..7e0d9e7e8 100644 --- a/vendor/github.com/docker/libcompose/docker/service.go +++ b/vendor/github.com/docker/libcompose/docker/service/service.go @@ -1,8 +1,7 @@ -package docker +package service import ( "fmt" - "strconv" "strings" "time" @@ -13,15 +12,21 @@ import ( "github.com/docker/engine-api/types" eventtypes "github.com/docker/engine-api/types/events" "github.com/docker/engine-api/types/filters" + "github.com/docker/engine-api/types/network" "github.com/docker/go-connections/nat" "github.com/docker/libcompose/config" + "github.com/docker/libcompose/docker/auth" "github.com/docker/libcompose/docker/builder" composeclient "github.com/docker/libcompose/docker/client" + "github.com/docker/libcompose/docker/container" + "github.com/docker/libcompose/docker/ctx" + "github.com/docker/libcompose/docker/image" "github.com/docker/libcompose/labels" "github.com/docker/libcompose/project" "github.com/docker/libcompose/project/events" "github.com/docker/libcompose/project/options" "github.com/docker/libcompose/utils" + "github.com/docker/libcompose/yaml" dockerevents "github.com/vdemeester/docker-events" ) @@ -31,14 +36,14 @@ type Service struct { project *project.Project serviceConfig *config.ServiceConfig clientFactory composeclient.Factory - authLookup AuthLookup + authLookup auth.Lookup // FIXME(vdemeester) remove this at some point - context *Context + context *ctx.Context } // NewService creates a service -func NewService(name string, serviceConfig *config.ServiceConfig, context *Context) *Service { +func NewService(name string, serviceConfig *config.ServiceConfig, context *ctx.Context) *Service { return &Service{ name: name, project: context.Project, @@ -72,69 +77,86 @@ func (s *Service) Create(ctx context.Context, options options.Create) error { return err } - imageName, err := s.ensureImageExists(ctx, options.NoBuild) - if err != nil { + if err := s.ensureImageExists(ctx, options.NoBuild, options.ForceBuild); err != nil { return err } if len(containers) != 0 { - return s.eachContainer(ctx, containers, func(c *Container) error { - return s.recreateIfNeeded(ctx, imageName, c, options.NoRecreate, options.ForceRecreate) + return s.eachContainer(ctx, containers, func(c *container.Container) error { + _, err := s.recreateIfNeeded(ctx, c, options.NoRecreate, options.ForceRecreate) + return err }) } - _, err = s.createOne(ctx, imageName) + namer, err := s.namer(ctx, 1) + if err != nil { + return err + } + + _, err = s.createContainer(ctx, namer, "", nil, false) return err } -func (s *Service) collectContainers(ctx context.Context) ([]*Container, error) { +func (s *Service) namer(ctx context.Context, count int) (Namer, error) { + var namer Namer + var err error + + if s.serviceConfig.ContainerName != "" { + if count > 1 { + logrus.Warnf(`The "%s" service is using the custom container name "%s". Docker requires each container to have a unique name. Remove the custom name to scale the service.`, s.name, s.serviceConfig.ContainerName) + } + namer = NewSingleNamer(s.serviceConfig.ContainerName) + } else { + client := s.clientFactory.Create(s) + namer, err = NewNamer(ctx, client, s.project.Name, s.name, false) + if err != nil { + return nil, err + } + } + return namer, nil +} + +func (s *Service) collectContainers(ctx context.Context) ([]*container.Container, error) { client := s.clientFactory.Create(s) - containers, err := GetContainersByFilter(ctx, client, labels.SERVICE.Eq(s.name), labels.PROJECT.Eq(s.project.Name)) + containers, err := container.ListByFilter(ctx, client, labels.SERVICE.Eq(s.name), labels.PROJECT.Eq(s.project.Name)) if err != nil { return nil, err } - result := []*Container{} + result := []*container.Container{} - for _, container := range containers { - containerNumber, err := strconv.Atoi(container.Labels[labels.NUMBER.Str()]) + for _, cont := range containers { + c, err := container.New(ctx, client, cont.ID) if err != nil { return nil, err } - // Compose add "/" before name, so Name[1] will store actaul name. - name := strings.SplitAfter(container.Names[0], "/") - result = append(result, NewContainer(client, name[1], containerNumber, s)) + result = append(result, c) } return result, nil } -func (s *Service) createOne(ctx context.Context, imageName string) (*Container, error) { - containers, err := s.constructContainers(ctx, imageName, 1) - if err != nil { - return nil, err +func (s *Service) ensureImageExists(ctx context.Context, noBuild bool, forceBuild bool) error { + if forceBuild { + return s.build(ctx, options.Build{}) } - return containers[0], err -} - -func (s *Service) ensureImageExists(ctx context.Context, noBuild bool) (string, error) { exists, err := s.ImageExists(ctx) if err != nil { - return "", err + return err } if exists { - return s.imageName(), nil + return nil } if s.Config().Build.Context != "" { if noBuild { - return "", fmt.Errorf("Service %q needs to be built, but no-build was specified", s.name) + return fmt.Errorf("Service %q needs to be built, but no-build was specified", s.name) } - return s.imageName(), s.build(ctx, options.Build{}) + return s.build(ctx, options.Build{}) } - return s.imageName(), s.Pull(ctx) + return s.Pull(ctx) } // ImageExists returns whether or not the service image already exists @@ -177,11 +199,12 @@ func (s *Service) build(ctx context.Context, buildOptions options.Build) error { NoCache: buildOptions.NoCache, ForceRemove: buildOptions.ForceRemove, Pull: buildOptions.Pull, + LoggerFactory: s.context.LoggerFactory, } return builder.Build(ctx, s.imageName()) } -func (s *Service) constructContainers(ctx context.Context, imageName string, count int) ([]*Container, error) { +func (s *Service) constructContainers(ctx context.Context, count int) ([]*container.Container, error) { result, err := s.collectContainers(ctx) if err != nil { return nil, err @@ -204,18 +227,16 @@ func (s *Service) constructContainers(ctx context.Context, imageName string, cou } for i := len(result); i < count; i++ { - containerName, containerNumber := namer.Next() - - c := NewContainer(client, containerName, containerNumber, s) - - dockerContainer, err := c.Create(ctx, imageName) + c, err := s.createContainer(ctx, namer, "", nil, false) if err != nil { return nil, err } - logrus.Debugf("Created container %s: %v", dockerContainer.ID, dockerContainer.Name) + // FIXME(vdemeester) use property/method instead + id, _ := c.ID() + logrus.Debugf("Created container %s: %v", id, c.Name()) - result = append(result, NewContainer(client, containerName, containerNumber, s)) + result = append(result, c) } return result, nil @@ -231,8 +252,7 @@ func (s *Service) Up(ctx context.Context, options options.Up) error { var imageName = s.imageName() if len(containers) == 0 || !options.NoRecreate { - imageName, err = s.ensureImageExists(ctx, options.NoBuild) - if err != nil { + if err = s.ensureImageExists(ctx, options.NoBuild, options.ForceBuild); err != nil { return err } } @@ -243,7 +263,7 @@ func (s *Service) Up(ctx context.Context, options options.Up) error { // Run implements Service.Run. It runs a one of command within the service container. // It always create a new container. func (s *Service) Run(ctx context.Context, commandParts []string, options options.Run) (int, error) { - imageName, err := s.ensureImageExists(ctx, false) + err := s.ensureImageExists(ctx, false, false) if err != nil { return -1, err } @@ -255,15 +275,14 @@ func (s *Service) Run(ctx context.Context, commandParts []string, options option return -1, err } - containerName, containerNumber := namer.Next() - - c := NewOneOffContainer(client, containerName, containerNumber, s) - configOverride := &config.ServiceConfig{Command: commandParts, Tty: true, StdinOpen: true} - c.CreateWithOverride(ctx, imageName, configOverride) + c, err := s.createContainer(ctx, namer, "", configOverride, true) + if err != nil { + return -1, err + } - if err := s.connectContainerToNetworks(ctx, c); err != nil { + if err := s.connectContainerToNetworks(ctx, c, true); err != nil { return -1, err } @@ -276,7 +295,7 @@ func (s *Service) Run(ctx context.Context, commandParts []string, options option // Info implements Service.Info. It returns an project.InfoSet with the containers // related to this service (can be multiple if using the scale command). -func (s *Service) Info(ctx context.Context, qFlag bool) (project.InfoSet, error) { +func (s *Service) Info(ctx context.Context) (project.InfoSet, error) { result := project.InfoSet{} containers, err := s.collectContainers(ctx) if err != nil { @@ -284,7 +303,7 @@ func (s *Service) Info(ctx context.Context, qFlag bool) (project.InfoSet, error) } for _, c := range containers { - info, err := c.Info(ctx, qFlag) + info, err := c.Info(ctx) if err != nil { return nil, err } @@ -296,8 +315,8 @@ func (s *Service) Info(ctx context.Context, qFlag bool) (project.InfoSet, error) // Start implements Service.Start. It tries to start a container without creating it. func (s *Service) Start(ctx context.Context) error { - return s.collectContainersAndDo(ctx, func(c *Container) error { - if err := s.connectContainerToNetworks(ctx, c); err != nil { + return s.collectContainersAndDo(ctx, func(c *container.Container) error { + if err := s.connectContainerToNetworks(ctx, c, false); err != nil { return err } return c.Start(ctx) @@ -313,29 +332,44 @@ func (s *Service) up(ctx context.Context, imageName string, create bool, options logrus.Debugf("Found %d existing containers for service %s", len(containers), s.name) if len(containers) == 0 && create { - c, err := s.createOne(ctx, imageName) + namer, err := s.namer(ctx, 1) if err != nil { return err } - containers = []*Container{c} + c, err := s.createContainer(ctx, namer, "", nil, false) + if err != nil { + return err + } + containers = []*container.Container{c} } - return s.eachContainer(ctx, containers, func(c *Container) error { + return s.eachContainer(ctx, containers, func(c *container.Container) error { + var err error if create { - if err := s.recreateIfNeeded(ctx, imageName, c, options.NoRecreate, options.ForceRecreate); err != nil { + c, err = s.recreateIfNeeded(ctx, c, options.NoRecreate, options.ForceRecreate) + if err != nil { return err } } - if err := s.connectContainerToNetworks(ctx, c); err != nil { + if err := s.connectContainerToNetworks(ctx, c, false); err != nil { return err } - return c.Start(ctx) + + err = c.Start(ctx) + + if err == nil { + s.project.Notify(events.ContainerStarted, s.name, map[string]string{ + "name": c.Name(), + }) + } + + return err }) } -func (s *Service) connectContainerToNetworks(ctx context.Context, c *Container) error { - connectedNetworks, err := c.Networks(ctx) +func (s *Service) connectContainerToNetworks(ctx context.Context, c *container.Container, oneOff bool) error { + connectedNetworks, err := c.Networks() if err != nil { return nil } @@ -355,11 +389,11 @@ func (s *Service) connectContainerToNetworks(ctx context.Context, c *Container) if aliasPresent { continue } - if err := c.NetworkDisconnect(ctx, network); err != nil { + if err := s.NetworkDisconnect(ctx, c, network, oneOff); err != nil { return err } } - if err := c.NetworkConnect(ctx, network); err != nil { + if err := s.NetworkConnect(ctx, c, network, oneOff); err != nil { return err } } @@ -367,13 +401,53 @@ func (s *Service) connectContainerToNetworks(ctx context.Context, c *Container) return nil } -func (s *Service) recreateIfNeeded(ctx context.Context, imageName string, c *Container, noRecreate, forceRecreate bool) error { +// NetworkDisconnect disconnects the container from the specified network +func (s *Service) NetworkDisconnect(ctx context.Context, c *container.Container, net *yaml.Network, oneOff bool) error { + containerID, _ := c.ID() + client := s.clientFactory.Create(s) + return client.NetworkDisconnect(ctx, net.RealName, containerID, true) +} + +// NetworkConnect connects the container to the specified network +// FIXME(vdemeester) will be refactor with Container refactoring +func (s *Service) NetworkConnect(ctx context.Context, c *container.Container, net *yaml.Network, oneOff bool) error { + containerID, _ := c.ID() + client := s.clientFactory.Create(s) + internalLinks, err := s.getLinks() + if err != nil { + return err + } + links := []string{} + // TODO(vdemeester) handle link to self (?) + for k, v := range internalLinks { + links = append(links, strings.Join([]string{v, k}, ":")) + } + for _, v := range s.serviceConfig.ExternalLinks { + links = append(links, v) + } + aliases := []string{} + if !oneOff { + aliases = []string{s.Name()} + } + aliases = append(aliases, net.Aliases...) + return client.NetworkConnect(ctx, net.RealName, containerID, &network.EndpointSettings{ + Aliases: aliases, + Links: links, + IPAddress: net.IPv4Address, + IPAMConfig: &network.EndpointIPAMConfig{ + IPv4Address: net.IPv4Address, + IPv6Address: net.IPv6Address, + }, + }) +} + +func (s *Service) recreateIfNeeded(ctx context.Context, c *container.Container, noRecreate, forceRecreate bool) (*container.Container, error) { if noRecreate { - return nil + return c, nil } - outOfSync, err := c.OutOfSync(ctx, imageName) + outOfSync, err := s.OutOfSync(ctx, c) if err != nil { - return err + return c, err } logrus.WithFields(logrus.Fields{ @@ -383,15 +457,68 @@ func (s *Service) recreateIfNeeded(ctx context.Context, imageName string, c *Con if forceRecreate || outOfSync { logrus.Infof("Recreating %s", s.name) - if _, err := c.Recreate(ctx, imageName); err != nil { - return err + newContainer, err := s.recreate(ctx, c) + if err != nil { + return c, err } + return newContainer, nil } - return nil + return c, err +} + +func (s *Service) recreate(ctx context.Context, c *container.Container) (*container.Container, error) { + name := c.Name() + id, _ := c.ID() + newName := fmt.Sprintf("%s_%s", name, id[:12]) + logrus.Debugf("Renaming %s => %s", name, newName) + if err := c.Rename(ctx, newName); err != nil { + logrus.Errorf("Failed to rename old container %s", c.Name()) + return nil, err + } + namer := NewSingleNamer(name) + newContainer, err := s.createContainer(ctx, namer, id, nil, false) + if err != nil { + return nil, err + } + newID, _ := newContainer.ID() + logrus.Debugf("Created replacement container %s", newID) + if err := c.Remove(ctx, false); err != nil { + logrus.Errorf("Failed to remove old container %s", c.Name()) + return nil, err + } + logrus.Debugf("Removed old container %s %s", c.Name(), id) + return newContainer, nil } -func (s *Service) collectContainersAndDo(ctx context.Context, action func(*Container) error) error { +// OutOfSync checks if the container is out of sync with the service definition. +// It looks if the the service hash container label is the same as the computed one. +func (s *Service) OutOfSync(ctx context.Context, c *container.Container) (bool, error) { + if c.ImageConfig() != s.serviceConfig.Image { + logrus.Debugf("Images for %s do not match %s!=%s", c.Name(), c.ImageConfig(), s.serviceConfig.Image) + return true, nil + } + + expectedHash := config.GetServiceHash(s.name, s.Config()) + if c.Hash() != expectedHash { + logrus.Debugf("Hashes for %s do not match %s!=%s", c.Name(), c.Hash(), expectedHash) + return true, nil + } + + image, err := image.InspectImage(ctx, s.clientFactory.Create(s), c.ImageConfig()) + if err != nil { + if client.IsErrImageNotFound(err) { + logrus.Debugf("Image %s do not exist, do not know if it's out of sync", c.Image()) + return false, nil + } + return false, err + } + + logrus.Debugf("Checking existing image name vs id: %s == %s", image.ID, c.Image()) + return image.ID != c.Image(), err +} + +func (s *Service) collectContainersAndDo(ctx context.Context, action func(*container.Container) error) error { containers, err := s.collectContainers(ctx) if err != nil { return err @@ -399,15 +526,15 @@ func (s *Service) collectContainersAndDo(ctx context.Context, action func(*Conta return s.eachContainer(ctx, containers, action) } -func (s *Service) eachContainer(ctx context.Context, containers []*Container, action func(*Container) error) error { +func (s *Service) eachContainer(ctx context.Context, containers []*container.Container, action func(*container.Container) error) error { tasks := utils.InParallel{} - for _, container := range containers { - task := func(container *Container) func() error { + for _, cont := range containers { + task := func(cont *container.Container) func() error { return func() error { - return action(container) + return action(cont) } - }(container) + }(cont) tasks.Add(task) } @@ -417,36 +544,49 @@ func (s *Service) eachContainer(ctx context.Context, containers []*Container, ac // Stop implements Service.Stop. It stops any containers related to the service. func (s *Service) Stop(ctx context.Context, timeout int) error { - return s.collectContainersAndDo(ctx, func(c *Container) error { + return s.collectContainersAndDo(ctx, func(c *container.Container) error { return c.Stop(ctx, timeout) }) } // Restart implements Service.Restart. It restarts any containers related to the service. func (s *Service) Restart(ctx context.Context, timeout int) error { - return s.collectContainersAndDo(ctx, func(c *Container) error { + return s.collectContainersAndDo(ctx, func(c *container.Container) error { return c.Restart(ctx, timeout) }) } // Kill implements Service.Kill. It kills any containers related to the service. func (s *Service) Kill(ctx context.Context, signal string) error { - return s.collectContainersAndDo(ctx, func(c *Container) error { + return s.collectContainersAndDo(ctx, func(c *container.Container) error { return c.Kill(ctx, signal) }) } // Delete implements Service.Delete. It removes any containers related to the service. func (s *Service) Delete(ctx context.Context, options options.Delete) error { - return s.collectContainersAndDo(ctx, func(c *Container) error { - return c.Delete(ctx, options.RemoveVolume) + return s.collectContainersAndDo(ctx, func(c *container.Container) error { + running, _ := c.IsRunning(ctx) + if !running || options.RemoveRunning { + return c.Remove(ctx, options.RemoveVolume) + } + return nil }) } // Log implements Service.Log. It returns the docker logs for each container related to the service. func (s *Service) Log(ctx context.Context, follow bool) error { - return s.collectContainersAndDo(ctx, func(c *Container) error { - return c.Log(ctx, follow) + return s.collectContainersAndDo(ctx, func(c *container.Container) error { + containerNumber, err := c.Number() + if err != nil { + return err + } + name := fmt.Sprintf("%s_%d", s.name, containerNumber) + if s.Config().ContainerName != "" { + name = s.Config().ContainerName + } + l := s.context.LoggerFactory.CreateContainerLogger(name) + return c.Log(ctx, l, follow) }) } @@ -457,31 +597,37 @@ func (s *Service) Scale(ctx context.Context, scale int, timeout int) error { logrus.Warnf("The \"%s\" service specifies a port on the host. If multiple containers for this service are created on a single host, the port will clash.", s.Name()) } - foundCount := 0 - err := s.collectContainersAndDo(ctx, func(c *Container) error { - foundCount++ - if foundCount > scale { - err := c.Stop(ctx, timeout) - if err != nil { - return err + containers, err := s.collectContainers(ctx) + if err != nil { + return err + } + if len(containers) > scale { + foundCount := 0 + for _, c := range containers { + foundCount++ + if foundCount > scale { + if err := c.Stop(ctx, timeout); err != nil { + return err + } + // FIXME(vdemeester) remove volume in scale by default ? + if err := c.Remove(ctx, false); err != nil { + return err + } } - // FIXME(vdemeester) remove volume in scale by default ? - return c.Delete(ctx, false) } - return nil - }) + } if err != nil { return err } - if foundCount != scale { - imageName, err := s.ensureImageExists(ctx, false) + if len(containers) < scale { + err := s.ensureImageExists(ctx, false, false) if err != nil { return err } - if _, err = s.constructContainers(ctx, imageName, scale); err != nil { + if _, err = s.constructContainers(ctx, scale); err != nil { return err } } @@ -496,13 +642,13 @@ func (s *Service) Pull(ctx context.Context) error { return nil } - return pullImage(ctx, s.clientFactory.Create(s), s, s.Config().Image) + return image.PullImage(ctx, s.clientFactory.Create(s), s.name, s.authLookup, s.Config().Image) } // Pause implements Service.Pause. It puts into pause the container(s) related // to the service. func (s *Service) Pause(ctx context.Context) error { - return s.collectContainersAndDo(ctx, func(c *Container) error { + return s.collectContainersAndDo(ctx, func(c *container.Container) error { return c.Pause(ctx) }) } @@ -510,7 +656,7 @@ func (s *Service) Pause(ctx context.Context) error { // Unpause implements Service.Pause. It brings back from pause the container(s) // related to the service. func (s *Service) Unpause(ctx context.Context) error { - return s.collectContainersAndDo(ctx, func(c *Container) error { + return s.collectContainersAndDo(ctx, func(c *container.Container) error { return c.Unpause(ctx) }) } @@ -523,9 +669,9 @@ func (s *Service) RemoveImage(ctx context.Context, imageType options.ImageType) if s.Config().Image != "" { return nil } - return removeImage(ctx, s.clientFactory.Create(s), s.imageName()) + return image.RemoveImage(ctx, s.clientFactory.Create(s), s.imageName()) case "all": - return removeImage(ctx, s.clientFactory.Create(s), s.imageName()) + return image.RemoveImage(ctx, s.clientFactory.Create(s), s.imageName()) default: // Don't do a thing, should be validated up-front return nil diff --git a/vendor/github.com/docker/libcompose/docker/service/service_create.go b/vendor/github.com/docker/libcompose/docker/service/service_create.go new file mode 100644 index 000000000..376d06fda --- /dev/null +++ b/vendor/github.com/docker/libcompose/docker/service/service_create.go @@ -0,0 +1,189 @@ +package service + +import ( + "fmt" + "strconv" + "strings" + + "golang.org/x/net/context" + + "github.com/Sirupsen/logrus" + "github.com/docker/engine-api/types" + containertypes "github.com/docker/engine-api/types/container" + "github.com/docker/libcompose/config" + composecontainer "github.com/docker/libcompose/docker/container" + "github.com/docker/libcompose/labels" + "github.com/docker/libcompose/project" + "github.com/docker/libcompose/project/events" + util "github.com/docker/libcompose/utils" +) + +func (s *Service) createContainer(ctx context.Context, namer Namer, oldContainer string, configOverride *config.ServiceConfig, oneOff bool) (*composecontainer.Container, error) { + serviceConfig := s.serviceConfig + if configOverride != nil { + serviceConfig.Command = configOverride.Command + serviceConfig.Tty = configOverride.Tty + serviceConfig.StdinOpen = configOverride.StdinOpen + } + configWrapper, err := ConvertToAPI(serviceConfig, s.context.Context) + if err != nil { + return nil, err + } + configWrapper.Config.Image = s.imageName() + + containerName, containerNumber := namer.Next() + + configWrapper.Config.Labels[labels.SERVICE.Str()] = s.name + configWrapper.Config.Labels[labels.PROJECT.Str()] = s.project.Name + configWrapper.Config.Labels[labels.HASH.Str()] = config.GetServiceHash(s.name, serviceConfig) + configWrapper.Config.Labels[labels.ONEOFF.Str()] = strings.Title(strconv.FormatBool(oneOff)) + configWrapper.Config.Labels[labels.NUMBER.Str()] = fmt.Sprintf("%d", containerNumber) + configWrapper.Config.Labels[labels.VERSION.Str()] = project.ComposeVersion + + err = s.populateAdditionalHostConfig(configWrapper.HostConfig) + if err != nil { + return nil, err + } + + // FIXME(vdemeester): oldContainer should be a Container instead of a string + client := s.clientFactory.Create(s) + if oldContainer != "" { + info, err := client.ContainerInspect(ctx, oldContainer) + if err != nil { + return nil, err + } + configWrapper.HostConfig.Binds = util.Merge(configWrapper.HostConfig.Binds, volumeBinds(configWrapper.Config.Volumes, &info)) + } + + logrus.Debugf("Creating container %s %#v", containerName, configWrapper) + // FIXME(vdemeester): long-term will be container.Create(…) + container, err := composecontainer.Create(ctx, client, containerName, configWrapper.Config, configWrapper.HostConfig, configWrapper.NetworkingConfig) + if err != nil { + return nil, err + } + s.project.Notify(events.ContainerCreated, s.name, map[string]string{ + "name": containerName, + }) + return container, nil +} + +func (s *Service) populateAdditionalHostConfig(hostConfig *containertypes.HostConfig) error { + links, err := s.getLinks() + if err != nil { + return err + } + + for _, link := range s.DependentServices() { + if !s.project.ServiceConfigs.Has(link.Target) { + continue + } + + service, err := s.project.CreateService(link.Target) + if err != nil { + return err + } + + containers, err := service.Containers(context.Background()) + if err != nil { + return err + } + + if link.Type == project.RelTypeIpcNamespace { + hostConfig, err = addIpc(hostConfig, service, containers, s.serviceConfig.Ipc) + } else if link.Type == project.RelTypeNetNamespace { + hostConfig, err = addNetNs(hostConfig, service, containers, s.serviceConfig.NetworkMode) + } + + if err != nil { + return err + } + } + + hostConfig.Links = []string{} + for k, v := range links { + hostConfig.Links = append(hostConfig.Links, strings.Join([]string{v, k}, ":")) + } + for _, v := range s.serviceConfig.ExternalLinks { + hostConfig.Links = append(hostConfig.Links, v) + } + + return nil +} + +// FIXME(vdemeester) this is temporary +func (s *Service) getLinks() (map[string]string, error) { + links := map[string]string{} + for _, link := range s.DependentServices() { + if !s.project.ServiceConfigs.Has(link.Target) { + continue + } + + service, err := s.project.CreateService(link.Target) + if err != nil { + return nil, err + } + + // FIXME(vdemeester) container should not know service + containers, err := service.Containers(context.Background()) + if err != nil { + return nil, err + } + + if link.Type == project.RelTypeLink { + addLinks(links, service, link, containers) + } + + if err != nil { + return nil, err + } + } + return links, nil +} + +func addLinks(links map[string]string, service project.Service, rel project.ServiceRelationship, containers []project.Container) { + for _, container := range containers { + if _, ok := links[rel.Alias]; !ok { + links[rel.Alias] = container.Name() + } + + links[container.Name()] = container.Name() + } +} + +func addIpc(config *containertypes.HostConfig, service project.Service, containers []project.Container, ipc string) (*containertypes.HostConfig, error) { + if len(containers) == 0 { + return nil, fmt.Errorf("Failed to find container for IPC %v", ipc) + } + + id, err := containers[0].ID() + if err != nil { + return nil, err + } + + config.IpcMode = containertypes.IpcMode("container:" + id) + return config, nil +} + +func addNetNs(config *containertypes.HostConfig, service project.Service, containers []project.Container, networkMode string) (*containertypes.HostConfig, error) { + if len(containers) == 0 { + return nil, fmt.Errorf("Failed to find container for networks ns %v", networkMode) + } + + id, err := containers[0].ID() + if err != nil { + return nil, err + } + + config.NetworkMode = containertypes.NetworkMode("container:" + id) + return config, nil +} + +func volumeBinds(volumes map[string]struct{}, container *types.ContainerJSON) []string { + result := make([]string, 0, len(container.Mounts)) + for _, mount := range container.Mounts { + if _, ok := volumes[mount.Destination]; ok { + result = append(result, fmt.Sprint(mount.Source, ":", mount.Destination)) + } + } + return result +} diff --git a/vendor/github.com/docker/libcompose/docker/service/service_factory.go b/vendor/github.com/docker/libcompose/docker/service/service_factory.go new file mode 100644 index 000000000..2fcaafab1 --- /dev/null +++ b/vendor/github.com/docker/libcompose/docker/service/service_factory.go @@ -0,0 +1,24 @@ +package service + +import ( + "github.com/docker/libcompose/config" + "github.com/docker/libcompose/docker/ctx" + "github.com/docker/libcompose/project" +) + +// Factory is an implementation of project.ServiceFactory. +type Factory struct { + context *ctx.Context +} + +// NewFactory creates a new service factory for the given context +func NewFactory(context *ctx.Context) *Factory { + return &Factory{ + context: context, + } +} + +// Create creates a Service based on the specified project, name and service configuration. +func (s *Factory) Create(project *project.Project, name string, serviceConfig *config.ServiceConfig) (project.Service, error) { + return NewService(name, serviceConfig, s.context), nil +} diff --git a/vendor/github.com/docker/libcompose/docker/utils.go b/vendor/github.com/docker/libcompose/docker/service/utils.go similarity index 98% rename from vendor/github.com/docker/libcompose/docker/utils.go rename to vendor/github.com/docker/libcompose/docker/service/utils.go index 719863577..6bb403b47 100644 --- a/vendor/github.com/docker/libcompose/docker/utils.go +++ b/vendor/github.com/docker/libcompose/docker/service/utils.go @@ -1,4 +1,4 @@ -package docker +package service import ( "github.com/docker/engine-api/types/container" diff --git a/vendor/github.com/docker/libcompose/docker/service_factory.go b/vendor/github.com/docker/libcompose/docker/service_factory.go deleted file mode 100644 index 3b455ee49..000000000 --- a/vendor/github.com/docker/libcompose/docker/service_factory.go +++ /dev/null @@ -1,16 +0,0 @@ -package docker - -import ( - "github.com/docker/libcompose/config" - "github.com/docker/libcompose/project" -) - -// ServiceFactory is an implementation of project.ServiceFactory. -type ServiceFactory struct { - context *Context -} - -// Create creates a Service based on the specified project, name and service configuration. -func (s *ServiceFactory) Create(project *project.Project, name string, serviceConfig *config.ServiceConfig) (project.Service, error) { - return NewService(name, serviceConfig, s.context), nil -} diff --git a/vendor/github.com/docker/libcompose/logger/null.go b/vendor/github.com/docker/libcompose/logger/null.go index b4b1bda69..d791bfb0d 100644 --- a/vendor/github.com/docker/libcompose/logger/null.go +++ b/vendor/github.com/docker/libcompose/logger/null.go @@ -1,5 +1,9 @@ package logger +import ( + "io" +) + // NullLogger is a logger.Logger and logger.Factory implementation that does nothing. type NullLogger struct { } @@ -12,7 +16,27 @@ func (n *NullLogger) Out(_ []byte) { func (n *NullLogger) Err(_ []byte) { } -// Create implements logger.Factory and returns a NullLogger. -func (n *NullLogger) Create(_ string) Logger { +// CreateContainerLogger allows NullLogger to implement logger.Factory. +func (n *NullLogger) CreateContainerLogger(_ string) Logger { + return &NullLogger{} +} + +// CreateBuildLogger allows NullLogger to implement logger.Factory. +func (n *NullLogger) CreateBuildLogger(_ string) Logger { return &NullLogger{} } + +// CreatePullLogger allows NullLogger to implement logger.Factory. +func (n *NullLogger) CreatePullLogger(_ string) Logger { + return &NullLogger{} +} + +// OutWriter returns the base writer +func (n *NullLogger) OutWriter() io.Writer { + return nil +} + +// ErrWriter returns the base writer +func (n *NullLogger) ErrWriter() io.Writer { + return nil +} diff --git a/vendor/github.com/docker/libcompose/logger/raw_logger.go b/vendor/github.com/docker/libcompose/logger/raw_logger.go new file mode 100644 index 000000000..9aa0a7bc8 --- /dev/null +++ b/vendor/github.com/docker/libcompose/logger/raw_logger.go @@ -0,0 +1,48 @@ +package logger + +import ( + "fmt" + "io" + "os" +) + +// RawLogger is a logger.Logger and logger.Factory implementation that prints raw data with no formatting. +type RawLogger struct { +} + +// Out is a no-op function. +func (r *RawLogger) Out(message []byte) { + fmt.Print(string(message)) + +} + +// Err is a no-op function. +func (r *RawLogger) Err(message []byte) { + fmt.Fprint(os.Stderr, string(message)) + +} + +// CreateContainerLogger allows RawLogger to implement logger.Factory. +func (r *RawLogger) CreateContainerLogger(_ string) Logger { + return &RawLogger{} +} + +// CreateBuildLogger allows RawLogger to implement logger.Factory. +func (r *RawLogger) CreateBuildLogger(_ string) Logger { + return &RawLogger{} +} + +// CreatePullLogger allows RawLogger to implement logger.Factory. +func (r *RawLogger) CreatePullLogger(_ string) Logger { + return &RawLogger{} +} + +// OutWriter returns the base writer +func (r *RawLogger) OutWriter() io.Writer { + return os.Stdout +} + +// ErrWriter returns the base writer +func (r *RawLogger) ErrWriter() io.Writer { + return os.Stderr +} diff --git a/vendor/github.com/docker/libcompose/logger/types.go b/vendor/github.com/docker/libcompose/logger/types.go index 6f1d39824..7300095aa 100644 --- a/vendor/github.com/docker/libcompose/logger/types.go +++ b/vendor/github.com/docker/libcompose/logger/types.go @@ -1,15 +1,23 @@ package logger +import ( + "io" +) + // Factory defines methods a factory should implement, to create a Logger -// based on the specified name. +// based on the specified container, image or service name. type Factory interface { - Create(name string) Logger + CreateContainerLogger(name string) Logger + CreateBuildLogger(name string) Logger + CreatePullLogger(name string) Logger } // Logger defines methods to implement for being a logger. type Logger interface { Out(bytes []byte) Err(bytes []byte) + OutWriter() io.Writer + ErrWriter() io.Writer } // Wrapper is a wrapper around Logger that implements the Writer interface, diff --git a/vendor/github.com/docker/libcompose/lookup/file.go b/vendor/github.com/docker/libcompose/lookup/file.go index 70b3d8d60..643592d79 100644 --- a/vendor/github.com/docker/libcompose/lookup/file.go +++ b/vendor/github.com/docker/libcompose/lookup/file.go @@ -20,7 +20,7 @@ func relativePath(file, relativeTo string) string { // stdin: return the current working directory if possible. if relativeTo == "-" { if cwd, err := os.Getwd(); err == nil { - return cwd + return filepath.Join(cwd, file) } } @@ -39,15 +39,15 @@ func relativePath(file, relativeTo string) string { return abs } -// FileConfigLookup is a "bare" structure that implements the project.ResourceLookup interface -type FileConfigLookup struct { +// FileResourceLookup is a "bare" structure that implements the project.ResourceLookup interface +type FileResourceLookup struct { } // Lookup returns the content and the actual filename of the file that is "built" using the // specified file and relativeTo string. file and relativeTo are supposed to be file path. // If file starts with a slash ('/'), it tries to load it, otherwise it will build a // filename using the folder part of relativeTo joined with file. -func (f *FileConfigLookup) Lookup(file, relativeTo string) ([]byte, string, error) { +func (f *FileResourceLookup) Lookup(file, relativeTo string) ([]byte, string, error) { file = relativePath(file, relativeTo) logrus.Debugf("Reading file %s", file) bytes, err := ioutil.ReadFile(file) @@ -56,11 +56,11 @@ func (f *FileConfigLookup) Lookup(file, relativeTo string) ([]byte, string, erro // ResolvePath returns the path to be used for the given path volume. This // function already takes care of relative paths. -func (f *FileConfigLookup) ResolvePath(path, inFile string) string { +func (f *FileResourceLookup) ResolvePath(path, relativeTo string) string { vs := strings.SplitN(path, ":", 2) if len(vs) != 2 || filepath.IsAbs(vs[0]) { return path } - vs[0] = relativePath(vs[0], inFile) + vs[0] = relativePath(vs[0], relativeTo) return strings.Join(vs, ":") } diff --git a/vendor/github.com/docker/libcompose/project/context.go b/vendor/github.com/docker/libcompose/project/context.go index 5c8a61dcb..94019306b 100644 --- a/vendor/github.com/docker/libcompose/project/context.go +++ b/vendor/github.com/docker/libcompose/project/context.go @@ -25,6 +25,7 @@ type Context struct { isOpen bool ServiceFactory ServiceFactory NetworksFactory NetworksFactory + VolumesFactory VolumesFactory EnvironmentLookup config.EnvironmentLookup ResourceLookup config.ResourceLookup LoggerFactory logger.Factory diff --git a/vendor/github.com/docker/libcompose/project/empty.go b/vendor/github.com/docker/libcompose/project/empty.go index 76ce74227..4b31b1dfe 100644 --- a/vendor/github.com/docker/libcompose/project/empty.go +++ b/vendor/github.com/docker/libcompose/project/empty.go @@ -10,7 +10,7 @@ import ( // this ensures EmptyService implements Service // useful since it's easy to forget adding new functions to EmptyService -var _ Service = &EmptyService{} +var _ Service = (*EmptyService)(nil) // EmptyService is a struct that implements Service but does nothing. type EmptyService struct { @@ -77,7 +77,7 @@ func (e *EmptyService) Scale(ctx context.Context, count int, timeout int) error } // Info implements Service.Info but does nothing. -func (e *EmptyService) Info(ctx context.Context, qFlag bool) (InfoSet, error) { +func (e *EmptyService) Info(ctx context.Context) (InfoSet, error) { return InfoSet{}, nil } @@ -120,3 +120,20 @@ func (e *EmptyService) Config() *config.ServiceConfig { func (e *EmptyService) Name() string { return "" } + +// this ensures EmptyNetworks implements Networks +var _ Networks = (*EmptyNetworks)(nil) + +// EmptyNetworks is a struct that implements Networks but does nothing. +type EmptyNetworks struct { +} + +// Initialize implements Networks.Initialize but does nothing. +func (e *EmptyNetworks) Initialize(ctx context.Context) error { + return nil +} + +// Remove implements Networks.Remove but does nothing. +func (e *EmptyNetworks) Remove(ctx context.Context) error { + return nil +} diff --git a/vendor/github.com/docker/libcompose/project/info.go b/vendor/github.com/docker/libcompose/project/info.go index 6689c77e6..c12b04c7d 100644 --- a/vendor/github.com/docker/libcompose/project/info.go +++ b/vendor/github.com/docker/libcompose/project/info.go @@ -6,18 +6,13 @@ import ( "text/tabwriter" ) -// InfoPart holds key/value strings. -type InfoPart struct { - Key, Value string -} - // InfoSet holds a list of Info. type InfoSet []Info // Info holds a list of InfoPart. -type Info []InfoPart +type Info map[string]string -func (infos InfoSet) String(titleFlag bool) string { +func (infos InfoSet) String(columns []string, titleFlag bool) string { //no error checking, none of this should fail buffer := bytes.NewBuffer(make([]byte, 0, 1024)) tabwriter := tabwriter.NewWriter(buffer, 4, 4, 2, ' ', 0) @@ -25,27 +20,27 @@ func (infos InfoSet) String(titleFlag bool) string { first := true for _, info := range infos { if first && titleFlag { - writeLine(tabwriter, true, info) + writeLine(tabwriter, columns, true, info) } first = false - writeLine(tabwriter, false, info) + writeLine(tabwriter, columns, false, info) } tabwriter.Flush() return buffer.String() } -func writeLine(writer io.Writer, key bool, info Info) { +func writeLine(writer io.Writer, columns []string, key bool, info Info) { first := true - for _, part := range info { + for _, column := range columns { if !first { writer.Write([]byte{'\t'}) } first = false if key { - writer.Write([]byte(part.Key)) + writer.Write([]byte(column)) } else { - writer.Write([]byte(part.Value)) + writer.Write([]byte(info[column])) } } diff --git a/vendor/github.com/docker/libcompose/project/interface.go b/vendor/github.com/docker/libcompose/project/interface.go index 40113a869..1f706f1a0 100644 --- a/vendor/github.com/docker/libcompose/project/interface.go +++ b/vendor/github.com/docker/libcompose/project/interface.go @@ -14,6 +14,7 @@ type APIProject interface { events.Emitter Build(ctx context.Context, options options.Build, sevice ...string) error + Config() (string, error) Create(ctx context.Context, options options.Create, services ...string) error Delete(ctx context.Context, options options.Delete, services ...string) error Down(ctx context.Context, options options.Down, services ...string) error @@ -21,7 +22,7 @@ type APIProject interface { Kill(ctx context.Context, signal string, services ...string) error Log(ctx context.Context, follow bool, services ...string) error Pause(ctx context.Context, services ...string) error - Ps(ctx context.Context, onlyID bool, services ...string) (InfoSet, error) + Ps(ctx context.Context, services ...string) (InfoSet, error) // FIXME(vdemeester) we could use nat.Port instead ? Port(ctx context.Context, index int, protocol, serviceName, privatePort string) (string, error) Pull(ctx context.Context, services ...string) error @@ -37,8 +38,24 @@ type APIProject interface { CreateService(name string) (Service, error) AddConfig(name string, config *config.ServiceConfig) error Load(bytes []byte) error + Containers(ctx context.Context, filter Filter, services ...string) ([]string, error) } +// Filter holds filter element to filter containers +type Filter struct { + State State +} + +// State defines the supported state you can filter on +type State string + +// Definitions of filter states +const ( + AnyState = State("") + Running = State("running") + Stopped = State("stopped") +) + // RuntimeProject defines runtime-specific methods for a libcompose implementation. type RuntimeProject interface { RemoveOrphans(ctx context.Context, projectName string, serviceConfigs *config.ServiceConfigs) error diff --git a/vendor/github.com/docker/libcompose/project/options/types.go b/vendor/github.com/docker/libcompose/project/options/types.go index 8828a0ddf..17a6df508 100644 --- a/vendor/github.com/docker/libcompose/project/options/types.go +++ b/vendor/github.com/docker/libcompose/project/options/types.go @@ -9,8 +9,8 @@ type Build struct { // Delete holds options of compose rm. type Delete struct { - RemoveVolume bool - BeforeDeleteCallback func([]string) bool + RemoveVolume bool + RemoveRunning bool } // Down holds options of compose down. @@ -25,7 +25,7 @@ type Create struct { NoRecreate bool ForceRecreate bool NoBuild bool - // ForceBuild bool + ForceBuild bool } // Run holds options of compose run. diff --git a/vendor/github.com/docker/libcompose/project/project.go b/vendor/github.com/docker/libcompose/project/project.go index 189d2a1dd..fb19a9c91 100644 --- a/vendor/github.com/docker/libcompose/project/project.go +++ b/vendor/github.com/docker/libcompose/project/project.go @@ -11,11 +11,13 @@ import ( "github.com/docker/libcompose/config" "github.com/docker/libcompose/logger" "github.com/docker/libcompose/project/events" - "github.com/docker/libcompose/project/options" "github.com/docker/libcompose/utils" "github.com/docker/libcompose/yaml" ) +// ComposeVersion is name of docker-compose.yml file syntax supported version +const ComposeVersion = "1.5.0" + type wrapperAction func(*serviceWrapper, map[string]*serviceWrapper) type serviceAction func(service Service) error @@ -31,6 +33,7 @@ type Project struct { runtime RuntimeProject networks Networks + volumes Volumes configVersion string context *Context reload []string @@ -205,6 +208,31 @@ func (p *Project) load(file string, bytes []byte) error { } // Update network configuration a little bit + p.handleNetworkConfig() + p.handleVolumeConfig() + + if p.context.NetworksFactory != nil { + networks, err := p.context.NetworksFactory.Create(p.Name, p.NetworkConfigs, p.ServiceConfigs, p.isNetworkEnabled()) + if err != nil { + return err + } + + p.networks = networks + } + + if p.context.VolumesFactory != nil { + volumes, err := p.context.VolumesFactory.Create(p.Name, p.VolumeConfigs, p.ServiceConfigs, p.isVolumeEnabled()) + if err != nil { + return err + } + + p.volumes = volumes + } + + return nil +} + +func (p *Project) handleNetworkConfig() { if p.isNetworkEnabled() { for _, serviceName := range p.ServiceConfigs.Keys() { serviceConfig, _ := p.ServiceConfigs.Get(serviceName) @@ -238,21 +266,44 @@ func (p *Project) load(file string, bytes []byte) error { } } } +} - // FIXME(vdemeester) Not sure about this.. - if p.context.NetworksFactory != nil { - networks, err := p.context.NetworksFactory.Create(p.Name, p.NetworkConfigs, p.ServiceConfigs, p.isNetworkEnabled()) - if err != nil { - return err - } +func (p *Project) isNetworkEnabled() bool { + return p.configVersion == "2" +} - p.networks = networks - } +func (p *Project) handleVolumeConfig() { + if p.isVolumeEnabled() { + for _, serviceName := range p.ServiceConfigs.Keys() { + serviceConfig, _ := p.ServiceConfigs.Get(serviceName) + // Consolidate the name of the volume + // FIXME(vdemeester) probably shouldn't be there, maybe move that to interface/factory + if serviceConfig.Volumes == nil { + continue + } + for _, volume := range serviceConfig.Volumes.Volumes { + if !IsNamedVolume(volume.Source) { + continue + } - return nil + vol, ok := p.VolumeConfigs[volume.Source] + if !ok { + continue + } + + if vol.External.External { + if vol.External.Name != "" { + volume.Source = vol.External.Name + } + } else { + volume.Source = p.Name + "_" + volume.Source + } + } + } + } } -func (p *Project) isNetworkEnabled() bool { +func (p *Project) isVolumeEnabled() bool { return p.configVersion == "2" } @@ -264,7 +315,11 @@ func (p *Project) initialize(ctx context.Context) error { return err } } - // TODO Initialize volumes + if p.volumes != nil { + if err := p.volumes.Initialize(ctx); err != nil { + return err + } + } return nil } @@ -280,258 +335,6 @@ func (p *Project) loadWrappers(wrappers map[string]*serviceWrapper, servicesToCo return nil } -// Build builds the specified services (like docker build). -func (p *Project) Build(ctx context.Context, buildOptions options.Build, services ...string) error { - return p.perform(events.ProjectBuildStart, events.ProjectBuildDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(wrappers, events.ServiceBuildStart, events.ServiceBuild, func(service Service) error { - return service.Build(ctx, buildOptions) - }) - }), nil) -} - -// Create creates the specified services (like docker create). -func (p *Project) Create(ctx context.Context, options options.Create, services ...string) error { - if options.NoRecreate && options.ForceRecreate { - return fmt.Errorf("no-recreate and force-recreate cannot be combined") - } - return p.perform(events.ProjectCreateStart, events.ProjectCreateDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(wrappers, events.ServiceCreateStart, events.ServiceCreate, func(service Service) error { - return service.Create(ctx, options) - }) - }), nil) -} - -// Stop stops the specified services (like docker stop). -func (p *Project) Stop(ctx context.Context, timeout int, services ...string) error { - return p.perform(events.ProjectStopStart, events.ProjectStopDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(nil, events.ServiceStopStart, events.ServiceStop, func(service Service) error { - return service.Stop(ctx, timeout) - }) - }), nil) -} - -// Down stops the specified services and clean related containers (like docker stop + docker rm). -func (p *Project) Down(ctx context.Context, opts options.Down, services ...string) error { - if !opts.RemoveImages.Valid() { - return fmt.Errorf("--rmi flag must be local, all or empty") - } - if err := p.Stop(ctx, 10, services...); err != nil { - return err - } - if opts.RemoveOrphans { - if err := p.runtime.RemoveOrphans(ctx, p.Name, p.ServiceConfigs); err != nil { - return err - } - } - if err := p.Delete(ctx, options.Delete{ - RemoveVolume: opts.RemoveVolume, - }, services...); err != nil { - return err - } - - networks, err := p.context.NetworksFactory.Create(p.Name, p.NetworkConfigs, p.ServiceConfigs, p.isNetworkEnabled()) - if err != nil { - return err - } - if err := networks.Remove(ctx); err != nil { - return err - } - - return p.forEach([]string{}, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(wrappers, events.NoEvent, events.NoEvent, func(service Service) error { - return service.RemoveImage(ctx, opts.RemoveImages) - }) - }), func(service Service) error { - return service.Create(ctx, options.Create{}) - }) -} - -// RemoveOrphans implements project.RuntimeProject.RemoveOrphans. -// It does nothing by default as it is supposed to be overriden by specific implementation. -func (p *Project) RemoveOrphans(ctx context.Context) error { - return nil -} - -// Restart restarts the specified services (like docker restart). -func (p *Project) Restart(ctx context.Context, timeout int, services ...string) error { - return p.perform(events.ProjectRestartStart, events.ProjectRestartDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(wrappers, events.ServiceRestartStart, events.ServiceRestart, func(service Service) error { - return service.Restart(ctx, timeout) - }) - }), nil) -} - -// Port returns the public port for a port binding of the specified service. -func (p *Project) Port(ctx context.Context, index int, protocol, serviceName, privatePort string) (string, error) { - service, err := p.CreateService(serviceName) - if err != nil { - return "", err - } - - containers, err := service.Containers(ctx) - if err != nil { - return "", err - } - - if index < 1 || index > len(containers) { - return "", fmt.Errorf("Invalid index %d", index) - } - - return containers[index-1].Port(ctx, fmt.Sprintf("%s/%s", privatePort, protocol)) -} - -// Ps list containers for the specified services. -func (p *Project) Ps(ctx context.Context, onlyID bool, services ...string) (InfoSet, error) { - allInfo := InfoSet{} - for _, name := range p.ServiceConfigs.Keys() { - service, err := p.CreateService(name) - if err != nil { - return nil, err - } - - info, err := service.Info(ctx, onlyID) - if err != nil { - return nil, err - } - - allInfo = append(allInfo, info...) - } - return allInfo, nil -} - -// Start starts the specified services (like docker start). -func (p *Project) Start(ctx context.Context, services ...string) error { - return p.perform(events.ProjectStartStart, events.ProjectStartDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(wrappers, events.ServiceStartStart, events.ServiceStart, func(service Service) error { - return service.Start(ctx) - }) - }), nil) -} - -// Run executes a one off command (like `docker run image command`). -func (p *Project) Run(ctx context.Context, serviceName string, commandParts []string, opts options.Run) (int, error) { - if !p.ServiceConfigs.Has(serviceName) { - return 1, fmt.Errorf("%s is not defined in the template", serviceName) - } - - if err := p.initialize(ctx); err != nil { - return 1, err - } - var exitCode int - err := p.forEach([]string{}, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(wrappers, events.ServiceRunStart, events.ServiceRun, func(service Service) error { - if service.Name() == serviceName { - code, err := service.Run(ctx, commandParts, opts) - exitCode = code - return err - } - return nil - }) - }), func(service Service) error { - return service.Create(ctx, options.Create{}) - }) - return exitCode, err -} - -// Up creates and starts the specified services (kinda like docker run). -func (p *Project) Up(ctx context.Context, options options.Up, services ...string) error { - if err := p.initialize(ctx); err != nil { - return err - } - return p.perform(events.ProjectUpStart, events.ProjectUpDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(wrappers, events.ServiceUpStart, events.ServiceUp, func(service Service) error { - return service.Up(ctx, options) - }) - }), func(service Service) error { - return service.Create(ctx, options.Create) - }) -} - -// Log aggregates and prints out the logs for the specified services. -func (p *Project) Log(ctx context.Context, follow bool, services ...string) error { - return p.forEach(services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(nil, events.NoEvent, events.NoEvent, func(service Service) error { - return service.Log(ctx, follow) - }) - }), nil) -} - -// Scale scales the specified services. -func (p *Project) Scale(ctx context.Context, timeout int, servicesScale map[string]int) error { - // This code is a bit verbose but I wanted to parse everything up front - order := make([]string, 0, 0) - services := make(map[string]Service) - - for name := range servicesScale { - if !p.ServiceConfigs.Has(name) { - return fmt.Errorf("%s is not defined in the template", name) - } - - service, err := p.CreateService(name) - if err != nil { - return fmt.Errorf("Failed to lookup service: %s: %v", service, err) - } - - order = append(order, name) - services[name] = service - } - - for _, name := range order { - scale := servicesScale[name] - log.Infof("Setting scale %s=%d...", name, scale) - err := services[name].Scale(ctx, scale, timeout) - if err != nil { - return fmt.Errorf("Failed to set the scale %s=%d: %v", name, scale, err) - } - } - return nil -} - -// Pull pulls the specified services (like docker pull). -func (p *Project) Pull(ctx context.Context, services ...string) error { - return p.forEach(services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(nil, events.ServicePullStart, events.ServicePull, func(service Service) error { - return service.Pull(ctx) - }) - }), nil) -} - -// Delete removes the specified services (like docker rm). -func (p *Project) Delete(ctx context.Context, options options.Delete, services ...string) error { - return p.perform(events.ProjectDeleteStart, events.ProjectDeleteDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(nil, events.ServiceDeleteStart, events.ServiceDelete, func(service Service) error { - return service.Delete(ctx, options) - }) - }), nil) -} - -// Kill kills the specified services (like docker kill). -func (p *Project) Kill(ctx context.Context, signal string, services ...string) error { - return p.perform(events.ProjectKillStart, events.ProjectKillDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(nil, events.ServiceKillStart, events.ServiceKill, func(service Service) error { - return service.Kill(ctx, signal) - }) - }), nil) -} - -// Pause pauses the specified services containers (like docker pause). -func (p *Project) Pause(ctx context.Context, services ...string) error { - return p.perform(events.ProjectPauseStart, events.ProjectPauseDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(nil, events.ServicePauseStart, events.ServicePause, func(service Service) error { - return service.Pause(ctx) - }) - }), nil) -} - -// Unpause pauses the specified services containers (like docker pause). -func (p *Project) Unpause(ctx context.Context, services ...string) error { - return p.perform(events.ProjectUnpauseStart, events.ProjectUnpauseDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { - wrapper.Do(nil, events.ServiceUnpauseStart, events.ServiceUnpause, func(service Service) error { - return service.Unpause(ctx) - }) - }), nil) -} - func (p *Project) perform(start, done events.EventType, services []string, action wrapperAction, cycleAction serviceAction) error { p.Notify(start, "", nil) @@ -700,3 +503,8 @@ func (p *Project) Notify(eventType events.EventType, serviceName string, data ma l <- event } } + +// IsNamedVolume returns whether the specified volume (string) is a named volume or not. +func IsNamedVolume(volume string) bool { + return !strings.HasPrefix(volume, ".") && !strings.HasPrefix(volume, "/") && !strings.HasPrefix(volume, "~") +} diff --git a/vendor/github.com/docker/libcompose/project/project_build.go b/vendor/github.com/docker/libcompose/project/project_build.go new file mode 100644 index 000000000..506a5c8fe --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_build.go @@ -0,0 +1,17 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" + "github.com/docker/libcompose/project/options" +) + +// Build builds the specified services (like docker build). +func (p *Project) Build(ctx context.Context, buildOptions options.Build, services ...string) error { + return p.perform(events.ProjectBuildStart, events.ProjectBuildDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(wrappers, events.ServiceBuildStart, events.ServiceBuild, func(service Service) error { + return service.Build(ctx, buildOptions) + }) + }), nil) +} diff --git a/vendor/github.com/docker/libcompose/project/project_config.go b/vendor/github.com/docker/libcompose/project/project_config.go new file mode 100644 index 000000000..c4ca1a31d --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_config.go @@ -0,0 +1,27 @@ +package project + +import ( + "github.com/docker/libcompose/config" + "gopkg.in/yaml.v2" +) + +// ExportedConfig holds config attribute that will be exported +type ExportedConfig struct { + Version string `yaml:"version,omitempty"` + Services map[string]*config.ServiceConfig `yaml:"services"` + Volumes map[string]*config.VolumeConfig `yaml:"volumes"` + Networks map[string]*config.NetworkConfig `yaml:"networks"` +} + +// Config validates and print the compose file. +func (p *Project) Config() (string, error) { + cfg := ExportedConfig{ + Version: "2.0", + Services: p.ServiceConfigs.All(), + Volumes: p.VolumeConfigs, + Networks: p.NetworkConfigs, + } + + bytes, err := yaml.Marshal(cfg) + return string(bytes), err +} diff --git a/vendor/github.com/docker/libcompose/project/project_containers.go b/vendor/github.com/docker/libcompose/project/project_containers.go new file mode 100644 index 000000000..acc2a9a8e --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_containers.go @@ -0,0 +1,56 @@ +package project + +import ( + "fmt" + + "golang.org/x/net/context" + + log "github.com/Sirupsen/logrus" + "github.com/docker/libcompose/project/events" +) + +// Containers lists the containers for the specified services. Can be filter using +// the Filter struct. +func (p *Project) Containers(ctx context.Context, filter Filter, services ...string) ([]string, error) { + containers := []string{} + err := p.forEach(services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(nil, events.NoEvent, events.NoEvent, func(service Service) error { + serviceContainers, innerErr := service.Containers(ctx) + if innerErr != nil { + return innerErr + } + + for _, container := range serviceContainers { + running, innerErr := container.IsRunning(ctx) + if innerErr != nil { + log.Error(innerErr) + } + switch filter.State { + case Running: + if !running { + continue + } + case Stopped: + if running { + continue + } + case AnyState: + // Don't do a thing + default: + // Invalid state filter + return fmt.Errorf("Invalid container filter: %s", filter.State) + } + containerID, innerErr := container.ID() + if innerErr != nil { + log.Error(innerErr) + } + containers = append(containers, containerID) + } + return nil + }) + }), nil) + if err != nil { + return nil, err + } + return containers, nil +} diff --git a/vendor/github.com/docker/libcompose/project/project_create.go b/vendor/github.com/docker/libcompose/project/project_create.go new file mode 100644 index 000000000..7efe2b3c1 --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_create.go @@ -0,0 +1,22 @@ +package project + +import ( + "fmt" + + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" + "github.com/docker/libcompose/project/options" +) + +// Create creates the specified services (like docker create). +func (p *Project) Create(ctx context.Context, options options.Create, services ...string) error { + if options.NoRecreate && options.ForceRecreate { + return fmt.Errorf("no-recreate and force-recreate cannot be combined") + } + return p.perform(events.ProjectCreateStart, events.ProjectCreateDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(wrappers, events.ServiceCreateStart, events.ServiceCreate, func(service Service) error { + return service.Create(ctx, options) + }) + }), nil) +} diff --git a/vendor/github.com/docker/libcompose/project/project_delete.go b/vendor/github.com/docker/libcompose/project/project_delete.go new file mode 100644 index 000000000..ab1d35017 --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_delete.go @@ -0,0 +1,17 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" + "github.com/docker/libcompose/project/options" +) + +// Delete removes the specified services (like docker rm). +func (p *Project) Delete(ctx context.Context, options options.Delete, services ...string) error { + return p.perform(events.ProjectDeleteStart, events.ProjectDeleteDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(nil, events.ServiceDeleteStart, events.ServiceDelete, func(service Service) error { + return service.Delete(ctx, options) + }) + }), nil) +} diff --git a/vendor/github.com/docker/libcompose/project/project_down.go b/vendor/github.com/docker/libcompose/project/project_down.go new file mode 100644 index 000000000..288ce53dd --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_down.go @@ -0,0 +1,56 @@ +package project + +import ( + "fmt" + + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" + "github.com/docker/libcompose/project/options" +) + +// Down stops the specified services and clean related containers (like docker stop + docker rm). +func (p *Project) Down(ctx context.Context, opts options.Down, services ...string) error { + if !opts.RemoveImages.Valid() { + return fmt.Errorf("--rmi flag must be local, all or empty") + } + if err := p.Stop(ctx, 10, services...); err != nil { + return err + } + if opts.RemoveOrphans { + if err := p.runtime.RemoveOrphans(ctx, p.Name, p.ServiceConfigs); err != nil { + return err + } + } + if err := p.Delete(ctx, options.Delete{ + RemoveVolume: opts.RemoveVolume, + }, services...); err != nil { + return err + } + + networks, err := p.context.NetworksFactory.Create(p.Name, p.NetworkConfigs, p.ServiceConfigs, p.isNetworkEnabled()) + if err != nil { + return err + } + if err := networks.Remove(ctx); err != nil { + return err + } + + if opts.RemoveVolume { + volumes, err := p.context.VolumesFactory.Create(p.Name, p.VolumeConfigs, p.ServiceConfigs, p.isVolumeEnabled()) + if err != nil { + return err + } + if err := volumes.Remove(ctx); err != nil { + return err + } + } + + return p.forEach([]string{}, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(wrappers, events.NoEvent, events.NoEvent, func(service Service) error { + return service.RemoveImage(ctx, opts.RemoveImages) + }) + }), func(service Service) error { + return service.Create(ctx, options.Create{}) + }) +} diff --git a/vendor/github.com/docker/libcompose/project/project_kill.go b/vendor/github.com/docker/libcompose/project/project_kill.go new file mode 100644 index 000000000..ac3c87d71 --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_kill.go @@ -0,0 +1,16 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" +) + +// Kill kills the specified services (like docker kill). +func (p *Project) Kill(ctx context.Context, signal string, services ...string) error { + return p.perform(events.ProjectKillStart, events.ProjectKillDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(nil, events.ServiceKillStart, events.ServiceKill, func(service Service) error { + return service.Kill(ctx, signal) + }) + }), nil) +} diff --git a/vendor/github.com/docker/libcompose/project/project_log.go b/vendor/github.com/docker/libcompose/project/project_log.go new file mode 100644 index 000000000..7e576d586 --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_log.go @@ -0,0 +1,16 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" +) + +// Log aggregates and prints out the logs for the specified services. +func (p *Project) Log(ctx context.Context, follow bool, services ...string) error { + return p.forEach(services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(nil, events.NoEvent, events.NoEvent, func(service Service) error { + return service.Log(ctx, follow) + }) + }), nil) +} diff --git a/vendor/github.com/docker/libcompose/project/project_pause.go b/vendor/github.com/docker/libcompose/project/project_pause.go new file mode 100644 index 000000000..c5c4c39b3 --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_pause.go @@ -0,0 +1,16 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" +) + +// Pause pauses the specified services containers (like docker pause). +func (p *Project) Pause(ctx context.Context, services ...string) error { + return p.perform(events.ProjectPauseStart, events.ProjectPauseDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(nil, events.ServicePauseStart, events.ServicePause, func(service Service) error { + return service.Pause(ctx) + }) + }), nil) +} diff --git a/vendor/github.com/docker/libcompose/project/project_port.go b/vendor/github.com/docker/libcompose/project/project_port.go new file mode 100644 index 000000000..85fa6d8a5 --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_port.go @@ -0,0 +1,26 @@ +package project + +import ( + "fmt" + + "golang.org/x/net/context" +) + +// Port returns the public port for a port binding of the specified service. +func (p *Project) Port(ctx context.Context, index int, protocol, serviceName, privatePort string) (string, error) { + service, err := p.CreateService(serviceName) + if err != nil { + return "", err + } + + containers, err := service.Containers(ctx) + if err != nil { + return "", err + } + + if index < 1 || index > len(containers) { + return "", fmt.Errorf("Invalid index %d", index) + } + + return containers[index-1].Port(ctx, fmt.Sprintf("%s/%s", privatePort, protocol)) +} diff --git a/vendor/github.com/docker/libcompose/project/project_ps.go b/vendor/github.com/docker/libcompose/project/project_ps.go new file mode 100644 index 000000000..f02c3416f --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_ps.go @@ -0,0 +1,24 @@ +package project + +import ( + "golang.org/x/net/context" +) + +// Ps list containers for the specified services. +func (p *Project) Ps(ctx context.Context, services ...string) (InfoSet, error) { + allInfo := InfoSet{} + for _, name := range p.ServiceConfigs.Keys() { + service, err := p.CreateService(name) + if err != nil { + return nil, err + } + + info, err := service.Info(ctx) + if err != nil { + return nil, err + } + + allInfo = append(allInfo, info...) + } + return allInfo, nil +} diff --git a/vendor/github.com/docker/libcompose/project/project_pull.go b/vendor/github.com/docker/libcompose/project/project_pull.go new file mode 100644 index 000000000..5a7b0eedd --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_pull.go @@ -0,0 +1,16 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" +) + +// Pull pulls the specified services (like docker pull). +func (p *Project) Pull(ctx context.Context, services ...string) error { + return p.forEach(services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(nil, events.ServicePullStart, events.ServicePull, func(service Service) error { + return service.Pull(ctx) + }) + }), nil) +} diff --git a/vendor/github.com/docker/libcompose/project/project_restart.go b/vendor/github.com/docker/libcompose/project/project_restart.go new file mode 100644 index 000000000..0cb326523 --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_restart.go @@ -0,0 +1,16 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" +) + +// Restart restarts the specified services (like docker restart). +func (p *Project) Restart(ctx context.Context, timeout int, services ...string) error { + return p.perform(events.ProjectRestartStart, events.ProjectRestartDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(wrappers, events.ServiceRestartStart, events.ServiceRestart, func(service Service) error { + return service.Restart(ctx, timeout) + }) + }), nil) +} diff --git a/vendor/github.com/docker/libcompose/project/project_run.go b/vendor/github.com/docker/libcompose/project/project_run.go new file mode 100644 index 000000000..c5f223fcc --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_run.go @@ -0,0 +1,35 @@ +package project + +import ( + "fmt" + + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" + "github.com/docker/libcompose/project/options" +) + +// Run executes a one off command (like `docker run image command`). +func (p *Project) Run(ctx context.Context, serviceName string, commandParts []string, opts options.Run) (int, error) { + if !p.ServiceConfigs.Has(serviceName) { + return 1, fmt.Errorf("%s is not defined in the template", serviceName) + } + + if err := p.initialize(ctx); err != nil { + return 1, err + } + var exitCode int + err := p.forEach([]string{}, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(wrappers, events.ServiceRunStart, events.ServiceRun, func(service Service) error { + if service.Name() == serviceName { + code, err := service.Run(ctx, commandParts, opts) + exitCode = code + return err + } + return nil + }) + }), func(service Service) error { + return service.Create(ctx, options.Create{}) + }) + return exitCode, err +} diff --git a/vendor/github.com/docker/libcompose/project/project_scale.go b/vendor/github.com/docker/libcompose/project/project_scale.go new file mode 100644 index 000000000..53d71978b --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_scale.go @@ -0,0 +1,40 @@ +package project + +import ( + "fmt" + + "golang.org/x/net/context" + + log "github.com/Sirupsen/logrus" +) + +// Scale scales the specified services. +func (p *Project) Scale(ctx context.Context, timeout int, servicesScale map[string]int) error { + // This code is a bit verbose but I wanted to parse everything up front + order := make([]string, 0, 0) + services := make(map[string]Service) + + for name := range servicesScale { + if !p.ServiceConfigs.Has(name) { + return fmt.Errorf("%s is not defined in the template", name) + } + + service, err := p.CreateService(name) + if err != nil { + return fmt.Errorf("Failed to lookup service: %s: %v", service, err) + } + + order = append(order, name) + services[name] = service + } + + for _, name := range order { + scale := servicesScale[name] + log.Infof("Setting scale %s=%d...", name, scale) + err := services[name].Scale(ctx, scale, timeout) + if err != nil { + return fmt.Errorf("Failed to set the scale %s=%d: %v", name, scale, err) + } + } + return nil +} diff --git a/vendor/github.com/docker/libcompose/project/project_start.go b/vendor/github.com/docker/libcompose/project/project_start.go new file mode 100644 index 000000000..8ffebdd3c --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_start.go @@ -0,0 +1,16 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" +) + +// Start starts the specified services (like docker start). +func (p *Project) Start(ctx context.Context, services ...string) error { + return p.perform(events.ProjectStartStart, events.ProjectStartDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(wrappers, events.ServiceStartStart, events.ServiceStart, func(service Service) error { + return service.Start(ctx) + }) + }), nil) +} diff --git a/vendor/github.com/docker/libcompose/project/project_stop.go b/vendor/github.com/docker/libcompose/project/project_stop.go new file mode 100644 index 000000000..16887f5b7 --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_stop.go @@ -0,0 +1,16 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" +) + +// Stop stops the specified services (like docker stop). +func (p *Project) Stop(ctx context.Context, timeout int, services ...string) error { + return p.perform(events.ProjectStopStart, events.ProjectStopDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(nil, events.ServiceStopStart, events.ServiceStop, func(service Service) error { + return service.Stop(ctx, timeout) + }) + }), nil) +} diff --git a/vendor/github.com/docker/libcompose/project/project_unpause.go b/vendor/github.com/docker/libcompose/project/project_unpause.go new file mode 100644 index 000000000..625129d8b --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_unpause.go @@ -0,0 +1,16 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" +) + +// Unpause pauses the specified services containers (like docker pause). +func (p *Project) Unpause(ctx context.Context, services ...string) error { + return p.perform(events.ProjectUnpauseStart, events.ProjectUnpauseDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(nil, events.ServiceUnpauseStart, events.ServiceUnpause, func(service Service) error { + return service.Unpause(ctx) + }) + }), nil) +} diff --git a/vendor/github.com/docker/libcompose/project/project_up.go b/vendor/github.com/docker/libcompose/project/project_up.go new file mode 100644 index 000000000..f5954cd7b --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/project_up.go @@ -0,0 +1,22 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/project/events" + "github.com/docker/libcompose/project/options" +) + +// Up creates and starts the specified services (kinda like docker run). +func (p *Project) Up(ctx context.Context, options options.Up, services ...string) error { + if err := p.initialize(ctx); err != nil { + return err + } + return p.perform(events.ProjectUpStart, events.ProjectUpDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) { + wrapper.Do(wrappers, events.ServiceUpStart, events.ServiceUp, func(service Service) error { + return service.Up(ctx, options) + }) + }), func(service Service) error { + return service.Create(ctx, options.Create) + }) +} diff --git a/vendor/github.com/docker/libcompose/project/service.go b/vendor/github.com/docker/libcompose/project/service.go index a98140a66..581df6740 100644 --- a/vendor/github.com/docker/libcompose/project/service.go +++ b/vendor/github.com/docker/libcompose/project/service.go @@ -16,7 +16,7 @@ type Service interface { Create(ctx context.Context, options options.Create) error Delete(ctx context.Context, options options.Delete) error Events(ctx context.Context, messages chan events.ContainerEvent) error - Info(ctx context.Context, qFlag bool) (InfoSet, error) + Info(ctx context.Context) (InfoSet, error) Log(ctx context.Context, follow bool) error Kill(ctx context.Context, signal string) error Pause(ctx context.Context) error diff --git a/vendor/github.com/docker/libcompose/project/volume.go b/vendor/github.com/docker/libcompose/project/volume.go new file mode 100644 index 000000000..08f926e30 --- /dev/null +++ b/vendor/github.com/docker/libcompose/project/volume.go @@ -0,0 +1,19 @@ +package project + +import ( + "golang.org/x/net/context" + + "github.com/docker/libcompose/config" +) + +// Volumes defines the methods a libcompose volume aggregate should define. +type Volumes interface { + Initialize(ctx context.Context) error + Remove(ctx context.Context) error +} + +// VolumesFactory is an interface factory to create Volumes object for the specified +// configurations (service, volumes, …) +type VolumesFactory interface { + Create(projectName string, volumeConfigs map[string]*config.VolumeConfig, serviceConfigs *config.ServiceConfigs, volumeEnabled bool) (Volumes, error) +} diff --git a/vendor/github.com/docker/libcompose/utils/util.go b/vendor/github.com/docker/libcompose/utils/util.go index ac1876364..51383cf3b 100644 --- a/vendor/github.com/docker/libcompose/utils/util.go +++ b/vendor/github.com/docker/libcompose/utils/util.go @@ -6,7 +6,7 @@ import ( "github.com/Sirupsen/logrus" - yaml "github.com/cloudfoundry-incubator/candiedyaml" + "gopkg.in/yaml.v2" ) // InParallel holds a pool and a waitgroup to execute tasks in parallel and to be able diff --git a/vendor/github.com/docker/libcompose/version/version.go b/vendor/github.com/docker/libcompose/version/version.go index e80e311e4..820c98367 100644 --- a/vendor/github.com/docker/libcompose/version/version.go +++ b/vendor/github.com/docker/libcompose/version/version.go @@ -2,7 +2,7 @@ package version var ( // VERSION should be updated by hand at each release - VERSION = "0.3.0-dev" + VERSION = "0.4.0-dev" // GITCOMMIT will be overwritten automatically by the build system GITCOMMIT = "HEAD" diff --git a/vendor/github.com/docker/libcompose/yaml/build.go b/vendor/github.com/docker/libcompose/yaml/build.go index 3dfa33905..95d6dd5fb 100644 --- a/vendor/github.com/docker/libcompose/yaml/build.go +++ b/vendor/github.com/docker/libcompose/yaml/build.go @@ -1,6 +1,7 @@ package yaml import ( + "errors" "fmt" "strconv" "strings" @@ -15,7 +16,7 @@ type Build struct { } // MarshalYAML implements the Marshaller interface. -func (b Build) MarshalYAML() (tag string, value interface{}, err error) { +func (b Build) MarshalYAML() (interface{}, error) { m := map[string]interface{}{} if b.Context != "" { m["context"] = b.Context @@ -26,16 +27,20 @@ func (b Build) MarshalYAML() (tag string, value interface{}, err error) { if len(b.Args) > 0 { m["args"] = b.Args } - return "", m, nil + return m, nil } // UnmarshalYAML implements the Unmarshaller interface. -func (b *Build) UnmarshalYAML(tag string, value interface{}) error { - switch v := value.(type) { - case string: - b.Context = v - case map[interface{}]interface{}: - for mapKey, mapValue := range v { +func (b *Build) UnmarshalYAML(unmarshal func(interface{}) error) error { + var stringType string + if err := unmarshal(&stringType); err == nil { + b.Context = stringType + return nil + } + + var mapType map[interface{}]interface{} + if err := unmarshal(&mapType); err == nil { + for mapKey, mapValue := range mapType { switch mapKey { case "context": b.Context = mapValue.(string) @@ -52,10 +57,10 @@ func (b *Build) UnmarshalYAML(tag string, value interface{}) error { continue } } - default: - return fmt.Errorf("Failed to unmarshal Build: %#v", value) + return nil } - return nil + + return errors.New("Failed to unmarshal Build") } func handleBuildArgs(value interface{}) (map[string]string, error) { @@ -98,6 +103,8 @@ func handleBuildArgMap(m map[interface{}]interface{}) (map[string]string, error) switch a := mapValue.(type) { case string: argValue = a + case int: + argValue = strconv.Itoa(a) case int64: argValue = strconv.Itoa(int(a)) default: diff --git a/vendor/github.com/docker/libcompose/yaml/command.go b/vendor/github.com/docker/libcompose/yaml/command.go index 1f855a32c..a9e4586f3 100644 --- a/vendor/github.com/docker/libcompose/yaml/command.go +++ b/vendor/github.com/docker/libcompose/yaml/command.go @@ -1,6 +1,7 @@ package yaml import ( + "errors" "fmt" "github.com/docker/engine-api/types/strslice" @@ -11,22 +12,31 @@ import ( type Command strslice.StrSlice // UnmarshalYAML implements the Unmarshaller interface. -func (s *Command) UnmarshalYAML(tag string, value interface{}) error { - switch value := value.(type) { - case []interface{}: - parts, err := toStrings(value) +func (s *Command) UnmarshalYAML(unmarshal func(interface{}) error) error { + var stringType string + if err := unmarshal(&stringType); err == nil { + parts, err := shlex.Split(stringType) if err != nil { return err } *s = parts - case string: - parts, err := shlex.Split(value) + return nil + } + + var sliceType []interface{} + if err := unmarshal(&sliceType); err == nil { + parts, err := toStrings(sliceType) if err != nil { return err } *s = parts - default: - return fmt.Errorf("Failed to unmarshal Command: %#v", value) + return nil } - return nil + + var interfaceType interface{} + if err := unmarshal(&interfaceType); err == nil { + fmt.Println(interfaceType) + } + + return errors.New("Failed to unmarshal Command") } diff --git a/vendor/github.com/docker/libcompose/yaml/external.go b/vendor/github.com/docker/libcompose/yaml/external.go index 0b5b3d6d0..be7efca9f 100644 --- a/vendor/github.com/docker/libcompose/yaml/external.go +++ b/vendor/github.com/docker/libcompose/yaml/external.go @@ -1,9 +1,5 @@ package yaml -import ( - "fmt" -) - // External represents an external network entry in compose file. // It can be a boolean (true|false) or have a name type External struct { @@ -12,33 +8,30 @@ type External struct { } // MarshalYAML implements the Marshaller interface. -func (n External) MarshalYAML() (tag string, value interface{}, err error) { +func (n External) MarshalYAML() (interface{}, error) { if n.Name == "" { - return "", n.External, nil + return n.External, nil } - return "", map[string]interface{}{ + return map[string]interface{}{ "name": n.Name, }, nil } // UnmarshalYAML implements the Unmarshaller interface. -func (n *External) UnmarshalYAML(tag string, value interface{}) error { - switch v := value.(type) { - case bool: - n.External = v - case map[interface{}]interface{}: - for mapKey, mapValue := range v { - switch mapKey { - case "name": - n.Name = mapValue.(string) - default: - // Ignore unknown keys - continue - } - } - n.External = true - default: - return fmt.Errorf("Failed to unmarshal External: %#v", value) +func (n *External) UnmarshalYAML(unmarshal func(interface{}) error) error { + if err := unmarshal(&n.External); err == nil { + return nil + } + var dummyExternal struct { + Name string } + + err := unmarshal(&dummyExternal) + if err != nil { + return err + } + n.Name = dummyExternal.Name + n.External = true + return nil } diff --git a/vendor/github.com/docker/libcompose/yaml/network.go b/vendor/github.com/docker/libcompose/yaml/network.go index 4adbdbe5d..2776b8586 100644 --- a/vendor/github.com/docker/libcompose/yaml/network.go +++ b/vendor/github.com/docker/libcompose/yaml/network.go @@ -1,6 +1,7 @@ package yaml import ( + "errors" "fmt" ) @@ -20,20 +21,20 @@ type Network struct { } // MarshalYAML implements the Marshaller interface. -func (n Networks) MarshalYAML() (tag string, value interface{}, err error) { +func (n Networks) MarshalYAML() (interface{}, error) { m := map[string]*Network{} for _, network := range n.Networks { m[network.Name] = network } - return "", m, nil + return m, nil } // UnmarshalYAML implements the Unmarshaller interface. -func (n *Networks) UnmarshalYAML(tag string, value interface{}) error { - switch v := value.(type) { - case []interface{}: +func (n *Networks) UnmarshalYAML(unmarshal func(interface{}) error) error { + var sliceType []interface{} + if err := unmarshal(&sliceType); err == nil { n.Networks = []*Network{} - for _, network := range v { + for _, network := range sliceType { name, ok := network.(string) if !ok { return fmt.Errorf("Cannot unmarshal '%v' to type %T into a string value", name, name) @@ -42,9 +43,13 @@ func (n *Networks) UnmarshalYAML(tag string, value interface{}) error { Name: name, }) } - case map[interface{}]interface{}: + return nil + } + + var mapType map[interface{}]interface{} + if err := unmarshal(&mapType); err == nil { n.Networks = []*Network{} - for mapKey, mapValue := range v { + for mapKey, mapValue := range mapType { name, ok := mapKey.(string) if !ok { return fmt.Errorf("Cannot unmarshal '%v' to type %T into a string value", name, name) @@ -55,10 +60,10 @@ func (n *Networks) UnmarshalYAML(tag string, value interface{}) error { } n.Networks = append(n.Networks, network) } - default: - return fmt.Errorf("Failed to unmarshal Networks: %#v", value) + return nil } - return nil + + return errors.New("Failed to unmarshal Networks") } func handleNetwork(name string, value interface{}) (*Network, error) { diff --git a/vendor/github.com/docker/libcompose/yaml/types_yaml.go b/vendor/github.com/docker/libcompose/yaml/types_yaml.go index ce3749ad6..3c152357d 100644 --- a/vendor/github.com/docker/libcompose/yaml/types_yaml.go +++ b/vendor/github.com/docker/libcompose/yaml/types_yaml.go @@ -1,6 +1,7 @@ package yaml import ( + "errors" "fmt" "strconv" "strings" @@ -8,50 +9,65 @@ import ( "github.com/docker/engine-api/types/strslice" ) -// Stringorslice represents a string or an array of strings. -// Using engine-api Strslice and augment it with YAML marshalling stuff. +// StringorInt represents a string or an integer. +type StringorInt int64 + +// UnmarshalYAML implements the Unmarshaller interface. +func (s *StringorInt) UnmarshalYAML(unmarshal func(interface{}) error) error { + var intType int64 + if err := unmarshal(&intType); err == nil { + *s = StringorInt(intType) + return nil + } + + var stringType string + if err := unmarshal(&stringType); err == nil { + intType, err := strconv.ParseInt(stringType, 10, 64) + if err != nil { + return err + } + *s = StringorInt(intType) + return nil + } + + return errors.New("Failed to unmarshal StringorInt") +} + +// Stringorslice represents +// Using engine-api Strslice and augment it with YAML marshalling stuff. a string or an array of strings. type Stringorslice strslice.StrSlice // UnmarshalYAML implements the Unmarshaller interface. -func (s *Stringorslice) UnmarshalYAML(tag string, value interface{}) error { - switch value := value.(type) { - case []interface{}: - parts, err := toStrings(value) +func (s *Stringorslice) UnmarshalYAML(unmarshal func(interface{}) error) error { + var stringType string + if err := unmarshal(&stringType); err == nil { + *s = []string{stringType} + return nil + } + + var sliceType []interface{} + if err := unmarshal(&sliceType); err == nil { + parts, err := toStrings(sliceType) if err != nil { return err } *s = parts - case string: - *s = []string{value} - default: - return fmt.Errorf("Failed to unmarshal Stringorslice: %#v", value) + return nil } - return nil + + return errors.New("Failed to unmarshal Stringorslice") } // SliceorMap represents a slice or a map of strings. type SliceorMap map[string]string // UnmarshalYAML implements the Unmarshaller interface. -func (s *SliceorMap) UnmarshalYAML(tag string, value interface{}) error { - switch value := value.(type) { - case map[interface{}]interface{}: - parts := map[string]string{} - for k, v := range value { - if sk, ok := k.(string); ok { - if sv, ok := v.(string); ok { - parts[sk] = sv - } else { - return fmt.Errorf("Cannot unmarshal '%v' of type %T into a string value", v, v) - } - } else { - return fmt.Errorf("Cannot unmarshal '%v' of type %T into a string value", k, k) - } - } - *s = parts - case []interface{}: +func (s *SliceorMap) UnmarshalYAML(unmarshal func(interface{}) error) error { + + var sliceType []interface{} + if err := unmarshal(&sliceType); err == nil { parts := map[string]string{} - for _, s := range value { + for _, s := range sliceType { if str, ok := s.(string); ok { str := strings.TrimSpace(str) keyValueSlice := strings.SplitN(str, "=", 2) @@ -67,10 +83,28 @@ func (s *SliceorMap) UnmarshalYAML(tag string, value interface{}) error { } } *s = parts - default: - return fmt.Errorf("Failed to unmarshal SliceorMap: %#v", value) + return nil } - return nil + + var mapType map[interface{}]interface{} + if err := unmarshal(&mapType); err == nil { + parts := map[string]string{} + for k, v := range mapType { + if sk, ok := k.(string); ok { + if sv, ok := v.(string); ok { + parts[sk] = sv + } else { + return fmt.Errorf("Cannot unmarshal '%v' of type %T into a string value", v, v) + } + } else { + return fmt.Errorf("Cannot unmarshal '%v' of type %T into a string value", k, k) + } + } + *s = parts + return nil + } + + return errors.New("Failed to unmarshal SliceorMap") } // MaporEqualSlice represents a slice of strings that gets unmarshal from a @@ -78,8 +112,8 @@ func (s *SliceorMap) UnmarshalYAML(tag string, value interface{}) error { type MaporEqualSlice []string // UnmarshalYAML implements the Unmarshaller interface. -func (s *MaporEqualSlice) UnmarshalYAML(tag string, value interface{}) error { - parts, err := unmarshalToStringOrSepMapParts(value, "=") +func (s *MaporEqualSlice) UnmarshalYAML(unmarshal func(interface{}) error) error { + parts, err := unmarshalToStringOrSepMapParts(unmarshal, "=") if err != nil { return err } @@ -97,8 +131,8 @@ func (s *MaporEqualSlice) ToMap() map[string]string { type MaporColonSlice []string // UnmarshalYAML implements the Unmarshaller interface. -func (s *MaporColonSlice) UnmarshalYAML(tag string, value interface{}) error { - parts, err := unmarshalToStringOrSepMapParts(value, ":") +func (s *MaporColonSlice) UnmarshalYAML(unmarshal func(interface{}) error) error { + parts, err := unmarshalToStringOrSepMapParts(unmarshal, ":") if err != nil { return err } @@ -116,8 +150,8 @@ func (s *MaporColonSlice) ToMap() map[string]string { type MaporSpaceSlice []string // UnmarshalYAML implements the Unmarshaller interface. -func (s *MaporSpaceSlice) UnmarshalYAML(tag string, value interface{}) error { - parts, err := unmarshalToStringOrSepMapParts(value, " ") +func (s *MaporSpaceSlice) UnmarshalYAML(unmarshal func(interface{}) error) error { + parts, err := unmarshalToStringOrSepMapParts(unmarshal, " ") if err != nil { return err } @@ -130,15 +164,16 @@ func (s *MaporSpaceSlice) ToMap() map[string]string { return toMap(*s, " ") } -func unmarshalToStringOrSepMapParts(value interface{}, key string) ([]string, error) { - switch value := value.(type) { - case []interface{}: - return toStrings(value) - case map[interface{}]interface{}: - return toSepMapParts(value, key) - default: - return nil, fmt.Errorf("Failed to unmarshal Map or Slice: %#v", value) +func unmarshalToStringOrSepMapParts(unmarshal func(interface{}) error, key string) ([]string, error) { + var sliceType []interface{} + if err := unmarshal(&sliceType); err == nil { + return toStrings(sliceType) + } + var mapType map[interface{}]interface{} + if err := unmarshal(&mapType); err == nil { + return toSepMapParts(mapType, key) } + return nil, errors.New("Failed to unmarshal MaporSlice") } func toSepMapParts(value map[interface{}]interface{}, sep string) ([]string, error) { @@ -150,6 +185,8 @@ func toSepMapParts(value map[interface{}]interface{}, sep string) ([]string, err if sk, ok := k.(string); ok { if sv, ok := v.(string); ok { parts = append(parts, sk+sep+sv) + } else if sv, ok := v.(int); ok { + parts = append(parts, sk+sep+strconv.Itoa(sv)) } else if sv, ok := v.(int64); ok { parts = append(parts, sk+sep+strconv.FormatInt(sv, 10)) } else if v == nil { diff --git a/vendor/github.com/docker/libcompose/yaml/ulimit.go b/vendor/github.com/docker/libcompose/yaml/ulimit.go index d4dd57701..c25c49364 100644 --- a/vendor/github.com/docker/libcompose/yaml/ulimit.go +++ b/vendor/github.com/docker/libcompose/yaml/ulimit.go @@ -1,6 +1,7 @@ package yaml import ( + "errors" "fmt" "sort" ) @@ -12,29 +13,30 @@ type Ulimits struct { } // MarshalYAML implements the Marshaller interface. -func (u Ulimits) MarshalYAML() (tag string, value interface{}, err error) { +func (u Ulimits) MarshalYAML() (interface{}, error) { ulimitMap := make(map[string]Ulimit) for _, ulimit := range u.Elements { ulimitMap[ulimit.Name] = ulimit } - return "", ulimitMap, nil + return ulimitMap, nil } // UnmarshalYAML implements the Unmarshaller interface. -func (u *Ulimits) UnmarshalYAML(tag string, value interface{}) error { +func (u *Ulimits) UnmarshalYAML(unmarshal func(interface{}) error) error { ulimits := make(map[string]Ulimit) - switch v := value.(type) { - case map[interface{}]interface{}: - for mapKey, mapValue := range v { + + var mapType map[interface{}]interface{} + if err := unmarshal(&mapType); err == nil { + for mapKey, mapValue := range mapType { name, ok := mapKey.(string) if !ok { return fmt.Errorf("Cannot unmarshal '%v' to type %T into a string value", name, name) } var soft, hard int64 switch mv := mapValue.(type) { - case int64: - soft = mv - hard = mv + case int: + soft = int64(mv) + hard = int64(mv) case map[interface{}]interface{}: if len(mv) != 2 { return fmt.Errorf("Failed to unmarshal Ulimit: %#v", mapValue) @@ -42,9 +44,9 @@ func (u *Ulimits) UnmarshalYAML(tag string, value interface{}) error { for mkey, mvalue := range mv { switch mkey { case "soft": - soft = mvalue.(int64) + soft = int64(mvalue.(int)) case "hard": - hard = mvalue.(int64) + hard = int64(mvalue.(int)) default: // FIXME(vdemeester) Should we ignore or fail ? continue @@ -69,10 +71,10 @@ func (u *Ulimits) UnmarshalYAML(tag string, value interface{}) error { for _, key := range keys { u.Elements = append(u.Elements, ulimits[key]) } - default: - return fmt.Errorf("Failed to unmarshal Ulimit: %#v", value) + return nil } - return nil + + return errors.New("Failed to unmarshal Ulimit") } // Ulimit represents ulimit information. @@ -87,11 +89,11 @@ type ulimitValues struct { } // MarshalYAML implements the Marshaller interface. -func (u Ulimit) MarshalYAML() (tag string, value interface{}, err error) { +func (u Ulimit) MarshalYAML() (interface{}, error) { if u.Soft == u.Hard { - return "", u.Soft, nil + return u.Soft, nil } - return "", u.ulimitValues, err + return u.ulimitValues, nil } // NewUlimit creates a Ulimit based on the specified parts. diff --git a/vendor/github.com/docker/libcompose/yaml/volume.go b/vendor/github.com/docker/libcompose/yaml/volume.go new file mode 100644 index 000000000..530aa6179 --- /dev/null +++ b/vendor/github.com/docker/libcompose/yaml/volume.go @@ -0,0 +1,83 @@ +package yaml + +import ( + "errors" + "fmt" + "strings" +) + +// Volumes represents a list of service volumes in compose file. +// It has several representation, hence this specific struct. +type Volumes struct { + Volumes []*Volume +} + +// Volume represent a service volume +type Volume struct { + Source string `yaml:"-"` + Destination string `yaml:"-"` + AccessMode string `yaml:"-"` +} + +// String implements the Stringer interface. +func (v *Volume) String() string { + var paths []string + if v.Source != "" { + paths = []string{v.Source, v.Destination} + } else { + paths = []string{v.Destination} + } + if v.AccessMode != "" { + paths = append(paths, v.AccessMode) + } + return strings.Join(paths, ":") +} + +// MarshalYAML implements the Marshaller interface. +func (v Volumes) MarshalYAML() (interface{}, error) { + vs := []string{} + for _, volume := range v.Volumes { + vs = append(vs, volume.String()) + } + return vs, nil +} + +// UnmarshalYAML implements the Unmarshaller interface. +func (v *Volumes) UnmarshalYAML(unmarshal func(interface{}) error) error { + var sliceType []interface{} + if err := unmarshal(&sliceType); err == nil { + v.Volumes = []*Volume{} + for _, volume := range sliceType { + name, ok := volume.(string) + if !ok { + return fmt.Errorf("Cannot unmarshal '%v' to type %T into a string value", name, name) + } + elts := strings.SplitN(name, ":", 3) + var vol *Volume + switch { + case len(elts) == 1: + vol = &Volume{ + Destination: elts[0], + } + case len(elts) == 2: + vol = &Volume{ + Source: elts[0], + Destination: elts[1], + } + case len(elts) == 3: + vol = &Volume{ + Source: elts[0], + Destination: elts[1], + AccessMode: elts[2], + } + default: + // FIXME + return fmt.Errorf("") + } + v.Volumes = append(v.Volumes, vol) + } + return nil + } + + return errors.New("Failed to unmarshal Volumes") +} diff --git a/vendor/github.com/mitchellh/mapstructure/.travis.yml b/vendor/github.com/mitchellh/mapstructure/.travis.yml new file mode 100644 index 000000000..7f3fe9a96 --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/.travis.yml @@ -0,0 +1,7 @@ +language: go + +go: + - 1.4 + +script: + - go test diff --git a/vendor/github.com/cloudfoundry-incubator/candiedyaml/libyaml-LICENSE b/vendor/github.com/mitchellh/mapstructure/LICENSE similarity index 52% rename from vendor/github.com/cloudfoundry-incubator/candiedyaml/libyaml-LICENSE rename to vendor/github.com/mitchellh/mapstructure/LICENSE index 050ced23f..f9c841a51 100644 --- a/vendor/github.com/cloudfoundry-incubator/candiedyaml/libyaml-LICENSE +++ b/vendor/github.com/mitchellh/mapstructure/LICENSE @@ -1,19 +1,21 @@ -Copyright (c) 2006 Kirill Simonov +The MIT License (MIT) -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: +Copyright (c) 2013 Mitchell Hashimoto -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/github.com/mitchellh/mapstructure/README.md b/vendor/github.com/mitchellh/mapstructure/README.md new file mode 100644 index 000000000..659d6885f --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/README.md @@ -0,0 +1,46 @@ +# mapstructure + +mapstructure is a Go library for decoding generic map values to structures +and vice versa, while providing helpful error handling. + +This library is most useful when decoding values from some data stream (JSON, +Gob, etc.) where you don't _quite_ know the structure of the underlying data +until you read a part of it. You can therefore read a `map[string]interface{}` +and use this library to decode it into the proper underlying native Go +structure. + +## Installation + +Standard `go get`: + +``` +$ go get github.com/mitchellh/mapstructure +``` + +## Usage & Example + +For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/mapstructure). + +The `Decode` function has examples associated with it there. + +## But Why?! + +Go offers fantastic standard libraries for decoding formats such as JSON. +The standard method is to have a struct pre-created, and populate that struct +from the bytes of the encoded format. This is great, but the problem is if +you have configuration or an encoding that changes slightly depending on +specific fields. For example, consider this JSON: + +```json +{ + "type": "person", + "name": "Mitchell" +} +``` + +Perhaps we can't populate a specific structure without first reading +the "type" field from the JSON. We could always do two passes over the +decoding of the JSON (reading the "type" first, and the rest later). +However, it is much simpler to just decode this into a `map[string]interface{}` +structure, read the "type" key, then use something like this library +to decode it into the proper structure. diff --git a/vendor/github.com/mitchellh/mapstructure/decode_hooks.go b/vendor/github.com/mitchellh/mapstructure/decode_hooks.go new file mode 100644 index 000000000..115ae67c1 --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/decode_hooks.go @@ -0,0 +1,154 @@ +package mapstructure + +import ( + "errors" + "reflect" + "strconv" + "strings" + "time" +) + +// typedDecodeHook takes a raw DecodeHookFunc (an interface{}) and turns +// it into the proper DecodeHookFunc type, such as DecodeHookFuncType. +func typedDecodeHook(h DecodeHookFunc) DecodeHookFunc { + // Create variables here so we can reference them with the reflect pkg + var f1 DecodeHookFuncType + var f2 DecodeHookFuncKind + + // Fill in the variables into this interface and the rest is done + // automatically using the reflect package. + potential := []interface{}{f1, f2} + + v := reflect.ValueOf(h) + vt := v.Type() + for _, raw := range potential { + pt := reflect.ValueOf(raw).Type() + if vt.ConvertibleTo(pt) { + return v.Convert(pt).Interface() + } + } + + return nil +} + +// DecodeHookExec executes the given decode hook. This should be used +// since it'll naturally degrade to the older backwards compatible DecodeHookFunc +// that took reflect.Kind instead of reflect.Type. +func DecodeHookExec( + raw DecodeHookFunc, + from reflect.Type, to reflect.Type, + data interface{}) (interface{}, error) { + // Build our arguments that reflect expects + argVals := make([]reflect.Value, 3) + argVals[0] = reflect.ValueOf(from) + argVals[1] = reflect.ValueOf(to) + argVals[2] = reflect.ValueOf(data) + + switch f := typedDecodeHook(raw).(type) { + case DecodeHookFuncType: + return f(from, to, data) + case DecodeHookFuncKind: + return f(from.Kind(), to.Kind(), data) + default: + return nil, errors.New("invalid decode hook signature") + } +} + +// ComposeDecodeHookFunc creates a single DecodeHookFunc that +// automatically composes multiple DecodeHookFuncs. +// +// The composed funcs are called in order, with the result of the +// previous transformation. +func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc { + return func( + f reflect.Type, + t reflect.Type, + data interface{}) (interface{}, error) { + var err error + for _, f1 := range fs { + data, err = DecodeHookExec(f1, f, t, data) + if err != nil { + return nil, err + } + + // Modify the from kind to be correct with the new data + f = nil + if val := reflect.ValueOf(data); val.IsValid() { + f = val.Type() + } + } + + return data, nil + } +} + +// StringToSliceHookFunc returns a DecodeHookFunc that converts +// string to []string by splitting on the given sep. +func StringToSliceHookFunc(sep string) DecodeHookFunc { + return func( + f reflect.Kind, + t reflect.Kind, + data interface{}) (interface{}, error) { + if f != reflect.String || t != reflect.Slice { + return data, nil + } + + raw := data.(string) + if raw == "" { + return []string{}, nil + } + + return strings.Split(raw, sep), nil + } +} + +// StringToTimeDurationHookFunc returns a DecodeHookFunc that converts +// strings to time.Duration. +func StringToTimeDurationHookFunc() DecodeHookFunc { + return func( + f reflect.Type, + t reflect.Type, + data interface{}) (interface{}, error) { + if f.Kind() != reflect.String { + return data, nil + } + if t != reflect.TypeOf(time.Duration(5)) { + return data, nil + } + + // Convert it by parsing + return time.ParseDuration(data.(string)) + } +} + +func WeaklyTypedHook( + f reflect.Kind, + t reflect.Kind, + data interface{}) (interface{}, error) { + dataVal := reflect.ValueOf(data) + switch t { + case reflect.String: + switch f { + case reflect.Bool: + if dataVal.Bool() { + return "1", nil + } else { + return "0", nil + } + case reflect.Float32: + return strconv.FormatFloat(dataVal.Float(), 'f', -1, 64), nil + case reflect.Int: + return strconv.FormatInt(dataVal.Int(), 10), nil + case reflect.Slice: + dataType := dataVal.Type() + elemKind := dataType.Elem().Kind() + if elemKind == reflect.Uint8 { + return string(dataVal.Interface().([]uint8)), nil + } + case reflect.Uint: + return strconv.FormatUint(dataVal.Uint(), 10), nil + } + } + + return data, nil +} diff --git a/vendor/github.com/mitchellh/mapstructure/error.go b/vendor/github.com/mitchellh/mapstructure/error.go new file mode 100644 index 000000000..47a99e5af --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/error.go @@ -0,0 +1,50 @@ +package mapstructure + +import ( + "errors" + "fmt" + "sort" + "strings" +) + +// Error implements the error interface and can represents multiple +// errors that occur in the course of a single decode. +type Error struct { + Errors []string +} + +func (e *Error) Error() string { + points := make([]string, len(e.Errors)) + for i, err := range e.Errors { + points[i] = fmt.Sprintf("* %s", err) + } + + sort.Strings(points) + return fmt.Sprintf( + "%d error(s) decoding:\n\n%s", + len(e.Errors), strings.Join(points, "\n")) +} + +// WrappedErrors implements the errwrap.Wrapper interface to make this +// return value more useful with the errwrap and go-multierror libraries. +func (e *Error) WrappedErrors() []error { + if e == nil { + return nil + } + + result := make([]error, len(e.Errors)) + for i, e := range e.Errors { + result[i] = errors.New(e) + } + + return result +} + +func appendErrors(errors []string, err error) []string { + switch e := err.(type) { + case *Error: + return append(errors, e.Errors...) + default: + return append(errors, e.Error()) + } +} diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go new file mode 100644 index 000000000..a554e799b --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go @@ -0,0 +1,790 @@ +// The mapstructure package exposes functionality to convert an +// abitrary map[string]interface{} into a native Go structure. +// +// The Go structure can be arbitrarily complex, containing slices, +// other structs, etc. and the decoder will properly decode nested +// maps and so on into the proper structures in the native Go struct. +// See the examples to see what the decoder is capable of. +package mapstructure + +import ( + "encoding/json" + "errors" + "fmt" + "reflect" + "sort" + "strconv" + "strings" +) + +// DecodeHookFunc is the callback function that can be used for +// data transformations. See "DecodeHook" in the DecoderConfig +// struct. +// +// The type should be DecodeHookFuncType or DecodeHookFuncKind. +// Either is accepted. Types are a superset of Kinds (Types can return +// Kinds) and are generally a richer thing to use, but Kinds are simpler +// if you only need those. +// +// The reason DecodeHookFunc is multi-typed is for backwards compatibility: +// we started with Kinds and then realized Types were the better solution, +// but have a promise to not break backwards compat so we now support +// both. +type DecodeHookFunc interface{} + +type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface{}, error) +type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) + +// DecoderConfig is the configuration that is used to create a new decoder +// and allows customization of various aspects of decoding. +type DecoderConfig struct { + // DecodeHook, if set, will be called before any decoding and any + // type conversion (if WeaklyTypedInput is on). This lets you modify + // the values before they're set down onto the resulting struct. + // + // If an error is returned, the entire decode will fail with that + // error. + DecodeHook DecodeHookFunc + + // If ErrorUnused is true, then it is an error for there to exist + // keys in the original map that were unused in the decoding process + // (extra keys). + ErrorUnused bool + + // ZeroFields, if set to true, will zero fields before writing them. + // For example, a map will be emptied before decoded values are put in + // it. If this is false, a map will be merged. + ZeroFields bool + + // If WeaklyTypedInput is true, the decoder will make the following + // "weak" conversions: + // + // - bools to string (true = "1", false = "0") + // - numbers to string (base 10) + // - bools to int/uint (true = 1, false = 0) + // - strings to int/uint (base implied by prefix) + // - int to bool (true if value != 0) + // - string to bool (accepts: 1, t, T, TRUE, true, True, 0, f, F, + // FALSE, false, False. Anything else is an error) + // - empty array = empty map and vice versa + // - negative numbers to overflowed uint values (base 10) + // - slice of maps to a merged map + // + WeaklyTypedInput bool + + // Metadata is the struct that will contain extra metadata about + // the decoding. If this is nil, then no metadata will be tracked. + Metadata *Metadata + + // Result is a pointer to the struct that will contain the decoded + // value. + Result interface{} + + // The tag name that mapstructure reads for field names. This + // defaults to "mapstructure" + TagName string +} + +// A Decoder takes a raw interface value and turns it into structured +// data, keeping track of rich error information along the way in case +// anything goes wrong. Unlike the basic top-level Decode method, you can +// more finely control how the Decoder behaves using the DecoderConfig +// structure. The top-level Decode method is just a convenience that sets +// up the most basic Decoder. +type Decoder struct { + config *DecoderConfig +} + +// Metadata contains information about decoding a structure that +// is tedious or difficult to get otherwise. +type Metadata struct { + // Keys are the keys of the structure which were successfully decoded + Keys []string + + // Unused is a slice of keys that were found in the raw value but + // weren't decoded since there was no matching field in the result interface + Unused []string +} + +// Decode takes a map and uses reflection to convert it into the +// given Go native structure. val must be a pointer to a struct. +func Decode(m interface{}, rawVal interface{}) error { + config := &DecoderConfig{ + Metadata: nil, + Result: rawVal, + } + + decoder, err := NewDecoder(config) + if err != nil { + return err + } + + return decoder.Decode(m) +} + +// WeakDecode is the same as Decode but is shorthand to enable +// WeaklyTypedInput. See DecoderConfig for more info. +func WeakDecode(input, output interface{}) error { + config := &DecoderConfig{ + Metadata: nil, + Result: output, + WeaklyTypedInput: true, + } + + decoder, err := NewDecoder(config) + if err != nil { + return err + } + + return decoder.Decode(input) +} + +// NewDecoder returns a new decoder for the given configuration. Once +// a decoder has been returned, the same configuration must not be used +// again. +func NewDecoder(config *DecoderConfig) (*Decoder, error) { + val := reflect.ValueOf(config.Result) + if val.Kind() != reflect.Ptr { + return nil, errors.New("result must be a pointer") + } + + val = val.Elem() + if !val.CanAddr() { + return nil, errors.New("result must be addressable (a pointer)") + } + + if config.Metadata != nil { + if config.Metadata.Keys == nil { + config.Metadata.Keys = make([]string, 0) + } + + if config.Metadata.Unused == nil { + config.Metadata.Unused = make([]string, 0) + } + } + + if config.TagName == "" { + config.TagName = "mapstructure" + } + + result := &Decoder{ + config: config, + } + + return result, nil +} + +// Decode decodes the given raw interface to the target pointer specified +// by the configuration. +func (d *Decoder) Decode(raw interface{}) error { + return d.decode("", raw, reflect.ValueOf(d.config.Result).Elem()) +} + +// Decodes an unknown data type into a specific reflection value. +func (d *Decoder) decode(name string, data interface{}, val reflect.Value) error { + if data == nil { + // If the data is nil, then we don't set anything. + return nil + } + + dataVal := reflect.ValueOf(data) + if !dataVal.IsValid() { + // If the data value is invalid, then we just set the value + // to be the zero value. + val.Set(reflect.Zero(val.Type())) + return nil + } + + if d.config.DecodeHook != nil { + // We have a DecodeHook, so let's pre-process the data. + var err error + data, err = DecodeHookExec( + d.config.DecodeHook, + dataVal.Type(), val.Type(), data) + if err != nil { + return err + } + } + + var err error + dataKind := getKind(val) + switch dataKind { + case reflect.Bool: + err = d.decodeBool(name, data, val) + case reflect.Interface: + err = d.decodeBasic(name, data, val) + case reflect.String: + err = d.decodeString(name, data, val) + case reflect.Int: + err = d.decodeInt(name, data, val) + case reflect.Uint: + err = d.decodeUint(name, data, val) + case reflect.Float32: + err = d.decodeFloat(name, data, val) + case reflect.Struct: + err = d.decodeStruct(name, data, val) + case reflect.Map: + err = d.decodeMap(name, data, val) + case reflect.Ptr: + err = d.decodePtr(name, data, val) + case reflect.Slice: + err = d.decodeSlice(name, data, val) + default: + // If we reached this point then we weren't able to decode it + return fmt.Errorf("%s: unsupported type: %s", name, dataKind) + } + + // If we reached here, then we successfully decoded SOMETHING, so + // mark the key as used if we're tracking metadata. + if d.config.Metadata != nil && name != "" { + d.config.Metadata.Keys = append(d.config.Metadata.Keys, name) + } + + return err +} + +// This decodes a basic type (bool, int, string, etc.) and sets the +// value to "data" of that type. +func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + if !dataVal.IsValid() { + dataVal = reflect.Zero(val.Type()) + } + + dataValType := dataVal.Type() + if !dataValType.AssignableTo(val.Type()) { + return fmt.Errorf( + "'%s' expected type '%s', got '%s'", + name, val.Type(), dataValType) + } + + val.Set(dataVal) + return nil +} + +func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + + converted := true + switch { + case dataKind == reflect.String: + val.SetString(dataVal.String()) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetString("1") + } else { + val.SetString("0") + } + case dataKind == reflect.Int && d.config.WeaklyTypedInput: + val.SetString(strconv.FormatInt(dataVal.Int(), 10)) + case dataKind == reflect.Uint && d.config.WeaklyTypedInput: + val.SetString(strconv.FormatUint(dataVal.Uint(), 10)) + case dataKind == reflect.Float32 && d.config.WeaklyTypedInput: + val.SetString(strconv.FormatFloat(dataVal.Float(), 'f', -1, 64)) + case dataKind == reflect.Slice && d.config.WeaklyTypedInput: + dataType := dataVal.Type() + elemKind := dataType.Elem().Kind() + switch { + case elemKind == reflect.Uint8: + val.SetString(string(dataVal.Interface().([]uint8))) + default: + converted = false + } + default: + converted = false + } + + if !converted { + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + dataType := dataVal.Type() + + switch { + case dataKind == reflect.Int: + val.SetInt(dataVal.Int()) + case dataKind == reflect.Uint: + val.SetInt(int64(dataVal.Uint())) + case dataKind == reflect.Float32: + val.SetInt(int64(dataVal.Float())) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetInt(1) + } else { + val.SetInt(0) + } + case dataKind == reflect.String && d.config.WeaklyTypedInput: + i, err := strconv.ParseInt(dataVal.String(), 0, val.Type().Bits()) + if err == nil { + val.SetInt(i) + } else { + return fmt.Errorf("cannot parse '%s' as int: %s", name, err) + } + case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": + jn := data.(json.Number) + i, err := jn.Int64() + if err != nil { + return fmt.Errorf( + "error decoding json.Number into %s: %s", name, err) + } + val.SetInt(i) + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + + switch { + case dataKind == reflect.Int: + i := dataVal.Int() + if i < 0 && !d.config.WeaklyTypedInput { + return fmt.Errorf("cannot parse '%s', %d overflows uint", + name, i) + } + val.SetUint(uint64(i)) + case dataKind == reflect.Uint: + val.SetUint(dataVal.Uint()) + case dataKind == reflect.Float32: + f := dataVal.Float() + if f < 0 && !d.config.WeaklyTypedInput { + return fmt.Errorf("cannot parse '%s', %f overflows uint", + name, f) + } + val.SetUint(uint64(f)) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetUint(1) + } else { + val.SetUint(0) + } + case dataKind == reflect.String && d.config.WeaklyTypedInput: + i, err := strconv.ParseUint(dataVal.String(), 0, val.Type().Bits()) + if err == nil { + val.SetUint(i) + } else { + return fmt.Errorf("cannot parse '%s' as uint: %s", name, err) + } + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + + switch { + case dataKind == reflect.Bool: + val.SetBool(dataVal.Bool()) + case dataKind == reflect.Int && d.config.WeaklyTypedInput: + val.SetBool(dataVal.Int() != 0) + case dataKind == reflect.Uint && d.config.WeaklyTypedInput: + val.SetBool(dataVal.Uint() != 0) + case dataKind == reflect.Float32 && d.config.WeaklyTypedInput: + val.SetBool(dataVal.Float() != 0) + case dataKind == reflect.String && d.config.WeaklyTypedInput: + b, err := strconv.ParseBool(dataVal.String()) + if err == nil { + val.SetBool(b) + } else if dataVal.String() == "" { + val.SetBool(false) + } else { + return fmt.Errorf("cannot parse '%s' as bool: %s", name, err) + } + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + dataType := dataVal.Type() + + switch { + case dataKind == reflect.Int: + val.SetFloat(float64(dataVal.Int())) + case dataKind == reflect.Uint: + val.SetFloat(float64(dataVal.Uint())) + case dataKind == reflect.Float32: + val.SetFloat(float64(dataVal.Float())) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetFloat(1) + } else { + val.SetFloat(0) + } + case dataKind == reflect.String && d.config.WeaklyTypedInput: + f, err := strconv.ParseFloat(dataVal.String(), val.Type().Bits()) + if err == nil { + val.SetFloat(f) + } else { + return fmt.Errorf("cannot parse '%s' as float: %s", name, err) + } + case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": + jn := data.(json.Number) + i, err := jn.Float64() + if err != nil { + return fmt.Errorf( + "error decoding json.Number into %s: %s", name, err) + } + val.SetFloat(i) + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeMap(name string, data interface{}, val reflect.Value) error { + valType := val.Type() + valKeyType := valType.Key() + valElemType := valType.Elem() + + // By default we overwrite keys in the current map + valMap := val + + // If the map is nil or we're purposely zeroing fields, make a new map + if valMap.IsNil() || d.config.ZeroFields { + // Make a new map to hold our result + mapType := reflect.MapOf(valKeyType, valElemType) + valMap = reflect.MakeMap(mapType) + } + + // Check input type + dataVal := reflect.Indirect(reflect.ValueOf(data)) + if dataVal.Kind() != reflect.Map { + // In weak mode, we accept a slice of maps as an input... + if d.config.WeaklyTypedInput { + switch dataVal.Kind() { + case reflect.Array, reflect.Slice: + // Special case for BC reasons (covered by tests) + if dataVal.Len() == 0 { + val.Set(valMap) + return nil + } + + for i := 0; i < dataVal.Len(); i++ { + err := d.decode( + fmt.Sprintf("%s[%d]", name, i), + dataVal.Index(i).Interface(), val) + if err != nil { + return err + } + } + + return nil + } + } + + return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind()) + } + + // Accumulate errors + errors := make([]string, 0) + + for _, k := range dataVal.MapKeys() { + fieldName := fmt.Sprintf("%s[%s]", name, k) + + // First decode the key into the proper type + currentKey := reflect.Indirect(reflect.New(valKeyType)) + if err := d.decode(fieldName, k.Interface(), currentKey); err != nil { + errors = appendErrors(errors, err) + continue + } + + // Next decode the data into the proper type + v := dataVal.MapIndex(k).Interface() + currentVal := reflect.Indirect(reflect.New(valElemType)) + if err := d.decode(fieldName, v, currentVal); err != nil { + errors = appendErrors(errors, err) + continue + } + + valMap.SetMapIndex(currentKey, currentVal) + } + + // Set the built up map to the value + val.Set(valMap) + + // If we had errors, return those + if len(errors) > 0 { + return &Error{errors} + } + + return nil +} + +func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) error { + // Create an element of the concrete (non pointer) type and decode + // into that. Then set the value of the pointer to this type. + valType := val.Type() + valElemType := valType.Elem() + realVal := reflect.New(valElemType) + if err := d.decode(name, data, reflect.Indirect(realVal)); err != nil { + return err + } + + val.Set(realVal) + return nil +} + +func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.Indirect(reflect.ValueOf(data)) + dataValKind := dataVal.Kind() + valType := val.Type() + valElemType := valType.Elem() + sliceType := reflect.SliceOf(valElemType) + + // Check input type + if dataValKind != reflect.Array && dataValKind != reflect.Slice { + // Accept empty map instead of array/slice in weakly typed mode + if d.config.WeaklyTypedInput && dataVal.Kind() == reflect.Map && dataVal.Len() == 0 { + val.Set(reflect.MakeSlice(sliceType, 0, 0)) + return nil + } else { + return fmt.Errorf( + "'%s': source data must be an array or slice, got %s", name, dataValKind) + } + } + + // Make a new slice to hold our result, same size as the original data. + valSlice := reflect.MakeSlice(sliceType, dataVal.Len(), dataVal.Len()) + + // Accumulate any errors + errors := make([]string, 0) + + for i := 0; i < dataVal.Len(); i++ { + currentData := dataVal.Index(i).Interface() + currentField := valSlice.Index(i) + + fieldName := fmt.Sprintf("%s[%d]", name, i) + if err := d.decode(fieldName, currentData, currentField); err != nil { + errors = appendErrors(errors, err) + } + } + + // Finally, set the value to the slice we built up + val.Set(valSlice) + + // If there were errors, we return those + if len(errors) > 0 { + return &Error{errors} + } + + return nil +} + +func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.Indirect(reflect.ValueOf(data)) + + // If the type of the value to write to and the data match directly, + // then we just set it directly instead of recursing into the structure. + if dataVal.Type() == val.Type() { + val.Set(dataVal) + return nil + } + + dataValKind := dataVal.Kind() + if dataValKind != reflect.Map { + return fmt.Errorf("'%s' expected a map, got '%s'", name, dataValKind) + } + + dataValType := dataVal.Type() + if kind := dataValType.Key().Kind(); kind != reflect.String && kind != reflect.Interface { + return fmt.Errorf( + "'%s' needs a map with string keys, has '%s' keys", + name, dataValType.Key().Kind()) + } + + dataValKeys := make(map[reflect.Value]struct{}) + dataValKeysUnused := make(map[interface{}]struct{}) + for _, dataValKey := range dataVal.MapKeys() { + dataValKeys[dataValKey] = struct{}{} + dataValKeysUnused[dataValKey.Interface()] = struct{}{} + } + + errors := make([]string, 0) + + // This slice will keep track of all the structs we'll be decoding. + // There can be more than one struct if there are embedded structs + // that are squashed. + structs := make([]reflect.Value, 1, 5) + structs[0] = val + + // Compile the list of all the fields that we're going to be decoding + // from all the structs. + fields := make(map[*reflect.StructField]reflect.Value) + for len(structs) > 0 { + structVal := structs[0] + structs = structs[1:] + + structType := structVal.Type() + + for i := 0; i < structType.NumField(); i++ { + fieldType := structType.Field(i) + fieldKind := fieldType.Type.Kind() + + if fieldType.Anonymous { + if fieldKind != reflect.Struct { + errors = appendErrors(errors, + fmt.Errorf("%s: unsupported type: %s", fieldType.Name, fieldKind)) + continue + } + } + + // If "squash" is specified in the tag, we squash the field down. + squash := false + tagParts := strings.Split(fieldType.Tag.Get(d.config.TagName), ",") + for _, tag := range tagParts[1:] { + if tag == "squash" { + squash = true + break + } + } + + if squash { + if fieldKind != reflect.Struct { + errors = appendErrors(errors, + fmt.Errorf("%s: unsupported type for squash: %s", fieldType.Name, fieldKind)) + } else { + structs = append(structs, val.FieldByName(fieldType.Name)) + } + continue + } + + // Normal struct field, store it away + fields[&fieldType] = structVal.Field(i) + } + } + + for fieldType, field := range fields { + fieldName := fieldType.Name + + tagValue := fieldType.Tag.Get(d.config.TagName) + tagValue = strings.SplitN(tagValue, ",", 2)[0] + if tagValue != "" { + fieldName = tagValue + } + + rawMapKey := reflect.ValueOf(fieldName) + rawMapVal := dataVal.MapIndex(rawMapKey) + if !rawMapVal.IsValid() { + // Do a slower search by iterating over each key and + // doing case-insensitive search. + for dataValKey, _ := range dataValKeys { + mK, ok := dataValKey.Interface().(string) + if !ok { + // Not a string key + continue + } + + if strings.EqualFold(mK, fieldName) { + rawMapKey = dataValKey + rawMapVal = dataVal.MapIndex(dataValKey) + break + } + } + + if !rawMapVal.IsValid() { + // There was no matching key in the map for the value in + // the struct. Just ignore. + continue + } + } + + // Delete the key we're using from the unused map so we stop tracking + delete(dataValKeysUnused, rawMapKey.Interface()) + + if !field.IsValid() { + // This should never happen + panic("field is not valid") + } + + // If we can't set the field, then it is unexported or something, + // and we just continue onwards. + if !field.CanSet() { + continue + } + + // If the name is empty string, then we're at the root, and we + // don't dot-join the fields. + if name != "" { + fieldName = fmt.Sprintf("%s.%s", name, fieldName) + } + + if err := d.decode(fieldName, rawMapVal.Interface(), field); err != nil { + errors = appendErrors(errors, err) + } + } + + if d.config.ErrorUnused && len(dataValKeysUnused) > 0 { + keys := make([]string, 0, len(dataValKeysUnused)) + for rawKey, _ := range dataValKeysUnused { + keys = append(keys, rawKey.(string)) + } + sort.Strings(keys) + + err := fmt.Errorf("'%s' has invalid keys: %s", name, strings.Join(keys, ", ")) + errors = appendErrors(errors, err) + } + + if len(errors) > 0 { + return &Error{errors} + } + + // Add the unused keys to the list of unused keys if we're tracking metadata + if d.config.Metadata != nil { + for rawKey, _ := range dataValKeysUnused { + key := rawKey.(string) + if name != "" { + key = fmt.Sprintf("%s.%s", name, key) + } + + d.config.Metadata.Unused = append(d.config.Metadata.Unused, key) + } + } + + return nil +} + +func getKind(val reflect.Value) reflect.Kind { + kind := val.Kind() + + switch { + case kind >= reflect.Int && kind <= reflect.Int64: + return reflect.Int + case kind >= reflect.Uint && kind <= reflect.Uint64: + return reflect.Uint + case kind >= reflect.Float32 && kind <= reflect.Float64: + return reflect.Float32 + default: + return kind + } +} diff --git a/vendor/github.com/rancher/go-rancher/catalog/common.go b/vendor/github.com/rancher/go-rancher/catalog/common.go index 01c28d780..d5839e5c6 100644 --- a/vendor/github.com/rancher/go-rancher/catalog/common.go +++ b/vendor/github.com/rancher/go-rancher/catalog/common.go @@ -3,7 +3,6 @@ package catalog import ( "bytes" "encoding/json" - "errors" "fmt" "io" "io/ioutil" @@ -11,10 +10,10 @@ import ( "net/url" "os" "regexp" - "time" "github.com/gorilla/websocket" + "github.com/pkg/errors" ) const ( @@ -116,7 +115,13 @@ func appendFilters(urlString string, filters map[string]interface{}) (string, er q := u.Query() for k, v := range filters { - q.Add(k, fmt.Sprintf("%v", v)) + if l, ok := v.([]string); ok { + for _, v := range l { + q.Add(k, v) + } + } else { + q.Add(k, fmt.Sprintf("%v", v)) + } } u.RawQuery = q.Encode() @@ -277,7 +282,11 @@ func (rancherClient *RancherBaseClient) doGet(url string, opts *ListOpts, respOb fmt.Println("Response <= " + string(byteContent)) } - return json.Unmarshal(byteContent, respObject) + if err := json.Unmarshal(byteContent, respObject); err != nil { + return errors.Wrap(err, fmt.Sprintf("Failed to parse: %s", byteContent)) + } + + return nil } func (rancherClient *RancherBaseClient) List(schemaType string, opts *ListOpts, respObject interface{}) error { @@ -486,6 +495,11 @@ func (rancherClient *RancherBaseClient) Reload(existing *Resource, output interf return rancherClient.doGet(selfUrl, NewListOpts(), output) } +func (rancherClient *RancherBaseClient) Action(schemaType string, action string, + existing *Resource, inputObject, respObject interface{}) error { + return rancherClient.doAction(schemaType, action, existing, inputObject, respObject) +} + func (rancherClient *RancherBaseClient) doAction(schemaType string, action string, existing *Resource, inputObject, respObject interface{}) error { diff --git a/vendor/github.com/rancher/go-rancher/catalog/generated_catalog.go b/vendor/github.com/rancher/go-rancher/catalog/generated_catalog.go index dcc2338e7..97fa356ab 100644 --- a/vendor/github.com/rancher/go-rancher/catalog/generated_catalog.go +++ b/vendor/github.com/rancher/go-rancher/catalog/generated_catalog.go @@ -9,6 +9,8 @@ type Catalog struct { Actions map[string]interface{} `json:"actions,omitempty" yaml:"actions,omitempty"` + Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` + CatalogRoot string `json:"catalogRoot,omitempty" yaml:"catalog_root,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/catalog/generated_template.go b/vendor/github.com/rancher/go-rancher/catalog/generated_template.go index 5fb22e224..613e5408d 100644 --- a/vendor/github.com/rancher/go-rancher/catalog/generated_template.go +++ b/vendor/github.com/rancher/go-rancher/catalog/generated_template.go @@ -21,6 +21,8 @@ type Template struct { IsSystem string `json:"isSystem,omitempty" yaml:"is_system,omitempty"` + Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + License string `json:"license,omitempty" yaml:"license,omitempty"` Links map[string]interface{} `json:"links,omitempty" yaml:"links,omitempty"` @@ -39,6 +41,8 @@ type Template struct { Type string `json:"type,omitempty" yaml:"type,omitempty"` + UpgradeFrom string `json:"upgradeFrom,omitempty" yaml:"upgrade_from,omitempty"` + UpgradeVersionLinks map[string]interface{} `json:"upgradeVersionLinks,omitempty" yaml:"upgrade_version_links,omitempty"` VersionLinks map[string]interface{} `json:"versionLinks,omitempty" yaml:"version_links,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/catalog/generated_template_version.go b/vendor/github.com/rancher/go-rancher/catalog/generated_template_version.go index e23009f95..c39523168 100644 --- a/vendor/github.com/rancher/go-rancher/catalog/generated_template_version.go +++ b/vendor/github.com/rancher/go-rancher/catalog/generated_template_version.go @@ -23,6 +23,8 @@ type TemplateVersion struct { IsSystem string `json:"isSystem,omitempty" yaml:"is_system,omitempty"` + Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + License string `json:"license,omitempty" yaml:"license,omitempty"` Links map[string]interface{} `json:"links,omitempty" yaml:"links,omitempty"` @@ -47,6 +49,8 @@ type TemplateVersion struct { Type string `json:"type,omitempty" yaml:"type,omitempty"` + UpgradeFrom string `json:"upgradeFrom,omitempty" yaml:"upgrade_from,omitempty"` + UpgradeVersionLinks map[string]interface{} `json:"upgradeVersionLinks,omitempty" yaml:"upgrade_version_links,omitempty"` Version string `json:"version,omitempty" yaml:"version,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/client/generated_add_label_input.go b/vendor/github.com/rancher/go-rancher/client/generated_add_label_input.go deleted file mode 100644 index 97afedd0f..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_add_label_input.go +++ /dev/null @@ -1,64 +0,0 @@ -package client - -const ( - ADD_LABEL_INPUT_TYPE = "addLabelInput" -) - -type AddLabelInput struct { - Resource - - Key string `json:"key,omitempty"` - - Value string `json:"value,omitempty"` -} - -type AddLabelInputCollection struct { - Collection - Data []AddLabelInput `json:"data,omitempty"` -} - -type AddLabelInputClient struct { - rancherClient *RancherClient -} - -type AddLabelInputOperations interface { - List(opts *ListOpts) (*AddLabelInputCollection, error) - Create(opts *AddLabelInput) (*AddLabelInput, error) - Update(existing *AddLabelInput, updates interface{}) (*AddLabelInput, error) - ById(id string) (*AddLabelInput, error) - Delete(container *AddLabelInput) error -} - -func newAddLabelInputClient(rancherClient *RancherClient) *AddLabelInputClient { - return &AddLabelInputClient{ - rancherClient: rancherClient, - } -} - -func (c *AddLabelInputClient) Create(container *AddLabelInput) (*AddLabelInput, error) { - resp := &AddLabelInput{} - err := c.rancherClient.doCreate(ADD_LABEL_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *AddLabelInputClient) Update(existing *AddLabelInput, updates interface{}) (*AddLabelInput, error) { - resp := &AddLabelInput{} - err := c.rancherClient.doUpdate(ADD_LABEL_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AddLabelInputClient) List(opts *ListOpts) (*AddLabelInputCollection, error) { - resp := &AddLabelInputCollection{} - err := c.rancherClient.doList(ADD_LABEL_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *AddLabelInputClient) ById(id string) (*AddLabelInput, error) { - resp := &AddLabelInput{} - err := c.rancherClient.doById(ADD_LABEL_INPUT_TYPE, id, resp) - return resp, err -} - -func (c *AddLabelInputClient) Delete(container *AddLabelInput) error { - return c.rancherClient.doResourceDelete(ADD_LABEL_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_add_load_balancer_input.go b/vendor/github.com/rancher/go-rancher/client/generated_add_load_balancer_input.go deleted file mode 100644 index 1afdbadae..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_add_load_balancer_input.go +++ /dev/null @@ -1,69 +0,0 @@ -package client - -const ( - ADD_LOAD_BALANCER_INPUT_TYPE = "addLoadBalancerInput" -) - -type AddLoadBalancerInput struct { - Resource - - LoadBalancerId string `json:"loadBalancerId,omitempty" yaml:"load_balancer_id,omitempty"` - - Weight int64 `json:"weight,omitempty" yaml:"weight,omitempty"` -} - -type AddLoadBalancerInputCollection struct { - Collection - Data []AddLoadBalancerInput `json:"data,omitempty"` -} - -type AddLoadBalancerInputClient struct { - rancherClient *RancherClient -} - -type AddLoadBalancerInputOperations interface { - List(opts *ListOpts) (*AddLoadBalancerInputCollection, error) - Create(opts *AddLoadBalancerInput) (*AddLoadBalancerInput, error) - Update(existing *AddLoadBalancerInput, updates interface{}) (*AddLoadBalancerInput, error) - ById(id string) (*AddLoadBalancerInput, error) - Delete(container *AddLoadBalancerInput) error -} - -func newAddLoadBalancerInputClient(rancherClient *RancherClient) *AddLoadBalancerInputClient { - return &AddLoadBalancerInputClient{ - rancherClient: rancherClient, - } -} - -func (c *AddLoadBalancerInputClient) Create(container *AddLoadBalancerInput) (*AddLoadBalancerInput, error) { - resp := &AddLoadBalancerInput{} - err := c.rancherClient.doCreate(ADD_LOAD_BALANCER_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *AddLoadBalancerInputClient) Update(existing *AddLoadBalancerInput, updates interface{}) (*AddLoadBalancerInput, error) { - resp := &AddLoadBalancerInput{} - err := c.rancherClient.doUpdate(ADD_LOAD_BALANCER_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AddLoadBalancerInputClient) List(opts *ListOpts) (*AddLoadBalancerInputCollection, error) { - resp := &AddLoadBalancerInputCollection{} - err := c.rancherClient.doList(ADD_LOAD_BALANCER_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *AddLoadBalancerInputClient) ById(id string) (*AddLoadBalancerInput, error) { - resp := &AddLoadBalancerInput{} - err := c.rancherClient.doById(ADD_LOAD_BALANCER_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AddLoadBalancerInputClient) Delete(container *AddLoadBalancerInput) error { - return c.rancherClient.doResourceDelete(ADD_LOAD_BALANCER_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_cluster_host_input.go b/vendor/github.com/rancher/go-rancher/client/generated_add_remove_cluster_host_input.go deleted file mode 100644 index 09d79e6ad..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_cluster_host_input.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -const ( - ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE = "addRemoveClusterHostInput" -) - -type AddRemoveClusterHostInput struct { - Resource - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` -} - -type AddRemoveClusterHostInputCollection struct { - Collection - Data []AddRemoveClusterHostInput `json:"data,omitempty"` -} - -type AddRemoveClusterHostInputClient struct { - rancherClient *RancherClient -} - -type AddRemoveClusterHostInputOperations interface { - List(opts *ListOpts) (*AddRemoveClusterHostInputCollection, error) - Create(opts *AddRemoveClusterHostInput) (*AddRemoveClusterHostInput, error) - Update(existing *AddRemoveClusterHostInput, updates interface{}) (*AddRemoveClusterHostInput, error) - ById(id string) (*AddRemoveClusterHostInput, error) - Delete(container *AddRemoveClusterHostInput) error -} - -func newAddRemoveClusterHostInputClient(rancherClient *RancherClient) *AddRemoveClusterHostInputClient { - return &AddRemoveClusterHostInputClient{ - rancherClient: rancherClient, - } -} - -func (c *AddRemoveClusterHostInputClient) Create(container *AddRemoveClusterHostInput) (*AddRemoveClusterHostInput, error) { - resp := &AddRemoveClusterHostInput{} - err := c.rancherClient.doCreate(ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *AddRemoveClusterHostInputClient) Update(existing *AddRemoveClusterHostInput, updates interface{}) (*AddRemoveClusterHostInput, error) { - resp := &AddRemoveClusterHostInput{} - err := c.rancherClient.doUpdate(ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AddRemoveClusterHostInputClient) List(opts *ListOpts) (*AddRemoveClusterHostInputCollection, error) { - resp := &AddRemoveClusterHostInputCollection{} - err := c.rancherClient.doList(ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *AddRemoveClusterHostInputClient) ById(id string) (*AddRemoveClusterHostInput, error) { - resp := &AddRemoveClusterHostInput{} - err := c.rancherClient.doById(ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AddRemoveClusterHostInputClient) Delete(container *AddRemoveClusterHostInput) error { - return c.rancherClient.doResourceDelete(ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_host_input.go b/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_host_input.go deleted file mode 100644 index 39a7d1759..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_host_input.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -const ( - ADD_REMOVE_LOAD_BALANCER_HOST_INPUT_TYPE = "addRemoveLoadBalancerHostInput" -) - -type AddRemoveLoadBalancerHostInput struct { - Resource - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` -} - -type AddRemoveLoadBalancerHostInputCollection struct { - Collection - Data []AddRemoveLoadBalancerHostInput `json:"data,omitempty"` -} - -type AddRemoveLoadBalancerHostInputClient struct { - rancherClient *RancherClient -} - -type AddRemoveLoadBalancerHostInputOperations interface { - List(opts *ListOpts) (*AddRemoveLoadBalancerHostInputCollection, error) - Create(opts *AddRemoveLoadBalancerHostInput) (*AddRemoveLoadBalancerHostInput, error) - Update(existing *AddRemoveLoadBalancerHostInput, updates interface{}) (*AddRemoveLoadBalancerHostInput, error) - ById(id string) (*AddRemoveLoadBalancerHostInput, error) - Delete(container *AddRemoveLoadBalancerHostInput) error -} - -func newAddRemoveLoadBalancerHostInputClient(rancherClient *RancherClient) *AddRemoveLoadBalancerHostInputClient { - return &AddRemoveLoadBalancerHostInputClient{ - rancherClient: rancherClient, - } -} - -func (c *AddRemoveLoadBalancerHostInputClient) Create(container *AddRemoveLoadBalancerHostInput) (*AddRemoveLoadBalancerHostInput, error) { - resp := &AddRemoveLoadBalancerHostInput{} - err := c.rancherClient.doCreate(ADD_REMOVE_LOAD_BALANCER_HOST_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *AddRemoveLoadBalancerHostInputClient) Update(existing *AddRemoveLoadBalancerHostInput, updates interface{}) (*AddRemoveLoadBalancerHostInput, error) { - resp := &AddRemoveLoadBalancerHostInput{} - err := c.rancherClient.doUpdate(ADD_REMOVE_LOAD_BALANCER_HOST_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AddRemoveLoadBalancerHostInputClient) List(opts *ListOpts) (*AddRemoveLoadBalancerHostInputCollection, error) { - resp := &AddRemoveLoadBalancerHostInputCollection{} - err := c.rancherClient.doList(ADD_REMOVE_LOAD_BALANCER_HOST_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *AddRemoveLoadBalancerHostInputClient) ById(id string) (*AddRemoveLoadBalancerHostInput, error) { - resp := &AddRemoveLoadBalancerHostInput{} - err := c.rancherClient.doById(ADD_REMOVE_LOAD_BALANCER_HOST_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AddRemoveLoadBalancerHostInputClient) Delete(container *AddRemoveLoadBalancerHostInput) error { - return c.rancherClient.doResourceDelete(ADD_REMOVE_LOAD_BALANCER_HOST_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_listener_input.go b/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_listener_input.go deleted file mode 100644 index df5a7195d..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_listener_input.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -const ( - ADD_REMOVE_LOAD_BALANCER_LISTENER_INPUT_TYPE = "addRemoveLoadBalancerListenerInput" -) - -type AddRemoveLoadBalancerListenerInput struct { - Resource - - LoadBalancerListenerId string `json:"loadBalancerListenerId,omitempty" yaml:"load_balancer_listener_id,omitempty"` -} - -type AddRemoveLoadBalancerListenerInputCollection struct { - Collection - Data []AddRemoveLoadBalancerListenerInput `json:"data,omitempty"` -} - -type AddRemoveLoadBalancerListenerInputClient struct { - rancherClient *RancherClient -} - -type AddRemoveLoadBalancerListenerInputOperations interface { - List(opts *ListOpts) (*AddRemoveLoadBalancerListenerInputCollection, error) - Create(opts *AddRemoveLoadBalancerListenerInput) (*AddRemoveLoadBalancerListenerInput, error) - Update(existing *AddRemoveLoadBalancerListenerInput, updates interface{}) (*AddRemoveLoadBalancerListenerInput, error) - ById(id string) (*AddRemoveLoadBalancerListenerInput, error) - Delete(container *AddRemoveLoadBalancerListenerInput) error -} - -func newAddRemoveLoadBalancerListenerInputClient(rancherClient *RancherClient) *AddRemoveLoadBalancerListenerInputClient { - return &AddRemoveLoadBalancerListenerInputClient{ - rancherClient: rancherClient, - } -} - -func (c *AddRemoveLoadBalancerListenerInputClient) Create(container *AddRemoveLoadBalancerListenerInput) (*AddRemoveLoadBalancerListenerInput, error) { - resp := &AddRemoveLoadBalancerListenerInput{} - err := c.rancherClient.doCreate(ADD_REMOVE_LOAD_BALANCER_LISTENER_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *AddRemoveLoadBalancerListenerInputClient) Update(existing *AddRemoveLoadBalancerListenerInput, updates interface{}) (*AddRemoveLoadBalancerListenerInput, error) { - resp := &AddRemoveLoadBalancerListenerInput{} - err := c.rancherClient.doUpdate(ADD_REMOVE_LOAD_BALANCER_LISTENER_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AddRemoveLoadBalancerListenerInputClient) List(opts *ListOpts) (*AddRemoveLoadBalancerListenerInputCollection, error) { - resp := &AddRemoveLoadBalancerListenerInputCollection{} - err := c.rancherClient.doList(ADD_REMOVE_LOAD_BALANCER_LISTENER_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *AddRemoveLoadBalancerListenerInputClient) ById(id string) (*AddRemoveLoadBalancerListenerInput, error) { - resp := &AddRemoveLoadBalancerListenerInput{} - err := c.rancherClient.doById(ADD_REMOVE_LOAD_BALANCER_LISTENER_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AddRemoveLoadBalancerListenerInputClient) Delete(container *AddRemoveLoadBalancerListenerInput) error { - return c.rancherClient.doResourceDelete(ADD_REMOVE_LOAD_BALANCER_LISTENER_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_target_input.go b/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_target_input.go deleted file mode 100644 index c352aad83..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_target_input.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -const ( - ADD_REMOVE_LOAD_BALANCER_TARGET_INPUT_TYPE = "addRemoveLoadBalancerTargetInput" -) - -type AddRemoveLoadBalancerTargetInput struct { - Resource - - LoadBalancerTarget LoadBalancerTarget `json:"loadBalancerTarget,omitempty" yaml:"load_balancer_target,omitempty"` -} - -type AddRemoveLoadBalancerTargetInputCollection struct { - Collection - Data []AddRemoveLoadBalancerTargetInput `json:"data,omitempty"` -} - -type AddRemoveLoadBalancerTargetInputClient struct { - rancherClient *RancherClient -} - -type AddRemoveLoadBalancerTargetInputOperations interface { - List(opts *ListOpts) (*AddRemoveLoadBalancerTargetInputCollection, error) - Create(opts *AddRemoveLoadBalancerTargetInput) (*AddRemoveLoadBalancerTargetInput, error) - Update(existing *AddRemoveLoadBalancerTargetInput, updates interface{}) (*AddRemoveLoadBalancerTargetInput, error) - ById(id string) (*AddRemoveLoadBalancerTargetInput, error) - Delete(container *AddRemoveLoadBalancerTargetInput) error -} - -func newAddRemoveLoadBalancerTargetInputClient(rancherClient *RancherClient) *AddRemoveLoadBalancerTargetInputClient { - return &AddRemoveLoadBalancerTargetInputClient{ - rancherClient: rancherClient, - } -} - -func (c *AddRemoveLoadBalancerTargetInputClient) Create(container *AddRemoveLoadBalancerTargetInput) (*AddRemoveLoadBalancerTargetInput, error) { - resp := &AddRemoveLoadBalancerTargetInput{} - err := c.rancherClient.doCreate(ADD_REMOVE_LOAD_BALANCER_TARGET_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *AddRemoveLoadBalancerTargetInputClient) Update(existing *AddRemoveLoadBalancerTargetInput, updates interface{}) (*AddRemoveLoadBalancerTargetInput, error) { - resp := &AddRemoveLoadBalancerTargetInput{} - err := c.rancherClient.doUpdate(ADD_REMOVE_LOAD_BALANCER_TARGET_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AddRemoveLoadBalancerTargetInputClient) List(opts *ListOpts) (*AddRemoveLoadBalancerTargetInputCollection, error) { - resp := &AddRemoveLoadBalancerTargetInputCollection{} - err := c.rancherClient.doList(ADD_REMOVE_LOAD_BALANCER_TARGET_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *AddRemoveLoadBalancerTargetInputClient) ById(id string) (*AddRemoveLoadBalancerTargetInput, error) { - resp := &AddRemoveLoadBalancerTargetInput{} - err := c.rancherClient.doById(ADD_REMOVE_LOAD_BALANCER_TARGET_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AddRemoveLoadBalancerTargetInputClient) Delete(container *AddRemoveLoadBalancerTargetInput) error { - return c.rancherClient.doResourceDelete(ADD_REMOVE_LOAD_BALANCER_TARGET_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_amazonec2config.go b/vendor/github.com/rancher/go-rancher/client/generated_amazonec2config.go index 0c7c35b40..9102e4f52 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_amazonec2config.go +++ b/vendor/github.com/rancher/go-rancher/client/generated_amazonec2config.go @@ -17,6 +17,8 @@ type Amazonec2Config struct { InstanceType string `json:"instanceType,omitempty" yaml:"instance_type,omitempty"` + KeypairName string `json:"keypairName,omitempty" yaml:"keypair_name,omitempty"` + Monitoring bool `json:"monitoring,omitempty" yaml:"monitoring,omitempty"` PrivateAddressOnly bool `json:"privateAddressOnly,omitempty" yaml:"private_address_only,omitempty"` @@ -25,11 +27,13 @@ type Amazonec2Config struct { RequestSpotInstance bool `json:"requestSpotInstance,omitempty" yaml:"request_spot_instance,omitempty"` + Retries string `json:"retries,omitempty" yaml:"retries,omitempty"` + RootSize string `json:"rootSize,omitempty" yaml:"root_size,omitempty"` SecretKey string `json:"secretKey,omitempty" yaml:"secret_key,omitempty"` - SecurityGroup string `json:"securityGroup,omitempty" yaml:"security_group,omitempty"` + SecurityGroup []string `json:"securityGroup,omitempty" yaml:"security_group,omitempty"` SessionToken string `json:"sessionToken,omitempty" yaml:"session_token,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/client/generated_azure_config.go b/vendor/github.com/rancher/go-rancher/client/generated_azure_config.go index afe230f89..8f9de8e22 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_azure_config.go +++ b/vendor/github.com/rancher/go-rancher/client/generated_azure_config.go @@ -7,27 +7,47 @@ const ( type AzureConfig struct { Resource + AvailabilitySet string `json:"availabilitySet,omitempty" yaml:"availability_set,omitempty"` + + ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"` + + ClientSecret string `json:"clientSecret,omitempty" yaml:"client_secret,omitempty"` + + CustomData string `json:"customData,omitempty" yaml:"custom_data,omitempty"` + DockerPort string `json:"dockerPort,omitempty" yaml:"docker_port,omitempty"` - DockerSwarmMasterPort string `json:"dockerSwarmMasterPort,omitempty" yaml:"docker_swarm_master_port,omitempty"` + Environment string `json:"environment,omitempty" yaml:"environment,omitempty"` Image string `json:"image,omitempty" yaml:"image,omitempty"` Location string `json:"location,omitempty" yaml:"location,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` + NoPublicIp bool `json:"noPublicIp,omitempty" yaml:"no_public_ip,omitempty"` + + OpenPort []string `json:"openPort,omitempty" yaml:"open_port,omitempty"` - PublishSettingsFile string `json:"publishSettingsFile,omitempty" yaml:"publish_settings_file,omitempty"` + PrivateIpAddress string `json:"privateIpAddress,omitempty" yaml:"private_ip_address,omitempty"` + + ResourceGroup string `json:"resourceGroup,omitempty" yaml:"resource_group,omitempty"` Size string `json:"size,omitempty" yaml:"size,omitempty"` - SshPort string `json:"sshPort,omitempty" yaml:"ssh_port,omitempty"` + SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` + + StaticPublicIp bool `json:"staticPublicIp,omitempty" yaml:"static_public_ip,omitempty"` + + StorageType string `json:"storageType,omitempty" yaml:"storage_type,omitempty"` - SubscriptionCert string `json:"subscriptionCert,omitempty" yaml:"subscription_cert,omitempty"` + Subnet string `json:"subnet,omitempty" yaml:"subnet,omitempty"` + + SubnetPrefix string `json:"subnetPrefix,omitempty" yaml:"subnet_prefix,omitempty"` SubscriptionId string `json:"subscriptionId,omitempty" yaml:"subscription_id,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` + UsePrivateIp bool `json:"usePrivateIp,omitempty" yaml:"use_private_ip,omitempty"` + + Vnet string `json:"vnet,omitempty" yaml:"vnet,omitempty"` } type AzureConfigCollection struct { diff --git a/vendor/github.com/rancher/go-rancher/client/generated_cluster.go b/vendor/github.com/rancher/go-rancher/client/generated_cluster.go deleted file mode 100644 index 0374af964..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_cluster.go +++ /dev/null @@ -1,223 +0,0 @@ -package client - -const ( - CLUSTER_TYPE = "cluster" -) - -type Cluster struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AgentState string `json:"agentState,omitempty" yaml:"agent_state,omitempty"` - - ApiProxy string `json:"apiProxy,omitempty" yaml:"api_proxy,omitempty"` - - ComputeTotal int64 `json:"computeTotal,omitempty" yaml:"compute_total,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DiscoverySpec string `json:"discoverySpec,omitempty" yaml:"discovery_spec,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - Info interface{} `json:"info,omitempty" yaml:"info,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PhysicalHostId string `json:"physicalHostId,omitempty" yaml:"physical_host_id,omitempty"` - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - PublicEndpoints []interface{} `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ClusterCollection struct { - Collection - Data []Cluster `json:"data,omitempty"` -} - -type ClusterClient struct { - rancherClient *RancherClient -} - -type ClusterOperations interface { - List(opts *ListOpts) (*ClusterCollection, error) - Create(opts *Cluster) (*Cluster, error) - Update(existing *Cluster, updates interface{}) (*Cluster, error) - ById(id string) (*Cluster, error) - Delete(container *Cluster) error - - ActionActivate(*Cluster) (*Host, error) - - ActionAddhost(*Cluster, *AddRemoveClusterHostInput) (*Cluster, error) - - ActionCreate(*Cluster) (*Host, error) - - ActionDeactivate(*Cluster) (*Host, error) - - ActionDockersocket(*Cluster) (*HostAccess, error) - - ActionPurge(*Cluster) (*Host, error) - - ActionRemove(*Cluster) (*Host, error) - - ActionRemovehost(*Cluster, *AddRemoveClusterHostInput) (*Cluster, error) - - ActionRestore(*Cluster) (*Host, error) - - ActionUpdate(*Cluster) (*Host, error) -} - -func newClusterClient(rancherClient *RancherClient) *ClusterClient { - return &ClusterClient{ - rancherClient: rancherClient, - } -} - -func (c *ClusterClient) Create(container *Cluster) (*Cluster, error) { - resp := &Cluster{} - err := c.rancherClient.doCreate(CLUSTER_TYPE, container, resp) - return resp, err -} - -func (c *ClusterClient) Update(existing *Cluster, updates interface{}) (*Cluster, error) { - resp := &Cluster{} - err := c.rancherClient.doUpdate(CLUSTER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterClient) List(opts *ListOpts) (*ClusterCollection, error) { - resp := &ClusterCollection{} - err := c.rancherClient.doList(CLUSTER_TYPE, opts, resp) - return resp, err -} - -func (c *ClusterClient) ById(id string) (*Cluster, error) { - resp := &Cluster{} - err := c.rancherClient.doById(CLUSTER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ClusterClient) Delete(container *Cluster) error { - return c.rancherClient.doResourceDelete(CLUSTER_TYPE, &container.Resource) -} - -func (c *ClusterClient) ActionActivate(resource *Cluster) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(CLUSTER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ClusterClient) ActionAddhost(resource *Cluster, input *AddRemoveClusterHostInput) (*Cluster, error) { - - resp := &Cluster{} - - err := c.rancherClient.doAction(CLUSTER_TYPE, "addhost", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ClusterClient) ActionCreate(resource *Cluster) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(CLUSTER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ClusterClient) ActionDeactivate(resource *Cluster) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(CLUSTER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ClusterClient) ActionDockersocket(resource *Cluster) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(CLUSTER_TYPE, "dockersocket", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ClusterClient) ActionPurge(resource *Cluster) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(CLUSTER_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ClusterClient) ActionRemove(resource *Cluster) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(CLUSTER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ClusterClient) ActionRemovehost(resource *Cluster, input *AddRemoveClusterHostInput) (*Cluster, error) { - - resp := &Cluster{} - - err := c.rancherClient.doAction(CLUSTER_TYPE, "removehost", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ClusterClient) ActionRestore(resource *Cluster) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(CLUSTER_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ClusterClient) ActionUpdate(resource *Cluster) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(CLUSTER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_digitalocean_config.go b/vendor/github.com/rancher/go-rancher/client/generated_digitalocean_config.go index 9976dd543..3ae14dd47 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_digitalocean_config.go +++ b/vendor/github.com/rancher/go-rancher/client/generated_digitalocean_config.go @@ -21,6 +21,8 @@ type DigitaloceanConfig struct { Size string `json:"size,omitempty" yaml:"size,omitempty"` + SshKeyFingerprint string `json:"sshKeyFingerprint,omitempty" yaml:"ssh_key_fingerprint,omitempty"` + SshPort string `json:"sshPort,omitempty" yaml:"ssh_port,omitempty"` SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/client/generated_exoscale_config.go b/vendor/github.com/rancher/go-rancher/client/generated_exoscale_config.go deleted file mode 100644 index 5fbda9b75..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_exoscale_config.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - EXOSCALE_CONFIG_TYPE = "exoscaleConfig" -) - -type ExoscaleConfig struct { - Resource - - ApiKey string `json:"apiKey,omitempty" yaml:"api_key,omitempty"` - - ApiSecretKey string `json:"apiSecretKey,omitempty" yaml:"api_secret_key,omitempty"` - - AvailabilityZone string `json:"availabilityZone,omitempty" yaml:"availability_zone,omitempty"` - - DiskSize string `json:"diskSize,omitempty" yaml:"disk_size,omitempty"` - - Image string `json:"image,omitempty" yaml:"image,omitempty"` - - InstanceProfile string `json:"instanceProfile,omitempty" yaml:"instance_profile,omitempty"` - - SecurityGroup []string `json:"securityGroup,omitempty" yaml:"security_group,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` -} - -type ExoscaleConfigCollection struct { - Collection - Data []ExoscaleConfig `json:"data,omitempty"` -} - -type ExoscaleConfigClient struct { - rancherClient *RancherClient -} - -type ExoscaleConfigOperations interface { - List(opts *ListOpts) (*ExoscaleConfigCollection, error) - Create(opts *ExoscaleConfig) (*ExoscaleConfig, error) - Update(existing *ExoscaleConfig, updates interface{}) (*ExoscaleConfig, error) - ById(id string) (*ExoscaleConfig, error) - Delete(container *ExoscaleConfig) error -} - -func newExoscaleConfigClient(rancherClient *RancherClient) *ExoscaleConfigClient { - return &ExoscaleConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *ExoscaleConfigClient) Create(container *ExoscaleConfig) (*ExoscaleConfig, error) { - resp := &ExoscaleConfig{} - err := c.rancherClient.doCreate(EXOSCALE_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *ExoscaleConfigClient) Update(existing *ExoscaleConfig, updates interface{}) (*ExoscaleConfig, error) { - resp := &ExoscaleConfig{} - err := c.rancherClient.doUpdate(EXOSCALE_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExoscaleConfigClient) List(opts *ListOpts) (*ExoscaleConfigCollection, error) { - resp := &ExoscaleConfigCollection{} - err := c.rancherClient.doList(EXOSCALE_CONFIG_TYPE, opts, resp) - return resp, err -} - -func (c *ExoscaleConfigClient) ById(id string) (*ExoscaleConfig, error) { - resp := &ExoscaleConfig{} - err := c.rancherClient.doById(EXOSCALE_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExoscaleConfigClient) Delete(container *ExoscaleConfig) error { - return c.rancherClient.doResourceDelete(EXOSCALE_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_global_load_balancer.go b/vendor/github.com/rancher/go-rancher/client/generated_global_load_balancer.go deleted file mode 100644 index 881b13fd9..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_global_load_balancer.go +++ /dev/null @@ -1,139 +0,0 @@ -package client - -const ( - GLOBAL_LOAD_BALANCER_TYPE = "globalLoadBalancer" -) - -type GlobalLoadBalancer struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - GlobalLoadBalancerHealthCheck []interface{} `json:"globalLoadBalancerHealthCheck,omitempty" yaml:"global_load_balancer_health_check,omitempty"` - - GlobalLoadBalancerPolicy []interface{} `json:"globalLoadBalancerPolicy,omitempty" yaml:"global_load_balancer_policy,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type GlobalLoadBalancerCollection struct { - Collection - Data []GlobalLoadBalancer `json:"data,omitempty"` -} - -type GlobalLoadBalancerClient struct { - rancherClient *RancherClient -} - -type GlobalLoadBalancerOperations interface { - List(opts *ListOpts) (*GlobalLoadBalancerCollection, error) - Create(opts *GlobalLoadBalancer) (*GlobalLoadBalancer, error) - Update(existing *GlobalLoadBalancer, updates interface{}) (*GlobalLoadBalancer, error) - ById(id string) (*GlobalLoadBalancer, error) - Delete(container *GlobalLoadBalancer) error - - ActionAddloadbalancer(*GlobalLoadBalancer, *AddLoadBalancerInput) (*GlobalLoadBalancer, error) - - ActionCreate(*GlobalLoadBalancer) (*GlobalLoadBalancer, error) - - ActionRemove(*GlobalLoadBalancer) (*GlobalLoadBalancer, error) - - ActionRemoveloadbalancer(*GlobalLoadBalancer, *RemoveLoadBalancerInput) (*GlobalLoadBalancer, error) -} - -func newGlobalLoadBalancerClient(rancherClient *RancherClient) *GlobalLoadBalancerClient { - return &GlobalLoadBalancerClient{ - rancherClient: rancherClient, - } -} - -func (c *GlobalLoadBalancerClient) Create(container *GlobalLoadBalancer) (*GlobalLoadBalancer, error) { - resp := &GlobalLoadBalancer{} - err := c.rancherClient.doCreate(GLOBAL_LOAD_BALANCER_TYPE, container, resp) - return resp, err -} - -func (c *GlobalLoadBalancerClient) Update(existing *GlobalLoadBalancer, updates interface{}) (*GlobalLoadBalancer, error) { - resp := &GlobalLoadBalancer{} - err := c.rancherClient.doUpdate(GLOBAL_LOAD_BALANCER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GlobalLoadBalancerClient) List(opts *ListOpts) (*GlobalLoadBalancerCollection, error) { - resp := &GlobalLoadBalancerCollection{} - err := c.rancherClient.doList(GLOBAL_LOAD_BALANCER_TYPE, opts, resp) - return resp, err -} - -func (c *GlobalLoadBalancerClient) ById(id string) (*GlobalLoadBalancer, error) { - resp := &GlobalLoadBalancer{} - err := c.rancherClient.doById(GLOBAL_LOAD_BALANCER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *GlobalLoadBalancerClient) Delete(container *GlobalLoadBalancer) error { - return c.rancherClient.doResourceDelete(GLOBAL_LOAD_BALANCER_TYPE, &container.Resource) -} - -func (c *GlobalLoadBalancerClient) ActionAddloadbalancer(resource *GlobalLoadBalancer, input *AddLoadBalancerInput) (*GlobalLoadBalancer, error) { - - resp := &GlobalLoadBalancer{} - - err := c.rancherClient.doAction(GLOBAL_LOAD_BALANCER_TYPE, "addloadbalancer", &resource.Resource, input, resp) - - return resp, err -} - -func (c *GlobalLoadBalancerClient) ActionCreate(resource *GlobalLoadBalancer) (*GlobalLoadBalancer, error) { - - resp := &GlobalLoadBalancer{} - - err := c.rancherClient.doAction(GLOBAL_LOAD_BALANCER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *GlobalLoadBalancerClient) ActionRemove(resource *GlobalLoadBalancer) (*GlobalLoadBalancer, error) { - - resp := &GlobalLoadBalancer{} - - err := c.rancherClient.doAction(GLOBAL_LOAD_BALANCER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *GlobalLoadBalancerClient) ActionRemoveloadbalancer(resource *GlobalLoadBalancer, input *RemoveLoadBalancerInput) (*GlobalLoadBalancer, error) { - - resp := &GlobalLoadBalancer{} - - err := c.rancherClient.doAction(GLOBAL_LOAD_BALANCER_TYPE, "removeloadbalancer", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_global_load_balancer_health_check.go b/vendor/github.com/rancher/go-rancher/client/generated_global_load_balancer_health_check.go deleted file mode 100644 index a461de952..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_global_load_balancer_health_check.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -const ( - GLOBAL_LOAD_BALANCER_HEALTH_CHECK_TYPE = "globalLoadBalancerHealthCheck" -) - -type GlobalLoadBalancerHealthCheck struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type GlobalLoadBalancerHealthCheckCollection struct { - Collection - Data []GlobalLoadBalancerHealthCheck `json:"data,omitempty"` -} - -type GlobalLoadBalancerHealthCheckClient struct { - rancherClient *RancherClient -} - -type GlobalLoadBalancerHealthCheckOperations interface { - List(opts *ListOpts) (*GlobalLoadBalancerHealthCheckCollection, error) - Create(opts *GlobalLoadBalancerHealthCheck) (*GlobalLoadBalancerHealthCheck, error) - Update(existing *GlobalLoadBalancerHealthCheck, updates interface{}) (*GlobalLoadBalancerHealthCheck, error) - ById(id string) (*GlobalLoadBalancerHealthCheck, error) - Delete(container *GlobalLoadBalancerHealthCheck) error -} - -func newGlobalLoadBalancerHealthCheckClient(rancherClient *RancherClient) *GlobalLoadBalancerHealthCheckClient { - return &GlobalLoadBalancerHealthCheckClient{ - rancherClient: rancherClient, - } -} - -func (c *GlobalLoadBalancerHealthCheckClient) Create(container *GlobalLoadBalancerHealthCheck) (*GlobalLoadBalancerHealthCheck, error) { - resp := &GlobalLoadBalancerHealthCheck{} - err := c.rancherClient.doCreate(GLOBAL_LOAD_BALANCER_HEALTH_CHECK_TYPE, container, resp) - return resp, err -} - -func (c *GlobalLoadBalancerHealthCheckClient) Update(existing *GlobalLoadBalancerHealthCheck, updates interface{}) (*GlobalLoadBalancerHealthCheck, error) { - resp := &GlobalLoadBalancerHealthCheck{} - err := c.rancherClient.doUpdate(GLOBAL_LOAD_BALANCER_HEALTH_CHECK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GlobalLoadBalancerHealthCheckClient) List(opts *ListOpts) (*GlobalLoadBalancerHealthCheckCollection, error) { - resp := &GlobalLoadBalancerHealthCheckCollection{} - err := c.rancherClient.doList(GLOBAL_LOAD_BALANCER_HEALTH_CHECK_TYPE, opts, resp) - return resp, err -} - -func (c *GlobalLoadBalancerHealthCheckClient) ById(id string) (*GlobalLoadBalancerHealthCheck, error) { - resp := &GlobalLoadBalancerHealthCheck{} - err := c.rancherClient.doById(GLOBAL_LOAD_BALANCER_HEALTH_CHECK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *GlobalLoadBalancerHealthCheckClient) Delete(container *GlobalLoadBalancerHealthCheck) error { - return c.rancherClient.doResourceDelete(GLOBAL_LOAD_BALANCER_HEALTH_CHECK_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_global_load_balancer_policy.go b/vendor/github.com/rancher/go-rancher/client/generated_global_load_balancer_policy.go deleted file mode 100644 index e60890648..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_global_load_balancer_policy.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -const ( - GLOBAL_LOAD_BALANCER_POLICY_TYPE = "globalLoadBalancerPolicy" -) - -type GlobalLoadBalancerPolicy struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type GlobalLoadBalancerPolicyCollection struct { - Collection - Data []GlobalLoadBalancerPolicy `json:"data,omitempty"` -} - -type GlobalLoadBalancerPolicyClient struct { - rancherClient *RancherClient -} - -type GlobalLoadBalancerPolicyOperations interface { - List(opts *ListOpts) (*GlobalLoadBalancerPolicyCollection, error) - Create(opts *GlobalLoadBalancerPolicy) (*GlobalLoadBalancerPolicy, error) - Update(existing *GlobalLoadBalancerPolicy, updates interface{}) (*GlobalLoadBalancerPolicy, error) - ById(id string) (*GlobalLoadBalancerPolicy, error) - Delete(container *GlobalLoadBalancerPolicy) error -} - -func newGlobalLoadBalancerPolicyClient(rancherClient *RancherClient) *GlobalLoadBalancerPolicyClient { - return &GlobalLoadBalancerPolicyClient{ - rancherClient: rancherClient, - } -} - -func (c *GlobalLoadBalancerPolicyClient) Create(container *GlobalLoadBalancerPolicy) (*GlobalLoadBalancerPolicy, error) { - resp := &GlobalLoadBalancerPolicy{} - err := c.rancherClient.doCreate(GLOBAL_LOAD_BALANCER_POLICY_TYPE, container, resp) - return resp, err -} - -func (c *GlobalLoadBalancerPolicyClient) Update(existing *GlobalLoadBalancerPolicy, updates interface{}) (*GlobalLoadBalancerPolicy, error) { - resp := &GlobalLoadBalancerPolicy{} - err := c.rancherClient.doUpdate(GLOBAL_LOAD_BALANCER_POLICY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GlobalLoadBalancerPolicyClient) List(opts *ListOpts) (*GlobalLoadBalancerPolicyCollection, error) { - resp := &GlobalLoadBalancerPolicyCollection{} - err := c.rancherClient.doList(GLOBAL_LOAD_BALANCER_POLICY_TYPE, opts, resp) - return resp, err -} - -func (c *GlobalLoadBalancerPolicyClient) ById(id string) (*GlobalLoadBalancerPolicy, error) { - resp := &GlobalLoadBalancerPolicy{} - err := c.rancherClient.doById(GLOBAL_LOAD_BALANCER_POLICY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *GlobalLoadBalancerPolicyClient) Delete(container *GlobalLoadBalancerPolicy) error { - return c.rancherClient.doResourceDelete(GLOBAL_LOAD_BALANCER_POLICY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer.go deleted file mode 100644 index 6b870b825..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer.go +++ /dev/null @@ -1,224 +0,0 @@ -package client - -const ( - LOAD_BALANCER_TYPE = "loadBalancer" -) - -type LoadBalancer struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - CertificateIds []string `json:"certificateIds,omitempty" yaml:"certificate_ids,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DefaultCertificateId string `json:"defaultCertificateId,omitempty" yaml:"default_certificate_id,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - GlobalLoadBalancerId string `json:"globalLoadBalancerId,omitempty" yaml:"global_load_balancer_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LoadBalancerConfigId string `json:"loadBalancerConfigId,omitempty" yaml:"load_balancer_config_id,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Weight int64 `json:"weight,omitempty" yaml:"weight,omitempty"` -} - -type LoadBalancerCollection struct { - Collection - Data []LoadBalancer `json:"data,omitempty"` -} - -type LoadBalancerClient struct { - rancherClient *RancherClient -} - -type LoadBalancerOperations interface { - List(opts *ListOpts) (*LoadBalancerCollection, error) - Create(opts *LoadBalancer) (*LoadBalancer, error) - Update(existing *LoadBalancer, updates interface{}) (*LoadBalancer, error) - ById(id string) (*LoadBalancer, error) - Delete(container *LoadBalancer) error - - ActionActivate(*LoadBalancer) (*LoadBalancer, error) - - ActionAddhost(*LoadBalancer, *AddRemoveLoadBalancerHostInput) (*LoadBalancer, error) - - ActionAddtarget(*LoadBalancer, *AddRemoveLoadBalancerTargetInput) (*LoadBalancer, error) - - ActionCreate(*LoadBalancer) (*LoadBalancer, error) - - ActionDeactivate(*LoadBalancer) (*LoadBalancer, error) - - ActionRemove(*LoadBalancer) (*LoadBalancer, error) - - ActionRemovehost(*LoadBalancer, *AddRemoveLoadBalancerHostInput) (*LoadBalancer, error) - - ActionRemovetarget(*LoadBalancer, *AddRemoveLoadBalancerTargetInput) (*LoadBalancer, error) - - ActionSethosts(*LoadBalancer, *SetLoadBalancerHostsInput) (*LoadBalancer, error) - - ActionSettargets(*LoadBalancer, *SetLoadBalancerTargetsInput) (*LoadBalancer, error) - - ActionUpdate(*LoadBalancer) (*LoadBalancer, error) -} - -func newLoadBalancerClient(rancherClient *RancherClient) *LoadBalancerClient { - return &LoadBalancerClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerClient) Create(container *LoadBalancer) (*LoadBalancer, error) { - resp := &LoadBalancer{} - err := c.rancherClient.doCreate(LOAD_BALANCER_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerClient) Update(existing *LoadBalancer, updates interface{}) (*LoadBalancer, error) { - resp := &LoadBalancer{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerClient) List(opts *ListOpts) (*LoadBalancerCollection, error) { - resp := &LoadBalancerCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_TYPE, opts, resp) - return resp, err -} - -func (c *LoadBalancerClient) ById(id string) (*LoadBalancer, error) { - resp := &LoadBalancer{} - err := c.rancherClient.doById(LOAD_BALANCER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerClient) Delete(container *LoadBalancer) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_TYPE, &container.Resource) -} - -func (c *LoadBalancerClient) ActionActivate(resource *LoadBalancer) (*LoadBalancer, error) { - - resp := &LoadBalancer{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerClient) ActionAddhost(resource *LoadBalancer, input *AddRemoveLoadBalancerHostInput) (*LoadBalancer, error) { - - resp := &LoadBalancer{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TYPE, "addhost", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerClient) ActionAddtarget(resource *LoadBalancer, input *AddRemoveLoadBalancerTargetInput) (*LoadBalancer, error) { - - resp := &LoadBalancer{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TYPE, "addtarget", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerClient) ActionCreate(resource *LoadBalancer) (*LoadBalancer, error) { - - resp := &LoadBalancer{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerClient) ActionDeactivate(resource *LoadBalancer) (*LoadBalancer, error) { - - resp := &LoadBalancer{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerClient) ActionRemove(resource *LoadBalancer) (*LoadBalancer, error) { - - resp := &LoadBalancer{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerClient) ActionRemovehost(resource *LoadBalancer, input *AddRemoveLoadBalancerHostInput) (*LoadBalancer, error) { - - resp := &LoadBalancer{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TYPE, "removehost", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerClient) ActionRemovetarget(resource *LoadBalancer, input *AddRemoveLoadBalancerTargetInput) (*LoadBalancer, error) { - - resp := &LoadBalancer{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TYPE, "removetarget", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerClient) ActionSethosts(resource *LoadBalancer, input *SetLoadBalancerHostsInput) (*LoadBalancer, error) { - - resp := &LoadBalancer{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TYPE, "sethosts", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerClient) ActionSettargets(resource *LoadBalancer, input *SetLoadBalancerTargetsInput) (*LoadBalancer, error) { - - resp := &LoadBalancer{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TYPE, "settargets", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerClient) ActionUpdate(resource *LoadBalancer) (*LoadBalancer, error) { - - resp := &LoadBalancer{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_config_listener_map.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_config_listener_map.go deleted file mode 100644 index b8e4d5157..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_config_listener_map.go +++ /dev/null @@ -1,117 +0,0 @@ -package client - -const ( - LOAD_BALANCER_CONFIG_LISTENER_MAP_TYPE = "loadBalancerConfigListenerMap" -) - -type LoadBalancerConfigListenerMap struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LoadBalancerConfigId string `json:"loadBalancerConfigId,omitempty" yaml:"load_balancer_config_id,omitempty"` - - LoadBalancerListenerId string `json:"loadBalancerListenerId,omitempty" yaml:"load_balancer_listener_id,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type LoadBalancerConfigListenerMapCollection struct { - Collection - Data []LoadBalancerConfigListenerMap `json:"data,omitempty"` -} - -type LoadBalancerConfigListenerMapClient struct { - rancherClient *RancherClient -} - -type LoadBalancerConfigListenerMapOperations interface { - List(opts *ListOpts) (*LoadBalancerConfigListenerMapCollection, error) - Create(opts *LoadBalancerConfigListenerMap) (*LoadBalancerConfigListenerMap, error) - Update(existing *LoadBalancerConfigListenerMap, updates interface{}) (*LoadBalancerConfigListenerMap, error) - ById(id string) (*LoadBalancerConfigListenerMap, error) - Delete(container *LoadBalancerConfigListenerMap) error - - ActionCreate(*LoadBalancerConfigListenerMap) (*LoadBalancerConfigListenerMap, error) - - ActionRemove(*LoadBalancerConfigListenerMap) (*LoadBalancerConfigListenerMap, error) -} - -func newLoadBalancerConfigListenerMapClient(rancherClient *RancherClient) *LoadBalancerConfigListenerMapClient { - return &LoadBalancerConfigListenerMapClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerConfigListenerMapClient) Create(container *LoadBalancerConfigListenerMap) (*LoadBalancerConfigListenerMap, error) { - resp := &LoadBalancerConfigListenerMap{} - err := c.rancherClient.doCreate(LOAD_BALANCER_CONFIG_LISTENER_MAP_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerConfigListenerMapClient) Update(existing *LoadBalancerConfigListenerMap, updates interface{}) (*LoadBalancerConfigListenerMap, error) { - resp := &LoadBalancerConfigListenerMap{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_CONFIG_LISTENER_MAP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerConfigListenerMapClient) List(opts *ListOpts) (*LoadBalancerConfigListenerMapCollection, error) { - resp := &LoadBalancerConfigListenerMapCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_CONFIG_LISTENER_MAP_TYPE, opts, resp) - return resp, err -} - -func (c *LoadBalancerConfigListenerMapClient) ById(id string) (*LoadBalancerConfigListenerMap, error) { - resp := &LoadBalancerConfigListenerMap{} - err := c.rancherClient.doById(LOAD_BALANCER_CONFIG_LISTENER_MAP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerConfigListenerMapClient) Delete(container *LoadBalancerConfigListenerMap) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_CONFIG_LISTENER_MAP_TYPE, &container.Resource) -} - -func (c *LoadBalancerConfigListenerMapClient) ActionCreate(resource *LoadBalancerConfigListenerMap) (*LoadBalancerConfigListenerMap, error) { - - resp := &LoadBalancerConfigListenerMap{} - - err := c.rancherClient.doAction(LOAD_BALANCER_CONFIG_LISTENER_MAP_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerConfigListenerMapClient) ActionRemove(resource *LoadBalancerConfigListenerMap) (*LoadBalancerConfigListenerMap, error) { - - resp := &LoadBalancerConfigListenerMap{} - - err := c.rancherClient.doAction(LOAD_BALANCER_CONFIG_LISTENER_MAP_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_health_check.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_health_check.go deleted file mode 100644 index 1d96ec648..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_health_check.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - LOAD_BALANCER_HEALTH_CHECK_TYPE = "loadBalancerHealthCheck" -) - -type LoadBalancerHealthCheck struct { - Resource - - HealthyThreshold int64 `json:"healthyThreshold,omitempty" yaml:"healthy_threshold,omitempty"` - - Interval int64 `json:"interval,omitempty" yaml:"interval,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - RequestLine string `json:"requestLine,omitempty" yaml:"request_line,omitempty"` - - ResponseTimeout int64 `json:"responseTimeout,omitempty" yaml:"response_timeout,omitempty"` - - UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty" yaml:"unhealthy_threshold,omitempty"` -} - -type LoadBalancerHealthCheckCollection struct { - Collection - Data []LoadBalancerHealthCheck `json:"data,omitempty"` -} - -type LoadBalancerHealthCheckClient struct { - rancherClient *RancherClient -} - -type LoadBalancerHealthCheckOperations interface { - List(opts *ListOpts) (*LoadBalancerHealthCheckCollection, error) - Create(opts *LoadBalancerHealthCheck) (*LoadBalancerHealthCheck, error) - Update(existing *LoadBalancerHealthCheck, updates interface{}) (*LoadBalancerHealthCheck, error) - ById(id string) (*LoadBalancerHealthCheck, error) - Delete(container *LoadBalancerHealthCheck) error -} - -func newLoadBalancerHealthCheckClient(rancherClient *RancherClient) *LoadBalancerHealthCheckClient { - return &LoadBalancerHealthCheckClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerHealthCheckClient) Create(container *LoadBalancerHealthCheck) (*LoadBalancerHealthCheck, error) { - resp := &LoadBalancerHealthCheck{} - err := c.rancherClient.doCreate(LOAD_BALANCER_HEALTH_CHECK_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerHealthCheckClient) Update(existing *LoadBalancerHealthCheck, updates interface{}) (*LoadBalancerHealthCheck, error) { - resp := &LoadBalancerHealthCheck{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_HEALTH_CHECK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerHealthCheckClient) List(opts *ListOpts) (*LoadBalancerHealthCheckCollection, error) { - resp := &LoadBalancerHealthCheckCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_HEALTH_CHECK_TYPE, opts, resp) - return resp, err -} - -func (c *LoadBalancerHealthCheckClient) ById(id string) (*LoadBalancerHealthCheck, error) { - resp := &LoadBalancerHealthCheck{} - err := c.rancherClient.doById(LOAD_BALANCER_HEALTH_CHECK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerHealthCheckClient) Delete(container *LoadBalancerHealthCheck) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_HEALTH_CHECK_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_host_map.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_host_map.go deleted file mode 100644 index b135d29cc..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_host_map.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - LOAD_BALANCER_HOST_MAP_TYPE = "loadBalancerHostMap" -) - -type LoadBalancerHostMap struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LoadBalancerId string `json:"loadBalancerId,omitempty" yaml:"load_balancer_id,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type LoadBalancerHostMapCollection struct { - Collection - Data []LoadBalancerHostMap `json:"data,omitempty"` -} - -type LoadBalancerHostMapClient struct { - rancherClient *RancherClient -} - -type LoadBalancerHostMapOperations interface { - List(opts *ListOpts) (*LoadBalancerHostMapCollection, error) - Create(opts *LoadBalancerHostMap) (*LoadBalancerHostMap, error) - Update(existing *LoadBalancerHostMap, updates interface{}) (*LoadBalancerHostMap, error) - ById(id string) (*LoadBalancerHostMap, error) - Delete(container *LoadBalancerHostMap) error -} - -func newLoadBalancerHostMapClient(rancherClient *RancherClient) *LoadBalancerHostMapClient { - return &LoadBalancerHostMapClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerHostMapClient) Create(container *LoadBalancerHostMap) (*LoadBalancerHostMap, error) { - resp := &LoadBalancerHostMap{} - err := c.rancherClient.doCreate(LOAD_BALANCER_HOST_MAP_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerHostMapClient) Update(existing *LoadBalancerHostMap, updates interface{}) (*LoadBalancerHostMap, error) { - resp := &LoadBalancerHostMap{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_HOST_MAP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerHostMapClient) List(opts *ListOpts) (*LoadBalancerHostMapCollection, error) { - resp := &LoadBalancerHostMapCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_HOST_MAP_TYPE, opts, resp) - return resp, err -} - -func (c *LoadBalancerHostMapClient) ById(id string) (*LoadBalancerHostMap, error) { - resp := &LoadBalancerHostMap{} - err := c.rancherClient.doById(LOAD_BALANCER_HOST_MAP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerHostMapClient) Delete(container *LoadBalancerHostMap) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_HOST_MAP_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_listener.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_listener.go deleted file mode 100644 index 5d0e983f9..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_listener.go +++ /dev/null @@ -1,127 +0,0 @@ -package client - -const ( - LOAD_BALANCER_LISTENER_TYPE = "loadBalancerListener" -) - -type LoadBalancerListener struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Algorithm string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PrivatePort int64 `json:"privatePort,omitempty" yaml:"private_port,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - SourcePort int64 `json:"sourcePort,omitempty" yaml:"source_port,omitempty"` - - SourceProtocol string `json:"sourceProtocol,omitempty" yaml:"source_protocol,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - TargetPort int64 `json:"targetPort,omitempty" yaml:"target_port,omitempty"` - - TargetProtocol string `json:"targetProtocol,omitempty" yaml:"target_protocol,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type LoadBalancerListenerCollection struct { - Collection - Data []LoadBalancerListener `json:"data,omitempty"` -} - -type LoadBalancerListenerClient struct { - rancherClient *RancherClient -} - -type LoadBalancerListenerOperations interface { - List(opts *ListOpts) (*LoadBalancerListenerCollection, error) - Create(opts *LoadBalancerListener) (*LoadBalancerListener, error) - Update(existing *LoadBalancerListener, updates interface{}) (*LoadBalancerListener, error) - ById(id string) (*LoadBalancerListener, error) - Delete(container *LoadBalancerListener) error - - ActionCreate(*LoadBalancerListener) (*LoadBalancerListener, error) - - ActionRemove(*LoadBalancerListener) (*LoadBalancerListener, error) -} - -func newLoadBalancerListenerClient(rancherClient *RancherClient) *LoadBalancerListenerClient { - return &LoadBalancerListenerClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerListenerClient) Create(container *LoadBalancerListener) (*LoadBalancerListener, error) { - resp := &LoadBalancerListener{} - err := c.rancherClient.doCreate(LOAD_BALANCER_LISTENER_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerListenerClient) Update(existing *LoadBalancerListener, updates interface{}) (*LoadBalancerListener, error) { - resp := &LoadBalancerListener{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_LISTENER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerListenerClient) List(opts *ListOpts) (*LoadBalancerListenerCollection, error) { - resp := &LoadBalancerListenerCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_LISTENER_TYPE, opts, resp) - return resp, err -} - -func (c *LoadBalancerListenerClient) ById(id string) (*LoadBalancerListener, error) { - resp := &LoadBalancerListener{} - err := c.rancherClient.doById(LOAD_BALANCER_LISTENER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerListenerClient) Delete(container *LoadBalancerListener) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_LISTENER_TYPE, &container.Resource) -} - -func (c *LoadBalancerListenerClient) ActionCreate(resource *LoadBalancerListener) (*LoadBalancerListener, error) { - - resp := &LoadBalancerListener{} - - err := c.rancherClient.doAction(LOAD_BALANCER_LISTENER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerListenerClient) ActionRemove(resource *LoadBalancerListener) (*LoadBalancerListener, error) { - - resp := &LoadBalancerListener{} - - err := c.rancherClient.doAction(LOAD_BALANCER_LISTENER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_target.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_target.go deleted file mode 100644 index b0037f7be..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_target.go +++ /dev/null @@ -1,132 +0,0 @@ -package client - -const ( - LOAD_BALANCER_TARGET_TYPE = "loadBalancerTarget" -) - -type LoadBalancerTarget struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - IpAddress string `json:"ipAddress,omitempty" yaml:"ip_address,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LoadBalancerId string `json:"loadBalancerId,omitempty" yaml:"load_balancer_id,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type LoadBalancerTargetCollection struct { - Collection - Data []LoadBalancerTarget `json:"data,omitempty"` -} - -type LoadBalancerTargetClient struct { - rancherClient *RancherClient -} - -type LoadBalancerTargetOperations interface { - List(opts *ListOpts) (*LoadBalancerTargetCollection, error) - Create(opts *LoadBalancerTarget) (*LoadBalancerTarget, error) - Update(existing *LoadBalancerTarget, updates interface{}) (*LoadBalancerTarget, error) - ById(id string) (*LoadBalancerTarget, error) - Delete(container *LoadBalancerTarget) error - - ActionCreate(*LoadBalancerTarget) (*LoadBalancerTarget, error) - - ActionRemove(*LoadBalancerTarget) (*LoadBalancerTarget, error) - - ActionUpdate(*LoadBalancerTarget) (*LoadBalancerTarget, error) -} - -func newLoadBalancerTargetClient(rancherClient *RancherClient) *LoadBalancerTargetClient { - return &LoadBalancerTargetClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerTargetClient) Create(container *LoadBalancerTarget) (*LoadBalancerTarget, error) { - resp := &LoadBalancerTarget{} - err := c.rancherClient.doCreate(LOAD_BALANCER_TARGET_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerTargetClient) Update(existing *LoadBalancerTarget, updates interface{}) (*LoadBalancerTarget, error) { - resp := &LoadBalancerTarget{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_TARGET_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerTargetClient) List(opts *ListOpts) (*LoadBalancerTargetCollection, error) { - resp := &LoadBalancerTargetCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_TARGET_TYPE, opts, resp) - return resp, err -} - -func (c *LoadBalancerTargetClient) ById(id string) (*LoadBalancerTarget, error) { - resp := &LoadBalancerTarget{} - err := c.rancherClient.doById(LOAD_BALANCER_TARGET_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerTargetClient) Delete(container *LoadBalancerTarget) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_TARGET_TYPE, &container.Resource) -} - -func (c *LoadBalancerTargetClient) ActionCreate(resource *LoadBalancerTarget) (*LoadBalancerTarget, error) { - - resp := &LoadBalancerTarget{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TARGET_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerTargetClient) ActionRemove(resource *LoadBalancerTarget) (*LoadBalancerTarget, error) { - - resp := &LoadBalancerTarget{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TARGET_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerTargetClient) ActionUpdate(resource *LoadBalancerTarget) (*LoadBalancerTarget, error) { - - resp := &LoadBalancerTarget{} - - err := c.rancherClient.doAction(LOAD_BALANCER_TARGET_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_machine_driver_error_input.go b/vendor/github.com/rancher/go-rancher/client/generated_machine_driver_error_input.go deleted file mode 100644 index f00ec798b..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_machine_driver_error_input.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -const ( - MACHINE_DRIVER_ERROR_INPUT_TYPE = "machineDriverErrorInput" -) - -type MachineDriverErrorInput struct { - Resource - - ErrorMessage string `json:"errorMessage,omitempty" yaml:"error_message,omitempty"` -} - -type MachineDriverErrorInputCollection struct { - Collection - Data []MachineDriverErrorInput `json:"data,omitempty"` -} - -type MachineDriverErrorInputClient struct { - rancherClient *RancherClient -} - -type MachineDriverErrorInputOperations interface { - List(opts *ListOpts) (*MachineDriverErrorInputCollection, error) - Create(opts *MachineDriverErrorInput) (*MachineDriverErrorInput, error) - Update(existing *MachineDriverErrorInput, updates interface{}) (*MachineDriverErrorInput, error) - ById(id string) (*MachineDriverErrorInput, error) - Delete(container *MachineDriverErrorInput) error -} - -func newMachineDriverErrorInputClient(rancherClient *RancherClient) *MachineDriverErrorInputClient { - return &MachineDriverErrorInputClient{ - rancherClient: rancherClient, - } -} - -func (c *MachineDriverErrorInputClient) Create(container *MachineDriverErrorInput) (*MachineDriverErrorInput, error) { - resp := &MachineDriverErrorInput{} - err := c.rancherClient.doCreate(MACHINE_DRIVER_ERROR_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *MachineDriverErrorInputClient) Update(existing *MachineDriverErrorInput, updates interface{}) (*MachineDriverErrorInput, error) { - resp := &MachineDriverErrorInput{} - err := c.rancherClient.doUpdate(MACHINE_DRIVER_ERROR_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MachineDriverErrorInputClient) List(opts *ListOpts) (*MachineDriverErrorInputCollection, error) { - resp := &MachineDriverErrorInputCollection{} - err := c.rancherClient.doList(MACHINE_DRIVER_ERROR_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *MachineDriverErrorInputClient) ById(id string) (*MachineDriverErrorInput, error) { - resp := &MachineDriverErrorInput{} - err := c.rancherClient.doById(MACHINE_DRIVER_ERROR_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *MachineDriverErrorInputClient) Delete(container *MachineDriverErrorInput) error { - return c.rancherClient.doResourceDelete(MACHINE_DRIVER_ERROR_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_machine_driver_update_input.go b/vendor/github.com/rancher/go-rancher/client/generated_machine_driver_update_input.go deleted file mode 100644 index 7e046af56..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_machine_driver_update_input.go +++ /dev/null @@ -1,71 +0,0 @@ -package client - -const ( - MACHINE_DRIVER_UPDATE_INPUT_TYPE = "machineDriverUpdateInput" -) - -type MachineDriverUpdateInput struct { - Resource - - Md5checksum string `json:"md5checksum,omitempty" yaml:"md5checksum,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` -} - -type MachineDriverUpdateInputCollection struct { - Collection - Data []MachineDriverUpdateInput `json:"data,omitempty"` -} - -type MachineDriverUpdateInputClient struct { - rancherClient *RancherClient -} - -type MachineDriverUpdateInputOperations interface { - List(opts *ListOpts) (*MachineDriverUpdateInputCollection, error) - Create(opts *MachineDriverUpdateInput) (*MachineDriverUpdateInput, error) - Update(existing *MachineDriverUpdateInput, updates interface{}) (*MachineDriverUpdateInput, error) - ById(id string) (*MachineDriverUpdateInput, error) - Delete(container *MachineDriverUpdateInput) error -} - -func newMachineDriverUpdateInputClient(rancherClient *RancherClient) *MachineDriverUpdateInputClient { - return &MachineDriverUpdateInputClient{ - rancherClient: rancherClient, - } -} - -func (c *MachineDriverUpdateInputClient) Create(container *MachineDriverUpdateInput) (*MachineDriverUpdateInput, error) { - resp := &MachineDriverUpdateInput{} - err := c.rancherClient.doCreate(MACHINE_DRIVER_UPDATE_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *MachineDriverUpdateInputClient) Update(existing *MachineDriverUpdateInput, updates interface{}) (*MachineDriverUpdateInput, error) { - resp := &MachineDriverUpdateInput{} - err := c.rancherClient.doUpdate(MACHINE_DRIVER_UPDATE_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MachineDriverUpdateInputClient) List(opts *ListOpts) (*MachineDriverUpdateInputCollection, error) { - resp := &MachineDriverUpdateInputCollection{} - err := c.rancherClient.doList(MACHINE_DRIVER_UPDATE_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *MachineDriverUpdateInputClient) ById(id string) (*MachineDriverUpdateInput, error) { - resp := &MachineDriverUpdateInput{} - err := c.rancherClient.doById(MACHINE_DRIVER_UPDATE_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *MachineDriverUpdateInputClient) Delete(container *MachineDriverUpdateInput) error { - return c.rancherClient.doResourceDelete(MACHINE_DRIVER_UPDATE_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_openstack_config.go b/vendor/github.com/rancher/go-rancher/client/generated_openstack_config.go deleted file mode 100644 index db914acf0..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_openstack_config.go +++ /dev/null @@ -1,107 +0,0 @@ -package client - -const ( - OPENSTACK_CONFIG_TYPE = "openstackConfig" -) - -type OpenstackConfig struct { - Resource - - AuthUrl string `json:"authUrl,omitempty" yaml:"auth_url,omitempty"` - - AvailabilityZone string `json:"availabilityZone,omitempty" yaml:"availability_zone,omitempty"` - - DomainId string `json:"domainId,omitempty" yaml:"domain_id,omitempty"` - - DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` - - EndpointType string `json:"endpointType,omitempty" yaml:"endpoint_type,omitempty"` - - FlavorId string `json:"flavorId,omitempty" yaml:"flavor_id,omitempty"` - - FlavorName string `json:"flavorName,omitempty" yaml:"flavor_name,omitempty"` - - FloatingipPool string `json:"floatingipPool,omitempty" yaml:"floatingip_pool,omitempty"` - - ImageId string `json:"imageId,omitempty" yaml:"image_id,omitempty"` - - ImageName string `json:"imageName,omitempty" yaml:"image_name,omitempty"` - - Insecure bool `json:"insecure,omitempty" yaml:"insecure,omitempty"` - - NetId string `json:"netId,omitempty" yaml:"net_id,omitempty"` - - NetName string `json:"netName,omitempty" yaml:"net_name,omitempty"` - - Password string `json:"password,omitempty" yaml:"password,omitempty"` - - Region string `json:"region,omitempty" yaml:"region,omitempty"` - - SecGroups string `json:"secGroups,omitempty" yaml:"sec_groups,omitempty"` - - SshPort string `json:"sshPort,omitempty" yaml:"ssh_port,omitempty"` - - SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` - - TenantId string `json:"tenantId,omitempty" yaml:"tenant_id,omitempty"` - - TenantName string `json:"tenantName,omitempty" yaml:"tenant_name,omitempty"` - - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} - -type OpenstackConfigCollection struct { - Collection - Data []OpenstackConfig `json:"data,omitempty"` -} - -type OpenstackConfigClient struct { - rancherClient *RancherClient -} - -type OpenstackConfigOperations interface { - List(opts *ListOpts) (*OpenstackConfigCollection, error) - Create(opts *OpenstackConfig) (*OpenstackConfig, error) - Update(existing *OpenstackConfig, updates interface{}) (*OpenstackConfig, error) - ById(id string) (*OpenstackConfig, error) - Delete(container *OpenstackConfig) error -} - -func newOpenstackConfigClient(rancherClient *RancherClient) *OpenstackConfigClient { - return &OpenstackConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *OpenstackConfigClient) Create(container *OpenstackConfig) (*OpenstackConfig, error) { - resp := &OpenstackConfig{} - err := c.rancherClient.doCreate(OPENSTACK_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *OpenstackConfigClient) Update(existing *OpenstackConfig, updates interface{}) (*OpenstackConfig, error) { - resp := &OpenstackConfig{} - err := c.rancherClient.doUpdate(OPENSTACK_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *OpenstackConfigClient) List(opts *ListOpts) (*OpenstackConfigCollection, error) { - resp := &OpenstackConfigCollection{} - err := c.rancherClient.doList(OPENSTACK_CONFIG_TYPE, opts, resp) - return resp, err -} - -func (c *OpenstackConfigClient) ById(id string) (*OpenstackConfig, error) { - resp := &OpenstackConfig{} - err := c.rancherClient.doById(OPENSTACK_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *OpenstackConfigClient) Delete(container *OpenstackConfig) error { - return c.rancherClient.doResourceDelete(OPENSTACK_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_rackspace_config.go b/vendor/github.com/rancher/go-rancher/client/generated_rackspace_config.go deleted file mode 100644 index 868e96f4e..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_rackspace_config.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - RACKSPACE_CONFIG_TYPE = "rackspaceConfig" -) - -type RackspaceConfig struct { - Resource - - ApiKey string `json:"apiKey,omitempty" yaml:"api_key,omitempty"` - - DockerInstall string `json:"dockerInstall,omitempty" yaml:"docker_install,omitempty"` - - EndpointType string `json:"endpointType,omitempty" yaml:"endpoint_type,omitempty"` - - FlavorId string `json:"flavorId,omitempty" yaml:"flavor_id,omitempty"` - - ImageId string `json:"imageId,omitempty" yaml:"image_id,omitempty"` - - Region string `json:"region,omitempty" yaml:"region,omitempty"` - - SshPort string `json:"sshPort,omitempty" yaml:"ssh_port,omitempty"` - - SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` - - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} - -type RackspaceConfigCollection struct { - Collection - Data []RackspaceConfig `json:"data,omitempty"` -} - -type RackspaceConfigClient struct { - rancherClient *RancherClient -} - -type RackspaceConfigOperations interface { - List(opts *ListOpts) (*RackspaceConfigCollection, error) - Create(opts *RackspaceConfig) (*RackspaceConfig, error) - Update(existing *RackspaceConfig, updates interface{}) (*RackspaceConfig, error) - ById(id string) (*RackspaceConfig, error) - Delete(container *RackspaceConfig) error -} - -func newRackspaceConfigClient(rancherClient *RancherClient) *RackspaceConfigClient { - return &RackspaceConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *RackspaceConfigClient) Create(container *RackspaceConfig) (*RackspaceConfig, error) { - resp := &RackspaceConfig{} - err := c.rancherClient.doCreate(RACKSPACE_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *RackspaceConfigClient) Update(existing *RackspaceConfig, updates interface{}) (*RackspaceConfig, error) { - resp := &RackspaceConfig{} - err := c.rancherClient.doUpdate(RACKSPACE_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RackspaceConfigClient) List(opts *ListOpts) (*RackspaceConfigCollection, error) { - resp := &RackspaceConfigCollection{} - err := c.rancherClient.doList(RACKSPACE_CONFIG_TYPE, opts, resp) - return resp, err -} - -func (c *RackspaceConfigClient) ById(id string) (*RackspaceConfig, error) { - resp := &RackspaceConfig{} - err := c.rancherClient.doById(RACKSPACE_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RackspaceConfigClient) Delete(container *RackspaceConfig) error { - return c.rancherClient.doResourceDelete(RACKSPACE_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_remove_label_input.go b/vendor/github.com/rancher/go-rancher/client/generated_remove_label_input.go deleted file mode 100644 index 84e47e7c3..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_remove_label_input.go +++ /dev/null @@ -1,62 +0,0 @@ -package client - -const ( - REMOVE_LABEL_INPUT_TYPE = "removeLabelInput" -) - -type RemoveLabelInput struct { - Resource - - Label string `json:"label,omitempty"` -} - -type RemoveLabelInputCollection struct { - Collection - Data []RemoveLabelInput `json:"data,omitempty"` -} - -type RemoveLabelInputClient struct { - rancherClient *RancherClient -} - -type RemoveLabelInputOperations interface { - List(opts *ListOpts) (*RemoveLabelInputCollection, error) - Create(opts *RemoveLabelInput) (*RemoveLabelInput, error) - Update(existing *RemoveLabelInput, updates interface{}) (*RemoveLabelInput, error) - ById(id string) (*RemoveLabelInput, error) - Delete(container *RemoveLabelInput) error -} - -func newRemoveLabelInputClient(rancherClient *RancherClient) *RemoveLabelInputClient { - return &RemoveLabelInputClient{ - rancherClient: rancherClient, - } -} - -func (c *RemoveLabelInputClient) Create(container *RemoveLabelInput) (*RemoveLabelInput, error) { - resp := &RemoveLabelInput{} - err := c.rancherClient.doCreate(REMOVE_LABEL_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *RemoveLabelInputClient) Update(existing *RemoveLabelInput, updates interface{}) (*RemoveLabelInput, error) { - resp := &RemoveLabelInput{} - err := c.rancherClient.doUpdate(REMOVE_LABEL_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RemoveLabelInputClient) List(opts *ListOpts) (*RemoveLabelInputCollection, error) { - resp := &RemoveLabelInputCollection{} - err := c.rancherClient.doList(REMOVE_LABEL_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *RemoveLabelInputClient) ById(id string) (*RemoveLabelInput, error) { - resp := &RemoveLabelInput{} - err := c.rancherClient.doById(REMOVE_LABEL_INPUT_TYPE, id, resp) - return resp, err -} - -func (c *RemoveLabelInputClient) Delete(container *RemoveLabelInput) error { - return c.rancherClient.doResourceDelete(REMOVE_LABEL_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_remove_load_balancer_input.go b/vendor/github.com/rancher/go-rancher/client/generated_remove_load_balancer_input.go deleted file mode 100644 index f6a2c1b9e..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_remove_load_balancer_input.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -const ( - REMOVE_LOAD_BALANCER_INPUT_TYPE = "removeLoadBalancerInput" -) - -type RemoveLoadBalancerInput struct { - Resource - - LoadBalancerId string `json:"loadBalancerId,omitempty" yaml:"load_balancer_id,omitempty"` -} - -type RemoveLoadBalancerInputCollection struct { - Collection - Data []RemoveLoadBalancerInput `json:"data,omitempty"` -} - -type RemoveLoadBalancerInputClient struct { - rancherClient *RancherClient -} - -type RemoveLoadBalancerInputOperations interface { - List(opts *ListOpts) (*RemoveLoadBalancerInputCollection, error) - Create(opts *RemoveLoadBalancerInput) (*RemoveLoadBalancerInput, error) - Update(existing *RemoveLoadBalancerInput, updates interface{}) (*RemoveLoadBalancerInput, error) - ById(id string) (*RemoveLoadBalancerInput, error) - Delete(container *RemoveLoadBalancerInput) error -} - -func newRemoveLoadBalancerInputClient(rancherClient *RancherClient) *RemoveLoadBalancerInputClient { - return &RemoveLoadBalancerInputClient{ - rancherClient: rancherClient, - } -} - -func (c *RemoveLoadBalancerInputClient) Create(container *RemoveLoadBalancerInput) (*RemoveLoadBalancerInput, error) { - resp := &RemoveLoadBalancerInput{} - err := c.rancherClient.doCreate(REMOVE_LOAD_BALANCER_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *RemoveLoadBalancerInputClient) Update(existing *RemoveLoadBalancerInput, updates interface{}) (*RemoveLoadBalancerInput, error) { - resp := &RemoveLoadBalancerInput{} - err := c.rancherClient.doUpdate(REMOVE_LOAD_BALANCER_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RemoveLoadBalancerInputClient) List(opts *ListOpts) (*RemoveLoadBalancerInputCollection, error) { - resp := &RemoveLoadBalancerInputCollection{} - err := c.rancherClient.doList(REMOVE_LOAD_BALANCER_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *RemoveLoadBalancerInputClient) ById(id string) (*RemoveLoadBalancerInput, error) { - resp := &RemoveLoadBalancerInput{} - err := c.rancherClient.doById(REMOVE_LOAD_BALANCER_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RemoveLoadBalancerInputClient) Delete(container *RemoveLoadBalancerInput) error { - return c.rancherClient.doResourceDelete(REMOVE_LOAD_BALANCER_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_hosts_input.go b/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_hosts_input.go deleted file mode 100644 index 753abc62f..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_hosts_input.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -const ( - SET_LOAD_BALANCER_HOSTS_INPUT_TYPE = "setLoadBalancerHostsInput" -) - -type SetLoadBalancerHostsInput struct { - Resource - - HostIds []string `json:"hostIds,omitempty" yaml:"host_ids,omitempty"` -} - -type SetLoadBalancerHostsInputCollection struct { - Collection - Data []SetLoadBalancerHostsInput `json:"data,omitempty"` -} - -type SetLoadBalancerHostsInputClient struct { - rancherClient *RancherClient -} - -type SetLoadBalancerHostsInputOperations interface { - List(opts *ListOpts) (*SetLoadBalancerHostsInputCollection, error) - Create(opts *SetLoadBalancerHostsInput) (*SetLoadBalancerHostsInput, error) - Update(existing *SetLoadBalancerHostsInput, updates interface{}) (*SetLoadBalancerHostsInput, error) - ById(id string) (*SetLoadBalancerHostsInput, error) - Delete(container *SetLoadBalancerHostsInput) error -} - -func newSetLoadBalancerHostsInputClient(rancherClient *RancherClient) *SetLoadBalancerHostsInputClient { - return &SetLoadBalancerHostsInputClient{ - rancherClient: rancherClient, - } -} - -func (c *SetLoadBalancerHostsInputClient) Create(container *SetLoadBalancerHostsInput) (*SetLoadBalancerHostsInput, error) { - resp := &SetLoadBalancerHostsInput{} - err := c.rancherClient.doCreate(SET_LOAD_BALANCER_HOSTS_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *SetLoadBalancerHostsInputClient) Update(existing *SetLoadBalancerHostsInput, updates interface{}) (*SetLoadBalancerHostsInput, error) { - resp := &SetLoadBalancerHostsInput{} - err := c.rancherClient.doUpdate(SET_LOAD_BALANCER_HOSTS_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SetLoadBalancerHostsInputClient) List(opts *ListOpts) (*SetLoadBalancerHostsInputCollection, error) { - resp := &SetLoadBalancerHostsInputCollection{} - err := c.rancherClient.doList(SET_LOAD_BALANCER_HOSTS_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *SetLoadBalancerHostsInputClient) ById(id string) (*SetLoadBalancerHostsInput, error) { - resp := &SetLoadBalancerHostsInput{} - err := c.rancherClient.doById(SET_LOAD_BALANCER_HOSTS_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SetLoadBalancerHostsInputClient) Delete(container *SetLoadBalancerHostsInput) error { - return c.rancherClient.doResourceDelete(SET_LOAD_BALANCER_HOSTS_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_listeners_input.go b/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_listeners_input.go deleted file mode 100644 index 31aaa9c56..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_listeners_input.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -const ( - SET_LOAD_BALANCER_LISTENERS_INPUT_TYPE = "setLoadBalancerListenersInput" -) - -type SetLoadBalancerListenersInput struct { - Resource - - LoadBalancerListenerIds []string `json:"loadBalancerListenerIds,omitempty" yaml:"load_balancer_listener_ids,omitempty"` -} - -type SetLoadBalancerListenersInputCollection struct { - Collection - Data []SetLoadBalancerListenersInput `json:"data,omitempty"` -} - -type SetLoadBalancerListenersInputClient struct { - rancherClient *RancherClient -} - -type SetLoadBalancerListenersInputOperations interface { - List(opts *ListOpts) (*SetLoadBalancerListenersInputCollection, error) - Create(opts *SetLoadBalancerListenersInput) (*SetLoadBalancerListenersInput, error) - Update(existing *SetLoadBalancerListenersInput, updates interface{}) (*SetLoadBalancerListenersInput, error) - ById(id string) (*SetLoadBalancerListenersInput, error) - Delete(container *SetLoadBalancerListenersInput) error -} - -func newSetLoadBalancerListenersInputClient(rancherClient *RancherClient) *SetLoadBalancerListenersInputClient { - return &SetLoadBalancerListenersInputClient{ - rancherClient: rancherClient, - } -} - -func (c *SetLoadBalancerListenersInputClient) Create(container *SetLoadBalancerListenersInput) (*SetLoadBalancerListenersInput, error) { - resp := &SetLoadBalancerListenersInput{} - err := c.rancherClient.doCreate(SET_LOAD_BALANCER_LISTENERS_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *SetLoadBalancerListenersInputClient) Update(existing *SetLoadBalancerListenersInput, updates interface{}) (*SetLoadBalancerListenersInput, error) { - resp := &SetLoadBalancerListenersInput{} - err := c.rancherClient.doUpdate(SET_LOAD_BALANCER_LISTENERS_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SetLoadBalancerListenersInputClient) List(opts *ListOpts) (*SetLoadBalancerListenersInputCollection, error) { - resp := &SetLoadBalancerListenersInputCollection{} - err := c.rancherClient.doList(SET_LOAD_BALANCER_LISTENERS_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *SetLoadBalancerListenersInputClient) ById(id string) (*SetLoadBalancerListenersInput, error) { - resp := &SetLoadBalancerListenersInput{} - err := c.rancherClient.doById(SET_LOAD_BALANCER_LISTENERS_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SetLoadBalancerListenersInputClient) Delete(container *SetLoadBalancerListenersInput) error { - return c.rancherClient.doResourceDelete(SET_LOAD_BALANCER_LISTENERS_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_targets_input.go b/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_targets_input.go deleted file mode 100644 index cef13a355..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_targets_input.go +++ /dev/null @@ -1,67 +0,0 @@ -package client - -const ( - SET_LOAD_BALANCER_TARGETS_INPUT_TYPE = "setLoadBalancerTargetsInput" -) - -type SetLoadBalancerTargetsInput struct { - Resource - - LoadBalancerTargets []interface{} `json:"loadBalancerTargets,omitempty" yaml:"load_balancer_targets,omitempty"` -} - -type SetLoadBalancerTargetsInputCollection struct { - Collection - Data []SetLoadBalancerTargetsInput `json:"data,omitempty"` -} - -type SetLoadBalancerTargetsInputClient struct { - rancherClient *RancherClient -} - -type SetLoadBalancerTargetsInputOperations interface { - List(opts *ListOpts) (*SetLoadBalancerTargetsInputCollection, error) - Create(opts *SetLoadBalancerTargetsInput) (*SetLoadBalancerTargetsInput, error) - Update(existing *SetLoadBalancerTargetsInput, updates interface{}) (*SetLoadBalancerTargetsInput, error) - ById(id string) (*SetLoadBalancerTargetsInput, error) - Delete(container *SetLoadBalancerTargetsInput) error -} - -func newSetLoadBalancerTargetsInputClient(rancherClient *RancherClient) *SetLoadBalancerTargetsInputClient { - return &SetLoadBalancerTargetsInputClient{ - rancherClient: rancherClient, - } -} - -func (c *SetLoadBalancerTargetsInputClient) Create(container *SetLoadBalancerTargetsInput) (*SetLoadBalancerTargetsInput, error) { - resp := &SetLoadBalancerTargetsInput{} - err := c.rancherClient.doCreate(SET_LOAD_BALANCER_TARGETS_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *SetLoadBalancerTargetsInputClient) Update(existing *SetLoadBalancerTargetsInput, updates interface{}) (*SetLoadBalancerTargetsInput, error) { - resp := &SetLoadBalancerTargetsInput{} - err := c.rancherClient.doUpdate(SET_LOAD_BALANCER_TARGETS_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SetLoadBalancerTargetsInputClient) List(opts *ListOpts) (*SetLoadBalancerTargetsInputCollection, error) { - resp := &SetLoadBalancerTargetsInputCollection{} - err := c.rancherClient.doList(SET_LOAD_BALANCER_TARGETS_INPUT_TYPE, opts, resp) - return resp, err -} - -func (c *SetLoadBalancerTargetsInputClient) ById(id string) (*SetLoadBalancerTargetsInput, error) { - resp := &SetLoadBalancerTargetsInput{} - err := c.rancherClient.doById(SET_LOAD_BALANCER_TARGETS_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SetLoadBalancerTargetsInputClient) Delete(container *SetLoadBalancerTargetsInput) error { - return c.rancherClient.doResourceDelete(SET_LOAD_BALANCER_TARGETS_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_softlayer_config.go b/vendor/github.com/rancher/go-rancher/client/generated_softlayer_config.go deleted file mode 100644 index 500d5a90f..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_softlayer_config.go +++ /dev/null @@ -1,95 +0,0 @@ -package client - -const ( - SOFTLAYER_CONFIG_TYPE = "softlayerConfig" -) - -type SoftlayerConfig struct { - Resource - - ApiEndpoint string `json:"apiEndpoint,omitempty" yaml:"api_endpoint,omitempty"` - - ApiKey string `json:"apiKey,omitempty" yaml:"api_key,omitempty"` - - Cpu string `json:"cpu,omitempty" yaml:"cpu,omitempty"` - - DiskSize string `json:"diskSize,omitempty" yaml:"disk_size,omitempty"` - - Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - HourlyBilling bool `json:"hourlyBilling,omitempty" yaml:"hourly_billing,omitempty"` - - Image string `json:"image,omitempty" yaml:"image,omitempty"` - - LocalDisk bool `json:"localDisk,omitempty" yaml:"local_disk,omitempty"` - - Memory string `json:"memory,omitempty" yaml:"memory,omitempty"` - - PrivateNetOnly bool `json:"privateNetOnly,omitempty" yaml:"private_net_only,omitempty"` - - PrivateVlanId string `json:"privateVlanId,omitempty" yaml:"private_vlan_id,omitempty"` - - PublicVlanId string `json:"publicVlanId,omitempty" yaml:"public_vlan_id,omitempty"` - - Region string `json:"region,omitempty" yaml:"region,omitempty"` - - User string `json:"user,omitempty" yaml:"user,omitempty"` -} - -type SoftlayerConfigCollection struct { - Collection - Data []SoftlayerConfig `json:"data,omitempty"` -} - -type SoftlayerConfigClient struct { - rancherClient *RancherClient -} - -type SoftlayerConfigOperations interface { - List(opts *ListOpts) (*SoftlayerConfigCollection, error) - Create(opts *SoftlayerConfig) (*SoftlayerConfig, error) - Update(existing *SoftlayerConfig, updates interface{}) (*SoftlayerConfig, error) - ById(id string) (*SoftlayerConfig, error) - Delete(container *SoftlayerConfig) error -} - -func newSoftlayerConfigClient(rancherClient *RancherClient) *SoftlayerConfigClient { - return &SoftlayerConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *SoftlayerConfigClient) Create(container *SoftlayerConfig) (*SoftlayerConfig, error) { - resp := &SoftlayerConfig{} - err := c.rancherClient.doCreate(SOFTLAYER_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *SoftlayerConfigClient) Update(existing *SoftlayerConfig, updates interface{}) (*SoftlayerConfig, error) { - resp := &SoftlayerConfig{} - err := c.rancherClient.doUpdate(SOFTLAYER_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SoftlayerConfigClient) List(opts *ListOpts) (*SoftlayerConfigCollection, error) { - resp := &SoftlayerConfigCollection{} - err := c.rancherClient.doList(SOFTLAYER_CONFIG_TYPE, opts, resp) - return resp, err -} - -func (c *SoftlayerConfigClient) ById(id string) (*SoftlayerConfig, error) { - resp := &SoftlayerConfig{} - err := c.rancherClient.doById(SOFTLAYER_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SoftlayerConfigClient) Delete(container *SoftlayerConfig) error { - return c.rancherClient.doResourceDelete(SOFTLAYER_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_ubiquity_config.go b/vendor/github.com/rancher/go-rancher/client/generated_ubiquity_config.go deleted file mode 100644 index 63f91d688..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_ubiquity_config.go +++ /dev/null @@ -1,77 +0,0 @@ -package client - -const ( - UBIQUITY_CONFIG_TYPE = "ubiquityConfig" -) - -type UbiquityConfig struct { - Resource - - ApiToken string `json:"apiToken,omitempty" yaml:"api_token,omitempty"` - - ApiUsername string `json:"apiUsername,omitempty" yaml:"api_username,omitempty"` - - ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"` - - FlavorId string `json:"flavorId,omitempty" yaml:"flavor_id,omitempty"` - - ImageId string `json:"imageId,omitempty" yaml:"image_id,omitempty"` - - ZoneId string `json:"zoneId,omitempty" yaml:"zone_id,omitempty"` -} - -type UbiquityConfigCollection struct { - Collection - Data []UbiquityConfig `json:"data,omitempty"` -} - -type UbiquityConfigClient struct { - rancherClient *RancherClient -} - -type UbiquityConfigOperations interface { - List(opts *ListOpts) (*UbiquityConfigCollection, error) - Create(opts *UbiquityConfig) (*UbiquityConfig, error) - Update(existing *UbiquityConfig, updates interface{}) (*UbiquityConfig, error) - ById(id string) (*UbiquityConfig, error) - Delete(container *UbiquityConfig) error -} - -func newUbiquityConfigClient(rancherClient *RancherClient) *UbiquityConfigClient { - return &UbiquityConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *UbiquityConfigClient) Create(container *UbiquityConfig) (*UbiquityConfig, error) { - resp := &UbiquityConfig{} - err := c.rancherClient.doCreate(UBIQUITY_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *UbiquityConfigClient) Update(existing *UbiquityConfig, updates interface{}) (*UbiquityConfig, error) { - resp := &UbiquityConfig{} - err := c.rancherClient.doUpdate(UBIQUITY_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *UbiquityConfigClient) List(opts *ListOpts) (*UbiquityConfigCollection, error) { - resp := &UbiquityConfigCollection{} - err := c.rancherClient.doList(UBIQUITY_CONFIG_TYPE, opts, resp) - return resp, err -} - -func (c *UbiquityConfigClient) ById(id string) (*UbiquityConfig, error) { - resp := &UbiquityConfig{} - err := c.rancherClient.doById(UBIQUITY_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *UbiquityConfigClient) Delete(container *UbiquityConfig) error { - return c.rancherClient.doResourceDelete(UBIQUITY_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_user_preference.go b/vendor/github.com/rancher/go-rancher/client/generated_user_preference.go deleted file mode 100644 index 5d2203b6d..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_user_preference.go +++ /dev/null @@ -1,165 +0,0 @@ -package client - -const ( - USER_PREFERENCE_TYPE = "userPreference" -) - -type UserPreference struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type UserPreferenceCollection struct { - Collection - Data []UserPreference `json:"data,omitempty"` -} - -type UserPreferenceClient struct { - rancherClient *RancherClient -} - -type UserPreferenceOperations interface { - List(opts *ListOpts) (*UserPreferenceCollection, error) - Create(opts *UserPreference) (*UserPreference, error) - Update(existing *UserPreference, updates interface{}) (*UserPreference, error) - ById(id string) (*UserPreference, error) - Delete(container *UserPreference) error - - ActionActivate(*UserPreference) (*UserPreference, error) - - ActionCreate(*UserPreference) (*UserPreference, error) - - ActionDeactivate(*UserPreference) (*UserPreference, error) - - ActionPurge(*UserPreference) (*UserPreference, error) - - ActionRemove(*UserPreference) (*UserPreference, error) - - ActionRestore(*UserPreference) (*UserPreference, error) - - ActionUpdate(*UserPreference) (*UserPreference, error) -} - -func newUserPreferenceClient(rancherClient *RancherClient) *UserPreferenceClient { - return &UserPreferenceClient{ - rancherClient: rancherClient, - } -} - -func (c *UserPreferenceClient) Create(container *UserPreference) (*UserPreference, error) { - resp := &UserPreference{} - err := c.rancherClient.doCreate(USER_PREFERENCE_TYPE, container, resp) - return resp, err -} - -func (c *UserPreferenceClient) Update(existing *UserPreference, updates interface{}) (*UserPreference, error) { - resp := &UserPreference{} - err := c.rancherClient.doUpdate(USER_PREFERENCE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *UserPreferenceClient) List(opts *ListOpts) (*UserPreferenceCollection, error) { - resp := &UserPreferenceCollection{} - err := c.rancherClient.doList(USER_PREFERENCE_TYPE, opts, resp) - return resp, err -} - -func (c *UserPreferenceClient) ById(id string) (*UserPreference, error) { - resp := &UserPreference{} - err := c.rancherClient.doById(USER_PREFERENCE_TYPE, id, resp) - return resp, err -} - -func (c *UserPreferenceClient) Delete(container *UserPreference) error { - return c.rancherClient.doResourceDelete(USER_PREFERENCE_TYPE, &container.Resource) -} - -func (c *UserPreferenceClient) ActionActivate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionCreate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionDeactivate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionPurge(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionRemove(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionRestore(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionUpdate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_virtualbox_config.go b/vendor/github.com/rancher/go-rancher/client/generated_virtualbox_config.go deleted file mode 100644 index 0a9e38358..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_virtualbox_config.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - VIRTUALBOX_CONFIG_TYPE = "virtualboxConfig" -) - -type VirtualboxConfig struct { - Resource - - Boot2dockerUrl string `json:"boot2dockerUrl,omitempty" yaml:"boot2docker_url,omitempty"` - - CpuCount string `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` - - DiskSize string `json:"diskSize,omitempty" yaml:"disk_size,omitempty"` - - HostonlyCidr string `json:"hostonlyCidr,omitempty" yaml:"hostonly_cidr,omitempty"` - - ImportBoot2dockerVm string `json:"importBoot2dockerVm,omitempty" yaml:"import_boot2docker_vm,omitempty"` - - Memory string `json:"memory,omitempty" yaml:"memory,omitempty"` - - NoShare bool `json:"noShare,omitempty" yaml:"no_share,omitempty"` -} - -type VirtualboxConfigCollection struct { - Collection - Data []VirtualboxConfig `json:"data,omitempty"` -} - -type VirtualboxConfigClient struct { - rancherClient *RancherClient -} - -type VirtualboxConfigOperations interface { - List(opts *ListOpts) (*VirtualboxConfigCollection, error) - Create(opts *VirtualboxConfig) (*VirtualboxConfig, error) - Update(existing *VirtualboxConfig, updates interface{}) (*VirtualboxConfig, error) - ById(id string) (*VirtualboxConfig, error) - Delete(container *VirtualboxConfig) error -} - -func newVirtualboxConfigClient(rancherClient *RancherClient) *VirtualboxConfigClient { - return &VirtualboxConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *VirtualboxConfigClient) Create(container *VirtualboxConfig) (*VirtualboxConfig, error) { - resp := &VirtualboxConfig{} - err := c.rancherClient.doCreate(VIRTUALBOX_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *VirtualboxConfigClient) Update(existing *VirtualboxConfig, updates interface{}) (*VirtualboxConfig, error) { - resp := &VirtualboxConfig{} - err := c.rancherClient.doUpdate(VIRTUALBOX_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VirtualboxConfigClient) List(opts *ListOpts) (*VirtualboxConfigCollection, error) { - resp := &VirtualboxConfigCollection{} - err := c.rancherClient.doList(VIRTUALBOX_CONFIG_TYPE, opts, resp) - return resp, err -} - -func (c *VirtualboxConfigClient) ById(id string) (*VirtualboxConfig, error) { - resp := &VirtualboxConfig{} - err := c.rancherClient.doById(VIRTUALBOX_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VirtualboxConfigClient) Delete(container *VirtualboxConfig) error { - return c.rancherClient.doResourceDelete(VIRTUALBOX_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_vmwarevcloudair_config.go b/vendor/github.com/rancher/go-rancher/client/generated_vmwarevcloudair_config.go deleted file mode 100644 index 12f962f4d..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_vmwarevcloudair_config.go +++ /dev/null @@ -1,93 +0,0 @@ -package client - -const ( - VMWAREVCLOUDAIR_CONFIG_TYPE = "vmwarevcloudairConfig" -) - -type VmwarevcloudairConfig struct { - Resource - - Catalog string `json:"catalog,omitempty" yaml:"catalog,omitempty"` - - Catalogitem string `json:"catalogitem,omitempty" yaml:"catalogitem,omitempty"` - - Computeid string `json:"computeid,omitempty" yaml:"computeid,omitempty"` - - CpuCount string `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` - - DockerPort string `json:"dockerPort,omitempty" yaml:"docker_port,omitempty"` - - Edgegateway string `json:"edgegateway,omitempty" yaml:"edgegateway,omitempty"` - - MemorySize string `json:"memorySize,omitempty" yaml:"memory_size,omitempty"` - - Orgvdcnetwork string `json:"orgvdcnetwork,omitempty" yaml:"orgvdcnetwork,omitempty"` - - Password string `json:"password,omitempty" yaml:"password,omitempty"` - - Provision bool `json:"provision,omitempty" yaml:"provision,omitempty"` - - Publicip string `json:"publicip,omitempty" yaml:"publicip,omitempty"` - - SshPort string `json:"sshPort,omitempty" yaml:"ssh_port,omitempty"` - - Username string `json:"username,omitempty" yaml:"username,omitempty"` - - Vdcid string `json:"vdcid,omitempty" yaml:"vdcid,omitempty"` -} - -type VmwarevcloudairConfigCollection struct { - Collection - Data []VmwarevcloudairConfig `json:"data,omitempty"` -} - -type VmwarevcloudairConfigClient struct { - rancherClient *RancherClient -} - -type VmwarevcloudairConfigOperations interface { - List(opts *ListOpts) (*VmwarevcloudairConfigCollection, error) - Create(opts *VmwarevcloudairConfig) (*VmwarevcloudairConfig, error) - Update(existing *VmwarevcloudairConfig, updates interface{}) (*VmwarevcloudairConfig, error) - ById(id string) (*VmwarevcloudairConfig, error) - Delete(container *VmwarevcloudairConfig) error -} - -func newVmwarevcloudairConfigClient(rancherClient *RancherClient) *VmwarevcloudairConfigClient { - return &VmwarevcloudairConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *VmwarevcloudairConfigClient) Create(container *VmwarevcloudairConfig) (*VmwarevcloudairConfig, error) { - resp := &VmwarevcloudairConfig{} - err := c.rancherClient.doCreate(VMWAREVCLOUDAIR_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *VmwarevcloudairConfigClient) Update(existing *VmwarevcloudairConfig, updates interface{}) (*VmwarevcloudairConfig, error) { - resp := &VmwarevcloudairConfig{} - err := c.rancherClient.doUpdate(VMWAREVCLOUDAIR_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VmwarevcloudairConfigClient) List(opts *ListOpts) (*VmwarevcloudairConfigCollection, error) { - resp := &VmwarevcloudairConfigCollection{} - err := c.rancherClient.doList(VMWAREVCLOUDAIR_CONFIG_TYPE, opts, resp) - return resp, err -} - -func (c *VmwarevcloudairConfigClient) ById(id string) (*VmwarevcloudairConfig, error) { - resp := &VmwarevcloudairConfig{} - err := c.rancherClient.doById(VMWAREVCLOUDAIR_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VmwarevcloudairConfigClient) Delete(container *VmwarevcloudairConfig) error { - return c.rancherClient.doResourceDelete(VMWAREVCLOUDAIR_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_vmwarevsphere_config.go b/vendor/github.com/rancher/go-rancher/client/generated_vmwarevsphere_config.go deleted file mode 100644 index f6cb9d211..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_vmwarevsphere_config.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - VMWAREVSPHERE_CONFIG_TYPE = "vmwarevsphereConfig" -) - -type VmwarevsphereConfig struct { - Resource - - Boot2dockerUrl string `json:"boot2dockerUrl,omitempty" yaml:"boot2docker_url,omitempty"` - - ComputeIp string `json:"computeIp,omitempty" yaml:"compute_ip,omitempty"` - - CpuCount string `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` - - Datacenter string `json:"datacenter,omitempty" yaml:"datacenter,omitempty"` - - Datastore string `json:"datastore,omitempty" yaml:"datastore,omitempty"` - - DiskSize string `json:"diskSize,omitempty" yaml:"disk_size,omitempty"` - - MemorySize string `json:"memorySize,omitempty" yaml:"memory_size,omitempty"` - - Network string `json:"network,omitempty" yaml:"network,omitempty"` - - Password string `json:"password,omitempty" yaml:"password,omitempty"` - - Pool string `json:"pool,omitempty" yaml:"pool,omitempty"` - - Username string `json:"username,omitempty" yaml:"username,omitempty"` - - Vcenter string `json:"vcenter,omitempty" yaml:"vcenter,omitempty"` -} - -type VmwarevsphereConfigCollection struct { - Collection - Data []VmwarevsphereConfig `json:"data,omitempty"` -} - -type VmwarevsphereConfigClient struct { - rancherClient *RancherClient -} - -type VmwarevsphereConfigOperations interface { - List(opts *ListOpts) (*VmwarevsphereConfigCollection, error) - Create(opts *VmwarevsphereConfig) (*VmwarevsphereConfig, error) - Update(existing *VmwarevsphereConfig, updates interface{}) (*VmwarevsphereConfig, error) - ById(id string) (*VmwarevsphereConfig, error) - Delete(container *VmwarevsphereConfig) error -} - -func newVmwarevsphereConfigClient(rancherClient *RancherClient) *VmwarevsphereConfigClient { - return &VmwarevsphereConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *VmwarevsphereConfigClient) Create(container *VmwarevsphereConfig) (*VmwarevsphereConfig, error) { - resp := &VmwarevsphereConfig{} - err := c.rancherClient.doCreate(VMWAREVSPHERE_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *VmwarevsphereConfigClient) Update(existing *VmwarevsphereConfig, updates interface{}) (*VmwarevsphereConfig, error) { - resp := &VmwarevsphereConfig{} - err := c.rancherClient.doUpdate(VMWAREVSPHERE_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VmwarevsphereConfigClient) List(opts *ListOpts) (*VmwarevsphereConfigCollection, error) { - resp := &VmwarevsphereConfigCollection{} - err := c.rancherClient.doList(VMWAREVSPHERE_CONFIG_TYPE, opts, resp) - return resp, err -} - -func (c *VmwarevsphereConfigClient) ById(id string) (*VmwarevsphereConfig, error) { - resp := &VmwarevsphereConfig{} - err := c.rancherClient.doById(VMWAREVSPHERE_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VmwarevsphereConfigClient) Delete(container *VmwarevsphereConfig) error { - return c.rancherClient.doResourceDelete(VMWAREVSPHERE_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/hostaccess/instance.go b/vendor/github.com/rancher/go-rancher/hostaccess/instance.go index c6bfd97c9..e65df5cac 100644 --- a/vendor/github.com/rancher/go-rancher/hostaccess/instance.go +++ b/vendor/github.com/rancher/go-rancher/hostaccess/instance.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/gorilla/websocket" - "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" ) type RancherWebsocketClient client.RancherClient diff --git a/vendor/github.com/rancher/go-rancher/schemas.json b/vendor/github.com/rancher/go-rancher/schemas.json deleted file mode 100644 index 40e810e46..000000000 --- a/vendor/github.com/rancher/go-rancher/schemas.json +++ /dev/null @@ -1,25862 +0,0 @@ -{ - "type": "collection", - "resourceType": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas" - }, - "createTypes": {}, - "actions": {}, - "data": [ - { - "id": "schema", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/schema", - "collection": "http://localhost:8080/v1/schemas" - }, - "actions": {}, - "pluralName": "schemas", - "resourceFields": { - "collectionActions": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "collectionFields": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "collectionFilters": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "collectionMethods": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "includeableLinks": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "pluralName": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "resourceActions": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "resourceFields": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "resourceMethods": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "subscribe", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/subscribe", - "collection": "http://localhost:8080/v1/subscribe" - }, - "actions": {}, - "pluralName": "subscribe", - "resourceFields": { - "agentId": { - "type": "reference[agent]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "eventNames": { - "type": "array[string]", - "validChars": "*._0-9a-zA-Z;=", - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": 1, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "eventNames": { - "modifiers": [ - "eq" - ] - } - }, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "publish", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/publish" - }, - "actions": {}, - "pluralName": "publish", - "resourceFields": { - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "id": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "previousIds": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "publisher": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "resourceId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "resourceType": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "time": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioning": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningInternalMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "restartPolicy", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/restartpolicy" - }, - "actions": {}, - "pluralName": "restartPolicys", - "resourceFields": { - "maximumRetryCount": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "loadBalancerHealthCheck", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/loadbalancerhealthcheck" - }, - "actions": {}, - "pluralName": "loadBalancerHealthChecks", - "resourceFields": { - "healthyThreshold": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "interval": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "requestLine": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "responseTimeout": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "unhealthyThreshold": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "loadBalancerCookieStickinessPolicy", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/loadbalancercookiestickinesspolicy" - }, - "actions": {}, - "pluralName": "loadBalancerCookieStickinessPolicys", - "resourceFields": { - "cookie": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "domain": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "indirect": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "mode": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "rewrite", - "insert", - "prefix" - ], - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "nocache": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "postonly": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "loadBalancerAppCookieStickinessPolicy", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/loadbalancerappcookiestickinesspolicy" - }, - "actions": {}, - "pluralName": "loadBalancerAppCookieStickinessPolicys", - "resourceFields": { - "cookie": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "maxLength": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "mode": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "path_parameters", - "query_string" - ], - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "prefix": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "requestLearn": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "timeout": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "globalLoadBalancerPolicy", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/globalloadbalancerpolicy" - }, - "actions": {}, - "pluralName": "globalLoadBalancerPolicys", - "resourceFields": { - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "globalLoadBalancerHealthCheck", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/globalloadbalancerhealthcheck" - }, - "actions": {}, - "pluralName": "globalLoadBalancerHealthChecks", - "resourceFields": { - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "externalHandlerProcessConfig", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/externalhandlerprocessconfig" - }, - "actions": {}, - "pluralName": "externalHandlerProcessConfigs", - "resourceFields": { - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "onError": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "composeConfig", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/composeconfig" - }, - "actions": {}, - "pluralName": "composeConfigs", - "resourceFields": { - "dockerComposeConfig": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "rancherComposeConfig": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [] - }, - { - "id": "addLoadBalancerInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/addloadbalancerinput" - }, - "actions": {}, - "pluralName": "addLoadBalancerInputs", - "resourceFields": { - "loadBalancerId": { - "type": "reference[loadBalancer]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "weight": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "addRemoveClusterHostInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/addremoveclusterhostinput" - }, - "actions": {}, - "pluralName": "addRemoveClusterHostInputs", - "resourceFields": { - "hostId": { - "type": "reference[host]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "addRemoveLoadBalancerHostInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/addremoveloadbalancerhostinput" - }, - "actions": {}, - "pluralName": "addRemoveLoadBalancerHostInputs", - "resourceFields": { - "hostId": { - "type": "reference[host]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "addRemoveLoadBalancerListenerInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/addremoveloadbalancerlistenerinput" - }, - "actions": {}, - "pluralName": "addRemoveLoadBalancerListenerInputs", - "resourceFields": { - "loadBalancerListenerId": { - "type": "reference[loadBalancerListener]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "addRemoveLoadBalancerTargetInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/addremoveloadbalancertargetinput" - }, - "actions": {}, - "pluralName": "addRemoveLoadBalancerTargetInputs", - "resourceFields": { - "instanceId": { - "type": "reference[instance]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "ipAddress": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "addRemoveServiceLinkInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/addremoveservicelinkinput" - }, - "actions": {}, - "pluralName": "addRemoveServiceLinkInputs", - "resourceFields": { - "serviceId": { - "type": "reference[service]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "addLabelInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/addlabelinput" - }, - "actions": {}, - "pluralName": "addLabelInputs", - "resourceFields": { - "key": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "value": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "removeLabelInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/removelabelinput" - }, - "actions": {}, - "pluralName": "removeLabelInputs", - "resourceFields": { - "label": { - "type": "reference[label]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "apiKey", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/apikey", - "collection": "http://localhost:8080/v1/apikeys" - }, - "actions": {}, - "pluralName": "apiKeys", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "publicValue": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 4096, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "secretValue": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 4096, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "publicValue": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "registryId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "secretValue": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "images", - "account", - "instances" - ], - "resourceActions": { - "update": { - "input": null, - "output": "credential" - }, - "activate": { - "input": null, - "output": "credential" - }, - "remove": { - "input": null, - "output": "credential" - }, - "restore": { - "input": null, - "output": "credential" - }, - "deactivate": { - "input": null, - "output": "credential" - }, - "create": { - "input": null, - "output": "credential" - }, - "purge": { - "input": null, - "output": "credential" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "cluster", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/cluster", - "collection": "http://localhost:8080/v1/clusters" - }, - "actions": {}, - "pluralName": "clusters", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "agentId": { - "type": "reference[agent]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "apiProxy": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "computeTotal": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "info": { - "type": "json", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "physicalHostId": { - "type": "reference[physicalHost]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "discoverySpec": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "port": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "agentId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "computeFree": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "computeTotal": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "isPublic": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "physicalHostId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uri": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "ipaddresses", - "storagepools", - "clusters", - "physicalhost", - "labels", - "hosts", - "containerevents", - "account", - "loadbalancerhostmaps", - "instances", - "agent", - "loadbalancers" - ], - "resourceActions": { - "update": { - "input": null, - "output": "host" - }, - "activate": { - "input": null, - "output": "host" - }, - "remove": { - "input": null, - "output": "host" - }, - "restore": { - "input": null, - "output": "host" - }, - "removelabel": { - "input": "removeLabelInput", - "output": "host" - }, - "addlabel": { - "input": "addLabelInput", - "output": "host" - }, - "deactivate": { - "input": null, - "output": "host" - }, - "create": { - "input": null, - "output": "host" - }, - "purge": { - "input": null, - "output": "host" - }, - "addhost": { - "input": "addRemoveClusterHostInput", - "output": "cluster" - }, - "removehost": { - "input": "addRemoveClusterHostInput", - "output": "cluster" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "composeConfigInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/composeconfiginput" - }, - "actions": {}, - "pluralName": "composeConfigInputs", - "resourceFields": { - "serviceIds": { - "type": "array[reference[service]]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "container", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/container", - "collection": "http://localhost:8080/v1/containers" - }, - "actions": {}, - "pluralName": "containers", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "agentId": { - "type": "reference[agent]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "allocationState": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "count": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "externalId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "firstRunning": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "hostname": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": 1, - "maxLength": 255, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "imageUuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "nativeContainer": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "networkIds": { - "type": "array[reference[network]]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "ports": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "primaryIpAddress": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "registryCredentialId": { - "type": "reference[registryCredential]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "requestedHostId": { - "type": "reference[host]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "startOnCreate": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": true - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "creating", - "migrating", - "purged", - "purging", - "removed", - "removing", - "requested", - "restarting", - "restoring", - "running", - "starting", - "stopped", - "stopping", - "updating-running", - "updating-stopped" - ], - "default": null - }, - "systemContainer": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "NetworkAgent", - "LoadBalancerAgent" - ], - "default": null - }, - "token": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "environment": { - "type": "map[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "command": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "directory": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": 1, - "maxLength": null, - "options": null, - "default": null - }, - "user": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": 1, - "maxLength": null, - "options": null, - "default": null - }, - "publishAllPorts": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": false - }, - "privileged": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": false - }, - "capAdd": { - "type": "array[enum]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "ALL", - "AUDIT_CONTROL", - "AUDIT_WRITE", - "BLOCK_SUSPEND", - "CHOWN", - "DAC_OVERRIDE", - "DAC_READ_SEARCH", - "FOWNER", - "FSETID", - "IPC_LOCK", - "IPC_OWNER", - "KILL", - "LEASE", - "LINUX_IMMUTABLE", - "MAC_ADMIN", - "MAC_OVERRIDE", - "MKNOD", - "NET_ADMIN", - "NET_BIND_SERVICE", - "NET_BROADCAST", - "NET_RAW", - "SETFCAP", - "SETGID", - "SETPCAP", - "SETUID", - "SYSLOG", - "SYS_ADMIN", - "SYS_BOOT", - "SYS_CHROOT", - "SYS_MODULE", - "SYS_NICE", - "SYS_PACCT", - "SYS_PTRACE", - "SYS_RAWIO", - "SYS_RESOURCE", - "SYS_TIME", - "SYS_TTY_CONFIG", - "WAKE_ALARM" - ], - "default": null - }, - "capDrop": { - "type": "array[enum]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "ALL", - "AUDIT_CONTROL", - "AUDIT_WRITE", - "BLOCK_SUSPEND", - "CHOWN", - "DAC_OVERRIDE", - "DAC_READ_SEARCH", - "FOWNER", - "FSETID", - "IPC_LOCK", - "IPC_OWNER", - "KILL", - "LEASE", - "LINUX_IMMUTABLE", - "MAC_ADMIN", - "MAC_OVERRIDE", - "MKNOD", - "NET_ADMIN", - "NET_BIND_SERVICE", - "NET_BROADCAST", - "NET_RAW", - "SETFCAP", - "SETGID", - "SETPCAP", - "SETUID", - "SYSLOG", - "SYS_ADMIN", - "SYS_BOOT", - "SYS_CHROOT", - "SYS_MODULE", - "SYS_NICE", - "SYS_PACCT", - "SYS_PTRACE", - "SYS_RAWIO", - "SYS_RESOURCE", - "SYS_TIME", - "SYS_TTY_CONFIG", - "WAKE_ALARM" - ], - "default": null - }, - "dns": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "dnsSearch": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "instanceLinks": { - "type": "map[reference[instance]]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "domainName": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "memorySwap": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "memory": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "cpuSet": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "cpuShares": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "stdinOpen": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": false - }, - "tty": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": false - }, - "entryPoint": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "lxcConf": { - "type": "map[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "restartPolicy": { - "type": "restartPolicy", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "devices": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "labels": { - "type": "map[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "dataVolumes": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "dataVolumesFrom": { - "type": "array[reference[container]]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "agentId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "allocationState": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "compute": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "domain": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "firstRunning": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "hostname": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "imageId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "instanceTriggeredStop": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "memoryMb": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "nativeContainer": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "offeringId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "registryCredentialId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "systemContainer": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "token": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "userdata": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "zoneId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "services", - "instancelinks", - "loadbalancertargets", - "volumes", - "targetinstancelinks", - "agent", - "registrycredential", - "instancelabels", - "ports", - "mounts", - "hosts", - "account", - "credentials" - ], - "resourceActions": { - "update": { - "input": null, - "output": "instance" - }, - "stop": { - "input": "instanceStop", - "output": "instance" - }, - "console": { - "input": "instanceConsoleInput", - "output": "instanceConsole" - }, - "restart": { - "input": null, - "output": "instance" - }, - "remove": { - "input": null, - "output": "instance" - }, - "start": { - "input": null, - "output": "instance" - }, - "restore": { - "input": null, - "output": "instance" - }, - "migrate": { - "input": null, - "output": "instance" - }, - "deallocate": { - "input": null, - "output": "instance" - }, - "allocate": { - "input": null, - "output": "instance" - }, - "create": { - "input": null, - "output": "instance" - }, - "purge": { - "input": null, - "output": "instance" - }, - "logs": { - "input": "containerLogs", - "output": "hostAccess" - }, - "addlabel": { - "input": "addLabelInput", - "output": "container" - }, - "removelabel": { - "input": "removeLabelInput", - "output": "container" - }, - "execute": { - "input": "containerExec", - "output": "hostAccess" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "instanceConsole", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/instanceconsole" - }, - "actions": {}, - "pluralName": "instanceConsoles", - "resourceFields": { - "url": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "password": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [] - }, - { - "id": "instanceConsoleInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/instanceconsoleinput" - }, - "actions": {}, - "pluralName": "instanceConsoleInputs", - "resourceFields": {}, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [] - }, - { - "id": "instanceStop", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/instancestop" - }, - "actions": {}, - "pluralName": "instanceStops", - "resourceFields": { - "remove": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "timeout": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "deallocateFromHost": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "ipAddressAssociateInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/ipaddressassociateinput" - }, - "actions": {}, - "pluralName": "ipAddressAssociateInputs", - "resourceFields": { - "ipAddressId": { - "type": "reference[ipAddress]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "project", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/project", - "collection": "http://localhost:8080/v1/projects" - }, - "actions": {}, - "pluralName": "projects", - "resourceFields": { - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "members": { - "type": "array[projectMember]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalIdType": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "networks", - "services", - "storagepools", - "agents", - "globalloadbalancers", - "labels", - "loadbalancertargets", - "environments", - "instancelinks", - "containerevents", - "loadbalancerhostmaps", - "volumes", - "instances", - "loadbalancers", - "loadbalancerconfiglistenermaps", - "ports", - "ipaddresses", - "mounts", - "loadbalancerlisteners", - "loadbalancerconfigs", - "projectmembers", - "physicalhosts", - "hosts", - "images", - "credentials", - "snapshots", - "certificates" - ], - "resourceActions": { - "update": { - "input": null, - "output": "account" - }, - "activate": { - "input": null, - "output": "account" - }, - "remove": { - "input": null, - "output": "account" - }, - "restore": { - "input": null, - "output": "account" - }, - "deactivate": { - "input": null, - "output": "account" - }, - "create": { - "input": null, - "output": "account" - }, - "purge": { - "input": null, - "output": "account" - }, - "setmembers": { - "input": "setProjectMembersInput", - "output": "setProjectMembersInput" - }, - "delete": { - "input": null, - "output": null - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "registry", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/registry", - "collection": "http://localhost:8080/v1/registries" - }, - "actions": {}, - "pluralName": "registries", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "serverAddress": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": 1, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "agentId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "external": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "physicalTotalSizeMb": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "virtualTotalSizeMb": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "zoneId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "hosts", - "images", - "account", - "credentials", - "volumes", - "snapshots" - ], - "resourceActions": { - "update": { - "input": null, - "output": "storagePool" - }, - "activate": { - "input": null, - "output": "storagePool" - }, - "remove": { - "input": null, - "output": "storagePool" - }, - "restore": { - "input": null, - "output": "storagePool" - }, - "deactivate": { - "input": null, - "output": "storagePool" - }, - "create": { - "input": null, - "output": "storagePool" - }, - "purge": { - "input": null, - "output": "storagePool" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "registryCredential", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/registrycredential", - "collection": "http://localhost:8080/v1/registrycredentials" - }, - "actions": {}, - "pluralName": "registryCredentials", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "publicValue": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 4096, - "options": null, - "default": null - }, - "registryId": { - "type": "reference[registry]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "secretValue": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 4096, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "email": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": 1, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "publicValue": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "registryId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "secretValue": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "images", - "account", - "registry", - "instances" - ], - "resourceActions": { - "update": { - "input": null, - "output": "credential" - }, - "activate": { - "input": null, - "output": "credential" - }, - "remove": { - "input": null, - "output": "credential" - }, - "restore": { - "input": null, - "output": "credential" - }, - "deactivate": { - "input": null, - "output": "credential" - }, - "create": { - "input": null, - "output": "credential" - }, - "purge": { - "input": null, - "output": "credential" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "removeLoadBalancerInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/removeloadbalancerinput" - }, - "actions": {}, - "pluralName": "removeLoadBalancerInputs", - "resourceFields": { - "loadBalancerId": { - "type": "reference[loadBalancer]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "setLoadBalancerHostsInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/setloadbalancerhostsinput" - }, - "actions": {}, - "pluralName": "setLoadBalancerHostsInputs", - "resourceFields": { - "hostIds": { - "type": "array[reference[host]]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "setLoadBalancerListenersInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/setloadbalancerlistenersinput" - }, - "actions": {}, - "pluralName": "setLoadBalancerListenersInputs", - "resourceFields": { - "loadBalancerListenerIds": { - "type": "array[reference[loadBalancerListener]]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "setLoadBalancerTargetsInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/setloadbalancertargetsinput" - }, - "actions": {}, - "pluralName": "setLoadBalancerTargetsInputs", - "resourceFields": { - "instanceIds": { - "type": "array[reference[instance]]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "ipAddresses": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "setProjectMembersInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/setprojectmembersinput" - }, - "actions": {}, - "pluralName": "setProjectMembersInputs", - "resourceFields": { - "members": { - "type": "array[projectMember]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": 1, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "setServiceLinksInput", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/setservicelinksinput" - }, - "actions": {}, - "pluralName": "setServiceLinksInputs", - "resourceFields": { - "serviceIds": { - "type": "array[reference[service]]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "loadBalancerService", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/loadbalancerservice", - "collection": "http://localhost:8080/v1/loadbalancerservices" - }, - "actions": {}, - "pluralName": "loadBalancerServices", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "dataVolumesFromService": { - "type": "array[reference[service]]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "environmentId": { - "type": "reference[environment]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "launchConfig": { - "type": "container", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": "[a-zA-Z0-9]-", - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": 1, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "scale": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": 1 - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "registering", - "removed", - "removing", - "requested", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "loadBalancerConfig": { - "type": "loadBalancerConfig", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "environmentId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "loadbalancerlisteners", - "environment", - "loadbalancerconfigs", - "consumedservices", - "account", - "instances", - "consumedbyservices", - "loadbalancers" - ], - "resourceActions": { - "update": { - "input": null, - "output": "service" - }, - "activate": { - "input": null, - "output": "service" - }, - "remove": { - "input": null, - "output": "service" - }, - "setservicelinks": { - "input": "setServiceLinksInput", - "output": "service" - }, - "removeservicelink": { - "input": "addRemoveServiceLinkInput", - "output": "service" - }, - "addservicelink": { - "input": "addRemoveServiceLinkInput", - "output": "service" - }, - "deactivate": { - "input": null, - "output": "service" - }, - "create": { - "input": null, - "output": "service" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "account", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/account", - "collection": "http://localhost:8080/v1/accounts" - }, - "actions": {}, - "pluralName": "accounts", - "resourceFields": { - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "externalId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "externalIdType": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalIdType": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "networks", - "services", - "storagepools", - "agents", - "globalloadbalancers", - "labels", - "loadbalancertargets", - "environments", - "instancelinks", - "containerevents", - "loadbalancerhostmaps", - "volumes", - "instances", - "loadbalancers", - "loadbalancerconfiglistenermaps", - "ports", - "ipaddresses", - "mounts", - "loadbalancerlisteners", - "loadbalancerconfigs", - "projectmembers", - "physicalhosts", - "hosts", - "images", - "credentials", - "snapshots", - "certificates" - ], - "resourceActions": { - "update": { - "input": null, - "output": "account" - }, - "activate": { - "input": null, - "output": "account" - }, - "remove": { - "input": null, - "output": "account" - }, - "restore": { - "input": null, - "output": "account" - }, - "deactivate": { - "input": null, - "output": "account" - }, - "create": { - "input": null, - "output": "account" - }, - "purge": { - "input": null, - "output": "account" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "agent", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/agent", - "collection": "http://localhost:8080/v1/agents" - }, - "actions": {}, - "pluralName": "agents", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "managedConfig": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": true - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "reconnecting", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uri": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": true, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "agentGroupId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "managedConfig": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uri": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "zoneId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "storagepools", - "configitemstatuses", - "physicalhosts", - "hosts", - "account", - "instances" - ], - "resourceActions": { - "update": { - "input": null, - "output": "agent" - }, - "activate": { - "input": null, - "output": "agent" - }, - "remove": { - "input": null, - "output": "agent" - }, - "reconnect": { - "input": null, - "output": "agent" - }, - "restore": { - "input": null, - "output": "agent" - }, - "deactivate": { - "input": null, - "output": "agent" - }, - "create": { - "input": null, - "output": "agent" - }, - "purge": { - "input": null, - "output": "agent" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "certificate", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/certificate", - "collection": "http://localhost:8080/v1/certificates" - }, - "actions": {}, - "pluralName": "certificates", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "cert": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "certChain": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "key": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "cert": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "certChain": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "key": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "account" - ], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "configItem", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/configitem", - "collection": "http://localhost:8080/v1/configitems" - }, - "actions": {}, - "pluralName": "configItems", - "resourceFields": { - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "sourceVersion": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - } - }, - "collectionFilters": { - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "sourceVersion": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "configItemStatus", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/configitemstatus", - "collection": "http://localhost:8080/v1/configitemstatuses" - }, - "actions": {}, - "pluralName": "configItemStatuses", - "resourceFields": { - "agentId": { - "type": "reference[agent]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "appliedUpdated": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "appliedVersion": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "requestedUpdated": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "requestedVersion": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "sourceVersion": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - } - }, - "collectionFilters": { - "agentId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "appliedUpdated": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "appliedVersion": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "requestedUpdated": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "requestedVersion": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "sourceVersion": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "agent" - ], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "containerEvent", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/containerevent", - "collection": "http://localhost:8080/v1/containerevents" - }, - "actions": {}, - "pluralName": "containerEvents", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "externalFrom": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "externalId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "externalStatus": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "externalTimestamp": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "hostId": { - "type": "reference[host]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "reportedHostUuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "created", - "creating", - "removed", - "removing", - "requested" - ], - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "dockerInspect": { - "type": "json", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "externalFrom": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalStatus": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalTimestamp": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "hostId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "reportedHostUuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "host", - "account" - ], - "resourceActions": { - "remove": { - "input": null, - "output": "containerEvent" - }, - "create": { - "input": null, - "output": "containerEvent" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "credential", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/credential", - "collection": "http://localhost:8080/v1/credentials" - }, - "actions": {}, - "pluralName": "credentials", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "publicValue": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 4096, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "secretValue": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 4096, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "publicValue": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "registryId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "secretValue": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "images", - "account", - "instances" - ], - "resourceActions": { - "update": { - "input": null, - "output": "credential" - }, - "activate": { - "input": null, - "output": "credential" - }, - "remove": { - "input": null, - "output": "credential" - }, - "restore": { - "input": null, - "output": "credential" - }, - "deactivate": { - "input": null, - "output": "credential" - }, - "create": { - "input": null, - "output": "credential" - }, - "purge": { - "input": null, - "output": "credential" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "databasechangelog", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/databasechangelog", - "collection": "http://localhost:8080/v1/databasechangelogs" - }, - "actions": {}, - "pluralName": "databasechangelogs", - "resourceFields": { - "author": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "comments": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "dateexecuted": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "exectype": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 10, - "options": null, - "default": null - }, - "filename": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "id": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "liquibase": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 20, - "options": null, - "default": null - }, - "md5sum": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 35, - "options": null, - "default": null - }, - "orderexecuted": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "tag": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - } - }, - "collectionFilters": { - "author": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "comments": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "dateexecuted": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "exectype": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "filename": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "liquibase": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "md5sum": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "orderexecuted": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "tag": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "DELETE" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "databasechangeloglock", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/databasechangeloglock", - "collection": "http://localhost:8080/v1/databasechangeloglocks" - }, - "actions": {}, - "pluralName": "databasechangeloglocks", - "resourceFields": { - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "locked": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "lockedby": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "lockgranted": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - } - }, - "collectionFilters": { - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "locked": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "lockedby": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "lockgranted": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - } - }, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "DELETE" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "environment", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/environment", - "collection": "http://localhost:8080/v1/environments" - }, - "actions": {}, - "pluralName": "environments", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": "[a-zA-Z0-9-]", - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": 1, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "removed", - "removing", - "requested", - "updating-active" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "services", - "account" - ], - "resourceActions": { - "update": { - "input": null, - "output": "environment" - }, - "remove": { - "input": null, - "output": "environment" - }, - "activateservices": { - "input": null, - "output": null - }, - "deactivateservices": { - "input": null, - "output": null - }, - "create": { - "input": null, - "output": "environment" - }, - "exportconfig": { - "input": "composeConfigInput", - "output": "composeConfig" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "externalHandler", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/externalhandler", - "collection": "http://localhost:8080/v1/externalhandlers" - }, - "actions": {}, - "pluralName": "externalHandlers", - "resourceFields": { - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "priority": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "processConfigs": { - "type": "array[externalHandlerProcessConfig]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "retries": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": 1, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "timeoutMillis": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": 1000, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "priority": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "externalhandlerexternalhandlerprocessmaps", - "externalhandlerprocesses" - ], - "resourceActions": { - "update": { - "input": null, - "output": "externalHandler" - }, - "activate": { - "input": null, - "output": "externalHandler" - }, - "remove": { - "input": null, - "output": "externalHandler" - }, - "restore": { - "input": null, - "output": "externalHandler" - }, - "deactivate": { - "input": null, - "output": "externalHandler" - }, - "create": { - "input": null, - "output": "externalHandler" - }, - "purge": { - "input": null, - "output": "externalHandler" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "externalHandlerExternalHandlerProcessMap", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/externalhandlerexternalhandlerprocessmap", - "collection": "http://localhost:8080/v1/externalhandlerexternalhandlerprocessmaps" - }, - "actions": {}, - "pluralName": "externalHandlerExternalHandlerProcessMaps", - "resourceFields": { - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "externalHandlerId": { - "type": "reference[externalHandler]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "externalHandlerProcessId": { - "type": "reference[externalHandlerProcess]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "onError": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalHandlerId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "externalHandlerProcessId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "onError": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "externalhandler", - "externalhandlerprocess" - ], - "resourceActions": { - "update": { - "input": null, - "output": "externalHandlerExternalHandlerProcessMap" - }, - "activate": { - "input": null, - "output": "externalHandlerExternalHandlerProcessMap" - }, - "remove": { - "input": null, - "output": "externalHandlerExternalHandlerProcessMap" - }, - "restore": { - "input": null, - "output": "externalHandlerExternalHandlerProcessMap" - }, - "deactivate": { - "input": null, - "output": "externalHandlerExternalHandlerProcessMap" - }, - "create": { - "input": null, - "output": "externalHandlerExternalHandlerProcessMap" - }, - "purge": { - "input": null, - "output": "externalHandlerExternalHandlerProcessMap" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "externalHandlerProcess", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/externalhandlerprocess", - "collection": "http://localhost:8080/v1/externalhandlerprocesses" - }, - "actions": {}, - "pluralName": "externalHandlerProcesses", - "resourceFields": { - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "externalhandlerexternalhandlerprocessmaps", - "externalhandlers" - ], - "resourceActions": { - "update": { - "input": null, - "output": "externalHandlerProcess" - }, - "activate": { - "input": null, - "output": "externalHandlerProcess" - }, - "remove": { - "input": null, - "output": "externalHandlerProcess" - }, - "restore": { - "input": null, - "output": "externalHandlerProcess" - }, - "deactivate": { - "input": null, - "output": "externalHandlerProcess" - }, - "create": { - "input": null, - "output": "externalHandlerProcess" - }, - "purge": { - "input": null, - "output": "externalHandlerProcess" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "globalLoadBalancer", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/globalloadbalancer", - "collection": "http://localhost:8080/v1/globalloadbalancers" - }, - "actions": {}, - "pluralName": "globalLoadBalancers", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "removed", - "removing", - "requested", - "updating-active" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "globalLoadBalancerHealthCheck": { - "type": "array[globalLoadBalancerHealthCheck]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "globalLoadBalancerPolicy": { - "type": "array[globalLoadBalancerPolicy]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "account", - "loadbalancers" - ], - "resourceActions": { - "remove": { - "input": null, - "output": "globalLoadBalancer" - }, - "addloadbalancer": { - "input": "addLoadBalancerInput", - "output": "globalLoadBalancer" - }, - "removeloadbalancer": { - "input": "removeLoadBalancerInput", - "output": "globalLoadBalancer" - }, - "create": { - "input": null, - "output": "globalLoadBalancer" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "host", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/host", - "collection": "http://localhost:8080/v1/hosts" - }, - "actions": {}, - "pluralName": "hosts", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "agentId": { - "type": "reference[agent]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "computeTotal": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "physicalHostId": { - "type": "reference[physicalHost]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "info": { - "type": "json", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "apiProxy": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "agentId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "computeFree": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "computeTotal": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "isPublic": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "physicalHostId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uri": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "ipaddresses", - "storagepools", - "clusters", - "physicalhost", - "labels", - "hosts", - "containerevents", - "account", - "loadbalancerhostmaps", - "instances", - "agent", - "loadbalancers" - ], - "resourceActions": { - "update": { - "input": null, - "output": "host" - }, - "activate": { - "input": null, - "output": "host" - }, - "remove": { - "input": null, - "output": "host" - }, - "restore": { - "input": null, - "output": "host" - }, - "removelabel": { - "input": "removeLabelInput", - "output": "host" - }, - "addlabel": { - "input": "addLabelInput", - "output": "host" - }, - "deactivate": { - "input": null, - "output": "host" - }, - "create": { - "input": null, - "output": "host" - }, - "purge": { - "input": null, - "output": "host" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "image", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/image", - "collection": "http://localhost:8080/v1/images" - }, - "actions": {}, - "pluralName": "images", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "checksum": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "format": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "instanceKind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "isPublic": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "physicalSizeMb": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "registryCredentialId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "url": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "virtualSizeMb": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "storagepools", - "account", - "volumes", - "instances" - ], - "resourceActions": { - "update": { - "input": null, - "output": "image" - }, - "activate": { - "input": null, - "output": "image" - }, - "remove": { - "input": null, - "output": "image" - }, - "restore": { - "input": null, - "output": "image" - }, - "deactivate": { - "input": null, - "output": "image" - }, - "create": { - "input": null, - "output": "image" - }, - "purge": { - "input": null, - "output": "image" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "instance", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/instance", - "collection": "http://localhost:8080/v1/instances" - }, - "actions": {}, - "pluralName": "instances", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "externalId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "creating", - "migrating", - "purged", - "purging", - "removed", - "removing", - "requested", - "restarting", - "restoring", - "running", - "starting", - "stopped", - "stopping", - "updating-running", - "updating-stopped" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "agentId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "allocationState": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "compute": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "domain": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "firstRunning": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "hostname": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "imageId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "instanceTriggeredStop": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "memoryMb": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "nativeContainer": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "offeringId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "registryCredentialId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "systemContainer": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "token": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "userdata": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "zoneId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "instancelabels", - "services", - "ports", - "mounts", - "loadbalancertargets", - "instancelinks", - "hosts", - "account", - "credentials", - "volumes", - "targetinstancelinks" - ], - "resourceActions": { - "update": { - "input": null, - "output": "instance" - }, - "stop": { - "input": "instanceStop", - "output": "instance" - }, - "console": { - "input": "instanceConsoleInput", - "output": "instanceConsole" - }, - "restart": { - "input": null, - "output": "instance" - }, - "remove": { - "input": null, - "output": "instance" - }, - "start": { - "input": null, - "output": "instance" - }, - "restore": { - "input": null, - "output": "instance" - }, - "migrate": { - "input": null, - "output": "instance" - }, - "deallocate": { - "input": null, - "output": "instance" - }, - "allocate": { - "input": null, - "output": "instance" - }, - "create": { - "input": null, - "output": "instance" - }, - "purge": { - "input": null, - "output": "instance" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "instanceLink", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/instancelink", - "collection": "http://localhost:8080/v1/instancelinks" - }, - "actions": {}, - "pluralName": "instanceLinks", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "instanceId": { - "type": "reference[instance]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "linkName": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "targetInstanceId": { - "type": "reference[instance]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "ports": { - "type": "array[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "instanceId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "linkName": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "targetInstanceId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "targetinstance", - "account", - "instance" - ], - "resourceActions": { - "update": { - "input": null, - "output": "instanceLink" - }, - "activate": { - "input": null, - "output": "instanceLink" - }, - "remove": { - "input": null, - "output": "instanceLink" - }, - "restore": { - "input": null, - "output": "instanceLink" - }, - "deactivate": { - "input": null, - "output": "instanceLink" - }, - "create": { - "input": null, - "output": "instanceLink" - }, - "purge": { - "input": null, - "output": "instanceLink" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "ipAddress", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/ipaddress", - "collection": "http://localhost:8080/v1/ipaddresses" - }, - "actions": {}, - "pluralName": "ipAddresses", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "address": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "networkId": { - "type": "reference[network]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "associated", - "associating", - "deactivating", - "disassociating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "address": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "hostname": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "ipPoolId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "isPublic": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "networkId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "role": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "subnetId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "privateports", - "publicports", - "hosts", - "account", - "network" - ], - "resourceActions": { - "update": { - "input": null, - "output": "ipAddress" - }, - "activate": { - "input": null, - "output": "ipAddress" - }, - "remove": { - "input": null, - "output": "ipAddress" - }, - "disassociate": { - "input": null, - "output": "ipAddress" - }, - "restore": { - "input": null, - "output": "ipAddress" - }, - "deactivate": { - "input": null, - "output": "ipAddress" - }, - "create": { - "input": null, - "output": "ipAddress" - }, - "purge": { - "input": null, - "output": "ipAddress" - }, - "associate": { - "input": "ipAddressAssociateInput", - "output": "ipPool" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "label", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/label", - "collection": "http://localhost:8080/v1/labels" - }, - "actions": {}, - "pluralName": "labels", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "key": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "created", - "creating", - "removed", - "removing", - "requested" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "value": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "key": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "type": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "value": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "hosts", - "account", - "instances" - ], - "resourceActions": { - "remove": { - "input": null, - "output": "label" - }, - "create": { - "input": null, - "output": "label" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "loadBalancer", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/loadbalancer", - "collection": "http://localhost:8080/v1/loadbalancers" - }, - "actions": {}, - "pluralName": "loadBalancers", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "globalLoadBalancerId": { - "type": "reference[globalLoadBalancer]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "loadBalancerConfigId": { - "type": "reference[loadBalancerConfig]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "serviceId": { - "type": "reference[service]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "removed", - "removing", - "requested", - "updating-active" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "weight": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "globalLoadBalancerId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "loadBalancerConfigId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "serviceId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "weight": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "loadbalancerconfig", - "service", - "loadbalancertargets", - "hosts", - "globalloadbalancer", - "account", - "loadbalancerhostmaps" - ], - "resourceActions": { - "update": { - "input": null, - "output": "loadBalancer" - }, - "sethosts": { - "input": "setLoadBalancerHostsInput", - "output": "loadBalancer" - }, - "addtarget": { - "input": "addRemoveLoadBalancerTargetInput", - "output": "loadBalancer" - }, - "removehost": { - "input": "addRemoveLoadBalancerHostInput", - "output": "loadBalancer" - }, - "remove": { - "input": null, - "output": "loadBalancer" - }, - "addhost": { - "input": "addRemoveLoadBalancerHostInput", - "output": "loadBalancer" - }, - "create": { - "input": null, - "output": "loadBalancer" - }, - "removetarget": { - "input": "addRemoveLoadBalancerTargetInput", - "output": "loadBalancer" - }, - "settargets": { - "input": "setLoadBalancerTargetsInput", - "output": "loadBalancer" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "loadBalancerConfig", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/loadbalancerconfig", - "collection": "http://localhost:8080/v1/loadbalancerconfigs" - }, - "actions": {}, - "pluralName": "loadBalancerConfigs", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "serviceId": { - "type": "reference[service]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "removed", - "removing", - "requested", - "updating-active" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "healthCheck": { - "type": "loadBalancerHealthCheck", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "appCookieStickinessPolicy": { - "type": "loadBalancerAppCookieStickinessPolicy", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "lbCookieStickinessPolicy": { - "type": "loadBalancerCookieStickinessPolicy", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "serviceId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "loadbalancerconfiglistenermaps", - "loadbalancerlisteners", - "service", - "account", - "loadbalancers" - ], - "resourceActions": { - "removelistener": { - "input": "addRemoveLoadBalancerListenerInput", - "output": "loadBalancerConfig" - }, - "update": { - "input": null, - "output": "loadBalancerConfig" - }, - "remove": { - "input": null, - "output": "loadBalancerConfig" - }, - "setlisteners": { - "input": "setLoadBalancerListenersInput", - "output": "loadBalancerConfig" - }, - "addlistener": { - "input": "addRemoveLoadBalancerListenerInput", - "output": "loadBalancerConfig" - }, - "create": { - "input": null, - "output": "loadBalancerConfig" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "loadBalancerConfigListenerMap", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/loadbalancerconfiglistenermap", - "collection": "http://localhost:8080/v1/loadbalancerconfiglistenermaps" - }, - "actions": {}, - "pluralName": "loadBalancerConfigListenerMaps", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "loadBalancerConfigId": { - "type": "reference[loadBalancerConfig]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "loadBalancerListenerId": { - "type": "reference[loadBalancerListener]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "removed", - "removing", - "requested" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "loadBalancerConfigId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "loadBalancerListenerId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "loadbalancerlistener", - "loadbalancerconfig", - "account" - ], - "resourceActions": { - "remove": { - "input": null, - "output": "loadBalancerConfigListenerMap" - }, - "create": { - "input": null, - "output": "loadBalancerConfigListenerMap" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "loadBalancerHostMap", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/loadbalancerhostmap", - "collection": "http://localhost:8080/v1/loadbalancerhostmaps" - }, - "actions": {}, - "pluralName": "loadBalancerHostMaps", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "hostId": { - "type": "reference[host]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "loadBalancerId": { - "type": "reference[loadBalancer]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "hostId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "loadBalancerId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "host", - "loadbalancer", - "account" - ], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "loadBalancerListener", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/loadbalancerlistener", - "collection": "http://localhost:8080/v1/loadbalancerlisteners" - }, - "actions": {}, - "pluralName": "loadBalancerListeners", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "serviceId": { - "type": "reference[service]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "sourcePort": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": 1, - "max": 65535, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "sourceProtocol": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": [ - "tcp", - "http" - ], - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "removed", - "removing", - "requested" - ], - "default": null - }, - "targetPort": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": 1, - "max": 65535, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "targetProtocol": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": [ - "tcp", - "http" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "algorithm": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "roundrobin", - "leastconn", - "source" - ], - "default": "roundrobin" - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "serviceId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "sourcePort": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "sourceProtocol": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "targetPort": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "targetProtocol": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "loadbalancerconfiglistenermaps", - "loadbalancerconfigs", - "service", - "account" - ], - "resourceActions": { - "remove": { - "input": null, - "output": "loadBalancerListener" - }, - "create": { - "input": null, - "output": "loadBalancerListener" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "loadBalancerTarget", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/loadbalancertarget", - "collection": "http://localhost:8080/v1/loadbalancertargets" - }, - "actions": {}, - "pluralName": "loadBalancerTargets", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "instanceId": { - "type": "reference[instance]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "ipAddress": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "loadBalancerId": { - "type": "reference[loadBalancer]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "removed", - "removing", - "requested" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "instanceId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "ipAddress": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "loadBalancerId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "loadbalancer", - "account", - "instance" - ], - "resourceActions": { - "remove": { - "input": null, - "output": "loadBalancerTarget" - }, - "create": { - "input": null, - "output": "loadBalancerTarget" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "mount", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/mount", - "collection": "http://localhost:8080/v1/mounts" - }, - "actions": {}, - "pluralName": "mounts", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "instanceId": { - "type": "reference[instance]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "path": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 512, - "options": null, - "default": null - }, - "permissions": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "volumeId": { - "type": "reference[volume]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "instanceId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "path": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "permissions": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "volumeId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "volume", - "account", - "instance" - ], - "resourceActions": { - "update": { - "input": null, - "output": "mount" - }, - "activate": { - "input": null, - "output": "mount" - }, - "remove": { - "input": null, - "output": "mount" - }, - "restore": { - "input": null, - "output": "mount" - }, - "deactivate": { - "input": null, - "output": "mount" - }, - "create": { - "input": null, - "output": "mount" - }, - "purge": { - "input": null, - "output": "mount" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "network", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/network", - "collection": "http://localhost:8080/v1/networks" - }, - "actions": {}, - "pluralName": "networks", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "domain": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "isPublic": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "ipaddresses", - "account" - ], - "resourceActions": { - "update": { - "input": null, - "output": "network" - }, - "activate": { - "input": null, - "output": "network" - }, - "remove": { - "input": null, - "output": "network" - }, - "restore": { - "input": null, - "output": "network" - }, - "deactivate": { - "input": null, - "output": "network" - }, - "create": { - "input": null, - "output": "network" - }, - "purge": { - "input": null, - "output": "network" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "physicalHost", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/physicalhost", - "collection": "http://localhost:8080/v1/physicalhosts" - }, - "actions": {}, - "pluralName": "physicalHosts", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "active", - "bootstrapping", - "created", - "creating", - "error", - "erroring", - "removed", - "removing", - "requested", - "updating" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "agentId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "hosts", - "account" - ], - "resourceActions": { - "update": { - "input": null, - "output": "physicalHost" - }, - "bootstrap": { - "input": null, - "output": "physicalHost" - }, - "remove": { - "input": null, - "output": "physicalHost" - }, - "error": { - "input": null, - "output": "physicalHost" - }, - "create": { - "input": null, - "output": "physicalHost" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "port", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/port", - "collection": "http://localhost:8080/v1/ports" - }, - "actions": {}, - "pluralName": "ports", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "instanceId": { - "type": "reference[instance]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "privateIpAddressId": { - "type": "reference[ipAddress]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "privatePort": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "protocol": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "publicIpAddressId": { - "type": "reference[ipAddress]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "publicPort": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "instanceId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "privateIpAddressId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "privatePort": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "protocol": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "publicIpAddressId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "publicPort": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "privateipaddress", - "publicipaddress", - "account", - "instance" - ], - "resourceActions": { - "update": { - "input": null, - "output": "port" - }, - "activate": { - "input": null, - "output": "port" - }, - "remove": { - "input": null, - "output": "port" - }, - "restore": { - "input": null, - "output": "port" - }, - "deactivate": { - "input": null, - "output": "port" - }, - "create": { - "input": null, - "output": "port" - }, - "purge": { - "input": null, - "output": "port" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "processExecution", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/processexecution", - "collection": "http://localhost:8080/v1/processexecutions" - }, - "actions": {}, - "pluralName": "processExecutions", - "resourceFields": { - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "log": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 16777215, - "options": null, - "default": null - }, - "processInstanceId": { - "type": "reference[processInstance]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - } - }, - "collectionFilters": { - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "processInstanceId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "processinstance" - ], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "processInstance", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/processinstance", - "collection": "http://localhost:8080/v1/processinstances" - }, - "actions": {}, - "pluralName": "processInstances", - "resourceFields": { - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "endTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "exitReason": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "phase": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "priority": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "processName": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "resourceId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "resourceType": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "result": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "runningProcessServerId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "startProcessServerId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "startTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - } - }, - "collectionFilters": { - "endTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "exitReason": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "phase": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "priority": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "processName": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "resourceId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "resourceType": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "result": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "runningProcessServerId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "startProcessServerId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "startTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "processexecutions" - ], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "projectMember", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/projectmember", - "collection": "http://localhost:8080/v1/projectmembers" - }, - "actions": {}, - "pluralName": "projectMembers", - "resourceFields": { - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "externalId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "externalIdType": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": [ - "github_user", - "github_org", - "github_team", - "rancher_id" - ], - "default": "rancher_id" - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "projectId": { - "type": "reference[project]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "role": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": [ - "member", - "owner" - ], - "default": "member" - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalIdType": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "projectId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "role": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "project" - ], - "resourceActions": { - "update": { - "input": null, - "output": "projectMember" - }, - "activate": { - "input": null, - "output": "projectMember" - }, - "remove": { - "input": null, - "output": "projectMember" - }, - "restore": { - "input": null, - "output": "projectMember" - }, - "deactivate": { - "input": null, - "output": "projectMember" - }, - "create": { - "input": null, - "output": "projectMember" - }, - "purge": { - "input": null, - "output": "projectMember" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "service", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/service", - "collection": "http://localhost:8080/v1/services" - }, - "actions": {}, - "pluralName": "services", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "environmentId": { - "type": "reference[environment]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": "[a-zA-Z0-9]-", - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": 1, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "registering", - "removed", - "removing", - "requested", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "scale": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": 1 - }, - "dataVolumesFromService": { - "type": "array[reference[service]]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "launchConfig": { - "type": "container", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "environmentId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "loadbalancerlisteners", - "environment", - "loadbalancerconfigs", - "consumedservices", - "account", - "instances", - "consumedbyservices", - "loadbalancers" - ], - "resourceActions": { - "update": { - "input": null, - "output": "service" - }, - "activate": { - "input": null, - "output": "service" - }, - "remove": { - "input": null, - "output": "service" - }, - "setservicelinks": { - "input": "setServiceLinksInput", - "output": "service" - }, - "removeservicelink": { - "input": "addRemoveServiceLinkInput", - "output": "service" - }, - "addservicelink": { - "input": "addRemoveServiceLinkInput", - "output": "service" - }, - "deactivate": { - "input": null, - "output": "service" - }, - "create": { - "input": null, - "output": "service" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "setting", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/setting", - "collection": "http://localhost:8080/v1/settings" - }, - "actions": {}, - "pluralName": "settings", - "resourceFields": { - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "value": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - } - }, - "collectionFilters": { - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "value": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "snapshot", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/snapshot", - "collection": "http://localhost:8080/v1/snapshots" - }, - "actions": {}, - "pluralName": "snapshots", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "backed-up", - "backing-up", - "created", - "creating", - "removed", - "removing", - "requested" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "volumeId": { - "type": "reference[volume]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "managedVolumeUUID": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "volumeId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "storagepools", - "volume", - "account" - ], - "resourceActions": { - "remove": { - "input": null, - "output": "snapshot" - }, - "create": { - "input": null, - "output": "snapshot" - }, - "backup": { - "input": null, - "output": "snapshot" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "storagePool", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/storagepool", - "collection": "http://localhost:8080/v1/storagepools" - }, - "actions": {}, - "pluralName": "storagePools", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "agentId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "external": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "physicalTotalSizeMb": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "virtualTotalSizeMb": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "zoneId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "hosts", - "images", - "account", - "credentials", - "volumes", - "snapshots" - ], - "resourceActions": { - "update": { - "input": null, - "output": "storagePool" - }, - "activate": { - "input": null, - "output": "storagePool" - }, - "remove": { - "input": null, - "output": "storagePool" - }, - "restore": { - "input": null, - "output": "storagePool" - }, - "deactivate": { - "input": null, - "output": "storagePool" - }, - "create": { - "input": null, - "output": "storagePool" - }, - "purge": { - "input": null, - "output": "storagePool" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "task", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/task", - "collection": "http://localhost:8080/v1/tasks" - }, - "actions": {}, - "pluralName": "tasks", - "resourceFields": { - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - } - }, - "collectionFilters": { - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "taskinstances" - ], - "resourceActions": { - "execute": { - "input": null, - "output": "task" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "taskInstance", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/taskinstance", - "collection": "http://localhost:8080/v1/taskinstances" - }, - "actions": {}, - "pluralName": "taskInstances", - "resourceFields": { - "endTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "exception": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "serverId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "startTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "taskId": { - "type": "reference[task]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - } - }, - "collectionFilters": { - "endTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "exception": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "serverId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "startTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "taskId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "task" - ], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "volume", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/volume", - "collection": "http://localhost:8080/v1/volumes" - }, - "actions": {}, - "pluralName": "volumes", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "imageId": { - "type": "reference[image]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "instanceId": { - "type": "reference[instance]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "uri": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 512, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "isHostPath": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": false - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "allocationState": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "attachedState": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "deviceNumber": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "format": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "imageId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "instanceId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "offeringId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "physicalSizeMb": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uri": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "virtualSizeMb": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "zoneId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "mounts", - "storagepools", - "image", - "account", - "snapshots", - "instance" - ], - "resourceActions": { - "update": { - "input": null, - "output": "volume" - }, - "activate": { - "input": null, - "output": "volume" - }, - "remove": { - "input": null, - "output": "volume" - }, - "restore": { - "input": null, - "output": "volume" - }, - "deallocate": { - "input": null, - "output": "volume" - }, - "allocate": { - "input": null, - "output": "volume" - }, - "deactivate": { - "input": null, - "output": "volume" - }, - "create": { - "input": null, - "output": "volume" - }, - "purge": { - "input": null, - "output": "volume" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "DELETE" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "typeDocumentation", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/typedocumentation", - "collection": "http://localhost:8080/v1/typedocumentations" - }, - "actions": {}, - "pluralName": "typeDocumentations", - "resourceFields": { - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "id": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "containerExec", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/containerexec", - "collection": "http://localhost:8080/v1/containerexecs" - }, - "actions": {}, - "pluralName": "containerExecs", - "resourceFields": { - "attachStdin": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": true - }, - "attachStdout": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": true - }, - "command": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "tty": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": true - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "containerLogs", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/containerlogs" - }, - "actions": {}, - "pluralName": "containerLogses", - "resourceFields": { - "follow": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": true - }, - "lines": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": 0, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": 100 - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "hostAccess", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/hostaccess", - "collection": "http://localhost:8080/v1/hostaccesses" - }, - "actions": {}, - "pluralName": "hostAccesses", - "resourceFields": { - "token": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "url": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "activeSetting", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/activesetting" - }, - "actions": {}, - "pluralName": "activeSettings", - "resourceFields": { - "activeValue": { - "type": "json", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "id": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "inDb": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "source": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "value": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [] - }, - { - "id": "extensionImplementation", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/extensionimplementation" - }, - "actions": {}, - "pluralName": "extensionImplementations", - "resourceFields": { - "className": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "properties": { - "type": "map[string]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [] - }, - { - "id": "extensionPoint", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/extensionpoint", - "collection": "http://localhost:8080/v1/extensionpoints" - }, - "actions": {}, - "pluralName": "extensionPoints", - "resourceFields": { - "excludeSetting": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "implementations": { - "type": "array[extensionImplementation]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "includeSetting": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "listSetting": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "processDefinition", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/processdefinition", - "collection": "http://localhost:8080/v1/processdefinitions" - }, - "actions": {}, - "pluralName": "processDefinitions", - "resourceFields": { - "extensionBased": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "id": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "postProcessListeners": { - "type": "extensionPoint", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "preProcessListeners": { - "type": "extensionPoint", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "processHandlers": { - "type": "extensionPoint", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "resourceType": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "stateTransitions": { - "type": "array[stateTransition]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "resourceDefinition", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/resourcedefinition", - "collection": "http://localhost:8080/v1/resourcedefinitions" - }, - "actions": {}, - "pluralName": "resourceDefinitions", - "resourceFields": { - "id": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "stateTransition", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/statetransition" - }, - "actions": {}, - "pluralName": "stateTransitions", - "resourceFields": {}, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [] - }, - { - "id": "githubconfig", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/githubconfig", - "collection": "http://localhost:8080/v1/githubconfigs" - }, - "actions": {}, - "pluralName": "githubconfigs", - "resourceFields": { - "accessMode": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "restricted", - "unrestricted" - ], - "default": "unrestricted" - }, - "allowedOrganizations": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "allowedUsers": { - "type": "array[string]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "clientId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "clientSecret": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "enabled": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "statsAccess", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/statsaccess", - "collection": "http://localhost:8080/v1/statsaccesses" - }, - "actions": {}, - "pluralName": "statsAccesses", - "resourceFields": { - "token": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "url": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET" - ] - }, - { - "id": "virtualboxConfig", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/virtualboxconfig" - }, - "actions": {}, - "pluralName": "virtualboxConfigs", - "resourceFields": { - "memory": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "diskSize": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "boot2dockerUrl": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "digitaloceanConfig", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/digitaloceanconfig" - }, - "actions": {}, - "pluralName": "digitaloceanConfigs", - "resourceFields": { - "image": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "region": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "size": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "accessToken": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "ipv6": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "privateNetworking": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "backups": { - "type": "boolean", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "amazonec2Config", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/amazonec2config" - }, - "actions": {}, - "pluralName": "amazonec2Configs", - "resourceFields": { - "accessKey": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "secretKey": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "vpcId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "sessionToken": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "ami": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "region": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "zone": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "subnetId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "securityGroup": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "instanceType": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "rootSize": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "iamInstanceProfile": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "rackspaceConfig", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/rackspaceconfig" - }, - "actions": {}, - "pluralName": "rackspaceConfigs", - "resourceFields": { - "username": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "apiKey": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "region": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "endpointType": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "imageId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "flavorId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "sshUser": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "sshPort": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "dockerInstall": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "packetConfig", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/packetconfig" - }, - "actions": {}, - "pluralName": "packetConfigs", - "resourceFields": { - "apiKey": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "projectId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "os": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "facilityCode": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "plan": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "billingCycle": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": {}, - "includeableLinks": [], - "resourceActions": {}, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "POST" - ] - }, - { - "id": "machine", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/machine", - "collection": "http://localhost:8080/v1/machines" - }, - "actions": {}, - "pluralName": "machines", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "externalId": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": false, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": 1, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "active", - "bootstrapping", - "created", - "creating", - "error", - "erroring", - "removed", - "removing", - "requested", - "updating" - ], - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "authCertificateAuthority": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "authKey": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "driver": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "extractedConfig": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "virtualboxConfig": { - "type": "virtualboxConfig", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "digitaloceanConfig": { - "type": "digitaloceanConfig", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "amazonec2Config": { - "type": "amazonec2Config", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "rackspaceConfig": { - "type": "rackspaceConfig", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "packetConfig": { - "type": "packetConfig", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "agentId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "externalId": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "hosts", - "account" - ], - "resourceActions": { - "update": { - "input": null, - "output": "physicalHost" - }, - "bootstrap": { - "input": null, - "output": "physicalHost" - }, - "remove": { - "input": null, - "output": "physicalHost" - }, - "error": { - "input": null, - "output": "physicalHost" - }, - "create": { - "input": null, - "output": "physicalHost" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET", - "PUT", - "DELETE" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "register", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/register", - "collection": "http://localhost:8080/v1/register" - }, - "actions": {}, - "pluralName": "register", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "key": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": true, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "accessKey": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "secretKey": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "key": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "token": { - "modifiers": [ - "eq" - ] - } - }, - "includeableLinks": [ - "account" - ], - "resourceActions": { - "update": { - "input": null, - "output": "genericObject" - }, - "activate": { - "input": null, - "output": "genericObject" - }, - "remove": { - "input": null, - "output": "genericObject" - }, - "restore": { - "input": null, - "output": "genericObject" - }, - "deactivate": { - "input": null, - "output": "genericObject" - }, - "create": { - "input": null, - "output": "genericObject" - }, - "purge": { - "input": null, - "output": "genericObject" - }, - "stop": { - "input": "instanceStop", - "output": "instance" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET", - "POST" - ] - }, - { - "id": "registrationToken", - "type": "schema", - "links": { - "self": "http://localhost:8080/v1/schemas/registrationtoken", - "collection": "http://localhost:8080/v1/registrationtokens" - }, - "actions": {}, - "pluralName": "registrationTokens", - "resourceFields": { - "accountId": { - "type": "reference[account]", - "validChars": null, - "invalidChars": null, - "create": true, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "created": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "data": { - "type": "map[json]", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 65535, - "options": null, - "default": null - }, - "description": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 1024, - "options": null, - "default": null - }, - "id": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "kind": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "name": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": true, - "update": true, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removeTime": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "removed": { - "type": "date", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 255, - "options": null, - "default": null - }, - "state": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": [ - "activating", - "active", - "deactivating", - "inactive", - "purged", - "purging", - "registering", - "removed", - "removing", - "requested", - "restoring", - "updating-active", - "updating-inactive" - ], - "default": null - }, - "transitioning": { - "type": "enum", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": [ - "yes", - "no", - "error" - ], - "default": null - }, - "transitioningMessage": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "transitioningProgress": { - "type": "int", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "uuid": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": true, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": 128, - "options": null, - "default": null - }, - "command": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "image": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "token": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - }, - "registrationUrl": { - "type": "string", - "validChars": null, - "invalidChars": null, - "create": false, - "update": false, - "nullable": false, - "unique": false, - "required": false, - "min": null, - "max": null, - "minLength": null, - "maxLength": null, - "options": null, - "default": null - } - }, - "collectionFilters": { - "accountId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "created": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "description": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "id": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "kind": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "name": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "publicValue": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "registryId": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "removeTime": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "removed": { - "modifiers": [ - "eq", - "ne", - "lt", - "lte", - "gt", - "gte", - "null", - "notnull" - ] - }, - "secretValue": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - }, - "state": { - "modifiers": [ - "eq", - "ne", - "null", - "notnull" - ] - }, - "uuid": { - "modifiers": [ - "eq", - "ne", - "prefix", - "like", - "notlike", - "null", - "notnull" - ] - } - }, - "includeableLinks": [ - "images", - "account", - "instances" - ], - "resourceActions": { - "update": { - "input": null, - "output": "credential" - }, - "activate": { - "input": null, - "output": "credential" - }, - "remove": { - "input": null, - "output": "credential" - }, - "restore": { - "input": null, - "output": "credential" - }, - "deactivate": { - "input": null, - "output": "credential" - }, - "create": { - "input": null, - "output": "credential" - }, - "purge": { - "input": null, - "output": "credential" - } - }, - "collectionActions": {}, - "collectionFields": {}, - "resourceMethods": [ - "GET" - ], - "collectionMethods": [ - "GET", - "POST" - ] - } - ], - "sortLinks": {}, - "pagination": null, - "sort": null, - "filters": {}, - "createDefaults": {} -} diff --git a/vendor/github.com/rancher/go-rancher/v2/client.go b/vendor/github.com/rancher/go-rancher/v2/client.go new file mode 100644 index 000000000..0b14ada3a --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/client.go @@ -0,0 +1,7 @@ +package client + +type RancherBaseClient struct { + Opts *ClientOpts + Schemas *Schemas + Types map[string]Schema +} diff --git a/vendor/github.com/rancher/go-rancher/v2/common.go b/vendor/github.com/rancher/go-rancher/v2/common.go new file mode 100644 index 000000000..910285996 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/common.go @@ -0,0 +1,571 @@ +package client + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "os" + "regexp" + "time" + + "github.com/gorilla/websocket" + "github.com/pkg/errors" +) + +const ( + SELF = "self" + COLLECTION = "collection" +) + +var ( + debug = false + dialer = &websocket.Dialer{} +) + +type ClientOpts struct { + Url string + AccessKey string + SecretKey string + Timeout time.Duration +} + +type ApiError struct { + StatusCode int + Url string + Msg string + Status string + Body string +} + +func (e *ApiError) Error() string { + return e.Msg +} + +func IsNotFound(err error) bool { + apiError, ok := err.(*ApiError) + if !ok { + return false + } + + return apiError.StatusCode == http.StatusNotFound +} + +func newApiError(resp *http.Response, url string) *ApiError { + contents, err := ioutil.ReadAll(resp.Body) + var body string + if err != nil { + body = "Unreadable body." + } else { + body = string(contents) + } + + data := map[string]interface{}{} + if json.Unmarshal(contents, &data) == nil { + delete(data, "id") + delete(data, "links") + delete(data, "actions") + delete(data, "type") + delete(data, "status") + buf := &bytes.Buffer{} + for k, v := range data { + if v == nil { + continue + } + if buf.Len() > 0 { + buf.WriteString(", ") + } + fmt.Fprintf(buf, "%s=%v", k, v) + } + body = buf.String() + } + formattedMsg := fmt.Sprintf("Bad response statusCode [%d]. Status [%s]. Body: [%s] from [%s]", + resp.StatusCode, resp.Status, body, url) + return &ApiError{ + Url: url, + Msg: formattedMsg, + StatusCode: resp.StatusCode, + Status: resp.Status, + Body: body, + } +} + +func contains(array []string, item string) bool { + for _, check := range array { + if check == item { + return true + } + } + + return false +} + +func appendFilters(urlString string, filters map[string]interface{}) (string, error) { + if len(filters) == 0 { + return urlString, nil + } + + u, err := url.Parse(urlString) + if err != nil { + return "", err + } + + q := u.Query() + for k, v := range filters { + if l, ok := v.([]string); ok { + for _, v := range l { + q.Add(k, v) + } + } else { + q.Add(k, fmt.Sprintf("%v", v)) + } + } + + u.RawQuery = q.Encode() + return u.String(), nil +} + +func setupRancherBaseClient(rancherClient *RancherBaseClient, opts *ClientOpts) error { + if opts.Timeout == 0 { + opts.Timeout = time.Second * 10 + } + client := &http.Client{Timeout: opts.Timeout} + req, err := http.NewRequest("GET", opts.Url, nil) + if err != nil { + return err + } + + req.SetBasicAuth(opts.AccessKey, opts.SecretKey) + + resp, err := client.Do(req) + if err != nil { + return err + } + + defer resp.Body.Close() + + if resp.StatusCode != 200 { + return newApiError(resp, opts.Url) + } + + schemasUrls := resp.Header.Get("X-API-Schemas") + if len(schemasUrls) == 0 { + return errors.New("Failed to find schema at [" + opts.Url + "]") + } + + if schemasUrls != opts.Url { + req, err = http.NewRequest("GET", schemasUrls, nil) + req.SetBasicAuth(opts.AccessKey, opts.SecretKey) + if err != nil { + return err + } + + resp, err = client.Do(req) + if err != nil { + return err + } + + defer resp.Body.Close() + + if resp.StatusCode != 200 { + return newApiError(resp, opts.Url) + } + } + + var schemas Schemas + bytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + + err = json.Unmarshal(bytes, &schemas) + if err != nil { + return err + } + + rancherClient.Opts = opts + rancherClient.Schemas = &schemas + + for _, schema := range schemas.Data { + rancherClient.Types[schema.Id] = schema + } + + return nil +} + +func NewListOpts() *ListOpts { + return &ListOpts{ + Filters: map[string]interface{}{}, + } +} + +func (rancherClient *RancherBaseClient) setupRequest(req *http.Request) { + req.SetBasicAuth(rancherClient.Opts.AccessKey, rancherClient.Opts.SecretKey) +} + +func (rancherClient *RancherBaseClient) newHttpClient() *http.Client { + if rancherClient.Opts.Timeout == 0 { + rancherClient.Opts.Timeout = time.Second * 10 + } + return &http.Client{Timeout: rancherClient.Opts.Timeout} +} + +func (rancherClient *RancherBaseClient) doDelete(url string) error { + client := rancherClient.newHttpClient() + req, err := http.NewRequest("DELETE", url, nil) + if err != nil { + return err + } + + rancherClient.setupRequest(req) + + resp, err := client.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + + io.Copy(ioutil.Discard, resp.Body) + + if resp.StatusCode >= 300 { + return newApiError(resp, url) + } + + return nil +} + +func (rancherClient *RancherBaseClient) Websocket(url string, headers map[string][]string) (*websocket.Conn, *http.Response, error) { + return dialer.Dial(url, http.Header(headers)) +} + +func (rancherClient *RancherBaseClient) doGet(url string, opts *ListOpts, respObject interface{}) error { + if opts == nil { + opts = NewListOpts() + } + url, err := appendFilters(url, opts.Filters) + if err != nil { + return err + } + + if debug { + fmt.Println("GET " + url) + } + + client := rancherClient.newHttpClient() + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return err + } + + rancherClient.setupRequest(req) + + resp, err := client.Do(req) + if err != nil { + return err + } + + defer resp.Body.Close() + + if resp.StatusCode != 200 { + return newApiError(resp, url) + } + + byteContent, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + + if debug { + fmt.Println("Response <= " + string(byteContent)) + } + + if err := json.Unmarshal(byteContent, respObject); err != nil { + return errors.Wrap(err, fmt.Sprintf("Failed to parse: %s", byteContent)) + } + + return nil +} + +func (rancherClient *RancherBaseClient) List(schemaType string, opts *ListOpts, respObject interface{}) error { + return rancherClient.doList(schemaType, opts, respObject) +} + +func (rancherClient *RancherBaseClient) doList(schemaType string, opts *ListOpts, respObject interface{}) error { + schema, ok := rancherClient.Types[schemaType] + if !ok { + return errors.New("Unknown schema type [" + schemaType + "]") + } + + if !contains(schema.CollectionMethods, "GET") { + return errors.New("Resource type [" + schemaType + "] is not listable") + } + + collectionUrl, ok := schema.Links[COLLECTION] + if !ok { + return errors.New("Failed to find collection URL for [" + schemaType + "]") + } + + return rancherClient.doGet(collectionUrl, opts, respObject) +} + +func (rancherClient *RancherBaseClient) Post(url string, createObj interface{}, respObject interface{}) error { + return rancherClient.doModify("POST", url, createObj, respObject) +} + +func (rancherClient *RancherBaseClient) GetLink(resource Resource, link string, respObject interface{}) error { + url := resource.Links[link] + if url == "" { + return fmt.Errorf("Failed to find link: %s", link) + } + + return rancherClient.doGet(url, &ListOpts{}, respObject) +} + +func (rancherClient *RancherBaseClient) doModify(method string, url string, createObj interface{}, respObject interface{}) error { + bodyContent, err := json.Marshal(createObj) + if err != nil { + return err + } + + if debug { + fmt.Println(method + " " + url) + fmt.Println("Request => " + string(bodyContent)) + } + + client := rancherClient.newHttpClient() + req, err := http.NewRequest(method, url, bytes.NewBuffer(bodyContent)) + if err != nil { + return err + } + + rancherClient.setupRequest(req) + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Content-Length", string(len(bodyContent))) + + resp, err := client.Do(req) + if err != nil { + return err + } + + defer resp.Body.Close() + + if resp.StatusCode >= 300 { + return newApiError(resp, url) + } + + byteContent, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + + if len(byteContent) > 0 { + if debug { + fmt.Println("Response <= " + string(byteContent)) + } + return json.Unmarshal(byteContent, respObject) + } + + return nil +} + +func (rancherClient *RancherBaseClient) Create(schemaType string, createObj interface{}, respObject interface{}) error { + return rancherClient.doCreate(schemaType, createObj, respObject) +} + +func (rancherClient *RancherBaseClient) doCreate(schemaType string, createObj interface{}, respObject interface{}) error { + if createObj == nil { + createObj = map[string]string{} + } + if respObject == nil { + respObject = &map[string]interface{}{} + } + schema, ok := rancherClient.Types[schemaType] + if !ok { + return errors.New("Unknown schema type [" + schemaType + "]") + } + + if !contains(schema.CollectionMethods, "POST") { + return errors.New("Resource type [" + schemaType + "] is not creatable") + } + + var collectionUrl string + collectionUrl, ok = schema.Links[COLLECTION] + if !ok { + // return errors.New("Failed to find collection URL for [" + schemaType + "]") + // This is a hack to address https://github.com/rancher/cattle/issues/254 + re := regexp.MustCompile("schemas.*") + collectionUrl = re.ReplaceAllString(schema.Links[SELF], schema.PluralName) + } + + return rancherClient.doModify("POST", collectionUrl, createObj, respObject) +} + +func (rancherClient *RancherBaseClient) Update(schemaType string, existing *Resource, updates interface{}, respObject interface{}) error { + return rancherClient.doUpdate(schemaType, existing, updates, respObject) +} + +func (rancherClient *RancherBaseClient) doUpdate(schemaType string, existing *Resource, updates interface{}, respObject interface{}) error { + if existing == nil { + return errors.New("Existing object is nil") + } + + selfUrl, ok := existing.Links[SELF] + if !ok { + return errors.New(fmt.Sprintf("Failed to find self URL of [%v]", existing)) + } + + if updates == nil { + updates = map[string]string{} + } + + if respObject == nil { + respObject = &map[string]interface{}{} + } + + schema, ok := rancherClient.Types[schemaType] + if !ok { + return errors.New("Unknown schema type [" + schemaType + "]") + } + + if !contains(schema.ResourceMethods, "PUT") { + return errors.New("Resource type [" + schemaType + "] is not updatable") + } + + return rancherClient.doModify("PUT", selfUrl, updates, respObject) +} + +func (rancherClient *RancherBaseClient) ById(schemaType string, id string, respObject interface{}) error { + return rancherClient.doById(schemaType, id, respObject) +} + +func (rancherClient *RancherBaseClient) doById(schemaType string, id string, respObject interface{}) error { + schema, ok := rancherClient.Types[schemaType] + if !ok { + return errors.New("Unknown schema type [" + schemaType + "]") + } + + if !contains(schema.ResourceMethods, "GET") { + return errors.New("Resource type [" + schemaType + "] can not be looked up by ID") + } + + collectionUrl, ok := schema.Links[COLLECTION] + if !ok { + return errors.New("Failed to find collection URL for [" + schemaType + "]") + } + + err := rancherClient.doGet(collectionUrl+"/"+id, nil, respObject) + //TODO check for 404 and return nil, nil + return err +} + +func (rancherClient *RancherBaseClient) Delete(existing *Resource) error { + if existing == nil { + return nil + } + return rancherClient.doResourceDelete(existing.Type, existing) +} + +func (rancherClient *RancherBaseClient) doResourceDelete(schemaType string, existing *Resource) error { + schema, ok := rancherClient.Types[schemaType] + if !ok { + return errors.New("Unknown schema type [" + schemaType + "]") + } + + if !contains(schema.ResourceMethods, "DELETE") { + return errors.New("Resource type [" + schemaType + "] can not be deleted") + } + + selfUrl, ok := existing.Links[SELF] + if !ok { + return errors.New(fmt.Sprintf("Failed to find self URL of [%v]", existing)) + } + + return rancherClient.doDelete(selfUrl) +} + +func (rancherClient *RancherBaseClient) Reload(existing *Resource, output interface{}) error { + selfUrl, ok := existing.Links[SELF] + if !ok { + return errors.New(fmt.Sprintf("Failed to find self URL of [%v]", existing)) + } + + return rancherClient.doGet(selfUrl, NewListOpts(), output) +} + +func (rancherClient *RancherBaseClient) Action(schemaType string, action string, + existing *Resource, inputObject, respObject interface{}) error { + return rancherClient.doAction(schemaType, action, existing, inputObject, respObject) +} + +func (rancherClient *RancherBaseClient) doAction(schemaType string, action string, + existing *Resource, inputObject, respObject interface{}) error { + + if existing == nil { + return errors.New("Existing object is nil") + } + + actionUrl, ok := existing.Actions[action] + if !ok { + return errors.New(fmt.Sprintf("Action [%v] not available on [%v]", action, existing)) + } + + _, ok = rancherClient.Types[schemaType] + if !ok { + return errors.New("Unknown schema type [" + schemaType + "]") + } + + var input io.Reader + + if inputObject != nil { + bodyContent, err := json.Marshal(inputObject) + if err != nil { + return err + } + if debug { + fmt.Println("Request => " + string(bodyContent)) + } + input = bytes.NewBuffer(bodyContent) + } + + client := rancherClient.newHttpClient() + req, err := http.NewRequest("POST", actionUrl, input) + if err != nil { + return err + } + + rancherClient.setupRequest(req) + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Content-Length", "0") + + resp, err := client.Do(req) + if err != nil { + return err + } + + defer resp.Body.Close() + + if resp.StatusCode >= 300 { + return newApiError(resp, actionUrl) + } + + byteContent, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + + if debug { + fmt.Println("Response <= " + string(byteContent)) + } + + return json.Unmarshal(byteContent, respObject) +} + +func init() { + debug = os.Getenv("RANCHER_CLIENT_DEBUG") == "true" + if debug { + fmt.Println("Rancher client debug on") + } +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_account.go b/vendor/github.com/rancher/go-rancher/v2/generated_account.go new file mode 100644 index 000000000..3e95989ec --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_account.go @@ -0,0 +1,172 @@ +package client + +const ( + ACCOUNT_TYPE = "account" +) + +type Account struct { + Resource + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + ExternalIdType string `json:"externalIdType,omitempty" yaml:"external_id_type,omitempty"` + + Identity string `json:"identity,omitempty" yaml:"identity,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type AccountCollection struct { + Collection + Data []Account `json:"data,omitempty"` +} + +type AccountClient struct { + rancherClient *RancherClient +} + +type AccountOperations interface { + List(opts *ListOpts) (*AccountCollection, error) + Create(opts *Account) (*Account, error) + Update(existing *Account, updates interface{}) (*Account, error) + ById(id string) (*Account, error) + Delete(container *Account) error + + ActionActivate(*Account) (*Account, error) + + ActionCreate(*Account) (*Account, error) + + ActionDeactivate(*Account) (*Account, error) + + ActionPurge(*Account) (*Account, error) + + ActionRemove(*Account) (*Account, error) + + ActionRestore(*Account) (*Account, error) + + ActionUpdate(*Account) (*Account, error) +} + +func newAccountClient(rancherClient *RancherClient) *AccountClient { + return &AccountClient{ + rancherClient: rancherClient, + } +} + +func (c *AccountClient) Create(container *Account) (*Account, error) { + resp := &Account{} + err := c.rancherClient.doCreate(ACCOUNT_TYPE, container, resp) + return resp, err +} + +func (c *AccountClient) Update(existing *Account, updates interface{}) (*Account, error) { + resp := &Account{} + err := c.rancherClient.doUpdate(ACCOUNT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *AccountClient) List(opts *ListOpts) (*AccountCollection, error) { + resp := &AccountCollection{} + err := c.rancherClient.doList(ACCOUNT_TYPE, opts, resp) + return resp, err +} + +func (c *AccountClient) ById(id string) (*Account, error) { + resp := &Account{} + err := c.rancherClient.doById(ACCOUNT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *AccountClient) Delete(container *Account) error { + return c.rancherClient.doResourceDelete(ACCOUNT_TYPE, &container.Resource) +} + +func (c *AccountClient) ActionActivate(resource *Account) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(ACCOUNT_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AccountClient) ActionCreate(resource *Account) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(ACCOUNT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AccountClient) ActionDeactivate(resource *Account) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(ACCOUNT_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AccountClient) ActionPurge(resource *Account) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(ACCOUNT_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AccountClient) ActionRemove(resource *Account) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(ACCOUNT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AccountClient) ActionRestore(resource *Account) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(ACCOUNT_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AccountClient) ActionUpdate(resource *Account) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(ACCOUNT_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go b/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go new file mode 100644 index 000000000..c8db84705 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go @@ -0,0 +1,75 @@ +package client + +const ( + ACTIVE_SETTING_TYPE = "activeSetting" +) + +type ActiveSetting struct { + Resource + + ActiveValue interface{} `json:"activeValue,omitempty" yaml:"active_value,omitempty"` + + InDb bool `json:"inDb,omitempty" yaml:"in_db,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Source string `json:"source,omitempty" yaml:"source,omitempty"` + + Value string `json:"value,omitempty" yaml:"value,omitempty"` +} + +type ActiveSettingCollection struct { + Collection + Data []ActiveSetting `json:"data,omitempty"` +} + +type ActiveSettingClient struct { + rancherClient *RancherClient +} + +type ActiveSettingOperations interface { + List(opts *ListOpts) (*ActiveSettingCollection, error) + Create(opts *ActiveSetting) (*ActiveSetting, error) + Update(existing *ActiveSetting, updates interface{}) (*ActiveSetting, error) + ById(id string) (*ActiveSetting, error) + Delete(container *ActiveSetting) error +} + +func newActiveSettingClient(rancherClient *RancherClient) *ActiveSettingClient { + return &ActiveSettingClient{ + rancherClient: rancherClient, + } +} + +func (c *ActiveSettingClient) Create(container *ActiveSetting) (*ActiveSetting, error) { + resp := &ActiveSetting{} + err := c.rancherClient.doCreate(ACTIVE_SETTING_TYPE, container, resp) + return resp, err +} + +func (c *ActiveSettingClient) Update(existing *ActiveSetting, updates interface{}) (*ActiveSetting, error) { + resp := &ActiveSetting{} + err := c.rancherClient.doUpdate(ACTIVE_SETTING_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ActiveSettingClient) List(opts *ListOpts) (*ActiveSettingCollection, error) { + resp := &ActiveSettingCollection{} + err := c.rancherClient.doList(ACTIVE_SETTING_TYPE, opts, resp) + return resp, err +} + +func (c *ActiveSettingClient) ById(id string) (*ActiveSetting, error) { + resp := &ActiveSetting{} + err := c.rancherClient.doById(ACTIVE_SETTING_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ActiveSettingClient) Delete(container *ActiveSetting) error { + return c.rancherClient.doResourceDelete(ACTIVE_SETTING_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go new file mode 100644 index 000000000..b2d51c73f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go @@ -0,0 +1,67 @@ +package client + +const ( + ADD_OUTPUTS_INPUT_TYPE = "addOutputsInput" +) + +type AddOutputsInput struct { + Resource + + Outputs map[string]interface{} `json:"outputs,omitempty" yaml:"outputs,omitempty"` +} + +type AddOutputsInputCollection struct { + Collection + Data []AddOutputsInput `json:"data,omitempty"` +} + +type AddOutputsInputClient struct { + rancherClient *RancherClient +} + +type AddOutputsInputOperations interface { + List(opts *ListOpts) (*AddOutputsInputCollection, error) + Create(opts *AddOutputsInput) (*AddOutputsInput, error) + Update(existing *AddOutputsInput, updates interface{}) (*AddOutputsInput, error) + ById(id string) (*AddOutputsInput, error) + Delete(container *AddOutputsInput) error +} + +func newAddOutputsInputClient(rancherClient *RancherClient) *AddOutputsInputClient { + return &AddOutputsInputClient{ + rancherClient: rancherClient, + } +} + +func (c *AddOutputsInputClient) Create(container *AddOutputsInput) (*AddOutputsInput, error) { + resp := &AddOutputsInput{} + err := c.rancherClient.doCreate(ADD_OUTPUTS_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *AddOutputsInputClient) Update(existing *AddOutputsInput, updates interface{}) (*AddOutputsInput, error) { + resp := &AddOutputsInput{} + err := c.rancherClient.doUpdate(ADD_OUTPUTS_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *AddOutputsInputClient) List(opts *ListOpts) (*AddOutputsInputCollection, error) { + resp := &AddOutputsInputCollection{} + err := c.rancherClient.doList(ADD_OUTPUTS_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *AddOutputsInputClient) ById(id string) (*AddOutputsInput, error) { + resp := &AddOutputsInput{} + err := c.rancherClient.doById(ADD_OUTPUTS_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *AddOutputsInputClient) Delete(container *AddOutputsInput) error { + return c.rancherClient.doResourceDelete(ADD_OUTPUTS_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_load_balancer_service_link_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_load_balancer_service_link_input.go new file mode 100644 index 000000000..a5f010ef8 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_load_balancer_service_link_input.go @@ -0,0 +1,67 @@ +package client + +const ( + ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE = "addRemoveLoadBalancerServiceLinkInput" +) + +type AddRemoveLoadBalancerServiceLinkInput struct { + Resource + + ServiceLink LoadBalancerServiceLink `json:"serviceLink,omitempty" yaml:"service_link,omitempty"` +} + +type AddRemoveLoadBalancerServiceLinkInputCollection struct { + Collection + Data []AddRemoveLoadBalancerServiceLinkInput `json:"data,omitempty"` +} + +type AddRemoveLoadBalancerServiceLinkInputClient struct { + rancherClient *RancherClient +} + +type AddRemoveLoadBalancerServiceLinkInputOperations interface { + List(opts *ListOpts) (*AddRemoveLoadBalancerServiceLinkInputCollection, error) + Create(opts *AddRemoveLoadBalancerServiceLinkInput) (*AddRemoveLoadBalancerServiceLinkInput, error) + Update(existing *AddRemoveLoadBalancerServiceLinkInput, updates interface{}) (*AddRemoveLoadBalancerServiceLinkInput, error) + ById(id string) (*AddRemoveLoadBalancerServiceLinkInput, error) + Delete(container *AddRemoveLoadBalancerServiceLinkInput) error +} + +func newAddRemoveLoadBalancerServiceLinkInputClient(rancherClient *RancherClient) *AddRemoveLoadBalancerServiceLinkInputClient { + return &AddRemoveLoadBalancerServiceLinkInputClient{ + rancherClient: rancherClient, + } +} + +func (c *AddRemoveLoadBalancerServiceLinkInputClient) Create(container *AddRemoveLoadBalancerServiceLinkInput) (*AddRemoveLoadBalancerServiceLinkInput, error) { + resp := &AddRemoveLoadBalancerServiceLinkInput{} + err := c.rancherClient.doCreate(ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *AddRemoveLoadBalancerServiceLinkInputClient) Update(existing *AddRemoveLoadBalancerServiceLinkInput, updates interface{}) (*AddRemoveLoadBalancerServiceLinkInput, error) { + resp := &AddRemoveLoadBalancerServiceLinkInput{} + err := c.rancherClient.doUpdate(ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *AddRemoveLoadBalancerServiceLinkInputClient) List(opts *ListOpts) (*AddRemoveLoadBalancerServiceLinkInputCollection, error) { + resp := &AddRemoveLoadBalancerServiceLinkInputCollection{} + err := c.rancherClient.doList(ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *AddRemoveLoadBalancerServiceLinkInputClient) ById(id string) (*AddRemoveLoadBalancerServiceLinkInput, error) { + resp := &AddRemoveLoadBalancerServiceLinkInput{} + err := c.rancherClient.doById(ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *AddRemoveLoadBalancerServiceLinkInputClient) Delete(container *AddRemoveLoadBalancerServiceLinkInput) error { + return c.rancherClient.doResourceDelete(ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go new file mode 100644 index 000000000..82c7d18bd --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go @@ -0,0 +1,67 @@ +package client + +const ( + ADD_REMOVE_SERVICE_LINK_INPUT_TYPE = "addRemoveServiceLinkInput" +) + +type AddRemoveServiceLinkInput struct { + Resource + + ServiceLink ServiceLink `json:"serviceLink,omitempty" yaml:"service_link,omitempty"` +} + +type AddRemoveServiceLinkInputCollection struct { + Collection + Data []AddRemoveServiceLinkInput `json:"data,omitempty"` +} + +type AddRemoveServiceLinkInputClient struct { + rancherClient *RancherClient +} + +type AddRemoveServiceLinkInputOperations interface { + List(opts *ListOpts) (*AddRemoveServiceLinkInputCollection, error) + Create(opts *AddRemoveServiceLinkInput) (*AddRemoveServiceLinkInput, error) + Update(existing *AddRemoveServiceLinkInput, updates interface{}) (*AddRemoveServiceLinkInput, error) + ById(id string) (*AddRemoveServiceLinkInput, error) + Delete(container *AddRemoveServiceLinkInput) error +} + +func newAddRemoveServiceLinkInputClient(rancherClient *RancherClient) *AddRemoveServiceLinkInputClient { + return &AddRemoveServiceLinkInputClient{ + rancherClient: rancherClient, + } +} + +func (c *AddRemoveServiceLinkInputClient) Create(container *AddRemoveServiceLinkInput) (*AddRemoveServiceLinkInput, error) { + resp := &AddRemoveServiceLinkInput{} + err := c.rancherClient.doCreate(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *AddRemoveServiceLinkInputClient) Update(existing *AddRemoveServiceLinkInput, updates interface{}) (*AddRemoveServiceLinkInput, error) { + resp := &AddRemoveServiceLinkInput{} + err := c.rancherClient.doUpdate(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *AddRemoveServiceLinkInputClient) List(opts *ListOpts) (*AddRemoveServiceLinkInputCollection, error) { + resp := &AddRemoveServiceLinkInputCollection{} + err := c.rancherClient.doList(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *AddRemoveServiceLinkInputClient) ById(id string) (*AddRemoveServiceLinkInput, error) { + resp := &AddRemoveServiceLinkInput{} + err := c.rancherClient.doById(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *AddRemoveServiceLinkInputClient) Delete(container *AddRemoveServiceLinkInput) error { + return c.rancherClient.doResourceDelete(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_agent.go b/vendor/github.com/rancher/go-rancher/v2/generated_agent.go new file mode 100644 index 000000000..d3bfb0729 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_agent.go @@ -0,0 +1,194 @@ +package client + +const ( + AGENT_TYPE = "agent" +) + +type Agent struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + ManagedConfig bool `json:"managedConfig,omitempty" yaml:"managed_config,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type AgentCollection struct { + Collection + Data []Agent `json:"data,omitempty"` +} + +type AgentClient struct { + rancherClient *RancherClient +} + +type AgentOperations interface { + List(opts *ListOpts) (*AgentCollection, error) + Create(opts *Agent) (*Agent, error) + Update(existing *Agent, updates interface{}) (*Agent, error) + ById(id string) (*Agent, error) + Delete(container *Agent) error + + ActionActivate(*Agent) (*Agent, error) + + ActionCreate(*Agent) (*Agent, error) + + ActionDeactivate(*Agent) (*Agent, error) + + ActionDisconnect(*Agent) (*Agent, error) + + ActionPurge(*Agent) (*Agent, error) + + ActionReconnect(*Agent) (*Agent, error) + + ActionRemove(*Agent) (*Agent, error) + + ActionRestore(*Agent) (*Agent, error) + + ActionUpdate(*Agent) (*Agent, error) +} + +func newAgentClient(rancherClient *RancherClient) *AgentClient { + return &AgentClient{ + rancherClient: rancherClient, + } +} + +func (c *AgentClient) Create(container *Agent) (*Agent, error) { + resp := &Agent{} + err := c.rancherClient.doCreate(AGENT_TYPE, container, resp) + return resp, err +} + +func (c *AgentClient) Update(existing *Agent, updates interface{}) (*Agent, error) { + resp := &Agent{} + err := c.rancherClient.doUpdate(AGENT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *AgentClient) List(opts *ListOpts) (*AgentCollection, error) { + resp := &AgentCollection{} + err := c.rancherClient.doList(AGENT_TYPE, opts, resp) + return resp, err +} + +func (c *AgentClient) ById(id string) (*Agent, error) { + resp := &Agent{} + err := c.rancherClient.doById(AGENT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *AgentClient) Delete(container *Agent) error { + return c.rancherClient.doResourceDelete(AGENT_TYPE, &container.Resource) +} + +func (c *AgentClient) ActionActivate(resource *Agent) (*Agent, error) { + + resp := &Agent{} + + err := c.rancherClient.doAction(AGENT_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AgentClient) ActionCreate(resource *Agent) (*Agent, error) { + + resp := &Agent{} + + err := c.rancherClient.doAction(AGENT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AgentClient) ActionDeactivate(resource *Agent) (*Agent, error) { + + resp := &Agent{} + + err := c.rancherClient.doAction(AGENT_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AgentClient) ActionDisconnect(resource *Agent) (*Agent, error) { + + resp := &Agent{} + + err := c.rancherClient.doAction(AGENT_TYPE, "disconnect", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AgentClient) ActionPurge(resource *Agent) (*Agent, error) { + + resp := &Agent{} + + err := c.rancherClient.doAction(AGENT_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AgentClient) ActionReconnect(resource *Agent) (*Agent, error) { + + resp := &Agent{} + + err := c.rancherClient.doAction(AGENT_TYPE, "reconnect", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AgentClient) ActionRemove(resource *Agent) (*Agent, error) { + + resp := &Agent{} + + err := c.rancherClient.doAction(AGENT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AgentClient) ActionRestore(resource *Agent) (*Agent, error) { + + resp := &Agent{} + + err := c.rancherClient.doAction(AGENT_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *AgentClient) ActionUpdate(resource *Agent) (*Agent, error) { + + resp := &Agent{} + + err := c.rancherClient.doAction(AGENT_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go b/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go new file mode 100644 index 000000000..9102e4f52 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go @@ -0,0 +1,115 @@ +package client + +const ( + AMAZONEC2CONFIG_TYPE = "amazonec2Config" +) + +type Amazonec2Config struct { + Resource + + AccessKey string `json:"accessKey,omitempty" yaml:"access_key,omitempty"` + + Ami string `json:"ami,omitempty" yaml:"ami,omitempty"` + + DeviceName string `json:"deviceName,omitempty" yaml:"device_name,omitempty"` + + IamInstanceProfile string `json:"iamInstanceProfile,omitempty" yaml:"iam_instance_profile,omitempty"` + + InstanceType string `json:"instanceType,omitempty" yaml:"instance_type,omitempty"` + + KeypairName string `json:"keypairName,omitempty" yaml:"keypair_name,omitempty"` + + Monitoring bool `json:"monitoring,omitempty" yaml:"monitoring,omitempty"` + + PrivateAddressOnly bool `json:"privateAddressOnly,omitempty" yaml:"private_address_only,omitempty"` + + Region string `json:"region,omitempty" yaml:"region,omitempty"` + + RequestSpotInstance bool `json:"requestSpotInstance,omitempty" yaml:"request_spot_instance,omitempty"` + + Retries string `json:"retries,omitempty" yaml:"retries,omitempty"` + + RootSize string `json:"rootSize,omitempty" yaml:"root_size,omitempty"` + + SecretKey string `json:"secretKey,omitempty" yaml:"secret_key,omitempty"` + + SecurityGroup []string `json:"securityGroup,omitempty" yaml:"security_group,omitempty"` + + SessionToken string `json:"sessionToken,omitempty" yaml:"session_token,omitempty"` + + SpotPrice string `json:"spotPrice,omitempty" yaml:"spot_price,omitempty"` + + SshKeypath string `json:"sshKeypath,omitempty" yaml:"ssh_keypath,omitempty"` + + SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` + + SubnetId string `json:"subnetId,omitempty" yaml:"subnet_id,omitempty"` + + Tags string `json:"tags,omitempty" yaml:"tags,omitempty"` + + UseEbsOptimizedInstance bool `json:"useEbsOptimizedInstance,omitempty" yaml:"use_ebs_optimized_instance,omitempty"` + + UsePrivateAddress bool `json:"usePrivateAddress,omitempty" yaml:"use_private_address,omitempty"` + + VolumeType string `json:"volumeType,omitempty" yaml:"volume_type,omitempty"` + + VpcId string `json:"vpcId,omitempty" yaml:"vpc_id,omitempty"` + + Zone string `json:"zone,omitempty" yaml:"zone,omitempty"` +} + +type Amazonec2ConfigCollection struct { + Collection + Data []Amazonec2Config `json:"data,omitempty"` +} + +type Amazonec2ConfigClient struct { + rancherClient *RancherClient +} + +type Amazonec2ConfigOperations interface { + List(opts *ListOpts) (*Amazonec2ConfigCollection, error) + Create(opts *Amazonec2Config) (*Amazonec2Config, error) + Update(existing *Amazonec2Config, updates interface{}) (*Amazonec2Config, error) + ById(id string) (*Amazonec2Config, error) + Delete(container *Amazonec2Config) error +} + +func newAmazonec2ConfigClient(rancherClient *RancherClient) *Amazonec2ConfigClient { + return &Amazonec2ConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *Amazonec2ConfigClient) Create(container *Amazonec2Config) (*Amazonec2Config, error) { + resp := &Amazonec2Config{} + err := c.rancherClient.doCreate(AMAZONEC2CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *Amazonec2ConfigClient) Update(existing *Amazonec2Config, updates interface{}) (*Amazonec2Config, error) { + resp := &Amazonec2Config{} + err := c.rancherClient.doUpdate(AMAZONEC2CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *Amazonec2ConfigClient) List(opts *ListOpts) (*Amazonec2ConfigCollection, error) { + resp := &Amazonec2ConfigCollection{} + err := c.rancherClient.doList(AMAZONEC2CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *Amazonec2ConfigClient) ById(id string) (*Amazonec2Config, error) { + resp := &Amazonec2Config{} + err := c.rancherClient.doById(AMAZONEC2CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *Amazonec2ConfigClient) Delete(container *Amazonec2Config) error { + return c.rancherClient.doResourceDelete(AMAZONEC2CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go b/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go new file mode 100644 index 000000000..c0f9c50ea --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go @@ -0,0 +1,161 @@ +package client + +const ( + API_KEY_TYPE = "apiKey" +) + +type ApiKey struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ApiKeyCollection struct { + Collection + Data []ApiKey `json:"data,omitempty"` +} + +type ApiKeyClient struct { + rancherClient *RancherClient +} + +type ApiKeyOperations interface { + List(opts *ListOpts) (*ApiKeyCollection, error) + Create(opts *ApiKey) (*ApiKey, error) + Update(existing *ApiKey, updates interface{}) (*ApiKey, error) + ById(id string) (*ApiKey, error) + Delete(container *ApiKey) error + + ActionActivate(*ApiKey) (*Credential, error) + + ActionCreate(*ApiKey) (*Credential, error) + + ActionDeactivate(*ApiKey) (*Credential, error) + + ActionPurge(*ApiKey) (*Credential, error) + + ActionRemove(*ApiKey) (*Credential, error) + + ActionUpdate(*ApiKey) (*Credential, error) +} + +func newApiKeyClient(rancherClient *RancherClient) *ApiKeyClient { + return &ApiKeyClient{ + rancherClient: rancherClient, + } +} + +func (c *ApiKeyClient) Create(container *ApiKey) (*ApiKey, error) { + resp := &ApiKey{} + err := c.rancherClient.doCreate(API_KEY_TYPE, container, resp) + return resp, err +} + +func (c *ApiKeyClient) Update(existing *ApiKey, updates interface{}) (*ApiKey, error) { + resp := &ApiKey{} + err := c.rancherClient.doUpdate(API_KEY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ApiKeyClient) List(opts *ListOpts) (*ApiKeyCollection, error) { + resp := &ApiKeyCollection{} + err := c.rancherClient.doList(API_KEY_TYPE, opts, resp) + return resp, err +} + +func (c *ApiKeyClient) ById(id string) (*ApiKey, error) { + resp := &ApiKey{} + err := c.rancherClient.doById(API_KEY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ApiKeyClient) Delete(container *ApiKey) error { + return c.rancherClient.doResourceDelete(API_KEY_TYPE, &container.Resource) +} + +func (c *ApiKeyClient) ActionActivate(resource *ApiKey) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(API_KEY_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ApiKeyClient) ActionCreate(resource *ApiKey) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(API_KEY_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ApiKeyClient) ActionDeactivate(resource *ApiKey) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(API_KEY_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ApiKeyClient) ActionPurge(resource *ApiKey) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(API_KEY_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ApiKeyClient) ActionRemove(resource *ApiKey) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(API_KEY_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ApiKeyClient) ActionUpdate(resource *ApiKey) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(API_KEY_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go b/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go new file mode 100644 index 000000000..d8ff08fb5 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go @@ -0,0 +1,93 @@ +package client + +const ( + AUDIT_LOG_TYPE = "auditLog" +) + +type AuditLog struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AuthType string `json:"authType,omitempty" yaml:"auth_type,omitempty"` + + AuthenticatedAsAccountId string `json:"authenticatedAsAccountId,omitempty" yaml:"authenticated_as_account_id,omitempty"` + + AuthenticatedAsIdentityId string `json:"authenticatedAsIdentityId,omitempty" yaml:"authenticated_as_identity_id,omitempty"` + + ClientIp string `json:"clientIp,omitempty" yaml:"client_ip,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + RequestObject string `json:"requestObject,omitempty" yaml:"request_object,omitempty"` + + ResourceId int64 `json:"resourceId,omitempty" yaml:"resource_id,omitempty"` + + ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` + + ResponseCode string `json:"responseCode,omitempty" yaml:"response_code,omitempty"` + + ResponseObject string `json:"responseObject,omitempty" yaml:"response_object,omitempty"` +} + +type AuditLogCollection struct { + Collection + Data []AuditLog `json:"data,omitempty"` +} + +type AuditLogClient struct { + rancherClient *RancherClient +} + +type AuditLogOperations interface { + List(opts *ListOpts) (*AuditLogCollection, error) + Create(opts *AuditLog) (*AuditLog, error) + Update(existing *AuditLog, updates interface{}) (*AuditLog, error) + ById(id string) (*AuditLog, error) + Delete(container *AuditLog) error +} + +func newAuditLogClient(rancherClient *RancherClient) *AuditLogClient { + return &AuditLogClient{ + rancherClient: rancherClient, + } +} + +func (c *AuditLogClient) Create(container *AuditLog) (*AuditLog, error) { + resp := &AuditLog{} + err := c.rancherClient.doCreate(AUDIT_LOG_TYPE, container, resp) + return resp, err +} + +func (c *AuditLogClient) Update(existing *AuditLog, updates interface{}) (*AuditLog, error) { + resp := &AuditLog{} + err := c.rancherClient.doUpdate(AUDIT_LOG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *AuditLogClient) List(opts *ListOpts) (*AuditLogCollection, error) { + resp := &AuditLogCollection{} + err := c.rancherClient.doList(AUDIT_LOG_TYPE, opts, resp) + return resp, err +} + +func (c *AuditLogClient) ById(id string) (*AuditLog, error) { + resp := &AuditLog{} + err := c.rancherClient.doById(AUDIT_LOG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *AuditLogClient) Delete(container *AuditLog) error { + return c.rancherClient.doResourceDelete(AUDIT_LOG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go new file mode 100644 index 000000000..8f9de8e22 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go @@ -0,0 +1,107 @@ +package client + +const ( + AZURE_CONFIG_TYPE = "azureConfig" +) + +type AzureConfig struct { + Resource + + AvailabilitySet string `json:"availabilitySet,omitempty" yaml:"availability_set,omitempty"` + + ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"` + + ClientSecret string `json:"clientSecret,omitempty" yaml:"client_secret,omitempty"` + + CustomData string `json:"customData,omitempty" yaml:"custom_data,omitempty"` + + DockerPort string `json:"dockerPort,omitempty" yaml:"docker_port,omitempty"` + + Environment string `json:"environment,omitempty" yaml:"environment,omitempty"` + + Image string `json:"image,omitempty" yaml:"image,omitempty"` + + Location string `json:"location,omitempty" yaml:"location,omitempty"` + + NoPublicIp bool `json:"noPublicIp,omitempty" yaml:"no_public_ip,omitempty"` + + OpenPort []string `json:"openPort,omitempty" yaml:"open_port,omitempty"` + + PrivateIpAddress string `json:"privateIpAddress,omitempty" yaml:"private_ip_address,omitempty"` + + ResourceGroup string `json:"resourceGroup,omitempty" yaml:"resource_group,omitempty"` + + Size string `json:"size,omitempty" yaml:"size,omitempty"` + + SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` + + StaticPublicIp bool `json:"staticPublicIp,omitempty" yaml:"static_public_ip,omitempty"` + + StorageType string `json:"storageType,omitempty" yaml:"storage_type,omitempty"` + + Subnet string `json:"subnet,omitempty" yaml:"subnet,omitempty"` + + SubnetPrefix string `json:"subnetPrefix,omitempty" yaml:"subnet_prefix,omitempty"` + + SubscriptionId string `json:"subscriptionId,omitempty" yaml:"subscription_id,omitempty"` + + UsePrivateIp bool `json:"usePrivateIp,omitempty" yaml:"use_private_ip,omitempty"` + + Vnet string `json:"vnet,omitempty" yaml:"vnet,omitempty"` +} + +type AzureConfigCollection struct { + Collection + Data []AzureConfig `json:"data,omitempty"` +} + +type AzureConfigClient struct { + rancherClient *RancherClient +} + +type AzureConfigOperations interface { + List(opts *ListOpts) (*AzureConfigCollection, error) + Create(opts *AzureConfig) (*AzureConfig, error) + Update(existing *AzureConfig, updates interface{}) (*AzureConfig, error) + ById(id string) (*AzureConfig, error) + Delete(container *AzureConfig) error +} + +func newAzureConfigClient(rancherClient *RancherClient) *AzureConfigClient { + return &AzureConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *AzureConfigClient) Create(container *AzureConfig) (*AzureConfig, error) { + resp := &AzureConfig{} + err := c.rancherClient.doCreate(AZURE_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *AzureConfigClient) Update(existing *AzureConfig, updates interface{}) (*AzureConfig, error) { + resp := &AzureConfig{} + err := c.rancherClient.doUpdate(AZURE_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *AzureConfigClient) List(opts *ListOpts) (*AzureConfigCollection, error) { + resp := &AzureConfigCollection{} + err := c.rancherClient.doList(AZURE_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *AzureConfigClient) ById(id string) (*AzureConfig, error) { + resp := &AzureConfig{} + err := c.rancherClient.doById(AZURE_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *AzureConfigClient) Delete(container *AzureConfig) error { + return c.rancherClient.doResourceDelete(AZURE_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go new file mode 100644 index 000000000..fe741e2e1 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go @@ -0,0 +1,81 @@ +package client + +const ( + AZUREADCONFIG_TYPE = "azureadconfig" +) + +type Azureadconfig struct { + Resource + + AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` + + AdminAccountPassword string `json:"adminAccountPassword,omitempty" yaml:"admin_account_password,omitempty"` + + AdminAccountUsername string `json:"adminAccountUsername,omitempty" yaml:"admin_account_username,omitempty"` + + ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"` + + Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` + + Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + TenantId string `json:"tenantId,omitempty" yaml:"tenant_id,omitempty"` +} + +type AzureadconfigCollection struct { + Collection + Data []Azureadconfig `json:"data,omitempty"` +} + +type AzureadconfigClient struct { + rancherClient *RancherClient +} + +type AzureadconfigOperations interface { + List(opts *ListOpts) (*AzureadconfigCollection, error) + Create(opts *Azureadconfig) (*Azureadconfig, error) + Update(existing *Azureadconfig, updates interface{}) (*Azureadconfig, error) + ById(id string) (*Azureadconfig, error) + Delete(container *Azureadconfig) error +} + +func newAzureadconfigClient(rancherClient *RancherClient) *AzureadconfigClient { + return &AzureadconfigClient{ + rancherClient: rancherClient, + } +} + +func (c *AzureadconfigClient) Create(container *Azureadconfig) (*Azureadconfig, error) { + resp := &Azureadconfig{} + err := c.rancherClient.doCreate(AZUREADCONFIG_TYPE, container, resp) + return resp, err +} + +func (c *AzureadconfigClient) Update(existing *Azureadconfig, updates interface{}) (*Azureadconfig, error) { + resp := &Azureadconfig{} + err := c.rancherClient.doUpdate(AZUREADCONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *AzureadconfigClient) List(opts *ListOpts) (*AzureadconfigCollection, error) { + resp := &AzureadconfigCollection{} + err := c.rancherClient.doList(AZUREADCONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *AzureadconfigClient) ById(id string) (*Azureadconfig, error) { + resp := &Azureadconfig{} + err := c.rancherClient.doById(AZUREADCONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *AzureadconfigClient) Delete(container *Azureadconfig) error { + return c.rancherClient.doResourceDelete(AZUREADCONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_backup.go b/vendor/github.com/rancher/go-rancher/v2/generated_backup.go new file mode 100644 index 000000000..237194ced --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_backup.go @@ -0,0 +1,121 @@ +package client + +const ( + BACKUP_TYPE = "backup" +) + +type Backup struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + BackupTargetId string `json:"backupTargetId,omitempty" yaml:"backup_target_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + SnapshotId string `json:"snapshotId,omitempty" yaml:"snapshot_id,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` +} + +type BackupCollection struct { + Collection + Data []Backup `json:"data,omitempty"` +} + +type BackupClient struct { + rancherClient *RancherClient +} + +type BackupOperations interface { + List(opts *ListOpts) (*BackupCollection, error) + Create(opts *Backup) (*Backup, error) + Update(existing *Backup, updates interface{}) (*Backup, error) + ById(id string) (*Backup, error) + Delete(container *Backup) error + + ActionCreate(*Backup) (*Backup, error) + + ActionRemove(*Backup) (*Backup, error) +} + +func newBackupClient(rancherClient *RancherClient) *BackupClient { + return &BackupClient{ + rancherClient: rancherClient, + } +} + +func (c *BackupClient) Create(container *Backup) (*Backup, error) { + resp := &Backup{} + err := c.rancherClient.doCreate(BACKUP_TYPE, container, resp) + return resp, err +} + +func (c *BackupClient) Update(existing *Backup, updates interface{}) (*Backup, error) { + resp := &Backup{} + err := c.rancherClient.doUpdate(BACKUP_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *BackupClient) List(opts *ListOpts) (*BackupCollection, error) { + resp := &BackupCollection{} + err := c.rancherClient.doList(BACKUP_TYPE, opts, resp) + return resp, err +} + +func (c *BackupClient) ById(id string) (*Backup, error) { + resp := &Backup{} + err := c.rancherClient.doById(BACKUP_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *BackupClient) Delete(container *Backup) error { + return c.rancherClient.doResourceDelete(BACKUP_TYPE, &container.Resource) +} + +func (c *BackupClient) ActionCreate(resource *Backup) (*Backup, error) { + + resp := &Backup{} + + err := c.rancherClient.doAction(BACKUP_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *BackupClient) ActionRemove(resource *Backup) (*Backup, error) { + + resp := &Backup{} + + err := c.rancherClient.doAction(BACKUP_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go b/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go new file mode 100644 index 000000000..c93d615c7 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go @@ -0,0 +1,115 @@ +package client + +const ( + BACKUP_TARGET_TYPE = "backupTarget" +) + +type BackupTarget struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + NfsConfig *NfsConfig `json:"nfsConfig,omitempty" yaml:"nfs_config,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type BackupTargetCollection struct { + Collection + Data []BackupTarget `json:"data,omitempty"` +} + +type BackupTargetClient struct { + rancherClient *RancherClient +} + +type BackupTargetOperations interface { + List(opts *ListOpts) (*BackupTargetCollection, error) + Create(opts *BackupTarget) (*BackupTarget, error) + Update(existing *BackupTarget, updates interface{}) (*BackupTarget, error) + ById(id string) (*BackupTarget, error) + Delete(container *BackupTarget) error + + ActionCreate(*BackupTarget) (*BackupTarget, error) + + ActionRemove(*BackupTarget) (*BackupTarget, error) +} + +func newBackupTargetClient(rancherClient *RancherClient) *BackupTargetClient { + return &BackupTargetClient{ + rancherClient: rancherClient, + } +} + +func (c *BackupTargetClient) Create(container *BackupTarget) (*BackupTarget, error) { + resp := &BackupTarget{} + err := c.rancherClient.doCreate(BACKUP_TARGET_TYPE, container, resp) + return resp, err +} + +func (c *BackupTargetClient) Update(existing *BackupTarget, updates interface{}) (*BackupTarget, error) { + resp := &BackupTarget{} + err := c.rancherClient.doUpdate(BACKUP_TARGET_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *BackupTargetClient) List(opts *ListOpts) (*BackupTargetCollection, error) { + resp := &BackupTargetCollection{} + err := c.rancherClient.doList(BACKUP_TARGET_TYPE, opts, resp) + return resp, err +} + +func (c *BackupTargetClient) ById(id string) (*BackupTarget, error) { + resp := &BackupTarget{} + err := c.rancherClient.doById(BACKUP_TARGET_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *BackupTargetClient) Delete(container *BackupTarget) error { + return c.rancherClient.doResourceDelete(BACKUP_TARGET_TYPE, &container.Resource) +} + +func (c *BackupTargetClient) ActionCreate(resource *BackupTarget) (*BackupTarget, error) { + + resp := &BackupTarget{} + + err := c.rancherClient.doAction(BACKUP_TARGET_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *BackupTargetClient) ActionRemove(resource *BackupTarget) (*BackupTarget, error) { + + resp := &BackupTarget{} + + err := c.rancherClient.doAction(BACKUP_TARGET_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go new file mode 100644 index 000000000..a01934241 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go @@ -0,0 +1,65 @@ +package client + +const ( + BASE_MACHINE_CONFIG_TYPE = "baseMachineConfig" +) + +type BaseMachineConfig struct { + Resource +} + +type BaseMachineConfigCollection struct { + Collection + Data []BaseMachineConfig `json:"data,omitempty"` +} + +type BaseMachineConfigClient struct { + rancherClient *RancherClient +} + +type BaseMachineConfigOperations interface { + List(opts *ListOpts) (*BaseMachineConfigCollection, error) + Create(opts *BaseMachineConfig) (*BaseMachineConfig, error) + Update(existing *BaseMachineConfig, updates interface{}) (*BaseMachineConfig, error) + ById(id string) (*BaseMachineConfig, error) + Delete(container *BaseMachineConfig) error +} + +func newBaseMachineConfigClient(rancherClient *RancherClient) *BaseMachineConfigClient { + return &BaseMachineConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *BaseMachineConfigClient) Create(container *BaseMachineConfig) (*BaseMachineConfig, error) { + resp := &BaseMachineConfig{} + err := c.rancherClient.doCreate(BASE_MACHINE_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *BaseMachineConfigClient) Update(existing *BaseMachineConfig, updates interface{}) (*BaseMachineConfig, error) { + resp := &BaseMachineConfig{} + err := c.rancherClient.doUpdate(BASE_MACHINE_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *BaseMachineConfigClient) List(opts *ListOpts) (*BaseMachineConfigCollection, error) { + resp := &BaseMachineConfigCollection{} + err := c.rancherClient.doList(BASE_MACHINE_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *BaseMachineConfigClient) ById(id string) (*BaseMachineConfig, error) { + resp := &BaseMachineConfig{} + err := c.rancherClient.doById(BASE_MACHINE_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *BaseMachineConfigClient) Delete(container *BaseMachineConfig) error { + return c.rancherClient.doResourceDelete(BASE_MACHINE_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_binding.go b/vendor/github.com/rancher/go-rancher/v2/generated_binding.go new file mode 100644 index 000000000..7766284fd --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_binding.go @@ -0,0 +1,67 @@ +package client + +const ( + BINDING_TYPE = "binding" +) + +type Binding struct { + Resource + + Services map[string]interface{} `json:"services,omitempty" yaml:"services,omitempty"` +} + +type BindingCollection struct { + Collection + Data []Binding `json:"data,omitempty"` +} + +type BindingClient struct { + rancherClient *RancherClient +} + +type BindingOperations interface { + List(opts *ListOpts) (*BindingCollection, error) + Create(opts *Binding) (*Binding, error) + Update(existing *Binding, updates interface{}) (*Binding, error) + ById(id string) (*Binding, error) + Delete(container *Binding) error +} + +func newBindingClient(rancherClient *RancherClient) *BindingClient { + return &BindingClient{ + rancherClient: rancherClient, + } +} + +func (c *BindingClient) Create(container *Binding) (*Binding, error) { + resp := &Binding{} + err := c.rancherClient.doCreate(BINDING_TYPE, container, resp) + return resp, err +} + +func (c *BindingClient) Update(existing *Binding, updates interface{}) (*Binding, error) { + resp := &Binding{} + err := c.rancherClient.doUpdate(BINDING_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *BindingClient) List(opts *ListOpts) (*BindingCollection, error) { + resp := &BindingCollection{} + err := c.rancherClient.doList(BINDING_TYPE, opts, resp) + return resp, err +} + +func (c *BindingClient) ById(id string) (*Binding, error) { + resp := &Binding{} + err := c.rancherClient.doById(BINDING_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *BindingClient) Delete(container *Binding) error { + return c.rancherClient.doResourceDelete(BINDING_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go b/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go new file mode 100644 index 000000000..4d0052255 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go @@ -0,0 +1,75 @@ +package client + +const ( + BLKIO_DEVICE_OPTION_TYPE = "blkioDeviceOption" +) + +type BlkioDeviceOption struct { + Resource + + ReadBps int64 `json:"readBps,omitempty" yaml:"read_bps,omitempty"` + + ReadIops int64 `json:"readIops,omitempty" yaml:"read_iops,omitempty"` + + Weight int64 `json:"weight,omitempty" yaml:"weight,omitempty"` + + WriteBps int64 `json:"writeBps,omitempty" yaml:"write_bps,omitempty"` + + WriteIops int64 `json:"writeIops,omitempty" yaml:"write_iops,omitempty"` +} + +type BlkioDeviceOptionCollection struct { + Collection + Data []BlkioDeviceOption `json:"data,omitempty"` +} + +type BlkioDeviceOptionClient struct { + rancherClient *RancherClient +} + +type BlkioDeviceOptionOperations interface { + List(opts *ListOpts) (*BlkioDeviceOptionCollection, error) + Create(opts *BlkioDeviceOption) (*BlkioDeviceOption, error) + Update(existing *BlkioDeviceOption, updates interface{}) (*BlkioDeviceOption, error) + ById(id string) (*BlkioDeviceOption, error) + Delete(container *BlkioDeviceOption) error +} + +func newBlkioDeviceOptionClient(rancherClient *RancherClient) *BlkioDeviceOptionClient { + return &BlkioDeviceOptionClient{ + rancherClient: rancherClient, + } +} + +func (c *BlkioDeviceOptionClient) Create(container *BlkioDeviceOption) (*BlkioDeviceOption, error) { + resp := &BlkioDeviceOption{} + err := c.rancherClient.doCreate(BLKIO_DEVICE_OPTION_TYPE, container, resp) + return resp, err +} + +func (c *BlkioDeviceOptionClient) Update(existing *BlkioDeviceOption, updates interface{}) (*BlkioDeviceOption, error) { + resp := &BlkioDeviceOption{} + err := c.rancherClient.doUpdate(BLKIO_DEVICE_OPTION_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *BlkioDeviceOptionClient) List(opts *ListOpts) (*BlkioDeviceOptionCollection, error) { + resp := &BlkioDeviceOptionCollection{} + err := c.rancherClient.doList(BLKIO_DEVICE_OPTION_TYPE, opts, resp) + return resp, err +} + +func (c *BlkioDeviceOptionClient) ById(id string) (*BlkioDeviceOption, error) { + resp := &BlkioDeviceOption{} + err := c.rancherClient.doById(BLKIO_DEVICE_OPTION_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *BlkioDeviceOptionClient) Delete(container *BlkioDeviceOption) error { + return c.rancherClient.doResourceDelete(BLKIO_DEVICE_OPTION_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go b/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go new file mode 100644 index 000000000..02f99e3ef --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go @@ -0,0 +1,150 @@ +package client + +const ( + CERTIFICATE_TYPE = "certificate" +) + +type Certificate struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Algorithm string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"` + + CN string `json:"cN,omitempty" yaml:"cn,omitempty"` + + Cert string `json:"cert,omitempty" yaml:"cert,omitempty"` + + CertChain string `json:"certChain,omitempty" yaml:"cert_chain,omitempty"` + + CertFingerprint string `json:"certFingerprint,omitempty" yaml:"cert_fingerprint,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExpiresAt string `json:"expiresAt,omitempty" yaml:"expires_at,omitempty"` + + IssuedAt string `json:"issuedAt,omitempty" yaml:"issued_at,omitempty"` + + Issuer string `json:"issuer,omitempty" yaml:"issuer,omitempty"` + + Key string `json:"key,omitempty" yaml:"key,omitempty"` + + KeySize int64 `json:"keySize,omitempty" yaml:"key_size,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + SerialNumber string `json:"serialNumber,omitempty" yaml:"serial_number,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty" yaml:"subject_alternative_names,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Version string `json:"version,omitempty" yaml:"version,omitempty"` +} + +type CertificateCollection struct { + Collection + Data []Certificate `json:"data,omitempty"` +} + +type CertificateClient struct { + rancherClient *RancherClient +} + +type CertificateOperations interface { + List(opts *ListOpts) (*CertificateCollection, error) + Create(opts *Certificate) (*Certificate, error) + Update(existing *Certificate, updates interface{}) (*Certificate, error) + ById(id string) (*Certificate, error) + Delete(container *Certificate) error + + ActionCreate(*Certificate) (*Certificate, error) + + ActionRemove(*Certificate) (*Certificate, error) + + ActionUpdate(*Certificate) (*Certificate, error) +} + +func newCertificateClient(rancherClient *RancherClient) *CertificateClient { + return &CertificateClient{ + rancherClient: rancherClient, + } +} + +func (c *CertificateClient) Create(container *Certificate) (*Certificate, error) { + resp := &Certificate{} + err := c.rancherClient.doCreate(CERTIFICATE_TYPE, container, resp) + return resp, err +} + +func (c *CertificateClient) Update(existing *Certificate, updates interface{}) (*Certificate, error) { + resp := &Certificate{} + err := c.rancherClient.doUpdate(CERTIFICATE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *CertificateClient) List(opts *ListOpts) (*CertificateCollection, error) { + resp := &CertificateCollection{} + err := c.rancherClient.doList(CERTIFICATE_TYPE, opts, resp) + return resp, err +} + +func (c *CertificateClient) ById(id string) (*Certificate, error) { + resp := &Certificate{} + err := c.rancherClient.doById(CERTIFICATE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *CertificateClient) Delete(container *Certificate) error { + return c.rancherClient.doResourceDelete(CERTIFICATE_TYPE, &container.Resource) +} + +func (c *CertificateClient) ActionCreate(resource *Certificate) (*Certificate, error) { + + resp := &Certificate{} + + err := c.rancherClient.doAction(CERTIFICATE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *CertificateClient) ActionRemove(resource *Certificate) (*Certificate, error) { + + resp := &Certificate{} + + err := c.rancherClient.doAction(CERTIFICATE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *CertificateClient) ActionUpdate(resource *Certificate) (*Certificate, error) { + + resp := &Certificate{} + + err := c.rancherClient.doAction(CERTIFICATE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go new file mode 100644 index 000000000..913c2eeaa --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go @@ -0,0 +1,69 @@ +package client + +const ( + CHANGE_SECRET_INPUT_TYPE = "changeSecretInput" +) + +type ChangeSecretInput struct { + Resource + + NewSecret string `json:"newSecret,omitempty" yaml:"new_secret,omitempty"` + + OldSecret string `json:"oldSecret,omitempty" yaml:"old_secret,omitempty"` +} + +type ChangeSecretInputCollection struct { + Collection + Data []ChangeSecretInput `json:"data,omitempty"` +} + +type ChangeSecretInputClient struct { + rancherClient *RancherClient +} + +type ChangeSecretInputOperations interface { + List(opts *ListOpts) (*ChangeSecretInputCollection, error) + Create(opts *ChangeSecretInput) (*ChangeSecretInput, error) + Update(existing *ChangeSecretInput, updates interface{}) (*ChangeSecretInput, error) + ById(id string) (*ChangeSecretInput, error) + Delete(container *ChangeSecretInput) error +} + +func newChangeSecretInputClient(rancherClient *RancherClient) *ChangeSecretInputClient { + return &ChangeSecretInputClient{ + rancherClient: rancherClient, + } +} + +func (c *ChangeSecretInputClient) Create(container *ChangeSecretInput) (*ChangeSecretInput, error) { + resp := &ChangeSecretInput{} + err := c.rancherClient.doCreate(CHANGE_SECRET_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *ChangeSecretInputClient) Update(existing *ChangeSecretInput, updates interface{}) (*ChangeSecretInput, error) { + resp := &ChangeSecretInput{} + err := c.rancherClient.doUpdate(CHANGE_SECRET_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ChangeSecretInputClient) List(opts *ListOpts) (*ChangeSecretInputCollection, error) { + resp := &ChangeSecretInputCollection{} + err := c.rancherClient.doList(CHANGE_SECRET_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *ChangeSecretInputClient) ById(id string) (*ChangeSecretInput, error) { + resp := &ChangeSecretInput{} + err := c.rancherClient.doById(CHANGE_SECRET_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ChangeSecretInputClient) Delete(container *ChangeSecretInput) error { + return c.rancherClient.doResourceDelete(CHANGE_SECRET_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_client.go b/vendor/github.com/rancher/go-rancher/v2/generated_client.go new file mode 100644 index 000000000..0b7a39610 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_client.go @@ -0,0 +1,318 @@ +package client + +type RancherClient struct { + RancherBaseClient + + Account AccountOperations + ActiveSetting ActiveSettingOperations + AddOutputsInput AddOutputsInputOperations + AddRemoveLoadBalancerServiceLinkInput AddRemoveLoadBalancerServiceLinkInputOperations + AddRemoveServiceLinkInput AddRemoveServiceLinkInputOperations + Agent AgentOperations + Amazonec2Config Amazonec2ConfigOperations + ApiKey ApiKeyOperations + AuditLog AuditLogOperations + AzureConfig AzureConfigOperations + Azureadconfig AzureadconfigOperations + Backup BackupOperations + BackupTarget BackupTargetOperations + BaseMachineConfig BaseMachineConfigOperations + Binding BindingOperations + BlkioDeviceOption BlkioDeviceOptionOperations + Certificate CertificateOperations + ChangeSecretInput ChangeSecretInputOperations + ComposeConfig ComposeConfigOperations + ComposeConfigInput ComposeConfigInputOperations + ComposeProject ComposeProjectOperations + ComposeService ComposeServiceOperations + ConfigItem ConfigItemOperations + ConfigItemStatus ConfigItemStatusOperations + Container ContainerOperations + ContainerEvent ContainerEventOperations + ContainerExec ContainerExecOperations + ContainerLogs ContainerLogsOperations + ContainerProxy ContainerProxyOperations + Credential CredentialOperations + Databasechangelog DatabasechangelogOperations + Databasechangeloglock DatabasechangeloglockOperations + DigitaloceanConfig DigitaloceanConfigOperations + DnsService DnsServiceOperations + DockerBuild DockerBuildOperations + DynamicSchema DynamicSchemaOperations + ExtensionImplementation ExtensionImplementationOperations + ExtensionPoint ExtensionPointOperations + ExternalDnsEvent ExternalDnsEventOperations + ExternalEvent ExternalEventOperations + ExternalHandler ExternalHandlerOperations + ExternalHandlerExternalHandlerProcessMap ExternalHandlerExternalHandlerProcessMapOperations + ExternalHandlerProcess ExternalHandlerProcessOperations + ExternalHandlerProcessConfig ExternalHandlerProcessConfigOperations + ExternalHostEvent ExternalHostEventOperations + ExternalService ExternalServiceOperations + ExternalServiceEvent ExternalServiceEventOperations + ExternalStoragePoolEvent ExternalStoragePoolEventOperations + ExternalVolumeEvent ExternalVolumeEventOperations + FieldDocumentation FieldDocumentationOperations + Githubconfig GithubconfigOperations + HaConfig HaConfigOperations + HaConfigInput HaConfigInputOperations + HaproxyConfig HaproxyConfigOperations + HealthcheckInstanceHostMap HealthcheckInstanceHostMapOperations + Host HostOperations + HostAccess HostAccessOperations + HostApiProxyToken HostApiProxyTokenOperations + Identity IdentityOperations + Image ImageOperations + InServiceUpgradeStrategy InServiceUpgradeStrategyOperations + Instance InstanceOperations + InstanceConsole InstanceConsoleOperations + InstanceConsoleInput InstanceConsoleInputOperations + InstanceHealthCheck InstanceHealthCheckOperations + InstanceLink InstanceLinkOperations + InstanceStop InstanceStopOperations + IpAddress IpAddressOperations + IpAddressAssociateInput IpAddressAssociateInputOperations + KubernetesService KubernetesServiceOperations + KubernetesStack KubernetesStackOperations + KubernetesStackUpgrade KubernetesStackUpgradeOperations + Label LabelOperations + LaunchConfig LaunchConfigOperations + Ldapconfig LdapconfigOperations + LoadBalancerAppCookieStickinessPolicy LoadBalancerAppCookieStickinessPolicyOperations + LoadBalancerConfig LoadBalancerConfigOperations + LoadBalancerCookieStickinessPolicy LoadBalancerCookieStickinessPolicyOperations + LoadBalancerService LoadBalancerServiceOperations + LoadBalancerServiceLink LoadBalancerServiceLinkOperations + LocalAuthConfig LocalAuthConfigOperations + LogConfig LogConfigOperations + Machine MachineOperations + MachineDriver MachineDriverOperations + Mount MountOperations + Network NetworkOperations + NfsConfig NfsConfigOperations + Openldapconfig OpenldapconfigOperations + PacketConfig PacketConfigOperations + Password PasswordOperations + PhysicalHost PhysicalHostOperations + Port PortOperations + ProcessDefinition ProcessDefinitionOperations + ProcessExecution ProcessExecutionOperations + ProcessInstance ProcessInstanceOperations + Project ProjectOperations + ProjectMember ProjectMemberOperations + PublicEndpoint PublicEndpointOperations + Publish PublishOperations + PullTask PullTaskOperations + RecreateOnQuorumStrategyConfig RecreateOnQuorumStrategyConfigOperations + Register RegisterOperations + RegistrationToken RegistrationTokenOperations + Registry RegistryOperations + RegistryCredential RegistryCredentialOperations + ResourceDefinition ResourceDefinitionOperations + RestartPolicy RestartPolicyOperations + RestoreFromBackupInput RestoreFromBackupInputOperations + RevertToSnapshotInput RevertToSnapshotInputOperations + RollingRestartStrategy RollingRestartStrategyOperations + ScalePolicy ScalePolicyOperations + SecondaryLaunchConfig SecondaryLaunchConfigOperations + Service ServiceOperations + ServiceBinding ServiceBindingOperations + ServiceConsumeMap ServiceConsumeMapOperations + ServiceEvent ServiceEventOperations + ServiceExposeMap ServiceExposeMapOperations + ServiceLink ServiceLinkOperations + ServiceLog ServiceLogOperations + ServiceProxy ServiceProxyOperations + ServiceRestart ServiceRestartOperations + ServiceUpgrade ServiceUpgradeOperations + ServiceUpgradeStrategy ServiceUpgradeStrategyOperations + ServicesPortRange ServicesPortRangeOperations + SetLabelsInput SetLabelsInputOperations + SetLoadBalancerServiceLinksInput SetLoadBalancerServiceLinksInputOperations + SetProjectMembersInput SetProjectMembersInputOperations + SetServiceLinksInput SetServiceLinksInputOperations + Setting SettingOperations + Snapshot SnapshotOperations + SnapshotBackupInput SnapshotBackupInputOperations + Stack StackOperations + StackUpgrade StackUpgradeOperations + StateTransition StateTransitionOperations + StatsAccess StatsAccessOperations + StoragePool StoragePoolOperations + Subscribe SubscribeOperations + Task TaskOperations + TaskInstance TaskInstanceOperations + ToServiceUpgradeStrategy ToServiceUpgradeStrategyOperations + TypeDocumentation TypeDocumentationOperations + VirtualMachine VirtualMachineOperations + VirtualMachineDisk VirtualMachineDiskOperations + Volume VolumeOperations + VolumeSnapshotInput VolumeSnapshotInputOperations +} + +func constructClient() *RancherClient { + client := &RancherClient{ + RancherBaseClient: RancherBaseClient{ + Types: map[string]Schema{}, + }, + } + + client.Account = newAccountClient(client) + client.ActiveSetting = newActiveSettingClient(client) + client.AddOutputsInput = newAddOutputsInputClient(client) + client.AddRemoveLoadBalancerServiceLinkInput = newAddRemoveLoadBalancerServiceLinkInputClient(client) + client.AddRemoveServiceLinkInput = newAddRemoveServiceLinkInputClient(client) + client.Agent = newAgentClient(client) + client.Amazonec2Config = newAmazonec2ConfigClient(client) + client.ApiKey = newApiKeyClient(client) + client.AuditLog = newAuditLogClient(client) + client.AzureConfig = newAzureConfigClient(client) + client.Azureadconfig = newAzureadconfigClient(client) + client.Backup = newBackupClient(client) + client.BackupTarget = newBackupTargetClient(client) + client.BaseMachineConfig = newBaseMachineConfigClient(client) + client.Binding = newBindingClient(client) + client.BlkioDeviceOption = newBlkioDeviceOptionClient(client) + client.Certificate = newCertificateClient(client) + client.ChangeSecretInput = newChangeSecretInputClient(client) + client.ComposeConfig = newComposeConfigClient(client) + client.ComposeConfigInput = newComposeConfigInputClient(client) + client.ComposeProject = newComposeProjectClient(client) + client.ComposeService = newComposeServiceClient(client) + client.ConfigItem = newConfigItemClient(client) + client.ConfigItemStatus = newConfigItemStatusClient(client) + client.Container = newContainerClient(client) + client.ContainerEvent = newContainerEventClient(client) + client.ContainerExec = newContainerExecClient(client) + client.ContainerLogs = newContainerLogsClient(client) + client.ContainerProxy = newContainerProxyClient(client) + client.Credential = newCredentialClient(client) + client.Databasechangelog = newDatabasechangelogClient(client) + client.Databasechangeloglock = newDatabasechangeloglockClient(client) + client.DigitaloceanConfig = newDigitaloceanConfigClient(client) + client.DnsService = newDnsServiceClient(client) + client.DockerBuild = newDockerBuildClient(client) + client.DynamicSchema = newDynamicSchemaClient(client) + client.ExtensionImplementation = newExtensionImplementationClient(client) + client.ExtensionPoint = newExtensionPointClient(client) + client.ExternalDnsEvent = newExternalDnsEventClient(client) + client.ExternalEvent = newExternalEventClient(client) + client.ExternalHandler = newExternalHandlerClient(client) + client.ExternalHandlerExternalHandlerProcessMap = newExternalHandlerExternalHandlerProcessMapClient(client) + client.ExternalHandlerProcess = newExternalHandlerProcessClient(client) + client.ExternalHandlerProcessConfig = newExternalHandlerProcessConfigClient(client) + client.ExternalHostEvent = newExternalHostEventClient(client) + client.ExternalService = newExternalServiceClient(client) + client.ExternalServiceEvent = newExternalServiceEventClient(client) + client.ExternalStoragePoolEvent = newExternalStoragePoolEventClient(client) + client.ExternalVolumeEvent = newExternalVolumeEventClient(client) + client.FieldDocumentation = newFieldDocumentationClient(client) + client.Githubconfig = newGithubconfigClient(client) + client.HaConfig = newHaConfigClient(client) + client.HaConfigInput = newHaConfigInputClient(client) + client.HaproxyConfig = newHaproxyConfigClient(client) + client.HealthcheckInstanceHostMap = newHealthcheckInstanceHostMapClient(client) + client.Host = newHostClient(client) + client.HostAccess = newHostAccessClient(client) + client.HostApiProxyToken = newHostApiProxyTokenClient(client) + client.Identity = newIdentityClient(client) + client.Image = newImageClient(client) + client.InServiceUpgradeStrategy = newInServiceUpgradeStrategyClient(client) + client.Instance = newInstanceClient(client) + client.InstanceConsole = newInstanceConsoleClient(client) + client.InstanceConsoleInput = newInstanceConsoleInputClient(client) + client.InstanceHealthCheck = newInstanceHealthCheckClient(client) + client.InstanceLink = newInstanceLinkClient(client) + client.InstanceStop = newInstanceStopClient(client) + client.IpAddress = newIpAddressClient(client) + client.IpAddressAssociateInput = newIpAddressAssociateInputClient(client) + client.KubernetesService = newKubernetesServiceClient(client) + client.KubernetesStack = newKubernetesStackClient(client) + client.KubernetesStackUpgrade = newKubernetesStackUpgradeClient(client) + client.Label = newLabelClient(client) + client.LaunchConfig = newLaunchConfigClient(client) + client.Ldapconfig = newLdapconfigClient(client) + client.LoadBalancerAppCookieStickinessPolicy = newLoadBalancerAppCookieStickinessPolicyClient(client) + client.LoadBalancerConfig = newLoadBalancerConfigClient(client) + client.LoadBalancerCookieStickinessPolicy = newLoadBalancerCookieStickinessPolicyClient(client) + client.LoadBalancerService = newLoadBalancerServiceClient(client) + client.LoadBalancerServiceLink = newLoadBalancerServiceLinkClient(client) + client.LocalAuthConfig = newLocalAuthConfigClient(client) + client.LogConfig = newLogConfigClient(client) + client.Machine = newMachineClient(client) + client.MachineDriver = newMachineDriverClient(client) + client.Mount = newMountClient(client) + client.Network = newNetworkClient(client) + client.NfsConfig = newNfsConfigClient(client) + client.Openldapconfig = newOpenldapconfigClient(client) + client.PacketConfig = newPacketConfigClient(client) + client.Password = newPasswordClient(client) + client.PhysicalHost = newPhysicalHostClient(client) + client.Port = newPortClient(client) + client.ProcessDefinition = newProcessDefinitionClient(client) + client.ProcessExecution = newProcessExecutionClient(client) + client.ProcessInstance = newProcessInstanceClient(client) + client.Project = newProjectClient(client) + client.ProjectMember = newProjectMemberClient(client) + client.PublicEndpoint = newPublicEndpointClient(client) + client.Publish = newPublishClient(client) + client.PullTask = newPullTaskClient(client) + client.RecreateOnQuorumStrategyConfig = newRecreateOnQuorumStrategyConfigClient(client) + client.Register = newRegisterClient(client) + client.RegistrationToken = newRegistrationTokenClient(client) + client.Registry = newRegistryClient(client) + client.RegistryCredential = newRegistryCredentialClient(client) + client.ResourceDefinition = newResourceDefinitionClient(client) + client.RestartPolicy = newRestartPolicyClient(client) + client.RestoreFromBackupInput = newRestoreFromBackupInputClient(client) + client.RevertToSnapshotInput = newRevertToSnapshotInputClient(client) + client.RollingRestartStrategy = newRollingRestartStrategyClient(client) + client.ScalePolicy = newScalePolicyClient(client) + client.SecondaryLaunchConfig = newSecondaryLaunchConfigClient(client) + client.Service = newServiceClient(client) + client.ServiceBinding = newServiceBindingClient(client) + client.ServiceConsumeMap = newServiceConsumeMapClient(client) + client.ServiceEvent = newServiceEventClient(client) + client.ServiceExposeMap = newServiceExposeMapClient(client) + client.ServiceLink = newServiceLinkClient(client) + client.ServiceLog = newServiceLogClient(client) + client.ServiceProxy = newServiceProxyClient(client) + client.ServiceRestart = newServiceRestartClient(client) + client.ServiceUpgrade = newServiceUpgradeClient(client) + client.ServiceUpgradeStrategy = newServiceUpgradeStrategyClient(client) + client.ServicesPortRange = newServicesPortRangeClient(client) + client.SetLabelsInput = newSetLabelsInputClient(client) + client.SetLoadBalancerServiceLinksInput = newSetLoadBalancerServiceLinksInputClient(client) + client.SetProjectMembersInput = newSetProjectMembersInputClient(client) + client.SetServiceLinksInput = newSetServiceLinksInputClient(client) + client.Setting = newSettingClient(client) + client.Snapshot = newSnapshotClient(client) + client.SnapshotBackupInput = newSnapshotBackupInputClient(client) + client.Stack = newStackClient(client) + client.StackUpgrade = newStackUpgradeClient(client) + client.StateTransition = newStateTransitionClient(client) + client.StatsAccess = newStatsAccessClient(client) + client.StoragePool = newStoragePoolClient(client) + client.Subscribe = newSubscribeClient(client) + client.Task = newTaskClient(client) + client.TaskInstance = newTaskInstanceClient(client) + client.ToServiceUpgradeStrategy = newToServiceUpgradeStrategyClient(client) + client.TypeDocumentation = newTypeDocumentationClient(client) + client.VirtualMachine = newVirtualMachineClient(client) + client.VirtualMachineDisk = newVirtualMachineDiskClient(client) + client.Volume = newVolumeClient(client) + client.VolumeSnapshotInput = newVolumeSnapshotInputClient(client) + + return client +} + +func NewRancherClient(opts *ClientOpts) (*RancherClient, error) { + client := constructClient() + + err := setupRancherBaseClient(&client.RancherBaseClient, opts) + if err != nil { + return nil, err + } + + return client, nil +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go new file mode 100644 index 000000000..49ee5ba1d --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go @@ -0,0 +1,69 @@ +package client + +const ( + COMPOSE_CONFIG_TYPE = "composeConfig" +) + +type ComposeConfig struct { + Resource + + DockerComposeConfig string `json:"dockerComposeConfig,omitempty" yaml:"docker_compose_config,omitempty"` + + RancherComposeConfig string `json:"rancherComposeConfig,omitempty" yaml:"rancher_compose_config,omitempty"` +} + +type ComposeConfigCollection struct { + Collection + Data []ComposeConfig `json:"data,omitempty"` +} + +type ComposeConfigClient struct { + rancherClient *RancherClient +} + +type ComposeConfigOperations interface { + List(opts *ListOpts) (*ComposeConfigCollection, error) + Create(opts *ComposeConfig) (*ComposeConfig, error) + Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error) + ById(id string) (*ComposeConfig, error) + Delete(container *ComposeConfig) error +} + +func newComposeConfigClient(rancherClient *RancherClient) *ComposeConfigClient { + return &ComposeConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *ComposeConfigClient) Create(container *ComposeConfig) (*ComposeConfig, error) { + resp := &ComposeConfig{} + err := c.rancherClient.doCreate(COMPOSE_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *ComposeConfigClient) Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error) { + resp := &ComposeConfig{} + err := c.rancherClient.doUpdate(COMPOSE_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ComposeConfigClient) List(opts *ListOpts) (*ComposeConfigCollection, error) { + resp := &ComposeConfigCollection{} + err := c.rancherClient.doList(COMPOSE_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *ComposeConfigClient) ById(id string) (*ComposeConfig, error) { + resp := &ComposeConfig{} + err := c.rancherClient.doById(COMPOSE_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ComposeConfigClient) Delete(container *ComposeConfig) error { + return c.rancherClient.doResourceDelete(COMPOSE_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go new file mode 100644 index 000000000..e0cdc76f9 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go @@ -0,0 +1,67 @@ +package client + +const ( + COMPOSE_CONFIG_INPUT_TYPE = "composeConfigInput" +) + +type ComposeConfigInput struct { + Resource + + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` +} + +type ComposeConfigInputCollection struct { + Collection + Data []ComposeConfigInput `json:"data,omitempty"` +} + +type ComposeConfigInputClient struct { + rancherClient *RancherClient +} + +type ComposeConfigInputOperations interface { + List(opts *ListOpts) (*ComposeConfigInputCollection, error) + Create(opts *ComposeConfigInput) (*ComposeConfigInput, error) + Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error) + ById(id string) (*ComposeConfigInput, error) + Delete(container *ComposeConfigInput) error +} + +func newComposeConfigInputClient(rancherClient *RancherClient) *ComposeConfigInputClient { + return &ComposeConfigInputClient{ + rancherClient: rancherClient, + } +} + +func (c *ComposeConfigInputClient) Create(container *ComposeConfigInput) (*ComposeConfigInput, error) { + resp := &ComposeConfigInput{} + err := c.rancherClient.doCreate(COMPOSE_CONFIG_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *ComposeConfigInputClient) Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error) { + resp := &ComposeConfigInput{} + err := c.rancherClient.doUpdate(COMPOSE_CONFIG_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ComposeConfigInputClient) List(opts *ListOpts) (*ComposeConfigInputCollection, error) { + resp := &ComposeConfigInputCollection{} + err := c.rancherClient.doList(COMPOSE_CONFIG_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *ComposeConfigInputClient) ById(id string) (*ComposeConfigInput, error) { + resp := &ComposeConfigInput{} + err := c.rancherClient.doById(COMPOSE_CONFIG_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ComposeConfigInputClient) Delete(container *ComposeConfigInput) error { + return c.rancherClient.doResourceDelete(COMPOSE_CONFIG_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go new file mode 100644 index 000000000..20232bf8f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go @@ -0,0 +1,171 @@ +package client + +const ( + COMPOSE_PROJECT_TYPE = "composeProject" +) + +type ComposeProject struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PreviousEnvironment map[string]interface{} `json:"previousEnvironment,omitempty" yaml:"previous_environment,omitempty"` + + PreviousExternalId string `json:"previousExternalId,omitempty" yaml:"previous_external_id,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ComposeProjectCollection struct { + Collection + Data []ComposeProject `json:"data,omitempty"` +} + +type ComposeProjectClient struct { + rancherClient *RancherClient +} + +type ComposeProjectOperations interface { + List(opts *ListOpts) (*ComposeProjectCollection, error) + Create(opts *ComposeProject) (*ComposeProject, error) + Update(existing *ComposeProject, updates interface{}) (*ComposeProject, error) + ById(id string) (*ComposeProject, error) + Delete(container *ComposeProject) error + + ActionCancelupgrade(*ComposeProject) (*Stack, error) + + ActionCreate(*ComposeProject) (*Stack, error) + + ActionError(*ComposeProject) (*Stack, error) + + ActionFinishupgrade(*ComposeProject) (*Stack, error) + + ActionRemove(*ComposeProject) (*Stack, error) + + ActionRollback(*ComposeProject) (*Stack, error) +} + +func newComposeProjectClient(rancherClient *RancherClient) *ComposeProjectClient { + return &ComposeProjectClient{ + rancherClient: rancherClient, + } +} + +func (c *ComposeProjectClient) Create(container *ComposeProject) (*ComposeProject, error) { + resp := &ComposeProject{} + err := c.rancherClient.doCreate(COMPOSE_PROJECT_TYPE, container, resp) + return resp, err +} + +func (c *ComposeProjectClient) Update(existing *ComposeProject, updates interface{}) (*ComposeProject, error) { + resp := &ComposeProject{} + err := c.rancherClient.doUpdate(COMPOSE_PROJECT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ComposeProjectClient) List(opts *ListOpts) (*ComposeProjectCollection, error) { + resp := &ComposeProjectCollection{} + err := c.rancherClient.doList(COMPOSE_PROJECT_TYPE, opts, resp) + return resp, err +} + +func (c *ComposeProjectClient) ById(id string) (*ComposeProject, error) { + resp := &ComposeProject{} + err := c.rancherClient.doById(COMPOSE_PROJECT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ComposeProjectClient) Delete(container *ComposeProject) error { + return c.rancherClient.doResourceDelete(COMPOSE_PROJECT_TYPE, &container.Resource) +} + +func (c *ComposeProjectClient) ActionCancelupgrade(resource *ComposeProject) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ComposeProjectClient) ActionCreate(resource *ComposeProject) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ComposeProjectClient) ActionError(resource *ComposeProject) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ComposeProjectClient) ActionFinishupgrade(resource *ComposeProject) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ComposeProjectClient) ActionRemove(resource *ComposeProject) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ComposeProjectClient) ActionRollback(resource *ComposeProject) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go new file mode 100644 index 000000000..5965a8c2f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go @@ -0,0 +1,194 @@ +package client + +const ( + COMPOSE_SERVICE_TYPE = "composeService" +) + +type ComposeService struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PublicEndpoints []interface{} `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` + + ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` + + SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` + + SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` +} + +type ComposeServiceCollection struct { + Collection + Data []ComposeService `json:"data,omitempty"` +} + +type ComposeServiceClient struct { + rancherClient *RancherClient +} + +type ComposeServiceOperations interface { + List(opts *ListOpts) (*ComposeServiceCollection, error) + Create(opts *ComposeService) (*ComposeService, error) + Update(existing *ComposeService, updates interface{}) (*ComposeService, error) + ById(id string) (*ComposeService, error) + Delete(container *ComposeService) error + + ActionActivate(*ComposeService) (*Service, error) + + ActionCancelupgrade(*ComposeService) (*Service, error) + + ActionContinueupgrade(*ComposeService) (*Service, error) + + ActionCreate(*ComposeService) (*Service, error) + + ActionFinishupgrade(*ComposeService) (*Service, error) + + ActionRemove(*ComposeService) (*Service, error) + + ActionRollback(*ComposeService) (*Service, error) +} + +func newComposeServiceClient(rancherClient *RancherClient) *ComposeServiceClient { + return &ComposeServiceClient{ + rancherClient: rancherClient, + } +} + +func (c *ComposeServiceClient) Create(container *ComposeService) (*ComposeService, error) { + resp := &ComposeService{} + err := c.rancherClient.doCreate(COMPOSE_SERVICE_TYPE, container, resp) + return resp, err +} + +func (c *ComposeServiceClient) Update(existing *ComposeService, updates interface{}) (*ComposeService, error) { + resp := &ComposeService{} + err := c.rancherClient.doUpdate(COMPOSE_SERVICE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ComposeServiceClient) List(opts *ListOpts) (*ComposeServiceCollection, error) { + resp := &ComposeServiceCollection{} + err := c.rancherClient.doList(COMPOSE_SERVICE_TYPE, opts, resp) + return resp, err +} + +func (c *ComposeServiceClient) ById(id string) (*ComposeService, error) { + resp := &ComposeService{} + err := c.rancherClient.doById(COMPOSE_SERVICE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ComposeServiceClient) Delete(container *ComposeService) error { + return c.rancherClient.doResourceDelete(COMPOSE_SERVICE_TYPE, &container.Resource) +} + +func (c *ComposeServiceClient) ActionActivate(resource *ComposeService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ComposeServiceClient) ActionCancelupgrade(resource *ComposeService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ComposeServiceClient) ActionContinueupgrade(resource *ComposeService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ComposeServiceClient) ActionCreate(resource *ComposeService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ComposeServiceClient) ActionFinishupgrade(resource *ComposeService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ComposeServiceClient) ActionRemove(resource *ComposeService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ComposeServiceClient) ActionRollback(resource *ComposeService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go b/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go new file mode 100644 index 000000000..71e687d22 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go @@ -0,0 +1,69 @@ +package client + +const ( + CONFIG_ITEM_TYPE = "configItem" +) + +type ConfigItem struct { + Resource + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + SourceVersion string `json:"sourceVersion,omitempty" yaml:"source_version,omitempty"` +} + +type ConfigItemCollection struct { + Collection + Data []ConfigItem `json:"data,omitempty"` +} + +type ConfigItemClient struct { + rancherClient *RancherClient +} + +type ConfigItemOperations interface { + List(opts *ListOpts) (*ConfigItemCollection, error) + Create(opts *ConfigItem) (*ConfigItem, error) + Update(existing *ConfigItem, updates interface{}) (*ConfigItem, error) + ById(id string) (*ConfigItem, error) + Delete(container *ConfigItem) error +} + +func newConfigItemClient(rancherClient *RancherClient) *ConfigItemClient { + return &ConfigItemClient{ + rancherClient: rancherClient, + } +} + +func (c *ConfigItemClient) Create(container *ConfigItem) (*ConfigItem, error) { + resp := &ConfigItem{} + err := c.rancherClient.doCreate(CONFIG_ITEM_TYPE, container, resp) + return resp, err +} + +func (c *ConfigItemClient) Update(existing *ConfigItem, updates interface{}) (*ConfigItem, error) { + resp := &ConfigItem{} + err := c.rancherClient.doUpdate(CONFIG_ITEM_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ConfigItemClient) List(opts *ListOpts) (*ConfigItemCollection, error) { + resp := &ConfigItemCollection{} + err := c.rancherClient.doList(CONFIG_ITEM_TYPE, opts, resp) + return resp, err +} + +func (c *ConfigItemClient) ById(id string) (*ConfigItem, error) { + resp := &ConfigItem{} + err := c.rancherClient.doById(CONFIG_ITEM_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ConfigItemClient) Delete(container *ConfigItem) error { + return c.rancherClient.doResourceDelete(CONFIG_ITEM_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go b/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go new file mode 100644 index 000000000..0ffef351f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go @@ -0,0 +1,81 @@ +package client + +const ( + CONFIG_ITEM_STATUS_TYPE = "configItemStatus" +) + +type ConfigItemStatus struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` + + AppliedUpdated string `json:"appliedUpdated,omitempty" yaml:"applied_updated,omitempty"` + + AppliedVersion int64 `json:"appliedVersion,omitempty" yaml:"applied_version,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RequestedUpdated string `json:"requestedUpdated,omitempty" yaml:"requested_updated,omitempty"` + + RequestedVersion int64 `json:"requestedVersion,omitempty" yaml:"requested_version,omitempty"` + + SourceVersion string `json:"sourceVersion,omitempty" yaml:"source_version,omitempty"` +} + +type ConfigItemStatusCollection struct { + Collection + Data []ConfigItemStatus `json:"data,omitempty"` +} + +type ConfigItemStatusClient struct { + rancherClient *RancherClient +} + +type ConfigItemStatusOperations interface { + List(opts *ListOpts) (*ConfigItemStatusCollection, error) + Create(opts *ConfigItemStatus) (*ConfigItemStatus, error) + Update(existing *ConfigItemStatus, updates interface{}) (*ConfigItemStatus, error) + ById(id string) (*ConfigItemStatus, error) + Delete(container *ConfigItemStatus) error +} + +func newConfigItemStatusClient(rancherClient *RancherClient) *ConfigItemStatusClient { + return &ConfigItemStatusClient{ + rancherClient: rancherClient, + } +} + +func (c *ConfigItemStatusClient) Create(container *ConfigItemStatus) (*ConfigItemStatus, error) { + resp := &ConfigItemStatus{} + err := c.rancherClient.doCreate(CONFIG_ITEM_STATUS_TYPE, container, resp) + return resp, err +} + +func (c *ConfigItemStatusClient) Update(existing *ConfigItemStatus, updates interface{}) (*ConfigItemStatus, error) { + resp := &ConfigItemStatus{} + err := c.rancherClient.doUpdate(CONFIG_ITEM_STATUS_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ConfigItemStatusClient) List(opts *ListOpts) (*ConfigItemStatusCollection, error) { + resp := &ConfigItemStatusCollection{} + err := c.rancherClient.doList(CONFIG_ITEM_STATUS_TYPE, opts, resp) + return resp, err +} + +func (c *ConfigItemStatusClient) ById(id string) (*ConfigItemStatus, error) { + resp := &ConfigItemStatus{} + err := c.rancherClient.doById(CONFIG_ITEM_STATUS_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ConfigItemStatusClient) Delete(container *ConfigItemStatus) error { + return c.rancherClient.doResourceDelete(CONFIG_ITEM_STATUS_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container.go b/vendor/github.com/rancher/go-rancher/v2/generated_container.go new file mode 100644 index 000000000..a41dcf362 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_container.go @@ -0,0 +1,431 @@ +package client + +const ( + CONTAINER_TYPE = "container" +) + +type Container struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` + + AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` + + BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + + Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` + + CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` + + CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` + + Command []string `json:"command,omitempty" yaml:"command,omitempty"` + + Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` + + CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + DataVolumeMounts map[string]interface{} `json:"dataVolumeMounts,omitempty" yaml:"data_volume_mounts,omitempty"` + + DataVolumes []string `json:"dataVolumes,omitempty" yaml:"data_volumes,omitempty"` + + DataVolumesFrom []string `json:"dataVolumesFrom,omitempty" yaml:"data_volumes_from,omitempty"` + + DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` + + Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` + + DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` + + EntryPoint []string `json:"entryPoint,omitempty" yaml:"entry_point,omitempty"` + + Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` + + Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` + + FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + + ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` + + InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + + LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` + + LxcConf map[string]interface{} `json:"lxcConf,omitempty" yaml:"lxc_conf,omitempty"` + + Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` + + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + + NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` + + NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` + + NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` + + PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` + + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` + + PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + + Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` + + PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` + + ReadOnly bool `json:"readOnly,omitempty" yaml:"read_only,omitempty"` + + RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` + + RestartPolicy *RestartPolicy `json:"restartPolicy,omitempty" yaml:"restart_policy,omitempty"` + + SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + + StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` + + SystemContainer string `json:"systemContainer,omitempty" yaml:"system_container,omitempty"` + + Token string `json:"token,omitempty" yaml:"token,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` + + User string `json:"user,omitempty" yaml:"user,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Version string `json:"version,omitempty" yaml:"version,omitempty"` + + VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` + + WorkingDir string `json:"workingDir,omitempty" yaml:"working_dir,omitempty"` +} + +type ContainerCollection struct { + Collection + Data []Container `json:"data,omitempty"` +} + +type ContainerClient struct { + rancherClient *RancherClient +} + +type ContainerOperations interface { + List(opts *ListOpts) (*ContainerCollection, error) + Create(opts *Container) (*Container, error) + Update(existing *Container, updates interface{}) (*Container, error) + ById(id string) (*Container, error) + Delete(container *Container) error + + ActionAllocate(*Container) (*Instance, error) + + ActionConsole(*Container, *InstanceConsoleInput) (*InstanceConsole, error) + + ActionCreate(*Container) (*Instance, error) + + ActionDeallocate(*Container) (*Instance, error) + + ActionError(*Container) (*Instance, error) + + ActionExecute(*Container, *ContainerExec) (*HostAccess, error) + + ActionLogs(*Container, *ContainerLogs) (*HostAccess, error) + + ActionMigrate(*Container) (*Instance, error) + + ActionProxy(*Container, *ContainerProxy) (*HostAccess, error) + + ActionPurge(*Container) (*Instance, error) + + ActionRemove(*Container) (*Instance, error) + + ActionRestart(*Container) (*Instance, error) + + ActionRestore(*Container) (*Instance, error) + + ActionSetlabels(*Container, *SetLabelsInput) (*Container, error) + + ActionStart(*Container) (*Instance, error) + + ActionStop(*Container, *InstanceStop) (*Instance, error) + + ActionUpdate(*Container) (*Instance, error) + + ActionUpdatehealthy(*Container) (*Instance, error) + + ActionUpdatereinitializing(*Container) (*Instance, error) + + ActionUpdateunhealthy(*Container) (*Instance, error) +} + +func newContainerClient(rancherClient *RancherClient) *ContainerClient { + return &ContainerClient{ + rancherClient: rancherClient, + } +} + +func (c *ContainerClient) Create(container *Container) (*Container, error) { + resp := &Container{} + err := c.rancherClient.doCreate(CONTAINER_TYPE, container, resp) + return resp, err +} + +func (c *ContainerClient) Update(existing *Container, updates interface{}) (*Container, error) { + resp := &Container{} + err := c.rancherClient.doUpdate(CONTAINER_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ContainerClient) List(opts *ListOpts) (*ContainerCollection, error) { + resp := &ContainerCollection{} + err := c.rancherClient.doList(CONTAINER_TYPE, opts, resp) + return resp, err +} + +func (c *ContainerClient) ById(id string) (*Container, error) { + resp := &Container{} + err := c.rancherClient.doById(CONTAINER_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ContainerClient) Delete(container *Container) error { + return c.rancherClient.doResourceDelete(CONTAINER_TYPE, &container.Resource) +} + +func (c *ContainerClient) ActionAllocate(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "allocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionConsole(resource *Container, input *InstanceConsoleInput) (*InstanceConsole, error) { + + resp := &InstanceConsole{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "console", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ContainerClient) ActionCreate(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionDeallocate(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "deallocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionError(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionExecute(resource *Container, input *ContainerExec) (*HostAccess, error) { + + resp := &HostAccess{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "execute", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ContainerClient) ActionLogs(resource *Container, input *ContainerLogs) (*HostAccess, error) { + + resp := &HostAccess{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "logs", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ContainerClient) ActionMigrate(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "migrate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionProxy(resource *Container, input *ContainerProxy) (*HostAccess, error) { + + resp := &HostAccess{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "proxy", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ContainerClient) ActionPurge(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionRemove(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionRestart(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "restart", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionRestore(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionSetlabels(resource *Container, input *SetLabelsInput) (*Container, error) { + + resp := &Container{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "setlabels", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ContainerClient) ActionStart(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "start", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionStop(resource *Container, input *InstanceStop) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "stop", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ContainerClient) ActionUpdate(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionUpdatehealthy(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "updatehealthy", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionUpdatereinitializing(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "updatereinitializing", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerClient) ActionUpdateunhealthy(resource *Container) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(CONTAINER_TYPE, "updateunhealthy", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go new file mode 100644 index 000000000..414030bde --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go @@ -0,0 +1,117 @@ +package client + +const ( + CONTAINER_EVENT_TYPE = "containerEvent" +) + +type ContainerEvent struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + DockerInspect interface{} `json:"dockerInspect,omitempty" yaml:"docker_inspect,omitempty"` + + ExternalFrom string `json:"externalFrom,omitempty" yaml:"external_from,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + ExternalStatus string `json:"externalStatus,omitempty" yaml:"external_status,omitempty"` + + ExternalTimestamp int64 `json:"externalTimestamp,omitempty" yaml:"external_timestamp,omitempty"` + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + ReportedHostUuid string `json:"reportedHostUuid,omitempty" yaml:"reported_host_uuid,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` +} + +type ContainerEventCollection struct { + Collection + Data []ContainerEvent `json:"data,omitempty"` +} + +type ContainerEventClient struct { + rancherClient *RancherClient +} + +type ContainerEventOperations interface { + List(opts *ListOpts) (*ContainerEventCollection, error) + Create(opts *ContainerEvent) (*ContainerEvent, error) + Update(existing *ContainerEvent, updates interface{}) (*ContainerEvent, error) + ById(id string) (*ContainerEvent, error) + Delete(container *ContainerEvent) error + + ActionCreate(*ContainerEvent) (*ContainerEvent, error) + + ActionRemove(*ContainerEvent) (*ContainerEvent, error) +} + +func newContainerEventClient(rancherClient *RancherClient) *ContainerEventClient { + return &ContainerEventClient{ + rancherClient: rancherClient, + } +} + +func (c *ContainerEventClient) Create(container *ContainerEvent) (*ContainerEvent, error) { + resp := &ContainerEvent{} + err := c.rancherClient.doCreate(CONTAINER_EVENT_TYPE, container, resp) + return resp, err +} + +func (c *ContainerEventClient) Update(existing *ContainerEvent, updates interface{}) (*ContainerEvent, error) { + resp := &ContainerEvent{} + err := c.rancherClient.doUpdate(CONTAINER_EVENT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ContainerEventClient) List(opts *ListOpts) (*ContainerEventCollection, error) { + resp := &ContainerEventCollection{} + err := c.rancherClient.doList(CONTAINER_EVENT_TYPE, opts, resp) + return resp, err +} + +func (c *ContainerEventClient) ById(id string) (*ContainerEvent, error) { + resp := &ContainerEvent{} + err := c.rancherClient.doById(CONTAINER_EVENT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ContainerEventClient) Delete(container *ContainerEvent) error { + return c.rancherClient.doResourceDelete(CONTAINER_EVENT_TYPE, &container.Resource) +} + +func (c *ContainerEventClient) ActionCreate(resource *ContainerEvent) (*ContainerEvent, error) { + + resp := &ContainerEvent{} + + err := c.rancherClient.doAction(CONTAINER_EVENT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ContainerEventClient) ActionRemove(resource *ContainerEvent) (*ContainerEvent, error) { + + resp := &ContainerEvent{} + + err := c.rancherClient.doAction(CONTAINER_EVENT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go new file mode 100644 index 000000000..c97f7703b --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go @@ -0,0 +1,73 @@ +package client + +const ( + CONTAINER_EXEC_TYPE = "containerExec" +) + +type ContainerExec struct { + Resource + + AttachStdin bool `json:"attachStdin,omitempty" yaml:"attach_stdin,omitempty"` + + AttachStdout bool `json:"attachStdout,omitempty" yaml:"attach_stdout,omitempty"` + + Command []string `json:"command,omitempty" yaml:"command,omitempty"` + + Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` +} + +type ContainerExecCollection struct { + Collection + Data []ContainerExec `json:"data,omitempty"` +} + +type ContainerExecClient struct { + rancherClient *RancherClient +} + +type ContainerExecOperations interface { + List(opts *ListOpts) (*ContainerExecCollection, error) + Create(opts *ContainerExec) (*ContainerExec, error) + Update(existing *ContainerExec, updates interface{}) (*ContainerExec, error) + ById(id string) (*ContainerExec, error) + Delete(container *ContainerExec) error +} + +func newContainerExecClient(rancherClient *RancherClient) *ContainerExecClient { + return &ContainerExecClient{ + rancherClient: rancherClient, + } +} + +func (c *ContainerExecClient) Create(container *ContainerExec) (*ContainerExec, error) { + resp := &ContainerExec{} + err := c.rancherClient.doCreate(CONTAINER_EXEC_TYPE, container, resp) + return resp, err +} + +func (c *ContainerExecClient) Update(existing *ContainerExec, updates interface{}) (*ContainerExec, error) { + resp := &ContainerExec{} + err := c.rancherClient.doUpdate(CONTAINER_EXEC_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ContainerExecClient) List(opts *ListOpts) (*ContainerExecCollection, error) { + resp := &ContainerExecCollection{} + err := c.rancherClient.doList(CONTAINER_EXEC_TYPE, opts, resp) + return resp, err +} + +func (c *ContainerExecClient) ById(id string) (*ContainerExec, error) { + resp := &ContainerExec{} + err := c.rancherClient.doById(CONTAINER_EXEC_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ContainerExecClient) Delete(container *ContainerExec) error { + return c.rancherClient.doResourceDelete(CONTAINER_EXEC_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go new file mode 100644 index 000000000..4d37dab92 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go @@ -0,0 +1,69 @@ +package client + +const ( + CONTAINER_LOGS_TYPE = "containerLogs" +) + +type ContainerLogs struct { + Resource + + Follow bool `json:"follow,omitempty" yaml:"follow,omitempty"` + + Lines int64 `json:"lines,omitempty" yaml:"lines,omitempty"` +} + +type ContainerLogsCollection struct { + Collection + Data []ContainerLogs `json:"data,omitempty"` +} + +type ContainerLogsClient struct { + rancherClient *RancherClient +} + +type ContainerLogsOperations interface { + List(opts *ListOpts) (*ContainerLogsCollection, error) + Create(opts *ContainerLogs) (*ContainerLogs, error) + Update(existing *ContainerLogs, updates interface{}) (*ContainerLogs, error) + ById(id string) (*ContainerLogs, error) + Delete(container *ContainerLogs) error +} + +func newContainerLogsClient(rancherClient *RancherClient) *ContainerLogsClient { + return &ContainerLogsClient{ + rancherClient: rancherClient, + } +} + +func (c *ContainerLogsClient) Create(container *ContainerLogs) (*ContainerLogs, error) { + resp := &ContainerLogs{} + err := c.rancherClient.doCreate(CONTAINER_LOGS_TYPE, container, resp) + return resp, err +} + +func (c *ContainerLogsClient) Update(existing *ContainerLogs, updates interface{}) (*ContainerLogs, error) { + resp := &ContainerLogs{} + err := c.rancherClient.doUpdate(CONTAINER_LOGS_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ContainerLogsClient) List(opts *ListOpts) (*ContainerLogsCollection, error) { + resp := &ContainerLogsCollection{} + err := c.rancherClient.doList(CONTAINER_LOGS_TYPE, opts, resp) + return resp, err +} + +func (c *ContainerLogsClient) ById(id string) (*ContainerLogs, error) { + resp := &ContainerLogs{} + err := c.rancherClient.doById(CONTAINER_LOGS_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ContainerLogsClient) Delete(container *ContainerLogs) error { + return c.rancherClient.doResourceDelete(CONTAINER_LOGS_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go new file mode 100644 index 000000000..19bcfd532 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go @@ -0,0 +1,69 @@ +package client + +const ( + CONTAINER_PROXY_TYPE = "containerProxy" +) + +type ContainerProxy struct { + Resource + + Port int64 `json:"port,omitempty" yaml:"port,omitempty"` + + Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"` +} + +type ContainerProxyCollection struct { + Collection + Data []ContainerProxy `json:"data,omitempty"` +} + +type ContainerProxyClient struct { + rancherClient *RancherClient +} + +type ContainerProxyOperations interface { + List(opts *ListOpts) (*ContainerProxyCollection, error) + Create(opts *ContainerProxy) (*ContainerProxy, error) + Update(existing *ContainerProxy, updates interface{}) (*ContainerProxy, error) + ById(id string) (*ContainerProxy, error) + Delete(container *ContainerProxy) error +} + +func newContainerProxyClient(rancherClient *RancherClient) *ContainerProxyClient { + return &ContainerProxyClient{ + rancherClient: rancherClient, + } +} + +func (c *ContainerProxyClient) Create(container *ContainerProxy) (*ContainerProxy, error) { + resp := &ContainerProxy{} + err := c.rancherClient.doCreate(CONTAINER_PROXY_TYPE, container, resp) + return resp, err +} + +func (c *ContainerProxyClient) Update(existing *ContainerProxy, updates interface{}) (*ContainerProxy, error) { + resp := &ContainerProxy{} + err := c.rancherClient.doUpdate(CONTAINER_PROXY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ContainerProxyClient) List(opts *ListOpts) (*ContainerProxyCollection, error) { + resp := &ContainerProxyCollection{} + err := c.rancherClient.doList(CONTAINER_PROXY_TYPE, opts, resp) + return resp, err +} + +func (c *ContainerProxyClient) ById(id string) (*ContainerProxy, error) { + resp := &ContainerProxy{} + err := c.rancherClient.doById(CONTAINER_PROXY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ContainerProxyClient) Delete(container *ContainerProxy) error { + return c.rancherClient.doResourceDelete(CONTAINER_PROXY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_credential.go b/vendor/github.com/rancher/go-rancher/v2/generated_credential.go new file mode 100644 index 000000000..e1586db29 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_credential.go @@ -0,0 +1,161 @@ +package client + +const ( + CREDENTIAL_TYPE = "credential" +) + +type Credential struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type CredentialCollection struct { + Collection + Data []Credential `json:"data,omitempty"` +} + +type CredentialClient struct { + rancherClient *RancherClient +} + +type CredentialOperations interface { + List(opts *ListOpts) (*CredentialCollection, error) + Create(opts *Credential) (*Credential, error) + Update(existing *Credential, updates interface{}) (*Credential, error) + ById(id string) (*Credential, error) + Delete(container *Credential) error + + ActionActivate(*Credential) (*Credential, error) + + ActionCreate(*Credential) (*Credential, error) + + ActionDeactivate(*Credential) (*Credential, error) + + ActionPurge(*Credential) (*Credential, error) + + ActionRemove(*Credential) (*Credential, error) + + ActionUpdate(*Credential) (*Credential, error) +} + +func newCredentialClient(rancherClient *RancherClient) *CredentialClient { + return &CredentialClient{ + rancherClient: rancherClient, + } +} + +func (c *CredentialClient) Create(container *Credential) (*Credential, error) { + resp := &Credential{} + err := c.rancherClient.doCreate(CREDENTIAL_TYPE, container, resp) + return resp, err +} + +func (c *CredentialClient) Update(existing *Credential, updates interface{}) (*Credential, error) { + resp := &Credential{} + err := c.rancherClient.doUpdate(CREDENTIAL_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *CredentialClient) List(opts *ListOpts) (*CredentialCollection, error) { + resp := &CredentialCollection{} + err := c.rancherClient.doList(CREDENTIAL_TYPE, opts, resp) + return resp, err +} + +func (c *CredentialClient) ById(id string) (*Credential, error) { + resp := &Credential{} + err := c.rancherClient.doById(CREDENTIAL_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *CredentialClient) Delete(container *Credential) error { + return c.rancherClient.doResourceDelete(CREDENTIAL_TYPE, &container.Resource) +} + +func (c *CredentialClient) ActionActivate(resource *Credential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(CREDENTIAL_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *CredentialClient) ActionCreate(resource *Credential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(CREDENTIAL_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *CredentialClient) ActionDeactivate(resource *Credential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(CREDENTIAL_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *CredentialClient) ActionPurge(resource *Credential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(CREDENTIAL_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *CredentialClient) ActionRemove(resource *Credential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(CREDENTIAL_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *CredentialClient) ActionUpdate(resource *Credential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(CREDENTIAL_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go new file mode 100644 index 000000000..63b3ca6cb --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go @@ -0,0 +1,85 @@ +package client + +const ( + DATABASECHANGELOG_TYPE = "databasechangelog" +) + +type Databasechangelog struct { + Resource + + Author string `json:"author,omitempty" yaml:"author,omitempty"` + + Comments string `json:"comments,omitempty" yaml:"comments,omitempty"` + + Dateexecuted string `json:"dateexecuted,omitempty" yaml:"dateexecuted,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Exectype string `json:"exectype,omitempty" yaml:"exectype,omitempty"` + + Filename string `json:"filename,omitempty" yaml:"filename,omitempty"` + + Liquibase string `json:"liquibase,omitempty" yaml:"liquibase,omitempty"` + + Md5sum string `json:"md5sum,omitempty" yaml:"md5sum,omitempty"` + + Orderexecuted int64 `json:"orderexecuted,omitempty" yaml:"orderexecuted,omitempty"` + + Tag string `json:"tag,omitempty" yaml:"tag,omitempty"` +} + +type DatabasechangelogCollection struct { + Collection + Data []Databasechangelog `json:"data,omitempty"` +} + +type DatabasechangelogClient struct { + rancherClient *RancherClient +} + +type DatabasechangelogOperations interface { + List(opts *ListOpts) (*DatabasechangelogCollection, error) + Create(opts *Databasechangelog) (*Databasechangelog, error) + Update(existing *Databasechangelog, updates interface{}) (*Databasechangelog, error) + ById(id string) (*Databasechangelog, error) + Delete(container *Databasechangelog) error +} + +func newDatabasechangelogClient(rancherClient *RancherClient) *DatabasechangelogClient { + return &DatabasechangelogClient{ + rancherClient: rancherClient, + } +} + +func (c *DatabasechangelogClient) Create(container *Databasechangelog) (*Databasechangelog, error) { + resp := &Databasechangelog{} + err := c.rancherClient.doCreate(DATABASECHANGELOG_TYPE, container, resp) + return resp, err +} + +func (c *DatabasechangelogClient) Update(existing *Databasechangelog, updates interface{}) (*Databasechangelog, error) { + resp := &Databasechangelog{} + err := c.rancherClient.doUpdate(DATABASECHANGELOG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *DatabasechangelogClient) List(opts *ListOpts) (*DatabasechangelogCollection, error) { + resp := &DatabasechangelogCollection{} + err := c.rancherClient.doList(DATABASECHANGELOG_TYPE, opts, resp) + return resp, err +} + +func (c *DatabasechangelogClient) ById(id string) (*Databasechangelog, error) { + resp := &Databasechangelog{} + err := c.rancherClient.doById(DATABASECHANGELOG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *DatabasechangelogClient) Delete(container *Databasechangelog) error { + return c.rancherClient.doResourceDelete(DATABASECHANGELOG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go new file mode 100644 index 000000000..f01b7bbc8 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go @@ -0,0 +1,71 @@ +package client + +const ( + DATABASECHANGELOGLOCK_TYPE = "databasechangeloglock" +) + +type Databasechangeloglock struct { + Resource + + Locked bool `json:"locked,omitempty" yaml:"locked,omitempty"` + + Lockedby string `json:"lockedby,omitempty" yaml:"lockedby,omitempty"` + + Lockgranted string `json:"lockgranted,omitempty" yaml:"lockgranted,omitempty"` +} + +type DatabasechangeloglockCollection struct { + Collection + Data []Databasechangeloglock `json:"data,omitempty"` +} + +type DatabasechangeloglockClient struct { + rancherClient *RancherClient +} + +type DatabasechangeloglockOperations interface { + List(opts *ListOpts) (*DatabasechangeloglockCollection, error) + Create(opts *Databasechangeloglock) (*Databasechangeloglock, error) + Update(existing *Databasechangeloglock, updates interface{}) (*Databasechangeloglock, error) + ById(id string) (*Databasechangeloglock, error) + Delete(container *Databasechangeloglock) error +} + +func newDatabasechangeloglockClient(rancherClient *RancherClient) *DatabasechangeloglockClient { + return &DatabasechangeloglockClient{ + rancherClient: rancherClient, + } +} + +func (c *DatabasechangeloglockClient) Create(container *Databasechangeloglock) (*Databasechangeloglock, error) { + resp := &Databasechangeloglock{} + err := c.rancherClient.doCreate(DATABASECHANGELOGLOCK_TYPE, container, resp) + return resp, err +} + +func (c *DatabasechangeloglockClient) Update(existing *Databasechangeloglock, updates interface{}) (*Databasechangeloglock, error) { + resp := &Databasechangeloglock{} + err := c.rancherClient.doUpdate(DATABASECHANGELOGLOCK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *DatabasechangeloglockClient) List(opts *ListOpts) (*DatabasechangeloglockCollection, error) { + resp := &DatabasechangeloglockCollection{} + err := c.rancherClient.doList(DATABASECHANGELOGLOCK_TYPE, opts, resp) + return resp, err +} + +func (c *DatabasechangeloglockClient) ById(id string) (*Databasechangeloglock, error) { + resp := &Databasechangeloglock{} + err := c.rancherClient.doById(DATABASECHANGELOGLOCK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *DatabasechangeloglockClient) Delete(container *Databasechangeloglock) error { + return c.rancherClient.doResourceDelete(DATABASECHANGELOGLOCK_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go new file mode 100644 index 000000000..3ae14dd47 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go @@ -0,0 +1,87 @@ +package client + +const ( + DIGITALOCEAN_CONFIG_TYPE = "digitaloceanConfig" +) + +type DigitaloceanConfig struct { + Resource + + AccessToken string `json:"accessToken,omitempty" yaml:"access_token,omitempty"` + + Backups bool `json:"backups,omitempty" yaml:"backups,omitempty"` + + Image string `json:"image,omitempty" yaml:"image,omitempty"` + + Ipv6 bool `json:"ipv6,omitempty" yaml:"ipv6,omitempty"` + + PrivateNetworking bool `json:"privateNetworking,omitempty" yaml:"private_networking,omitempty"` + + Region string `json:"region,omitempty" yaml:"region,omitempty"` + + Size string `json:"size,omitempty" yaml:"size,omitempty"` + + SshKeyFingerprint string `json:"sshKeyFingerprint,omitempty" yaml:"ssh_key_fingerprint,omitempty"` + + SshPort string `json:"sshPort,omitempty" yaml:"ssh_port,omitempty"` + + SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` + + Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` +} + +type DigitaloceanConfigCollection struct { + Collection + Data []DigitaloceanConfig `json:"data,omitempty"` +} + +type DigitaloceanConfigClient struct { + rancherClient *RancherClient +} + +type DigitaloceanConfigOperations interface { + List(opts *ListOpts) (*DigitaloceanConfigCollection, error) + Create(opts *DigitaloceanConfig) (*DigitaloceanConfig, error) + Update(existing *DigitaloceanConfig, updates interface{}) (*DigitaloceanConfig, error) + ById(id string) (*DigitaloceanConfig, error) + Delete(container *DigitaloceanConfig) error +} + +func newDigitaloceanConfigClient(rancherClient *RancherClient) *DigitaloceanConfigClient { + return &DigitaloceanConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *DigitaloceanConfigClient) Create(container *DigitaloceanConfig) (*DigitaloceanConfig, error) { + resp := &DigitaloceanConfig{} + err := c.rancherClient.doCreate(DIGITALOCEAN_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *DigitaloceanConfigClient) Update(existing *DigitaloceanConfig, updates interface{}) (*DigitaloceanConfig, error) { + resp := &DigitaloceanConfig{} + err := c.rancherClient.doUpdate(DIGITALOCEAN_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *DigitaloceanConfigClient) List(opts *ListOpts) (*DigitaloceanConfigCollection, error) { + resp := &DigitaloceanConfigCollection{} + err := c.rancherClient.doList(DIGITALOCEAN_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *DigitaloceanConfigClient) ById(id string) (*DigitaloceanConfig, error) { + resp := &DigitaloceanConfig{} + err := c.rancherClient.doById(DIGITALOCEAN_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *DigitaloceanConfigClient) Delete(container *DigitaloceanConfig) error { + return c.rancherClient.doResourceDelete(DIGITALOCEAN_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go new file mode 100644 index 000000000..4f9d9255b --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go @@ -0,0 +1,267 @@ +package client + +const ( + DNS_SERVICE_TYPE = "dnsService" +) + +type DnsService struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` + + SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type DnsServiceCollection struct { + Collection + Data []DnsService `json:"data,omitempty"` +} + +type DnsServiceClient struct { + rancherClient *RancherClient +} + +type DnsServiceOperations interface { + List(opts *ListOpts) (*DnsServiceCollection, error) + Create(opts *DnsService) (*DnsService, error) + Update(existing *DnsService, updates interface{}) (*DnsService, error) + ById(id string) (*DnsService, error) + Delete(container *DnsService) error + + ActionActivate(*DnsService) (*Service, error) + + ActionAddservicelink(*DnsService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionCancelupgrade(*DnsService) (*Service, error) + + ActionContinueupgrade(*DnsService) (*Service, error) + + ActionCreate(*DnsService) (*Service, error) + + ActionDeactivate(*DnsService) (*Service, error) + + ActionFinishupgrade(*DnsService) (*Service, error) + + ActionRemove(*DnsService) (*Service, error) + + ActionRemoveservicelink(*DnsService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionRestart(*DnsService, *ServiceRestart) (*Service, error) + + ActionRollback(*DnsService) (*Service, error) + + ActionSetservicelinks(*DnsService, *SetServiceLinksInput) (*Service, error) + + ActionUpdate(*DnsService) (*Service, error) + + ActionUpgrade(*DnsService, *ServiceUpgrade) (*Service, error) +} + +func newDnsServiceClient(rancherClient *RancherClient) *DnsServiceClient { + return &DnsServiceClient{ + rancherClient: rancherClient, + } +} + +func (c *DnsServiceClient) Create(container *DnsService) (*DnsService, error) { + resp := &DnsService{} + err := c.rancherClient.doCreate(DNS_SERVICE_TYPE, container, resp) + return resp, err +} + +func (c *DnsServiceClient) Update(existing *DnsService, updates interface{}) (*DnsService, error) { + resp := &DnsService{} + err := c.rancherClient.doUpdate(DNS_SERVICE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *DnsServiceClient) List(opts *ListOpts) (*DnsServiceCollection, error) { + resp := &DnsServiceCollection{} + err := c.rancherClient.doList(DNS_SERVICE_TYPE, opts, resp) + return resp, err +} + +func (c *DnsServiceClient) ById(id string) (*DnsService, error) { + resp := &DnsService{} + err := c.rancherClient.doById(DNS_SERVICE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *DnsServiceClient) Delete(container *DnsService) error { + return c.rancherClient.doResourceDelete(DNS_SERVICE_TYPE, &container.Resource) +} + +func (c *DnsServiceClient) ActionActivate(resource *DnsService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionAddservicelink(resource *DnsService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionCancelupgrade(resource *DnsService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionContinueupgrade(resource *DnsService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionCreate(resource *DnsService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionDeactivate(resource *DnsService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionFinishupgrade(resource *DnsService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionRemove(resource *DnsService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionRemoveservicelink(resource *DnsService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionRestart(resource *DnsService, input *ServiceRestart) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "restart", &resource.Resource, input, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionRollback(resource *DnsService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionSetservicelinks(resource *DnsService, input *SetServiceLinksInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionUpdate(resource *DnsService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DnsServiceClient) ActionUpgrade(resource *DnsService, input *ServiceUpgrade) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go b/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go new file mode 100644 index 000000000..cd91f65b2 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go @@ -0,0 +1,77 @@ +package client + +const ( + DOCKER_BUILD_TYPE = "dockerBuild" +) + +type DockerBuild struct { + Resource + + Context string `json:"context,omitempty" yaml:"context,omitempty"` + + Dockerfile string `json:"dockerfile,omitempty" yaml:"dockerfile,omitempty"` + + Forcerm bool `json:"forcerm,omitempty" yaml:"forcerm,omitempty"` + + Nocache bool `json:"nocache,omitempty" yaml:"nocache,omitempty"` + + Remote string `json:"remote,omitempty" yaml:"remote,omitempty"` + + Rm bool `json:"rm,omitempty" yaml:"rm,omitempty"` +} + +type DockerBuildCollection struct { + Collection + Data []DockerBuild `json:"data,omitempty"` +} + +type DockerBuildClient struct { + rancherClient *RancherClient +} + +type DockerBuildOperations interface { + List(opts *ListOpts) (*DockerBuildCollection, error) + Create(opts *DockerBuild) (*DockerBuild, error) + Update(existing *DockerBuild, updates interface{}) (*DockerBuild, error) + ById(id string) (*DockerBuild, error) + Delete(container *DockerBuild) error +} + +func newDockerBuildClient(rancherClient *RancherClient) *DockerBuildClient { + return &DockerBuildClient{ + rancherClient: rancherClient, + } +} + +func (c *DockerBuildClient) Create(container *DockerBuild) (*DockerBuild, error) { + resp := &DockerBuild{} + err := c.rancherClient.doCreate(DOCKER_BUILD_TYPE, container, resp) + return resp, err +} + +func (c *DockerBuildClient) Update(existing *DockerBuild, updates interface{}) (*DockerBuild, error) { + resp := &DockerBuild{} + err := c.rancherClient.doUpdate(DOCKER_BUILD_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *DockerBuildClient) List(opts *ListOpts) (*DockerBuildCollection, error) { + resp := &DockerBuildCollection{} + err := c.rancherClient.doList(DOCKER_BUILD_TYPE, opts, resp) + return resp, err +} + +func (c *DockerBuildClient) ById(id string) (*DockerBuild, error) { + resp := &DockerBuild{} + err := c.rancherClient.doById(DOCKER_BUILD_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *DockerBuildClient) Delete(container *DockerBuild) error { + return c.rancherClient.doResourceDelete(DOCKER_BUILD_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_dynamic_schema.go b/vendor/github.com/rancher/go-rancher/v2/generated_dynamic_schema.go new file mode 100644 index 000000000..f9421dd66 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_dynamic_schema.go @@ -0,0 +1,117 @@ +package client + +const ( + DYNAMIC_SCHEMA_TYPE = "dynamicSchema" +) + +type DynamicSchema struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Definition string `json:"definition,omitempty" yaml:"definition,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Parent string `json:"parent,omitempty" yaml:"parent,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + Roles []string `json:"roles,omitempty" yaml:"roles,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type DynamicSchemaCollection struct { + Collection + Data []DynamicSchema `json:"data,omitempty"` +} + +type DynamicSchemaClient struct { + rancherClient *RancherClient +} + +type DynamicSchemaOperations interface { + List(opts *ListOpts) (*DynamicSchemaCollection, error) + Create(opts *DynamicSchema) (*DynamicSchema, error) + Update(existing *DynamicSchema, updates interface{}) (*DynamicSchema, error) + ById(id string) (*DynamicSchema, error) + Delete(container *DynamicSchema) error + + ActionCreate(*DynamicSchema) (*DynamicSchema, error) + + ActionRemove(*DynamicSchema) (*DynamicSchema, error) +} + +func newDynamicSchemaClient(rancherClient *RancherClient) *DynamicSchemaClient { + return &DynamicSchemaClient{ + rancherClient: rancherClient, + } +} + +func (c *DynamicSchemaClient) Create(container *DynamicSchema) (*DynamicSchema, error) { + resp := &DynamicSchema{} + err := c.rancherClient.doCreate(DYNAMIC_SCHEMA_TYPE, container, resp) + return resp, err +} + +func (c *DynamicSchemaClient) Update(existing *DynamicSchema, updates interface{}) (*DynamicSchema, error) { + resp := &DynamicSchema{} + err := c.rancherClient.doUpdate(DYNAMIC_SCHEMA_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *DynamicSchemaClient) List(opts *ListOpts) (*DynamicSchemaCollection, error) { + resp := &DynamicSchemaCollection{} + err := c.rancherClient.doList(DYNAMIC_SCHEMA_TYPE, opts, resp) + return resp, err +} + +func (c *DynamicSchemaClient) ById(id string) (*DynamicSchema, error) { + resp := &DynamicSchema{} + err := c.rancherClient.doById(DYNAMIC_SCHEMA_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *DynamicSchemaClient) Delete(container *DynamicSchema) error { + return c.rancherClient.doResourceDelete(DYNAMIC_SCHEMA_TYPE, &container.Resource) +} + +func (c *DynamicSchemaClient) ActionCreate(resource *DynamicSchema) (*DynamicSchema, error) { + + resp := &DynamicSchema{} + + err := c.rancherClient.doAction(DYNAMIC_SCHEMA_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DynamicSchemaClient) ActionRemove(resource *DynamicSchema) (*DynamicSchema, error) { + + resp := &DynamicSchema{} + + err := c.rancherClient.doAction(DYNAMIC_SCHEMA_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go b/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go new file mode 100644 index 000000000..cfa7b4aa3 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go @@ -0,0 +1,71 @@ +package client + +const ( + EXTENSION_IMPLEMENTATION_TYPE = "extensionImplementation" +) + +type ExtensionImplementation struct { + Resource + + ClassName string `json:"className,omitempty" yaml:"class_name,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Properties map[string]interface{} `json:"properties,omitempty" yaml:"properties,omitempty"` +} + +type ExtensionImplementationCollection struct { + Collection + Data []ExtensionImplementation `json:"data,omitempty"` +} + +type ExtensionImplementationClient struct { + rancherClient *RancherClient +} + +type ExtensionImplementationOperations interface { + List(opts *ListOpts) (*ExtensionImplementationCollection, error) + Create(opts *ExtensionImplementation) (*ExtensionImplementation, error) + Update(existing *ExtensionImplementation, updates interface{}) (*ExtensionImplementation, error) + ById(id string) (*ExtensionImplementation, error) + Delete(container *ExtensionImplementation) error +} + +func newExtensionImplementationClient(rancherClient *RancherClient) *ExtensionImplementationClient { + return &ExtensionImplementationClient{ + rancherClient: rancherClient, + } +} + +func (c *ExtensionImplementationClient) Create(container *ExtensionImplementation) (*ExtensionImplementation, error) { + resp := &ExtensionImplementation{} + err := c.rancherClient.doCreate(EXTENSION_IMPLEMENTATION_TYPE, container, resp) + return resp, err +} + +func (c *ExtensionImplementationClient) Update(existing *ExtensionImplementation, updates interface{}) (*ExtensionImplementation, error) { + resp := &ExtensionImplementation{} + err := c.rancherClient.doUpdate(EXTENSION_IMPLEMENTATION_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExtensionImplementationClient) List(opts *ListOpts) (*ExtensionImplementationCollection, error) { + resp := &ExtensionImplementationCollection{} + err := c.rancherClient.doList(EXTENSION_IMPLEMENTATION_TYPE, opts, resp) + return resp, err +} + +func (c *ExtensionImplementationClient) ById(id string) (*ExtensionImplementation, error) { + resp := &ExtensionImplementation{} + err := c.rancherClient.doById(EXTENSION_IMPLEMENTATION_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExtensionImplementationClient) Delete(container *ExtensionImplementation) error { + return c.rancherClient.doResourceDelete(EXTENSION_IMPLEMENTATION_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go b/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go new file mode 100644 index 000000000..0b13cf548 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go @@ -0,0 +1,75 @@ +package client + +const ( + EXTENSION_POINT_TYPE = "extensionPoint" +) + +type ExtensionPoint struct { + Resource + + ExcludeSetting string `json:"excludeSetting,omitempty" yaml:"exclude_setting,omitempty"` + + Implementations []interface{} `json:"implementations,omitempty" yaml:"implementations,omitempty"` + + IncludeSetting string `json:"includeSetting,omitempty" yaml:"include_setting,omitempty"` + + ListSetting string `json:"listSetting,omitempty" yaml:"list_setting,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` +} + +type ExtensionPointCollection struct { + Collection + Data []ExtensionPoint `json:"data,omitempty"` +} + +type ExtensionPointClient struct { + rancherClient *RancherClient +} + +type ExtensionPointOperations interface { + List(opts *ListOpts) (*ExtensionPointCollection, error) + Create(opts *ExtensionPoint) (*ExtensionPoint, error) + Update(existing *ExtensionPoint, updates interface{}) (*ExtensionPoint, error) + ById(id string) (*ExtensionPoint, error) + Delete(container *ExtensionPoint) error +} + +func newExtensionPointClient(rancherClient *RancherClient) *ExtensionPointClient { + return &ExtensionPointClient{ + rancherClient: rancherClient, + } +} + +func (c *ExtensionPointClient) Create(container *ExtensionPoint) (*ExtensionPoint, error) { + resp := &ExtensionPoint{} + err := c.rancherClient.doCreate(EXTENSION_POINT_TYPE, container, resp) + return resp, err +} + +func (c *ExtensionPointClient) Update(existing *ExtensionPoint, updates interface{}) (*ExtensionPoint, error) { + resp := &ExtensionPoint{} + err := c.rancherClient.doUpdate(EXTENSION_POINT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExtensionPointClient) List(opts *ListOpts) (*ExtensionPointCollection, error) { + resp := &ExtensionPointCollection{} + err := c.rancherClient.doList(EXTENSION_POINT_TYPE, opts, resp) + return resp, err +} + +func (c *ExtensionPointClient) ById(id string) (*ExtensionPoint, error) { + resp := &ExtensionPoint{} + err := c.rancherClient.doById(EXTENSION_POINT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExtensionPointClient) Delete(container *ExtensionPoint) error { + return c.rancherClient.doResourceDelete(EXTENSION_POINT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go new file mode 100644 index 000000000..7f4ce2562 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go @@ -0,0 +1,117 @@ +package client + +const ( + EXTERNAL_DNS_EVENT_TYPE = "externalDnsEvent" +) + +type ExternalDnsEvent struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` + + ServiceName string `json:"serviceName,omitempty" yaml:"service_name,omitempty"` + + StackName string `json:"stackName,omitempty" yaml:"stack_name,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ExternalDnsEventCollection struct { + Collection + Data []ExternalDnsEvent `json:"data,omitempty"` +} + +type ExternalDnsEventClient struct { + rancherClient *RancherClient +} + +type ExternalDnsEventOperations interface { + List(opts *ListOpts) (*ExternalDnsEventCollection, error) + Create(opts *ExternalDnsEvent) (*ExternalDnsEvent, error) + Update(existing *ExternalDnsEvent, updates interface{}) (*ExternalDnsEvent, error) + ById(id string) (*ExternalDnsEvent, error) + Delete(container *ExternalDnsEvent) error + + ActionCreate(*ExternalDnsEvent) (*ExternalEvent, error) + + ActionRemove(*ExternalDnsEvent) (*ExternalEvent, error) +} + +func newExternalDnsEventClient(rancherClient *RancherClient) *ExternalDnsEventClient { + return &ExternalDnsEventClient{ + rancherClient: rancherClient, + } +} + +func (c *ExternalDnsEventClient) Create(container *ExternalDnsEvent) (*ExternalDnsEvent, error) { + resp := &ExternalDnsEvent{} + err := c.rancherClient.doCreate(EXTERNAL_DNS_EVENT_TYPE, container, resp) + return resp, err +} + +func (c *ExternalDnsEventClient) Update(existing *ExternalDnsEvent, updates interface{}) (*ExternalDnsEvent, error) { + resp := &ExternalDnsEvent{} + err := c.rancherClient.doUpdate(EXTERNAL_DNS_EVENT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExternalDnsEventClient) List(opts *ListOpts) (*ExternalDnsEventCollection, error) { + resp := &ExternalDnsEventCollection{} + err := c.rancherClient.doList(EXTERNAL_DNS_EVENT_TYPE, opts, resp) + return resp, err +} + +func (c *ExternalDnsEventClient) ById(id string) (*ExternalDnsEvent, error) { + resp := &ExternalDnsEvent{} + err := c.rancherClient.doById(EXTERNAL_DNS_EVENT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExternalDnsEventClient) Delete(container *ExternalDnsEvent) error { + return c.rancherClient.doResourceDelete(EXTERNAL_DNS_EVENT_TYPE, &container.Resource) +} + +func (c *ExternalDnsEventClient) ActionCreate(resource *ExternalDnsEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_DNS_EVENT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalDnsEventClient) ActionRemove(resource *ExternalDnsEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_DNS_EVENT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go new file mode 100644 index 000000000..a1bf8180b --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go @@ -0,0 +1,111 @@ +package client + +const ( + EXTERNAL_EVENT_TYPE = "externalEvent" +) + +type ExternalEvent struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ExternalEventCollection struct { + Collection + Data []ExternalEvent `json:"data,omitempty"` +} + +type ExternalEventClient struct { + rancherClient *RancherClient +} + +type ExternalEventOperations interface { + List(opts *ListOpts) (*ExternalEventCollection, error) + Create(opts *ExternalEvent) (*ExternalEvent, error) + Update(existing *ExternalEvent, updates interface{}) (*ExternalEvent, error) + ById(id string) (*ExternalEvent, error) + Delete(container *ExternalEvent) error + + ActionCreate(*ExternalEvent) (*ExternalEvent, error) + + ActionRemove(*ExternalEvent) (*ExternalEvent, error) +} + +func newExternalEventClient(rancherClient *RancherClient) *ExternalEventClient { + return &ExternalEventClient{ + rancherClient: rancherClient, + } +} + +func (c *ExternalEventClient) Create(container *ExternalEvent) (*ExternalEvent, error) { + resp := &ExternalEvent{} + err := c.rancherClient.doCreate(EXTERNAL_EVENT_TYPE, container, resp) + return resp, err +} + +func (c *ExternalEventClient) Update(existing *ExternalEvent, updates interface{}) (*ExternalEvent, error) { + resp := &ExternalEvent{} + err := c.rancherClient.doUpdate(EXTERNAL_EVENT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExternalEventClient) List(opts *ListOpts) (*ExternalEventCollection, error) { + resp := &ExternalEventCollection{} + err := c.rancherClient.doList(EXTERNAL_EVENT_TYPE, opts, resp) + return resp, err +} + +func (c *ExternalEventClient) ById(id string) (*ExternalEvent, error) { + resp := &ExternalEvent{} + err := c.rancherClient.doById(EXTERNAL_EVENT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExternalEventClient) Delete(container *ExternalEvent) error { + return c.rancherClient.doResourceDelete(EXTERNAL_EVENT_TYPE, &container.Resource) +} + +func (c *ExternalEventClient) ActionCreate(resource *ExternalEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_EVENT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalEventClient) ActionRemove(resource *ExternalEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_EVENT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go new file mode 100644 index 000000000..d325b8d55 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go @@ -0,0 +1,174 @@ +package client + +const ( + EXTERNAL_HANDLER_TYPE = "externalHandler" +) + +type ExternalHandler struct { + Resource + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` + + ProcessConfigs []interface{} `json:"processConfigs,omitempty" yaml:"process_configs,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + Retries int64 `json:"retries,omitempty" yaml:"retries,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + TimeoutMillis int64 `json:"timeoutMillis,omitempty" yaml:"timeout_millis,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ExternalHandlerCollection struct { + Collection + Data []ExternalHandler `json:"data,omitempty"` +} + +type ExternalHandlerClient struct { + rancherClient *RancherClient +} + +type ExternalHandlerOperations interface { + List(opts *ListOpts) (*ExternalHandlerCollection, error) + Create(opts *ExternalHandler) (*ExternalHandler, error) + Update(existing *ExternalHandler, updates interface{}) (*ExternalHandler, error) + ById(id string) (*ExternalHandler, error) + Delete(container *ExternalHandler) error + + ActionActivate(*ExternalHandler) (*ExternalHandler, error) + + ActionCreate(*ExternalHandler) (*ExternalHandler, error) + + ActionDeactivate(*ExternalHandler) (*ExternalHandler, error) + + ActionPurge(*ExternalHandler) (*ExternalHandler, error) + + ActionRemove(*ExternalHandler) (*ExternalHandler, error) + + ActionRestore(*ExternalHandler) (*ExternalHandler, error) + + ActionUpdate(*ExternalHandler) (*ExternalHandler, error) +} + +func newExternalHandlerClient(rancherClient *RancherClient) *ExternalHandlerClient { + return &ExternalHandlerClient{ + rancherClient: rancherClient, + } +} + +func (c *ExternalHandlerClient) Create(container *ExternalHandler) (*ExternalHandler, error) { + resp := &ExternalHandler{} + err := c.rancherClient.doCreate(EXTERNAL_HANDLER_TYPE, container, resp) + return resp, err +} + +func (c *ExternalHandlerClient) Update(existing *ExternalHandler, updates interface{}) (*ExternalHandler, error) { + resp := &ExternalHandler{} + err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExternalHandlerClient) List(opts *ListOpts) (*ExternalHandlerCollection, error) { + resp := &ExternalHandlerCollection{} + err := c.rancherClient.doList(EXTERNAL_HANDLER_TYPE, opts, resp) + return resp, err +} + +func (c *ExternalHandlerClient) ById(id string) (*ExternalHandler, error) { + resp := &ExternalHandler{} + err := c.rancherClient.doById(EXTERNAL_HANDLER_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExternalHandlerClient) Delete(container *ExternalHandler) error { + return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_TYPE, &container.Resource) +} + +func (c *ExternalHandlerClient) ActionActivate(resource *ExternalHandler) (*ExternalHandler, error) { + + resp := &ExternalHandler{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerClient) ActionCreate(resource *ExternalHandler) (*ExternalHandler, error) { + + resp := &ExternalHandler{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerClient) ActionDeactivate(resource *ExternalHandler) (*ExternalHandler, error) { + + resp := &ExternalHandler{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerClient) ActionPurge(resource *ExternalHandler) (*ExternalHandler, error) { + + resp := &ExternalHandler{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerClient) ActionRemove(resource *ExternalHandler) (*ExternalHandler, error) { + + resp := &ExternalHandler{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerClient) ActionRestore(resource *ExternalHandler) (*ExternalHandler, error) { + + resp := &ExternalHandler{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerClient) ActionUpdate(resource *ExternalHandler) (*ExternalHandler, error) { + + resp := &ExternalHandler{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go new file mode 100644 index 000000000..b90847ee2 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go @@ -0,0 +1,174 @@ +package client + +const ( + EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE = "externalHandlerExternalHandlerProcessMap" +) + +type ExternalHandlerExternalHandlerProcessMap struct { + Resource + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + EventName string `json:"eventName,omitempty" yaml:"event_name,omitempty"` + + ExternalHandlerId string `json:"externalHandlerId,omitempty" yaml:"external_handler_id,omitempty"` + + ExternalHandlerProcessId string `json:"externalHandlerProcessId,omitempty" yaml:"external_handler_process_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + OnError string `json:"onError,omitempty" yaml:"on_error,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ExternalHandlerExternalHandlerProcessMapCollection struct { + Collection + Data []ExternalHandlerExternalHandlerProcessMap `json:"data,omitempty"` +} + +type ExternalHandlerExternalHandlerProcessMapClient struct { + rancherClient *RancherClient +} + +type ExternalHandlerExternalHandlerProcessMapOperations interface { + List(opts *ListOpts) (*ExternalHandlerExternalHandlerProcessMapCollection, error) + Create(opts *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) + Update(existing *ExternalHandlerExternalHandlerProcessMap, updates interface{}) (*ExternalHandlerExternalHandlerProcessMap, error) + ById(id string) (*ExternalHandlerExternalHandlerProcessMap, error) + Delete(container *ExternalHandlerExternalHandlerProcessMap) error + + ActionActivate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) + + ActionCreate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) + + ActionDeactivate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) + + ActionPurge(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) + + ActionRemove(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) + + ActionRestore(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) + + ActionUpdate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) +} + +func newExternalHandlerExternalHandlerProcessMapClient(rancherClient *RancherClient) *ExternalHandlerExternalHandlerProcessMapClient { + return &ExternalHandlerExternalHandlerProcessMapClient{ + rancherClient: rancherClient, + } +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) Create(container *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { + resp := &ExternalHandlerExternalHandlerProcessMap{} + err := c.rancherClient.doCreate(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, container, resp) + return resp, err +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) Update(existing *ExternalHandlerExternalHandlerProcessMap, updates interface{}) (*ExternalHandlerExternalHandlerProcessMap, error) { + resp := &ExternalHandlerExternalHandlerProcessMap{} + err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) List(opts *ListOpts) (*ExternalHandlerExternalHandlerProcessMapCollection, error) { + resp := &ExternalHandlerExternalHandlerProcessMapCollection{} + err := c.rancherClient.doList(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, opts, resp) + return resp, err +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) ById(id string) (*ExternalHandlerExternalHandlerProcessMap, error) { + resp := &ExternalHandlerExternalHandlerProcessMap{} + err := c.rancherClient.doById(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) Delete(container *ExternalHandlerExternalHandlerProcessMap) error { + return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, &container.Resource) +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionActivate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { + + resp := &ExternalHandlerExternalHandlerProcessMap{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionCreate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { + + resp := &ExternalHandlerExternalHandlerProcessMap{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionDeactivate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { + + resp := &ExternalHandlerExternalHandlerProcessMap{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionPurge(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { + + resp := &ExternalHandlerExternalHandlerProcessMap{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionRemove(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { + + resp := &ExternalHandlerExternalHandlerProcessMap{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionRestore(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { + + resp := &ExternalHandlerExternalHandlerProcessMap{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionUpdate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { + + resp := &ExternalHandlerExternalHandlerProcessMap{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go new file mode 100644 index 000000000..a61336572 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go @@ -0,0 +1,166 @@ +package client + +const ( + EXTERNAL_HANDLER_PROCESS_TYPE = "externalHandlerProcess" +) + +type ExternalHandlerProcess struct { + Resource + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ExternalHandlerProcessCollection struct { + Collection + Data []ExternalHandlerProcess `json:"data,omitempty"` +} + +type ExternalHandlerProcessClient struct { + rancherClient *RancherClient +} + +type ExternalHandlerProcessOperations interface { + List(opts *ListOpts) (*ExternalHandlerProcessCollection, error) + Create(opts *ExternalHandlerProcess) (*ExternalHandlerProcess, error) + Update(existing *ExternalHandlerProcess, updates interface{}) (*ExternalHandlerProcess, error) + ById(id string) (*ExternalHandlerProcess, error) + Delete(container *ExternalHandlerProcess) error + + ActionActivate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) + + ActionCreate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) + + ActionDeactivate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) + + ActionPurge(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) + + ActionRemove(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) + + ActionRestore(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) + + ActionUpdate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) +} + +func newExternalHandlerProcessClient(rancherClient *RancherClient) *ExternalHandlerProcessClient { + return &ExternalHandlerProcessClient{ + rancherClient: rancherClient, + } +} + +func (c *ExternalHandlerProcessClient) Create(container *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { + resp := &ExternalHandlerProcess{} + err := c.rancherClient.doCreate(EXTERNAL_HANDLER_PROCESS_TYPE, container, resp) + return resp, err +} + +func (c *ExternalHandlerProcessClient) Update(existing *ExternalHandlerProcess, updates interface{}) (*ExternalHandlerProcess, error) { + resp := &ExternalHandlerProcess{} + err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_PROCESS_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExternalHandlerProcessClient) List(opts *ListOpts) (*ExternalHandlerProcessCollection, error) { + resp := &ExternalHandlerProcessCollection{} + err := c.rancherClient.doList(EXTERNAL_HANDLER_PROCESS_TYPE, opts, resp) + return resp, err +} + +func (c *ExternalHandlerProcessClient) ById(id string) (*ExternalHandlerProcess, error) { + resp := &ExternalHandlerProcess{} + err := c.rancherClient.doById(EXTERNAL_HANDLER_PROCESS_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExternalHandlerProcessClient) Delete(container *ExternalHandlerProcess) error { + return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_PROCESS_TYPE, &container.Resource) +} + +func (c *ExternalHandlerProcessClient) ActionActivate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { + + resp := &ExternalHandlerProcess{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerProcessClient) ActionCreate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { + + resp := &ExternalHandlerProcess{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerProcessClient) ActionDeactivate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { + + resp := &ExternalHandlerProcess{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerProcessClient) ActionPurge(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { + + resp := &ExternalHandlerProcess{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerProcessClient) ActionRemove(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { + + resp := &ExternalHandlerProcess{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerProcessClient) ActionRestore(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { + + resp := &ExternalHandlerProcess{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHandlerProcessClient) ActionUpdate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { + + resp := &ExternalHandlerProcess{} + + err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go new file mode 100644 index 000000000..de0d49eb4 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go @@ -0,0 +1,69 @@ +package client + +const ( + EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE = "externalHandlerProcessConfig" +) + +type ExternalHandlerProcessConfig struct { + Resource + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + OnError string `json:"onError,omitempty" yaml:"on_error,omitempty"` +} + +type ExternalHandlerProcessConfigCollection struct { + Collection + Data []ExternalHandlerProcessConfig `json:"data,omitempty"` +} + +type ExternalHandlerProcessConfigClient struct { + rancherClient *RancherClient +} + +type ExternalHandlerProcessConfigOperations interface { + List(opts *ListOpts) (*ExternalHandlerProcessConfigCollection, error) + Create(opts *ExternalHandlerProcessConfig) (*ExternalHandlerProcessConfig, error) + Update(existing *ExternalHandlerProcessConfig, updates interface{}) (*ExternalHandlerProcessConfig, error) + ById(id string) (*ExternalHandlerProcessConfig, error) + Delete(container *ExternalHandlerProcessConfig) error +} + +func newExternalHandlerProcessConfigClient(rancherClient *RancherClient) *ExternalHandlerProcessConfigClient { + return &ExternalHandlerProcessConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *ExternalHandlerProcessConfigClient) Create(container *ExternalHandlerProcessConfig) (*ExternalHandlerProcessConfig, error) { + resp := &ExternalHandlerProcessConfig{} + err := c.rancherClient.doCreate(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *ExternalHandlerProcessConfigClient) Update(existing *ExternalHandlerProcessConfig, updates interface{}) (*ExternalHandlerProcessConfig, error) { + resp := &ExternalHandlerProcessConfig{} + err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExternalHandlerProcessConfigClient) List(opts *ListOpts) (*ExternalHandlerProcessConfigCollection, error) { + resp := &ExternalHandlerProcessConfigCollection{} + err := c.rancherClient.doList(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *ExternalHandlerProcessConfigClient) ById(id string) (*ExternalHandlerProcessConfig, error) { + resp := &ExternalHandlerProcessConfig{} + err := c.rancherClient.doById(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExternalHandlerProcessConfigClient) Delete(container *ExternalHandlerProcessConfig) error { + return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go new file mode 100644 index 000000000..ae8ec14ce --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go @@ -0,0 +1,117 @@ +package client + +const ( + EXTERNAL_HOST_EVENT_TYPE = "externalHostEvent" +) + +type ExternalHostEvent struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + DeleteHost bool `json:"deleteHost,omitempty" yaml:"delete_host,omitempty"` + + EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + + HostLabel string `json:"hostLabel,omitempty" yaml:"host_label,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ExternalHostEventCollection struct { + Collection + Data []ExternalHostEvent `json:"data,omitempty"` +} + +type ExternalHostEventClient struct { + rancherClient *RancherClient +} + +type ExternalHostEventOperations interface { + List(opts *ListOpts) (*ExternalHostEventCollection, error) + Create(opts *ExternalHostEvent) (*ExternalHostEvent, error) + Update(existing *ExternalHostEvent, updates interface{}) (*ExternalHostEvent, error) + ById(id string) (*ExternalHostEvent, error) + Delete(container *ExternalHostEvent) error + + ActionCreate(*ExternalHostEvent) (*ExternalEvent, error) + + ActionRemove(*ExternalHostEvent) (*ExternalEvent, error) +} + +func newExternalHostEventClient(rancherClient *RancherClient) *ExternalHostEventClient { + return &ExternalHostEventClient{ + rancherClient: rancherClient, + } +} + +func (c *ExternalHostEventClient) Create(container *ExternalHostEvent) (*ExternalHostEvent, error) { + resp := &ExternalHostEvent{} + err := c.rancherClient.doCreate(EXTERNAL_HOST_EVENT_TYPE, container, resp) + return resp, err +} + +func (c *ExternalHostEventClient) Update(existing *ExternalHostEvent, updates interface{}) (*ExternalHostEvent, error) { + resp := &ExternalHostEvent{} + err := c.rancherClient.doUpdate(EXTERNAL_HOST_EVENT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExternalHostEventClient) List(opts *ListOpts) (*ExternalHostEventCollection, error) { + resp := &ExternalHostEventCollection{} + err := c.rancherClient.doList(EXTERNAL_HOST_EVENT_TYPE, opts, resp) + return resp, err +} + +func (c *ExternalHostEventClient) ById(id string) (*ExternalHostEvent, error) { + resp := &ExternalHostEvent{} + err := c.rancherClient.doById(EXTERNAL_HOST_EVENT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExternalHostEventClient) Delete(container *ExternalHostEvent) error { + return c.rancherClient.doResourceDelete(EXTERNAL_HOST_EVENT_TYPE, &container.Resource) +} + +func (c *ExternalHostEventClient) ActionCreate(resource *ExternalHostEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_HOST_EVENT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalHostEventClient) ActionRemove(resource *ExternalHostEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_HOST_EVENT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go new file mode 100644 index 000000000..b4a4e9440 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go @@ -0,0 +1,234 @@ +package client + +const ( + EXTERNAL_SERVICE_TYPE = "externalService" +) + +type ExternalService struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + ExternalIpAddresses []string `json:"externalIpAddresses,omitempty" yaml:"external_ip_addresses,omitempty"` + + Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` + + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ExternalServiceCollection struct { + Collection + Data []ExternalService `json:"data,omitempty"` +} + +type ExternalServiceClient struct { + rancherClient *RancherClient +} + +type ExternalServiceOperations interface { + List(opts *ListOpts) (*ExternalServiceCollection, error) + Create(opts *ExternalService) (*ExternalService, error) + Update(existing *ExternalService, updates interface{}) (*ExternalService, error) + ById(id string) (*ExternalService, error) + Delete(container *ExternalService) error + + ActionActivate(*ExternalService) (*Service, error) + + ActionCancelupgrade(*ExternalService) (*Service, error) + + ActionContinueupgrade(*ExternalService) (*Service, error) + + ActionCreate(*ExternalService) (*Service, error) + + ActionDeactivate(*ExternalService) (*Service, error) + + ActionFinishupgrade(*ExternalService) (*Service, error) + + ActionRemove(*ExternalService) (*Service, error) + + ActionRestart(*ExternalService, *ServiceRestart) (*Service, error) + + ActionRollback(*ExternalService) (*Service, error) + + ActionUpdate(*ExternalService) (*Service, error) + + ActionUpgrade(*ExternalService, *ServiceUpgrade) (*Service, error) +} + +func newExternalServiceClient(rancherClient *RancherClient) *ExternalServiceClient { + return &ExternalServiceClient{ + rancherClient: rancherClient, + } +} + +func (c *ExternalServiceClient) Create(container *ExternalService) (*ExternalService, error) { + resp := &ExternalService{} + err := c.rancherClient.doCreate(EXTERNAL_SERVICE_TYPE, container, resp) + return resp, err +} + +func (c *ExternalServiceClient) Update(existing *ExternalService, updates interface{}) (*ExternalService, error) { + resp := &ExternalService{} + err := c.rancherClient.doUpdate(EXTERNAL_SERVICE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExternalServiceClient) List(opts *ListOpts) (*ExternalServiceCollection, error) { + resp := &ExternalServiceCollection{} + err := c.rancherClient.doList(EXTERNAL_SERVICE_TYPE, opts, resp) + return resp, err +} + +func (c *ExternalServiceClient) ById(id string) (*ExternalService, error) { + resp := &ExternalService{} + err := c.rancherClient.doById(EXTERNAL_SERVICE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExternalServiceClient) Delete(container *ExternalService) error { + return c.rancherClient.doResourceDelete(EXTERNAL_SERVICE_TYPE, &container.Resource) +} + +func (c *ExternalServiceClient) ActionActivate(resource *ExternalService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalServiceClient) ActionCancelupgrade(resource *ExternalService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalServiceClient) ActionContinueupgrade(resource *ExternalService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalServiceClient) ActionCreate(resource *ExternalService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalServiceClient) ActionDeactivate(resource *ExternalService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalServiceClient) ActionFinishupgrade(resource *ExternalService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalServiceClient) ActionRemove(resource *ExternalService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalServiceClient) ActionRestart(resource *ExternalService, input *ServiceRestart) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "restart", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ExternalServiceClient) ActionRollback(resource *ExternalService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalServiceClient) ActionUpdate(resource *ExternalService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalServiceClient) ActionUpgrade(resource *ExternalService, input *ServiceUpgrade) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go new file mode 100644 index 000000000..1eb53a599 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go @@ -0,0 +1,115 @@ +package client + +const ( + EXTERNAL_SERVICE_EVENT_TYPE = "externalServiceEvent" +) + +type ExternalServiceEvent struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Environment interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` + + EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` + + Service interface{} `json:"service,omitempty" yaml:"service,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ExternalServiceEventCollection struct { + Collection + Data []ExternalServiceEvent `json:"data,omitempty"` +} + +type ExternalServiceEventClient struct { + rancherClient *RancherClient +} + +type ExternalServiceEventOperations interface { + List(opts *ListOpts) (*ExternalServiceEventCollection, error) + Create(opts *ExternalServiceEvent) (*ExternalServiceEvent, error) + Update(existing *ExternalServiceEvent, updates interface{}) (*ExternalServiceEvent, error) + ById(id string) (*ExternalServiceEvent, error) + Delete(container *ExternalServiceEvent) error + + ActionCreate(*ExternalServiceEvent) (*ExternalEvent, error) + + ActionRemove(*ExternalServiceEvent) (*ExternalEvent, error) +} + +func newExternalServiceEventClient(rancherClient *RancherClient) *ExternalServiceEventClient { + return &ExternalServiceEventClient{ + rancherClient: rancherClient, + } +} + +func (c *ExternalServiceEventClient) Create(container *ExternalServiceEvent) (*ExternalServiceEvent, error) { + resp := &ExternalServiceEvent{} + err := c.rancherClient.doCreate(EXTERNAL_SERVICE_EVENT_TYPE, container, resp) + return resp, err +} + +func (c *ExternalServiceEventClient) Update(existing *ExternalServiceEvent, updates interface{}) (*ExternalServiceEvent, error) { + resp := &ExternalServiceEvent{} + err := c.rancherClient.doUpdate(EXTERNAL_SERVICE_EVENT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExternalServiceEventClient) List(opts *ListOpts) (*ExternalServiceEventCollection, error) { + resp := &ExternalServiceEventCollection{} + err := c.rancherClient.doList(EXTERNAL_SERVICE_EVENT_TYPE, opts, resp) + return resp, err +} + +func (c *ExternalServiceEventClient) ById(id string) (*ExternalServiceEvent, error) { + resp := &ExternalServiceEvent{} + err := c.rancherClient.doById(EXTERNAL_SERVICE_EVENT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExternalServiceEventClient) Delete(container *ExternalServiceEvent) error { + return c.rancherClient.doResourceDelete(EXTERNAL_SERVICE_EVENT_TYPE, &container.Resource) +} + +func (c *ExternalServiceEventClient) ActionCreate(resource *ExternalServiceEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_EVENT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalServiceEventClient) ActionRemove(resource *ExternalServiceEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_EVENT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go new file mode 100644 index 000000000..21d4ef365 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go @@ -0,0 +1,115 @@ +package client + +const ( + EXTERNAL_STORAGE_POOL_EVENT_TYPE = "externalStoragePoolEvent" +) + +type ExternalStoragePoolEvent struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + HostUuids []string `json:"hostUuids,omitempty" yaml:"host_uuids,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + StoragePool StoragePool `json:"storagePool,omitempty" yaml:"storage_pool,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ExternalStoragePoolEventCollection struct { + Collection + Data []ExternalStoragePoolEvent `json:"data,omitempty"` +} + +type ExternalStoragePoolEventClient struct { + rancherClient *RancherClient +} + +type ExternalStoragePoolEventOperations interface { + List(opts *ListOpts) (*ExternalStoragePoolEventCollection, error) + Create(opts *ExternalStoragePoolEvent) (*ExternalStoragePoolEvent, error) + Update(existing *ExternalStoragePoolEvent, updates interface{}) (*ExternalStoragePoolEvent, error) + ById(id string) (*ExternalStoragePoolEvent, error) + Delete(container *ExternalStoragePoolEvent) error + + ActionCreate(*ExternalStoragePoolEvent) (*ExternalEvent, error) + + ActionRemove(*ExternalStoragePoolEvent) (*ExternalEvent, error) +} + +func newExternalStoragePoolEventClient(rancherClient *RancherClient) *ExternalStoragePoolEventClient { + return &ExternalStoragePoolEventClient{ + rancherClient: rancherClient, + } +} + +func (c *ExternalStoragePoolEventClient) Create(container *ExternalStoragePoolEvent) (*ExternalStoragePoolEvent, error) { + resp := &ExternalStoragePoolEvent{} + err := c.rancherClient.doCreate(EXTERNAL_STORAGE_POOL_EVENT_TYPE, container, resp) + return resp, err +} + +func (c *ExternalStoragePoolEventClient) Update(existing *ExternalStoragePoolEvent, updates interface{}) (*ExternalStoragePoolEvent, error) { + resp := &ExternalStoragePoolEvent{} + err := c.rancherClient.doUpdate(EXTERNAL_STORAGE_POOL_EVENT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExternalStoragePoolEventClient) List(opts *ListOpts) (*ExternalStoragePoolEventCollection, error) { + resp := &ExternalStoragePoolEventCollection{} + err := c.rancherClient.doList(EXTERNAL_STORAGE_POOL_EVENT_TYPE, opts, resp) + return resp, err +} + +func (c *ExternalStoragePoolEventClient) ById(id string) (*ExternalStoragePoolEvent, error) { + resp := &ExternalStoragePoolEvent{} + err := c.rancherClient.doById(EXTERNAL_STORAGE_POOL_EVENT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExternalStoragePoolEventClient) Delete(container *ExternalStoragePoolEvent) error { + return c.rancherClient.doResourceDelete(EXTERNAL_STORAGE_POOL_EVENT_TYPE, &container.Resource) +} + +func (c *ExternalStoragePoolEventClient) ActionCreate(resource *ExternalStoragePoolEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_STORAGE_POOL_EVENT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalStoragePoolEventClient) ActionRemove(resource *ExternalStoragePoolEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_STORAGE_POOL_EVENT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go new file mode 100644 index 000000000..2c1fae7dc --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go @@ -0,0 +1,113 @@ +package client + +const ( + EXTERNAL_VOLUME_EVENT_TYPE = "externalVolumeEvent" +) + +type ExternalVolumeEvent struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Volume Volume `json:"volume,omitempty" yaml:"volume,omitempty"` +} + +type ExternalVolumeEventCollection struct { + Collection + Data []ExternalVolumeEvent `json:"data,omitempty"` +} + +type ExternalVolumeEventClient struct { + rancherClient *RancherClient +} + +type ExternalVolumeEventOperations interface { + List(opts *ListOpts) (*ExternalVolumeEventCollection, error) + Create(opts *ExternalVolumeEvent) (*ExternalVolumeEvent, error) + Update(existing *ExternalVolumeEvent, updates interface{}) (*ExternalVolumeEvent, error) + ById(id string) (*ExternalVolumeEvent, error) + Delete(container *ExternalVolumeEvent) error + + ActionCreate(*ExternalVolumeEvent) (*ExternalEvent, error) + + ActionRemove(*ExternalVolumeEvent) (*ExternalEvent, error) +} + +func newExternalVolumeEventClient(rancherClient *RancherClient) *ExternalVolumeEventClient { + return &ExternalVolumeEventClient{ + rancherClient: rancherClient, + } +} + +func (c *ExternalVolumeEventClient) Create(container *ExternalVolumeEvent) (*ExternalVolumeEvent, error) { + resp := &ExternalVolumeEvent{} + err := c.rancherClient.doCreate(EXTERNAL_VOLUME_EVENT_TYPE, container, resp) + return resp, err +} + +func (c *ExternalVolumeEventClient) Update(existing *ExternalVolumeEvent, updates interface{}) (*ExternalVolumeEvent, error) { + resp := &ExternalVolumeEvent{} + err := c.rancherClient.doUpdate(EXTERNAL_VOLUME_EVENT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ExternalVolumeEventClient) List(opts *ListOpts) (*ExternalVolumeEventCollection, error) { + resp := &ExternalVolumeEventCollection{} + err := c.rancherClient.doList(EXTERNAL_VOLUME_EVENT_TYPE, opts, resp) + return resp, err +} + +func (c *ExternalVolumeEventClient) ById(id string) (*ExternalVolumeEvent, error) { + resp := &ExternalVolumeEvent{} + err := c.rancherClient.doById(EXTERNAL_VOLUME_EVENT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ExternalVolumeEventClient) Delete(container *ExternalVolumeEvent) error { + return c.rancherClient.doResourceDelete(EXTERNAL_VOLUME_EVENT_TYPE, &container.Resource) +} + +func (c *ExternalVolumeEventClient) ActionCreate(resource *ExternalVolumeEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_VOLUME_EVENT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ExternalVolumeEventClient) ActionRemove(resource *ExternalVolumeEvent) (*ExternalEvent, error) { + + resp := &ExternalEvent{} + + err := c.rancherClient.doAction(EXTERNAL_VOLUME_EVENT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go b/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go new file mode 100644 index 000000000..035ac23fd --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go @@ -0,0 +1,67 @@ +package client + +const ( + FIELD_DOCUMENTATION_TYPE = "fieldDocumentation" +) + +type FieldDocumentation struct { + Resource + + Description string `json:"description,omitempty" yaml:"description,omitempty"` +} + +type FieldDocumentationCollection struct { + Collection + Data []FieldDocumentation `json:"data,omitempty"` +} + +type FieldDocumentationClient struct { + rancherClient *RancherClient +} + +type FieldDocumentationOperations interface { + List(opts *ListOpts) (*FieldDocumentationCollection, error) + Create(opts *FieldDocumentation) (*FieldDocumentation, error) + Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error) + ById(id string) (*FieldDocumentation, error) + Delete(container *FieldDocumentation) error +} + +func newFieldDocumentationClient(rancherClient *RancherClient) *FieldDocumentationClient { + return &FieldDocumentationClient{ + rancherClient: rancherClient, + } +} + +func (c *FieldDocumentationClient) Create(container *FieldDocumentation) (*FieldDocumentation, error) { + resp := &FieldDocumentation{} + err := c.rancherClient.doCreate(FIELD_DOCUMENTATION_TYPE, container, resp) + return resp, err +} + +func (c *FieldDocumentationClient) Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error) { + resp := &FieldDocumentation{} + err := c.rancherClient.doUpdate(FIELD_DOCUMENTATION_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *FieldDocumentationClient) List(opts *ListOpts) (*FieldDocumentationCollection, error) { + resp := &FieldDocumentationCollection{} + err := c.rancherClient.doList(FIELD_DOCUMENTATION_TYPE, opts, resp) + return resp, err +} + +func (c *FieldDocumentationClient) ById(id string) (*FieldDocumentation, error) { + resp := &FieldDocumentation{} + err := c.rancherClient.doById(FIELD_DOCUMENTATION_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *FieldDocumentationClient) Delete(container *FieldDocumentation) error { + return c.rancherClient.doResourceDelete(FIELD_DOCUMENTATION_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_githubconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_githubconfig.go new file mode 100644 index 000000000..cafb43340 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_githubconfig.go @@ -0,0 +1,81 @@ +package client + +const ( + GITHUBCONFIG_TYPE = "githubconfig" +) + +type Githubconfig struct { + Resource + + AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` + + AllowedIdentities []interface{} `json:"allowedIdentities,omitempty" yaml:"allowed_identities,omitempty"` + + ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"` + + ClientSecret string `json:"clientSecret,omitempty" yaml:"client_secret,omitempty"` + + Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` + + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"` +} + +type GithubconfigCollection struct { + Collection + Data []Githubconfig `json:"data,omitempty"` +} + +type GithubconfigClient struct { + rancherClient *RancherClient +} + +type GithubconfigOperations interface { + List(opts *ListOpts) (*GithubconfigCollection, error) + Create(opts *Githubconfig) (*Githubconfig, error) + Update(existing *Githubconfig, updates interface{}) (*Githubconfig, error) + ById(id string) (*Githubconfig, error) + Delete(container *Githubconfig) error +} + +func newGithubconfigClient(rancherClient *RancherClient) *GithubconfigClient { + return &GithubconfigClient{ + rancherClient: rancherClient, + } +} + +func (c *GithubconfigClient) Create(container *Githubconfig) (*Githubconfig, error) { + resp := &Githubconfig{} + err := c.rancherClient.doCreate(GITHUBCONFIG_TYPE, container, resp) + return resp, err +} + +func (c *GithubconfigClient) Update(existing *Githubconfig, updates interface{}) (*Githubconfig, error) { + resp := &Githubconfig{} + err := c.rancherClient.doUpdate(GITHUBCONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *GithubconfigClient) List(opts *ListOpts) (*GithubconfigCollection, error) { + resp := &GithubconfigCollection{} + err := c.rancherClient.doList(GITHUBCONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *GithubconfigClient) ById(id string) (*Githubconfig, error) { + resp := &Githubconfig{} + err := c.rancherClient.doById(GITHUBCONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *GithubconfigClient) Delete(container *Githubconfig) error { + return c.rancherClient.doResourceDelete(GITHUBCONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go new file mode 100644 index 000000000..9b9d14c4a --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go @@ -0,0 +1,73 @@ +package client + +const ( + HA_CONFIG_TYPE = "haConfig" +) + +type HaConfig struct { + Resource + + ClusterSize int64 `json:"clusterSize,omitempty" yaml:"cluster_size,omitempty"` + + DbHost string `json:"dbHost,omitempty" yaml:"db_host,omitempty"` + + DbSize int64 `json:"dbSize,omitempty" yaml:"db_size,omitempty"` + + Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` +} + +type HaConfigCollection struct { + Collection + Data []HaConfig `json:"data,omitempty"` +} + +type HaConfigClient struct { + rancherClient *RancherClient +} + +type HaConfigOperations interface { + List(opts *ListOpts) (*HaConfigCollection, error) + Create(opts *HaConfig) (*HaConfig, error) + Update(existing *HaConfig, updates interface{}) (*HaConfig, error) + ById(id string) (*HaConfig, error) + Delete(container *HaConfig) error +} + +func newHaConfigClient(rancherClient *RancherClient) *HaConfigClient { + return &HaConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *HaConfigClient) Create(container *HaConfig) (*HaConfig, error) { + resp := &HaConfig{} + err := c.rancherClient.doCreate(HA_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *HaConfigClient) Update(existing *HaConfig, updates interface{}) (*HaConfig, error) { + resp := &HaConfig{} + err := c.rancherClient.doUpdate(HA_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *HaConfigClient) List(opts *ListOpts) (*HaConfigCollection, error) { + resp := &HaConfigCollection{} + err := c.rancherClient.doList(HA_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *HaConfigClient) ById(id string) (*HaConfig, error) { + resp := &HaConfig{} + err := c.rancherClient.doById(HA_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *HaConfigClient) Delete(container *HaConfig) error { + return c.rancherClient.doResourceDelete(HA_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go new file mode 100644 index 000000000..fdff3ae1c --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go @@ -0,0 +1,97 @@ +package client + +const ( + HA_CONFIG_INPUT_TYPE = "haConfigInput" +) + +type HaConfigInput struct { + Resource + + Cert string `json:"cert,omitempty" yaml:"cert,omitempty"` + + CertChain string `json:"certChain,omitempty" yaml:"cert_chain,omitempty"` + + ClusterSize int64 `json:"clusterSize,omitempty" yaml:"cluster_size,omitempty"` + + HostRegistrationUrl string `json:"hostRegistrationUrl,omitempty" yaml:"host_registration_url,omitempty"` + + HttpEnabled bool `json:"httpEnabled,omitempty" yaml:"http_enabled,omitempty"` + + HttpPort int64 `json:"httpPort,omitempty" yaml:"http_port,omitempty"` + + HttpsPort int64 `json:"httpsPort,omitempty" yaml:"https_port,omitempty"` + + Key string `json:"key,omitempty" yaml:"key,omitempty"` + + PpHttpPort int64 `json:"ppHttpPort,omitempty" yaml:"pp_http_port,omitempty"` + + PpHttpsPort int64 `json:"ppHttpsPort,omitempty" yaml:"pp_https_port,omitempty"` + + RedisPort int64 `json:"redisPort,omitempty" yaml:"redis_port,omitempty"` + + SwarmEnabled bool `json:"swarmEnabled,omitempty" yaml:"swarm_enabled,omitempty"` + + SwarmPort int64 `json:"swarmPort,omitempty" yaml:"swarm_port,omitempty"` + + ZookeeperClientPort int64 `json:"zookeeperClientPort,omitempty" yaml:"zookeeper_client_port,omitempty"` + + ZookeeperLeaderPort int64 `json:"zookeeperLeaderPort,omitempty" yaml:"zookeeper_leader_port,omitempty"` + + ZookeeperQuorumPort int64 `json:"zookeeperQuorumPort,omitempty" yaml:"zookeeper_quorum_port,omitempty"` +} + +type HaConfigInputCollection struct { + Collection + Data []HaConfigInput `json:"data,omitempty"` +} + +type HaConfigInputClient struct { + rancherClient *RancherClient +} + +type HaConfigInputOperations interface { + List(opts *ListOpts) (*HaConfigInputCollection, error) + Create(opts *HaConfigInput) (*HaConfigInput, error) + Update(existing *HaConfigInput, updates interface{}) (*HaConfigInput, error) + ById(id string) (*HaConfigInput, error) + Delete(container *HaConfigInput) error +} + +func newHaConfigInputClient(rancherClient *RancherClient) *HaConfigInputClient { + return &HaConfigInputClient{ + rancherClient: rancherClient, + } +} + +func (c *HaConfigInputClient) Create(container *HaConfigInput) (*HaConfigInput, error) { + resp := &HaConfigInput{} + err := c.rancherClient.doCreate(HA_CONFIG_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *HaConfigInputClient) Update(existing *HaConfigInput, updates interface{}) (*HaConfigInput, error) { + resp := &HaConfigInput{} + err := c.rancherClient.doUpdate(HA_CONFIG_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *HaConfigInputClient) List(opts *ListOpts) (*HaConfigInputCollection, error) { + resp := &HaConfigInputCollection{} + err := c.rancherClient.doList(HA_CONFIG_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *HaConfigInputClient) ById(id string) (*HaConfigInput, error) { + resp := &HaConfigInput{} + err := c.rancherClient.doById(HA_CONFIG_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *HaConfigInputClient) Delete(container *HaConfigInput) error { + return c.rancherClient.doResourceDelete(HA_CONFIG_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_haproxy_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_haproxy_config.go new file mode 100644 index 000000000..a1e27bcdf --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_haproxy_config.go @@ -0,0 +1,69 @@ +package client + +const ( + HAPROXY_CONFIG_TYPE = "haproxyConfig" +) + +type HaproxyConfig struct { + Resource + + Defaults string `json:"defaults,omitempty" yaml:"defaults,omitempty"` + + Global string `json:"global,omitempty" yaml:"global,omitempty"` +} + +type HaproxyConfigCollection struct { + Collection + Data []HaproxyConfig `json:"data,omitempty"` +} + +type HaproxyConfigClient struct { + rancherClient *RancherClient +} + +type HaproxyConfigOperations interface { + List(opts *ListOpts) (*HaproxyConfigCollection, error) + Create(opts *HaproxyConfig) (*HaproxyConfig, error) + Update(existing *HaproxyConfig, updates interface{}) (*HaproxyConfig, error) + ById(id string) (*HaproxyConfig, error) + Delete(container *HaproxyConfig) error +} + +func newHaproxyConfigClient(rancherClient *RancherClient) *HaproxyConfigClient { + return &HaproxyConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *HaproxyConfigClient) Create(container *HaproxyConfig) (*HaproxyConfig, error) { + resp := &HaproxyConfig{} + err := c.rancherClient.doCreate(HAPROXY_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *HaproxyConfigClient) Update(existing *HaproxyConfig, updates interface{}) (*HaproxyConfig, error) { + resp := &HaproxyConfig{} + err := c.rancherClient.doUpdate(HAPROXY_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *HaproxyConfigClient) List(opts *ListOpts) (*HaproxyConfigCollection, error) { + resp := &HaproxyConfigCollection{} + err := c.rancherClient.doList(HAPROXY_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *HaproxyConfigClient) ById(id string) (*HaproxyConfig, error) { + resp := &HaproxyConfig{} + err := c.rancherClient.doById(HAPROXY_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *HaproxyConfigClient) Delete(container *HaproxyConfig) error { + return c.rancherClient.doResourceDelete(HAPROXY_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go new file mode 100644 index 000000000..6329d2f83 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go @@ -0,0 +1,119 @@ +package client + +const ( + HEALTHCHECK_INSTANCE_HOST_MAP_TYPE = "healthcheckInstanceHostMap" +) + +type HealthcheckInstanceHostMap struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type HealthcheckInstanceHostMapCollection struct { + Collection + Data []HealthcheckInstanceHostMap `json:"data,omitempty"` +} + +type HealthcheckInstanceHostMapClient struct { + rancherClient *RancherClient +} + +type HealthcheckInstanceHostMapOperations interface { + List(opts *ListOpts) (*HealthcheckInstanceHostMapCollection, error) + Create(opts *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) + Update(existing *HealthcheckInstanceHostMap, updates interface{}) (*HealthcheckInstanceHostMap, error) + ById(id string) (*HealthcheckInstanceHostMap, error) + Delete(container *HealthcheckInstanceHostMap) error + + ActionCreate(*HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) + + ActionRemove(*HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) +} + +func newHealthcheckInstanceHostMapClient(rancherClient *RancherClient) *HealthcheckInstanceHostMapClient { + return &HealthcheckInstanceHostMapClient{ + rancherClient: rancherClient, + } +} + +func (c *HealthcheckInstanceHostMapClient) Create(container *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) { + resp := &HealthcheckInstanceHostMap{} + err := c.rancherClient.doCreate(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, container, resp) + return resp, err +} + +func (c *HealthcheckInstanceHostMapClient) Update(existing *HealthcheckInstanceHostMap, updates interface{}) (*HealthcheckInstanceHostMap, error) { + resp := &HealthcheckInstanceHostMap{} + err := c.rancherClient.doUpdate(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *HealthcheckInstanceHostMapClient) List(opts *ListOpts) (*HealthcheckInstanceHostMapCollection, error) { + resp := &HealthcheckInstanceHostMapCollection{} + err := c.rancherClient.doList(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, opts, resp) + return resp, err +} + +func (c *HealthcheckInstanceHostMapClient) ById(id string) (*HealthcheckInstanceHostMap, error) { + resp := &HealthcheckInstanceHostMap{} + err := c.rancherClient.doById(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *HealthcheckInstanceHostMapClient) Delete(container *HealthcheckInstanceHostMap) error { + return c.rancherClient.doResourceDelete(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, &container.Resource) +} + +func (c *HealthcheckInstanceHostMapClient) ActionCreate(resource *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) { + + resp := &HealthcheckInstanceHostMap{} + + err := c.rancherClient.doAction(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HealthcheckInstanceHostMapClient) ActionRemove(resource *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) { + + resp := &HealthcheckInstanceHostMap{} + + err := c.rancherClient.doAction(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host.go b/vendor/github.com/rancher/go-rancher/v2/generated_host.go new file mode 100644 index 000000000..f1ee94368 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_host.go @@ -0,0 +1,197 @@ +package client + +const ( + HOST_TYPE = "host" +) + +type Host struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` + + AgentState string `json:"agentState,omitempty" yaml:"agent_state,omitempty"` + + ApiProxy string `json:"apiProxy,omitempty" yaml:"api_proxy,omitempty"` + + ComputeTotal int64 `json:"computeTotal,omitempty" yaml:"compute_total,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + + Info interface{} `json:"info,omitempty" yaml:"info,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PhysicalHostId string `json:"physicalHostId,omitempty" yaml:"physical_host_id,omitempty"` + + PublicEndpoints []interface{} `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type HostCollection struct { + Collection + Data []Host `json:"data,omitempty"` +} + +type HostClient struct { + rancherClient *RancherClient +} + +type HostOperations interface { + List(opts *ListOpts) (*HostCollection, error) + Create(opts *Host) (*Host, error) + Update(existing *Host, updates interface{}) (*Host, error) + ById(id string) (*Host, error) + Delete(container *Host) error + + ActionActivate(*Host) (*Host, error) + + ActionCreate(*Host) (*Host, error) + + ActionDeactivate(*Host) (*Host, error) + + ActionDockersocket(*Host) (*HostAccess, error) + + ActionPurge(*Host) (*Host, error) + + ActionRemove(*Host) (*Host, error) + + ActionRestore(*Host) (*Host, error) + + ActionUpdate(*Host) (*Host, error) +} + +func newHostClient(rancherClient *RancherClient) *HostClient { + return &HostClient{ + rancherClient: rancherClient, + } +} + +func (c *HostClient) Create(container *Host) (*Host, error) { + resp := &Host{} + err := c.rancherClient.doCreate(HOST_TYPE, container, resp) + return resp, err +} + +func (c *HostClient) Update(existing *Host, updates interface{}) (*Host, error) { + resp := &Host{} + err := c.rancherClient.doUpdate(HOST_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *HostClient) List(opts *ListOpts) (*HostCollection, error) { + resp := &HostCollection{} + err := c.rancherClient.doList(HOST_TYPE, opts, resp) + return resp, err +} + +func (c *HostClient) ById(id string) (*Host, error) { + resp := &Host{} + err := c.rancherClient.doById(HOST_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *HostClient) Delete(container *Host) error { + return c.rancherClient.doResourceDelete(HOST_TYPE, &container.Resource) +} + +func (c *HostClient) ActionActivate(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HostClient) ActionCreate(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HostClient) ActionDeactivate(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HostClient) ActionDockersocket(resource *Host) (*HostAccess, error) { + + resp := &HostAccess{} + + err := c.rancherClient.doAction(HOST_TYPE, "dockersocket", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HostClient) ActionPurge(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HostClient) ActionRemove(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HostClient) ActionRestore(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HostClient) ActionUpdate(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go new file mode 100644 index 000000000..ee4ab3992 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go @@ -0,0 +1,69 @@ +package client + +const ( + HOST_ACCESS_TYPE = "hostAccess" +) + +type HostAccess struct { + Resource + + Token string `json:"token,omitempty" yaml:"token,omitempty"` + + Url string `json:"url,omitempty" yaml:"url,omitempty"` +} + +type HostAccessCollection struct { + Collection + Data []HostAccess `json:"data,omitempty"` +} + +type HostAccessClient struct { + rancherClient *RancherClient +} + +type HostAccessOperations interface { + List(opts *ListOpts) (*HostAccessCollection, error) + Create(opts *HostAccess) (*HostAccess, error) + Update(existing *HostAccess, updates interface{}) (*HostAccess, error) + ById(id string) (*HostAccess, error) + Delete(container *HostAccess) error +} + +func newHostAccessClient(rancherClient *RancherClient) *HostAccessClient { + return &HostAccessClient{ + rancherClient: rancherClient, + } +} + +func (c *HostAccessClient) Create(container *HostAccess) (*HostAccess, error) { + resp := &HostAccess{} + err := c.rancherClient.doCreate(HOST_ACCESS_TYPE, container, resp) + return resp, err +} + +func (c *HostAccessClient) Update(existing *HostAccess, updates interface{}) (*HostAccess, error) { + resp := &HostAccess{} + err := c.rancherClient.doUpdate(HOST_ACCESS_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *HostAccessClient) List(opts *ListOpts) (*HostAccessCollection, error) { + resp := &HostAccessCollection{} + err := c.rancherClient.doList(HOST_ACCESS_TYPE, opts, resp) + return resp, err +} + +func (c *HostAccessClient) ById(id string) (*HostAccess, error) { + resp := &HostAccess{} + err := c.rancherClient.doById(HOST_ACCESS_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *HostAccessClient) Delete(container *HostAccess) error { + return c.rancherClient.doResourceDelete(HOST_ACCESS_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go new file mode 100644 index 000000000..e4c508a2f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go @@ -0,0 +1,71 @@ +package client + +const ( + HOST_API_PROXY_TOKEN_TYPE = "hostApiProxyToken" +) + +type HostApiProxyToken struct { + Resource + + ReportedUuid string `json:"reportedUuid,omitempty" yaml:"reported_uuid,omitempty"` + + Token string `json:"token,omitempty" yaml:"token,omitempty"` + + Url string `json:"url,omitempty" yaml:"url,omitempty"` +} + +type HostApiProxyTokenCollection struct { + Collection + Data []HostApiProxyToken `json:"data,omitempty"` +} + +type HostApiProxyTokenClient struct { + rancherClient *RancherClient +} + +type HostApiProxyTokenOperations interface { + List(opts *ListOpts) (*HostApiProxyTokenCollection, error) + Create(opts *HostApiProxyToken) (*HostApiProxyToken, error) + Update(existing *HostApiProxyToken, updates interface{}) (*HostApiProxyToken, error) + ById(id string) (*HostApiProxyToken, error) + Delete(container *HostApiProxyToken) error +} + +func newHostApiProxyTokenClient(rancherClient *RancherClient) *HostApiProxyTokenClient { + return &HostApiProxyTokenClient{ + rancherClient: rancherClient, + } +} + +func (c *HostApiProxyTokenClient) Create(container *HostApiProxyToken) (*HostApiProxyToken, error) { + resp := &HostApiProxyToken{} + err := c.rancherClient.doCreate(HOST_API_PROXY_TOKEN_TYPE, container, resp) + return resp, err +} + +func (c *HostApiProxyTokenClient) Update(existing *HostApiProxyToken, updates interface{}) (*HostApiProxyToken, error) { + resp := &HostApiProxyToken{} + err := c.rancherClient.doUpdate(HOST_API_PROXY_TOKEN_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *HostApiProxyTokenClient) List(opts *ListOpts) (*HostApiProxyTokenCollection, error) { + resp := &HostApiProxyTokenCollection{} + err := c.rancherClient.doList(HOST_API_PROXY_TOKEN_TYPE, opts, resp) + return resp, err +} + +func (c *HostApiProxyTokenClient) ById(id string) (*HostApiProxyToken, error) { + resp := &HostApiProxyToken{} + err := c.rancherClient.doById(HOST_API_PROXY_TOKEN_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *HostApiProxyTokenClient) Delete(container *HostApiProxyToken) error { + return c.rancherClient.doResourceDelete(HOST_API_PROXY_TOKEN_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_identity.go b/vendor/github.com/rancher/go-rancher/v2/generated_identity.go new file mode 100644 index 000000000..f78f7c765 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_identity.go @@ -0,0 +1,83 @@ +package client + +const ( + IDENTITY_TYPE = "identity" +) + +type Identity struct { + Resource + + All string `json:"all,omitempty" yaml:"all,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + ExternalIdType string `json:"externalIdType,omitempty" yaml:"external_id_type,omitempty"` + + Login string `json:"login,omitempty" yaml:"login,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + ProfilePicture string `json:"profilePicture,omitempty" yaml:"profile_picture,omitempty"` + + ProfileUrl string `json:"profileUrl,omitempty" yaml:"profile_url,omitempty"` + + ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"` + + Role string `json:"role,omitempty" yaml:"role,omitempty"` +} + +type IdentityCollection struct { + Collection + Data []Identity `json:"data,omitempty"` +} + +type IdentityClient struct { + rancherClient *RancherClient +} + +type IdentityOperations interface { + List(opts *ListOpts) (*IdentityCollection, error) + Create(opts *Identity) (*Identity, error) + Update(existing *Identity, updates interface{}) (*Identity, error) + ById(id string) (*Identity, error) + Delete(container *Identity) error +} + +func newIdentityClient(rancherClient *RancherClient) *IdentityClient { + return &IdentityClient{ + rancherClient: rancherClient, + } +} + +func (c *IdentityClient) Create(container *Identity) (*Identity, error) { + resp := &Identity{} + err := c.rancherClient.doCreate(IDENTITY_TYPE, container, resp) + return resp, err +} + +func (c *IdentityClient) Update(existing *Identity, updates interface{}) (*Identity, error) { + resp := &Identity{} + err := c.rancherClient.doUpdate(IDENTITY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *IdentityClient) List(opts *ListOpts) (*IdentityCollection, error) { + resp := &IdentityCollection{} + err := c.rancherClient.doList(IDENTITY_TYPE, opts, resp) + return resp, err +} + +func (c *IdentityClient) ById(id string) (*Identity, error) { + resp := &Identity{} + err := c.rancherClient.doById(IDENTITY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *IdentityClient) Delete(container *Identity) error { + return c.rancherClient.doResourceDelete(IDENTITY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_image.go b/vendor/github.com/rancher/go-rancher/v2/generated_image.go new file mode 100644 index 000000000..84d1d0ffc --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_image.go @@ -0,0 +1,168 @@ +package client + +const ( + IMAGE_TYPE = "image" +) + +type Image struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ImageCollection struct { + Collection + Data []Image `json:"data,omitempty"` +} + +type ImageClient struct { + rancherClient *RancherClient +} + +type ImageOperations interface { + List(opts *ListOpts) (*ImageCollection, error) + Create(opts *Image) (*Image, error) + Update(existing *Image, updates interface{}) (*Image, error) + ById(id string) (*Image, error) + Delete(container *Image) error + + ActionActivate(*Image) (*Image, error) + + ActionCreate(*Image) (*Image, error) + + ActionDeactivate(*Image) (*Image, error) + + ActionPurge(*Image) (*Image, error) + + ActionRemove(*Image) (*Image, error) + + ActionRestore(*Image) (*Image, error) + + ActionUpdate(*Image) (*Image, error) +} + +func newImageClient(rancherClient *RancherClient) *ImageClient { + return &ImageClient{ + rancherClient: rancherClient, + } +} + +func (c *ImageClient) Create(container *Image) (*Image, error) { + resp := &Image{} + err := c.rancherClient.doCreate(IMAGE_TYPE, container, resp) + return resp, err +} + +func (c *ImageClient) Update(existing *Image, updates interface{}) (*Image, error) { + resp := &Image{} + err := c.rancherClient.doUpdate(IMAGE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ImageClient) List(opts *ListOpts) (*ImageCollection, error) { + resp := &ImageCollection{} + err := c.rancherClient.doList(IMAGE_TYPE, opts, resp) + return resp, err +} + +func (c *ImageClient) ById(id string) (*Image, error) { + resp := &Image{} + err := c.rancherClient.doById(IMAGE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ImageClient) Delete(container *Image) error { + return c.rancherClient.doResourceDelete(IMAGE_TYPE, &container.Resource) +} + +func (c *ImageClient) ActionActivate(resource *Image) (*Image, error) { + + resp := &Image{} + + err := c.rancherClient.doAction(IMAGE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ImageClient) ActionCreate(resource *Image) (*Image, error) { + + resp := &Image{} + + err := c.rancherClient.doAction(IMAGE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ImageClient) ActionDeactivate(resource *Image) (*Image, error) { + + resp := &Image{} + + err := c.rancherClient.doAction(IMAGE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ImageClient) ActionPurge(resource *Image) (*Image, error) { + + resp := &Image{} + + err := c.rancherClient.doAction(IMAGE_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ImageClient) ActionRemove(resource *Image) (*Image, error) { + + resp := &Image{} + + err := c.rancherClient.doAction(IMAGE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ImageClient) ActionRestore(resource *Image) (*Image, error) { + + resp := &Image{} + + err := c.rancherClient.doAction(IMAGE_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ImageClient) ActionUpdate(resource *Image) (*Image, error) { + + resp := &Image{} + + err := c.rancherClient.doAction(IMAGE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go new file mode 100644 index 000000000..a92885793 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go @@ -0,0 +1,79 @@ +package client + +const ( + IN_SERVICE_UPGRADE_STRATEGY_TYPE = "inServiceUpgradeStrategy" +) + +type InServiceUpgradeStrategy struct { + Resource + + BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` + + IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` + + LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + + PreviousLaunchConfig *LaunchConfig `json:"previousLaunchConfig,omitempty" yaml:"previous_launch_config,omitempty"` + + PreviousSecondaryLaunchConfigs []interface{} `json:"previousSecondaryLaunchConfigs,omitempty" yaml:"previous_secondary_launch_configs,omitempty"` + + SecondaryLaunchConfigs []interface{} `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` + + StartFirst bool `json:"startFirst,omitempty" yaml:"start_first,omitempty"` +} + +type InServiceUpgradeStrategyCollection struct { + Collection + Data []InServiceUpgradeStrategy `json:"data,omitempty"` +} + +type InServiceUpgradeStrategyClient struct { + rancherClient *RancherClient +} + +type InServiceUpgradeStrategyOperations interface { + List(opts *ListOpts) (*InServiceUpgradeStrategyCollection, error) + Create(opts *InServiceUpgradeStrategy) (*InServiceUpgradeStrategy, error) + Update(existing *InServiceUpgradeStrategy, updates interface{}) (*InServiceUpgradeStrategy, error) + ById(id string) (*InServiceUpgradeStrategy, error) + Delete(container *InServiceUpgradeStrategy) error +} + +func newInServiceUpgradeStrategyClient(rancherClient *RancherClient) *InServiceUpgradeStrategyClient { + return &InServiceUpgradeStrategyClient{ + rancherClient: rancherClient, + } +} + +func (c *InServiceUpgradeStrategyClient) Create(container *InServiceUpgradeStrategy) (*InServiceUpgradeStrategy, error) { + resp := &InServiceUpgradeStrategy{} + err := c.rancherClient.doCreate(IN_SERVICE_UPGRADE_STRATEGY_TYPE, container, resp) + return resp, err +} + +func (c *InServiceUpgradeStrategyClient) Update(existing *InServiceUpgradeStrategy, updates interface{}) (*InServiceUpgradeStrategy, error) { + resp := &InServiceUpgradeStrategy{} + err := c.rancherClient.doUpdate(IN_SERVICE_UPGRADE_STRATEGY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *InServiceUpgradeStrategyClient) List(opts *ListOpts) (*InServiceUpgradeStrategyCollection, error) { + resp := &InServiceUpgradeStrategyCollection{} + err := c.rancherClient.doList(IN_SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) + return resp, err +} + +func (c *InServiceUpgradeStrategyClient) ById(id string) (*InServiceUpgradeStrategy, error) { + resp := &InServiceUpgradeStrategy{} + err := c.rancherClient.doById(IN_SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *InServiceUpgradeStrategyClient) Delete(container *InServiceUpgradeStrategy) error { + return c.rancherClient.doResourceDelete(IN_SERVICE_UPGRADE_STRATEGY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance.go new file mode 100644 index 000000000..f43f6bd57 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance.go @@ -0,0 +1,271 @@ +package client + +const ( + INSTANCE_TYPE = "instance" +) + +type Instance struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type InstanceCollection struct { + Collection + Data []Instance `json:"data,omitempty"` +} + +type InstanceClient struct { + rancherClient *RancherClient +} + +type InstanceOperations interface { + List(opts *ListOpts) (*InstanceCollection, error) + Create(opts *Instance) (*Instance, error) + Update(existing *Instance, updates interface{}) (*Instance, error) + ById(id string) (*Instance, error) + Delete(container *Instance) error + + ActionAllocate(*Instance) (*Instance, error) + + ActionConsole(*Instance, *InstanceConsoleInput) (*InstanceConsole, error) + + ActionCreate(*Instance) (*Instance, error) + + ActionDeallocate(*Instance) (*Instance, error) + + ActionError(*Instance) (*Instance, error) + + ActionMigrate(*Instance) (*Instance, error) + + ActionPurge(*Instance) (*Instance, error) + + ActionRemove(*Instance) (*Instance, error) + + ActionRestart(*Instance) (*Instance, error) + + ActionRestore(*Instance) (*Instance, error) + + ActionStart(*Instance) (*Instance, error) + + ActionStop(*Instance, *InstanceStop) (*Instance, error) + + ActionUpdate(*Instance) (*Instance, error) + + ActionUpdatehealthy(*Instance) (*Instance, error) + + ActionUpdatereinitializing(*Instance) (*Instance, error) + + ActionUpdateunhealthy(*Instance) (*Instance, error) +} + +func newInstanceClient(rancherClient *RancherClient) *InstanceClient { + return &InstanceClient{ + rancherClient: rancherClient, + } +} + +func (c *InstanceClient) Create(container *Instance) (*Instance, error) { + resp := &Instance{} + err := c.rancherClient.doCreate(INSTANCE_TYPE, container, resp) + return resp, err +} + +func (c *InstanceClient) Update(existing *Instance, updates interface{}) (*Instance, error) { + resp := &Instance{} + err := c.rancherClient.doUpdate(INSTANCE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *InstanceClient) List(opts *ListOpts) (*InstanceCollection, error) { + resp := &InstanceCollection{} + err := c.rancherClient.doList(INSTANCE_TYPE, opts, resp) + return resp, err +} + +func (c *InstanceClient) ById(id string) (*Instance, error) { + resp := &Instance{} + err := c.rancherClient.doById(INSTANCE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *InstanceClient) Delete(container *Instance) error { + return c.rancherClient.doResourceDelete(INSTANCE_TYPE, &container.Resource) +} + +func (c *InstanceClient) ActionAllocate(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "allocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionConsole(resource *Instance, input *InstanceConsoleInput) (*InstanceConsole, error) { + + resp := &InstanceConsole{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "console", &resource.Resource, input, resp) + + return resp, err +} + +func (c *InstanceClient) ActionCreate(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionDeallocate(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "deallocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionError(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionMigrate(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "migrate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionPurge(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionRemove(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionRestart(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "restart", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionRestore(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionStart(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "start", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionStop(resource *Instance, input *InstanceStop) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "stop", &resource.Resource, input, resp) + + return resp, err +} + +func (c *InstanceClient) ActionUpdate(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionUpdatehealthy(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "updatehealthy", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionUpdatereinitializing(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "updatereinitializing", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceClient) ActionUpdateunhealthy(resource *Instance) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(INSTANCE_TYPE, "updateunhealthy", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go new file mode 100644 index 000000000..bf38cb4c1 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go @@ -0,0 +1,71 @@ +package client + +const ( + INSTANCE_CONSOLE_TYPE = "instanceConsole" +) + +type InstanceConsole struct { + Resource + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Password string `json:"password,omitempty" yaml:"password,omitempty"` + + Url string `json:"url,omitempty" yaml:"url,omitempty"` +} + +type InstanceConsoleCollection struct { + Collection + Data []InstanceConsole `json:"data,omitempty"` +} + +type InstanceConsoleClient struct { + rancherClient *RancherClient +} + +type InstanceConsoleOperations interface { + List(opts *ListOpts) (*InstanceConsoleCollection, error) + Create(opts *InstanceConsole) (*InstanceConsole, error) + Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error) + ById(id string) (*InstanceConsole, error) + Delete(container *InstanceConsole) error +} + +func newInstanceConsoleClient(rancherClient *RancherClient) *InstanceConsoleClient { + return &InstanceConsoleClient{ + rancherClient: rancherClient, + } +} + +func (c *InstanceConsoleClient) Create(container *InstanceConsole) (*InstanceConsole, error) { + resp := &InstanceConsole{} + err := c.rancherClient.doCreate(INSTANCE_CONSOLE_TYPE, container, resp) + return resp, err +} + +func (c *InstanceConsoleClient) Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error) { + resp := &InstanceConsole{} + err := c.rancherClient.doUpdate(INSTANCE_CONSOLE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *InstanceConsoleClient) List(opts *ListOpts) (*InstanceConsoleCollection, error) { + resp := &InstanceConsoleCollection{} + err := c.rancherClient.doList(INSTANCE_CONSOLE_TYPE, opts, resp) + return resp, err +} + +func (c *InstanceConsoleClient) ById(id string) (*InstanceConsole, error) { + resp := &InstanceConsole{} + err := c.rancherClient.doById(INSTANCE_CONSOLE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *InstanceConsoleClient) Delete(container *InstanceConsole) error { + return c.rancherClient.doResourceDelete(INSTANCE_CONSOLE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go new file mode 100644 index 000000000..11a126f79 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go @@ -0,0 +1,65 @@ +package client + +const ( + INSTANCE_CONSOLE_INPUT_TYPE = "instanceConsoleInput" +) + +type InstanceConsoleInput struct { + Resource +} + +type InstanceConsoleInputCollection struct { + Collection + Data []InstanceConsoleInput `json:"data,omitempty"` +} + +type InstanceConsoleInputClient struct { + rancherClient *RancherClient +} + +type InstanceConsoleInputOperations interface { + List(opts *ListOpts) (*InstanceConsoleInputCollection, error) + Create(opts *InstanceConsoleInput) (*InstanceConsoleInput, error) + Update(existing *InstanceConsoleInput, updates interface{}) (*InstanceConsoleInput, error) + ById(id string) (*InstanceConsoleInput, error) + Delete(container *InstanceConsoleInput) error +} + +func newInstanceConsoleInputClient(rancherClient *RancherClient) *InstanceConsoleInputClient { + return &InstanceConsoleInputClient{ + rancherClient: rancherClient, + } +} + +func (c *InstanceConsoleInputClient) Create(container *InstanceConsoleInput) (*InstanceConsoleInput, error) { + resp := &InstanceConsoleInput{} + err := c.rancherClient.doCreate(INSTANCE_CONSOLE_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *InstanceConsoleInputClient) Update(existing *InstanceConsoleInput, updates interface{}) (*InstanceConsoleInput, error) { + resp := &InstanceConsoleInput{} + err := c.rancherClient.doUpdate(INSTANCE_CONSOLE_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *InstanceConsoleInputClient) List(opts *ListOpts) (*InstanceConsoleInputCollection, error) { + resp := &InstanceConsoleInputCollection{} + err := c.rancherClient.doList(INSTANCE_CONSOLE_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *InstanceConsoleInputClient) ById(id string) (*InstanceConsoleInput, error) { + resp := &InstanceConsoleInput{} + err := c.rancherClient.doById(INSTANCE_CONSOLE_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *InstanceConsoleInputClient) Delete(container *InstanceConsoleInput) error { + return c.rancherClient.doResourceDelete(INSTANCE_CONSOLE_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go new file mode 100644 index 000000000..305798bf8 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go @@ -0,0 +1,87 @@ +package client + +const ( + INSTANCE_HEALTH_CHECK_TYPE = "instanceHealthCheck" +) + +type InstanceHealthCheck struct { + Resource + + HealthyThreshold int64 `json:"healthyThreshold,omitempty" yaml:"healthy_threshold,omitempty"` + + InitializingTimeout int64 `json:"initializingTimeout,omitempty" yaml:"initializing_timeout,omitempty"` + + Interval int64 `json:"interval,omitempty" yaml:"interval,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Port int64 `json:"port,omitempty" yaml:"port,omitempty"` + + RecreateOnQuorumStrategyConfig *RecreateOnQuorumStrategyConfig `json:"recreateOnQuorumStrategyConfig,omitempty" yaml:"recreate_on_quorum_strategy_config,omitempty"` + + ReinitializingTimeout int64 `json:"reinitializingTimeout,omitempty" yaml:"reinitializing_timeout,omitempty"` + + RequestLine string `json:"requestLine,omitempty" yaml:"request_line,omitempty"` + + ResponseTimeout int64 `json:"responseTimeout,omitempty" yaml:"response_timeout,omitempty"` + + Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"` + + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty" yaml:"unhealthy_threshold,omitempty"` +} + +type InstanceHealthCheckCollection struct { + Collection + Data []InstanceHealthCheck `json:"data,omitempty"` +} + +type InstanceHealthCheckClient struct { + rancherClient *RancherClient +} + +type InstanceHealthCheckOperations interface { + List(opts *ListOpts) (*InstanceHealthCheckCollection, error) + Create(opts *InstanceHealthCheck) (*InstanceHealthCheck, error) + Update(existing *InstanceHealthCheck, updates interface{}) (*InstanceHealthCheck, error) + ById(id string) (*InstanceHealthCheck, error) + Delete(container *InstanceHealthCheck) error +} + +func newInstanceHealthCheckClient(rancherClient *RancherClient) *InstanceHealthCheckClient { + return &InstanceHealthCheckClient{ + rancherClient: rancherClient, + } +} + +func (c *InstanceHealthCheckClient) Create(container *InstanceHealthCheck) (*InstanceHealthCheck, error) { + resp := &InstanceHealthCheck{} + err := c.rancherClient.doCreate(INSTANCE_HEALTH_CHECK_TYPE, container, resp) + return resp, err +} + +func (c *InstanceHealthCheckClient) Update(existing *InstanceHealthCheck, updates interface{}) (*InstanceHealthCheck, error) { + resp := &InstanceHealthCheck{} + err := c.rancherClient.doUpdate(INSTANCE_HEALTH_CHECK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *InstanceHealthCheckClient) List(opts *ListOpts) (*InstanceHealthCheckCollection, error) { + resp := &InstanceHealthCheckCollection{} + err := c.rancherClient.doList(INSTANCE_HEALTH_CHECK_TYPE, opts, resp) + return resp, err +} + +func (c *InstanceHealthCheckClient) ById(id string) (*InstanceHealthCheck, error) { + resp := &InstanceHealthCheck{} + err := c.rancherClient.doById(INSTANCE_HEALTH_CHECK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *InstanceHealthCheckClient) Delete(container *InstanceHealthCheck) error { + return c.rancherClient.doResourceDelete(INSTANCE_HEALTH_CHECK_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go new file mode 100644 index 000000000..5e7146514 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go @@ -0,0 +1,176 @@ +package client + +const ( + INSTANCE_LINK_TYPE = "instanceLink" +) + +type InstanceLink struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + LinkName string `json:"linkName,omitempty" yaml:"link_name,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Ports []interface{} `json:"ports,omitempty" yaml:"ports,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + TargetInstanceId string `json:"targetInstanceId,omitempty" yaml:"target_instance_id,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type InstanceLinkCollection struct { + Collection + Data []InstanceLink `json:"data,omitempty"` +} + +type InstanceLinkClient struct { + rancherClient *RancherClient +} + +type InstanceLinkOperations interface { + List(opts *ListOpts) (*InstanceLinkCollection, error) + Create(opts *InstanceLink) (*InstanceLink, error) + Update(existing *InstanceLink, updates interface{}) (*InstanceLink, error) + ById(id string) (*InstanceLink, error) + Delete(container *InstanceLink) error + + ActionActivate(*InstanceLink) (*InstanceLink, error) + + ActionCreate(*InstanceLink) (*InstanceLink, error) + + ActionDeactivate(*InstanceLink) (*InstanceLink, error) + + ActionPurge(*InstanceLink) (*InstanceLink, error) + + ActionRemove(*InstanceLink) (*InstanceLink, error) + + ActionRestore(*InstanceLink) (*InstanceLink, error) + + ActionUpdate(*InstanceLink) (*InstanceLink, error) +} + +func newInstanceLinkClient(rancherClient *RancherClient) *InstanceLinkClient { + return &InstanceLinkClient{ + rancherClient: rancherClient, + } +} + +func (c *InstanceLinkClient) Create(container *InstanceLink) (*InstanceLink, error) { + resp := &InstanceLink{} + err := c.rancherClient.doCreate(INSTANCE_LINK_TYPE, container, resp) + return resp, err +} + +func (c *InstanceLinkClient) Update(existing *InstanceLink, updates interface{}) (*InstanceLink, error) { + resp := &InstanceLink{} + err := c.rancherClient.doUpdate(INSTANCE_LINK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *InstanceLinkClient) List(opts *ListOpts) (*InstanceLinkCollection, error) { + resp := &InstanceLinkCollection{} + err := c.rancherClient.doList(INSTANCE_LINK_TYPE, opts, resp) + return resp, err +} + +func (c *InstanceLinkClient) ById(id string) (*InstanceLink, error) { + resp := &InstanceLink{} + err := c.rancherClient.doById(INSTANCE_LINK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *InstanceLinkClient) Delete(container *InstanceLink) error { + return c.rancherClient.doResourceDelete(INSTANCE_LINK_TYPE, &container.Resource) +} + +func (c *InstanceLinkClient) ActionActivate(resource *InstanceLink) (*InstanceLink, error) { + + resp := &InstanceLink{} + + err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceLinkClient) ActionCreate(resource *InstanceLink) (*InstanceLink, error) { + + resp := &InstanceLink{} + + err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceLinkClient) ActionDeactivate(resource *InstanceLink) (*InstanceLink, error) { + + resp := &InstanceLink{} + + err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceLinkClient) ActionPurge(resource *InstanceLink) (*InstanceLink, error) { + + resp := &InstanceLink{} + + err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceLinkClient) ActionRemove(resource *InstanceLink) (*InstanceLink, error) { + + resp := &InstanceLink{} + + err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceLinkClient) ActionRestore(resource *InstanceLink) (*InstanceLink, error) { + + resp := &InstanceLink{} + + err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *InstanceLinkClient) ActionUpdate(resource *InstanceLink) (*InstanceLink, error) { + + resp := &InstanceLink{} + + err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go new file mode 100644 index 000000000..d034bd615 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go @@ -0,0 +1,69 @@ +package client + +const ( + INSTANCE_STOP_TYPE = "instanceStop" +) + +type InstanceStop struct { + Resource + + Remove bool `json:"remove,omitempty" yaml:"remove,omitempty"` + + Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` +} + +type InstanceStopCollection struct { + Collection + Data []InstanceStop `json:"data,omitempty"` +} + +type InstanceStopClient struct { + rancherClient *RancherClient +} + +type InstanceStopOperations interface { + List(opts *ListOpts) (*InstanceStopCollection, error) + Create(opts *InstanceStop) (*InstanceStop, error) + Update(existing *InstanceStop, updates interface{}) (*InstanceStop, error) + ById(id string) (*InstanceStop, error) + Delete(container *InstanceStop) error +} + +func newInstanceStopClient(rancherClient *RancherClient) *InstanceStopClient { + return &InstanceStopClient{ + rancherClient: rancherClient, + } +} + +func (c *InstanceStopClient) Create(container *InstanceStop) (*InstanceStop, error) { + resp := &InstanceStop{} + err := c.rancherClient.doCreate(INSTANCE_STOP_TYPE, container, resp) + return resp, err +} + +func (c *InstanceStopClient) Update(existing *InstanceStop, updates interface{}) (*InstanceStop, error) { + resp := &InstanceStop{} + err := c.rancherClient.doUpdate(INSTANCE_STOP_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *InstanceStopClient) List(opts *ListOpts) (*InstanceStopCollection, error) { + resp := &InstanceStopCollection{} + err := c.rancherClient.doList(INSTANCE_STOP_TYPE, opts, resp) + return resp, err +} + +func (c *InstanceStopClient) ById(id string) (*InstanceStop, error) { + resp := &InstanceStop{} + err := c.rancherClient.doById(INSTANCE_STOP_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *InstanceStopClient) Delete(container *InstanceStop) error { + return c.rancherClient.doResourceDelete(INSTANCE_STOP_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go b/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go new file mode 100644 index 000000000..ba7a0f39a --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go @@ -0,0 +1,183 @@ +package client + +const ( + IP_ADDRESS_TYPE = "ipAddress" +) + +type IpAddress struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Address string `json:"address,omitempty" yaml:"address,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + NetworkId string `json:"networkId,omitempty" yaml:"network_id,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type IpAddressCollection struct { + Collection + Data []IpAddress `json:"data,omitempty"` +} + +type IpAddressClient struct { + rancherClient *RancherClient +} + +type IpAddressOperations interface { + List(opts *ListOpts) (*IpAddressCollection, error) + Create(opts *IpAddress) (*IpAddress, error) + Update(existing *IpAddress, updates interface{}) (*IpAddress, error) + ById(id string) (*IpAddress, error) + Delete(container *IpAddress) error + + ActionActivate(*IpAddress) (*IpAddress, error) + + ActionCreate(*IpAddress) (*IpAddress, error) + + ActionDeactivate(*IpAddress) (*IpAddress, error) + + ActionDisassociate(*IpAddress) (*IpAddress, error) + + ActionPurge(*IpAddress) (*IpAddress, error) + + ActionRemove(*IpAddress) (*IpAddress, error) + + ActionRestore(*IpAddress) (*IpAddress, error) + + ActionUpdate(*IpAddress) (*IpAddress, error) +} + +func newIpAddressClient(rancherClient *RancherClient) *IpAddressClient { + return &IpAddressClient{ + rancherClient: rancherClient, + } +} + +func (c *IpAddressClient) Create(container *IpAddress) (*IpAddress, error) { + resp := &IpAddress{} + err := c.rancherClient.doCreate(IP_ADDRESS_TYPE, container, resp) + return resp, err +} + +func (c *IpAddressClient) Update(existing *IpAddress, updates interface{}) (*IpAddress, error) { + resp := &IpAddress{} + err := c.rancherClient.doUpdate(IP_ADDRESS_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *IpAddressClient) List(opts *ListOpts) (*IpAddressCollection, error) { + resp := &IpAddressCollection{} + err := c.rancherClient.doList(IP_ADDRESS_TYPE, opts, resp) + return resp, err +} + +func (c *IpAddressClient) ById(id string) (*IpAddress, error) { + resp := &IpAddress{} + err := c.rancherClient.doById(IP_ADDRESS_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *IpAddressClient) Delete(container *IpAddress) error { + return c.rancherClient.doResourceDelete(IP_ADDRESS_TYPE, &container.Resource) +} + +func (c *IpAddressClient) ActionActivate(resource *IpAddress) (*IpAddress, error) { + + resp := &IpAddress{} + + err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *IpAddressClient) ActionCreate(resource *IpAddress) (*IpAddress, error) { + + resp := &IpAddress{} + + err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *IpAddressClient) ActionDeactivate(resource *IpAddress) (*IpAddress, error) { + + resp := &IpAddress{} + + err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *IpAddressClient) ActionDisassociate(resource *IpAddress) (*IpAddress, error) { + + resp := &IpAddress{} + + err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "disassociate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *IpAddressClient) ActionPurge(resource *IpAddress) (*IpAddress, error) { + + resp := &IpAddress{} + + err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *IpAddressClient) ActionRemove(resource *IpAddress) (*IpAddress, error) { + + resp := &IpAddress{} + + err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *IpAddressClient) ActionRestore(resource *IpAddress) (*IpAddress, error) { + + resp := &IpAddress{} + + err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *IpAddressClient) ActionUpdate(resource *IpAddress) (*IpAddress, error) { + + resp := &IpAddress{} + + err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ip_address_associate_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_ip_address_associate_input.go new file mode 100644 index 000000000..2184ae9a4 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ip_address_associate_input.go @@ -0,0 +1,67 @@ +package client + +const ( + IP_ADDRESS_ASSOCIATE_INPUT_TYPE = "ipAddressAssociateInput" +) + +type IpAddressAssociateInput struct { + Resource + + IpAddressId string `json:"ipAddressId,omitempty" yaml:"ip_address_id,omitempty"` +} + +type IpAddressAssociateInputCollection struct { + Collection + Data []IpAddressAssociateInput `json:"data,omitempty"` +} + +type IpAddressAssociateInputClient struct { + rancherClient *RancherClient +} + +type IpAddressAssociateInputOperations interface { + List(opts *ListOpts) (*IpAddressAssociateInputCollection, error) + Create(opts *IpAddressAssociateInput) (*IpAddressAssociateInput, error) + Update(existing *IpAddressAssociateInput, updates interface{}) (*IpAddressAssociateInput, error) + ById(id string) (*IpAddressAssociateInput, error) + Delete(container *IpAddressAssociateInput) error +} + +func newIpAddressAssociateInputClient(rancherClient *RancherClient) *IpAddressAssociateInputClient { + return &IpAddressAssociateInputClient{ + rancherClient: rancherClient, + } +} + +func (c *IpAddressAssociateInputClient) Create(container *IpAddressAssociateInput) (*IpAddressAssociateInput, error) { + resp := &IpAddressAssociateInput{} + err := c.rancherClient.doCreate(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *IpAddressAssociateInputClient) Update(existing *IpAddressAssociateInput, updates interface{}) (*IpAddressAssociateInput, error) { + resp := &IpAddressAssociateInput{} + err := c.rancherClient.doUpdate(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *IpAddressAssociateInputClient) List(opts *ListOpts) (*IpAddressAssociateInputCollection, error) { + resp := &IpAddressAssociateInputCollection{} + err := c.rancherClient.doList(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *IpAddressAssociateInputClient) ById(id string) (*IpAddressAssociateInput, error) { + resp := &IpAddressAssociateInput{} + err := c.rancherClient.doById(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *IpAddressAssociateInputClient) Delete(container *IpAddressAssociateInput) error { + return c.rancherClient.doResourceDelete(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go new file mode 100644 index 000000000..a5e63475c --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go @@ -0,0 +1,257 @@ +package client + +const ( + KUBERNETES_SERVICE_TYPE = "kubernetesService" +) + +type KubernetesService struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Template interface{} `json:"template,omitempty" yaml:"template,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` +} + +type KubernetesServiceCollection struct { + Collection + Data []KubernetesService `json:"data,omitempty"` +} + +type KubernetesServiceClient struct { + rancherClient *RancherClient +} + +type KubernetesServiceOperations interface { + List(opts *ListOpts) (*KubernetesServiceCollection, error) + Create(opts *KubernetesService) (*KubernetesService, error) + Update(existing *KubernetesService, updates interface{}) (*KubernetesService, error) + ById(id string) (*KubernetesService, error) + Delete(container *KubernetesService) error + + ActionActivate(*KubernetesService) (*Service, error) + + ActionAddservicelink(*KubernetesService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionCancelupgrade(*KubernetesService) (*Service, error) + + ActionContinueupgrade(*KubernetesService) (*Service, error) + + ActionCreate(*KubernetesService) (*Service, error) + + ActionDeactivate(*KubernetesService) (*Service, error) + + ActionFinishupgrade(*KubernetesService) (*Service, error) + + ActionRemove(*KubernetesService) (*Service, error) + + ActionRemoveservicelink(*KubernetesService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionRestart(*KubernetesService, *ServiceRestart) (*Service, error) + + ActionRollback(*KubernetesService) (*Service, error) + + ActionSetservicelinks(*KubernetesService, *SetServiceLinksInput) (*Service, error) + + ActionUpdate(*KubernetesService) (*Service, error) + + ActionUpgrade(*KubernetesService, *ServiceUpgrade) (*Service, error) +} + +func newKubernetesServiceClient(rancherClient *RancherClient) *KubernetesServiceClient { + return &KubernetesServiceClient{ + rancherClient: rancherClient, + } +} + +func (c *KubernetesServiceClient) Create(container *KubernetesService) (*KubernetesService, error) { + resp := &KubernetesService{} + err := c.rancherClient.doCreate(KUBERNETES_SERVICE_TYPE, container, resp) + return resp, err +} + +func (c *KubernetesServiceClient) Update(existing *KubernetesService, updates interface{}) (*KubernetesService, error) { + resp := &KubernetesService{} + err := c.rancherClient.doUpdate(KUBERNETES_SERVICE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *KubernetesServiceClient) List(opts *ListOpts) (*KubernetesServiceCollection, error) { + resp := &KubernetesServiceCollection{} + err := c.rancherClient.doList(KUBERNETES_SERVICE_TYPE, opts, resp) + return resp, err +} + +func (c *KubernetesServiceClient) ById(id string) (*KubernetesService, error) { + resp := &KubernetesService{} + err := c.rancherClient.doById(KUBERNETES_SERVICE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *KubernetesServiceClient) Delete(container *KubernetesService) error { + return c.rancherClient.doResourceDelete(KUBERNETES_SERVICE_TYPE, &container.Resource) +} + +func (c *KubernetesServiceClient) ActionActivate(resource *KubernetesService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionAddservicelink(resource *KubernetesService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionCancelupgrade(resource *KubernetesService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionContinueupgrade(resource *KubernetesService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionCreate(resource *KubernetesService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionDeactivate(resource *KubernetesService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionFinishupgrade(resource *KubernetesService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionRemove(resource *KubernetesService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionRemoveservicelink(resource *KubernetesService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionRestart(resource *KubernetesService, input *ServiceRestart) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "restart", &resource.Resource, input, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionRollback(resource *KubernetesService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionSetservicelinks(resource *KubernetesService, input *SetServiceLinksInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionUpdate(resource *KubernetesService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesServiceClient) ActionUpgrade(resource *KubernetesService, input *ServiceUpgrade) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go new file mode 100644 index 000000000..5df948e42 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go @@ -0,0 +1,184 @@ +package client + +const ( + KUBERNETES_STACK_TYPE = "kubernetesStack" +) + +type KubernetesStack struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` + + PreviousEnvironment map[string]interface{} `json:"previousEnvironment,omitempty" yaml:"previous_environment,omitempty"` + + PreviousExternalId string `json:"previousExternalId,omitempty" yaml:"previous_external_id,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type KubernetesStackCollection struct { + Collection + Data []KubernetesStack `json:"data,omitempty"` +} + +type KubernetesStackClient struct { + rancherClient *RancherClient +} + +type KubernetesStackOperations interface { + List(opts *ListOpts) (*KubernetesStackCollection, error) + Create(opts *KubernetesStack) (*KubernetesStack, error) + Update(existing *KubernetesStack, updates interface{}) (*KubernetesStack, error) + ById(id string) (*KubernetesStack, error) + Delete(container *KubernetesStack) error + + ActionCancelupgrade(*KubernetesStack) (*Stack, error) + + ActionCreate(*KubernetesStack) (*Stack, error) + + ActionError(*KubernetesStack) (*Stack, error) + + ActionFinishupgrade(*KubernetesStack) (*Stack, error) + + ActionRemove(*KubernetesStack) (*Stack, error) + + ActionRollback(*KubernetesStack) (*Stack, error) + + ActionUpgrade(*KubernetesStack, *KubernetesStackUpgrade) (*KubernetesStack, error) +} + +func newKubernetesStackClient(rancherClient *RancherClient) *KubernetesStackClient { + return &KubernetesStackClient{ + rancherClient: rancherClient, + } +} + +func (c *KubernetesStackClient) Create(container *KubernetesStack) (*KubernetesStack, error) { + resp := &KubernetesStack{} + err := c.rancherClient.doCreate(KUBERNETES_STACK_TYPE, container, resp) + return resp, err +} + +func (c *KubernetesStackClient) Update(existing *KubernetesStack, updates interface{}) (*KubernetesStack, error) { + resp := &KubernetesStack{} + err := c.rancherClient.doUpdate(KUBERNETES_STACK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *KubernetesStackClient) List(opts *ListOpts) (*KubernetesStackCollection, error) { + resp := &KubernetesStackCollection{} + err := c.rancherClient.doList(KUBERNETES_STACK_TYPE, opts, resp) + return resp, err +} + +func (c *KubernetesStackClient) ById(id string) (*KubernetesStack, error) { + resp := &KubernetesStack{} + err := c.rancherClient.doById(KUBERNETES_STACK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *KubernetesStackClient) Delete(container *KubernetesStack) error { + return c.rancherClient.doResourceDelete(KUBERNETES_STACK_TYPE, &container.Resource) +} + +func (c *KubernetesStackClient) ActionCancelupgrade(resource *KubernetesStack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesStackClient) ActionCreate(resource *KubernetesStack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesStackClient) ActionError(resource *KubernetesStack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesStackClient) ActionFinishupgrade(resource *KubernetesStack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesStackClient) ActionRemove(resource *KubernetesStack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesStackClient) ActionRollback(resource *KubernetesStack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *KubernetesStackClient) ActionUpgrade(resource *KubernetesStack, input *KubernetesStackUpgrade) (*KubernetesStack, error) { + + resp := &KubernetesStack{} + + err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go new file mode 100644 index 000000000..11d7f9322 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go @@ -0,0 +1,71 @@ +package client + +const ( + KUBERNETES_STACK_UPGRADE_TYPE = "kubernetesStackUpgrade" +) + +type KubernetesStackUpgrade struct { + Resource + + Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` +} + +type KubernetesStackUpgradeCollection struct { + Collection + Data []KubernetesStackUpgrade `json:"data,omitempty"` +} + +type KubernetesStackUpgradeClient struct { + rancherClient *RancherClient +} + +type KubernetesStackUpgradeOperations interface { + List(opts *ListOpts) (*KubernetesStackUpgradeCollection, error) + Create(opts *KubernetesStackUpgrade) (*KubernetesStackUpgrade, error) + Update(existing *KubernetesStackUpgrade, updates interface{}) (*KubernetesStackUpgrade, error) + ById(id string) (*KubernetesStackUpgrade, error) + Delete(container *KubernetesStackUpgrade) error +} + +func newKubernetesStackUpgradeClient(rancherClient *RancherClient) *KubernetesStackUpgradeClient { + return &KubernetesStackUpgradeClient{ + rancherClient: rancherClient, + } +} + +func (c *KubernetesStackUpgradeClient) Create(container *KubernetesStackUpgrade) (*KubernetesStackUpgrade, error) { + resp := &KubernetesStackUpgrade{} + err := c.rancherClient.doCreate(KUBERNETES_STACK_UPGRADE_TYPE, container, resp) + return resp, err +} + +func (c *KubernetesStackUpgradeClient) Update(existing *KubernetesStackUpgrade, updates interface{}) (*KubernetesStackUpgrade, error) { + resp := &KubernetesStackUpgrade{} + err := c.rancherClient.doUpdate(KUBERNETES_STACK_UPGRADE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *KubernetesStackUpgradeClient) List(opts *ListOpts) (*KubernetesStackUpgradeCollection, error) { + resp := &KubernetesStackUpgradeCollection{} + err := c.rancherClient.doList(KUBERNETES_STACK_UPGRADE_TYPE, opts, resp) + return resp, err +} + +func (c *KubernetesStackUpgradeClient) ById(id string) (*KubernetesStackUpgrade, error) { + resp := &KubernetesStackUpgrade{} + err := c.rancherClient.doById(KUBERNETES_STACK_UPGRADE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *KubernetesStackUpgradeClient) Delete(container *KubernetesStackUpgrade) error { + return c.rancherClient.doResourceDelete(KUBERNETES_STACK_UPGRADE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_label.go b/vendor/github.com/rancher/go-rancher/v2/generated_label.go new file mode 100644 index 000000000..004a75d9d --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_label.go @@ -0,0 +1,117 @@ +package client + +const ( + LABEL_TYPE = "label" +) + +type Label struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Key string `json:"key,omitempty" yaml:"key,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Value string `json:"value,omitempty" yaml:"value,omitempty"` +} + +type LabelCollection struct { + Collection + Data []Label `json:"data,omitempty"` +} + +type LabelClient struct { + rancherClient *RancherClient +} + +type LabelOperations interface { + List(opts *ListOpts) (*LabelCollection, error) + Create(opts *Label) (*Label, error) + Update(existing *Label, updates interface{}) (*Label, error) + ById(id string) (*Label, error) + Delete(container *Label) error + + ActionCreate(*Label) (*Label, error) + + ActionRemove(*Label) (*Label, error) +} + +func newLabelClient(rancherClient *RancherClient) *LabelClient { + return &LabelClient{ + rancherClient: rancherClient, + } +} + +func (c *LabelClient) Create(container *Label) (*Label, error) { + resp := &Label{} + err := c.rancherClient.doCreate(LABEL_TYPE, container, resp) + return resp, err +} + +func (c *LabelClient) Update(existing *Label, updates interface{}) (*Label, error) { + resp := &Label{} + err := c.rancherClient.doUpdate(LABEL_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LabelClient) List(opts *ListOpts) (*LabelCollection, error) { + resp := &LabelCollection{} + err := c.rancherClient.doList(LABEL_TYPE, opts, resp) + return resp, err +} + +func (c *LabelClient) ById(id string) (*Label, error) { + resp := &Label{} + err := c.rancherClient.doById(LABEL_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LabelClient) Delete(container *Label) error { + return c.rancherClient.doResourceDelete(LABEL_TYPE, &container.Resource) +} + +func (c *LabelClient) ActionCreate(resource *Label) (*Label, error) { + + resp := &Label{} + + err := c.rancherClient.doAction(LABEL_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LabelClient) ActionRemove(resource *Label) (*Label, error) { + + resp := &Label{} + + err := c.rancherClient.doAction(LABEL_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go new file mode 100644 index 000000000..b24cf4b26 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go @@ -0,0 +1,430 @@ +package client + +const ( + LAUNCH_CONFIG_TYPE = "launchConfig" +) + +type LaunchConfig struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` + + AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` + + BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + + Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` + + CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` + + CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` + + Command []string `json:"command,omitempty" yaml:"command,omitempty"` + + Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` + + CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + DataVolumeMounts map[string]interface{} `json:"dataVolumeMounts,omitempty" yaml:"data_volume_mounts,omitempty"` + + DataVolumes []string `json:"dataVolumes,omitempty" yaml:"data_volumes,omitempty"` + + DataVolumesFrom []string `json:"dataVolumesFrom,omitempty" yaml:"data_volumes_from,omitempty"` + + DataVolumesFromLaunchConfigs []string `json:"dataVolumesFromLaunchConfigs,omitempty" yaml:"data_volumes_from_launch_configs,omitempty"` + + DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` + + Disks []interface{} `json:"disks,omitempty" yaml:"disks,omitempty"` + + Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` + + DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` + + EntryPoint []string `json:"entryPoint,omitempty" yaml:"entry_point,omitempty"` + + Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` + + Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` + + FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + + ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` + + InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + + LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` + + LxcConf map[string]interface{} `json:"lxcConf,omitempty" yaml:"lxc_conf,omitempty"` + + Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` + + MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` + + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + + NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + + NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` + + NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` + + NetworkLaunchConfig string `json:"networkLaunchConfig,omitempty" yaml:"network_launch_config,omitempty"` + + NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` + + PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` + + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` + + PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + + Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` + + PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` + + ReadOnly bool `json:"readOnly,omitempty" yaml:"read_only,omitempty"` + + RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` + + RequestedIpAddress string `json:"requestedIpAddress,omitempty" yaml:"requested_ip_address,omitempty"` + + SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + + StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` + + SystemContainer string `json:"systemContainer,omitempty" yaml:"system_container,omitempty"` + + Token string `json:"token,omitempty" yaml:"token,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` + + User string `json:"user,omitempty" yaml:"user,omitempty"` + + Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` + + Version string `json:"version,omitempty" yaml:"version,omitempty"` + + VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` + + WorkingDir string `json:"workingDir,omitempty" yaml:"working_dir,omitempty"` +} + +type LaunchConfigCollection struct { + Collection + Data []LaunchConfig `json:"data,omitempty"` +} + +type LaunchConfigClient struct { + rancherClient *RancherClient +} + +type LaunchConfigOperations interface { + List(opts *ListOpts) (*LaunchConfigCollection, error) + Create(opts *LaunchConfig) (*LaunchConfig, error) + Update(existing *LaunchConfig, updates interface{}) (*LaunchConfig, error) + ById(id string) (*LaunchConfig, error) + Delete(container *LaunchConfig) error + + ActionAllocate(*LaunchConfig) (*Instance, error) + + ActionConsole(*LaunchConfig, *InstanceConsoleInput) (*InstanceConsole, error) + + ActionCreate(*LaunchConfig) (*Instance, error) + + ActionDeallocate(*LaunchConfig) (*Instance, error) + + ActionError(*LaunchConfig) (*Instance, error) + + ActionExecute(*LaunchConfig, *ContainerExec) (*HostAccess, error) + + ActionMigrate(*LaunchConfig) (*Instance, error) + + ActionProxy(*LaunchConfig, *ContainerProxy) (*HostAccess, error) + + ActionPurge(*LaunchConfig) (*Instance, error) + + ActionRemove(*LaunchConfig) (*Instance, error) + + ActionRestart(*LaunchConfig) (*Instance, error) + + ActionRestore(*LaunchConfig) (*Instance, error) + + ActionSetlabels(*LaunchConfig, *SetLabelsInput) (*Container, error) + + ActionStart(*LaunchConfig) (*Instance, error) + + ActionStop(*LaunchConfig, *InstanceStop) (*Instance, error) + + ActionUpdate(*LaunchConfig) (*Instance, error) + + ActionUpdatehealthy(*LaunchConfig) (*Instance, error) + + ActionUpdatereinitializing(*LaunchConfig) (*Instance, error) + + ActionUpdateunhealthy(*LaunchConfig) (*Instance, error) +} + +func newLaunchConfigClient(rancherClient *RancherClient) *LaunchConfigClient { + return &LaunchConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *LaunchConfigClient) Create(container *LaunchConfig) (*LaunchConfig, error) { + resp := &LaunchConfig{} + err := c.rancherClient.doCreate(LAUNCH_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *LaunchConfigClient) Update(existing *LaunchConfig, updates interface{}) (*LaunchConfig, error) { + resp := &LaunchConfig{} + err := c.rancherClient.doUpdate(LAUNCH_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LaunchConfigClient) List(opts *ListOpts) (*LaunchConfigCollection, error) { + resp := &LaunchConfigCollection{} + err := c.rancherClient.doList(LAUNCH_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *LaunchConfigClient) ById(id string) (*LaunchConfig, error) { + resp := &LaunchConfig{} + err := c.rancherClient.doById(LAUNCH_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LaunchConfigClient) Delete(container *LaunchConfig) error { + return c.rancherClient.doResourceDelete(LAUNCH_CONFIG_TYPE, &container.Resource) +} + +func (c *LaunchConfigClient) ActionAllocate(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "allocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionConsole(resource *LaunchConfig, input *InstanceConsoleInput) (*InstanceConsole, error) { + + resp := &InstanceConsole{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "console", &resource.Resource, input, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionCreate(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionDeallocate(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "deallocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionError(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionExecute(resource *LaunchConfig, input *ContainerExec) (*HostAccess, error) { + + resp := &HostAccess{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "execute", &resource.Resource, input, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionMigrate(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "migrate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionProxy(resource *LaunchConfig, input *ContainerProxy) (*HostAccess, error) { + + resp := &HostAccess{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "proxy", &resource.Resource, input, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionPurge(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionRemove(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionRestart(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "restart", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionRestore(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionSetlabels(resource *LaunchConfig, input *SetLabelsInput) (*Container, error) { + + resp := &Container{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "setlabels", &resource.Resource, input, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionStart(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "start", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionStop(resource *LaunchConfig, input *InstanceStop) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "stop", &resource.Resource, input, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionUpdate(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionUpdatehealthy(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "updatehealthy", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionUpdatereinitializing(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "updatereinitializing", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LaunchConfigClient) ActionUpdateunhealthy(resource *LaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "updateunhealthy", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ldapconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_ldapconfig.go new file mode 100644 index 000000000..f760cfc95 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ldapconfig.go @@ -0,0 +1,111 @@ +package client + +const ( + LDAPCONFIG_TYPE = "ldapconfig" +) + +type Ldapconfig struct { + Resource + + AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` + + AllowedIdentities []interface{} `json:"allowedIdentities,omitempty" yaml:"allowed_identities,omitempty"` + + ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connection_timeout,omitempty"` + + Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` + + Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` + + GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"group_member_mapping_attribute,omitempty"` + + GroupNameField string `json:"groupNameField,omitempty" yaml:"group_name_field,omitempty"` + + GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"group_object_class,omitempty"` + + GroupSearchField string `json:"groupSearchField,omitempty" yaml:"group_search_field,omitempty"` + + LoginDomain string `json:"loginDomain,omitempty" yaml:"login_domain,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Port int64 `json:"port,omitempty" yaml:"port,omitempty"` + + Server string `json:"server,omitempty" yaml:"server,omitempty"` + + ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" yaml:"service_account_password,omitempty"` + + ServiceAccountUsername string `json:"serviceAccountUsername,omitempty" yaml:"service_account_username,omitempty"` + + Tls bool `json:"tls,omitempty" yaml:"tls,omitempty"` + + UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" yaml:"user_disabled_bit_mask,omitempty"` + + UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" yaml:"user_enabled_attribute,omitempty"` + + UserLoginField string `json:"userLoginField,omitempty" yaml:"user_login_field,omitempty"` + + UserMemberAttribute string `json:"userMemberAttribute,omitempty" yaml:"user_member_attribute,omitempty"` + + UserNameField string `json:"userNameField,omitempty" yaml:"user_name_field,omitempty"` + + UserObjectClass string `json:"userObjectClass,omitempty" yaml:"user_object_class,omitempty"` + + UserSearchField string `json:"userSearchField,omitempty" yaml:"user_search_field,omitempty"` +} + +type LdapconfigCollection struct { + Collection + Data []Ldapconfig `json:"data,omitempty"` +} + +type LdapconfigClient struct { + rancherClient *RancherClient +} + +type LdapconfigOperations interface { + List(opts *ListOpts) (*LdapconfigCollection, error) + Create(opts *Ldapconfig) (*Ldapconfig, error) + Update(existing *Ldapconfig, updates interface{}) (*Ldapconfig, error) + ById(id string) (*Ldapconfig, error) + Delete(container *Ldapconfig) error +} + +func newLdapconfigClient(rancherClient *RancherClient) *LdapconfigClient { + return &LdapconfigClient{ + rancherClient: rancherClient, + } +} + +func (c *LdapconfigClient) Create(container *Ldapconfig) (*Ldapconfig, error) { + resp := &Ldapconfig{} + err := c.rancherClient.doCreate(LDAPCONFIG_TYPE, container, resp) + return resp, err +} + +func (c *LdapconfigClient) Update(existing *Ldapconfig, updates interface{}) (*Ldapconfig, error) { + resp := &Ldapconfig{} + err := c.rancherClient.doUpdate(LDAPCONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LdapconfigClient) List(opts *ListOpts) (*LdapconfigCollection, error) { + resp := &LdapconfigCollection{} + err := c.rancherClient.doList(LDAPCONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *LdapconfigClient) ById(id string) (*Ldapconfig, error) { + resp := &Ldapconfig{} + err := c.rancherClient.doById(LDAPCONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LdapconfigClient) Delete(container *Ldapconfig) error { + return c.rancherClient.doResourceDelete(LDAPCONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_app_cookie_stickiness_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_app_cookie_stickiness_policy.go new file mode 100644 index 000000000..235252cd3 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_app_cookie_stickiness_policy.go @@ -0,0 +1,79 @@ +package client + +const ( + LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE = "loadBalancerAppCookieStickinessPolicy" +) + +type LoadBalancerAppCookieStickinessPolicy struct { + Resource + + Cookie string `json:"cookie,omitempty" yaml:"cookie,omitempty"` + + MaxLength int64 `json:"maxLength,omitempty" yaml:"max_length,omitempty"` + + Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Prefix bool `json:"prefix,omitempty" yaml:"prefix,omitempty"` + + RequestLearn bool `json:"requestLearn,omitempty" yaml:"request_learn,omitempty"` + + Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` +} + +type LoadBalancerAppCookieStickinessPolicyCollection struct { + Collection + Data []LoadBalancerAppCookieStickinessPolicy `json:"data,omitempty"` +} + +type LoadBalancerAppCookieStickinessPolicyClient struct { + rancherClient *RancherClient +} + +type LoadBalancerAppCookieStickinessPolicyOperations interface { + List(opts *ListOpts) (*LoadBalancerAppCookieStickinessPolicyCollection, error) + Create(opts *LoadBalancerAppCookieStickinessPolicy) (*LoadBalancerAppCookieStickinessPolicy, error) + Update(existing *LoadBalancerAppCookieStickinessPolicy, updates interface{}) (*LoadBalancerAppCookieStickinessPolicy, error) + ById(id string) (*LoadBalancerAppCookieStickinessPolicy, error) + Delete(container *LoadBalancerAppCookieStickinessPolicy) error +} + +func newLoadBalancerAppCookieStickinessPolicyClient(rancherClient *RancherClient) *LoadBalancerAppCookieStickinessPolicyClient { + return &LoadBalancerAppCookieStickinessPolicyClient{ + rancherClient: rancherClient, + } +} + +func (c *LoadBalancerAppCookieStickinessPolicyClient) Create(container *LoadBalancerAppCookieStickinessPolicy) (*LoadBalancerAppCookieStickinessPolicy, error) { + resp := &LoadBalancerAppCookieStickinessPolicy{} + err := c.rancherClient.doCreate(LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE, container, resp) + return resp, err +} + +func (c *LoadBalancerAppCookieStickinessPolicyClient) Update(existing *LoadBalancerAppCookieStickinessPolicy, updates interface{}) (*LoadBalancerAppCookieStickinessPolicy, error) { + resp := &LoadBalancerAppCookieStickinessPolicy{} + err := c.rancherClient.doUpdate(LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LoadBalancerAppCookieStickinessPolicyClient) List(opts *ListOpts) (*LoadBalancerAppCookieStickinessPolicyCollection, error) { + resp := &LoadBalancerAppCookieStickinessPolicyCollection{} + err := c.rancherClient.doList(LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE, opts, resp) + return resp, err +} + +func (c *LoadBalancerAppCookieStickinessPolicyClient) ById(id string) (*LoadBalancerAppCookieStickinessPolicy, error) { + resp := &LoadBalancerAppCookieStickinessPolicy{} + err := c.rancherClient.doById(LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LoadBalancerAppCookieStickinessPolicyClient) Delete(container *LoadBalancerAppCookieStickinessPolicy) error { + return c.rancherClient.doResourceDelete(LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_config.go new file mode 100644 index 000000000..8c23c42e3 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_config.go @@ -0,0 +1,69 @@ +package client + +const ( + LOAD_BALANCER_CONFIG_TYPE = "loadBalancerConfig" +) + +type LoadBalancerConfig struct { + Resource + + HaproxyConfig *HaproxyConfig `json:"haproxyConfig,omitempty" yaml:"haproxy_config,omitempty"` + + LbCookieStickinessPolicy *LoadBalancerCookieStickinessPolicy `json:"lbCookieStickinessPolicy,omitempty" yaml:"lb_cookie_stickiness_policy,omitempty"` +} + +type LoadBalancerConfigCollection struct { + Collection + Data []LoadBalancerConfig `json:"data,omitempty"` +} + +type LoadBalancerConfigClient struct { + rancherClient *RancherClient +} + +type LoadBalancerConfigOperations interface { + List(opts *ListOpts) (*LoadBalancerConfigCollection, error) + Create(opts *LoadBalancerConfig) (*LoadBalancerConfig, error) + Update(existing *LoadBalancerConfig, updates interface{}) (*LoadBalancerConfig, error) + ById(id string) (*LoadBalancerConfig, error) + Delete(container *LoadBalancerConfig) error +} + +func newLoadBalancerConfigClient(rancherClient *RancherClient) *LoadBalancerConfigClient { + return &LoadBalancerConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *LoadBalancerConfigClient) Create(container *LoadBalancerConfig) (*LoadBalancerConfig, error) { + resp := &LoadBalancerConfig{} + err := c.rancherClient.doCreate(LOAD_BALANCER_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *LoadBalancerConfigClient) Update(existing *LoadBalancerConfig, updates interface{}) (*LoadBalancerConfig, error) { + resp := &LoadBalancerConfig{} + err := c.rancherClient.doUpdate(LOAD_BALANCER_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LoadBalancerConfigClient) List(opts *ListOpts) (*LoadBalancerConfigCollection, error) { + resp := &LoadBalancerConfigCollection{} + err := c.rancherClient.doList(LOAD_BALANCER_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *LoadBalancerConfigClient) ById(id string) (*LoadBalancerConfig, error) { + resp := &LoadBalancerConfig{} + err := c.rancherClient.doById(LOAD_BALANCER_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LoadBalancerConfigClient) Delete(container *LoadBalancerConfig) error { + return c.rancherClient.doResourceDelete(LOAD_BALANCER_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go new file mode 100644 index 000000000..0fc5699a5 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go @@ -0,0 +1,79 @@ +package client + +const ( + LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE = "loadBalancerCookieStickinessPolicy" +) + +type LoadBalancerCookieStickinessPolicy struct { + Resource + + Cookie string `json:"cookie,omitempty" yaml:"cookie,omitempty"` + + Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` + + Indirect bool `json:"indirect,omitempty" yaml:"indirect,omitempty"` + + Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Nocache bool `json:"nocache,omitempty" yaml:"nocache,omitempty"` + + Postonly bool `json:"postonly,omitempty" yaml:"postonly,omitempty"` +} + +type LoadBalancerCookieStickinessPolicyCollection struct { + Collection + Data []LoadBalancerCookieStickinessPolicy `json:"data,omitempty"` +} + +type LoadBalancerCookieStickinessPolicyClient struct { + rancherClient *RancherClient +} + +type LoadBalancerCookieStickinessPolicyOperations interface { + List(opts *ListOpts) (*LoadBalancerCookieStickinessPolicyCollection, error) + Create(opts *LoadBalancerCookieStickinessPolicy) (*LoadBalancerCookieStickinessPolicy, error) + Update(existing *LoadBalancerCookieStickinessPolicy, updates interface{}) (*LoadBalancerCookieStickinessPolicy, error) + ById(id string) (*LoadBalancerCookieStickinessPolicy, error) + Delete(container *LoadBalancerCookieStickinessPolicy) error +} + +func newLoadBalancerCookieStickinessPolicyClient(rancherClient *RancherClient) *LoadBalancerCookieStickinessPolicyClient { + return &LoadBalancerCookieStickinessPolicyClient{ + rancherClient: rancherClient, + } +} + +func (c *LoadBalancerCookieStickinessPolicyClient) Create(container *LoadBalancerCookieStickinessPolicy) (*LoadBalancerCookieStickinessPolicy, error) { + resp := &LoadBalancerCookieStickinessPolicy{} + err := c.rancherClient.doCreate(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, container, resp) + return resp, err +} + +func (c *LoadBalancerCookieStickinessPolicyClient) Update(existing *LoadBalancerCookieStickinessPolicy, updates interface{}) (*LoadBalancerCookieStickinessPolicy, error) { + resp := &LoadBalancerCookieStickinessPolicy{} + err := c.rancherClient.doUpdate(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LoadBalancerCookieStickinessPolicyClient) List(opts *ListOpts) (*LoadBalancerCookieStickinessPolicyCollection, error) { + resp := &LoadBalancerCookieStickinessPolicyCollection{} + err := c.rancherClient.doList(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, opts, resp) + return resp, err +} + +func (c *LoadBalancerCookieStickinessPolicyClient) ById(id string) (*LoadBalancerCookieStickinessPolicy, error) { + resp := &LoadBalancerCookieStickinessPolicy{} + err := c.rancherClient.doById(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LoadBalancerCookieStickinessPolicyClient) Delete(container *LoadBalancerCookieStickinessPolicy) error { + return c.rancherClient.doResourceDelete(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go new file mode 100644 index 000000000..728eb8c9f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go @@ -0,0 +1,283 @@ +package client + +const ( + LOAD_BALANCER_SERVICE_TYPE = "loadBalancerService" +) + +type LoadBalancerService struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` + + CertificateIds []string `json:"certificateIds,omitempty" yaml:"certificate_ids,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + DefaultCertificateId string `json:"defaultCertificateId,omitempty" yaml:"default_certificate_id,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + + LoadBalancerConfig *LoadBalancerConfig `json:"loadBalancerConfig,omitempty" yaml:"load_balancer_config,omitempty"` + + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PublicEndpoints []interface{} `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` + + Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` + + ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` + + SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` +} + +type LoadBalancerServiceCollection struct { + Collection + Data []LoadBalancerService `json:"data,omitempty"` +} + +type LoadBalancerServiceClient struct { + rancherClient *RancherClient +} + +type LoadBalancerServiceOperations interface { + List(opts *ListOpts) (*LoadBalancerServiceCollection, error) + Create(opts *LoadBalancerService) (*LoadBalancerService, error) + Update(existing *LoadBalancerService, updates interface{}) (*LoadBalancerService, error) + ById(id string) (*LoadBalancerService, error) + Delete(container *LoadBalancerService) error + + ActionActivate(*LoadBalancerService) (*Service, error) + + ActionAddservicelink(*LoadBalancerService, *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) + + ActionCancelupgrade(*LoadBalancerService) (*Service, error) + + ActionContinueupgrade(*LoadBalancerService) (*Service, error) + + ActionCreate(*LoadBalancerService) (*Service, error) + + ActionDeactivate(*LoadBalancerService) (*Service, error) + + ActionFinishupgrade(*LoadBalancerService) (*Service, error) + + ActionRemove(*LoadBalancerService) (*Service, error) + + ActionRemoveservicelink(*LoadBalancerService, *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) + + ActionRestart(*LoadBalancerService, *ServiceRestart) (*Service, error) + + ActionRollback(*LoadBalancerService) (*Service, error) + + ActionSetservicelinks(*LoadBalancerService, *SetLoadBalancerServiceLinksInput) (*Service, error) + + ActionUpdate(*LoadBalancerService) (*Service, error) + + ActionUpgrade(*LoadBalancerService, *ServiceUpgrade) (*Service, error) +} + +func newLoadBalancerServiceClient(rancherClient *RancherClient) *LoadBalancerServiceClient { + return &LoadBalancerServiceClient{ + rancherClient: rancherClient, + } +} + +func (c *LoadBalancerServiceClient) Create(container *LoadBalancerService) (*LoadBalancerService, error) { + resp := &LoadBalancerService{} + err := c.rancherClient.doCreate(LOAD_BALANCER_SERVICE_TYPE, container, resp) + return resp, err +} + +func (c *LoadBalancerServiceClient) Update(existing *LoadBalancerService, updates interface{}) (*LoadBalancerService, error) { + resp := &LoadBalancerService{} + err := c.rancherClient.doUpdate(LOAD_BALANCER_SERVICE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LoadBalancerServiceClient) List(opts *ListOpts) (*LoadBalancerServiceCollection, error) { + resp := &LoadBalancerServiceCollection{} + err := c.rancherClient.doList(LOAD_BALANCER_SERVICE_TYPE, opts, resp) + return resp, err +} + +func (c *LoadBalancerServiceClient) ById(id string) (*LoadBalancerService, error) { + resp := &LoadBalancerService{} + err := c.rancherClient.doById(LOAD_BALANCER_SERVICE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LoadBalancerServiceClient) Delete(container *LoadBalancerService) error { + return c.rancherClient.doResourceDelete(LOAD_BALANCER_SERVICE_TYPE, &container.Resource) +} + +func (c *LoadBalancerServiceClient) ActionActivate(resource *LoadBalancerService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionAddservicelink(resource *LoadBalancerService, input *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionCancelupgrade(resource *LoadBalancerService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionContinueupgrade(resource *LoadBalancerService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionCreate(resource *LoadBalancerService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionDeactivate(resource *LoadBalancerService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionFinishupgrade(resource *LoadBalancerService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionRemove(resource *LoadBalancerService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionRemoveservicelink(resource *LoadBalancerService, input *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionRestart(resource *LoadBalancerService, input *ServiceRestart) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "restart", &resource.Resource, input, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionRollback(resource *LoadBalancerService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionSetservicelinks(resource *LoadBalancerService, input *SetLoadBalancerServiceLinksInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionUpdate(resource *LoadBalancerService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *LoadBalancerServiceClient) ActionUpgrade(resource *LoadBalancerService, input *ServiceUpgrade) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service_link.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service_link.go new file mode 100644 index 000000000..b30c45be9 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service_link.go @@ -0,0 +1,71 @@ +package client + +const ( + LOAD_BALANCER_SERVICE_LINK_TYPE = "loadBalancerServiceLink" +) + +type LoadBalancerServiceLink struct { + Resource + + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` + + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type LoadBalancerServiceLinkCollection struct { + Collection + Data []LoadBalancerServiceLink `json:"data,omitempty"` +} + +type LoadBalancerServiceLinkClient struct { + rancherClient *RancherClient +} + +type LoadBalancerServiceLinkOperations interface { + List(opts *ListOpts) (*LoadBalancerServiceLinkCollection, error) + Create(opts *LoadBalancerServiceLink) (*LoadBalancerServiceLink, error) + Update(existing *LoadBalancerServiceLink, updates interface{}) (*LoadBalancerServiceLink, error) + ById(id string) (*LoadBalancerServiceLink, error) + Delete(container *LoadBalancerServiceLink) error +} + +func newLoadBalancerServiceLinkClient(rancherClient *RancherClient) *LoadBalancerServiceLinkClient { + return &LoadBalancerServiceLinkClient{ + rancherClient: rancherClient, + } +} + +func (c *LoadBalancerServiceLinkClient) Create(container *LoadBalancerServiceLink) (*LoadBalancerServiceLink, error) { + resp := &LoadBalancerServiceLink{} + err := c.rancherClient.doCreate(LOAD_BALANCER_SERVICE_LINK_TYPE, container, resp) + return resp, err +} + +func (c *LoadBalancerServiceLinkClient) Update(existing *LoadBalancerServiceLink, updates interface{}) (*LoadBalancerServiceLink, error) { + resp := &LoadBalancerServiceLink{} + err := c.rancherClient.doUpdate(LOAD_BALANCER_SERVICE_LINK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LoadBalancerServiceLinkClient) List(opts *ListOpts) (*LoadBalancerServiceLinkCollection, error) { + resp := &LoadBalancerServiceLinkCollection{} + err := c.rancherClient.doList(LOAD_BALANCER_SERVICE_LINK_TYPE, opts, resp) + return resp, err +} + +func (c *LoadBalancerServiceLinkClient) ById(id string) (*LoadBalancerServiceLink, error) { + resp := &LoadBalancerServiceLink{} + err := c.rancherClient.doById(LOAD_BALANCER_SERVICE_LINK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LoadBalancerServiceLinkClient) Delete(container *LoadBalancerServiceLink) error { + return c.rancherClient.doResourceDelete(LOAD_BALANCER_SERVICE_LINK_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go new file mode 100644 index 000000000..16d985545 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go @@ -0,0 +1,75 @@ +package client + +const ( + LOCAL_AUTH_CONFIG_TYPE = "localAuthConfig" +) + +type LocalAuthConfig struct { + Resource + + AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` + + Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Password string `json:"password,omitempty" yaml:"password,omitempty"` + + Username string `json:"username,omitempty" yaml:"username,omitempty"` +} + +type LocalAuthConfigCollection struct { + Collection + Data []LocalAuthConfig `json:"data,omitempty"` +} + +type LocalAuthConfigClient struct { + rancherClient *RancherClient +} + +type LocalAuthConfigOperations interface { + List(opts *ListOpts) (*LocalAuthConfigCollection, error) + Create(opts *LocalAuthConfig) (*LocalAuthConfig, error) + Update(existing *LocalAuthConfig, updates interface{}) (*LocalAuthConfig, error) + ById(id string) (*LocalAuthConfig, error) + Delete(container *LocalAuthConfig) error +} + +func newLocalAuthConfigClient(rancherClient *RancherClient) *LocalAuthConfigClient { + return &LocalAuthConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *LocalAuthConfigClient) Create(container *LocalAuthConfig) (*LocalAuthConfig, error) { + resp := &LocalAuthConfig{} + err := c.rancherClient.doCreate(LOCAL_AUTH_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *LocalAuthConfigClient) Update(existing *LocalAuthConfig, updates interface{}) (*LocalAuthConfig, error) { + resp := &LocalAuthConfig{} + err := c.rancherClient.doUpdate(LOCAL_AUTH_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LocalAuthConfigClient) List(opts *ListOpts) (*LocalAuthConfigCollection, error) { + resp := &LocalAuthConfigCollection{} + err := c.rancherClient.doList(LOCAL_AUTH_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *LocalAuthConfigClient) ById(id string) (*LocalAuthConfig, error) { + resp := &LocalAuthConfig{} + err := c.rancherClient.doById(LOCAL_AUTH_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LocalAuthConfigClient) Delete(container *LocalAuthConfig) error { + return c.rancherClient.doResourceDelete(LOCAL_AUTH_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go new file mode 100644 index 000000000..1abfc4c93 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go @@ -0,0 +1,69 @@ +package client + +const ( + LOG_CONFIG_TYPE = "logConfig" +) + +type LogConfig struct { + Resource + + Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"` + + Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` +} + +type LogConfigCollection struct { + Collection + Data []LogConfig `json:"data,omitempty"` +} + +type LogConfigClient struct { + rancherClient *RancherClient +} + +type LogConfigOperations interface { + List(opts *ListOpts) (*LogConfigCollection, error) + Create(opts *LogConfig) (*LogConfig, error) + Update(existing *LogConfig, updates interface{}) (*LogConfig, error) + ById(id string) (*LogConfig, error) + Delete(container *LogConfig) error +} + +func newLogConfigClient(rancherClient *RancherClient) *LogConfigClient { + return &LogConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *LogConfigClient) Create(container *LogConfig) (*LogConfig, error) { + resp := &LogConfig{} + err := c.rancherClient.doCreate(LOG_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *LogConfigClient) Update(existing *LogConfig, updates interface{}) (*LogConfig, error) { + resp := &LogConfig{} + err := c.rancherClient.doUpdate(LOG_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LogConfigClient) List(opts *ListOpts) (*LogConfigCollection, error) { + resp := &LogConfigCollection{} + err := c.rancherClient.doList(LOG_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *LogConfigClient) ById(id string) (*LogConfig, error) { + resp := &LogConfig{} + err := c.rancherClient.doById(LOG_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LogConfigClient) Delete(container *LogConfig) error { + return c.rancherClient.doResourceDelete(LOG_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_machine.go b/vendor/github.com/rancher/go-rancher/v2/generated_machine.go new file mode 100644 index 000000000..fb7768d97 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_machine.go @@ -0,0 +1,182 @@ +package client + +const ( + MACHINE_TYPE = "machine" +) + +type Machine struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Amazonec2Config *Amazonec2Config `json:"amazonec2Config,omitempty" yaml:"amazonec2config,omitempty"` + + AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty" yaml:"auth_certificate_authority,omitempty"` + + AuthKey string `json:"authKey,omitempty" yaml:"auth_key,omitempty"` + + AzureConfig *AzureConfig `json:"azureConfig,omitempty" yaml:"azure_config,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + DigitaloceanConfig *DigitaloceanConfig `json:"digitaloceanConfig,omitempty" yaml:"digitalocean_config,omitempty"` + + DockerVersion string `json:"dockerVersion,omitempty" yaml:"docker_version,omitempty"` + + Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` + + EngineEnv map[string]interface{} `json:"engineEnv,omitempty" yaml:"engine_env,omitempty"` + + EngineInsecureRegistry []string `json:"engineInsecureRegistry,omitempty" yaml:"engine_insecure_registry,omitempty"` + + EngineInstallUrl string `json:"engineInstallUrl,omitempty" yaml:"engine_install_url,omitempty"` + + EngineLabel map[string]interface{} `json:"engineLabel,omitempty" yaml:"engine_label,omitempty"` + + EngineOpt map[string]interface{} `json:"engineOpt,omitempty" yaml:"engine_opt,omitempty"` + + EngineRegistryMirror []string `json:"engineRegistryMirror,omitempty" yaml:"engine_registry_mirror,omitempty"` + + EngineStorageDriver string `json:"engineStorageDriver,omitempty" yaml:"engine_storage_driver,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + ExtractedConfig string `json:"extractedConfig,omitempty" yaml:"extracted_config,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PacketConfig *PacketConfig `json:"packetConfig,omitempty" yaml:"packet_config,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type MachineCollection struct { + Collection + Data []Machine `json:"data,omitempty"` +} + +type MachineClient struct { + rancherClient *RancherClient +} + +type MachineOperations interface { + List(opts *ListOpts) (*MachineCollection, error) + Create(opts *Machine) (*Machine, error) + Update(existing *Machine, updates interface{}) (*Machine, error) + ById(id string) (*Machine, error) + Delete(container *Machine) error + + ActionBootstrap(*Machine) (*PhysicalHost, error) + + ActionCreate(*Machine) (*PhysicalHost, error) + + ActionError(*Machine) (*PhysicalHost, error) + + ActionRemove(*Machine) (*PhysicalHost, error) + + ActionUpdate(*Machine) (*PhysicalHost, error) +} + +func newMachineClient(rancherClient *RancherClient) *MachineClient { + return &MachineClient{ + rancherClient: rancherClient, + } +} + +func (c *MachineClient) Create(container *Machine) (*Machine, error) { + resp := &Machine{} + err := c.rancherClient.doCreate(MACHINE_TYPE, container, resp) + return resp, err +} + +func (c *MachineClient) Update(existing *Machine, updates interface{}) (*Machine, error) { + resp := &Machine{} + err := c.rancherClient.doUpdate(MACHINE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *MachineClient) List(opts *ListOpts) (*MachineCollection, error) { + resp := &MachineCollection{} + err := c.rancherClient.doList(MACHINE_TYPE, opts, resp) + return resp, err +} + +func (c *MachineClient) ById(id string) (*Machine, error) { + resp := &Machine{} + err := c.rancherClient.doById(MACHINE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *MachineClient) Delete(container *Machine) error { + return c.rancherClient.doResourceDelete(MACHINE_TYPE, &container.Resource) +} + +func (c *MachineClient) ActionBootstrap(resource *Machine) (*PhysicalHost, error) { + + resp := &PhysicalHost{} + + err := c.rancherClient.doAction(MACHINE_TYPE, "bootstrap", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *MachineClient) ActionCreate(resource *Machine) (*PhysicalHost, error) { + + resp := &PhysicalHost{} + + err := c.rancherClient.doAction(MACHINE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *MachineClient) ActionError(resource *Machine) (*PhysicalHost, error) { + + resp := &PhysicalHost{} + + err := c.rancherClient.doAction(MACHINE_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *MachineClient) ActionRemove(resource *Machine) (*PhysicalHost, error) { + + resp := &PhysicalHost{} + + err := c.rancherClient.doAction(MACHINE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *MachineClient) ActionUpdate(resource *Machine) (*PhysicalHost, error) { + + resp := &PhysicalHost{} + + err := c.rancherClient.doAction(MACHINE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go new file mode 100644 index 000000000..c54bcd4b6 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go @@ -0,0 +1,169 @@ +package client + +const ( + MACHINE_DRIVER_TYPE = "machineDriver" +) + +type MachineDriver struct { + Resource + + ActivateOnCreate bool `json:"activateOnCreate,omitempty" yaml:"activate_on_create,omitempty"` + + Builtin bool `json:"builtin,omitempty" yaml:"builtin,omitempty"` + + Checksum string `json:"checksum,omitempty" yaml:"checksum,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + DefaultActive bool `json:"defaultActive,omitempty" yaml:"default_active,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + UiUrl string `json:"uiUrl,omitempty" yaml:"ui_url,omitempty"` + + Url string `json:"url,omitempty" yaml:"url,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type MachineDriverCollection struct { + Collection + Data []MachineDriver `json:"data,omitempty"` +} + +type MachineDriverClient struct { + rancherClient *RancherClient +} + +type MachineDriverOperations interface { + List(opts *ListOpts) (*MachineDriverCollection, error) + Create(opts *MachineDriver) (*MachineDriver, error) + Update(existing *MachineDriver, updates interface{}) (*MachineDriver, error) + ById(id string) (*MachineDriver, error) + Delete(container *MachineDriver) error + + ActionActivate(*MachineDriver) (*MachineDriver, error) + + ActionDeactivate(*MachineDriver) (*MachineDriver, error) + + ActionError(*MachineDriver) (*MachineDriver, error) + + ActionReactivate(*MachineDriver) (*MachineDriver, error) + + ActionRemove(*MachineDriver) (*MachineDriver, error) + + ActionUpdate(*MachineDriver) (*MachineDriver, error) +} + +func newMachineDriverClient(rancherClient *RancherClient) *MachineDriverClient { + return &MachineDriverClient{ + rancherClient: rancherClient, + } +} + +func (c *MachineDriverClient) Create(container *MachineDriver) (*MachineDriver, error) { + resp := &MachineDriver{} + err := c.rancherClient.doCreate(MACHINE_DRIVER_TYPE, container, resp) + return resp, err +} + +func (c *MachineDriverClient) Update(existing *MachineDriver, updates interface{}) (*MachineDriver, error) { + resp := &MachineDriver{} + err := c.rancherClient.doUpdate(MACHINE_DRIVER_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *MachineDriverClient) List(opts *ListOpts) (*MachineDriverCollection, error) { + resp := &MachineDriverCollection{} + err := c.rancherClient.doList(MACHINE_DRIVER_TYPE, opts, resp) + return resp, err +} + +func (c *MachineDriverClient) ById(id string) (*MachineDriver, error) { + resp := &MachineDriver{} + err := c.rancherClient.doById(MACHINE_DRIVER_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *MachineDriverClient) Delete(container *MachineDriver) error { + return c.rancherClient.doResourceDelete(MACHINE_DRIVER_TYPE, &container.Resource) +} + +func (c *MachineDriverClient) ActionActivate(resource *MachineDriver) (*MachineDriver, error) { + + resp := &MachineDriver{} + + err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *MachineDriverClient) ActionDeactivate(resource *MachineDriver) (*MachineDriver, error) { + + resp := &MachineDriver{} + + err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *MachineDriverClient) ActionError(resource *MachineDriver) (*MachineDriver, error) { + + resp := &MachineDriver{} + + err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *MachineDriverClient) ActionReactivate(resource *MachineDriver) (*MachineDriver, error) { + + resp := &MachineDriver{} + + err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "reactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *MachineDriverClient) ActionRemove(resource *MachineDriver) (*MachineDriver, error) { + + resp := &MachineDriver{} + + err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *MachineDriverClient) ActionUpdate(resource *MachineDriver) (*MachineDriver, error) { + + resp := &MachineDriver{} + + err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_mount.go b/vendor/github.com/rancher/go-rancher/v2/generated_mount.go new file mode 100644 index 000000000..59c976303 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_mount.go @@ -0,0 +1,132 @@ +package client + +const ( + MOUNT_TYPE = "mount" +) + +type Mount struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Path string `json:"path,omitempty" yaml:"path,omitempty"` + + Permissions string `json:"permissions,omitempty" yaml:"permissions,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` +} + +type MountCollection struct { + Collection + Data []Mount `json:"data,omitempty"` +} + +type MountClient struct { + rancherClient *RancherClient +} + +type MountOperations interface { + List(opts *ListOpts) (*MountCollection, error) + Create(opts *Mount) (*Mount, error) + Update(existing *Mount, updates interface{}) (*Mount, error) + ById(id string) (*Mount, error) + Delete(container *Mount) error + + ActionCreate(*Mount) (*Mount, error) + + ActionDeactivate(*Mount) (*Mount, error) + + ActionRemove(*Mount) (*Mount, error) +} + +func newMountClient(rancherClient *RancherClient) *MountClient { + return &MountClient{ + rancherClient: rancherClient, + } +} + +func (c *MountClient) Create(container *Mount) (*Mount, error) { + resp := &Mount{} + err := c.rancherClient.doCreate(MOUNT_TYPE, container, resp) + return resp, err +} + +func (c *MountClient) Update(existing *Mount, updates interface{}) (*Mount, error) { + resp := &Mount{} + err := c.rancherClient.doUpdate(MOUNT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *MountClient) List(opts *ListOpts) (*MountCollection, error) { + resp := &MountCollection{} + err := c.rancherClient.doList(MOUNT_TYPE, opts, resp) + return resp, err +} + +func (c *MountClient) ById(id string) (*Mount, error) { + resp := &Mount{} + err := c.rancherClient.doById(MOUNT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *MountClient) Delete(container *Mount) error { + return c.rancherClient.doResourceDelete(MOUNT_TYPE, &container.Resource) +} + +func (c *MountClient) ActionCreate(resource *Mount) (*Mount, error) { + + resp := &Mount{} + + err := c.rancherClient.doAction(MOUNT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *MountClient) ActionDeactivate(resource *Mount) (*Mount, error) { + + resp := &Mount{} + + err := c.rancherClient.doAction(MOUNT_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *MountClient) ActionRemove(resource *Mount) (*Mount, error) { + + resp := &Mount{} + + err := c.rancherClient.doAction(MOUNT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network.go b/vendor/github.com/rancher/go-rancher/v2/generated_network.go new file mode 100644 index 000000000..53c59be4b --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_network.go @@ -0,0 +1,168 @@ +package client + +const ( + NETWORK_TYPE = "network" +) + +type Network struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type NetworkCollection struct { + Collection + Data []Network `json:"data,omitempty"` +} + +type NetworkClient struct { + rancherClient *RancherClient +} + +type NetworkOperations interface { + List(opts *ListOpts) (*NetworkCollection, error) + Create(opts *Network) (*Network, error) + Update(existing *Network, updates interface{}) (*Network, error) + ById(id string) (*Network, error) + Delete(container *Network) error + + ActionActivate(*Network) (*Network, error) + + ActionCreate(*Network) (*Network, error) + + ActionDeactivate(*Network) (*Network, error) + + ActionPurge(*Network) (*Network, error) + + ActionRemove(*Network) (*Network, error) + + ActionRestore(*Network) (*Network, error) + + ActionUpdate(*Network) (*Network, error) +} + +func newNetworkClient(rancherClient *RancherClient) *NetworkClient { + return &NetworkClient{ + rancherClient: rancherClient, + } +} + +func (c *NetworkClient) Create(container *Network) (*Network, error) { + resp := &Network{} + err := c.rancherClient.doCreate(NETWORK_TYPE, container, resp) + return resp, err +} + +func (c *NetworkClient) Update(existing *Network, updates interface{}) (*Network, error) { + resp := &Network{} + err := c.rancherClient.doUpdate(NETWORK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *NetworkClient) List(opts *ListOpts) (*NetworkCollection, error) { + resp := &NetworkCollection{} + err := c.rancherClient.doList(NETWORK_TYPE, opts, resp) + return resp, err +} + +func (c *NetworkClient) ById(id string) (*Network, error) { + resp := &Network{} + err := c.rancherClient.doById(NETWORK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *NetworkClient) Delete(container *Network) error { + return c.rancherClient.doResourceDelete(NETWORK_TYPE, &container.Resource) +} + +func (c *NetworkClient) ActionActivate(resource *Network) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(NETWORK_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkClient) ActionCreate(resource *Network) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(NETWORK_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkClient) ActionDeactivate(resource *Network) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(NETWORK_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkClient) ActionPurge(resource *Network) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(NETWORK_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkClient) ActionRemove(resource *Network) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(NETWORK_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkClient) ActionRestore(resource *Network) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(NETWORK_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkClient) ActionUpdate(resource *Network) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(NETWORK_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go new file mode 100644 index 000000000..d7fecc473 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go @@ -0,0 +1,71 @@ +package client + +const ( + NFS_CONFIG_TYPE = "nfsConfig" +) + +type NfsConfig struct { + Resource + + MountOptions string `json:"mountOptions,omitempty" yaml:"mount_options,omitempty"` + + Server string `json:"server,omitempty" yaml:"server,omitempty"` + + Share string `json:"share,omitempty" yaml:"share,omitempty"` +} + +type NfsConfigCollection struct { + Collection + Data []NfsConfig `json:"data,omitempty"` +} + +type NfsConfigClient struct { + rancherClient *RancherClient +} + +type NfsConfigOperations interface { + List(opts *ListOpts) (*NfsConfigCollection, error) + Create(opts *NfsConfig) (*NfsConfig, error) + Update(existing *NfsConfig, updates interface{}) (*NfsConfig, error) + ById(id string) (*NfsConfig, error) + Delete(container *NfsConfig) error +} + +func newNfsConfigClient(rancherClient *RancherClient) *NfsConfigClient { + return &NfsConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *NfsConfigClient) Create(container *NfsConfig) (*NfsConfig, error) { + resp := &NfsConfig{} + err := c.rancherClient.doCreate(NFS_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *NfsConfigClient) Update(existing *NfsConfig, updates interface{}) (*NfsConfig, error) { + resp := &NfsConfig{} + err := c.rancherClient.doUpdate(NFS_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *NfsConfigClient) List(opts *ListOpts) (*NfsConfigCollection, error) { + resp := &NfsConfigCollection{} + err := c.rancherClient.doList(NFS_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *NfsConfigClient) ById(id string) (*NfsConfig, error) { + resp := &NfsConfig{} + err := c.rancherClient.doById(NFS_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *NfsConfigClient) Delete(container *NfsConfig) error { + return c.rancherClient.doResourceDelete(NFS_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go new file mode 100644 index 000000000..7b24f4132 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go @@ -0,0 +1,109 @@ +package client + +const ( + OPENLDAPCONFIG_TYPE = "openldapconfig" +) + +type Openldapconfig struct { + Resource + + AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` + + ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connection_timeout,omitempty"` + + Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` + + Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` + + GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"group_member_mapping_attribute,omitempty"` + + GroupNameField string `json:"groupNameField,omitempty" yaml:"group_name_field,omitempty"` + + GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"group_object_class,omitempty"` + + GroupSearchField string `json:"groupSearchField,omitempty" yaml:"group_search_field,omitempty"` + + LoginDomain string `json:"loginDomain,omitempty" yaml:"login_domain,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Port int64 `json:"port,omitempty" yaml:"port,omitempty"` + + Server string `json:"server,omitempty" yaml:"server,omitempty"` + + ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" yaml:"service_account_password,omitempty"` + + ServiceAccountUsername string `json:"serviceAccountUsername,omitempty" yaml:"service_account_username,omitempty"` + + Tls bool `json:"tls,omitempty" yaml:"tls,omitempty"` + + UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" yaml:"user_disabled_bit_mask,omitempty"` + + UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" yaml:"user_enabled_attribute,omitempty"` + + UserLoginField string `json:"userLoginField,omitempty" yaml:"user_login_field,omitempty"` + + UserMemberAttribute string `json:"userMemberAttribute,omitempty" yaml:"user_member_attribute,omitempty"` + + UserNameField string `json:"userNameField,omitempty" yaml:"user_name_field,omitempty"` + + UserObjectClass string `json:"userObjectClass,omitempty" yaml:"user_object_class,omitempty"` + + UserSearchField string `json:"userSearchField,omitempty" yaml:"user_search_field,omitempty"` +} + +type OpenldapconfigCollection struct { + Collection + Data []Openldapconfig `json:"data,omitempty"` +} + +type OpenldapconfigClient struct { + rancherClient *RancherClient +} + +type OpenldapconfigOperations interface { + List(opts *ListOpts) (*OpenldapconfigCollection, error) + Create(opts *Openldapconfig) (*Openldapconfig, error) + Update(existing *Openldapconfig, updates interface{}) (*Openldapconfig, error) + ById(id string) (*Openldapconfig, error) + Delete(container *Openldapconfig) error +} + +func newOpenldapconfigClient(rancherClient *RancherClient) *OpenldapconfigClient { + return &OpenldapconfigClient{ + rancherClient: rancherClient, + } +} + +func (c *OpenldapconfigClient) Create(container *Openldapconfig) (*Openldapconfig, error) { + resp := &Openldapconfig{} + err := c.rancherClient.doCreate(OPENLDAPCONFIG_TYPE, container, resp) + return resp, err +} + +func (c *OpenldapconfigClient) Update(existing *Openldapconfig, updates interface{}) (*Openldapconfig, error) { + resp := &Openldapconfig{} + err := c.rancherClient.doUpdate(OPENLDAPCONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *OpenldapconfigClient) List(opts *ListOpts) (*OpenldapconfigCollection, error) { + resp := &OpenldapconfigCollection{} + err := c.rancherClient.doList(OPENLDAPCONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *OpenldapconfigClient) ById(id string) (*Openldapconfig, error) { + resp := &Openldapconfig{} + err := c.rancherClient.doById(OPENLDAPCONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *OpenldapconfigClient) Delete(container *Openldapconfig) error { + return c.rancherClient.doResourceDelete(OPENLDAPCONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go new file mode 100644 index 000000000..f0d03e51f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go @@ -0,0 +1,77 @@ +package client + +const ( + PACKET_CONFIG_TYPE = "packetConfig" +) + +type PacketConfig struct { + Resource + + ApiKey string `json:"apiKey,omitempty" yaml:"api_key,omitempty"` + + BillingCycle string `json:"billingCycle,omitempty" yaml:"billing_cycle,omitempty"` + + FacilityCode string `json:"facilityCode,omitempty" yaml:"facility_code,omitempty"` + + Os string `json:"os,omitempty" yaml:"os,omitempty"` + + Plan string `json:"plan,omitempty" yaml:"plan,omitempty"` + + ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"` +} + +type PacketConfigCollection struct { + Collection + Data []PacketConfig `json:"data,omitempty"` +} + +type PacketConfigClient struct { + rancherClient *RancherClient +} + +type PacketConfigOperations interface { + List(opts *ListOpts) (*PacketConfigCollection, error) + Create(opts *PacketConfig) (*PacketConfig, error) + Update(existing *PacketConfig, updates interface{}) (*PacketConfig, error) + ById(id string) (*PacketConfig, error) + Delete(container *PacketConfig) error +} + +func newPacketConfigClient(rancherClient *RancherClient) *PacketConfigClient { + return &PacketConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *PacketConfigClient) Create(container *PacketConfig) (*PacketConfig, error) { + resp := &PacketConfig{} + err := c.rancherClient.doCreate(PACKET_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *PacketConfigClient) Update(existing *PacketConfig, updates interface{}) (*PacketConfig, error) { + resp := &PacketConfig{} + err := c.rancherClient.doUpdate(PACKET_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *PacketConfigClient) List(opts *ListOpts) (*PacketConfigCollection, error) { + resp := &PacketConfigCollection{} + err := c.rancherClient.doList(PACKET_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *PacketConfigClient) ById(id string) (*PacketConfig, error) { + resp := &PacketConfig{} + err := c.rancherClient.doById(PACKET_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *PacketConfigClient) Delete(container *PacketConfig) error { + return c.rancherClient.doResourceDelete(PACKET_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_password.go b/vendor/github.com/rancher/go-rancher/v2/generated_password.go new file mode 100644 index 000000000..427eca312 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_password.go @@ -0,0 +1,172 @@ +package client + +const ( + PASSWORD_TYPE = "password" +) + +type Password struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type PasswordCollection struct { + Collection + Data []Password `json:"data,omitempty"` +} + +type PasswordClient struct { + rancherClient *RancherClient +} + +type PasswordOperations interface { + List(opts *ListOpts) (*PasswordCollection, error) + Create(opts *Password) (*Password, error) + Update(existing *Password, updates interface{}) (*Password, error) + ById(id string) (*Password, error) + Delete(container *Password) error + + ActionActivate(*Password) (*Credential, error) + + ActionChangesecret(*Password, *ChangeSecretInput) (*ChangeSecretInput, error) + + ActionCreate(*Password) (*Credential, error) + + ActionDeactivate(*Password) (*Credential, error) + + ActionPurge(*Password) (*Credential, error) + + ActionRemove(*Password) (*Credential, error) + + ActionUpdate(*Password) (*Credential, error) +} + +func newPasswordClient(rancherClient *RancherClient) *PasswordClient { + return &PasswordClient{ + rancherClient: rancherClient, + } +} + +func (c *PasswordClient) Create(container *Password) (*Password, error) { + resp := &Password{} + err := c.rancherClient.doCreate(PASSWORD_TYPE, container, resp) + return resp, err +} + +func (c *PasswordClient) Update(existing *Password, updates interface{}) (*Password, error) { + resp := &Password{} + err := c.rancherClient.doUpdate(PASSWORD_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *PasswordClient) List(opts *ListOpts) (*PasswordCollection, error) { + resp := &PasswordCollection{} + err := c.rancherClient.doList(PASSWORD_TYPE, opts, resp) + return resp, err +} + +func (c *PasswordClient) ById(id string) (*Password, error) { + resp := &Password{} + err := c.rancherClient.doById(PASSWORD_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *PasswordClient) Delete(container *Password) error { + return c.rancherClient.doResourceDelete(PASSWORD_TYPE, &container.Resource) +} + +func (c *PasswordClient) ActionActivate(resource *Password) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(PASSWORD_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PasswordClient) ActionChangesecret(resource *Password, input *ChangeSecretInput) (*ChangeSecretInput, error) { + + resp := &ChangeSecretInput{} + + err := c.rancherClient.doAction(PASSWORD_TYPE, "changesecret", &resource.Resource, input, resp) + + return resp, err +} + +func (c *PasswordClient) ActionCreate(resource *Password) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(PASSWORD_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PasswordClient) ActionDeactivate(resource *Password) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(PASSWORD_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PasswordClient) ActionPurge(resource *Password) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(PASSWORD_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PasswordClient) ActionRemove(resource *Password) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(PASSWORD_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PasswordClient) ActionUpdate(resource *Password) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(PASSWORD_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go b/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go new file mode 100644 index 000000000..99b623677 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go @@ -0,0 +1,150 @@ +package client + +const ( + PHYSICAL_HOST_TYPE = "physicalHost" +) + +type PhysicalHost struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type PhysicalHostCollection struct { + Collection + Data []PhysicalHost `json:"data,omitempty"` +} + +type PhysicalHostClient struct { + rancherClient *RancherClient +} + +type PhysicalHostOperations interface { + List(opts *ListOpts) (*PhysicalHostCollection, error) + Create(opts *PhysicalHost) (*PhysicalHost, error) + Update(existing *PhysicalHost, updates interface{}) (*PhysicalHost, error) + ById(id string) (*PhysicalHost, error) + Delete(container *PhysicalHost) error + + ActionBootstrap(*PhysicalHost) (*PhysicalHost, error) + + ActionCreate(*PhysicalHost) (*PhysicalHost, error) + + ActionError(*PhysicalHost) (*PhysicalHost, error) + + ActionRemove(*PhysicalHost) (*PhysicalHost, error) + + ActionUpdate(*PhysicalHost) (*PhysicalHost, error) +} + +func newPhysicalHostClient(rancherClient *RancherClient) *PhysicalHostClient { + return &PhysicalHostClient{ + rancherClient: rancherClient, + } +} + +func (c *PhysicalHostClient) Create(container *PhysicalHost) (*PhysicalHost, error) { + resp := &PhysicalHost{} + err := c.rancherClient.doCreate(PHYSICAL_HOST_TYPE, container, resp) + return resp, err +} + +func (c *PhysicalHostClient) Update(existing *PhysicalHost, updates interface{}) (*PhysicalHost, error) { + resp := &PhysicalHost{} + err := c.rancherClient.doUpdate(PHYSICAL_HOST_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *PhysicalHostClient) List(opts *ListOpts) (*PhysicalHostCollection, error) { + resp := &PhysicalHostCollection{} + err := c.rancherClient.doList(PHYSICAL_HOST_TYPE, opts, resp) + return resp, err +} + +func (c *PhysicalHostClient) ById(id string) (*PhysicalHost, error) { + resp := &PhysicalHost{} + err := c.rancherClient.doById(PHYSICAL_HOST_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *PhysicalHostClient) Delete(container *PhysicalHost) error { + return c.rancherClient.doResourceDelete(PHYSICAL_HOST_TYPE, &container.Resource) +} + +func (c *PhysicalHostClient) ActionBootstrap(resource *PhysicalHost) (*PhysicalHost, error) { + + resp := &PhysicalHost{} + + err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "bootstrap", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PhysicalHostClient) ActionCreate(resource *PhysicalHost) (*PhysicalHost, error) { + + resp := &PhysicalHost{} + + err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PhysicalHostClient) ActionError(resource *PhysicalHost) (*PhysicalHost, error) { + + resp := &PhysicalHost{} + + err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PhysicalHostClient) ActionRemove(resource *PhysicalHost) (*PhysicalHost, error) { + + resp := &PhysicalHost{} + + err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PhysicalHostClient) ActionUpdate(resource *PhysicalHost) (*PhysicalHost, error) { + + resp := &PhysicalHost{} + + err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_port.go b/vendor/github.com/rancher/go-rancher/v2/generated_port.go new file mode 100644 index 000000000..3db9283d2 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_port.go @@ -0,0 +1,182 @@ +package client + +const ( + PORT_TYPE = "port" +) + +type Port struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + BindAddress string `json:"bindAddress,omitempty" yaml:"bind_address,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PrivateIpAddressId string `json:"privateIpAddressId,omitempty" yaml:"private_ip_address_id,omitempty"` + + PrivatePort int64 `json:"privatePort,omitempty" yaml:"private_port,omitempty"` + + Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` + + PublicIpAddressId string `json:"publicIpAddressId,omitempty" yaml:"public_ip_address_id,omitempty"` + + PublicPort int64 `json:"publicPort,omitempty" yaml:"public_port,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type PortCollection struct { + Collection + Data []Port `json:"data,omitempty"` +} + +type PortClient struct { + rancherClient *RancherClient +} + +type PortOperations interface { + List(opts *ListOpts) (*PortCollection, error) + Create(opts *Port) (*Port, error) + Update(existing *Port, updates interface{}) (*Port, error) + ById(id string) (*Port, error) + Delete(container *Port) error + + ActionActivate(*Port) (*Port, error) + + ActionCreate(*Port) (*Port, error) + + ActionDeactivate(*Port) (*Port, error) + + ActionPurge(*Port) (*Port, error) + + ActionRemove(*Port) (*Port, error) + + ActionRestore(*Port) (*Port, error) + + ActionUpdate(*Port) (*Port, error) +} + +func newPortClient(rancherClient *RancherClient) *PortClient { + return &PortClient{ + rancherClient: rancherClient, + } +} + +func (c *PortClient) Create(container *Port) (*Port, error) { + resp := &Port{} + err := c.rancherClient.doCreate(PORT_TYPE, container, resp) + return resp, err +} + +func (c *PortClient) Update(existing *Port, updates interface{}) (*Port, error) { + resp := &Port{} + err := c.rancherClient.doUpdate(PORT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *PortClient) List(opts *ListOpts) (*PortCollection, error) { + resp := &PortCollection{} + err := c.rancherClient.doList(PORT_TYPE, opts, resp) + return resp, err +} + +func (c *PortClient) ById(id string) (*Port, error) { + resp := &Port{} + err := c.rancherClient.doById(PORT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *PortClient) Delete(container *Port) error { + return c.rancherClient.doResourceDelete(PORT_TYPE, &container.Resource) +} + +func (c *PortClient) ActionActivate(resource *Port) (*Port, error) { + + resp := &Port{} + + err := c.rancherClient.doAction(PORT_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PortClient) ActionCreate(resource *Port) (*Port, error) { + + resp := &Port{} + + err := c.rancherClient.doAction(PORT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PortClient) ActionDeactivate(resource *Port) (*Port, error) { + + resp := &Port{} + + err := c.rancherClient.doAction(PORT_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PortClient) ActionPurge(resource *Port) (*Port, error) { + + resp := &Port{} + + err := c.rancherClient.doAction(PORT_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PortClient) ActionRemove(resource *Port) (*Port, error) { + + resp := &Port{} + + err := c.rancherClient.doAction(PORT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PortClient) ActionRestore(resource *Port) (*Port, error) { + + resp := &Port{} + + err := c.rancherClient.doAction(PORT_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PortClient) ActionUpdate(resource *Port) (*Port, error) { + + resp := &Port{} + + err := c.rancherClient.doAction(PORT_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go new file mode 100644 index 000000000..e6403303f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go @@ -0,0 +1,79 @@ +package client + +const ( + PROCESS_DEFINITION_TYPE = "processDefinition" +) + +type ProcessDefinition struct { + Resource + + ExtensionBased bool `json:"extensionBased,omitempty" yaml:"extension_based,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PostProcessListeners interface{} `json:"postProcessListeners,omitempty" yaml:"post_process_listeners,omitempty"` + + PreProcessListeners interface{} `json:"preProcessListeners,omitempty" yaml:"pre_process_listeners,omitempty"` + + ProcessHandlers interface{} `json:"processHandlers,omitempty" yaml:"process_handlers,omitempty"` + + ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` + + StateTransitions []interface{} `json:"stateTransitions,omitempty" yaml:"state_transitions,omitempty"` +} + +type ProcessDefinitionCollection struct { + Collection + Data []ProcessDefinition `json:"data,omitempty"` +} + +type ProcessDefinitionClient struct { + rancherClient *RancherClient +} + +type ProcessDefinitionOperations interface { + List(opts *ListOpts) (*ProcessDefinitionCollection, error) + Create(opts *ProcessDefinition) (*ProcessDefinition, error) + Update(existing *ProcessDefinition, updates interface{}) (*ProcessDefinition, error) + ById(id string) (*ProcessDefinition, error) + Delete(container *ProcessDefinition) error +} + +func newProcessDefinitionClient(rancherClient *RancherClient) *ProcessDefinitionClient { + return &ProcessDefinitionClient{ + rancherClient: rancherClient, + } +} + +func (c *ProcessDefinitionClient) Create(container *ProcessDefinition) (*ProcessDefinition, error) { + resp := &ProcessDefinition{} + err := c.rancherClient.doCreate(PROCESS_DEFINITION_TYPE, container, resp) + return resp, err +} + +func (c *ProcessDefinitionClient) Update(existing *ProcessDefinition, updates interface{}) (*ProcessDefinition, error) { + resp := &ProcessDefinition{} + err := c.rancherClient.doUpdate(PROCESS_DEFINITION_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ProcessDefinitionClient) List(opts *ListOpts) (*ProcessDefinitionCollection, error) { + resp := &ProcessDefinitionCollection{} + err := c.rancherClient.doList(PROCESS_DEFINITION_TYPE, opts, resp) + return resp, err +} + +func (c *ProcessDefinitionClient) ById(id string) (*ProcessDefinition, error) { + resp := &ProcessDefinition{} + err := c.rancherClient.doById(PROCESS_DEFINITION_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ProcessDefinitionClient) Delete(container *ProcessDefinition) error { + return c.rancherClient.doResourceDelete(PROCESS_DEFINITION_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go new file mode 100644 index 000000000..05e12914a --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go @@ -0,0 +1,73 @@ +package client + +const ( + PROCESS_EXECUTION_TYPE = "processExecution" +) + +type ProcessExecution struct { + Resource + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Log map[string]interface{} `json:"log,omitempty" yaml:"log,omitempty"` + + ProcessInstanceId string `json:"processInstanceId,omitempty" yaml:"process_instance_id,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ProcessExecutionCollection struct { + Collection + Data []ProcessExecution `json:"data,omitempty"` +} + +type ProcessExecutionClient struct { + rancherClient *RancherClient +} + +type ProcessExecutionOperations interface { + List(opts *ListOpts) (*ProcessExecutionCollection, error) + Create(opts *ProcessExecution) (*ProcessExecution, error) + Update(existing *ProcessExecution, updates interface{}) (*ProcessExecution, error) + ById(id string) (*ProcessExecution, error) + Delete(container *ProcessExecution) error +} + +func newProcessExecutionClient(rancherClient *RancherClient) *ProcessExecutionClient { + return &ProcessExecutionClient{ + rancherClient: rancherClient, + } +} + +func (c *ProcessExecutionClient) Create(container *ProcessExecution) (*ProcessExecution, error) { + resp := &ProcessExecution{} + err := c.rancherClient.doCreate(PROCESS_EXECUTION_TYPE, container, resp) + return resp, err +} + +func (c *ProcessExecutionClient) Update(existing *ProcessExecution, updates interface{}) (*ProcessExecution, error) { + resp := &ProcessExecution{} + err := c.rancherClient.doUpdate(PROCESS_EXECUTION_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ProcessExecutionClient) List(opts *ListOpts) (*ProcessExecutionCollection, error) { + resp := &ProcessExecutionCollection{} + err := c.rancherClient.doList(PROCESS_EXECUTION_TYPE, opts, resp) + return resp, err +} + +func (c *ProcessExecutionClient) ById(id string) (*ProcessExecution, error) { + resp := &ProcessExecution{} + err := c.rancherClient.doById(PROCESS_EXECUTION_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ProcessExecutionClient) Delete(container *ProcessExecution) error { + return c.rancherClient.doResourceDelete(PROCESS_EXECUTION_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go new file mode 100644 index 000000000..6ba08dfea --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go @@ -0,0 +1,89 @@ +package client + +const ( + PROCESS_INSTANCE_TYPE = "processInstance" +) + +type ProcessInstance struct { + Resource + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` + + ExitReason string `json:"exitReason,omitempty" yaml:"exit_reason,omitempty"` + + Phase string `json:"phase,omitempty" yaml:"phase,omitempty"` + + Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` + + ProcessName string `json:"processName,omitempty" yaml:"process_name,omitempty"` + + ResourceId string `json:"resourceId,omitempty" yaml:"resource_id,omitempty"` + + ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` + + Result string `json:"result,omitempty" yaml:"result,omitempty"` + + RunningProcessServerId string `json:"runningProcessServerId,omitempty" yaml:"running_process_server_id,omitempty"` + + StartProcessServerId string `json:"startProcessServerId,omitempty" yaml:"start_process_server_id,omitempty"` + + StartTime string `json:"startTime,omitempty" yaml:"start_time,omitempty"` +} + +type ProcessInstanceCollection struct { + Collection + Data []ProcessInstance `json:"data,omitempty"` +} + +type ProcessInstanceClient struct { + rancherClient *RancherClient +} + +type ProcessInstanceOperations interface { + List(opts *ListOpts) (*ProcessInstanceCollection, error) + Create(opts *ProcessInstance) (*ProcessInstance, error) + Update(existing *ProcessInstance, updates interface{}) (*ProcessInstance, error) + ById(id string) (*ProcessInstance, error) + Delete(container *ProcessInstance) error +} + +func newProcessInstanceClient(rancherClient *RancherClient) *ProcessInstanceClient { + return &ProcessInstanceClient{ + rancherClient: rancherClient, + } +} + +func (c *ProcessInstanceClient) Create(container *ProcessInstance) (*ProcessInstance, error) { + resp := &ProcessInstance{} + err := c.rancherClient.doCreate(PROCESS_INSTANCE_TYPE, container, resp) + return resp, err +} + +func (c *ProcessInstanceClient) Update(existing *ProcessInstance, updates interface{}) (*ProcessInstance, error) { + resp := &ProcessInstance{} + err := c.rancherClient.doUpdate(PROCESS_INSTANCE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ProcessInstanceClient) List(opts *ListOpts) (*ProcessInstanceCollection, error) { + resp := &ProcessInstanceCollection{} + err := c.rancherClient.doList(PROCESS_INSTANCE_TYPE, opts, resp) + return resp, err +} + +func (c *ProcessInstanceClient) ById(id string) (*ProcessInstance, error) { + resp := &ProcessInstance{} + err := c.rancherClient.doById(PROCESS_INSTANCE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ProcessInstanceClient) Delete(container *ProcessInstance) error { + return c.rancherClient.doResourceDelete(PROCESS_INSTANCE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_project.go b/vendor/github.com/rancher/go-rancher/v2/generated_project.go new file mode 100644 index 000000000..17f21401c --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_project.go @@ -0,0 +1,193 @@ +package client + +const ( + PROJECT_TYPE = "project" +) + +type Project struct { + Resource + + AllowSystemRole bool `json:"allowSystemRole,omitempty" yaml:"allow_system_role,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Kubernetes bool `json:"kubernetes,omitempty" yaml:"kubernetes,omitempty"` + + Members []interface{} `json:"members,omitempty" yaml:"members,omitempty"` + + Mesos bool `json:"mesos,omitempty" yaml:"mesos,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PublicDns bool `json:"publicDns,omitempty" yaml:"public_dns,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + ServicesPortRange *ServicesPortRange `json:"servicesPortRange,omitempty" yaml:"services_port_range,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Swarm bool `json:"swarm,omitempty" yaml:"swarm,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + VirtualMachine bool `json:"virtualMachine,omitempty" yaml:"virtual_machine,omitempty"` +} + +type ProjectCollection struct { + Collection + Data []Project `json:"data,omitempty"` +} + +type ProjectClient struct { + rancherClient *RancherClient +} + +type ProjectOperations interface { + List(opts *ListOpts) (*ProjectCollection, error) + Create(opts *Project) (*Project, error) + Update(existing *Project, updates interface{}) (*Project, error) + ById(id string) (*Project, error) + Delete(container *Project) error + + ActionActivate(*Project) (*Account, error) + + ActionCreate(*Project) (*Account, error) + + ActionDeactivate(*Project) (*Account, error) + + ActionPurge(*Project) (*Account, error) + + ActionRemove(*Project) (*Account, error) + + ActionRestore(*Project) (*Account, error) + + ActionSetmembers(*Project, *SetProjectMembersInput) (*SetProjectMembersInput, error) + + ActionUpdate(*Project) (*Account, error) +} + +func newProjectClient(rancherClient *RancherClient) *ProjectClient { + return &ProjectClient{ + rancherClient: rancherClient, + } +} + +func (c *ProjectClient) Create(container *Project) (*Project, error) { + resp := &Project{} + err := c.rancherClient.doCreate(PROJECT_TYPE, container, resp) + return resp, err +} + +func (c *ProjectClient) Update(existing *Project, updates interface{}) (*Project, error) { + resp := &Project{} + err := c.rancherClient.doUpdate(PROJECT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ProjectClient) List(opts *ListOpts) (*ProjectCollection, error) { + resp := &ProjectCollection{} + err := c.rancherClient.doList(PROJECT_TYPE, opts, resp) + return resp, err +} + +func (c *ProjectClient) ById(id string) (*Project, error) { + resp := &Project{} + err := c.rancherClient.doById(PROJECT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ProjectClient) Delete(container *Project) error { + return c.rancherClient.doResourceDelete(PROJECT_TYPE, &container.Resource) +} + +func (c *ProjectClient) ActionActivate(resource *Project) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(PROJECT_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectClient) ActionCreate(resource *Project) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(PROJECT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectClient) ActionDeactivate(resource *Project) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(PROJECT_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectClient) ActionPurge(resource *Project) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(PROJECT_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectClient) ActionRemove(resource *Project) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(PROJECT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectClient) ActionRestore(resource *Project) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(PROJECT_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectClient) ActionSetmembers(resource *Project, input *SetProjectMembersInput) (*SetProjectMembersInput, error) { + + resp := &SetProjectMembersInput{} + + err := c.rancherClient.doAction(PROJECT_TYPE, "setmembers", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ProjectClient) ActionUpdate(resource *Project) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(PROJECT_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go b/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go new file mode 100644 index 000000000..82ba10bd4 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go @@ -0,0 +1,174 @@ +package client + +const ( + PROJECT_MEMBER_TYPE = "projectMember" +) + +type ProjectMember struct { + Resource + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + ExternalIdType string `json:"externalIdType,omitempty" yaml:"external_id_type,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + Role string `json:"role,omitempty" yaml:"role,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ProjectMemberCollection struct { + Collection + Data []ProjectMember `json:"data,omitempty"` +} + +type ProjectMemberClient struct { + rancherClient *RancherClient +} + +type ProjectMemberOperations interface { + List(opts *ListOpts) (*ProjectMemberCollection, error) + Create(opts *ProjectMember) (*ProjectMember, error) + Update(existing *ProjectMember, updates interface{}) (*ProjectMember, error) + ById(id string) (*ProjectMember, error) + Delete(container *ProjectMember) error + + ActionActivate(*ProjectMember) (*ProjectMember, error) + + ActionCreate(*ProjectMember) (*ProjectMember, error) + + ActionDeactivate(*ProjectMember) (*ProjectMember, error) + + ActionPurge(*ProjectMember) (*ProjectMember, error) + + ActionRemove(*ProjectMember) (*ProjectMember, error) + + ActionRestore(*ProjectMember) (*ProjectMember, error) + + ActionUpdate(*ProjectMember) (*ProjectMember, error) +} + +func newProjectMemberClient(rancherClient *RancherClient) *ProjectMemberClient { + return &ProjectMemberClient{ + rancherClient: rancherClient, + } +} + +func (c *ProjectMemberClient) Create(container *ProjectMember) (*ProjectMember, error) { + resp := &ProjectMember{} + err := c.rancherClient.doCreate(PROJECT_MEMBER_TYPE, container, resp) + return resp, err +} + +func (c *ProjectMemberClient) Update(existing *ProjectMember, updates interface{}) (*ProjectMember, error) { + resp := &ProjectMember{} + err := c.rancherClient.doUpdate(PROJECT_MEMBER_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ProjectMemberClient) List(opts *ListOpts) (*ProjectMemberCollection, error) { + resp := &ProjectMemberCollection{} + err := c.rancherClient.doList(PROJECT_MEMBER_TYPE, opts, resp) + return resp, err +} + +func (c *ProjectMemberClient) ById(id string) (*ProjectMember, error) { + resp := &ProjectMember{} + err := c.rancherClient.doById(PROJECT_MEMBER_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ProjectMemberClient) Delete(container *ProjectMember) error { + return c.rancherClient.doResourceDelete(PROJECT_MEMBER_TYPE, &container.Resource) +} + +func (c *ProjectMemberClient) ActionActivate(resource *ProjectMember) (*ProjectMember, error) { + + resp := &ProjectMember{} + + err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectMemberClient) ActionCreate(resource *ProjectMember) (*ProjectMember, error) { + + resp := &ProjectMember{} + + err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectMemberClient) ActionDeactivate(resource *ProjectMember) (*ProjectMember, error) { + + resp := &ProjectMember{} + + err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectMemberClient) ActionPurge(resource *ProjectMember) (*ProjectMember, error) { + + resp := &ProjectMember{} + + err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectMemberClient) ActionRemove(resource *ProjectMember) (*ProjectMember, error) { + + resp := &ProjectMember{} + + err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectMemberClient) ActionRestore(resource *ProjectMember) (*ProjectMember, error) { + + resp := &ProjectMember{} + + err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectMemberClient) ActionUpdate(resource *ProjectMember) (*ProjectMember, error) { + + resp := &ProjectMember{} + + err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go b/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go new file mode 100644 index 000000000..3d85858ef --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go @@ -0,0 +1,75 @@ +package client + +const ( + PUBLIC_ENDPOINT_TYPE = "publicEndpoint" +) + +type PublicEndpoint struct { + Resource + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + IpAddress string `json:"ipAddress,omitempty" yaml:"ip_address,omitempty"` + + Port int64 `json:"port,omitempty" yaml:"port,omitempty"` + + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` +} + +type PublicEndpointCollection struct { + Collection + Data []PublicEndpoint `json:"data,omitempty"` +} + +type PublicEndpointClient struct { + rancherClient *RancherClient +} + +type PublicEndpointOperations interface { + List(opts *ListOpts) (*PublicEndpointCollection, error) + Create(opts *PublicEndpoint) (*PublicEndpoint, error) + Update(existing *PublicEndpoint, updates interface{}) (*PublicEndpoint, error) + ById(id string) (*PublicEndpoint, error) + Delete(container *PublicEndpoint) error +} + +func newPublicEndpointClient(rancherClient *RancherClient) *PublicEndpointClient { + return &PublicEndpointClient{ + rancherClient: rancherClient, + } +} + +func (c *PublicEndpointClient) Create(container *PublicEndpoint) (*PublicEndpoint, error) { + resp := &PublicEndpoint{} + err := c.rancherClient.doCreate(PUBLIC_ENDPOINT_TYPE, container, resp) + return resp, err +} + +func (c *PublicEndpointClient) Update(existing *PublicEndpoint, updates interface{}) (*PublicEndpoint, error) { + resp := &PublicEndpoint{} + err := c.rancherClient.doUpdate(PUBLIC_ENDPOINT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *PublicEndpointClient) List(opts *ListOpts) (*PublicEndpointCollection, error) { + resp := &PublicEndpointCollection{} + err := c.rancherClient.doList(PUBLIC_ENDPOINT_TYPE, opts, resp) + return resp, err +} + +func (c *PublicEndpointClient) ById(id string) (*PublicEndpoint, error) { + resp := &PublicEndpoint{} + err := c.rancherClient.doById(PUBLIC_ENDPOINT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *PublicEndpointClient) Delete(container *PublicEndpoint) error { + return c.rancherClient.doResourceDelete(PUBLIC_ENDPOINT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_publish.go b/vendor/github.com/rancher/go-rancher/v2/generated_publish.go new file mode 100644 index 000000000..9071207f5 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_publish.go @@ -0,0 +1,87 @@ +package client + +const ( + PUBLISH_TYPE = "publish" +) + +type Publish struct { + Resource + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PreviousIds []string `json:"previousIds,omitempty" yaml:"previous_ids,omitempty"` + + Publisher string `json:"publisher,omitempty" yaml:"publisher,omitempty"` + + ResourceId string `json:"resourceId,omitempty" yaml:"resource_id,omitempty"` + + ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` + + Time int64 `json:"time,omitempty" yaml:"time,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningInternalMessage string `json:"transitioningInternalMessage,omitempty" yaml:"transitioning_internal_message,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` +} + +type PublishCollection struct { + Collection + Data []Publish `json:"data,omitempty"` +} + +type PublishClient struct { + rancherClient *RancherClient +} + +type PublishOperations interface { + List(opts *ListOpts) (*PublishCollection, error) + Create(opts *Publish) (*Publish, error) + Update(existing *Publish, updates interface{}) (*Publish, error) + ById(id string) (*Publish, error) + Delete(container *Publish) error +} + +func newPublishClient(rancherClient *RancherClient) *PublishClient { + return &PublishClient{ + rancherClient: rancherClient, + } +} + +func (c *PublishClient) Create(container *Publish) (*Publish, error) { + resp := &Publish{} + err := c.rancherClient.doCreate(PUBLISH_TYPE, container, resp) + return resp, err +} + +func (c *PublishClient) Update(existing *Publish, updates interface{}) (*Publish, error) { + resp := &Publish{} + err := c.rancherClient.doUpdate(PUBLISH_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *PublishClient) List(opts *ListOpts) (*PublishCollection, error) { + resp := &PublishCollection{} + err := c.rancherClient.doList(PUBLISH_TYPE, opts, resp) + return resp, err +} + +func (c *PublishClient) ById(id string) (*Publish, error) { + resp := &Publish{} + err := c.rancherClient.doById(PUBLISH_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *PublishClient) Delete(container *Publish) error { + return c.rancherClient.doResourceDelete(PUBLISH_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go b/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go new file mode 100644 index 000000000..a077e8885 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go @@ -0,0 +1,99 @@ +package client + +const ( + PULL_TASK_TYPE = "pullTask" +) + +type PullTask struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Image string `json:"image,omitempty" yaml:"image,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + + Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Status map[string]interface{} `json:"status,omitempty" yaml:"status,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type PullTaskCollection struct { + Collection + Data []PullTask `json:"data,omitempty"` +} + +type PullTaskClient struct { + rancherClient *RancherClient +} + +type PullTaskOperations interface { + List(opts *ListOpts) (*PullTaskCollection, error) + Create(opts *PullTask) (*PullTask, error) + Update(existing *PullTask, updates interface{}) (*PullTask, error) + ById(id string) (*PullTask, error) + Delete(container *PullTask) error +} + +func newPullTaskClient(rancherClient *RancherClient) *PullTaskClient { + return &PullTaskClient{ + rancherClient: rancherClient, + } +} + +func (c *PullTaskClient) Create(container *PullTask) (*PullTask, error) { + resp := &PullTask{} + err := c.rancherClient.doCreate(PULL_TASK_TYPE, container, resp) + return resp, err +} + +func (c *PullTaskClient) Update(existing *PullTask, updates interface{}) (*PullTask, error) { + resp := &PullTask{} + err := c.rancherClient.doUpdate(PULL_TASK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *PullTaskClient) List(opts *ListOpts) (*PullTaskCollection, error) { + resp := &PullTaskCollection{} + err := c.rancherClient.doList(PULL_TASK_TYPE, opts, resp) + return resp, err +} + +func (c *PullTaskClient) ById(id string) (*PullTask, error) { + resp := &PullTask{} + err := c.rancherClient.doById(PULL_TASK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *PullTaskClient) Delete(container *PullTask) error { + return c.rancherClient.doResourceDelete(PULL_TASK_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go new file mode 100644 index 000000000..a8a89ed8c --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go @@ -0,0 +1,67 @@ +package client + +const ( + RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE = "recreateOnQuorumStrategyConfig" +) + +type RecreateOnQuorumStrategyConfig struct { + Resource + + Quorum int64 `json:"quorum,omitempty" yaml:"quorum,omitempty"` +} + +type RecreateOnQuorumStrategyConfigCollection struct { + Collection + Data []RecreateOnQuorumStrategyConfig `json:"data,omitempty"` +} + +type RecreateOnQuorumStrategyConfigClient struct { + rancherClient *RancherClient +} + +type RecreateOnQuorumStrategyConfigOperations interface { + List(opts *ListOpts) (*RecreateOnQuorumStrategyConfigCollection, error) + Create(opts *RecreateOnQuorumStrategyConfig) (*RecreateOnQuorumStrategyConfig, error) + Update(existing *RecreateOnQuorumStrategyConfig, updates interface{}) (*RecreateOnQuorumStrategyConfig, error) + ById(id string) (*RecreateOnQuorumStrategyConfig, error) + Delete(container *RecreateOnQuorumStrategyConfig) error +} + +func newRecreateOnQuorumStrategyConfigClient(rancherClient *RancherClient) *RecreateOnQuorumStrategyConfigClient { + return &RecreateOnQuorumStrategyConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *RecreateOnQuorumStrategyConfigClient) Create(container *RecreateOnQuorumStrategyConfig) (*RecreateOnQuorumStrategyConfig, error) { + resp := &RecreateOnQuorumStrategyConfig{} + err := c.rancherClient.doCreate(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *RecreateOnQuorumStrategyConfigClient) Update(existing *RecreateOnQuorumStrategyConfig, updates interface{}) (*RecreateOnQuorumStrategyConfig, error) { + resp := &RecreateOnQuorumStrategyConfig{} + err := c.rancherClient.doUpdate(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *RecreateOnQuorumStrategyConfigClient) List(opts *ListOpts) (*RecreateOnQuorumStrategyConfigCollection, error) { + resp := &RecreateOnQuorumStrategyConfigCollection{} + err := c.rancherClient.doList(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *RecreateOnQuorumStrategyConfigClient) ById(id string) (*RecreateOnQuorumStrategyConfig, error) { + resp := &RecreateOnQuorumStrategyConfig{} + err := c.rancherClient.doById(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *RecreateOnQuorumStrategyConfigClient) Delete(container *RecreateOnQuorumStrategyConfig) error { + return c.rancherClient.doResourceDelete(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_register.go b/vendor/github.com/rancher/go-rancher/v2/generated_register.go new file mode 100644 index 000000000..510cd1602 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_register.go @@ -0,0 +1,108 @@ +package client + +const ( + REGISTER_TYPE = "register" +) + +type Register struct { + Resource + + AccessKey string `json:"accessKey,omitempty" yaml:"access_key,omitempty"` + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Key string `json:"key,omitempty" yaml:"key,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + SecretKey string `json:"secretKey,omitempty" yaml:"secret_key,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type RegisterCollection struct { + Collection + Data []Register `json:"data,omitempty"` +} + +type RegisterClient struct { + rancherClient *RancherClient +} + +type RegisterOperations interface { + List(opts *ListOpts) (*RegisterCollection, error) + Create(opts *Register) (*Register, error) + Update(existing *Register, updates interface{}) (*Register, error) + ById(id string) (*Register, error) + Delete(container *Register) error + + ActionStop(*Register, *InstanceStop) (*Instance, error) +} + +func newRegisterClient(rancherClient *RancherClient) *RegisterClient { + return &RegisterClient{ + rancherClient: rancherClient, + } +} + +func (c *RegisterClient) Create(container *Register) (*Register, error) { + resp := &Register{} + err := c.rancherClient.doCreate(REGISTER_TYPE, container, resp) + return resp, err +} + +func (c *RegisterClient) Update(existing *Register, updates interface{}) (*Register, error) { + resp := &Register{} + err := c.rancherClient.doUpdate(REGISTER_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *RegisterClient) List(opts *ListOpts) (*RegisterCollection, error) { + resp := &RegisterCollection{} + err := c.rancherClient.doList(REGISTER_TYPE, opts, resp) + return resp, err +} + +func (c *RegisterClient) ById(id string) (*Register, error) { + resp := &Register{} + err := c.rancherClient.doById(REGISTER_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *RegisterClient) Delete(container *Register) error { + return c.rancherClient.doResourceDelete(REGISTER_TYPE, &container.Resource) +} + +func (c *RegisterClient) ActionStop(resource *Register, input *InstanceStop) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(REGISTER_TYPE, "stop", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go b/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go new file mode 100644 index 000000000..01b8cd8e1 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go @@ -0,0 +1,165 @@ +package client + +const ( + REGISTRATION_TOKEN_TYPE = "registrationToken" +) + +type RegistrationToken struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Command string `json:"command,omitempty" yaml:"command,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Image string `json:"image,omitempty" yaml:"image,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RegistrationUrl string `json:"registrationUrl,omitempty" yaml:"registration_url,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Token string `json:"token,omitempty" yaml:"token,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type RegistrationTokenCollection struct { + Collection + Data []RegistrationToken `json:"data,omitempty"` +} + +type RegistrationTokenClient struct { + rancherClient *RancherClient +} + +type RegistrationTokenOperations interface { + List(opts *ListOpts) (*RegistrationTokenCollection, error) + Create(opts *RegistrationToken) (*RegistrationToken, error) + Update(existing *RegistrationToken, updates interface{}) (*RegistrationToken, error) + ById(id string) (*RegistrationToken, error) + Delete(container *RegistrationToken) error + + ActionActivate(*RegistrationToken) (*Credential, error) + + ActionCreate(*RegistrationToken) (*Credential, error) + + ActionDeactivate(*RegistrationToken) (*Credential, error) + + ActionPurge(*RegistrationToken) (*Credential, error) + + ActionRemove(*RegistrationToken) (*Credential, error) + + ActionUpdate(*RegistrationToken) (*Credential, error) +} + +func newRegistrationTokenClient(rancherClient *RancherClient) *RegistrationTokenClient { + return &RegistrationTokenClient{ + rancherClient: rancherClient, + } +} + +func (c *RegistrationTokenClient) Create(container *RegistrationToken) (*RegistrationToken, error) { + resp := &RegistrationToken{} + err := c.rancherClient.doCreate(REGISTRATION_TOKEN_TYPE, container, resp) + return resp, err +} + +func (c *RegistrationTokenClient) Update(existing *RegistrationToken, updates interface{}) (*RegistrationToken, error) { + resp := &RegistrationToken{} + err := c.rancherClient.doUpdate(REGISTRATION_TOKEN_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *RegistrationTokenClient) List(opts *ListOpts) (*RegistrationTokenCollection, error) { + resp := &RegistrationTokenCollection{} + err := c.rancherClient.doList(REGISTRATION_TOKEN_TYPE, opts, resp) + return resp, err +} + +func (c *RegistrationTokenClient) ById(id string) (*RegistrationToken, error) { + resp := &RegistrationToken{} + err := c.rancherClient.doById(REGISTRATION_TOKEN_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *RegistrationTokenClient) Delete(container *RegistrationToken) error { + return c.rancherClient.doResourceDelete(REGISTRATION_TOKEN_TYPE, &container.Resource) +} + +func (c *RegistrationTokenClient) ActionActivate(resource *RegistrationToken) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistrationTokenClient) ActionCreate(resource *RegistrationToken) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistrationTokenClient) ActionDeactivate(resource *RegistrationToken) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistrationTokenClient) ActionPurge(resource *RegistrationToken) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistrationTokenClient) ActionRemove(resource *RegistrationToken) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistrationTokenClient) ActionUpdate(resource *RegistrationToken) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_registry.go b/vendor/github.com/rancher/go-rancher/v2/generated_registry.go new file mode 100644 index 000000000..6dbeb4fb7 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_registry.go @@ -0,0 +1,180 @@ +package client + +const ( + REGISTRY_TYPE = "registry" +) + +type Registry struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + BlockDevicePath string `json:"blockDevicePath,omitempty" yaml:"block_device_path,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + DriverName string `json:"driverName,omitempty" yaml:"driver_name,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + ServerAddress string `json:"serverAddress,omitempty" yaml:"server_address,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` + + VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` +} + +type RegistryCollection struct { + Collection + Data []Registry `json:"data,omitempty"` +} + +type RegistryClient struct { + rancherClient *RancherClient +} + +type RegistryOperations interface { + List(opts *ListOpts) (*RegistryCollection, error) + Create(opts *Registry) (*Registry, error) + Update(existing *Registry, updates interface{}) (*Registry, error) + ById(id string) (*Registry, error) + Delete(container *Registry) error + + ActionActivate(*Registry) (*StoragePool, error) + + ActionCreate(*Registry) (*StoragePool, error) + + ActionDeactivate(*Registry) (*StoragePool, error) + + ActionPurge(*Registry) (*StoragePool, error) + + ActionRemove(*Registry) (*StoragePool, error) + + ActionRestore(*Registry) (*StoragePool, error) + + ActionUpdate(*Registry) (*StoragePool, error) +} + +func newRegistryClient(rancherClient *RancherClient) *RegistryClient { + return &RegistryClient{ + rancherClient: rancherClient, + } +} + +func (c *RegistryClient) Create(container *Registry) (*Registry, error) { + resp := &Registry{} + err := c.rancherClient.doCreate(REGISTRY_TYPE, container, resp) + return resp, err +} + +func (c *RegistryClient) Update(existing *Registry, updates interface{}) (*Registry, error) { + resp := &Registry{} + err := c.rancherClient.doUpdate(REGISTRY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *RegistryClient) List(opts *ListOpts) (*RegistryCollection, error) { + resp := &RegistryCollection{} + err := c.rancherClient.doList(REGISTRY_TYPE, opts, resp) + return resp, err +} + +func (c *RegistryClient) ById(id string) (*Registry, error) { + resp := &Registry{} + err := c.rancherClient.doById(REGISTRY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *RegistryClient) Delete(container *Registry) error { + return c.rancherClient.doResourceDelete(REGISTRY_TYPE, &container.Resource) +} + +func (c *RegistryClient) ActionActivate(resource *Registry) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(REGISTRY_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistryClient) ActionCreate(resource *Registry) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(REGISTRY_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistryClient) ActionDeactivate(resource *Registry) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(REGISTRY_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistryClient) ActionPurge(resource *Registry) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(REGISTRY_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistryClient) ActionRemove(resource *Registry) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(REGISTRY_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistryClient) ActionRestore(resource *Registry) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(REGISTRY_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistryClient) ActionUpdate(resource *Registry) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(REGISTRY_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go b/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go new file mode 100644 index 000000000..e17ab42df --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go @@ -0,0 +1,165 @@ +package client + +const ( + REGISTRY_CREDENTIAL_TYPE = "registryCredential" +) + +type RegistryCredential struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Email string `json:"email,omitempty" yaml:"email,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` + + RegistryId string `json:"registryId,omitempty" yaml:"registry_id,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type RegistryCredentialCollection struct { + Collection + Data []RegistryCredential `json:"data,omitempty"` +} + +type RegistryCredentialClient struct { + rancherClient *RancherClient +} + +type RegistryCredentialOperations interface { + List(opts *ListOpts) (*RegistryCredentialCollection, error) + Create(opts *RegistryCredential) (*RegistryCredential, error) + Update(existing *RegistryCredential, updates interface{}) (*RegistryCredential, error) + ById(id string) (*RegistryCredential, error) + Delete(container *RegistryCredential) error + + ActionActivate(*RegistryCredential) (*Credential, error) + + ActionCreate(*RegistryCredential) (*Credential, error) + + ActionDeactivate(*RegistryCredential) (*Credential, error) + + ActionPurge(*RegistryCredential) (*Credential, error) + + ActionRemove(*RegistryCredential) (*Credential, error) + + ActionUpdate(*RegistryCredential) (*Credential, error) +} + +func newRegistryCredentialClient(rancherClient *RancherClient) *RegistryCredentialClient { + return &RegistryCredentialClient{ + rancherClient: rancherClient, + } +} + +func (c *RegistryCredentialClient) Create(container *RegistryCredential) (*RegistryCredential, error) { + resp := &RegistryCredential{} + err := c.rancherClient.doCreate(REGISTRY_CREDENTIAL_TYPE, container, resp) + return resp, err +} + +func (c *RegistryCredentialClient) Update(existing *RegistryCredential, updates interface{}) (*RegistryCredential, error) { + resp := &RegistryCredential{} + err := c.rancherClient.doUpdate(REGISTRY_CREDENTIAL_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *RegistryCredentialClient) List(opts *ListOpts) (*RegistryCredentialCollection, error) { + resp := &RegistryCredentialCollection{} + err := c.rancherClient.doList(REGISTRY_CREDENTIAL_TYPE, opts, resp) + return resp, err +} + +func (c *RegistryCredentialClient) ById(id string) (*RegistryCredential, error) { + resp := &RegistryCredential{} + err := c.rancherClient.doById(REGISTRY_CREDENTIAL_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *RegistryCredentialClient) Delete(container *RegistryCredential) error { + return c.rancherClient.doResourceDelete(REGISTRY_CREDENTIAL_TYPE, &container.Resource) +} + +func (c *RegistryCredentialClient) ActionActivate(resource *RegistryCredential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistryCredentialClient) ActionCreate(resource *RegistryCredential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistryCredentialClient) ActionDeactivate(resource *RegistryCredential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistryCredentialClient) ActionPurge(resource *RegistryCredential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistryCredentialClient) ActionRemove(resource *RegistryCredential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegistryCredentialClient) ActionUpdate(resource *RegistryCredential) (*Credential, error) { + + resp := &Credential{} + + err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go b/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go new file mode 100644 index 000000000..bb9a4a173 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go @@ -0,0 +1,67 @@ +package client + +const ( + RESOURCE_DEFINITION_TYPE = "resourceDefinition" +) + +type ResourceDefinition struct { + Resource + + Name string `json:"name,omitempty" yaml:"name,omitempty"` +} + +type ResourceDefinitionCollection struct { + Collection + Data []ResourceDefinition `json:"data,omitempty"` +} + +type ResourceDefinitionClient struct { + rancherClient *RancherClient +} + +type ResourceDefinitionOperations interface { + List(opts *ListOpts) (*ResourceDefinitionCollection, error) + Create(opts *ResourceDefinition) (*ResourceDefinition, error) + Update(existing *ResourceDefinition, updates interface{}) (*ResourceDefinition, error) + ById(id string) (*ResourceDefinition, error) + Delete(container *ResourceDefinition) error +} + +func newResourceDefinitionClient(rancherClient *RancherClient) *ResourceDefinitionClient { + return &ResourceDefinitionClient{ + rancherClient: rancherClient, + } +} + +func (c *ResourceDefinitionClient) Create(container *ResourceDefinition) (*ResourceDefinition, error) { + resp := &ResourceDefinition{} + err := c.rancherClient.doCreate(RESOURCE_DEFINITION_TYPE, container, resp) + return resp, err +} + +func (c *ResourceDefinitionClient) Update(existing *ResourceDefinition, updates interface{}) (*ResourceDefinition, error) { + resp := &ResourceDefinition{} + err := c.rancherClient.doUpdate(RESOURCE_DEFINITION_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ResourceDefinitionClient) List(opts *ListOpts) (*ResourceDefinitionCollection, error) { + resp := &ResourceDefinitionCollection{} + err := c.rancherClient.doList(RESOURCE_DEFINITION_TYPE, opts, resp) + return resp, err +} + +func (c *ResourceDefinitionClient) ById(id string) (*ResourceDefinition, error) { + resp := &ResourceDefinition{} + err := c.rancherClient.doById(RESOURCE_DEFINITION_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ResourceDefinitionClient) Delete(container *ResourceDefinition) error { + return c.rancherClient.doResourceDelete(RESOURCE_DEFINITION_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go new file mode 100644 index 000000000..f301adb5a --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go @@ -0,0 +1,69 @@ +package client + +const ( + RESTART_POLICY_TYPE = "restartPolicy" +) + +type RestartPolicy struct { + Resource + + MaximumRetryCount int64 `json:"maximumRetryCount,omitempty" yaml:"maximum_retry_count,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` +} + +type RestartPolicyCollection struct { + Collection + Data []RestartPolicy `json:"data,omitempty"` +} + +type RestartPolicyClient struct { + rancherClient *RancherClient +} + +type RestartPolicyOperations interface { + List(opts *ListOpts) (*RestartPolicyCollection, error) + Create(opts *RestartPolicy) (*RestartPolicy, error) + Update(existing *RestartPolicy, updates interface{}) (*RestartPolicy, error) + ById(id string) (*RestartPolicy, error) + Delete(container *RestartPolicy) error +} + +func newRestartPolicyClient(rancherClient *RancherClient) *RestartPolicyClient { + return &RestartPolicyClient{ + rancherClient: rancherClient, + } +} + +func (c *RestartPolicyClient) Create(container *RestartPolicy) (*RestartPolicy, error) { + resp := &RestartPolicy{} + err := c.rancherClient.doCreate(RESTART_POLICY_TYPE, container, resp) + return resp, err +} + +func (c *RestartPolicyClient) Update(existing *RestartPolicy, updates interface{}) (*RestartPolicy, error) { + resp := &RestartPolicy{} + err := c.rancherClient.doUpdate(RESTART_POLICY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *RestartPolicyClient) List(opts *ListOpts) (*RestartPolicyCollection, error) { + resp := &RestartPolicyCollection{} + err := c.rancherClient.doList(RESTART_POLICY_TYPE, opts, resp) + return resp, err +} + +func (c *RestartPolicyClient) ById(id string) (*RestartPolicy, error) { + resp := &RestartPolicy{} + err := c.rancherClient.doById(RESTART_POLICY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *RestartPolicyClient) Delete(container *RestartPolicy) error { + return c.rancherClient.doResourceDelete(RESTART_POLICY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go new file mode 100644 index 000000000..a4878de4b --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go @@ -0,0 +1,67 @@ +package client + +const ( + RESTORE_FROM_BACKUP_INPUT_TYPE = "restoreFromBackupInput" +) + +type RestoreFromBackupInput struct { + Resource + + BackupId string `json:"backupId,omitempty" yaml:"backup_id,omitempty"` +} + +type RestoreFromBackupInputCollection struct { + Collection + Data []RestoreFromBackupInput `json:"data,omitempty"` +} + +type RestoreFromBackupInputClient struct { + rancherClient *RancherClient +} + +type RestoreFromBackupInputOperations interface { + List(opts *ListOpts) (*RestoreFromBackupInputCollection, error) + Create(opts *RestoreFromBackupInput) (*RestoreFromBackupInput, error) + Update(existing *RestoreFromBackupInput, updates interface{}) (*RestoreFromBackupInput, error) + ById(id string) (*RestoreFromBackupInput, error) + Delete(container *RestoreFromBackupInput) error +} + +func newRestoreFromBackupInputClient(rancherClient *RancherClient) *RestoreFromBackupInputClient { + return &RestoreFromBackupInputClient{ + rancherClient: rancherClient, + } +} + +func (c *RestoreFromBackupInputClient) Create(container *RestoreFromBackupInput) (*RestoreFromBackupInput, error) { + resp := &RestoreFromBackupInput{} + err := c.rancherClient.doCreate(RESTORE_FROM_BACKUP_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *RestoreFromBackupInputClient) Update(existing *RestoreFromBackupInput, updates interface{}) (*RestoreFromBackupInput, error) { + resp := &RestoreFromBackupInput{} + err := c.rancherClient.doUpdate(RESTORE_FROM_BACKUP_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *RestoreFromBackupInputClient) List(opts *ListOpts) (*RestoreFromBackupInputCollection, error) { + resp := &RestoreFromBackupInputCollection{} + err := c.rancherClient.doList(RESTORE_FROM_BACKUP_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *RestoreFromBackupInputClient) ById(id string) (*RestoreFromBackupInput, error) { + resp := &RestoreFromBackupInput{} + err := c.rancherClient.doById(RESTORE_FROM_BACKUP_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *RestoreFromBackupInputClient) Delete(container *RestoreFromBackupInput) error { + return c.rancherClient.doResourceDelete(RESTORE_FROM_BACKUP_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go new file mode 100644 index 000000000..db702c9c8 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go @@ -0,0 +1,67 @@ +package client + +const ( + REVERT_TO_SNAPSHOT_INPUT_TYPE = "revertToSnapshotInput" +) + +type RevertToSnapshotInput struct { + Resource + + SnapshotId string `json:"snapshotId,omitempty" yaml:"snapshot_id,omitempty"` +} + +type RevertToSnapshotInputCollection struct { + Collection + Data []RevertToSnapshotInput `json:"data,omitempty"` +} + +type RevertToSnapshotInputClient struct { + rancherClient *RancherClient +} + +type RevertToSnapshotInputOperations interface { + List(opts *ListOpts) (*RevertToSnapshotInputCollection, error) + Create(opts *RevertToSnapshotInput) (*RevertToSnapshotInput, error) + Update(existing *RevertToSnapshotInput, updates interface{}) (*RevertToSnapshotInput, error) + ById(id string) (*RevertToSnapshotInput, error) + Delete(container *RevertToSnapshotInput) error +} + +func newRevertToSnapshotInputClient(rancherClient *RancherClient) *RevertToSnapshotInputClient { + return &RevertToSnapshotInputClient{ + rancherClient: rancherClient, + } +} + +func (c *RevertToSnapshotInputClient) Create(container *RevertToSnapshotInput) (*RevertToSnapshotInput, error) { + resp := &RevertToSnapshotInput{} + err := c.rancherClient.doCreate(REVERT_TO_SNAPSHOT_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *RevertToSnapshotInputClient) Update(existing *RevertToSnapshotInput, updates interface{}) (*RevertToSnapshotInput, error) { + resp := &RevertToSnapshotInput{} + err := c.rancherClient.doUpdate(REVERT_TO_SNAPSHOT_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *RevertToSnapshotInputClient) List(opts *ListOpts) (*RevertToSnapshotInputCollection, error) { + resp := &RevertToSnapshotInputCollection{} + err := c.rancherClient.doList(REVERT_TO_SNAPSHOT_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *RevertToSnapshotInputClient) ById(id string) (*RevertToSnapshotInput, error) { + resp := &RevertToSnapshotInput{} + err := c.rancherClient.doById(REVERT_TO_SNAPSHOT_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *RevertToSnapshotInputClient) Delete(container *RevertToSnapshotInput) error { + return c.rancherClient.doResourceDelete(REVERT_TO_SNAPSHOT_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go new file mode 100644 index 000000000..443f9f1ec --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go @@ -0,0 +1,69 @@ +package client + +const ( + ROLLING_RESTART_STRATEGY_TYPE = "rollingRestartStrategy" +) + +type RollingRestartStrategy struct { + Resource + + BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` + + IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` +} + +type RollingRestartStrategyCollection struct { + Collection + Data []RollingRestartStrategy `json:"data,omitempty"` +} + +type RollingRestartStrategyClient struct { + rancherClient *RancherClient +} + +type RollingRestartStrategyOperations interface { + List(opts *ListOpts) (*RollingRestartStrategyCollection, error) + Create(opts *RollingRestartStrategy) (*RollingRestartStrategy, error) + Update(existing *RollingRestartStrategy, updates interface{}) (*RollingRestartStrategy, error) + ById(id string) (*RollingRestartStrategy, error) + Delete(container *RollingRestartStrategy) error +} + +func newRollingRestartStrategyClient(rancherClient *RancherClient) *RollingRestartStrategyClient { + return &RollingRestartStrategyClient{ + rancherClient: rancherClient, + } +} + +func (c *RollingRestartStrategyClient) Create(container *RollingRestartStrategy) (*RollingRestartStrategy, error) { + resp := &RollingRestartStrategy{} + err := c.rancherClient.doCreate(ROLLING_RESTART_STRATEGY_TYPE, container, resp) + return resp, err +} + +func (c *RollingRestartStrategyClient) Update(existing *RollingRestartStrategy, updates interface{}) (*RollingRestartStrategy, error) { + resp := &RollingRestartStrategy{} + err := c.rancherClient.doUpdate(ROLLING_RESTART_STRATEGY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *RollingRestartStrategyClient) List(opts *ListOpts) (*RollingRestartStrategyCollection, error) { + resp := &RollingRestartStrategyCollection{} + err := c.rancherClient.doList(ROLLING_RESTART_STRATEGY_TYPE, opts, resp) + return resp, err +} + +func (c *RollingRestartStrategyClient) ById(id string) (*RollingRestartStrategy, error) { + resp := &RollingRestartStrategy{} + err := c.rancherClient.doById(ROLLING_RESTART_STRATEGY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *RollingRestartStrategyClient) Delete(container *RollingRestartStrategy) error { + return c.rancherClient.doResourceDelete(ROLLING_RESTART_STRATEGY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go new file mode 100644 index 000000000..abcd1bb5b --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go @@ -0,0 +1,71 @@ +package client + +const ( + SCALE_POLICY_TYPE = "scalePolicy" +) + +type ScalePolicy struct { + Resource + + Increment int64 `json:"increment,omitempty" yaml:"increment,omitempty"` + + Max int64 `json:"max,omitempty" yaml:"max,omitempty"` + + Min int64 `json:"min,omitempty" yaml:"min,omitempty"` +} + +type ScalePolicyCollection struct { + Collection + Data []ScalePolicy `json:"data,omitempty"` +} + +type ScalePolicyClient struct { + rancherClient *RancherClient +} + +type ScalePolicyOperations interface { + List(opts *ListOpts) (*ScalePolicyCollection, error) + Create(opts *ScalePolicy) (*ScalePolicy, error) + Update(existing *ScalePolicy, updates interface{}) (*ScalePolicy, error) + ById(id string) (*ScalePolicy, error) + Delete(container *ScalePolicy) error +} + +func newScalePolicyClient(rancherClient *RancherClient) *ScalePolicyClient { + return &ScalePolicyClient{ + rancherClient: rancherClient, + } +} + +func (c *ScalePolicyClient) Create(container *ScalePolicy) (*ScalePolicy, error) { + resp := &ScalePolicy{} + err := c.rancherClient.doCreate(SCALE_POLICY_TYPE, container, resp) + return resp, err +} + +func (c *ScalePolicyClient) Update(existing *ScalePolicy, updates interface{}) (*ScalePolicy, error) { + resp := &ScalePolicy{} + err := c.rancherClient.doUpdate(SCALE_POLICY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ScalePolicyClient) List(opts *ListOpts) (*ScalePolicyCollection, error) { + resp := &ScalePolicyCollection{} + err := c.rancherClient.doList(SCALE_POLICY_TYPE, opts, resp) + return resp, err +} + +func (c *ScalePolicyClient) ById(id string) (*ScalePolicy, error) { + resp := &ScalePolicy{} + err := c.rancherClient.doById(SCALE_POLICY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ScalePolicyClient) Delete(container *ScalePolicy) error { + return c.rancherClient.doResourceDelete(SCALE_POLICY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go new file mode 100644 index 000000000..ab7425587 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go @@ -0,0 +1,432 @@ +package client + +const ( + SECONDARY_LAUNCH_CONFIG_TYPE = "secondaryLaunchConfig" +) + +type SecondaryLaunchConfig struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` + + AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` + + BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + + Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` + + CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` + + CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` + + Command []string `json:"command,omitempty" yaml:"command,omitempty"` + + Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` + + CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + DataVolumeMounts map[string]interface{} `json:"dataVolumeMounts,omitempty" yaml:"data_volume_mounts,omitempty"` + + DataVolumes []string `json:"dataVolumes,omitempty" yaml:"data_volumes,omitempty"` + + DataVolumesFrom []string `json:"dataVolumesFrom,omitempty" yaml:"data_volumes_from,omitempty"` + + DataVolumesFromLaunchConfigs []string `json:"dataVolumesFromLaunchConfigs,omitempty" yaml:"data_volumes_from_launch_configs,omitempty"` + + DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` + + Disks []interface{} `json:"disks,omitempty" yaml:"disks,omitempty"` + + Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` + + DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` + + EntryPoint []string `json:"entryPoint,omitempty" yaml:"entry_point,omitempty"` + + Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` + + Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` + + FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + + ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` + + InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + + LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` + + LxcConf map[string]interface{} `json:"lxcConf,omitempty" yaml:"lxc_conf,omitempty"` + + Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` + + MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` + + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + + NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` + + NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` + + NetworkLaunchConfig string `json:"networkLaunchConfig,omitempty" yaml:"network_launch_config,omitempty"` + + NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` + + PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` + + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` + + PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + + Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` + + PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` + + ReadOnly bool `json:"readOnly,omitempty" yaml:"read_only,omitempty"` + + RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` + + RequestedIpAddress string `json:"requestedIpAddress,omitempty" yaml:"requested_ip_address,omitempty"` + + SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + + StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` + + SystemContainer string `json:"systemContainer,omitempty" yaml:"system_container,omitempty"` + + Token string `json:"token,omitempty" yaml:"token,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` + + User string `json:"user,omitempty" yaml:"user,omitempty"` + + Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` + + Version string `json:"version,omitempty" yaml:"version,omitempty"` + + VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` + + WorkingDir string `json:"workingDir,omitempty" yaml:"working_dir,omitempty"` +} + +type SecondaryLaunchConfigCollection struct { + Collection + Data []SecondaryLaunchConfig `json:"data,omitempty"` +} + +type SecondaryLaunchConfigClient struct { + rancherClient *RancherClient +} + +type SecondaryLaunchConfigOperations interface { + List(opts *ListOpts) (*SecondaryLaunchConfigCollection, error) + Create(opts *SecondaryLaunchConfig) (*SecondaryLaunchConfig, error) + Update(existing *SecondaryLaunchConfig, updates interface{}) (*SecondaryLaunchConfig, error) + ById(id string) (*SecondaryLaunchConfig, error) + Delete(container *SecondaryLaunchConfig) error + + ActionAllocate(*SecondaryLaunchConfig) (*Instance, error) + + ActionConsole(*SecondaryLaunchConfig, *InstanceConsoleInput) (*InstanceConsole, error) + + ActionCreate(*SecondaryLaunchConfig) (*Instance, error) + + ActionDeallocate(*SecondaryLaunchConfig) (*Instance, error) + + ActionError(*SecondaryLaunchConfig) (*Instance, error) + + ActionExecute(*SecondaryLaunchConfig, *ContainerExec) (*HostAccess, error) + + ActionMigrate(*SecondaryLaunchConfig) (*Instance, error) + + ActionProxy(*SecondaryLaunchConfig, *ContainerProxy) (*HostAccess, error) + + ActionPurge(*SecondaryLaunchConfig) (*Instance, error) + + ActionRemove(*SecondaryLaunchConfig) (*Instance, error) + + ActionRestart(*SecondaryLaunchConfig) (*Instance, error) + + ActionRestore(*SecondaryLaunchConfig) (*Instance, error) + + ActionSetlabels(*SecondaryLaunchConfig, *SetLabelsInput) (*Container, error) + + ActionStart(*SecondaryLaunchConfig) (*Instance, error) + + ActionStop(*SecondaryLaunchConfig, *InstanceStop) (*Instance, error) + + ActionUpdate(*SecondaryLaunchConfig) (*Instance, error) + + ActionUpdatehealthy(*SecondaryLaunchConfig) (*Instance, error) + + ActionUpdatereinitializing(*SecondaryLaunchConfig) (*Instance, error) + + ActionUpdateunhealthy(*SecondaryLaunchConfig) (*Instance, error) +} + +func newSecondaryLaunchConfigClient(rancherClient *RancherClient) *SecondaryLaunchConfigClient { + return &SecondaryLaunchConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *SecondaryLaunchConfigClient) Create(container *SecondaryLaunchConfig) (*SecondaryLaunchConfig, error) { + resp := &SecondaryLaunchConfig{} + err := c.rancherClient.doCreate(SECONDARY_LAUNCH_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *SecondaryLaunchConfigClient) Update(existing *SecondaryLaunchConfig, updates interface{}) (*SecondaryLaunchConfig, error) { + resp := &SecondaryLaunchConfig{} + err := c.rancherClient.doUpdate(SECONDARY_LAUNCH_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SecondaryLaunchConfigClient) List(opts *ListOpts) (*SecondaryLaunchConfigCollection, error) { + resp := &SecondaryLaunchConfigCollection{} + err := c.rancherClient.doList(SECONDARY_LAUNCH_CONFIG_TYPE, opts, resp) + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ById(id string) (*SecondaryLaunchConfig, error) { + resp := &SecondaryLaunchConfig{} + err := c.rancherClient.doById(SECONDARY_LAUNCH_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SecondaryLaunchConfigClient) Delete(container *SecondaryLaunchConfig) error { + return c.rancherClient.doResourceDelete(SECONDARY_LAUNCH_CONFIG_TYPE, &container.Resource) +} + +func (c *SecondaryLaunchConfigClient) ActionAllocate(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "allocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionConsole(resource *SecondaryLaunchConfig, input *InstanceConsoleInput) (*InstanceConsole, error) { + + resp := &InstanceConsole{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "console", &resource.Resource, input, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionCreate(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionDeallocate(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "deallocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionError(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionExecute(resource *SecondaryLaunchConfig, input *ContainerExec) (*HostAccess, error) { + + resp := &HostAccess{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "execute", &resource.Resource, input, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionMigrate(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "migrate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionProxy(resource *SecondaryLaunchConfig, input *ContainerProxy) (*HostAccess, error) { + + resp := &HostAccess{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "proxy", &resource.Resource, input, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionPurge(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionRemove(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionRestart(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "restart", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionRestore(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionSetlabels(resource *SecondaryLaunchConfig, input *SetLabelsInput) (*Container, error) { + + resp := &Container{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "setlabels", &resource.Resource, input, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionStart(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "start", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionStop(resource *SecondaryLaunchConfig, input *InstanceStop) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "stop", &resource.Resource, input, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionUpdate(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionUpdatehealthy(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "updatehealthy", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionUpdatereinitializing(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "updatereinitializing", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecondaryLaunchConfigClient) ActionUpdateunhealthy(resource *SecondaryLaunchConfig) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "updateunhealthy", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_service.go new file mode 100644 index 000000000..5ad61fc88 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service.go @@ -0,0 +1,283 @@ +package client + +const ( + SERVICE_TYPE = "service" +) + +type Service struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` + + CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PublicEndpoints []interface{} `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` + + Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` + + ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` + + SecondaryLaunchConfigs []interface{} `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` + + SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` + + SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` +} + +type ServiceCollection struct { + Collection + Data []Service `json:"data,omitempty"` +} + +type ServiceClient struct { + rancherClient *RancherClient +} + +type ServiceOperations interface { + List(opts *ListOpts) (*ServiceCollection, error) + Create(opts *Service) (*Service, error) + Update(existing *Service, updates interface{}) (*Service, error) + ById(id string) (*Service, error) + Delete(container *Service) error + + ActionActivate(*Service) (*Service, error) + + ActionAddservicelink(*Service, *AddRemoveServiceLinkInput) (*Service, error) + + ActionCancelupgrade(*Service) (*Service, error) + + ActionContinueupgrade(*Service) (*Service, error) + + ActionCreate(*Service) (*Service, error) + + ActionDeactivate(*Service) (*Service, error) + + ActionFinishupgrade(*Service) (*Service, error) + + ActionRemove(*Service) (*Service, error) + + ActionRemoveservicelink(*Service, *AddRemoveServiceLinkInput) (*Service, error) + + ActionRestart(*Service, *ServiceRestart) (*Service, error) + + ActionRollback(*Service) (*Service, error) + + ActionSetservicelinks(*Service, *SetServiceLinksInput) (*Service, error) + + ActionUpdate(*Service) (*Service, error) + + ActionUpgrade(*Service, *ServiceUpgrade) (*Service, error) +} + +func newServiceClient(rancherClient *RancherClient) *ServiceClient { + return &ServiceClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceClient) Create(container *Service) (*Service, error) { + resp := &Service{} + err := c.rancherClient.doCreate(SERVICE_TYPE, container, resp) + return resp, err +} + +func (c *ServiceClient) Update(existing *Service, updates interface{}) (*Service, error) { + resp := &Service{} + err := c.rancherClient.doUpdate(SERVICE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceClient) List(opts *ListOpts) (*ServiceCollection, error) { + resp := &ServiceCollection{} + err := c.rancherClient.doList(SERVICE_TYPE, opts, resp) + return resp, err +} + +func (c *ServiceClient) ById(id string) (*Service, error) { + resp := &Service{} + err := c.rancherClient.doById(SERVICE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceClient) Delete(container *Service) error { + return c.rancherClient.doResourceDelete(SERVICE_TYPE, &container.Resource) +} + +func (c *ServiceClient) ActionActivate(resource *Service) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceClient) ActionAddservicelink(resource *Service, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ServiceClient) ActionCancelupgrade(resource *Service) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceClient) ActionContinueupgrade(resource *Service) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceClient) ActionCreate(resource *Service) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceClient) ActionDeactivate(resource *Service) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceClient) ActionFinishupgrade(resource *Service) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceClient) ActionRemove(resource *Service) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceClient) ActionRemoveservicelink(resource *Service, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ServiceClient) ActionRestart(resource *Service, input *ServiceRestart) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "restart", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ServiceClient) ActionRollback(resource *Service) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceClient) ActionSetservicelinks(resource *Service, input *SetServiceLinksInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) + + return resp, err +} + +func (c *ServiceClient) ActionUpdate(resource *Service) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceClient) ActionUpgrade(resource *Service, input *ServiceUpgrade) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go new file mode 100644 index 000000000..e93040eba --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go @@ -0,0 +1,71 @@ +package client + +const ( + SERVICE_BINDING_TYPE = "serviceBinding" +) + +type ServiceBinding struct { + Resource + + Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` + + Scale string `json:"scale,omitempty" yaml:"scale,omitempty"` +} + +type ServiceBindingCollection struct { + Collection + Data []ServiceBinding `json:"data,omitempty"` +} + +type ServiceBindingClient struct { + rancherClient *RancherClient +} + +type ServiceBindingOperations interface { + List(opts *ListOpts) (*ServiceBindingCollection, error) + Create(opts *ServiceBinding) (*ServiceBinding, error) + Update(existing *ServiceBinding, updates interface{}) (*ServiceBinding, error) + ById(id string) (*ServiceBinding, error) + Delete(container *ServiceBinding) error +} + +func newServiceBindingClient(rancherClient *RancherClient) *ServiceBindingClient { + return &ServiceBindingClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceBindingClient) Create(container *ServiceBinding) (*ServiceBinding, error) { + resp := &ServiceBinding{} + err := c.rancherClient.doCreate(SERVICE_BINDING_TYPE, container, resp) + return resp, err +} + +func (c *ServiceBindingClient) Update(existing *ServiceBinding, updates interface{}) (*ServiceBinding, error) { + resp := &ServiceBinding{} + err := c.rancherClient.doUpdate(SERVICE_BINDING_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceBindingClient) List(opts *ListOpts) (*ServiceBindingCollection, error) { + resp := &ServiceBindingCollection{} + err := c.rancherClient.doList(SERVICE_BINDING_TYPE, opts, resp) + return resp, err +} + +func (c *ServiceBindingClient) ById(id string) (*ServiceBinding, error) { + resp := &ServiceBinding{} + err := c.rancherClient.doById(SERVICE_BINDING_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceBindingClient) Delete(container *ServiceBinding) error { + return c.rancherClient.doResourceDelete(SERVICE_BINDING_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go new file mode 100644 index 000000000..822a9aac5 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go @@ -0,0 +1,130 @@ +package client + +const ( + SERVICE_CONSUME_MAP_TYPE = "serviceConsumeMap" +) + +type ServiceConsumeMap struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + ConsumedServiceId string `json:"consumedServiceId,omitempty" yaml:"consumed_service_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ServiceConsumeMapCollection struct { + Collection + Data []ServiceConsumeMap `json:"data,omitempty"` +} + +type ServiceConsumeMapClient struct { + rancherClient *RancherClient +} + +type ServiceConsumeMapOperations interface { + List(opts *ListOpts) (*ServiceConsumeMapCollection, error) + Create(opts *ServiceConsumeMap) (*ServiceConsumeMap, error) + Update(existing *ServiceConsumeMap, updates interface{}) (*ServiceConsumeMap, error) + ById(id string) (*ServiceConsumeMap, error) + Delete(container *ServiceConsumeMap) error + + ActionCreate(*ServiceConsumeMap) (*ServiceConsumeMap, error) + + ActionRemove(*ServiceConsumeMap) (*ServiceConsumeMap, error) + + ActionUpdate(*ServiceConsumeMap) (*ServiceConsumeMap, error) +} + +func newServiceConsumeMapClient(rancherClient *RancherClient) *ServiceConsumeMapClient { + return &ServiceConsumeMapClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceConsumeMapClient) Create(container *ServiceConsumeMap) (*ServiceConsumeMap, error) { + resp := &ServiceConsumeMap{} + err := c.rancherClient.doCreate(SERVICE_CONSUME_MAP_TYPE, container, resp) + return resp, err +} + +func (c *ServiceConsumeMapClient) Update(existing *ServiceConsumeMap, updates interface{}) (*ServiceConsumeMap, error) { + resp := &ServiceConsumeMap{} + err := c.rancherClient.doUpdate(SERVICE_CONSUME_MAP_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceConsumeMapClient) List(opts *ListOpts) (*ServiceConsumeMapCollection, error) { + resp := &ServiceConsumeMapCollection{} + err := c.rancherClient.doList(SERVICE_CONSUME_MAP_TYPE, opts, resp) + return resp, err +} + +func (c *ServiceConsumeMapClient) ById(id string) (*ServiceConsumeMap, error) { + resp := &ServiceConsumeMap{} + err := c.rancherClient.doById(SERVICE_CONSUME_MAP_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceConsumeMapClient) Delete(container *ServiceConsumeMap) error { + return c.rancherClient.doResourceDelete(SERVICE_CONSUME_MAP_TYPE, &container.Resource) +} + +func (c *ServiceConsumeMapClient) ActionCreate(resource *ServiceConsumeMap) (*ServiceConsumeMap, error) { + + resp := &ServiceConsumeMap{} + + err := c.rancherClient.doAction(SERVICE_CONSUME_MAP_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceConsumeMapClient) ActionRemove(resource *ServiceConsumeMap) (*ServiceConsumeMap, error) { + + resp := &ServiceConsumeMap{} + + err := c.rancherClient.doAction(SERVICE_CONSUME_MAP_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceConsumeMapClient) ActionUpdate(resource *ServiceConsumeMap) (*ServiceConsumeMap, error) { + + resp := &ServiceConsumeMap{} + + err := c.rancherClient.doAction(SERVICE_CONSUME_MAP_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go new file mode 100644 index 000000000..7d046b38b --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go @@ -0,0 +1,123 @@ +package client + +const ( + SERVICE_EVENT_TYPE = "serviceEvent" +) + +type ServiceEvent struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalTimestamp int64 `json:"externalTimestamp,omitempty" yaml:"external_timestamp,omitempty"` + + HealthcheckUuid string `json:"healthcheckUuid,omitempty" yaml:"healthcheck_uuid,omitempty"` + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + ReportedHealth string `json:"reportedHealth,omitempty" yaml:"reported_health,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ServiceEventCollection struct { + Collection + Data []ServiceEvent `json:"data,omitempty"` +} + +type ServiceEventClient struct { + rancherClient *RancherClient +} + +type ServiceEventOperations interface { + List(opts *ListOpts) (*ServiceEventCollection, error) + Create(opts *ServiceEvent) (*ServiceEvent, error) + Update(existing *ServiceEvent, updates interface{}) (*ServiceEvent, error) + ById(id string) (*ServiceEvent, error) + Delete(container *ServiceEvent) error + + ActionCreate(*ServiceEvent) (*ServiceEvent, error) + + ActionRemove(*ServiceEvent) (*ServiceEvent, error) +} + +func newServiceEventClient(rancherClient *RancherClient) *ServiceEventClient { + return &ServiceEventClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceEventClient) Create(container *ServiceEvent) (*ServiceEvent, error) { + resp := &ServiceEvent{} + err := c.rancherClient.doCreate(SERVICE_EVENT_TYPE, container, resp) + return resp, err +} + +func (c *ServiceEventClient) Update(existing *ServiceEvent, updates interface{}) (*ServiceEvent, error) { + resp := &ServiceEvent{} + err := c.rancherClient.doUpdate(SERVICE_EVENT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceEventClient) List(opts *ListOpts) (*ServiceEventCollection, error) { + resp := &ServiceEventCollection{} + err := c.rancherClient.doList(SERVICE_EVENT_TYPE, opts, resp) + return resp, err +} + +func (c *ServiceEventClient) ById(id string) (*ServiceEvent, error) { + resp := &ServiceEvent{} + err := c.rancherClient.doById(SERVICE_EVENT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceEventClient) Delete(container *ServiceEvent) error { + return c.rancherClient.doResourceDelete(SERVICE_EVENT_TYPE, &container.Resource) +} + +func (c *ServiceEventClient) ActionCreate(resource *ServiceEvent) (*ServiceEvent, error) { + + resp := &ServiceEvent{} + + err := c.rancherClient.doAction(SERVICE_EVENT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceEventClient) ActionRemove(resource *ServiceEvent) (*ServiceEvent, error) { + + resp := &ServiceEvent{} + + err := c.rancherClient.doAction(SERVICE_EVENT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go new file mode 100644 index 000000000..60fe5f2f8 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go @@ -0,0 +1,121 @@ +package client + +const ( + SERVICE_EXPOSE_MAP_TYPE = "serviceExposeMap" +) + +type ServiceExposeMap struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + IpAddress string `json:"ipAddress,omitempty" yaml:"ip_address,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Managed bool `json:"managed,omitempty" yaml:"managed,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ServiceExposeMapCollection struct { + Collection + Data []ServiceExposeMap `json:"data,omitempty"` +} + +type ServiceExposeMapClient struct { + rancherClient *RancherClient +} + +type ServiceExposeMapOperations interface { + List(opts *ListOpts) (*ServiceExposeMapCollection, error) + Create(opts *ServiceExposeMap) (*ServiceExposeMap, error) + Update(existing *ServiceExposeMap, updates interface{}) (*ServiceExposeMap, error) + ById(id string) (*ServiceExposeMap, error) + Delete(container *ServiceExposeMap) error + + ActionCreate(*ServiceExposeMap) (*ServiceExposeMap, error) + + ActionRemove(*ServiceExposeMap) (*ServiceExposeMap, error) +} + +func newServiceExposeMapClient(rancherClient *RancherClient) *ServiceExposeMapClient { + return &ServiceExposeMapClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceExposeMapClient) Create(container *ServiceExposeMap) (*ServiceExposeMap, error) { + resp := &ServiceExposeMap{} + err := c.rancherClient.doCreate(SERVICE_EXPOSE_MAP_TYPE, container, resp) + return resp, err +} + +func (c *ServiceExposeMapClient) Update(existing *ServiceExposeMap, updates interface{}) (*ServiceExposeMap, error) { + resp := &ServiceExposeMap{} + err := c.rancherClient.doUpdate(SERVICE_EXPOSE_MAP_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceExposeMapClient) List(opts *ListOpts) (*ServiceExposeMapCollection, error) { + resp := &ServiceExposeMapCollection{} + err := c.rancherClient.doList(SERVICE_EXPOSE_MAP_TYPE, opts, resp) + return resp, err +} + +func (c *ServiceExposeMapClient) ById(id string) (*ServiceExposeMap, error) { + resp := &ServiceExposeMap{} + err := c.rancherClient.doById(SERVICE_EXPOSE_MAP_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceExposeMapClient) Delete(container *ServiceExposeMap) error { + return c.rancherClient.doResourceDelete(SERVICE_EXPOSE_MAP_TYPE, &container.Resource) +} + +func (c *ServiceExposeMapClient) ActionCreate(resource *ServiceExposeMap) (*ServiceExposeMap, error) { + + resp := &ServiceExposeMap{} + + err := c.rancherClient.doAction(SERVICE_EXPOSE_MAP_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ServiceExposeMapClient) ActionRemove(resource *ServiceExposeMap) (*ServiceExposeMap, error) { + + resp := &ServiceExposeMap{} + + err := c.rancherClient.doAction(SERVICE_EXPOSE_MAP_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go new file mode 100644 index 000000000..52c75ac53 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go @@ -0,0 +1,71 @@ +package client + +const ( + SERVICE_LINK_TYPE = "serviceLink" +) + +type ServiceLink struct { + Resource + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ServiceLinkCollection struct { + Collection + Data []ServiceLink `json:"data,omitempty"` +} + +type ServiceLinkClient struct { + rancherClient *RancherClient +} + +type ServiceLinkOperations interface { + List(opts *ListOpts) (*ServiceLinkCollection, error) + Create(opts *ServiceLink) (*ServiceLink, error) + Update(existing *ServiceLink, updates interface{}) (*ServiceLink, error) + ById(id string) (*ServiceLink, error) + Delete(container *ServiceLink) error +} + +func newServiceLinkClient(rancherClient *RancherClient) *ServiceLinkClient { + return &ServiceLinkClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceLinkClient) Create(container *ServiceLink) (*ServiceLink, error) { + resp := &ServiceLink{} + err := c.rancherClient.doCreate(SERVICE_LINK_TYPE, container, resp) + return resp, err +} + +func (c *ServiceLinkClient) Update(existing *ServiceLink, updates interface{}) (*ServiceLink, error) { + resp := &ServiceLink{} + err := c.rancherClient.doUpdate(SERVICE_LINK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceLinkClient) List(opts *ListOpts) (*ServiceLinkCollection, error) { + resp := &ServiceLinkCollection{} + err := c.rancherClient.doList(SERVICE_LINK_TYPE, opts, resp) + return resp, err +} + +func (c *ServiceLinkClient) ById(id string) (*ServiceLink, error) { + resp := &ServiceLink{} + err := c.rancherClient.doById(SERVICE_LINK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceLinkClient) Delete(container *ServiceLink) error { + return c.rancherClient.doResourceDelete(SERVICE_LINK_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go new file mode 100644 index 000000000..0757d820f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go @@ -0,0 +1,89 @@ +package client + +const ( + SERVICE_LOG_TYPE = "serviceLog" +) + +type ServiceLog struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` + + EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Level string `json:"level,omitempty" yaml:"level,omitempty"` + + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + SubLog bool `json:"subLog,omitempty" yaml:"sub_log,omitempty"` + + TransactionId string `json:"transactionId,omitempty" yaml:"transaction_id,omitempty"` +} + +type ServiceLogCollection struct { + Collection + Data []ServiceLog `json:"data,omitempty"` +} + +type ServiceLogClient struct { + rancherClient *RancherClient +} + +type ServiceLogOperations interface { + List(opts *ListOpts) (*ServiceLogCollection, error) + Create(opts *ServiceLog) (*ServiceLog, error) + Update(existing *ServiceLog, updates interface{}) (*ServiceLog, error) + ById(id string) (*ServiceLog, error) + Delete(container *ServiceLog) error +} + +func newServiceLogClient(rancherClient *RancherClient) *ServiceLogClient { + return &ServiceLogClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceLogClient) Create(container *ServiceLog) (*ServiceLog, error) { + resp := &ServiceLog{} + err := c.rancherClient.doCreate(SERVICE_LOG_TYPE, container, resp) + return resp, err +} + +func (c *ServiceLogClient) Update(existing *ServiceLog, updates interface{}) (*ServiceLog, error) { + resp := &ServiceLog{} + err := c.rancherClient.doUpdate(SERVICE_LOG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceLogClient) List(opts *ListOpts) (*ServiceLogCollection, error) { + resp := &ServiceLogCollection{} + err := c.rancherClient.doList(SERVICE_LOG_TYPE, opts, resp) + return resp, err +} + +func (c *ServiceLogClient) ById(id string) (*ServiceLog, error) { + resp := &ServiceLog{} + err := c.rancherClient.doById(SERVICE_LOG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceLogClient) Delete(container *ServiceLog) error { + return c.rancherClient.doResourceDelete(SERVICE_LOG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go new file mode 100644 index 000000000..fd6c32868 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go @@ -0,0 +1,75 @@ +package client + +const ( + SERVICE_PROXY_TYPE = "serviceProxy" +) + +type ServiceProxy struct { + Resource + + Port int64 `json:"port,omitempty" yaml:"port,omitempty"` + + Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"` + + Service string `json:"service,omitempty" yaml:"service,omitempty"` + + Token string `json:"token,omitempty" yaml:"token,omitempty"` + + Url string `json:"url,omitempty" yaml:"url,omitempty"` +} + +type ServiceProxyCollection struct { + Collection + Data []ServiceProxy `json:"data,omitempty"` +} + +type ServiceProxyClient struct { + rancherClient *RancherClient +} + +type ServiceProxyOperations interface { + List(opts *ListOpts) (*ServiceProxyCollection, error) + Create(opts *ServiceProxy) (*ServiceProxy, error) + Update(existing *ServiceProxy, updates interface{}) (*ServiceProxy, error) + ById(id string) (*ServiceProxy, error) + Delete(container *ServiceProxy) error +} + +func newServiceProxyClient(rancherClient *RancherClient) *ServiceProxyClient { + return &ServiceProxyClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceProxyClient) Create(container *ServiceProxy) (*ServiceProxy, error) { + resp := &ServiceProxy{} + err := c.rancherClient.doCreate(SERVICE_PROXY_TYPE, container, resp) + return resp, err +} + +func (c *ServiceProxyClient) Update(existing *ServiceProxy, updates interface{}) (*ServiceProxy, error) { + resp := &ServiceProxy{} + err := c.rancherClient.doUpdate(SERVICE_PROXY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceProxyClient) List(opts *ListOpts) (*ServiceProxyCollection, error) { + resp := &ServiceProxyCollection{} + err := c.rancherClient.doList(SERVICE_PROXY_TYPE, opts, resp) + return resp, err +} + +func (c *ServiceProxyClient) ById(id string) (*ServiceProxy, error) { + resp := &ServiceProxy{} + err := c.rancherClient.doById(SERVICE_PROXY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceProxyClient) Delete(container *ServiceProxy) error { + return c.rancherClient.doResourceDelete(SERVICE_PROXY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go new file mode 100644 index 000000000..5b95e8c68 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go @@ -0,0 +1,67 @@ +package client + +const ( + SERVICE_RESTART_TYPE = "serviceRestart" +) + +type ServiceRestart struct { + Resource + + RollingRestartStrategy RollingRestartStrategy `json:"rollingRestartStrategy,omitempty" yaml:"rolling_restart_strategy,omitempty"` +} + +type ServiceRestartCollection struct { + Collection + Data []ServiceRestart `json:"data,omitempty"` +} + +type ServiceRestartClient struct { + rancherClient *RancherClient +} + +type ServiceRestartOperations interface { + List(opts *ListOpts) (*ServiceRestartCollection, error) + Create(opts *ServiceRestart) (*ServiceRestart, error) + Update(existing *ServiceRestart, updates interface{}) (*ServiceRestart, error) + ById(id string) (*ServiceRestart, error) + Delete(container *ServiceRestart) error +} + +func newServiceRestartClient(rancherClient *RancherClient) *ServiceRestartClient { + return &ServiceRestartClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceRestartClient) Create(container *ServiceRestart) (*ServiceRestart, error) { + resp := &ServiceRestart{} + err := c.rancherClient.doCreate(SERVICE_RESTART_TYPE, container, resp) + return resp, err +} + +func (c *ServiceRestartClient) Update(existing *ServiceRestart, updates interface{}) (*ServiceRestart, error) { + resp := &ServiceRestart{} + err := c.rancherClient.doUpdate(SERVICE_RESTART_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceRestartClient) List(opts *ListOpts) (*ServiceRestartCollection, error) { + resp := &ServiceRestartCollection{} + err := c.rancherClient.doList(SERVICE_RESTART_TYPE, opts, resp) + return resp, err +} + +func (c *ServiceRestartClient) ById(id string) (*ServiceRestart, error) { + resp := &ServiceRestart{} + err := c.rancherClient.doById(SERVICE_RESTART_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceRestartClient) Delete(container *ServiceRestart) error { + return c.rancherClient.doResourceDelete(SERVICE_RESTART_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go new file mode 100644 index 000000000..25b453f2b --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go @@ -0,0 +1,69 @@ +package client + +const ( + SERVICE_UPGRADE_TYPE = "serviceUpgrade" +) + +type ServiceUpgrade struct { + Resource + + InServiceStrategy *InServiceUpgradeStrategy `json:"inServiceStrategy,omitempty" yaml:"in_service_strategy,omitempty"` + + ToServiceStrategy *ToServiceUpgradeStrategy `json:"toServiceStrategy,omitempty" yaml:"to_service_strategy,omitempty"` +} + +type ServiceUpgradeCollection struct { + Collection + Data []ServiceUpgrade `json:"data,omitempty"` +} + +type ServiceUpgradeClient struct { + rancherClient *RancherClient +} + +type ServiceUpgradeOperations interface { + List(opts *ListOpts) (*ServiceUpgradeCollection, error) + Create(opts *ServiceUpgrade) (*ServiceUpgrade, error) + Update(existing *ServiceUpgrade, updates interface{}) (*ServiceUpgrade, error) + ById(id string) (*ServiceUpgrade, error) + Delete(container *ServiceUpgrade) error +} + +func newServiceUpgradeClient(rancherClient *RancherClient) *ServiceUpgradeClient { + return &ServiceUpgradeClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceUpgradeClient) Create(container *ServiceUpgrade) (*ServiceUpgrade, error) { + resp := &ServiceUpgrade{} + err := c.rancherClient.doCreate(SERVICE_UPGRADE_TYPE, container, resp) + return resp, err +} + +func (c *ServiceUpgradeClient) Update(existing *ServiceUpgrade, updates interface{}) (*ServiceUpgrade, error) { + resp := &ServiceUpgrade{} + err := c.rancherClient.doUpdate(SERVICE_UPGRADE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceUpgradeClient) List(opts *ListOpts) (*ServiceUpgradeCollection, error) { + resp := &ServiceUpgradeCollection{} + err := c.rancherClient.doList(SERVICE_UPGRADE_TYPE, opts, resp) + return resp, err +} + +func (c *ServiceUpgradeClient) ById(id string) (*ServiceUpgrade, error) { + resp := &ServiceUpgrade{} + err := c.rancherClient.doById(SERVICE_UPGRADE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceUpgradeClient) Delete(container *ServiceUpgrade) error { + return c.rancherClient.doResourceDelete(SERVICE_UPGRADE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go new file mode 100644 index 000000000..834606b61 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go @@ -0,0 +1,69 @@ +package client + +const ( + SERVICE_UPGRADE_STRATEGY_TYPE = "serviceUpgradeStrategy" +) + +type ServiceUpgradeStrategy struct { + Resource + + BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` + + IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` +} + +type ServiceUpgradeStrategyCollection struct { + Collection + Data []ServiceUpgradeStrategy `json:"data,omitempty"` +} + +type ServiceUpgradeStrategyClient struct { + rancherClient *RancherClient +} + +type ServiceUpgradeStrategyOperations interface { + List(opts *ListOpts) (*ServiceUpgradeStrategyCollection, error) + Create(opts *ServiceUpgradeStrategy) (*ServiceUpgradeStrategy, error) + Update(existing *ServiceUpgradeStrategy, updates interface{}) (*ServiceUpgradeStrategy, error) + ById(id string) (*ServiceUpgradeStrategy, error) + Delete(container *ServiceUpgradeStrategy) error +} + +func newServiceUpgradeStrategyClient(rancherClient *RancherClient) *ServiceUpgradeStrategyClient { + return &ServiceUpgradeStrategyClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceUpgradeStrategyClient) Create(container *ServiceUpgradeStrategy) (*ServiceUpgradeStrategy, error) { + resp := &ServiceUpgradeStrategy{} + err := c.rancherClient.doCreate(SERVICE_UPGRADE_STRATEGY_TYPE, container, resp) + return resp, err +} + +func (c *ServiceUpgradeStrategyClient) Update(existing *ServiceUpgradeStrategy, updates interface{}) (*ServiceUpgradeStrategy, error) { + resp := &ServiceUpgradeStrategy{} + err := c.rancherClient.doUpdate(SERVICE_UPGRADE_STRATEGY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceUpgradeStrategyClient) List(opts *ListOpts) (*ServiceUpgradeStrategyCollection, error) { + resp := &ServiceUpgradeStrategyCollection{} + err := c.rancherClient.doList(SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) + return resp, err +} + +func (c *ServiceUpgradeStrategyClient) ById(id string) (*ServiceUpgradeStrategy, error) { + resp := &ServiceUpgradeStrategy{} + err := c.rancherClient.doById(SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceUpgradeStrategyClient) Delete(container *ServiceUpgradeStrategy) error { + return c.rancherClient.doResourceDelete(SERVICE_UPGRADE_STRATEGY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go b/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go new file mode 100644 index 000000000..d3c0eb91d --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go @@ -0,0 +1,69 @@ +package client + +const ( + SERVICES_PORT_RANGE_TYPE = "servicesPortRange" +) + +type ServicesPortRange struct { + Resource + + EndPort int64 `json:"endPort,omitempty" yaml:"end_port,omitempty"` + + StartPort int64 `json:"startPort,omitempty" yaml:"start_port,omitempty"` +} + +type ServicesPortRangeCollection struct { + Collection + Data []ServicesPortRange `json:"data,omitempty"` +} + +type ServicesPortRangeClient struct { + rancherClient *RancherClient +} + +type ServicesPortRangeOperations interface { + List(opts *ListOpts) (*ServicesPortRangeCollection, error) + Create(opts *ServicesPortRange) (*ServicesPortRange, error) + Update(existing *ServicesPortRange, updates interface{}) (*ServicesPortRange, error) + ById(id string) (*ServicesPortRange, error) + Delete(container *ServicesPortRange) error +} + +func newServicesPortRangeClient(rancherClient *RancherClient) *ServicesPortRangeClient { + return &ServicesPortRangeClient{ + rancherClient: rancherClient, + } +} + +func (c *ServicesPortRangeClient) Create(container *ServicesPortRange) (*ServicesPortRange, error) { + resp := &ServicesPortRange{} + err := c.rancherClient.doCreate(SERVICES_PORT_RANGE_TYPE, container, resp) + return resp, err +} + +func (c *ServicesPortRangeClient) Update(existing *ServicesPortRange, updates interface{}) (*ServicesPortRange, error) { + resp := &ServicesPortRange{} + err := c.rancherClient.doUpdate(SERVICES_PORT_RANGE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServicesPortRangeClient) List(opts *ListOpts) (*ServicesPortRangeCollection, error) { + resp := &ServicesPortRangeCollection{} + err := c.rancherClient.doList(SERVICES_PORT_RANGE_TYPE, opts, resp) + return resp, err +} + +func (c *ServicesPortRangeClient) ById(id string) (*ServicesPortRange, error) { + resp := &ServicesPortRange{} + err := c.rancherClient.doById(SERVICES_PORT_RANGE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServicesPortRangeClient) Delete(container *ServicesPortRange) error { + return c.rancherClient.doResourceDelete(SERVICES_PORT_RANGE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_set_labels_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_labels_input.go new file mode 100644 index 000000000..96d894512 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_set_labels_input.go @@ -0,0 +1,67 @@ +package client + +const ( + SET_LABELS_INPUT_TYPE = "setLabelsInput" +) + +type SetLabelsInput struct { + Resource + + Labels interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` +} + +type SetLabelsInputCollection struct { + Collection + Data []SetLabelsInput `json:"data,omitempty"` +} + +type SetLabelsInputClient struct { + rancherClient *RancherClient +} + +type SetLabelsInputOperations interface { + List(opts *ListOpts) (*SetLabelsInputCollection, error) + Create(opts *SetLabelsInput) (*SetLabelsInput, error) + Update(existing *SetLabelsInput, updates interface{}) (*SetLabelsInput, error) + ById(id string) (*SetLabelsInput, error) + Delete(container *SetLabelsInput) error +} + +func newSetLabelsInputClient(rancherClient *RancherClient) *SetLabelsInputClient { + return &SetLabelsInputClient{ + rancherClient: rancherClient, + } +} + +func (c *SetLabelsInputClient) Create(container *SetLabelsInput) (*SetLabelsInput, error) { + resp := &SetLabelsInput{} + err := c.rancherClient.doCreate(SET_LABELS_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *SetLabelsInputClient) Update(existing *SetLabelsInput, updates interface{}) (*SetLabelsInput, error) { + resp := &SetLabelsInput{} + err := c.rancherClient.doUpdate(SET_LABELS_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SetLabelsInputClient) List(opts *ListOpts) (*SetLabelsInputCollection, error) { + resp := &SetLabelsInputCollection{} + err := c.rancherClient.doList(SET_LABELS_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *SetLabelsInputClient) ById(id string) (*SetLabelsInput, error) { + resp := &SetLabelsInput{} + err := c.rancherClient.doById(SET_LABELS_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SetLabelsInputClient) Delete(container *SetLabelsInput) error { + return c.rancherClient.doResourceDelete(SET_LABELS_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_set_load_balancer_service_links_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_load_balancer_service_links_input.go new file mode 100644 index 000000000..76d8684cf --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_set_load_balancer_service_links_input.go @@ -0,0 +1,67 @@ +package client + +const ( + SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE = "setLoadBalancerServiceLinksInput" +) + +type SetLoadBalancerServiceLinksInput struct { + Resource + + ServiceLinks []interface{} `json:"serviceLinks,omitempty" yaml:"service_links,omitempty"` +} + +type SetLoadBalancerServiceLinksInputCollection struct { + Collection + Data []SetLoadBalancerServiceLinksInput `json:"data,omitempty"` +} + +type SetLoadBalancerServiceLinksInputClient struct { + rancherClient *RancherClient +} + +type SetLoadBalancerServiceLinksInputOperations interface { + List(opts *ListOpts) (*SetLoadBalancerServiceLinksInputCollection, error) + Create(opts *SetLoadBalancerServiceLinksInput) (*SetLoadBalancerServiceLinksInput, error) + Update(existing *SetLoadBalancerServiceLinksInput, updates interface{}) (*SetLoadBalancerServiceLinksInput, error) + ById(id string) (*SetLoadBalancerServiceLinksInput, error) + Delete(container *SetLoadBalancerServiceLinksInput) error +} + +func newSetLoadBalancerServiceLinksInputClient(rancherClient *RancherClient) *SetLoadBalancerServiceLinksInputClient { + return &SetLoadBalancerServiceLinksInputClient{ + rancherClient: rancherClient, + } +} + +func (c *SetLoadBalancerServiceLinksInputClient) Create(container *SetLoadBalancerServiceLinksInput) (*SetLoadBalancerServiceLinksInput, error) { + resp := &SetLoadBalancerServiceLinksInput{} + err := c.rancherClient.doCreate(SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *SetLoadBalancerServiceLinksInputClient) Update(existing *SetLoadBalancerServiceLinksInput, updates interface{}) (*SetLoadBalancerServiceLinksInput, error) { + resp := &SetLoadBalancerServiceLinksInput{} + err := c.rancherClient.doUpdate(SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SetLoadBalancerServiceLinksInputClient) List(opts *ListOpts) (*SetLoadBalancerServiceLinksInputCollection, error) { + resp := &SetLoadBalancerServiceLinksInputCollection{} + err := c.rancherClient.doList(SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *SetLoadBalancerServiceLinksInputClient) ById(id string) (*SetLoadBalancerServiceLinksInput, error) { + resp := &SetLoadBalancerServiceLinksInput{} + err := c.rancherClient.doById(SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SetLoadBalancerServiceLinksInputClient) Delete(container *SetLoadBalancerServiceLinksInput) error { + return c.rancherClient.doResourceDelete(SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go new file mode 100644 index 000000000..bc8c2f201 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go @@ -0,0 +1,67 @@ +package client + +const ( + SET_PROJECT_MEMBERS_INPUT_TYPE = "setProjectMembersInput" +) + +type SetProjectMembersInput struct { + Resource + + Members []interface{} `json:"members,omitempty" yaml:"members,omitempty"` +} + +type SetProjectMembersInputCollection struct { + Collection + Data []SetProjectMembersInput `json:"data,omitempty"` +} + +type SetProjectMembersInputClient struct { + rancherClient *RancherClient +} + +type SetProjectMembersInputOperations interface { + List(opts *ListOpts) (*SetProjectMembersInputCollection, error) + Create(opts *SetProjectMembersInput) (*SetProjectMembersInput, error) + Update(existing *SetProjectMembersInput, updates interface{}) (*SetProjectMembersInput, error) + ById(id string) (*SetProjectMembersInput, error) + Delete(container *SetProjectMembersInput) error +} + +func newSetProjectMembersInputClient(rancherClient *RancherClient) *SetProjectMembersInputClient { + return &SetProjectMembersInputClient{ + rancherClient: rancherClient, + } +} + +func (c *SetProjectMembersInputClient) Create(container *SetProjectMembersInput) (*SetProjectMembersInput, error) { + resp := &SetProjectMembersInput{} + err := c.rancherClient.doCreate(SET_PROJECT_MEMBERS_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *SetProjectMembersInputClient) Update(existing *SetProjectMembersInput, updates interface{}) (*SetProjectMembersInput, error) { + resp := &SetProjectMembersInput{} + err := c.rancherClient.doUpdate(SET_PROJECT_MEMBERS_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SetProjectMembersInputClient) List(opts *ListOpts) (*SetProjectMembersInputCollection, error) { + resp := &SetProjectMembersInputCollection{} + err := c.rancherClient.doList(SET_PROJECT_MEMBERS_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *SetProjectMembersInputClient) ById(id string) (*SetProjectMembersInput, error) { + resp := &SetProjectMembersInput{} + err := c.rancherClient.doById(SET_PROJECT_MEMBERS_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SetProjectMembersInputClient) Delete(container *SetProjectMembersInput) error { + return c.rancherClient.doResourceDelete(SET_PROJECT_MEMBERS_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go new file mode 100644 index 000000000..b471e96c2 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go @@ -0,0 +1,67 @@ +package client + +const ( + SET_SERVICE_LINKS_INPUT_TYPE = "setServiceLinksInput" +) + +type SetServiceLinksInput struct { + Resource + + ServiceLinks []interface{} `json:"serviceLinks,omitempty" yaml:"service_links,omitempty"` +} + +type SetServiceLinksInputCollection struct { + Collection + Data []SetServiceLinksInput `json:"data,omitempty"` +} + +type SetServiceLinksInputClient struct { + rancherClient *RancherClient +} + +type SetServiceLinksInputOperations interface { + List(opts *ListOpts) (*SetServiceLinksInputCollection, error) + Create(opts *SetServiceLinksInput) (*SetServiceLinksInput, error) + Update(existing *SetServiceLinksInput, updates interface{}) (*SetServiceLinksInput, error) + ById(id string) (*SetServiceLinksInput, error) + Delete(container *SetServiceLinksInput) error +} + +func newSetServiceLinksInputClient(rancherClient *RancherClient) *SetServiceLinksInputClient { + return &SetServiceLinksInputClient{ + rancherClient: rancherClient, + } +} + +func (c *SetServiceLinksInputClient) Create(container *SetServiceLinksInput) (*SetServiceLinksInput, error) { + resp := &SetServiceLinksInput{} + err := c.rancherClient.doCreate(SET_SERVICE_LINKS_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *SetServiceLinksInputClient) Update(existing *SetServiceLinksInput, updates interface{}) (*SetServiceLinksInput, error) { + resp := &SetServiceLinksInput{} + err := c.rancherClient.doUpdate(SET_SERVICE_LINKS_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SetServiceLinksInputClient) List(opts *ListOpts) (*SetServiceLinksInputCollection, error) { + resp := &SetServiceLinksInputCollection{} + err := c.rancherClient.doList(SET_SERVICE_LINKS_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *SetServiceLinksInputClient) ById(id string) (*SetServiceLinksInput, error) { + resp := &SetServiceLinksInput{} + err := c.rancherClient.doById(SET_SERVICE_LINKS_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SetServiceLinksInputClient) Delete(container *SetServiceLinksInput) error { + return c.rancherClient.doResourceDelete(SET_SERVICE_LINKS_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_setting.go b/vendor/github.com/rancher/go-rancher/v2/generated_setting.go new file mode 100644 index 000000000..1aa7655b3 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_setting.go @@ -0,0 +1,75 @@ +package client + +const ( + SETTING_TYPE = "setting" +) + +type Setting struct { + Resource + + ActiveValue string `json:"activeValue,omitempty" yaml:"active_value,omitempty"` + + InDb bool `json:"inDb,omitempty" yaml:"in_db,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Source string `json:"source,omitempty" yaml:"source,omitempty"` + + Value string `json:"value,omitempty" yaml:"value,omitempty"` +} + +type SettingCollection struct { + Collection + Data []Setting `json:"data,omitempty"` +} + +type SettingClient struct { + rancherClient *RancherClient +} + +type SettingOperations interface { + List(opts *ListOpts) (*SettingCollection, error) + Create(opts *Setting) (*Setting, error) + Update(existing *Setting, updates interface{}) (*Setting, error) + ById(id string) (*Setting, error) + Delete(container *Setting) error +} + +func newSettingClient(rancherClient *RancherClient) *SettingClient { + return &SettingClient{ + rancherClient: rancherClient, + } +} + +func (c *SettingClient) Create(container *Setting) (*Setting, error) { + resp := &Setting{} + err := c.rancherClient.doCreate(SETTING_TYPE, container, resp) + return resp, err +} + +func (c *SettingClient) Update(existing *Setting, updates interface{}) (*Setting, error) { + resp := &Setting{} + err := c.rancherClient.doUpdate(SETTING_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SettingClient) List(opts *ListOpts) (*SettingCollection, error) { + resp := &SettingCollection{} + err := c.rancherClient.doList(SETTING_TYPE, opts, resp) + return resp, err +} + +func (c *SettingClient) ById(id string) (*Setting, error) { + resp := &Setting{} + err := c.rancherClient.doById(SETTING_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SettingClient) Delete(container *Setting) error { + return c.rancherClient.doResourceDelete(SETTING_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go new file mode 100644 index 000000000..554035673 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go @@ -0,0 +1,126 @@ +package client + +const ( + SNAPSHOT_TYPE = "snapshot" +) + +type Snapshot struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` +} + +type SnapshotCollection struct { + Collection + Data []Snapshot `json:"data,omitempty"` +} + +type SnapshotClient struct { + rancherClient *RancherClient +} + +type SnapshotOperations interface { + List(opts *ListOpts) (*SnapshotCollection, error) + Create(opts *Snapshot) (*Snapshot, error) + Update(existing *Snapshot, updates interface{}) (*Snapshot, error) + ById(id string) (*Snapshot, error) + Delete(container *Snapshot) error + + ActionBackup(*Snapshot, *SnapshotBackupInput) (*Backup, error) + + ActionCreate(*Snapshot) (*Snapshot, error) + + ActionRemove(*Snapshot) (*Snapshot, error) +} + +func newSnapshotClient(rancherClient *RancherClient) *SnapshotClient { + return &SnapshotClient{ + rancherClient: rancherClient, + } +} + +func (c *SnapshotClient) Create(container *Snapshot) (*Snapshot, error) { + resp := &Snapshot{} + err := c.rancherClient.doCreate(SNAPSHOT_TYPE, container, resp) + return resp, err +} + +func (c *SnapshotClient) Update(existing *Snapshot, updates interface{}) (*Snapshot, error) { + resp := &Snapshot{} + err := c.rancherClient.doUpdate(SNAPSHOT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SnapshotClient) List(opts *ListOpts) (*SnapshotCollection, error) { + resp := &SnapshotCollection{} + err := c.rancherClient.doList(SNAPSHOT_TYPE, opts, resp) + return resp, err +} + +func (c *SnapshotClient) ById(id string) (*Snapshot, error) { + resp := &Snapshot{} + err := c.rancherClient.doById(SNAPSHOT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SnapshotClient) Delete(container *Snapshot) error { + return c.rancherClient.doResourceDelete(SNAPSHOT_TYPE, &container.Resource) +} + +func (c *SnapshotClient) ActionBackup(resource *Snapshot, input *SnapshotBackupInput) (*Backup, error) { + + resp := &Backup{} + + err := c.rancherClient.doAction(SNAPSHOT_TYPE, "backup", &resource.Resource, input, resp) + + return resp, err +} + +func (c *SnapshotClient) ActionCreate(resource *Snapshot) (*Snapshot, error) { + + resp := &Snapshot{} + + err := c.rancherClient.doAction(SNAPSHOT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SnapshotClient) ActionRemove(resource *Snapshot) (*Snapshot, error) { + + resp := &Snapshot{} + + err := c.rancherClient.doAction(SNAPSHOT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go new file mode 100644 index 000000000..deb2fcc1b --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go @@ -0,0 +1,95 @@ +package client + +const ( + SNAPSHOT_BACKUP_INPUT_TYPE = "snapshotBackupInput" +) + +type SnapshotBackupInput struct { + Resource + + BackupTargetId string `json:"backupTargetId,omitempty" yaml:"backup_target_id,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` +} + +type SnapshotBackupInputCollection struct { + Collection + Data []SnapshotBackupInput `json:"data,omitempty"` +} + +type SnapshotBackupInputClient struct { + rancherClient *RancherClient +} + +type SnapshotBackupInputOperations interface { + List(opts *ListOpts) (*SnapshotBackupInputCollection, error) + Create(opts *SnapshotBackupInput) (*SnapshotBackupInput, error) + Update(existing *SnapshotBackupInput, updates interface{}) (*SnapshotBackupInput, error) + ById(id string) (*SnapshotBackupInput, error) + Delete(container *SnapshotBackupInput) error + + ActionCreate(*SnapshotBackupInput) (*Backup, error) + + ActionRemove(*SnapshotBackupInput) (*Backup, error) +} + +func newSnapshotBackupInputClient(rancherClient *RancherClient) *SnapshotBackupInputClient { + return &SnapshotBackupInputClient{ + rancherClient: rancherClient, + } +} + +func (c *SnapshotBackupInputClient) Create(container *SnapshotBackupInput) (*SnapshotBackupInput, error) { + resp := &SnapshotBackupInput{} + err := c.rancherClient.doCreate(SNAPSHOT_BACKUP_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *SnapshotBackupInputClient) Update(existing *SnapshotBackupInput, updates interface{}) (*SnapshotBackupInput, error) { + resp := &SnapshotBackupInput{} + err := c.rancherClient.doUpdate(SNAPSHOT_BACKUP_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SnapshotBackupInputClient) List(opts *ListOpts) (*SnapshotBackupInputCollection, error) { + resp := &SnapshotBackupInputCollection{} + err := c.rancherClient.doList(SNAPSHOT_BACKUP_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *SnapshotBackupInputClient) ById(id string) (*SnapshotBackupInput, error) { + resp := &SnapshotBackupInput{} + err := c.rancherClient.doById(SNAPSHOT_BACKUP_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SnapshotBackupInputClient) Delete(container *SnapshotBackupInput) error { + return c.rancherClient.doResourceDelete(SNAPSHOT_BACKUP_INPUT_TYPE, &container.Resource) +} + +func (c *SnapshotBackupInputClient) ActionCreate(resource *SnapshotBackupInput) (*Backup, error) { + + resp := &Backup{} + + err := c.rancherClient.doAction(SNAPSHOT_BACKUP_INPUT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SnapshotBackupInputClient) ActionRemove(resource *SnapshotBackupInput) (*Backup, error) { + + resp := &Backup{} + + err := c.rancherClient.doAction(SNAPSHOT_BACKUP_INPUT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_stack.go b/vendor/github.com/rancher/go-rancher/v2/generated_stack.go new file mode 100644 index 000000000..e761b2a30 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_stack.go @@ -0,0 +1,243 @@ +package client + +const ( + STACK_TYPE = "stack" +) + +type Stack struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` + + Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Outputs map[string]interface{} `json:"outputs,omitempty" yaml:"outputs,omitempty"` + + PreviousEnvironment map[string]interface{} `json:"previousEnvironment,omitempty" yaml:"previous_environment,omitempty"` + + PreviousExternalId string `json:"previousExternalId,omitempty" yaml:"previous_external_id,omitempty"` + + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type StackCollection struct { + Collection + Data []Stack `json:"data,omitempty"` +} + +type StackClient struct { + rancherClient *RancherClient +} + +type StackOperations interface { + List(opts *ListOpts) (*StackCollection, error) + Create(opts *Stack) (*Stack, error) + Update(existing *Stack, updates interface{}) (*Stack, error) + ById(id string) (*Stack, error) + Delete(container *Stack) error + + ActionActivateservices(*Stack) (*Stack, error) + + ActionAddoutputs(*Stack, *AddOutputsInput) (*Stack, error) + + ActionCancelupgrade(*Stack) (*Stack, error) + + ActionCreate(*Stack) (*Stack, error) + + ActionDeactivateservices(*Stack) (*Stack, error) + + ActionError(*Stack) (*Stack, error) + + ActionExportconfig(*Stack, *ComposeConfigInput) (*ComposeConfig, error) + + ActionFinishupgrade(*Stack) (*Stack, error) + + ActionRemove(*Stack) (*Stack, error) + + ActionRollback(*Stack) (*Stack, error) + + ActionUpdate(*Stack) (*Stack, error) + + ActionUpgrade(*Stack, *StackUpgrade) (*Stack, error) +} + +func newStackClient(rancherClient *RancherClient) *StackClient { + return &StackClient{ + rancherClient: rancherClient, + } +} + +func (c *StackClient) Create(container *Stack) (*Stack, error) { + resp := &Stack{} + err := c.rancherClient.doCreate(STACK_TYPE, container, resp) + return resp, err +} + +func (c *StackClient) Update(existing *Stack, updates interface{}) (*Stack, error) { + resp := &Stack{} + err := c.rancherClient.doUpdate(STACK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *StackClient) List(opts *ListOpts) (*StackCollection, error) { + resp := &StackCollection{} + err := c.rancherClient.doList(STACK_TYPE, opts, resp) + return resp, err +} + +func (c *StackClient) ById(id string) (*Stack, error) { + resp := &Stack{} + err := c.rancherClient.doById(STACK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *StackClient) Delete(container *Stack) error { + return c.rancherClient.doResourceDelete(STACK_TYPE, &container.Resource) +} + +func (c *StackClient) ActionActivateservices(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "activateservices", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionAddoutputs(resource *Stack, input *AddOutputsInput) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "addoutputs", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StackClient) ActionCancelupgrade(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionCreate(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionDeactivateservices(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "deactivateservices", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionError(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionExportconfig(resource *Stack, input *ComposeConfigInput) (*ComposeConfig, error) { + + resp := &ComposeConfig{} + + err := c.rancherClient.doAction(STACK_TYPE, "exportconfig", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StackClient) ActionFinishupgrade(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionRemove(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionRollback(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionUpdate(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionUpgrade(resource *Stack, input *StackUpgrade) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go new file mode 100644 index 000000000..76a823900 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go @@ -0,0 +1,73 @@ +package client + +const ( + STACK_UPGRADE_TYPE = "stackUpgrade" +) + +type StackUpgrade struct { + Resource + + DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` + + Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` +} + +type StackUpgradeCollection struct { + Collection + Data []StackUpgrade `json:"data,omitempty"` +} + +type StackUpgradeClient struct { + rancherClient *RancherClient +} + +type StackUpgradeOperations interface { + List(opts *ListOpts) (*StackUpgradeCollection, error) + Create(opts *StackUpgrade) (*StackUpgrade, error) + Update(existing *StackUpgrade, updates interface{}) (*StackUpgrade, error) + ById(id string) (*StackUpgrade, error) + Delete(container *StackUpgrade) error +} + +func newStackUpgradeClient(rancherClient *RancherClient) *StackUpgradeClient { + return &StackUpgradeClient{ + rancherClient: rancherClient, + } +} + +func (c *StackUpgradeClient) Create(container *StackUpgrade) (*StackUpgrade, error) { + resp := &StackUpgrade{} + err := c.rancherClient.doCreate(STACK_UPGRADE_TYPE, container, resp) + return resp, err +} + +func (c *StackUpgradeClient) Update(existing *StackUpgrade, updates interface{}) (*StackUpgrade, error) { + resp := &StackUpgrade{} + err := c.rancherClient.doUpdate(STACK_UPGRADE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *StackUpgradeClient) List(opts *ListOpts) (*StackUpgradeCollection, error) { + resp := &StackUpgradeCollection{} + err := c.rancherClient.doList(STACK_UPGRADE_TYPE, opts, resp) + return resp, err +} + +func (c *StackUpgradeClient) ById(id string) (*StackUpgrade, error) { + resp := &StackUpgrade{} + err := c.rancherClient.doById(STACK_UPGRADE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *StackUpgradeClient) Delete(container *StackUpgrade) error { + return c.rancherClient.doResourceDelete(STACK_UPGRADE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go b/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go new file mode 100644 index 000000000..d763903f4 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go @@ -0,0 +1,65 @@ +package client + +const ( + STATE_TRANSITION_TYPE = "stateTransition" +) + +type StateTransition struct { + Resource +} + +type StateTransitionCollection struct { + Collection + Data []StateTransition `json:"data,omitempty"` +} + +type StateTransitionClient struct { + rancherClient *RancherClient +} + +type StateTransitionOperations interface { + List(opts *ListOpts) (*StateTransitionCollection, error) + Create(opts *StateTransition) (*StateTransition, error) + Update(existing *StateTransition, updates interface{}) (*StateTransition, error) + ById(id string) (*StateTransition, error) + Delete(container *StateTransition) error +} + +func newStateTransitionClient(rancherClient *RancherClient) *StateTransitionClient { + return &StateTransitionClient{ + rancherClient: rancherClient, + } +} + +func (c *StateTransitionClient) Create(container *StateTransition) (*StateTransition, error) { + resp := &StateTransition{} + err := c.rancherClient.doCreate(STATE_TRANSITION_TYPE, container, resp) + return resp, err +} + +func (c *StateTransitionClient) Update(existing *StateTransition, updates interface{}) (*StateTransition, error) { + resp := &StateTransition{} + err := c.rancherClient.doUpdate(STATE_TRANSITION_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *StateTransitionClient) List(opts *ListOpts) (*StateTransitionCollection, error) { + resp := &StateTransitionCollection{} + err := c.rancherClient.doList(STATE_TRANSITION_TYPE, opts, resp) + return resp, err +} + +func (c *StateTransitionClient) ById(id string) (*StateTransition, error) { + resp := &StateTransition{} + err := c.rancherClient.doById(STATE_TRANSITION_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *StateTransitionClient) Delete(container *StateTransition) error { + return c.rancherClient.doResourceDelete(STATE_TRANSITION_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go b/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go new file mode 100644 index 000000000..1ec4d45be --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go @@ -0,0 +1,69 @@ +package client + +const ( + STATS_ACCESS_TYPE = "statsAccess" +) + +type StatsAccess struct { + Resource + + Token string `json:"token,omitempty" yaml:"token,omitempty"` + + Url string `json:"url,omitempty" yaml:"url,omitempty"` +} + +type StatsAccessCollection struct { + Collection + Data []StatsAccess `json:"data,omitempty"` +} + +type StatsAccessClient struct { + rancherClient *RancherClient +} + +type StatsAccessOperations interface { + List(opts *ListOpts) (*StatsAccessCollection, error) + Create(opts *StatsAccess) (*StatsAccess, error) + Update(existing *StatsAccess, updates interface{}) (*StatsAccess, error) + ById(id string) (*StatsAccess, error) + Delete(container *StatsAccess) error +} + +func newStatsAccessClient(rancherClient *RancherClient) *StatsAccessClient { + return &StatsAccessClient{ + rancherClient: rancherClient, + } +} + +func (c *StatsAccessClient) Create(container *StatsAccess) (*StatsAccess, error) { + resp := &StatsAccess{} + err := c.rancherClient.doCreate(STATS_ACCESS_TYPE, container, resp) + return resp, err +} + +func (c *StatsAccessClient) Update(existing *StatsAccess, updates interface{}) (*StatsAccess, error) { + resp := &StatsAccess{} + err := c.rancherClient.doUpdate(STATS_ACCESS_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *StatsAccessClient) List(opts *ListOpts) (*StatsAccessCollection, error) { + resp := &StatsAccessCollection{} + err := c.rancherClient.doList(STATS_ACCESS_TYPE, opts, resp) + return resp, err +} + +func (c *StatsAccessClient) ById(id string) (*StatsAccess, error) { + resp := &StatsAccess{} + err := c.rancherClient.doById(STATS_ACCESS_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *StatsAccessClient) Delete(container *StatsAccess) error { + return c.rancherClient.doResourceDelete(STATS_ACCESS_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go new file mode 100644 index 000000000..1175cfd8a --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go @@ -0,0 +1,178 @@ +package client + +const ( + STORAGE_POOL_TYPE = "storagePool" +) + +type StoragePool struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + BlockDevicePath string `json:"blockDevicePath,omitempty" yaml:"block_device_path,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + DriverName string `json:"driverName,omitempty" yaml:"driver_name,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` + + VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` +} + +type StoragePoolCollection struct { + Collection + Data []StoragePool `json:"data,omitempty"` +} + +type StoragePoolClient struct { + rancherClient *RancherClient +} + +type StoragePoolOperations interface { + List(opts *ListOpts) (*StoragePoolCollection, error) + Create(opts *StoragePool) (*StoragePool, error) + Update(existing *StoragePool, updates interface{}) (*StoragePool, error) + ById(id string) (*StoragePool, error) + Delete(container *StoragePool) error + + ActionActivate(*StoragePool) (*StoragePool, error) + + ActionCreate(*StoragePool) (*StoragePool, error) + + ActionDeactivate(*StoragePool) (*StoragePool, error) + + ActionPurge(*StoragePool) (*StoragePool, error) + + ActionRemove(*StoragePool) (*StoragePool, error) + + ActionRestore(*StoragePool) (*StoragePool, error) + + ActionUpdate(*StoragePool) (*StoragePool, error) +} + +func newStoragePoolClient(rancherClient *RancherClient) *StoragePoolClient { + return &StoragePoolClient{ + rancherClient: rancherClient, + } +} + +func (c *StoragePoolClient) Create(container *StoragePool) (*StoragePool, error) { + resp := &StoragePool{} + err := c.rancherClient.doCreate(STORAGE_POOL_TYPE, container, resp) + return resp, err +} + +func (c *StoragePoolClient) Update(existing *StoragePool, updates interface{}) (*StoragePool, error) { + resp := &StoragePool{} + err := c.rancherClient.doUpdate(STORAGE_POOL_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *StoragePoolClient) List(opts *ListOpts) (*StoragePoolCollection, error) { + resp := &StoragePoolCollection{} + err := c.rancherClient.doList(STORAGE_POOL_TYPE, opts, resp) + return resp, err +} + +func (c *StoragePoolClient) ById(id string) (*StoragePool, error) { + resp := &StoragePool{} + err := c.rancherClient.doById(STORAGE_POOL_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *StoragePoolClient) Delete(container *StoragePool) error { + return c.rancherClient.doResourceDelete(STORAGE_POOL_TYPE, &container.Resource) +} + +func (c *StoragePoolClient) ActionActivate(resource *StoragePool) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StoragePoolClient) ActionCreate(resource *StoragePool) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StoragePoolClient) ActionDeactivate(resource *StoragePool) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StoragePoolClient) ActionPurge(resource *StoragePool) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StoragePoolClient) ActionRemove(resource *StoragePool) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StoragePoolClient) ActionRestore(resource *StoragePool) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StoragePoolClient) ActionUpdate(resource *StoragePool) (*StoragePool, error) { + + resp := &StoragePool{} + + err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_subscribe.go b/vendor/github.com/rancher/go-rancher/v2/generated_subscribe.go new file mode 100644 index 000000000..b8c6aa072 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_subscribe.go @@ -0,0 +1,69 @@ +package client + +const ( + SUBSCRIBE_TYPE = "subscribe" +) + +type Subscribe struct { + Resource + + AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` + + EventNames []string `json:"eventNames,omitempty" yaml:"event_names,omitempty"` +} + +type SubscribeCollection struct { + Collection + Data []Subscribe `json:"data,omitempty"` +} + +type SubscribeClient struct { + rancherClient *RancherClient +} + +type SubscribeOperations interface { + List(opts *ListOpts) (*SubscribeCollection, error) + Create(opts *Subscribe) (*Subscribe, error) + Update(existing *Subscribe, updates interface{}) (*Subscribe, error) + ById(id string) (*Subscribe, error) + Delete(container *Subscribe) error +} + +func newSubscribeClient(rancherClient *RancherClient) *SubscribeClient { + return &SubscribeClient{ + rancherClient: rancherClient, + } +} + +func (c *SubscribeClient) Create(container *Subscribe) (*Subscribe, error) { + resp := &Subscribe{} + err := c.rancherClient.doCreate(SUBSCRIBE_TYPE, container, resp) + return resp, err +} + +func (c *SubscribeClient) Update(existing *Subscribe, updates interface{}) (*Subscribe, error) { + resp := &Subscribe{} + err := c.rancherClient.doUpdate(SUBSCRIBE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SubscribeClient) List(opts *ListOpts) (*SubscribeCollection, error) { + resp := &SubscribeCollection{} + err := c.rancherClient.doList(SUBSCRIBE_TYPE, opts, resp) + return resp, err +} + +func (c *SubscribeClient) ById(id string) (*Subscribe, error) { + resp := &Subscribe{} + err := c.rancherClient.doById(SUBSCRIBE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SubscribeClient) Delete(container *Subscribe) error { + return c.rancherClient.doResourceDelete(SUBSCRIBE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_task.go b/vendor/github.com/rancher/go-rancher/v2/generated_task.go new file mode 100644 index 000000000..13730c4ee --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_task.go @@ -0,0 +1,78 @@ +package client + +const ( + TASK_TYPE = "task" +) + +type Task struct { + Resource + + Name string `json:"name,omitempty" yaml:"name,omitempty"` +} + +type TaskCollection struct { + Collection + Data []Task `json:"data,omitempty"` +} + +type TaskClient struct { + rancherClient *RancherClient +} + +type TaskOperations interface { + List(opts *ListOpts) (*TaskCollection, error) + Create(opts *Task) (*Task, error) + Update(existing *Task, updates interface{}) (*Task, error) + ById(id string) (*Task, error) + Delete(container *Task) error + + ActionExecute(*Task) (*Task, error) +} + +func newTaskClient(rancherClient *RancherClient) *TaskClient { + return &TaskClient{ + rancherClient: rancherClient, + } +} + +func (c *TaskClient) Create(container *Task) (*Task, error) { + resp := &Task{} + err := c.rancherClient.doCreate(TASK_TYPE, container, resp) + return resp, err +} + +func (c *TaskClient) Update(existing *Task, updates interface{}) (*Task, error) { + resp := &Task{} + err := c.rancherClient.doUpdate(TASK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *TaskClient) List(opts *ListOpts) (*TaskCollection, error) { + resp := &TaskCollection{} + err := c.rancherClient.doList(TASK_TYPE, opts, resp) + return resp, err +} + +func (c *TaskClient) ById(id string) (*Task, error) { + resp := &Task{} + err := c.rancherClient.doById(TASK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *TaskClient) Delete(container *Task) error { + return c.rancherClient.doResourceDelete(TASK_TYPE, &container.Resource) +} + +func (c *TaskClient) ActionExecute(resource *Task) (*Task, error) { + + resp := &Task{} + + err := c.rancherClient.doAction(TASK_TYPE, "execute", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go new file mode 100644 index 000000000..52739b118 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go @@ -0,0 +1,77 @@ +package client + +const ( + TASK_INSTANCE_TYPE = "taskInstance" +) + +type TaskInstance struct { + Resource + + EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` + + Exception string `json:"exception,omitempty" yaml:"exception,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + ServerId string `json:"serverId,omitempty" yaml:"server_id,omitempty"` + + StartTime string `json:"startTime,omitempty" yaml:"start_time,omitempty"` + + TaskId string `json:"taskId,omitempty" yaml:"task_id,omitempty"` +} + +type TaskInstanceCollection struct { + Collection + Data []TaskInstance `json:"data,omitempty"` +} + +type TaskInstanceClient struct { + rancherClient *RancherClient +} + +type TaskInstanceOperations interface { + List(opts *ListOpts) (*TaskInstanceCollection, error) + Create(opts *TaskInstance) (*TaskInstance, error) + Update(existing *TaskInstance, updates interface{}) (*TaskInstance, error) + ById(id string) (*TaskInstance, error) + Delete(container *TaskInstance) error +} + +func newTaskInstanceClient(rancherClient *RancherClient) *TaskInstanceClient { + return &TaskInstanceClient{ + rancherClient: rancherClient, + } +} + +func (c *TaskInstanceClient) Create(container *TaskInstance) (*TaskInstance, error) { + resp := &TaskInstance{} + err := c.rancherClient.doCreate(TASK_INSTANCE_TYPE, container, resp) + return resp, err +} + +func (c *TaskInstanceClient) Update(existing *TaskInstance, updates interface{}) (*TaskInstance, error) { + resp := &TaskInstance{} + err := c.rancherClient.doUpdate(TASK_INSTANCE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *TaskInstanceClient) List(opts *ListOpts) (*TaskInstanceCollection, error) { + resp := &TaskInstanceCollection{} + err := c.rancherClient.doList(TASK_INSTANCE_TYPE, opts, resp) + return resp, err +} + +func (c *TaskInstanceClient) ById(id string) (*TaskInstance, error) { + resp := &TaskInstance{} + err := c.rancherClient.doById(TASK_INSTANCE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *TaskInstanceClient) Delete(container *TaskInstance) error { + return c.rancherClient.doResourceDelete(TASK_INSTANCE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go new file mode 100644 index 000000000..3abdc456f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go @@ -0,0 +1,75 @@ +package client + +const ( + TO_SERVICE_UPGRADE_STRATEGY_TYPE = "toServiceUpgradeStrategy" +) + +type ToServiceUpgradeStrategy struct { + Resource + + BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` + + FinalScale int64 `json:"finalScale,omitempty" yaml:"final_scale,omitempty"` + + IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` + + ToServiceId string `json:"toServiceId,omitempty" yaml:"to_service_id,omitempty"` + + UpdateLinks bool `json:"updateLinks,omitempty" yaml:"update_links,omitempty"` +} + +type ToServiceUpgradeStrategyCollection struct { + Collection + Data []ToServiceUpgradeStrategy `json:"data,omitempty"` +} + +type ToServiceUpgradeStrategyClient struct { + rancherClient *RancherClient +} + +type ToServiceUpgradeStrategyOperations interface { + List(opts *ListOpts) (*ToServiceUpgradeStrategyCollection, error) + Create(opts *ToServiceUpgradeStrategy) (*ToServiceUpgradeStrategy, error) + Update(existing *ToServiceUpgradeStrategy, updates interface{}) (*ToServiceUpgradeStrategy, error) + ById(id string) (*ToServiceUpgradeStrategy, error) + Delete(container *ToServiceUpgradeStrategy) error +} + +func newToServiceUpgradeStrategyClient(rancherClient *RancherClient) *ToServiceUpgradeStrategyClient { + return &ToServiceUpgradeStrategyClient{ + rancherClient: rancherClient, + } +} + +func (c *ToServiceUpgradeStrategyClient) Create(container *ToServiceUpgradeStrategy) (*ToServiceUpgradeStrategy, error) { + resp := &ToServiceUpgradeStrategy{} + err := c.rancherClient.doCreate(TO_SERVICE_UPGRADE_STRATEGY_TYPE, container, resp) + return resp, err +} + +func (c *ToServiceUpgradeStrategyClient) Update(existing *ToServiceUpgradeStrategy, updates interface{}) (*ToServiceUpgradeStrategy, error) { + resp := &ToServiceUpgradeStrategy{} + err := c.rancherClient.doUpdate(TO_SERVICE_UPGRADE_STRATEGY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ToServiceUpgradeStrategyClient) List(opts *ListOpts) (*ToServiceUpgradeStrategyCollection, error) { + resp := &ToServiceUpgradeStrategyCollection{} + err := c.rancherClient.doList(TO_SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) + return resp, err +} + +func (c *ToServiceUpgradeStrategyClient) ById(id string) (*ToServiceUpgradeStrategy, error) { + resp := &ToServiceUpgradeStrategy{} + err := c.rancherClient.doById(TO_SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ToServiceUpgradeStrategyClient) Delete(container *ToServiceUpgradeStrategy) error { + return c.rancherClient.doResourceDelete(TO_SERVICE_UPGRADE_STRATEGY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go b/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go new file mode 100644 index 000000000..dc1d5ef82 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go @@ -0,0 +1,69 @@ +package client + +const ( + TYPE_DOCUMENTATION_TYPE = "typeDocumentation" +) + +type TypeDocumentation struct { + Resource + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ResourceFields map[string]interface{} `json:"resourceFields,omitempty" yaml:"resource_fields,omitempty"` +} + +type TypeDocumentationCollection struct { + Collection + Data []TypeDocumentation `json:"data,omitempty"` +} + +type TypeDocumentationClient struct { + rancherClient *RancherClient +} + +type TypeDocumentationOperations interface { + List(opts *ListOpts) (*TypeDocumentationCollection, error) + Create(opts *TypeDocumentation) (*TypeDocumentation, error) + Update(existing *TypeDocumentation, updates interface{}) (*TypeDocumentation, error) + ById(id string) (*TypeDocumentation, error) + Delete(container *TypeDocumentation) error +} + +func newTypeDocumentationClient(rancherClient *RancherClient) *TypeDocumentationClient { + return &TypeDocumentationClient{ + rancherClient: rancherClient, + } +} + +func (c *TypeDocumentationClient) Create(container *TypeDocumentation) (*TypeDocumentation, error) { + resp := &TypeDocumentation{} + err := c.rancherClient.doCreate(TYPE_DOCUMENTATION_TYPE, container, resp) + return resp, err +} + +func (c *TypeDocumentationClient) Update(existing *TypeDocumentation, updates interface{}) (*TypeDocumentation, error) { + resp := &TypeDocumentation{} + err := c.rancherClient.doUpdate(TYPE_DOCUMENTATION_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *TypeDocumentationClient) List(opts *ListOpts) (*TypeDocumentationCollection, error) { + resp := &TypeDocumentationCollection{} + err := c.rancherClient.doList(TYPE_DOCUMENTATION_TYPE, opts, resp) + return resp, err +} + +func (c *TypeDocumentationClient) ById(id string) (*TypeDocumentation, error) { + resp := &TypeDocumentation{} + err := c.rancherClient.doById(TYPE_DOCUMENTATION_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *TypeDocumentationClient) Delete(container *TypeDocumentation) error { + return c.rancherClient.doResourceDelete(TYPE_DOCUMENTATION_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go new file mode 100644 index 000000000..cf8abedfb --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go @@ -0,0 +1,401 @@ +package client + +const ( + VIRTUAL_MACHINE_TYPE = "virtualMachine" +) + +type VirtualMachine struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` + + AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` + + BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + + Command []string `json:"command,omitempty" yaml:"command,omitempty"` + + Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` + + CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Disks []interface{} `json:"disks,omitempty" yaml:"disks,omitempty"` + + Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` + + DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` + + Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` + + FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + + ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` + + InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + + LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` + + Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` + + MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` + + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + + NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` + + NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` + + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` + + PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + + RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` + + RestartPolicy *RestartPolicy `json:"restartPolicy,omitempty" yaml:"restart_policy,omitempty"` + + SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + + StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + SystemContainer string `json:"systemContainer,omitempty" yaml:"system_container,omitempty"` + + Token string `json:"token,omitempty" yaml:"token,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` + + Version string `json:"version,omitempty" yaml:"version,omitempty"` + + VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` +} + +type VirtualMachineCollection struct { + Collection + Data []VirtualMachine `json:"data,omitempty"` +} + +type VirtualMachineClient struct { + rancherClient *RancherClient +} + +type VirtualMachineOperations interface { + List(opts *ListOpts) (*VirtualMachineCollection, error) + Create(opts *VirtualMachine) (*VirtualMachine, error) + Update(existing *VirtualMachine, updates interface{}) (*VirtualMachine, error) + ById(id string) (*VirtualMachine, error) + Delete(container *VirtualMachine) error + + ActionAllocate(*VirtualMachine) (*Instance, error) + + ActionConsole(*VirtualMachine, *InstanceConsoleInput) (*InstanceConsole, error) + + ActionCreate(*VirtualMachine) (*Instance, error) + + ActionDeallocate(*VirtualMachine) (*Instance, error) + + ActionError(*VirtualMachine) (*Instance, error) + + ActionExecute(*VirtualMachine, *ContainerExec) (*HostAccess, error) + + ActionLogs(*VirtualMachine, *ContainerLogs) (*HostAccess, error) + + ActionMigrate(*VirtualMachine) (*Instance, error) + + ActionProxy(*VirtualMachine, *ContainerProxy) (*HostAccess, error) + + ActionPurge(*VirtualMachine) (*Instance, error) + + ActionRemove(*VirtualMachine) (*Instance, error) + + ActionRestart(*VirtualMachine) (*Instance, error) + + ActionRestore(*VirtualMachine) (*Instance, error) + + ActionSetlabels(*VirtualMachine, *SetLabelsInput) (*Container, error) + + ActionStart(*VirtualMachine) (*Instance, error) + + ActionStop(*VirtualMachine, *InstanceStop) (*Instance, error) + + ActionUpdate(*VirtualMachine) (*Instance, error) + + ActionUpdatehealthy(*VirtualMachine) (*Instance, error) + + ActionUpdatereinitializing(*VirtualMachine) (*Instance, error) + + ActionUpdateunhealthy(*VirtualMachine) (*Instance, error) +} + +func newVirtualMachineClient(rancherClient *RancherClient) *VirtualMachineClient { + return &VirtualMachineClient{ + rancherClient: rancherClient, + } +} + +func (c *VirtualMachineClient) Create(container *VirtualMachine) (*VirtualMachine, error) { + resp := &VirtualMachine{} + err := c.rancherClient.doCreate(VIRTUAL_MACHINE_TYPE, container, resp) + return resp, err +} + +func (c *VirtualMachineClient) Update(existing *VirtualMachine, updates interface{}) (*VirtualMachine, error) { + resp := &VirtualMachine{} + err := c.rancherClient.doUpdate(VIRTUAL_MACHINE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *VirtualMachineClient) List(opts *ListOpts) (*VirtualMachineCollection, error) { + resp := &VirtualMachineCollection{} + err := c.rancherClient.doList(VIRTUAL_MACHINE_TYPE, opts, resp) + return resp, err +} + +func (c *VirtualMachineClient) ById(id string) (*VirtualMachine, error) { + resp := &VirtualMachine{} + err := c.rancherClient.doById(VIRTUAL_MACHINE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *VirtualMachineClient) Delete(container *VirtualMachine) error { + return c.rancherClient.doResourceDelete(VIRTUAL_MACHINE_TYPE, &container.Resource) +} + +func (c *VirtualMachineClient) ActionAllocate(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "allocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionConsole(resource *VirtualMachine, input *InstanceConsoleInput) (*InstanceConsole, error) { + + resp := &InstanceConsole{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "console", &resource.Resource, input, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionCreate(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionDeallocate(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "deallocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionError(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionExecute(resource *VirtualMachine, input *ContainerExec) (*HostAccess, error) { + + resp := &HostAccess{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "execute", &resource.Resource, input, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionLogs(resource *VirtualMachine, input *ContainerLogs) (*HostAccess, error) { + + resp := &HostAccess{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "logs", &resource.Resource, input, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionMigrate(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "migrate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionProxy(resource *VirtualMachine, input *ContainerProxy) (*HostAccess, error) { + + resp := &HostAccess{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "proxy", &resource.Resource, input, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionPurge(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionRemove(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionRestart(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "restart", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionRestore(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionSetlabels(resource *VirtualMachine, input *SetLabelsInput) (*Container, error) { + + resp := &Container{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "setlabels", &resource.Resource, input, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionStart(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "start", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionStop(resource *VirtualMachine, input *InstanceStop) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "stop", &resource.Resource, input, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionUpdate(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionUpdatehealthy(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "updatehealthy", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionUpdatereinitializing(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "updatereinitializing", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VirtualMachineClient) ActionUpdateunhealthy(resource *VirtualMachine) (*Instance, error) { + + resp := &Instance{} + + err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "updateunhealthy", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go new file mode 100644 index 000000000..7e1e8a526 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go @@ -0,0 +1,79 @@ +package client + +const ( + VIRTUAL_MACHINE_DISK_TYPE = "virtualMachineDisk" +) + +type VirtualMachineDisk struct { + Resource + + Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Opts map[string]interface{} `json:"opts,omitempty" yaml:"opts,omitempty"` + + ReadIops int64 `json:"readIops,omitempty" yaml:"read_iops,omitempty"` + + Root bool `json:"root,omitempty" yaml:"root,omitempty"` + + Size string `json:"size,omitempty" yaml:"size,omitempty"` + + WriteIops int64 `json:"writeIops,omitempty" yaml:"write_iops,omitempty"` +} + +type VirtualMachineDiskCollection struct { + Collection + Data []VirtualMachineDisk `json:"data,omitempty"` +} + +type VirtualMachineDiskClient struct { + rancherClient *RancherClient +} + +type VirtualMachineDiskOperations interface { + List(opts *ListOpts) (*VirtualMachineDiskCollection, error) + Create(opts *VirtualMachineDisk) (*VirtualMachineDisk, error) + Update(existing *VirtualMachineDisk, updates interface{}) (*VirtualMachineDisk, error) + ById(id string) (*VirtualMachineDisk, error) + Delete(container *VirtualMachineDisk) error +} + +func newVirtualMachineDiskClient(rancherClient *RancherClient) *VirtualMachineDiskClient { + return &VirtualMachineDiskClient{ + rancherClient: rancherClient, + } +} + +func (c *VirtualMachineDiskClient) Create(container *VirtualMachineDisk) (*VirtualMachineDisk, error) { + resp := &VirtualMachineDisk{} + err := c.rancherClient.doCreate(VIRTUAL_MACHINE_DISK_TYPE, container, resp) + return resp, err +} + +func (c *VirtualMachineDiskClient) Update(existing *VirtualMachineDisk, updates interface{}) (*VirtualMachineDisk, error) { + resp := &VirtualMachineDisk{} + err := c.rancherClient.doUpdate(VIRTUAL_MACHINE_DISK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *VirtualMachineDiskClient) List(opts *ListOpts) (*VirtualMachineDiskCollection, error) { + resp := &VirtualMachineDiskCollection{} + err := c.rancherClient.doList(VIRTUAL_MACHINE_DISK_TYPE, opts, resp) + return resp, err +} + +func (c *VirtualMachineDiskClient) ById(id string) (*VirtualMachineDisk, error) { + resp := &VirtualMachineDisk{} + err := c.rancherClient.doById(VIRTUAL_MACHINE_DISK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *VirtualMachineDiskClient) Delete(container *VirtualMachineDisk) error { + return c.rancherClient.doResourceDelete(VIRTUAL_MACHINE_DISK_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume.go new file mode 100644 index 000000000..395deb6de --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_volume.go @@ -0,0 +1,228 @@ +package client + +const ( + VOLUME_TYPE = "volume" +) + +type Volume struct { + Resource + + AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` + + DriverOpts map[string]interface{} `json:"driverOpts,omitempty" yaml:"driver_opts,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + ImageId string `json:"imageId,omitempty" yaml:"image_id,omitempty"` + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + IsHostPath bool `json:"isHostPath,omitempty" yaml:"is_host_path,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type VolumeCollection struct { + Collection + Data []Volume `json:"data,omitempty"` +} + +type VolumeClient struct { + rancherClient *RancherClient +} + +type VolumeOperations interface { + List(opts *ListOpts) (*VolumeCollection, error) + Create(opts *Volume) (*Volume, error) + Update(existing *Volume, updates interface{}) (*Volume, error) + ById(id string) (*Volume, error) + Delete(container *Volume) error + + ActionActivate(*Volume) (*Volume, error) + + ActionAllocate(*Volume) (*Volume, error) + + ActionCreate(*Volume) (*Volume, error) + + ActionDeallocate(*Volume) (*Volume, error) + + ActionPurge(*Volume) (*Volume, error) + + ActionRemove(*Volume) (*Volume, error) + + ActionRestore(*Volume) (*Volume, error) + + ActionRestorefrombackup(*Volume, *RestoreFromBackupInput) (*Volume, error) + + ActionReverttosnapshot(*Volume, *RevertToSnapshotInput) (*Volume, error) + + ActionSnapshot(*Volume, *VolumeSnapshotInput) (*Snapshot, error) + + ActionUpdate(*Volume) (*Volume, error) +} + +func newVolumeClient(rancherClient *RancherClient) *VolumeClient { + return &VolumeClient{ + rancherClient: rancherClient, + } +} + +func (c *VolumeClient) Create(container *Volume) (*Volume, error) { + resp := &Volume{} + err := c.rancherClient.doCreate(VOLUME_TYPE, container, resp) + return resp, err +} + +func (c *VolumeClient) Update(existing *Volume, updates interface{}) (*Volume, error) { + resp := &Volume{} + err := c.rancherClient.doUpdate(VOLUME_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *VolumeClient) List(opts *ListOpts) (*VolumeCollection, error) { + resp := &VolumeCollection{} + err := c.rancherClient.doList(VOLUME_TYPE, opts, resp) + return resp, err +} + +func (c *VolumeClient) ById(id string) (*Volume, error) { + resp := &Volume{} + err := c.rancherClient.doById(VOLUME_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *VolumeClient) Delete(container *Volume) error { + return c.rancherClient.doResourceDelete(VOLUME_TYPE, &container.Resource) +} + +func (c *VolumeClient) ActionActivate(resource *Volume) (*Volume, error) { + + resp := &Volume{} + + err := c.rancherClient.doAction(VOLUME_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeClient) ActionAllocate(resource *Volume) (*Volume, error) { + + resp := &Volume{} + + err := c.rancherClient.doAction(VOLUME_TYPE, "allocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeClient) ActionCreate(resource *Volume) (*Volume, error) { + + resp := &Volume{} + + err := c.rancherClient.doAction(VOLUME_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeClient) ActionDeallocate(resource *Volume) (*Volume, error) { + + resp := &Volume{} + + err := c.rancherClient.doAction(VOLUME_TYPE, "deallocate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeClient) ActionPurge(resource *Volume) (*Volume, error) { + + resp := &Volume{} + + err := c.rancherClient.doAction(VOLUME_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeClient) ActionRemove(resource *Volume) (*Volume, error) { + + resp := &Volume{} + + err := c.rancherClient.doAction(VOLUME_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeClient) ActionRestore(resource *Volume) (*Volume, error) { + + resp := &Volume{} + + err := c.rancherClient.doAction(VOLUME_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeClient) ActionRestorefrombackup(resource *Volume, input *RestoreFromBackupInput) (*Volume, error) { + + resp := &Volume{} + + err := c.rancherClient.doAction(VOLUME_TYPE, "restorefrombackup", &resource.Resource, input, resp) + + return resp, err +} + +func (c *VolumeClient) ActionReverttosnapshot(resource *Volume, input *RevertToSnapshotInput) (*Volume, error) { + + resp := &Volume{} + + err := c.rancherClient.doAction(VOLUME_TYPE, "reverttosnapshot", &resource.Resource, input, resp) + + return resp, err +} + +func (c *VolumeClient) ActionSnapshot(resource *Volume, input *VolumeSnapshotInput) (*Snapshot, error) { + + resp := &Snapshot{} + + err := c.rancherClient.doAction(VOLUME_TYPE, "snapshot", &resource.Resource, input, resp) + + return resp, err +} + +func (c *VolumeClient) ActionUpdate(resource *Volume) (*Volume, error) { + + resp := &Volume{} + + err := c.rancherClient.doAction(VOLUME_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go new file mode 100644 index 000000000..10df7edea --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go @@ -0,0 +1,67 @@ +package client + +const ( + VOLUME_SNAPSHOT_INPUT_TYPE = "volumeSnapshotInput" +) + +type VolumeSnapshotInput struct { + Resource + + Name string `json:"name,omitempty" yaml:"name,omitempty"` +} + +type VolumeSnapshotInputCollection struct { + Collection + Data []VolumeSnapshotInput `json:"data,omitempty"` +} + +type VolumeSnapshotInputClient struct { + rancherClient *RancherClient +} + +type VolumeSnapshotInputOperations interface { + List(opts *ListOpts) (*VolumeSnapshotInputCollection, error) + Create(opts *VolumeSnapshotInput) (*VolumeSnapshotInput, error) + Update(existing *VolumeSnapshotInput, updates interface{}) (*VolumeSnapshotInput, error) + ById(id string) (*VolumeSnapshotInput, error) + Delete(container *VolumeSnapshotInput) error +} + +func newVolumeSnapshotInputClient(rancherClient *RancherClient) *VolumeSnapshotInputClient { + return &VolumeSnapshotInputClient{ + rancherClient: rancherClient, + } +} + +func (c *VolumeSnapshotInputClient) Create(container *VolumeSnapshotInput) (*VolumeSnapshotInput, error) { + resp := &VolumeSnapshotInput{} + err := c.rancherClient.doCreate(VOLUME_SNAPSHOT_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *VolumeSnapshotInputClient) Update(existing *VolumeSnapshotInput, updates interface{}) (*VolumeSnapshotInput, error) { + resp := &VolumeSnapshotInput{} + err := c.rancherClient.doUpdate(VOLUME_SNAPSHOT_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *VolumeSnapshotInputClient) List(opts *ListOpts) (*VolumeSnapshotInputCollection, error) { + resp := &VolumeSnapshotInputCollection{} + err := c.rancherClient.doList(VOLUME_SNAPSHOT_INPUT_TYPE, opts, resp) + return resp, err +} + +func (c *VolumeSnapshotInputClient) ById(id string) (*VolumeSnapshotInput, error) { + resp := &VolumeSnapshotInput{} + err := c.rancherClient.doById(VOLUME_SNAPSHOT_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *VolumeSnapshotInputClient) Delete(container *VolumeSnapshotInput) error { + return c.rancherClient.doResourceDelete(VOLUME_SNAPSHOT_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/schemas.go b/vendor/github.com/rancher/go-rancher/v2/schemas.go new file mode 100644 index 000000000..e5fd2f54f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/schemas.go @@ -0,0 +1,129 @@ +package client + +import ( + "reflect" + "strings" +) + +type Schemas struct { + Collection + Data []Schema `json:"data,omitempty"` + schemasByName map[string]*Schema +} + +func (s *Schema) CheckField(name string) (Field, bool) { + for fieldName := range s.ResourceFields { + if fieldName == name { + v, ok := s.ResourceFields[fieldName] + return v, ok + } + } + return Field{}, false +} + +func (s *Schema) Field(name string) Field { + f, _ := s.CheckField(name) + return f +} + +func (s *Schemas) CheckSchema(name string) (Schema, bool) { + for i := range s.Data { + if s.Data[i].Id == name { + return s.Data[i], true + } + } + return Schema{}, false +} + +func (s *Schemas) Schema(name string) Schema { + r, _ := s.CheckSchema(name) + return r +} + +func typeToFields(t reflect.Type) map[string]Field { + result := map[string]Field{} + + for i := 0; i < t.NumField(); i++ { + schemaField := Field{} + + typeField := t.Field(i) + if typeField.Anonymous && typeField.Type.Kind() == reflect.Struct { + parentFields := typeToFields(typeField.Type) + for k, v := range result { + parentFields[k] = v + } + result = parentFields + continue + } else if typeField.Anonymous { + continue + } + + fieldString := strings.ToLower(typeField.Type.Kind().String()) + + switch { + case strings.HasPrefix(fieldString, "int") || strings.HasPrefix(fieldString, "uint"): + schemaField.Type = "int" + case fieldString == "bool": + schemaField.Type = fieldString + case fieldString == "float32" || fieldString == "float64": + schemaField.Type = "float" + case fieldString == "string": + schemaField.Type = "string" + case fieldString == "map": + // HACK + schemaField.Type = "map[string]" + case fieldString == "slice": + // HACK + schemaField.Type = "array[string]" + } + + name := strings.Split(typeField.Tag.Get("json"), ",")[0] + if name == "" && len(typeField.Name) > 1 { + name = strings.ToLower(typeField.Name[0:1]) + typeField.Name[1:] + } else if name == "" { + name = typeField.Name + } + + if schemaField.Type != "" { + result[name] = schemaField + } + } + + return result +} + +func (s *Schemas) AddType(schemaName string, obj interface{}) *Schema { + t := reflect.TypeOf(obj) + schema := Schema{ + Resource: Resource{ + Id: schemaName, + Type: "schema", + Links: map[string]string{}, + }, + PluralName: guessPluralName(schemaName), + ResourceFields: typeToFields(t), + CollectionMethods: []string{"GET"}, + ResourceMethods: []string{"GET"}, + } + + if s.Data == nil { + s.Data = []Schema{} + } + + s.Data = append(s.Data, schema) + + return &s.Data[len(s.Data)-1] +} + +func guessPluralName(name string) string { + if name == "" { + return "" + } + + if strings.HasSuffix(name, "s") || + strings.HasSuffix(name, "ch") || + strings.HasSuffix(name, "x") { + return name + "es" + } + return name + "s" +} diff --git a/vendor/github.com/rancher/go-rancher/v2/types.go b/vendor/github.com/rancher/go-rancher/v2/types.go new file mode 100644 index 000000000..905df87ff --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/types.go @@ -0,0 +1,95 @@ +package client + +type Collection struct { + Type string `json:"type,omitempty"` + ResourceType string `json:"resourceType,omitempty"` + Links map[string]string `json:"links,omitempty"` + CreateTypes map[string]string `json:"createTypes,omitempty"` + Actions map[string]string `json:"actions,omitempty"` + SortLinks map[string]string `json:"sortLinks,omitempty"` + Pagination *Pagination `json:"pagination,omitempty"` + Sort *Sort `json:"sort,omitempty"` + Filters map[string][]Condition `json:"filters,omitempty"` +} + +type GenericCollection struct { + Collection + Data []interface{} `json:"data,omitempty"` +} + +type ResourceCollection struct { + Collection + Data []Resource `json:"data,omitempty"` +} + +type Sort struct { + Name string `json:"name,omitempty"` + Order string `json:"order,omitempty"` + Reverse string `json:"reverse,omitempty"` +} + +type Condition struct { + Modifier string `json:"modifier,omitempty"` + Value interface{} `json:"value,omitempty"` +} + +type Pagination struct { + Marker string `json:"marker,omitempty"` + First string `json:"first,omitempty"` + Previous string `json:"previous,omitempty"` + Next string `json:"next,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Total *int64 `json:"total,omitempty"` + Partial bool `json:"partial,omitempty"` +} + +type Resource struct { + Id string `json:"id,omitempty"` + Type string `json:"type,omitempty"` + Links map[string]string `json:"links"` + Actions map[string]string `json:"actions"` +} + +type Schema struct { + Resource + PluralName string `json:"pluralName,omitempty"` + ResourceMethods []string `json:"resourceMethods,omitempty"` + ResourceFields map[string]Field `json:"resourceFields,omitempty"` + ResourceActions map[string]Action `json:"resourceActions,omitempty"` + CollectionMethods []string `json:"collectionMethods,omitempty"` + CollectionFields map[string]Field `json:"collectionFields,omitempty"` + CollectionActions map[string]Action `json:"collectionActions,omitempty"` + CollectionFilters map[string]Filter `json:"collectionFilters,omitempty"` + IncludeableLinks []string `json:"includeableLinks,omitempty"` +} + +type Field struct { + Type string `json:"type,omitempty"` + Default interface{} `json:"default,omitempty"` + Unique bool `json:"unique,omitempty"` + Nullable bool `json:"nullable,omitempty"` + Create bool `json:"create,omitempty"` + Required bool `json:"required,omitempty"` + Update bool `json:"update,omitempty"` + MinLength *int64 `json:"minLength,omitempty"` + MaxLength *int64 `json:"maxLength,omitempty"` + Min *int64 `json:"min,omitempty"` + Max *int64 `json:"max,omitempty"` + Options []string `json:"options,omitempty"` + ValidChars string `json:"validChars,omitempty"` + InvalidChars string `json:"invalidChars,omitempty"` + Description string `json:"description,omitempty"` +} + +type Action struct { + Input string `json:"input,omitempty"` + Output string `json:"output,omitempty"` +} + +type Filter struct { + Modifiers []string `json:"modifiers,omitempty"` +} + +type ListOpts struct { + Filters map[string]interface{} +} diff --git a/vendor/github.com/rancher/rancher-compose/.drone.yml b/vendor/github.com/rancher/rancher-compose/.drone.yml index b0f0e2ebd..f88938bbe 100644 --- a/vendor/github.com/rancher/rancher-compose/.drone.yml +++ b/vendor/github.com/rancher/rancher-compose/.drone.yml @@ -1,4 +1,8 @@ -image: rancher/dind:v1.10.0-rancher1 -script: - - wrapdocker - - make ci +--- +pipeline: + build: + privileged: true + image: rancher/dind:v1.10.0-rancher1 + commands: + - wrapdocker + - make ci diff --git a/vendor/github.com/rancher/rancher-compose/Dockerfile.dapper b/vendor/github.com/rancher/rancher-compose/Dockerfile.dapper index 5295e69b1..4f64f7e9e 100644 --- a/vendor/github.com/rancher/rancher-compose/Dockerfile.dapper +++ b/vendor/github.com/rancher/rancher-compose/Dockerfile.dapper @@ -1,5 +1,5 @@ FROM golang:1.6 -RUN go get github.com/imikushin/trash +RUN go get github.com/rancher/trash RUN go get github.com/golang/lint/golint RUN curl -sL https://get.docker.com/builds/Linux/x86_64/docker-1.9.1 > /usr/bin/docker && \ chmod +x /usr/bin/docker diff --git a/vendor/github.com/rancher/rancher-compose/app/app.go b/vendor/github.com/rancher/rancher-compose/app/app.go index 7d3fd1411..1d5e9188c 100644 --- a/vendor/github.com/rancher/rancher-compose/app/app.go +++ b/vendor/github.com/rancher/rancher-compose/app/app.go @@ -38,7 +38,7 @@ func (p *ProjectFactory) Create(c *cli.Context) (project.APIProject, error) { context := &rancher.Context{ Context: project.Context{ - ResourceLookup: &rLookup.FileConfigLookup{}, + ResourceLookup: &rLookup.FileResourceLookup{}, EnvironmentLookup: envLookup, LoggerFactory: logger.NewColorLoggerFactory(), }, diff --git a/vendor/github.com/rancher/rancher-compose/digest/hash.go b/vendor/github.com/rancher/rancher-compose/digest/hash.go index d43f79a6b..d156e7cd4 100644 --- a/vendor/github.com/rancher/rancher-compose/digest/hash.go +++ b/vendor/github.com/rancher/rancher-compose/digest/hash.go @@ -9,7 +9,7 @@ import ( "sort" "github.com/docker/libcompose/utils" - rancherClient "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" rUtils "github.com/rancher/rancher-compose/utils" ) @@ -24,7 +24,7 @@ var ( "scale", "selector_container", "selector_link", - "environment_id", + "stack_id", } ) @@ -49,7 +49,7 @@ func toString(obj interface{}) string { return fmt.Sprintf("%v", obj) } -func LookupHash(service *rancherClient.Service) (ServiceHash, bool) { +func LookupHash(service *client.Service) (ServiceHash, bool) { ret := ServiceHash{ SecondaryLaunchConfigs: map[string]string{}, } @@ -58,7 +58,7 @@ func LookupHash(service *rancherClient.Service) (ServiceHash, bool) { ret.LaunchConfig = toString(service.LaunchConfig.Labels[ServiceHashKey]) for _, rawSecondaryLaunchConfig := range service.SecondaryLaunchConfigs { - var secondaryLaunchConfig rancherClient.SecondaryLaunchConfig + var secondaryLaunchConfig client.SecondaryLaunchConfig if err := utils.Convert(rawSecondaryLaunchConfig, &secondaryLaunchConfig); err != nil { return ret, false } @@ -68,7 +68,7 @@ func LookupHash(service *rancherClient.Service) (ServiceHash, bool) { return ret, ret.Service != "" } -func CreateServiceHash(rancherService interface{}, launchConfig *rancherClient.LaunchConfig, secondaryLaunchConfigs []rancherClient.SecondaryLaunchConfig) (ServiceHash, error) { +func CreateServiceHash(rancherService interface{}, launchConfig *client.LaunchConfig, secondaryLaunchConfigs []client.SecondaryLaunchConfig) (ServiceHash, error) { var err error result := ServiceHash{} if err != nil { diff --git a/vendor/github.com/rancher/rancher-compose/lookup/file.go b/vendor/github.com/rancher/rancher-compose/lookup/file.go index c315f15da..24aa0eaba 100644 --- a/vendor/github.com/rancher/rancher-compose/lookup/file.go +++ b/vendor/github.com/rancher/rancher-compose/lookup/file.go @@ -8,12 +8,12 @@ import ( "github.com/docker/libcompose/lookup" ) -type FileConfigLookup struct { - lookup.FileConfigLookup +type FileResourceLookup struct { + lookup.FileResourceLookup } // Give a warning rather than resolve relative paths -func (f *FileConfigLookup) ResolvePath(path, inFile string) string { +func (f *FileResourceLookup) ResolvePath(path, inFile string) string { vs := strings.SplitN(path, ":", 2) if len(vs) == 2 && !filepath.IsAbs(vs[0]) { log.Warnf("Rancher Compose will not resolve relative path %s", vs[0]) diff --git a/vendor/github.com/rancher/rancher-compose/lookup/questions.go b/vendor/github.com/rancher/rancher-compose/lookup/questions.go index 1ff4b1d82..cb5d8f73f 100644 --- a/vendor/github.com/rancher/rancher-compose/lookup/questions.go +++ b/vendor/github.com/rancher/rancher-compose/lookup/questions.go @@ -77,9 +77,9 @@ func (f *QuestionLookup) Lookup(key, serviceName string, config *config.ServiceC } if f.Context != nil { - env, err := f.Context.LoadEnv() - if err == nil && env != nil { - if v, ok := env.Environment[key]; ok { + stack, err := f.Context.LoadStack() + if err == nil && stack != nil { + if v, ok := stack.Environment[key]; ok { return join(key, fmt.Sprintf("%v", v)) } } diff --git a/vendor/github.com/rancher/rancher-compose/preprocess/project.go b/vendor/github.com/rancher/rancher-compose/preprocess/project.go index fe2ac803f..39c122b34 100644 --- a/vendor/github.com/rancher/rancher-compose/preprocess/project.go +++ b/vendor/github.com/rancher/rancher-compose/preprocess/project.go @@ -2,6 +2,7 @@ package preprocess import ( "fmt" + "strconv" "github.com/docker/libcompose/config" ) @@ -47,9 +48,62 @@ func Preprocess(item interface{}, replaceTypes bool) interface{} { return newArray default: - if replaceTypes { + if replaceTypes && item != nil { return fmt.Sprint(item) } return item } } + +func TryConvertStringsToInts(serviceMap config.RawServiceMap) (config.RawServiceMap, error) { + newServiceMap := make(config.RawServiceMap) + + for k, v := range serviceMap { + newServiceMap[k] = make(config.RawService) + + for k2, v2 := range v { + if k2 == "disks" || k2 == "load_balancer_config" || k2 == "health_check" || k2 == "scale_policy" || k2 == "upgrade_strategy" || k2 == "service_schemas" { + newServiceMap[k][k2] = tryConvertStringsToInts(v2, true) + } else { + newServiceMap[k][k2] = tryConvertStringsToInts(v2, false) + } + + } + } + + return newServiceMap, nil +} + +func tryConvertStringsToInts(item interface{}, replaceTypes bool) interface{} { + switch typedDatas := item.(type) { + + case map[interface{}]interface{}: + newMap := make(map[interface{}]interface{}) + + for key, value := range typedDatas { + newMap[key] = tryConvertStringsToInts(value, replaceTypes) + } + return newMap + + case []interface{}: + // newArray := make([]interface{}, 0) will cause golint to complain + var newArray []interface{} + newArray = make([]interface{}, 0) + + for _, value := range typedDatas { + newArray = append(newArray, tryConvertStringsToInts(value, replaceTypes)) + } + return newArray + + case string: + lineAsInteger, err := strconv.Atoi(typedDatas) + + if replaceTypes && err == nil { + return lineAsInteger + } + + return item + default: + return item + } +} diff --git a/vendor/github.com/rancher/rancher-compose/rancher/certs.go b/vendor/github.com/rancher/rancher-compose/rancher/certs.go index 3f052180f..c9e91c728 100644 --- a/vendor/github.com/rancher/rancher-compose/rancher/certs.go +++ b/vendor/github.com/rancher/rancher-compose/rancher/certs.go @@ -3,12 +3,12 @@ package rancher import ( "fmt" - rancherClient "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" ) -func populateCerts(client *rancherClient.RancherClient, lbService *CompositeService, rancherConfig *RancherConfig) error { +func populateCerts(apiClient *client.RancherClient, lbService *CompositeService, rancherConfig *RancherConfig) error { if rancherConfig.DefaultCert != "" { - if certId, err := findCertByName(client, rancherConfig.DefaultCert); err != nil { + if certId, err := findCertByName(apiClient, rancherConfig.DefaultCert); err != nil { return err } else { lbService.DefaultCertificateId = certId @@ -17,7 +17,7 @@ func populateCerts(client *rancherClient.RancherClient, lbService *CompositeServ lbService.CertificateIds = []string{} for _, certName := range rancherConfig.Certs { - if certId, err := findCertByName(client, certName); err != nil { + if certId, err := findCertByName(apiClient, certName); err != nil { return err } else { @@ -28,8 +28,8 @@ func populateCerts(client *rancherClient.RancherClient, lbService *CompositeServ return nil } -func findCertByName(client *rancherClient.RancherClient, name string) (string, error) { - certs, err := client.Certificate.List(&rancherClient.ListOpts{ +func findCertByName(apiClient *client.RancherClient, name string) (string, error) { + certs, err := apiClient.Certificate.List(&client.ListOpts{ Filters: map[string]interface{}{ "removed_null": nil, "name": name, diff --git a/vendor/github.com/rancher/rancher-compose/rancher/configs.go b/vendor/github.com/rancher/rancher-compose/rancher/configs.go index d60e6c4d9..b04415b57 100644 --- a/vendor/github.com/rancher/rancher-compose/rancher/configs.go +++ b/vendor/github.com/rancher/rancher-compose/rancher/configs.go @@ -8,13 +8,13 @@ import ( "github.com/Sirupsen/logrus" "github.com/docker/engine-api/types/container" "github.com/docker/libcompose/config" - "github.com/docker/libcompose/docker" + "github.com/docker/libcompose/docker/service" "github.com/docker/libcompose/utils" - rancherClient "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" ) -func createLaunchConfigs(r *RancherService) (rancherClient.LaunchConfig, []rancherClient.SecondaryLaunchConfig, error) { - secondaryLaunchConfigs := []rancherClient.SecondaryLaunchConfig{} +func createLaunchConfigs(r *RancherService) (client.LaunchConfig, []client.SecondaryLaunchConfig, error) { + secondaryLaunchConfigs := []client.SecondaryLaunchConfig{} launchConfig, err := createLaunchConfig(r, r.Name(), r.Config()) if err != nil { return launchConfig, nil, err @@ -34,7 +34,7 @@ func createLaunchConfigs(r *RancherService) (rancherClient.LaunchConfig, []ranch } launchConfig.HealthCheck = r.HealthCheck(secondaryName) - var secondaryLaunchConfig rancherClient.SecondaryLaunchConfig + var secondaryLaunchConfig client.SecondaryLaunchConfig utils.Convert(launchConfig, &secondaryLaunchConfig) secondaryLaunchConfig.Name = secondaryName @@ -48,15 +48,15 @@ func createLaunchConfigs(r *RancherService) (rancherClient.LaunchConfig, []ranch return launchConfig, secondaryLaunchConfigs, nil } -func createLaunchConfig(r *RancherService, name string, serviceConfig *config.ServiceConfig) (rancherClient.LaunchConfig, error) { - var result rancherClient.LaunchConfig +func createLaunchConfig(r *RancherService, name string, serviceConfig *config.ServiceConfig) (client.LaunchConfig, error) { + var result client.LaunchConfig rancherConfig := r.context.RancherConfig[name] schemasUrl := strings.SplitN(r.Context().Client.Schemas.Links["self"], "/schemas", 2)[0] scriptsUrl := schemasUrl + "/scripts/transform" - config, hostConfig, err := docker.Convert(serviceConfig, r.context.Context) + config, hostConfig, err := service.Convert(serviceConfig, r.context.Context) if err != nil { return result, err } @@ -86,9 +86,9 @@ func createLaunchConfig(r *RancherService, name string, serviceConfig *config.Se } result.Kind = rancherConfig.Type - result.Vcpu = rancherConfig.Vcpu + result.Vcpu = int64(rancherConfig.Vcpu) result.Userdata = rancherConfig.Userdata - result.MemoryMb = rancherConfig.Memory + result.MemoryMb = int64(rancherConfig.Memory) result.Disks = []interface{}{} for _, i := range rancherConfig.Disks { result.Disks = append(result.Disks, i) @@ -105,7 +105,7 @@ func createLaunchConfig(r *RancherService, name string, serviceConfig *config.Se return result, err } -func setupNetworking(netMode string, launchConfig *rancherClient.LaunchConfig) { +func setupNetworking(netMode string, launchConfig *client.LaunchConfig) { if netMode == "" { launchConfig.NetworkMode = "managed" } else if container.IpcMode(netMode).IsContainer() { @@ -117,13 +117,13 @@ func setupNetworking(netMode string, launchConfig *rancherClient.LaunchConfig) { } } -func setupVolumesFrom(volumesFrom []string, launchConfig *rancherClient.LaunchConfig) { +func setupVolumesFrom(volumesFrom []string, launchConfig *client.LaunchConfig) { launchConfig.DataVolumesFromLaunchConfigs = volumesFrom } -func setupBuild(r *RancherService, name string, result *rancherClient.LaunchConfig, serviceConfig *config.ServiceConfig) error { +func setupBuild(r *RancherService, name string, result *client.LaunchConfig, serviceConfig *config.ServiceConfig) error { if serviceConfig.Build.Context != "" { - result.Build = &rancherClient.DockerBuild{ + result.Build = &client.DockerBuild{ Remote: serviceConfig.Build.Context, Dockerfile: serviceConfig.Build.Dockerfile, } @@ -145,7 +145,7 @@ func setupBuild(r *RancherService, name string, result *rancherClient.LaunchConf serviceConfig.Image = image } - result.Build = &rancherClient.DockerBuild{ + result.Build = &client.DockerBuild{ Context: url, Dockerfile: serviceConfig.Build.Dockerfile, } diff --git a/vendor/github.com/rancher/rancher-compose/rancher/context.go b/vendor/github.com/rancher/rancher-compose/rancher/context.go index cb273d3c4..4056d94cc 100644 --- a/vendor/github.com/rancher/rancher-compose/rancher/context.go +++ b/vendor/github.com/rancher/rancher-compose/rancher/context.go @@ -3,6 +3,7 @@ package rancher import ( "fmt" "io/ioutil" + "net/url" "os" "path" "path/filepath" @@ -15,7 +16,9 @@ import ( "github.com/docker/libcompose/config" "github.com/docker/libcompose/project" "github.com/docker/libcompose/utils" - rancherClient "github.com/rancher/go-rancher/client" + composeYaml "github.com/docker/libcompose/yaml" + "github.com/rancher/go-rancher/v2" + "github.com/rancher/rancher-compose/preprocess" rUtils "github.com/rancher/rancher-compose/utils" rVersion "github.com/rancher/rancher-compose/version" @@ -33,8 +36,8 @@ type Context struct { Url string AccessKey string SecretKey string - Client *rancherClient.RancherClient - Environment *rancherClient.Environment + Client *client.RancherClient + Stack *client.Stack isOpen bool SidekickInfo *SidekickInfo Uploader Uploader @@ -52,24 +55,24 @@ type Context struct { type RancherConfig struct { // VirtualMachine fields - Vcpu int64 `yaml:"vcpu,omitempty"` - Userdata string `yaml:"userdata,omitempty"` - Memory int64 `yaml:"memory,omitempty"` - Disks []rancherClient.VirtualMachineDisk `yaml:"disks,omitempty"` - - Type string `yaml:"type,omitempty"` - Scale int `yaml:"scale,omitempty"` - RetainIp bool `yaml:"retain_ip,omitempty"` - LoadBalancerConfig *rancherClient.LoadBalancerConfig `yaml:"load_balancer_config,omitempty"` - ExternalIps []string `yaml:"external_ips,omitempty"` - Hostname string `yaml:"hostname,omitempty"` - HealthCheck *rancherClient.InstanceHealthCheck `yaml:"health_check,omitempty"` - DefaultCert string `yaml:"default_cert,omitempty"` - Certs []string `yaml:"certs,omitempty"` - Metadata map[string]interface{} `yaml:"metadata,omitempty"` - ScalePolicy *rancherClient.ScalePolicy `yaml:"scale_policy,omitempty"` - ServiceSchemas map[string]rancherClient.Schema `yaml:"service_schemas,omitempty"` - UpgradeStrategy rancherClient.InServiceUpgradeStrategy `yaml:"upgrade_strategy,omitempty"` + Vcpu composeYaml.StringorInt `yaml:"vcpu,omitempty"` + Userdata string `yaml:"userdata,omitempty"` + Memory composeYaml.StringorInt `yaml:"memory,omitempty"` + Disks []client.VirtualMachineDisk `yaml:"disks,omitempty"` + + Type string `yaml:"type,omitempty"` + Scale composeYaml.StringorInt `yaml:"scale,omitempty"` + RetainIp bool `yaml:"retain_ip,omitempty"` + LoadBalancerConfig *client.LoadBalancerConfig `yaml:"load_balancer_config,omitempty"` + ExternalIps []string `yaml:"external_ips,omitempty"` + Hostname string `yaml:"hostname,omitempty"` + HealthCheck *client.InstanceHealthCheck `yaml:"health_check,omitempty"` + DefaultCert string `yaml:"default_cert,omitempty"` + Certs []string `yaml:"certs,omitempty"` + Metadata map[string]interface{} `yaml:"metadata,omitempty"` + ScalePolicy *client.ScalePolicy `yaml:"scale_policy,omitempty"` + ServiceSchemas map[string]client.Schema `yaml:"service_schemas,omitempty"` + UpgradeStrategy client.InServiceUpgradeStrategy `yaml:"upgrade_strategy,omitempty"` } func ResolveRancherCompose(composeFile, rancherComposeFile string) (string, error) { @@ -112,22 +115,39 @@ func (c *Context) readRancherConfig() error { func (c *Context) unmarshalBytes(composeBytes, bytes []byte) error { rawServiceMap := config.RawServiceMap{} if composeBytes != nil { - if err := yaml.Unmarshal(composeBytes, &rawServiceMap); err != nil { + var config config.Config + if err := yaml.Unmarshal(composeBytes, &config); err != nil { return err } + if config.Version == "2" { + rawServiceMap = config.Services + } else { + if err := yaml.Unmarshal(composeBytes, &rawServiceMap); err != nil { + return err + } + } + for key := range rawServiceMap { delete(rawServiceMap[key], "hostname") } } - if bytes != nil { + if bytes != nil && len(bytes) > 0 { if err := yaml.Unmarshal(bytes, &rawServiceMap); err != nil { return err } } + return c.fillInRancherConfig(rawServiceMap) +} + +func (c *Context) fillInRancherConfig(rawServiceMap config.RawServiceMap) error { if err := config.Interpolate(c.EnvironmentLookup, &rawServiceMap); err != nil { return err } + rawServiceMap, err := preprocess.TryConvertStringsToInts(rawServiceMap) + if err != nil { + return err + } if err := utils.Convert(rawServiceMap, &c.RancherConfig); err != nil { return err } @@ -147,14 +167,24 @@ func (c *Context) sanitizedProjectName() string { return projectName } -func (c *Context) loadClient() (*rancherClient.RancherClient, error) { +func (c *Context) loadClient() (*client.RancherClient, error) { if c.Client == nil { if c.Url == "" { return nil, fmt.Errorf("RANCHER_URL is not set") } - if client, err := rancherClient.NewRancherClient(&rancherClient.ClientOpts{ - Url: c.Url, + url, err := url.Parse(c.Url) + if err != nil { + return nil, err + } + + base := path.Base(url.Path) + if base != "v2-beta" && base != "schemas" { + url.Path = path.Join(url.Path, "v2-beta") + } + + if client, err := client.NewRancherClient(&client.ClientOpts{ + Url: url.String(), AccessKey: c.AccessKey, SecretKey: c.SecretKey, }); err != nil { @@ -182,13 +212,13 @@ func (c *Context) open() error { return err } - if envSchema, ok := c.Client.Types["environment"]; !ok || !rUtils.Contains(envSchema.CollectionMethods, "POST") { + if stackSchema, ok := c.Client.Types["stack"]; !ok || !rUtils.Contains(stackSchema.CollectionMethods, "POST") { return fmt.Errorf("Can not create a stack, check API key [%s] for [%s]", c.AccessKey, c.Url) } c.checkVersion() - if _, err := c.LoadEnv(); err != nil { + if _, err := c.LoadStack(); err != nil { return err } @@ -232,9 +262,9 @@ func (c *Context) getSetting(key string) string { return s.Value } -func (c *Context) LoadEnv() (*rancherClient.Environment, error) { - if c.Environment != nil { - return c.Environment, nil +func (c *Context) LoadStack() (*client.Stack, error) { + if c.Stack != nil { + return c.Stack, nil } projectName := c.sanitizedProjectName() @@ -244,7 +274,7 @@ func (c *Context) LoadEnv() (*rancherClient.Environment, error) { logrus.Debugf("Looking for stack %s", projectName) // First try by name - envs, err := c.Client.Environment.List(&rancherClient.ListOpts{ + stacks, err := c.Client.Stack.List(&client.ListOpts{ Filters: map[string]interface{}{ "name": projectName, "removed_null": nil, @@ -254,16 +284,16 @@ func (c *Context) LoadEnv() (*rancherClient.Environment, error) { return nil, err } - for _, env := range envs.Data { - if strings.EqualFold(projectName, env.Name) { - logrus.Debugf("Found stack: %s(%s)", env.Name, env.Id) - c.Environment = &env - return c.Environment, nil + for _, stack := range stacks.Data { + if strings.EqualFold(projectName, stack.Name) { + logrus.Debugf("Found stack: %s(%s)", stack.Name, stack.Id) + c.Stack = &stack + return c.Stack, nil } } // Now try not by name for case sensitive databases - envs, err = c.Client.Environment.List(&rancherClient.ListOpts{ + stacks, err = c.Client.Stack.List(&client.ListOpts{ Filters: map[string]interface{}{ "removed_null": nil, }, @@ -272,23 +302,23 @@ func (c *Context) LoadEnv() (*rancherClient.Environment, error) { return nil, err } - for _, env := range envs.Data { - if strings.EqualFold(projectName, env.Name) { - logrus.Debugf("Found stack: %s(%s)", env.Name, env.Id) - c.Environment = &env - return c.Environment, nil + for _, stack := range stacks.Data { + if strings.EqualFold(projectName, stack.Name) { + logrus.Debugf("Found stack: %s(%s)", stack.Name, stack.Id) + c.Stack = &stack + return c.Stack, nil } } logrus.Infof("Creating stack %s", projectName) - env, err := c.Client.Environment.Create(&rancherClient.Environment{ + stack, err := c.Client.Stack.Create(&client.Stack{ Name: projectName, }) if err != nil { return nil, err } - c.Environment = env + c.Stack = stack - return c.Environment, nil + return c.Stack, nil } diff --git a/vendor/github.com/rancher/rancher-compose/rancher/lb_service.go b/vendor/github.com/rancher/rancher-compose/rancher/lb_service.go index 605329529..15f50a12f 100644 --- a/vendor/github.com/rancher/rancher-compose/rancher/lb_service.go +++ b/vendor/github.com/rancher/rancher-compose/rancher/lb_service.go @@ -1,8 +1,8 @@ package rancher -import rancherClient "github.com/rancher/go-rancher/client" +import "github.com/rancher/go-rancher/v2" -func populateLbFields(r *RancherService, launchConfig *rancherClient.LaunchConfig, service *CompositeService) error { +func populateLbFields(r *RancherService, launchConfig *client.LaunchConfig, service *CompositeService) error { config, ok := r.context.RancherConfig[r.name] if ok { service.LoadBalancerConfig = config.LoadBalancerConfig diff --git a/vendor/github.com/rancher/rancher-compose/rancher/normal.go b/vendor/github.com/rancher/rancher-compose/rancher/normal.go index c50087d8b..303556558 100644 --- a/vendor/github.com/rancher/rancher-compose/rancher/normal.go +++ b/vendor/github.com/rancher/rancher-compose/rancher/normal.go @@ -5,7 +5,7 @@ import ( "github.com/Sirupsen/logrus" "github.com/docker/libcompose/utils" - rancherClient "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/rancher/rancher-compose/digest" ) @@ -41,7 +41,7 @@ func (f *NormalFactory) configAndHash(r *RancherService) (digest.ServiceHash, *C return hash, rancherService, nil } -func (f *NormalFactory) config(r *RancherService) (*CompositeService, *rancherClient.LaunchConfig, []rancherClient.SecondaryLaunchConfig, error) { +func (f *NormalFactory) config(r *RancherService) (*CompositeService, *client.LaunchConfig, []client.SecondaryLaunchConfig, error) { launchConfig, secondaryLaunchConfigs, err := createLaunchConfigs(r) if err != nil { return nil, nil, nil, err @@ -50,13 +50,13 @@ func (f *NormalFactory) config(r *RancherService) (*CompositeService, *rancherCl rancherConfig, _ := r.context.RancherConfig[r.name] service := &CompositeService{ - Service: rancherClient.Service{ + Service: client.Service{ Name: r.name, Metadata: r.Metadata(), Scale: int64(r.getConfiguredScale()), ScalePolicy: rancherConfig.ScalePolicy, RetainIp: rancherConfig.RetainIp, - EnvironmentId: r.Context().Environment.Id, + StackId: r.Context().Stack.Id, SelectorContainer: r.SelectorContainer(), SelectorLink: r.SelectorLink(), }, @@ -81,11 +81,11 @@ func (f *NormalFactory) Create(r *RancherService) error { logrus.Debugf("Creating service %s with hash: %#v", r.name, hash) switch FindServiceType(r) { case ExternalServiceType: - return r.context.Client.Create(rancherClient.EXTERNAL_SERVICE_TYPE, &service, nil) + return r.context.Client.Create(client.EXTERNAL_SERVICE_TYPE, &service, nil) case DnsServiceType: - return r.context.Client.Create(rancherClient.DNS_SERVICE_TYPE, &service, nil) + return r.context.Client.Create(client.DNS_SERVICE_TYPE, &service, nil) case LbServiceType: - return r.context.Client.Create(rancherClient.LOAD_BALANCER_SERVICE_TYPE, &service, nil) + return r.context.Client.Create(client.LOAD_BALANCER_SERVICE_TYPE, &service, nil) default: _, err = r.context.Client.Service.Create(&service.Service) } @@ -157,14 +157,14 @@ func (f *NormalFactory) Upgrade(r *RancherService, force bool, selected []string return f.upgrade(r, existingService, service, launchConfig, secondaryNames, removedSecondaryNames) } -func (f *NormalFactory) upgrade(r *RancherService, existingService *rancherClient.Service, service, launchConfig bool, secondaryNames, removedSecondaryNames []string) error { +func (f *NormalFactory) upgrade(r *RancherService, existingService *client.Service, service, launchConfig bool, secondaryNames, removedSecondaryNames []string) error { _, config, err := f.configAndHash(r) if err != nil { return err } - serviceUpgrade := &rancherClient.ServiceUpgrade{ - InServiceStrategy: &rancherClient.InServiceUpgradeStrategy{ + serviceUpgrade := &client.ServiceUpgrade{ + InServiceStrategy: &client.InServiceUpgradeStrategy{ BatchSize: r.context.BatchSize, IntervalMillis: r.context.Interval, StartFirst: r.RancherConfig().UpgradeStrategy.StartFirst, @@ -179,7 +179,7 @@ func (f *NormalFactory) upgrade(r *RancherService, existingService *rancherClien for _, name := range secondaryNames { for _, v := range config.SecondaryLaunchConfigs { - if secondaryLaunchConfig, ok := v.(rancherClient.SecondaryLaunchConfig); ok { + if secondaryLaunchConfig, ok := v.(client.SecondaryLaunchConfig); ok { if secondaryLaunchConfig.Name == name { serviceUpgrade.InServiceStrategy.SecondaryLaunchConfigs = append(serviceUpgrade.InServiceStrategy.SecondaryLaunchConfigs, secondaryLaunchConfig) } @@ -188,7 +188,7 @@ func (f *NormalFactory) upgrade(r *RancherService, existingService *rancherClien } for _, removedSecondaryName := range removedSecondaryNames { - serviceUpgrade.InServiceStrategy.SecondaryLaunchConfigs = append(serviceUpgrade.InServiceStrategy.SecondaryLaunchConfigs, &rancherClient.SecondaryLaunchConfig{ + serviceUpgrade.InServiceStrategy.SecondaryLaunchConfigs = append(serviceUpgrade.InServiceStrategy.SecondaryLaunchConfigs, &client.SecondaryLaunchConfig{ Name: removedSecondaryName, ImageUuid: "rancher/none", }) @@ -199,14 +199,14 @@ func (f *NormalFactory) upgrade(r *RancherService, existingService *rancherClien config.Scale = existingService.Scale logrus.Infof("Updating %s", r.Name()) - schemaType := rancherClient.SERVICE_TYPE + schemaType := client.SERVICE_TYPE switch FindServiceType(r) { case ExternalServiceType: - schemaType = rancherClient.EXTERNAL_SERVICE_TYPE + schemaType = client.EXTERNAL_SERVICE_TYPE case DnsServiceType: - schemaType = rancherClient.DNS_SERVICE_TYPE + schemaType = client.DNS_SERVICE_TYPE case LbServiceType: - schemaType = rancherClient.LOAD_BALANCER_SERVICE_TYPE + schemaType = client.LOAD_BALANCER_SERVICE_TYPE } if err := r.context.Client.Update(schemaType, &existingService.Resource, config, existingService); err != nil { diff --git a/vendor/github.com/rancher/rancher-compose/rancher/service.go b/vendor/github.com/rancher/rancher-compose/rancher/service.go index de9d3b98c..a51481088 100644 --- a/vendor/github.com/rancher/rancher-compose/rancher/service.go +++ b/vendor/github.com/rancher/rancher-compose/rancher/service.go @@ -12,13 +12,13 @@ import ( "github.com/Sirupsen/logrus" "github.com/docker/engine-api/types/container" "github.com/docker/libcompose/config" + "github.com/docker/libcompose/docker/service" "github.com/docker/libcompose/labels" "github.com/docker/libcompose/project" "github.com/docker/libcompose/project/events" "github.com/docker/libcompose/project/options" "github.com/gorilla/websocket" - rancherClient "github.com/rancher/go-rancher/client" - "github.com/rancher/go-rancher/hostaccess" + "github.com/rancher/go-rancher/v2" rUtils "github.com/rancher/rancher-compose/utils" ) @@ -26,7 +26,7 @@ type Link struct { ServiceName, Alias string } -type IsDone func(*rancherClient.Resource) (bool, error) +type IsDone func(*client.Resource) (bool, error) type ContainerInspect struct { Name string @@ -67,7 +67,7 @@ func NewService(name string, config *config.ServiceConfig, context *Context) *Ra } } -func (r *RancherService) RancherService() (*rancherClient.Service, error) { +func (r *RancherService) RancherService() (*client.Service, error) { return r.FindExisting(r.name) } @@ -202,13 +202,13 @@ func (r *RancherService) Delete(ctx context.Context, options options.Delete) err return r.Wait(service) } -func (r *RancherService) resolveServiceAndEnvironmentId(name string) (string, string, error) { +func (r *RancherService) resolveServiceAndStackId(name string) (string, string, error) { parts := strings.SplitN(name, "/", 2) if len(parts) == 1 { - return name, r.context.Environment.Id, nil + return name, r.context.Stack.Id, nil } - envs, err := r.context.Client.Environment.List(&rancherClient.ListOpts{ + stacks, err := r.context.Client.Stack.List(&client.ListOpts{ Filters: map[string]interface{}{ "name": parts[0], "removed_null": nil, @@ -219,26 +219,26 @@ func (r *RancherService) resolveServiceAndEnvironmentId(name string) (string, st return "", "", err } - if len(envs.Data) == 0 { + if len(stacks.Data) == 0 { return "", "", fmt.Errorf("Failed to find stack: %s", parts[0]) } - return parts[1], envs.Data[0].Id, nil + return parts[1], stacks.Data[0].Id, nil } -func (r *RancherService) FindExisting(name string) (*rancherClient.Service, error) { +func (r *RancherService) FindExisting(name string) (*client.Service, error) { logrus.Debugf("Finding service %s", name) - name, environmentId, err := r.resolveServiceAndEnvironmentId(name) + name, stackId, err := r.resolveServiceAndStackId(name) if err != nil { return nil, err } - services, err := r.context.Client.Service.List(&rancherClient.ListOpts{ + services, err := r.context.Client.Service.List(&client.ListOpts{ Filters: map[string]interface{}{ - "environmentId": environmentId, - "name": name, - "removed_null": nil, + "stackId": stackId, + "name": name, + "removed_null": nil, }, }) @@ -261,7 +261,7 @@ func (r *RancherService) Metadata() map[string]interface{} { return map[string]interface{}{} } -func (r *RancherService) HealthCheck(service string) *rancherClient.InstanceHealthCheck { +func (r *RancherService) HealthCheck(service string) *client.InstanceHealthCheck { if service == "" { service = r.name } @@ -276,14 +276,14 @@ func (r *RancherService) getConfiguredScale() int { scale := 1 if config, ok := r.context.RancherConfig[r.name]; ok { if config.Scale > 0 { - scale = config.Scale + scale = int(config.Scale) } } return scale } -func (r *RancherService) createService() (*rancherClient.Service, error) { +func (r *RancherService) createService() (*client.Service, error) { logrus.Infof("Creating service %s", r.name) factory, err := GetFactory(r) @@ -308,7 +308,7 @@ func (r *RancherService) createService() (*rancherClient.Service, error) { return service, err } -func (r *RancherService) setupLinks(service *rancherClient.Service, update bool) error { +func (r *RancherService) setupLinks(service *client.Service, update bool) error { // Don't modify links for selector based linking, don't want to conflict if service.SelectorLink != "" || FindServiceType(r) == ExternalServiceType { return nil @@ -317,7 +317,7 @@ func (r *RancherService) setupLinks(service *rancherClient.Service, update bool) var err error var links []interface{} - existingLinks, err := r.context.Client.ServiceConsumeMap.List(&rancherClient.ListOpts{ + existingLinks, err := r.context.Client.ServiceConsumeMap.List(&client.ListOpts{ Filters: map[string]interface{}{ "serviceId": service.Id, }, @@ -330,14 +330,14 @@ func (r *RancherService) setupLinks(service *rancherClient.Service, update bool) return nil } - if service.Type == rancherClient.LOAD_BALANCER_SERVICE_TYPE { + if service.Type == client.LOAD_BALANCER_SERVICE_TYPE { links, err = r.getLbLinks() } else { links, err = r.getServiceLinks() } if err == nil { - _, err = r.context.Client.Service.ActionSetservicelinks(service, &rancherClient.SetServiceLinksInput{ + _, err = r.context.Client.Service.ActionSetservicelinks(service, &client.SetServiceLinksInput{ ServiceLinks: links, }) } @@ -357,7 +357,7 @@ func (r *RancherService) getLbLinks() ([]interface{}, error) { return nil, err } - result = append(result, rancherClient.LoadBalancerServiceLink{ + result = append(result, client.LoadBalancerServiceLink{ Ports: ports, ServiceId: id, }) @@ -392,7 +392,7 @@ func (r *RancherService) getServiceLinks() ([]interface{}, error) { result := []interface{}{} for link, id := range links { - result = append(result, rancherClient.ServiceLink{ + result = append(result, client.ServiceLink{ Name: link.Alias, ServiceId: id, }) @@ -474,13 +474,13 @@ func (r *RancherService) Containers(ctx context.Context) ([]project.Container, e return result, nil } -func (r *RancherService) containers() ([]rancherClient.Container, error) { +func (r *RancherService) containers() ([]client.Container, error) { service, err := r.FindExisting(r.name) if err != nil { return nil, err } - var instances rancherClient.ContainerCollection + var instances client.ContainerCollection err = r.context.Client.GetLink(service.Resource, "instances", &instances) if err != nil { @@ -496,8 +496,12 @@ func (r *RancherService) Restart(ctx context.Context, timeout int) error { return err } - service, err = r.context.Client.Service.ActionRestart(service, &rancherClient.ServiceRestart{ - RollingRestartStrategy: rancherClient.RollingRestartStrategy{ + if service == nil { + return fmt.Errorf("Failed to find %s to restart", r.name) + } + + service, err = r.context.Client.Service.ActionRestart(service, &client.ServiceRestart{ + RollingRestartStrategy: client.RollingRestartStrategy{ BatchSize: r.context.BatchSize, IntervalMillis: r.context.Interval, }, @@ -527,7 +531,8 @@ func (r *RancherService) Log(ctx context.Context, follow bool) error { return err } - for _, container := range containers { + _ = containers + /*for _, container := range containers { conn, err := (*hostaccess.RancherWebsocketClient)(r.context.Client).GetHostAccess(container.Resource, "logs", nil) if err != nil { logrus.Errorf("Failed to get logs for %s: %v", container.Name, err) @@ -535,16 +540,16 @@ func (r *RancherService) Log(ctx context.Context, follow bool) error { } go r.pipeLogs(&container, conn) - } + }*/ return nil } -func (r *RancherService) pipeLogs(container *rancherClient.Container, conn *websocket.Conn) { +func (r *RancherService) pipeLogs(container *client.Container, conn *websocket.Conn) { defer conn.Close() log_name := strings.TrimPrefix(container.Name, r.context.ProjectName+"_") - logger := r.context.LoggerFactory.Create(log_name) + logger := r.context.LoggerFactory.CreateContainerLogger(log_name) for { messageType, bytes, err := conn.ReadMessage() @@ -576,7 +581,7 @@ func (r *RancherService) pipeLogs(container *rancherClient.Container, conn *webs func (r *RancherService) DependentServices() []project.ServiceRelationship { result := []project.ServiceRelationship{} - for _, rel := range project.DefaultDependentServices(r.context.Project, r) { + for _, rel := range service.DefaultDependentServices(r.context.Project, r) { if rel.Type == project.RelTypeLink { rel.Optional = true result = append(result, rel) @@ -586,7 +591,7 @@ func (r *RancherService) DependentServices() []project.ServiceRelationship { return result } -func (r *RancherService) Client() *rancherClient.RancherClient { +func (r *RancherService) Client() *client.RancherClient { return r.context.Client } @@ -594,12 +599,12 @@ func (r *RancherService) Kill(ctx context.Context, signal string) error { return project.ErrUnsupported } -func (r *RancherService) Info(ctx context.Context, qFlag bool) (project.InfoSet, error) { +func (r *RancherService) Info(ctx context.Context) (project.InfoSet, error) { return project.InfoSet{}, project.ErrUnsupported } func (r *RancherService) pullImage(image string, labels map[string]string) error { - taskOpts := &rancherClient.PullTask{ + taskOpts := &client.PullTask{ Mode: "all", Labels: rUtils.ToMapInterface(labels), Image: image, diff --git a/vendor/github.com/rancher/rancher-compose/rancher/types.go b/vendor/github.com/rancher/rancher-compose/rancher/types.go index 1386073c1..64e15dcaf 100644 --- a/vendor/github.com/rancher/rancher-compose/rancher/types.go +++ b/vendor/github.com/rancher/rancher-compose/rancher/types.go @@ -1,6 +1,6 @@ package rancher -import rancherClient "github.com/rancher/go-rancher/client" +import "github.com/rancher/go-rancher/v2" const ( LB_IMAGE = "rancher/load-balancer-service" @@ -30,15 +30,15 @@ func FindServiceType(r *RancherService) ServiceType { } type CompositeService struct { - rancherClient.Service + client.Service //LoadBalancer Fields - CertificateIds []string `json:"certificateIds,omitempty" yaml:"certificate_ids,omitempty"` - DefaultCertificateId string `json:"defaultCertificateId,omitempty" yaml:"default_certificate_id,omitempty"` - LoadBalancerConfig *rancherClient.LoadBalancerConfig `json:"loadBalancerConfig,omitempty" yaml:"load_balancer_config,omitempty"` + CertificateIds []string `json:"certificateIds,omitempty" yaml:"certificate_ids,omitempty"` + DefaultCertificateId string `json:"defaultCertificateId,omitempty" yaml:"default_certificate_id,omitempty"` + LoadBalancerConfig *client.LoadBalancerConfig `json:"loadBalancerConfig,omitempty" yaml:"load_balancer_config,omitempty"` // External Service Fields - ExternalIpAddresses []string `json:"externalIpAddresses,omitempty" yaml:"external_ip_addresses,omitempty"` - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - HealthCheck *rancherClient.InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + ExternalIpAddresses []string `json:"externalIpAddresses,omitempty" yaml:"external_ip_addresses,omitempty"` + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + HealthCheck *client.InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` } diff --git a/vendor/github.com/rancher/rancher-compose/rancher/upgrade.go b/vendor/github.com/rancher/rancher-compose/rancher/upgrade.go index d62495440..9304bc012 100644 --- a/vendor/github.com/rancher/rancher-compose/rancher/upgrade.go +++ b/vendor/github.com/rancher/rancher-compose/rancher/upgrade.go @@ -2,11 +2,11 @@ package rancher import ( "github.com/Sirupsen/logrus" - rancherClient "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/rancher/rancher-compose/digest" ) -func (r *RancherService) upgrade(service *rancherClient.Service, force bool, selected []string) (*rancherClient.Service, error) { +func (r *RancherService) upgrade(service *client.Service, force bool, selected []string) (*client.Service, error) { factory, err := GetFactory(r) if err != nil { return nil, err @@ -19,7 +19,7 @@ func (r *RancherService) upgrade(service *rancherClient.Service, force bool, sel return r.FindExisting(r.name) } -func (r *RancherService) rollback(service *rancherClient.Service) (*rancherClient.Service, error) { +func (r *RancherService) rollback(service *client.Service) (*client.Service, error) { factory, err := GetFactory(r) if err != nil { return nil, err @@ -32,7 +32,7 @@ func (r *RancherService) rollback(service *rancherClient.Service) (*rancherClien return r.FindExisting(r.name) } -func (r *RancherService) shouldUpgrade(service *rancherClient.Service) bool { +func (r *RancherService) shouldUpgrade(service *client.Service) bool { switch FindServiceType(r) { case ExternalServiceType: return false @@ -60,7 +60,7 @@ func (r *RancherService) shouldUpgrade(service *rancherClient.Service) bool { return false } -func (r *RancherService) isOutOfSync(service *rancherClient.Service) bool { +func (r *RancherService) isOutOfSync(service *client.Service) bool { if service == nil { return false } @@ -86,7 +86,7 @@ func (r *RancherService) isOutOfSync(service *rancherClient.Service) bool { return !hash.Equals(newHash) } -func hasOldHash(service *rancherClient.Service) bool { +func hasOldHash(service *client.Service) bool { _, ok := digest.LookupHash(service) return ok } diff --git a/vendor/github.com/rancher/rancher-compose/rancher/wait.go b/vendor/github.com/rancher/rancher-compose/rancher/wait.go index c639b6a7f..238a63022 100644 --- a/vendor/github.com/rancher/rancher-compose/rancher/wait.go +++ b/vendor/github.com/rancher/rancher-compose/rancher/wait.go @@ -3,10 +3,10 @@ package rancher import ( "time" - rancherClient "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" ) -func (r *RancherService) WaitFor(resource *rancherClient.Resource, output interface{}, transitioning func() string) error { +func (r *RancherService) WaitFor(resource *client.Resource, output interface{}, transitioning func() string) error { for { if transitioning() != "yes" { return nil @@ -21,13 +21,13 @@ func (r *RancherService) WaitFor(resource *rancherClient.Resource, output interf } } -func (r *RancherService) Wait(service *rancherClient.Service) error { +func (r *RancherService) Wait(service *client.Service) error { return r.WaitFor(&service.Resource, service, func() string { return service.Transitioning }) } -func (r *RancherService) waitInstance(instance *rancherClient.Instance) error { +func (r *RancherService) waitInstance(instance *client.Instance) error { return r.WaitFor(&instance.Resource, instance, func() string { return instance.Transitioning }) diff --git a/vendor/github.com/rancher/rancher-compose/trash.conf b/vendor/github.com/rancher/rancher-compose/trash.conf index bdad1dd2a..2038d63cb 100644 --- a/vendor/github.com/rancher/rancher-compose/trash.conf +++ b/vendor/github.com/rancher/rancher-compose/trash.conf @@ -5,22 +5,22 @@ github.com/docker/distribution 5bbf65499960b184fe8e0f045397375e1a6722b8 github.com/docker/docker 534753663161334baba06f13b8efa4cad22b5bc5 github.com/docker/engine-api 62043eb79d581a32ea849645277023c550732e52 github.com/docker/go-connections 990a1a1a70b0da4c4cb70e117971a4f0babfbf1a -github.com/docker/libcompose 8afd773e5531623d91f62c332dd5b72bcf310e6a https://github.com/joshwget/libcompose/ +github.com/docker/libcompose 444fe501e251841740281be421449f1551cde8dd https://github.com/rancher/libcompose github.com/flynn/go-shlex 3f9db97f856818214da2e1057f8ad84803971cff github.com/gorilla/context 14f550f51a github.com/gorilla/mux e444e69cbd github.com/gorilla/websocket 1551221275a7bd42978745a376b2531f791d88f3 github.com/hashicorp/go-version 2b9865f60ce11e527bd1255ba82036d465570aa3 github.com/opencontainers/runc cc29e3dded8e27ba8f65738f40d251c885030a28 -github.com/rancher/event-subscriber 2e42f210dae2234d08786806100b4ddc4ce87641 -github.com/rancher/go-rancher 37c17e456a2d6dce279f54ee2f957797d30a20dc +github.com/pkg/errors 1d2e60385a13aaa66134984235061c2f9302520e +github.com/rancher/event-subscriber dc144e28875c4cb660fcba8b8bce069760a13957 +github.com/rancher/go-rancher 9ddc97606e7353d33794373ac98c05e8021bab86 github.com/rancher/rancher-catalog-service a3a8b500adceb82b3a0387b2c7b06a60e7eeee9a github.com/vaughan0/go-ini a98ad7ee00ec53921f08832bc06ecf7fd600e6a1 golang.org/x/net 3a29182c25eeabbaaf94daaeecbc7823d86261e7 golang.org/x/crypto 4d48e5fa3d62b5e6e71260571bf76c767198ca02 -gopkg.in/yaml.v2 49c95bdc21843256fb6c4e0d370a05f24a0bf213 +gopkg.in/yaml.v2 e4d366fc3c7938e2958e662b4258c7a89e1f0e3e github.com/docker/go-units f2d77a61e3c169b43402a0a1e84f06daf29b8190 -github.com/cloudfoundry-incubator/candiedyaml 5cef21e2e4f0fd147973b558d4db7395176bcd95 github.com/vbatts/tar-split v0.9.11 github.com/Azure/go-ansiterm 388960b655244e76e24c75f48631564eaefade62 github.com/Microsoft/go-winio v0.3.0 diff --git a/vendor/github.com/rancher/rancher-compose/upgrade/upgrade.go b/vendor/github.com/rancher/rancher-compose/upgrade/upgrade.go index 7c0b56bc3..8fc158ecd 100644 --- a/vendor/github.com/rancher/rancher-compose/upgrade/upgrade.go +++ b/vendor/github.com/rancher/rancher-compose/upgrade/upgrade.go @@ -8,7 +8,7 @@ import ( "github.com/Sirupsen/logrus" "github.com/docker/libcompose/project" "github.com/docker/libcompose/project/options" - rancherClient "github.com/rancher/go-rancher/client" + "github.com/rancher/go-rancher/v2" "github.com/rancher/rancher-compose/rancher" ) @@ -87,8 +87,8 @@ func Upgrade(p project.APIProject, from, to string, opts UpgradeOpts) error { return fmt.Errorf("Upgrade is not supported for global services") } - upgradeOpts := &rancherClient.ServiceUpgrade{ - ToServiceStrategy: &rancherClient.ToServiceUpgradeStrategy{ + upgradeOpts := &client.ServiceUpgrade{ + ToServiceStrategy: &client.ToServiceUpgradeStrategy{ UpdateLinks: opts.UpdateLinks, FinalScale: int64(opts.FinalScale), BatchSize: int64(opts.BatchSize), @@ -139,7 +139,7 @@ func Upgrade(p project.APIProject, from, to string, opts UpgradeOpts) error { return nil } -func upgradeInfo(up bool, p project.APIProject, from, to string, opts UpgradeOpts) (*rancherClient.Service, *rancherClient.Service, *rancherClient.RancherClient, error) { +func upgradeInfo(up bool, p project.APIProject, from, to string, opts UpgradeOpts) (*client.Service, *client.Service, *client.RancherClient, error) { fromService, err := p.CreateService(from) if err != nil { return nil, nil, nil, err diff --git a/vendor/github.com/rancher/rancher-docker-api-proxy/README.md b/vendor/github.com/rancher/rancher-docker-api-proxy/README.md index 72614c67f..342d2290b 100644 --- a/vendor/github.com/rancher/rancher-docker-api-proxy/README.md +++ b/vendor/github.com/rancher/rancher-docker-api-proxy/README.md @@ -14,7 +14,7 @@ import ( "os" "github.com/Sirupsen/logrus" - rancher "github.com/rancher/go-rancher/client" + rancher "github.com/rancher/go-rancher/v2" ) func main() { diff --git a/vendor/github.com/rancher/rancher-docker-api-proxy/server.go b/vendor/github.com/rancher/rancher-docker-api-proxy/server.go index 09e5a0abe..30d626c90 100644 --- a/vendor/github.com/rancher/rancher-docker-api-proxy/server.go +++ b/vendor/github.com/rancher/rancher-docker-api-proxy/server.go @@ -11,8 +11,8 @@ import ( "github.com/Sirupsen/logrus" - rancher "github.com/rancher/go-rancher/client" "github.com/rancher/go-rancher/hostaccess" + rancher "github.com/rancher/go-rancher/v2" ) type IoOps interface { diff --git a/vendor/gopkg.in/yaml.v2/.travis.yml b/vendor/gopkg.in/yaml.v2/.travis.yml new file mode 100644 index 000000000..004172a2e --- /dev/null +++ b/vendor/gopkg.in/yaml.v2/.travis.yml @@ -0,0 +1,9 @@ +language: go + +go: + - 1.4 + - 1.5 + - 1.6 + - tip + +go_import_path: gopkg.in/yaml.v2 diff --git a/vendor/gopkg.in/yaml.v2/LICENSE b/vendor/gopkg.in/yaml.v2/LICENSE index a68e67f01..866d74a7a 100644 --- a/vendor/gopkg.in/yaml.v2/LICENSE +++ b/vendor/gopkg.in/yaml.v2/LICENSE @@ -1,188 +1,13 @@ +Copyright 2011-2016 Canonical Ltd. -Copyright (c) 2011-2014 - Canonical Inc. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -This software is licensed under the LGPLv3, included below. + http://www.apache.org/licenses/LICENSE-2.0 -As a special exception to the GNU Lesser General Public License version 3 -("LGPL3"), the copyright holders of this Library give you permission to -convey to a third party a Combined Work that links statically or dynamically -to this Library without providing any Minimal Corresponding Source or -Minimal Application Code as set out in 4d or providing the installation -information set out in section 4e, provided that you comply with the other -provisions of LGPL3 and provided that you meet, for the Application the -terms and conditions of the license(s) which apply to the Application. - -Except as stated in this special exception, the provisions of LGPL3 will -continue to comply in full to this Library. If you modify this Library, you -may apply this exception to your version of this Library, but you are not -obliged to do so. If you do not wish to do so, delete this exception -statement from your version. This exception does not (and cannot) modify any -license terms which apply to the Application, with which you must still -comply. - - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/vendor/gopkg.in/yaml.v2/README.md b/vendor/gopkg.in/yaml.v2/README.md index d6c919e60..7b8bd8670 100644 --- a/vendor/gopkg.in/yaml.v2/README.md +++ b/vendor/gopkg.in/yaml.v2/README.md @@ -67,7 +67,10 @@ b: type T struct { A string - B struct{C int; D []int ",flow"} + B struct { + RenamedC int `yaml:"c"` + D []int `yaml:",flow"` + } } func main() { diff --git a/vendor/gopkg.in/yaml.v2/emitterc.go b/vendor/gopkg.in/yaml.v2/emitterc.go index 9b3dc4a43..2befd553e 100644 --- a/vendor/gopkg.in/yaml.v2/emitterc.go +++ b/vendor/gopkg.in/yaml.v2/emitterc.go @@ -1019,7 +1019,7 @@ func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool { preceeded_by_whitespace = true for i, w := 0, 0; i < len(value); i += w { - w = width(value[0]) + w = width(value[i]) followed_by_whitespace = i+w >= len(value) || is_blank(value, i+w) if i == 0 { diff --git a/vendor/gopkg.in/yaml.v2/readerc.go b/vendor/gopkg.in/yaml.v2/readerc.go index d5fb09727..f45079171 100644 --- a/vendor/gopkg.in/yaml.v2/readerc.go +++ b/vendor/gopkg.in/yaml.v2/readerc.go @@ -247,7 +247,7 @@ func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { if parser.encoding == yaml_UTF16LE_ENCODING { low, high = 0, 1 } else { - high, low = 1, 0 + low, high = 1, 0 } // The UTF-16 encoding is not as simple as one might @@ -357,23 +357,26 @@ func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { if value <= 0x7F { // 0000 0000-0000 007F . 0xxxxxxx parser.buffer[buffer_len+0] = byte(value) + buffer_len += 1 } else if value <= 0x7FF { // 0000 0080-0000 07FF . 110xxxxx 10xxxxxx parser.buffer[buffer_len+0] = byte(0xC0 + (value >> 6)) parser.buffer[buffer_len+1] = byte(0x80 + (value & 0x3F)) + buffer_len += 2 } else if value <= 0xFFFF { // 0000 0800-0000 FFFF . 1110xxxx 10xxxxxx 10xxxxxx parser.buffer[buffer_len+0] = byte(0xE0 + (value >> 12)) parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 6) & 0x3F)) parser.buffer[buffer_len+2] = byte(0x80 + (value & 0x3F)) + buffer_len += 3 } else { // 0001 0000-0010 FFFF . 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx parser.buffer[buffer_len+0] = byte(0xF0 + (value >> 18)) parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 12) & 0x3F)) parser.buffer[buffer_len+2] = byte(0x80 + ((value >> 6) & 0x3F)) parser.buffer[buffer_len+3] = byte(0x80 + (value & 0x3F)) + buffer_len += 4 } - buffer_len += width parser.unread++ } diff --git a/vendor/gopkg.in/yaml.v2/scannerc.go b/vendor/gopkg.in/yaml.v2/scannerc.go index fe93b190c..25808000f 100644 --- a/vendor/gopkg.in/yaml.v2/scannerc.go +++ b/vendor/gopkg.in/yaml.v2/scannerc.go @@ -961,7 +961,7 @@ func yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml } // Pop indentation levels from the indents stack until the current level -// becomes less or equal to the column. For each intendation level, append +// becomes less or equal to the column. For each indentation level, append // the BLOCK-END token. func yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool { // In the flow context, do nothing. @@ -969,7 +969,7 @@ func yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool { return true } - // Loop through the intendation levels in the stack. + // Loop through the indentation levels in the stack. for parser.indent > column { // Create a token and append it to the queue. token := yaml_token_t{ @@ -1546,7 +1546,7 @@ func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool // Unknown directive. } else { yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "found uknown directive name") + start_mark, "found unknown directive name") return false } @@ -2085,14 +2085,14 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l return false } if is_digit(parser.buffer, parser.buffer_pos) { - // Check that the intendation is greater than 0. + // Check that the indentation is greater than 0. if parser.buffer[parser.buffer_pos] == '0' { yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found an intendation indicator equal to 0") + start_mark, "found an indentation indicator equal to 0") return false } - // Get the intendation level and eat the indicator. + // Get the indentation level and eat the indicator. increment = as_digit(parser.buffer, parser.buffer_pos) skip(parser) } @@ -2102,7 +2102,7 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l if parser.buffer[parser.buffer_pos] == '0' { yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found an intendation indicator equal to 0") + start_mark, "found an indentation indicator equal to 0") return false } increment = as_digit(parser.buffer, parser.buffer_pos) @@ -2157,7 +2157,7 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l end_mark := parser.mark - // Set the intendation level if it was specified. + // Set the indentation level if it was specified. var indent int if increment > 0 { if parser.indent >= 0 { @@ -2217,7 +2217,7 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l leading_break = read_line(parser, leading_break) - // Eat the following intendation spaces and line breaks. + // Eat the following indentation spaces and line breaks. if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) { return false } @@ -2245,15 +2245,15 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l return true } -// Scan intendation spaces and line breaks for a block scalar. Determine the -// intendation level if needed. +// Scan indentation spaces and line breaks for a block scalar. Determine the +// indentation level if needed. func yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t, indent *int, breaks *[]byte, start_mark yaml_mark_t, end_mark *yaml_mark_t) bool { *end_mark = parser.mark - // Eat the intendation spaces and line breaks. + // Eat the indentation spaces and line breaks. max_indent := 0 for { - // Eat the intendation spaces. + // Eat the indentation spaces. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } @@ -2267,10 +2267,10 @@ func yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t, indent *int, br max_indent = parser.mark.column } - // Check for a tab character messing the intendation. + // Check for a tab character messing the indentation. if (*indent == 0 || parser.mark.column < *indent) && is_tab(parser.buffer, parser.buffer_pos) { return yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found a tab character where an intendation space is expected") + start_mark, "found a tab character where an indentation space is expected") } // Have we found a non-empty line? @@ -2655,10 +2655,10 @@ func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) b for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) { if is_blank(parser.buffer, parser.buffer_pos) { - // Check for tab character that abuse intendation. + // Check for tab character that abuse indentation. if leading_blanks && parser.mark.column < indent && is_tab(parser.buffer, parser.buffer_pos) { yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", - start_mark, "found a tab character that violate intendation") + start_mark, "found a tab character that violate indentation") return false } @@ -2687,7 +2687,7 @@ func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) b } } - // Check intendation level. + // Check indentation level. if parser.flow_level == 0 && parser.mark.column < indent { break } diff --git a/vendor/gopkg.in/yaml.v2/yaml.go b/vendor/gopkg.in/yaml.v2/yaml.go index af4df8a42..36d6b883a 100644 --- a/vendor/gopkg.in/yaml.v2/yaml.go +++ b/vendor/gopkg.in/yaml.v2/yaml.go @@ -222,7 +222,7 @@ func getStructInfo(st reflect.Type) (*structInfo, error) { inlineMap := -1 for i := 0; i != n; i++ { field := st.Field(i) - if field.PkgPath != "" { + if field.PkgPath != "" && !field.Anonymous { continue // Private field } @@ -324,13 +324,15 @@ func isZero(v reflect.Value) bool { return v.Len() == 0 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return v.Int() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return v.Uint() == 0 case reflect.Bool: return !v.Bool() case reflect.Struct: vt := v.Type() - for i := v.NumField()-1; i >= 0; i-- { + for i := v.NumField() - 1; i >= 0; i-- { if vt.Field(i).PkgPath != "" { continue // Private field }