diff --git a/Dockerfile.dev b/Dockerfile.dev index 0bc16d2..23b4513 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -9,4 +9,4 @@ ADD build/rancher-letsencrypt-linux-amd64 /usr/bin/rancher-letsencrypt RUN chmod +x /usr/bin/rancher-letsencrypt -ENTRYPOINT ["/usr/bin/rancher-letsencrypt", "-debug"] \ No newline at end of file +ENTRYPOINT ["/usr/bin/rancher-letsencrypt", "-debug", "-test-mode"] diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 1f82388..8877166 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -2,9 +2,6 @@ "ImportPath": "github.com/janeczku/rancher-letsencrypt", "GoVersion": "go1.6", "GodepVersion": "v74", - "Packages": [ - "./..." - ], "Deps": [ { "ImportPath": "github.com/JamesClonk/vultr/lib", @@ -169,9 +166,14 @@ "Rev": "d2207178e10e4527e8f222fd8707982df8c3af17" }, { - "ImportPath": "github.com/rancher/go-rancher/client", - "Comment": "v0.1.0-173-g37c17e4", - "Rev": "37c17e456a2d6dce279f54ee2f957797d30a20dc" + "ImportPath": "github.com/pkg/errors", + "Comment": "v0.8.0-2-g248dadf", + "Rev": "248dadf4e9068a0b3e79f02ed0a610d935de5302" + }, + { + "ImportPath": "github.com/rancher/go-rancher/v2", + "Comment": "v0.1.0-241-g2c43ff3", + "Rev": "2c43ff300f3eafcbd7d0b89b10427fc630efdc1e" }, { "ImportPath": "github.com/weppos/dnsimple-go/dnsimple", diff --git a/context.go b/context.go index 9deb02f..7753563 100644 --- a/context.go +++ b/context.go @@ -28,13 +28,15 @@ type Context struct { ExpiryDate time.Time RancherCertId string - Debug bool + Debug bool + TestMode bool } // InitContext initializes the application context from environmental variables func (c *Context) InitContext() { var err error c.Debug = debug + c.TestMode = testMode cattleUrl := getEnvOption("CATTLE_URL", true) cattleApiKey := getEnvOption("CATTLE_ACCESS_KEY", true) cattleSecretKey := getEnvOption("CATTLE_SECRET_KEY", true) @@ -94,6 +96,8 @@ func (c *Context) InitContext() { logrus.Fatalf("LetsEncrypt client: %v", err) } + logrus.Infof("Using Let's Encrypt %s API", apiVersion) + // Enable debug mode if c.Debug { logrus.SetLevel(logrus.DebugLevel) diff --git a/letsencrypt/client.go b/letsencrypt/client.go index dd91245..8e61d7e 100644 --- a/letsencrypt/client.go +++ b/letsencrypt/client.go @@ -56,6 +56,7 @@ type AcmeCertificate struct { type Client struct { client *lego.Client apiVersion ApiVersion + provider Provider } // NewClient returns a new Lets Encrypt client @@ -140,6 +141,7 @@ func NewClient(email string, kt KeyType, apiVer ApiVersion, provider ProviderOpt return &Client{ client: client, apiVersion: apiVer, + provider: provider.Provider, }, nil } @@ -312,6 +314,14 @@ func (c *Client) ConfigPath() string { return path } +func (c *Client) ProviderName() string { + return string(c.provider) +} + +func (c *Client) ApiVersion() string { + return string(c.apiVersion) +} + func (c *Client) CertPath(certName string) string { return path.Join(c.ConfigPath(), "certs", safeFileName(certName)) } diff --git a/main.go b/main.go index d375182..0bde234 100644 --- a/main.go +++ b/main.go @@ -12,11 +12,13 @@ var ( Version string Git string - debug bool + debug bool + testMode bool ) func init() { flag.BoolVar(&debug, "debug", false, "Enable debugging") + flag.BoolVar(&testMode, "test-mode", false, "Renew certificate every 120 seconds") logrus.SetFormatter(&logrus.TextFormatter{DisableTimestamp: true}) logrus.SetOutput(os.Stdout) } diff --git a/manager.go b/manager.go index b49ebef..403a1d1 100644 --- a/manager.go +++ b/manager.go @@ -56,7 +56,14 @@ func (c *Context) startup() { return } - logrus.Infof("Trying to obtain SSL certificate (%s) from Let's Encrypt CA", strings.Join(c.Domains, ",")) + if c.Acme.ProviderName() == "HTTP" { + logrus.Info("Using HTTP challenge: Sleeping for 120 seconds before requesting certificate") + logrus.Info("Make sure that HTTP requests for '/.well-known/acme-challenge' for all certificate " + + "domains are forwarded to the container running this application") + time.Sleep(120 * time.Second) + } + + logrus.Infof("Trying to obtain SSL certificate (%s) from Let's Encrypt %s CA", strings.Join(c.Domains, ","), c.Acme.ApiVersion()) acmeCert, failures := c.Acme.Issue(c.CertificateName, c.Domains) if len(failures) > 0 { @@ -95,14 +102,14 @@ func (c *Context) updateRancherCert(privateKey, cert []byte) { } logrus.Infof("Updated Rancher certificate '%s'", c.CertificateName) - err = c.Rancher.UpgradeLoadBalancers(c.RancherCertId) + err = c.Rancher.UpdateLoadBalancers(c.RancherCertId) if err != nil { logrus.Fatalf("Failed to upgrade load balancers: %v", err) } } func (c *Context) renew() { - logrus.Infof("Trying to obtain renewed SSL certificate (%s) from Let's Encrypt CA", strings.Join(c.Domains, ",")) + logrus.Infof("Trying to obtain renewed SSL certificate (%s) from Let's Encrypt %s CA", strings.Join(c.Domains, ","), c.Acme.ApiVersion()) acmeCert, err := c.Acme.Renew(c.CertificateName) if err != nil { @@ -125,9 +132,9 @@ func (c *Context) timer() <-chan time.Time { logrus.Infof("Certificate renewal scheduled for %s", next.Format("2006/01/02 15:04 MST")) - // Debug option forces renewal - if c.Debug { - logrus.Debug("Debug mode: Forced certificate renewal in 120 seconds") + // test mode forces renewal + if c.TestMode { + logrus.Debug("Test mode: Forced certificate renewal in 120 seconds") left = 120 * time.Second } diff --git a/rancher/certificate.go b/rancher/certificate.go index b7af7ad..dbc42be 100644 --- a/rancher/certificate.go +++ b/rancher/certificate.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/Sirupsen/logrus" - rancherClient "github.com/rancher/go-rancher/client" + rancherClient "github.com/rancher/go-rancher/v2" ) // AddCertificate creates a new certificate resource using the given private key and PEM encoded certificate @@ -24,7 +24,7 @@ func (r *Client) AddCertificate(name, descr string, privateKey, cert []byte) (*r return nil, err } - logrus.Debugf("Waiting for added certificate '%s' to become active", rancherCert.Name) + logrus.Debugf("Waiting for new certificate '%s' to become active", rancherCert.Name) if err := r.WaitCertificate(rancherCert); err != nil { return nil, err @@ -58,7 +58,7 @@ func (r *Client) UpdateCertificate(certId, descr string, privateKey, cert []byte // FindCertByName retrieves an existing certificate func (r *Client) FindCertByName(name string) (*rancherClient.Certificate, error) { - logrus.Debugf("Looking up Rancher certificate by name: '%s'", name) + logrus.Debugf("Looking up Rancher certificate by name: %s", name) certificates, err := r.client.Certificate.List(&rancherClient.ListOpts{ Filters: map[string]interface{}{ @@ -75,7 +75,7 @@ func (r *Client) FindCertByName(name string) (*rancherClient.Certificate, error) return nil, nil } - logrus.Debugf("Found existing Rancher certificate by name: '%s'", name) + logrus.Debugf("Found existing Rancher certificate by name: %s", name) return &certificates.Data[0], nil } @@ -87,9 +87,9 @@ func (r *Client) GetCertById(certId string) (*rancherClient.Certificate, error) } if rancherCert == nil { - return nil, fmt.Errorf("Rancher certificate with Id '%s' does not exist", certId) + return nil, fmt.Errorf("No such certificate with ID %s", certId) } - logrus.Debugf("Got Rancher certificate '%s' by Id '%s'", rancherCert.Name, certId) + logrus.Debugf("Got Rancher certificate %s by ID %s", rancherCert.Name, certId) return rancherCert, nil } diff --git a/rancher/client.go b/rancher/client.go index 94d2179..97e041a 100644 --- a/rancher/client.go +++ b/rancher/client.go @@ -3,7 +3,7 @@ package rancher import ( "time" - rancherClient "github.com/rancher/go-rancher/client" + rancherClient "github.com/rancher/go-rancher/v2" ) type Client struct { diff --git a/rancher/loadbalancer.go b/rancher/loadbalancer.go index f44a476..58108c5 100644 --- a/rancher/loadbalancer.go +++ b/rancher/loadbalancer.go @@ -2,50 +2,44 @@ package rancher import ( "github.com/Sirupsen/logrus" - rancherClient "github.com/rancher/go-rancher/client" + rancherClient "github.com/rancher/go-rancher/v2" ) -// UpgradeLoadBalancers upgrades all load balancers with the renewed certificate -func (r *Client) UpgradeLoadBalancers(certId string) error { +// UpdateLoadBalancers updates all load balancers with the renewed certificate +func (r *Client) UpdateLoadBalancers(certId string) error { balancers, err := r.findLoadBalancerServicesByCert(certId) if err != nil { return err } if len(balancers) == 0 { - logrus.Info("Certificate is not being used by any load balancer") + logrus.Info("Certificate not used by any load balancer") return nil } for _, id := range balancers { lb, err := r.client.LoadBalancerService.ById(id) if err != nil { - logrus.Errorf("Failed to get load balancer by id '%s': %v", id, err) + logrus.Errorf("Failed to get load balancer by ID %s: %v", id, err) continue } - err = r.upgrade(lb) + err = r.update(lb) if err != nil { - logrus.Errorf("Failed to upgrade load balancer '%s': %v", lb.Name, err) + logrus.Errorf("Failed to update load balancer '%s': %v", lb.Name, err) } else { - logrus.Infof("Upgraded load balancer '%s' with renewed certificate", lb.Name) + logrus.Infof("Updated load balancer '%s' with changed certificate", lb.Name) } } return nil } -func (r *Client) upgrade(lb *rancherClient.LoadBalancerService) error { - upgrade := &rancherClient.ServiceUpgrade{} - upgrade.InServiceStrategy = &rancherClient.InServiceUpgradeStrategy{ - LaunchConfig: lb.LaunchConfig, - StartFirst: false, - } - upgrade.ToServiceStrategy = &rancherClient.ToServiceUpgradeStrategy{} +func (r *Client) update(lb *rancherClient.LoadBalancerService) error { - logrus.Debugf("Upgrading load balancer '%s'", lb.Name) + logrus.Debugf("Updating load balancer %s", lb.Name) - service, err := r.client.LoadBalancerService.ActionUpgrade(lb, upgrade) + service, err := r.client.LoadBalancerService.ActionUpdate(lb) if err != nil { return err } @@ -55,26 +49,13 @@ func (r *Client) upgrade(lb *rancherClient.LoadBalancerService) error { logrus.Warnf(err.Error()) } - if service.State == "upgraded" { - logrus.Debugf("Finishing upgrade for load balancer '%s'", lb.Name) - - service, err = r.client.Service.ActionFinishupgrade(service) - if err != nil { - return err - } - err = r.WaitService(service) - if err != nil { - logrus.Warnf(err.Error()) - } - } - return nil } func (r *Client) findLoadBalancerServicesByCert(certId string) ([]string, error) { var results []string - logrus.Debugf("Looking up load balancers matching certificate id '%s'", certId) + logrus.Debugf("Looking up load balancers matching certificate ID %s", certId) balancers, err := r.client.LoadBalancerService.List(&rancherClient.ListOpts{ Filters: map[string]interface{}{ @@ -86,16 +67,18 @@ func (r *Client) findLoadBalancerServicesByCert(certId string) ([]string, error) return results, err } if len(balancers.Data) == 0 { - logrus.Debug("Did not find matching load balancers") + logrus.Debug("Did not find any active load balancers") return results, nil } + logrus.Debugf("Found %d active load balancers", len(balancers.Data)) + for _, b := range balancers.Data { - if b.DefaultCertificateId == certId { + if b.LbConfig.DefaultCertificateId == certId { results = append(results, b.Id) continue } - for _, id := range b.CertificateIds { + for _, id := range b.LbConfig.CertificateIds { if id == certId { results = append(results, b.Id) break @@ -103,6 +86,6 @@ func (r *Client) findLoadBalancerServicesByCert(certId string) ([]string, error) } } - logrus.Debugf("Found %d matching load balancers", len(results)) + logrus.Debugf("Found %d load balancers with matching certificate", len(results)) return results, nil } diff --git a/rancher/wait.go b/rancher/wait.go index f3cf52f..2b75023 100644 --- a/rancher/wait.go +++ b/rancher/wait.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - rancherClient "github.com/rancher/go-rancher/client" + rancherClient "github.com/rancher/go-rancher/v2" ) func backoff(maxDuration time.Duration, timeoutMessage string, f func() (bool, error)) error { diff --git a/vendor/github.com/pkg/errors/.gitignore b/vendor/github.com/pkg/errors/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/vendor/github.com/pkg/errors/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/vendor/github.com/pkg/errors/.travis.yml b/vendor/github.com/pkg/errors/.travis.yml new file mode 100644 index 0000000..567ccdb --- /dev/null +++ b/vendor/github.com/pkg/errors/.travis.yml @@ -0,0 +1,11 @@ +language: go +go_import_path: github.com/pkg/errors +go: + - 1.4.3 + - 1.5.4 + - 1.6.3 + - 1.7.3 + - tip + +script: + - go test -v ./... diff --git a/vendor/github.com/pkg/errors/LICENSE b/vendor/github.com/pkg/errors/LICENSE new file mode 100644 index 0000000..835ba3e --- /dev/null +++ b/vendor/github.com/pkg/errors/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2015, Dave Cheney +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/pkg/errors/README.md b/vendor/github.com/pkg/errors/README.md new file mode 100644 index 0000000..273db3c --- /dev/null +++ b/vendor/github.com/pkg/errors/README.md @@ -0,0 +1,52 @@ +# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) + +Package errors provides simple error handling primitives. + +`go get github.com/pkg/errors` + +The traditional error handling idiom in Go is roughly akin to +```go +if err != nil { + return err +} +``` +which applied recursively up the call stack results in error reports without context or debugging information. The errors package allows programmers to add context to the failure path in their code in a way that does not destroy the original value of the error. + +## Adding context to an error + +The errors.Wrap function returns a new error that adds context to the original error. For example +```go +_, err := ioutil.ReadAll(r) +if err != nil { + return errors.Wrap(err, "read failed") +} +``` +## Retrieving the cause of an error + +Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`. +```go +type causer interface { + Cause() error +} +``` +`errors.Cause` will recursively retrieve the topmost error which does not implement `causer`, which is assumed to be the original cause. For example: +```go +switch err := errors.Cause(err).(type) { +case *MyError: + // handle specifically +default: + // unknown error +} +``` + +[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). + +## Contributing + +We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high. + +Before proposing a change, please discuss your change by raising an issue. + +## Licence + +BSD-2-Clause diff --git a/vendor/github.com/pkg/errors/appveyor.yml b/vendor/github.com/pkg/errors/appveyor.yml new file mode 100644 index 0000000..a932ead --- /dev/null +++ b/vendor/github.com/pkg/errors/appveyor.yml @@ -0,0 +1,32 @@ +version: build-{build}.{branch} + +clone_folder: C:\gopath\src\github.com\pkg\errors +shallow_clone: true # for startup speed + +environment: + GOPATH: C:\gopath + +platform: + - x64 + +# http://www.appveyor.com/docs/installed-software +install: + # some helpful output for debugging builds + - go version + - go env + # pre-installed MinGW at C:\MinGW is 32bit only + # but MSYS2 at C:\msys64 has mingw64 + - set PATH=C:\msys64\mingw64\bin;%PATH% + - gcc --version + - g++ --version + +build_script: + - go install -v ./... + +test_script: + - set PATH=C:\gopath\bin;%PATH% + - go test -v ./... + +#artifacts: +# - path: '%GOPATH%\bin\*.exe' +deploy: off diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go new file mode 100644 index 0000000..842ee80 --- /dev/null +++ b/vendor/github.com/pkg/errors/errors.go @@ -0,0 +1,269 @@ +// Package errors provides simple error handling primitives. +// +// The traditional error handling idiom in Go is roughly akin to +// +// if err != nil { +// return err +// } +// +// which applied recursively up the call stack results in error reports +// without context or debugging information. The errors package allows +// programmers to add context to the failure path in their code in a way +// that does not destroy the original value of the error. +// +// Adding context to an error +// +// The errors.Wrap function returns a new error that adds context to the +// original error by recording a stack trace at the point Wrap is called, +// and the supplied message. For example +// +// _, err := ioutil.ReadAll(r) +// if err != nil { +// return errors.Wrap(err, "read failed") +// } +// +// If additional control is required the errors.WithStack and errors.WithMessage +// functions destructure errors.Wrap into its component operations of annotating +// an error with a stack trace and an a message, respectively. +// +// Retrieving the cause of an error +// +// Using errors.Wrap constructs a stack of errors, adding context to the +// preceding error. Depending on the nature of the error it may be necessary +// to reverse the operation of errors.Wrap to retrieve the original error +// for inspection. Any error value which implements this interface +// +// type causer interface { +// Cause() error +// } +// +// can be inspected by errors.Cause. errors.Cause will recursively retrieve +// the topmost error which does not implement causer, which is assumed to be +// the original cause. For example: +// +// switch err := errors.Cause(err).(type) { +// case *MyError: +// // handle specifically +// default: +// // unknown error +// } +// +// causer interface is not exported by this package, but is considered a part +// of stable public API. +// +// Formatted printing of errors +// +// All error values returned from this package implement fmt.Formatter and can +// be formatted by the fmt package. The following verbs are supported +// +// %s print the error. If the error has a Cause it will be +// printed recursively +// %v see %s +// %+v extended format. Each Frame of the error's StackTrace will +// be printed in detail. +// +// Retrieving the stack trace of an error or wrapper +// +// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are +// invoked. This information can be retrieved with the following interface. +// +// type stackTracer interface { +// StackTrace() errors.StackTrace +// } +// +// Where errors.StackTrace is defined as +// +// type StackTrace []Frame +// +// The Frame type represents a call site in the stack trace. Frame supports +// the fmt.Formatter interface that can be used for printing information about +// the stack trace of this error. For example: +// +// if err, ok := err.(stackTracer); ok { +// for _, f := range err.StackTrace() { +// fmt.Printf("%+s:%d", f) +// } +// } +// +// stackTracer interface is not exported by this package, but is considered a part +// of stable public API. +// +// See the documentation for Frame.Format for more details. +package errors + +import ( + "fmt" + "io" +) + +// New returns an error with the supplied message. +// New also records the stack trace at the point it was called. +func New(message string) error { + return &fundamental{ + msg: message, + stack: callers(), + } +} + +// Errorf formats according to a format specifier and returns the string +// as a value that satisfies error. +// Errorf also records the stack trace at the point it was called. +func Errorf(format string, args ...interface{}) error { + return &fundamental{ + msg: fmt.Sprintf(format, args...), + stack: callers(), + } +} + +// fundamental is an error that has a message and a stack, but no caller. +type fundamental struct { + msg string + *stack +} + +func (f *fundamental) Error() string { return f.msg } + +func (f *fundamental) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + io.WriteString(s, f.msg) + f.stack.Format(s, verb) + return + } + fallthrough + case 's': + io.WriteString(s, f.msg) + case 'q': + fmt.Fprintf(s, "%q", f.msg) + } +} + +// WithStack annotates err with a stack trace at the point WithStack was called. +// If err is nil, WithStack returns nil. +func WithStack(err error) error { + if err == nil { + return nil + } + return &withStack{ + err, + callers(), + } +} + +type withStack struct { + error + *stack +} + +func (w *withStack) Cause() error { return w.error } + +func (w *withStack) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + fmt.Fprintf(s, "%+v", w.Cause()) + w.stack.Format(s, verb) + return + } + fallthrough + case 's': + io.WriteString(s, w.Error()) + case 'q': + fmt.Fprintf(s, "%q", w.Error()) + } +} + +// Wrap returns an error annotating err with a stack trace +// at the point Wrap is called, and the supplied message. +// If err is nil, Wrap returns nil. +func Wrap(err error, message string) error { + if err == nil { + return nil + } + err = &withMessage{ + cause: err, + msg: message, + } + return &withStack{ + err, + callers(), + } +} + +// Wrapf returns an error annotating err with a stack trace +// at the point Wrapf is call, and the format specifier. +// If err is nil, Wrapf returns nil. +func Wrapf(err error, format string, args ...interface{}) error { + if err == nil { + return nil + } + err = &withMessage{ + cause: err, + msg: fmt.Sprintf(format, args...), + } + return &withStack{ + err, + callers(), + } +} + +// WithMessage annotates err with a new message. +// If err is nil, WithMessage returns nil. +func WithMessage(err error, message string) error { + if err == nil { + return nil + } + return &withMessage{ + cause: err, + msg: message, + } +} + +type withMessage struct { + cause error + msg string +} + +func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() } +func (w *withMessage) Cause() error { return w.cause } + +func (w *withMessage) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + fmt.Fprintf(s, "%+v\n", w.Cause()) + io.WriteString(s, w.msg) + return + } + fallthrough + case 's', 'q': + io.WriteString(s, w.Error()) + } +} + +// Cause returns the underlying cause of the error, if possible. +// An error value has a cause if it implements the following +// interface: +// +// type causer interface { +// Cause() error +// } +// +// If the error does not implement Cause, the original error will +// be returned. If the error is nil, nil will be returned without further +// investigation. +func Cause(err error) error { + type causer interface { + Cause() error + } + + for err != nil { + cause, ok := err.(causer) + if !ok { + break + } + err = cause.Cause() + } + return err +} diff --git a/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/pkg/errors/stack.go new file mode 100644 index 0000000..6b1f289 --- /dev/null +++ b/vendor/github.com/pkg/errors/stack.go @@ -0,0 +1,178 @@ +package errors + +import ( + "fmt" + "io" + "path" + "runtime" + "strings" +) + +// Frame represents a program counter inside a stack frame. +type Frame uintptr + +// pc returns the program counter for this frame; +// multiple frames may have the same PC value. +func (f Frame) pc() uintptr { return uintptr(f) - 1 } + +// file returns the full path to the file that contains the +// function for this Frame's pc. +func (f Frame) file() string { + fn := runtime.FuncForPC(f.pc()) + if fn == nil { + return "unknown" + } + file, _ := fn.FileLine(f.pc()) + return file +} + +// line returns the line number of source code of the +// function for this Frame's pc. +func (f Frame) line() int { + fn := runtime.FuncForPC(f.pc()) + if fn == nil { + return 0 + } + _, line := fn.FileLine(f.pc()) + return line +} + +// Format formats the frame according to the fmt.Formatter interface. +// +// %s source file +// %d source line +// %n function name +// %v equivalent to %s:%d +// +// Format accepts flags that alter the printing of some verbs, as follows: +// +// %+s path of source file relative to the compile time GOPATH +// %+v equivalent to %+s:%d +func (f Frame) Format(s fmt.State, verb rune) { + switch verb { + case 's': + switch { + case s.Flag('+'): + pc := f.pc() + fn := runtime.FuncForPC(pc) + if fn == nil { + io.WriteString(s, "unknown") + } else { + file, _ := fn.FileLine(pc) + fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file) + } + default: + io.WriteString(s, path.Base(f.file())) + } + case 'd': + fmt.Fprintf(s, "%d", f.line()) + case 'n': + name := runtime.FuncForPC(f.pc()).Name() + io.WriteString(s, funcname(name)) + case 'v': + f.Format(s, 's') + io.WriteString(s, ":") + f.Format(s, 'd') + } +} + +// StackTrace is stack of Frames from innermost (newest) to outermost (oldest). +type StackTrace []Frame + +func (st StackTrace) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + switch { + case s.Flag('+'): + for _, f := range st { + fmt.Fprintf(s, "\n%+v", f) + } + case s.Flag('#'): + fmt.Fprintf(s, "%#v", []Frame(st)) + default: + fmt.Fprintf(s, "%v", []Frame(st)) + } + case 's': + fmt.Fprintf(s, "%s", []Frame(st)) + } +} + +// stack represents a stack of program counters. +type stack []uintptr + +func (s *stack) Format(st fmt.State, verb rune) { + switch verb { + case 'v': + switch { + case st.Flag('+'): + for _, pc := range *s { + f := Frame(pc) + fmt.Fprintf(st, "\n%+v", f) + } + } + } +} + +func (s *stack) StackTrace() StackTrace { + f := make([]Frame, len(*s)) + for i := 0; i < len(f); i++ { + f[i] = Frame((*s)[i]) + } + return f +} + +func callers() *stack { + const depth = 32 + var pcs [depth]uintptr + n := runtime.Callers(3, pcs[:]) + var st stack = pcs[0:n] + return &st +} + +// funcname removes the path prefix component of a function's name reported by func.Name(). +func funcname(name string) string { + i := strings.LastIndex(name, "/") + name = name[i+1:] + i = strings.Index(name, ".") + return name[i+1:] +} + +func trimGOPATH(name, file string) string { + // Here we want to get the source file path relative to the compile time + // GOPATH. As of Go 1.6.x there is no direct way to know the compiled + // GOPATH at runtime, but we can infer the number of path segments in the + // GOPATH. We note that fn.Name() returns the function name qualified by + // the import path, which does not include the GOPATH. Thus we can trim + // segments from the beginning of the file path until the number of path + // separators remaining is one more than the number of path separators in + // the function name. For example, given: + // + // GOPATH /home/user + // file /home/user/src/pkg/sub/file.go + // fn.Name() pkg/sub.Type.Method + // + // We want to produce: + // + // pkg/sub/file.go + // + // From this we can easily see that fn.Name() has one less path separator + // than our desired output. We count separators from the end of the file + // path until it finds two more than in the function name and then move + // one character forward to preserve the initial path segment without a + // leading separator. + const sep = "/" + goal := strings.Count(name, sep) + 2 + i := len(file) + for n := 0; n < goal; n++ { + i = strings.LastIndex(file[:i], sep) + if i == -1 { + // not enough separators found, set i so that the slice expression + // below leaves file unmodified + i = -len(sep) + break + } + } + // get back to 0 or trim the leading separator + file = file[i+len(sep):] + return file +} diff --git a/vendor/github.com/rancher/go-rancher/client/client.go b/vendor/github.com/rancher/go-rancher/client/client.go deleted file mode 100644 index 0b14ada..0000000 --- a/vendor/github.com/rancher/go-rancher/client/client.go +++ /dev/null @@ -1,7 +0,0 @@ -package client - -type RancherBaseClient struct { - Opts *ClientOpts - Schemas *Schemas - Types map[string]Schema -} 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 97afedd..0000000 --- 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 1afdbad..0000000 --- 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 09d79e6..0000000 --- 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 39a7d17..0000000 --- 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 df5a719..0000000 --- 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_service_link_input.go b/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_service_link_input.go deleted file mode 100644 index a5f010e..0000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_service_link_input.go +++ /dev/null @@ -1,67 +0,0 @@ -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/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 c352aad..0000000 --- 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_cluster.go b/vendor/github.com/rancher/go-rancher/client/generated_cluster.go deleted file mode 100644 index 0374af9..0000000 --- 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_environment.go b/vendor/github.com/rancher/go-rancher/client/generated_environment.go deleted file mode 100644 index 3439fb2..0000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_environment.go +++ /dev/null @@ -1,252 +0,0 @@ -package client - -const ( - ENVIRONMENT_TYPE = "environment" -) - -type Environment 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"` - - 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 EnvironmentCollection struct { - Collection - Data []Environment `json:"data,omitempty"` -} - -type EnvironmentClient struct { - rancherClient *RancherClient -} - -type EnvironmentOperations interface { - List(opts *ListOpts) (*EnvironmentCollection, error) - Create(opts *Environment) (*Environment, error) - Update(existing *Environment, updates interface{}) (*Environment, error) - ById(id string) (*Environment, error) - Delete(container *Environment) error - - ActionActivateservices(*Environment) (*Environment, error) - - ActionAddoutputs(*Environment, *AddOutputsInput) (*Environment, error) - - ActionCancelrollback(*Environment) (*Environment, error) - - ActionCancelupgrade(*Environment) (*Environment, error) - - ActionCreate(*Environment) (*Environment, error) - - ActionDeactivateservices(*Environment) (*Environment, error) - - ActionError(*Environment) (*Environment, error) - - ActionExportconfig(*Environment, *ComposeConfigInput) (*ComposeConfig, error) - - ActionFinishupgrade(*Environment) (*Environment, error) - - ActionRemove(*Environment) (*Environment, error) - - ActionRollback(*Environment) (*Environment, error) - - ActionUpdate(*Environment) (*Environment, error) - - ActionUpgrade(*Environment, *EnvironmentUpgrade) (*Environment, error) -} - -func newEnvironmentClient(rancherClient *RancherClient) *EnvironmentClient { - return &EnvironmentClient{ - rancherClient: rancherClient, - } -} - -func (c *EnvironmentClient) Create(container *Environment) (*Environment, error) { - resp := &Environment{} - err := c.rancherClient.doCreate(ENVIRONMENT_TYPE, container, resp) - return resp, err -} - -func (c *EnvironmentClient) Update(existing *Environment, updates interface{}) (*Environment, error) { - resp := &Environment{} - err := c.rancherClient.doUpdate(ENVIRONMENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *EnvironmentClient) List(opts *ListOpts) (*EnvironmentCollection, error) { - resp := &EnvironmentCollection{} - err := c.rancherClient.doList(ENVIRONMENT_TYPE, opts, resp) - return resp, err -} - -func (c *EnvironmentClient) ById(id string) (*Environment, error) { - resp := &Environment{} - err := c.rancherClient.doById(ENVIRONMENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *EnvironmentClient) Delete(container *Environment) error { - return c.rancherClient.doResourceDelete(ENVIRONMENT_TYPE, &container.Resource) -} - -func (c *EnvironmentClient) ActionActivateservices(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "activateservices", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionAddoutputs(resource *Environment, input *AddOutputsInput) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "addoutputs", &resource.Resource, input, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionCancelrollback(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionCancelupgrade(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionCreate(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionDeactivateservices(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "deactivateservices", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionError(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionExportconfig(resource *Environment, input *ComposeConfigInput) (*ComposeConfig, error) { - - resp := &ComposeConfig{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "exportconfig", &resource.Resource, input, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionFinishupgrade(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionRemove(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionRollback(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionUpdate(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionUpgrade(resource *Environment, input *EnvironmentUpgrade) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_environment_upgrade.go b/vendor/github.com/rancher/go-rancher/client/generated_environment_upgrade.go deleted file mode 100644 index 23a9afc..0000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_environment_upgrade.go +++ /dev/null @@ -1,73 +0,0 @@ -package client - -const ( - ENVIRONMENT_UPGRADE_TYPE = "environmentUpgrade" -) - -type EnvironmentUpgrade 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 EnvironmentUpgradeCollection struct { - Collection - Data []EnvironmentUpgrade `json:"data,omitempty"` -} - -type EnvironmentUpgradeClient struct { - rancherClient *RancherClient -} - -type EnvironmentUpgradeOperations interface { - List(opts *ListOpts) (*EnvironmentUpgradeCollection, error) - Create(opts *EnvironmentUpgrade) (*EnvironmentUpgrade, error) - Update(existing *EnvironmentUpgrade, updates interface{}) (*EnvironmentUpgrade, error) - ById(id string) (*EnvironmentUpgrade, error) - Delete(container *EnvironmentUpgrade) error -} - -func newEnvironmentUpgradeClient(rancherClient *RancherClient) *EnvironmentUpgradeClient { - return &EnvironmentUpgradeClient{ - rancherClient: rancherClient, - } -} - -func (c *EnvironmentUpgradeClient) Create(container *EnvironmentUpgrade) (*EnvironmentUpgrade, error) { - resp := &EnvironmentUpgrade{} - err := c.rancherClient.doCreate(ENVIRONMENT_UPGRADE_TYPE, container, resp) - return resp, err -} - -func (c *EnvironmentUpgradeClient) Update(existing *EnvironmentUpgrade, updates interface{}) (*EnvironmentUpgrade, error) { - resp := &EnvironmentUpgrade{} - err := c.rancherClient.doUpdate(ENVIRONMENT_UPGRADE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *EnvironmentUpgradeClient) List(opts *ListOpts) (*EnvironmentUpgradeCollection, error) { - resp := &EnvironmentUpgradeCollection{} - err := c.rancherClient.doList(ENVIRONMENT_UPGRADE_TYPE, opts, resp) - return resp, err -} - -func (c *EnvironmentUpgradeClient) ById(id string) (*EnvironmentUpgrade, error) { - resp := &EnvironmentUpgrade{} - err := c.rancherClient.doById(ENVIRONMENT_UPGRADE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *EnvironmentUpgradeClient) Delete(container *EnvironmentUpgrade) error { - return c.rancherClient.doResourceDelete(ENVIRONMENT_UPGRADE_TYPE, &container.Resource) -} 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 5fbda9b..0000000 --- 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_githubconfig.go b/vendor/github.com/rancher/go-rancher/client/generated_githubconfig.go deleted file mode 100644 index cafb433..0000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_githubconfig.go +++ /dev/null @@ -1,81 +0,0 @@ -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/client/generated_global_load_balancer.go b/vendor/github.com/rancher/go-rancher/client/generated_global_load_balancer.go deleted file mode 100644 index 881b13f..0000000 --- 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 a461de9..0000000 --- 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 e608906..0000000 --- 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_haproxy_config.go b/vendor/github.com/rancher/go-rancher/client/generated_haproxy_config.go deleted file mode 100644 index a1e27bc..0000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_haproxy_config.go +++ /dev/null @@ -1,69 +0,0 @@ -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/client/generated_ip_address_associate_input.go b/vendor/github.com/rancher/go-rancher/client/generated_ip_address_associate_input.go deleted file mode 100644 index 2184ae9..0000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_ip_address_associate_input.go +++ /dev/null @@ -1,67 +0,0 @@ -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/client/generated_load_balancer.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer.go deleted file mode 100644 index 6b870b8..0000000 --- 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_app_cookie_stickiness_policy.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_app_cookie_stickiness_policy.go deleted file mode 100644 index 235252c..0000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_app_cookie_stickiness_policy.go +++ /dev/null @@ -1,79 +0,0 @@ -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/client/generated_load_balancer_config.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_config.go deleted file mode 100644 index 8c23c42..0000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_config.go +++ /dev/null @@ -1,69 +0,0 @@ -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/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 b8e4d51..0000000 --- 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 1d96ec6..0000000 --- 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 b135d29..0000000 --- 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 5d0e983..0000000 --- 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_service_link.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service_link.go deleted file mode 100644 index b30c45b..0000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service_link.go +++ /dev/null @@ -1,71 +0,0 @@ -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/client/generated_load_balancer_target.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_target.go deleted file mode 100644 index b0037f7..0000000 --- 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 f00ec79..0000000 --- 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 7e046af..0000000 --- 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 db914ac..0000000 --- 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 868e96f..0000000 --- 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 84e47e7..0000000 --- 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 f6a2c1b..0000000 --- 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_labels_input.go b/vendor/github.com/rancher/go-rancher/client/generated_set_labels_input.go deleted file mode 100644 index 96d8945..0000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_set_labels_input.go +++ /dev/null @@ -1,67 +0,0 @@ -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/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 753abc6..0000000 --- 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 31aaa9c..0000000 --- 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_service_links_input.go b/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_service_links_input.go deleted file mode 100644 index 76d8684..0000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_service_links_input.go +++ /dev/null @@ -1,67 +0,0 @@ -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/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 cef13a3..0000000 --- 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 500d5a9..0000000 --- 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 63f91d6..0000000 --- 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 5d2203b..0000000 --- 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 0a9e383..0000000 --- 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 12f962f..0000000 --- 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 f6cb9d2..0000000 --- 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/v2/client.go b/vendor/github.com/rancher/go-rancher/v2/client.go new file mode 100644 index 0000000..fef9e40 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/client.go @@ -0,0 +1,39 @@ +package client + +import ( + "net/http" + + "github.com/gorilla/websocket" +) + +type RancherBaseClientImpl struct { + Opts *ClientOpts + Schemas *Schemas + Types map[string]Schema +} + +type RancherBaseClient interface { + Websocket(string, map[string][]string) (*websocket.Conn, *http.Response, error) + List(string, *ListOpts, interface{}) error + Post(string, interface{}, interface{}) error + GetLink(Resource, string, interface{}) error + Create(string, interface{}, interface{}) error + Update(string, *Resource, interface{}, interface{}) error + ById(string, string, interface{}) error + Delete(*Resource) error + Reload(*Resource, interface{}) error + Action(string, string, *Resource, interface{}, interface{}) error + GetOpts() *ClientOpts + GetSchemas() *Schemas + GetTypes() map[string]Schema + + doGet(string, *ListOpts, interface{}) error + doList(string, *ListOpts, interface{}) error + doNext(string, interface{}) error + doModify(string, string, interface{}, interface{}) error + doCreate(string, interface{}, interface{}) error + doUpdate(string, *Resource, interface{}, interface{}) error + doById(string, string, interface{}) error + doResourceDelete(string, *Resource) error + doAction(string, string, *Resource, interface{}, interface{}) error +} diff --git a/vendor/github.com/rancher/go-rancher/client/common.go b/vendor/github.com/rancher/go-rancher/v2/common.go similarity index 72% rename from vendor/github.com/rancher/go-rancher/client/common.go rename to vendor/github.com/rancher/go-rancher/v2/common.go index 61d0d1e..c4eeb6f 100644 --- a/vendor/github.com/rancher/go-rancher/client/common.go +++ b/vendor/github.com/rancher/go-rancher/v2/common.go @@ -2,8 +2,8 @@ package client import ( "bytes" + "encoding/base64" "encoding/json" - "errors" "fmt" "io" "io/ioutil" @@ -11,10 +11,11 @@ import ( "net/url" "os" "regexp" - + "strings" "time" "github.com/gorilla/websocket" + "github.com/pkg/errors" ) const ( @@ -116,14 +117,32 @@ 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() return u.String(), nil } -func setupRancherBaseClient(rancherClient *RancherBaseClient, opts *ClientOpts) error { +func setupRancherBaseClient(rancherClient *RancherBaseClientImpl, opts *ClientOpts) error { + u, err := url.Parse(opts.Url) + if err != nil { + return err + } + + if u.Path == "" || u.Path == "/" { + u.Path = "v2-beta" + } else if u.Path == "/v1" || strings.HasPrefix(u.Path, "/v1/") { + u.Path = strings.Replace(u.Path, "/v1", "/v2-beta", 1) + } + opts.Url = u.String() + if opts.Timeout == 0 { opts.Timeout = time.Second * 10 } @@ -197,18 +216,18 @@ func NewListOpts() *ListOpts { } } -func (rancherClient *RancherBaseClient) setupRequest(req *http.Request) { +func (rancherClient *RancherBaseClientImpl) setupRequest(req *http.Request) { req.SetBasicAuth(rancherClient.Opts.AccessKey, rancherClient.Opts.SecretKey) } -func (rancherClient *RancherBaseClient) newHttpClient() *http.Client { +func (rancherClient *RancherBaseClientImpl) 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 { +func (rancherClient *RancherBaseClientImpl) doDelete(url string) error { client := rancherClient.newHttpClient() req, err := http.NewRequest("DELETE", url, nil) if err != nil { @@ -232,11 +251,21 @@ func (rancherClient *RancherBaseClient) doDelete(url string) error { 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 *RancherBaseClientImpl) Websocket(url string, headers map[string][]string) (*websocket.Conn, *http.Response, error) { + httpHeaders := http.Header{} + for k, v := range httpHeaders { + httpHeaders[k] = v + } + + if rancherClient.Opts != nil { + s := rancherClient.Opts.AccessKey + ":" + rancherClient.Opts.SecretKey + httpHeaders.Add("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(s))) + } + + return dialer.Dial(url, http.Header(httpHeaders)) } -func (rancherClient *RancherBaseClient) doGet(url string, opts *ListOpts, respObject interface{}) error { +func (rancherClient *RancherBaseClientImpl) doGet(url string, opts *ListOpts, respObject interface{}) error { if opts == nil { opts = NewListOpts() } @@ -277,14 +306,18 @@ 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 { +func (rancherClient *RancherBaseClientImpl) 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 { +func (rancherClient *RancherBaseClientImpl) doList(schemaType string, opts *ListOpts, respObject interface{}) error { schema, ok := rancherClient.Types[schemaType] if !ok { return errors.New("Unknown schema type [" + schemaType + "]") @@ -302,11 +335,15 @@ func (rancherClient *RancherBaseClient) doList(schemaType string, opts *ListOpts return rancherClient.doGet(collectionUrl, opts, respObject) } -func (rancherClient *RancherBaseClient) Post(url string, createObj interface{}, respObject interface{}) error { +func (rancherClient *RancherBaseClientImpl) doNext(nextUrl string, respObject interface{}) error { + return rancherClient.doGet(nextUrl, nil, respObject) +} + +func (rancherClient *RancherBaseClientImpl) 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 { +func (rancherClient *RancherBaseClientImpl) GetLink(resource Resource, link string, respObject interface{}) error { url := resource.Links[link] if url == "" { return fmt.Errorf("Failed to find link: %s", link) @@ -315,7 +352,7 @@ func (rancherClient *RancherBaseClient) GetLink(resource Resource, link string, return rancherClient.doGet(url, &ListOpts{}, respObject) } -func (rancherClient *RancherBaseClient) doModify(method string, url string, createObj interface{}, respObject interface{}) error { +func (rancherClient *RancherBaseClientImpl) doModify(method string, url string, createObj interface{}, respObject interface{}) error { bodyContent, err := json.Marshal(createObj) if err != nil { return err @@ -334,7 +371,6 @@ func (rancherClient *RancherBaseClient) doModify(method string, url string, crea 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 { @@ -362,11 +398,11 @@ func (rancherClient *RancherBaseClient) doModify(method string, url string, crea return nil } -func (rancherClient *RancherBaseClient) Create(schemaType string, createObj interface{}, respObject interface{}) error { +func (rancherClient *RancherBaseClientImpl) 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 { +func (rancherClient *RancherBaseClientImpl) doCreate(schemaType string, createObj interface{}, respObject interface{}) error { if createObj == nil { createObj = map[string]string{} } @@ -394,11 +430,11 @@ func (rancherClient *RancherBaseClient) doCreate(schemaType string, createObj in return rancherClient.doModify("POST", collectionUrl, createObj, respObject) } -func (rancherClient *RancherBaseClient) Update(schemaType string, existing *Resource, updates interface{}, respObject interface{}) error { +func (rancherClient *RancherBaseClientImpl) 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 { +func (rancherClient *RancherBaseClientImpl) doUpdate(schemaType string, existing *Resource, updates interface{}, respObject interface{}) error { if existing == nil { return errors.New("Existing object is nil") } @@ -428,11 +464,11 @@ func (rancherClient *RancherBaseClient) doUpdate(schemaType string, existing *Re return rancherClient.doModify("PUT", selfUrl, updates, respObject) } -func (rancherClient *RancherBaseClient) ById(schemaType string, id string, respObject interface{}) error { +func (rancherClient *RancherBaseClientImpl) 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 { +func (rancherClient *RancherBaseClientImpl) doById(schemaType string, id string, respObject interface{}) error { schema, ok := rancherClient.Types[schemaType] if !ok { return errors.New("Unknown schema type [" + schemaType + "]") @@ -452,14 +488,14 @@ func (rancherClient *RancherBaseClient) doById(schemaType string, id string, res return err } -func (rancherClient *RancherBaseClient) Delete(existing *Resource) error { +func (rancherClient *RancherBaseClientImpl) Delete(existing *Resource) error { if existing == nil { return nil } return rancherClient.doResourceDelete(existing.Type, existing) } -func (rancherClient *RancherBaseClient) doResourceDelete(schemaType string, existing *Resource) error { +func (rancherClient *RancherBaseClientImpl) doResourceDelete(schemaType string, existing *Resource) error { schema, ok := rancherClient.Types[schemaType] if !ok { return errors.New("Unknown schema type [" + schemaType + "]") @@ -477,7 +513,7 @@ func (rancherClient *RancherBaseClient) doResourceDelete(schemaType string, exis return rancherClient.doDelete(selfUrl) } -func (rancherClient *RancherBaseClient) Reload(existing *Resource, output interface{}) error { +func (rancherClient *RancherBaseClientImpl) 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)) @@ -486,7 +522,12 @@ func (rancherClient *RancherBaseClient) Reload(existing *Resource, output interf return rancherClient.doGet(selfUrl, NewListOpts(), output) } -func (rancherClient *RancherBaseClient) doAction(schemaType string, action string, +func (rancherClient *RancherBaseClientImpl) Action(schemaType string, action string, + existing *Resource, inputObject, respObject interface{}) error { + return rancherClient.doAction(schemaType, action, existing, inputObject, respObject) +} + +func (rancherClient *RancherBaseClientImpl) doAction(schemaType string, action string, existing *Resource, inputObject, respObject interface{}) error { if existing == nil { @@ -549,6 +590,18 @@ func (rancherClient *RancherBaseClient) doAction(schemaType string, action strin return json.Unmarshal(byteContent, respObject) } +func (rancherClient *RancherBaseClientImpl) GetOpts() *ClientOpts { + return rancherClient.Opts +} + +func (rancherClient *RancherBaseClientImpl) GetSchemas() *Schemas { + return rancherClient.Schemas +} + +func (rancherClient *RancherBaseClientImpl) GetTypes() map[string]Schema { + return rancherClient.Types +} + func init() { debug = os.Getenv("RANCHER_CLIENT_DEBUG") == "true" if debug { diff --git a/vendor/github.com/rancher/go-rancher/client/generated_account.go b/vendor/github.com/rancher/go-rancher/v2/generated_account.go similarity index 86% rename from vendor/github.com/rancher/go-rancher/client/generated_account.go rename to vendor/github.com/rancher/go-rancher/v2/generated_account.go index 3e95989..82c5f7f 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_account.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_account.go @@ -36,11 +36,14 @@ type Account struct { 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 AccountCollection struct { Collection - Data []Account `json:"data,omitempty"` + Data []Account `json:"data,omitempty"` + client *AccountClient } type AccountClient struct { @@ -67,6 +70,8 @@ type AccountOperations interface { ActionRestore(*Account) (*Account, error) ActionUpdate(*Account) (*Account, error) + + ActionUpgrade(*Account) (*Account, error) } func newAccountClient(rancherClient *RancherClient) *AccountClient { @@ -90,9 +95,20 @@ func (c *AccountClient) Update(existing *Account, updates interface{}) (*Account func (c *AccountClient) List(opts *ListOpts) (*AccountCollection, error) { resp := &AccountCollection{} err := c.rancherClient.doList(ACCOUNT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *AccountCollection) Next() (*AccountCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &AccountCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *AccountClient) ById(id string) (*Account, error) { resp := &Account{} err := c.rancherClient.doById(ACCOUNT_TYPE, id, resp) @@ -170,3 +186,12 @@ func (c *AccountClient) ActionUpdate(resource *Account) (*Account, error) { return resp, err } + +func (c *AccountClient) ActionUpgrade(resource *Account) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(ACCOUNT_TYPE, "upgrade", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_active_setting.go b/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_active_setting.go rename to vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go index c8db847..b1799a3 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_active_setting.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go @@ -20,7 +20,8 @@ type ActiveSetting struct { type ActiveSettingCollection struct { Collection - Data []ActiveSetting `json:"data,omitempty"` + Data []ActiveSetting `json:"data,omitempty"` + client *ActiveSettingClient } type ActiveSettingClient struct { @@ -56,9 +57,20 @@ func (c *ActiveSettingClient) Update(existing *ActiveSetting, updates interface{ func (c *ActiveSettingClient) List(opts *ListOpts) (*ActiveSettingCollection, error) { resp := &ActiveSettingCollection{} err := c.rancherClient.doList(ACTIVE_SETTING_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ActiveSettingCollection) Next() (*ActiveSettingCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ActiveSettingCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ActiveSettingClient) ById(id string) (*ActiveSetting, error) { resp := &ActiveSetting{} err := c.rancherClient.doById(ACTIVE_SETTING_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_add_outputs_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_add_outputs_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go index b2d51c7..88bf4a7 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_add_outputs_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go @@ -12,7 +12,8 @@ type AddOutputsInput struct { type AddOutputsInputCollection struct { Collection - Data []AddOutputsInput `json:"data,omitempty"` + Data []AddOutputsInput `json:"data,omitempty"` + client *AddOutputsInputClient } type AddOutputsInputClient struct { @@ -48,9 +49,20 @@ func (c *AddOutputsInputClient) Update(existing *AddOutputsInput, updates interf func (c *AddOutputsInputClient) List(opts *ListOpts) (*AddOutputsInputCollection, error) { resp := &AddOutputsInputCollection{} err := c.rancherClient.doList(ADD_OUTPUTS_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *AddOutputsInputCollection) Next() (*AddOutputsInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &AddOutputsInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *AddOutputsInputClient) ById(id string) (*AddOutputsInput, error) { resp := &AddOutputsInput{} err := c.rancherClient.doById(ADD_OUTPUTS_INPUT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_service_link_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_add_remove_service_link_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go index 82c7d18..5366b48 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_service_link_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go @@ -12,7 +12,8 @@ type AddRemoveServiceLinkInput struct { type AddRemoveServiceLinkInputCollection struct { Collection - Data []AddRemoveServiceLinkInput `json:"data,omitempty"` + Data []AddRemoveServiceLinkInput `json:"data,omitempty"` + client *AddRemoveServiceLinkInputClient } type AddRemoveServiceLinkInputClient struct { @@ -48,9 +49,20 @@ func (c *AddRemoveServiceLinkInputClient) Update(existing *AddRemoveServiceLinkI func (c *AddRemoveServiceLinkInputClient) List(opts *ListOpts) (*AddRemoveServiceLinkInputCollection, error) { resp := &AddRemoveServiceLinkInputCollection{} err := c.rancherClient.doList(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *AddRemoveServiceLinkInputCollection) Next() (*AddRemoveServiceLinkInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &AddRemoveServiceLinkInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *AddRemoveServiceLinkInputClient) ById(id string) (*AddRemoveServiceLinkInput, error) { resp := &AddRemoveServiceLinkInput{} err := c.rancherClient.doById(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_agent.go b/vendor/github.com/rancher/go-rancher/v2/generated_agent.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_agent.go rename to vendor/github.com/rancher/go-rancher/v2/generated_agent.go index 557ca61..05309d3 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_agent.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_agent.go @@ -40,7 +40,8 @@ type Agent struct { type AgentCollection struct { Collection - Data []Agent `json:"data,omitempty"` + Data []Agent `json:"data,omitempty"` + client *AgentClient } type AgentClient struct { @@ -60,6 +61,10 @@ type AgentOperations interface { ActionDeactivate(*Agent) (*Agent, error) + ActionDisconnect(*Agent) (*Agent, error) + + ActionFinishreconnect(*Agent) (*Agent, error) + ActionPurge(*Agent) (*Agent, error) ActionReconnect(*Agent) (*Agent, error) @@ -92,9 +97,20 @@ func (c *AgentClient) Update(existing *Agent, updates interface{}) (*Agent, erro func (c *AgentClient) List(opts *ListOpts) (*AgentCollection, error) { resp := &AgentCollection{} err := c.rancherClient.doList(AGENT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *AgentCollection) Next() (*AgentCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &AgentCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *AgentClient) ById(id string) (*Agent, error) { resp := &Agent{} err := c.rancherClient.doById(AGENT_TYPE, id, resp) @@ -137,6 +153,24 @@ func (c *AgentClient) ActionDeactivate(resource *Agent) (*Agent, error) { 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) ActionFinishreconnect(resource *Agent) (*Agent, error) { + + resp := &Agent{} + + err := c.rancherClient.doAction(AGENT_TYPE, "finishreconnect", &resource.Resource, nil, resp) + + return resp, err +} + func (c *AgentClient) ActionPurge(resource *Agent) (*Agent, error) { resp := &Agent{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_amazonec2config.go b/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go similarity index 70% rename from vendor/github.com/rancher/go-rancher/client/generated_amazonec2config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go index 8306f1f..80be6ab 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_amazonec2config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go @@ -11,34 +11,54 @@ type Amazonec2Config struct { Ami string `json:"ami,omitempty" yaml:"ami,omitempty"` + DeviceName string `json:"deviceName,omitempty" yaml:"device_name,omitempty"` + + Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` + IamInstanceProfile string `json:"iamInstanceProfile,omitempty" yaml:"iam_instance_profile,omitempty"` + InsecureTransport bool `json:"insecureTransport,omitempty" yaml:"insecure_transport,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"` + OpenPort []string `json:"openPort,omitempty" yaml:"open_port,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"` + 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"` @@ -46,7 +66,8 @@ type Amazonec2Config struct { type Amazonec2ConfigCollection struct { Collection - Data []Amazonec2Config `json:"data,omitempty"` + Data []Amazonec2Config `json:"data,omitempty"` + client *Amazonec2ConfigClient } type Amazonec2ConfigClient struct { @@ -82,9 +103,20 @@ func (c *Amazonec2ConfigClient) Update(existing *Amazonec2Config, updates interf func (c *Amazonec2ConfigClient) List(opts *ListOpts) (*Amazonec2ConfigCollection, error) { resp := &Amazonec2ConfigCollection{} err := c.rancherClient.doList(AMAZONEC2CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *Amazonec2ConfigCollection) Next() (*Amazonec2ConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &Amazonec2ConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *Amazonec2ConfigClient) ById(id string) (*Amazonec2Config, error) { resp := &Amazonec2Config{} err := c.rancherClient.doById(AMAZONEC2CONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_api_key.go b/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go similarity index 91% rename from vendor/github.com/rancher/go-rancher/client/generated_api_key.go rename to vendor/github.com/rancher/go-rancher/v2/generated_api_key.go index c0f9c50..91dc09d 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_api_key.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go @@ -40,7 +40,8 @@ type ApiKey struct { type ApiKeyCollection struct { Collection - Data []ApiKey `json:"data,omitempty"` + Data []ApiKey `json:"data,omitempty"` + client *ApiKeyClient } type ApiKeyClient struct { @@ -88,9 +89,20 @@ func (c *ApiKeyClient) Update(existing *ApiKey, updates interface{}) (*ApiKey, e func (c *ApiKeyClient) List(opts *ListOpts) (*ApiKeyCollection, error) { resp := &ApiKeyCollection{} err := c.rancherClient.doList(API_KEY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ApiKeyCollection) Next() (*ApiKeyCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ApiKeyCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ApiKeyClient) ById(id string) (*ApiKey, error) { resp := &ApiKey{} err := c.rancherClient.doById(API_KEY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_audit_log.go b/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go similarity index 87% rename from vendor/github.com/rancher/go-rancher/client/generated_audit_log.go rename to vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go index d8ff08f..1c9d4ae 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_audit_log.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go @@ -38,7 +38,8 @@ type AuditLog struct { type AuditLogCollection struct { Collection - Data []AuditLog `json:"data,omitempty"` + Data []AuditLog `json:"data,omitempty"` + client *AuditLogClient } type AuditLogClient struct { @@ -74,9 +75,20 @@ func (c *AuditLogClient) Update(existing *AuditLog, updates interface{}) (*Audit func (c *AuditLogClient) List(opts *ListOpts) (*AuditLogCollection, error) { resp := &AuditLogCollection{} err := c.rancherClient.doList(AUDIT_LOG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *AuditLogCollection) Next() (*AuditLogCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &AuditLogCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *AuditLogClient) ById(id string) (*AuditLog, error) { resp := &AuditLog{} err := c.rancherClient.doById(AUDIT_LOG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_azure_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go similarity index 54% rename from vendor/github.com/rancher/go-rancher/client/generated_azure_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go index afe230f..12d1b30 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_azure_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go @@ -7,32 +7,55 @@ 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"` + + Dns string `json:"dns,omitempty" yaml:"dns,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"` - PublishSettingsFile string `json:"publishSettingsFile,omitempty" yaml:"publish_settings_file,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"` - SshPort string `json:"sshPort,omitempty" yaml:"ssh_port,omitempty"` + SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` - SubscriptionCert string `json:"subscriptionCert,omitempty" yaml:"subscription_cert,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"` - 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 { Collection - Data []AzureConfig `json:"data,omitempty"` + Data []AzureConfig `json:"data,omitempty"` + client *AzureConfigClient } type AzureConfigClient struct { @@ -68,9 +91,20 @@ func (c *AzureConfigClient) Update(existing *AzureConfig, updates interface{}) ( func (c *AzureConfigClient) List(opts *ListOpts) (*AzureConfigCollection, error) { resp := &AzureConfigCollection{} err := c.rancherClient.doList(AZURE_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *AzureConfigCollection) Next() (*AzureConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &AzureConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *AzureConfigClient) ById(id string) (*AzureConfig, error) { resp := &AzureConfig{} err := c.rancherClient.doById(AZURE_CONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_azureadconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go similarity index 85% rename from vendor/github.com/rancher/go-rancher/client/generated_azureadconfig.go rename to vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go index fe741e2..5b3117f 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_azureadconfig.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go @@ -26,7 +26,8 @@ type Azureadconfig struct { type AzureadconfigCollection struct { Collection - Data []Azureadconfig `json:"data,omitempty"` + Data []Azureadconfig `json:"data,omitempty"` + client *AzureadconfigClient } type AzureadconfigClient struct { @@ -62,9 +63,20 @@ func (c *AzureadconfigClient) Update(existing *Azureadconfig, updates interface{ func (c *AzureadconfigClient) List(opts *ListOpts) (*AzureadconfigCollection, error) { resp := &AzureadconfigCollection{} err := c.rancherClient.doList(AZUREADCONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *AzureadconfigCollection) Next() (*AzureadconfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &AzureadconfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *AzureadconfigClient) ById(id string) (*Azureadconfig, error) { resp := &Azureadconfig{} err := c.rancherClient.doById(AZUREADCONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_backup.go b/vendor/github.com/rancher/go-rancher/v2/generated_backup.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_backup.go rename to vendor/github.com/rancher/go-rancher/v2/generated_backup.go index 237194c..755605e 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_backup.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_backup.go @@ -44,7 +44,8 @@ type Backup struct { type BackupCollection struct { Collection - Data []Backup `json:"data,omitempty"` + Data []Backup `json:"data,omitempty"` + client *BackupClient } type BackupClient struct { @@ -84,9 +85,20 @@ func (c *BackupClient) Update(existing *Backup, updates interface{}) (*Backup, e func (c *BackupClient) List(opts *ListOpts) (*BackupCollection, error) { resp := &BackupCollection{} err := c.rancherClient.doList(BACKUP_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *BackupCollection) Next() (*BackupCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &BackupCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *BackupClient) ById(id string) (*Backup, error) { resp := &Backup{} err := c.rancherClient.doById(BACKUP_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_backup_target.go b/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_backup_target.go rename to vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go index c93d615..a00f2bc 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_backup_target.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go @@ -38,7 +38,8 @@ type BackupTarget struct { type BackupTargetCollection struct { Collection - Data []BackupTarget `json:"data,omitempty"` + Data []BackupTarget `json:"data,omitempty"` + client *BackupTargetClient } type BackupTargetClient struct { @@ -78,9 +79,20 @@ func (c *BackupTargetClient) Update(existing *BackupTarget, updates interface{}) func (c *BackupTargetClient) List(opts *ListOpts) (*BackupTargetCollection, error) { resp := &BackupTargetCollection{} err := c.rancherClient.doList(BACKUP_TARGET_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *BackupTargetCollection) Next() (*BackupTargetCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &BackupTargetCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *BackupTargetClient) ById(id string) (*BackupTarget, error) { resp := &BackupTarget{} err := c.rancherClient.doById(BACKUP_TARGET_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_base_machine_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go similarity index 81% rename from vendor/github.com/rancher/go-rancher/client/generated_base_machine_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go index a019342..0c0112d 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_base_machine_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go @@ -10,7 +10,8 @@ type BaseMachineConfig struct { type BaseMachineConfigCollection struct { Collection - Data []BaseMachineConfig `json:"data,omitempty"` + Data []BaseMachineConfig `json:"data,omitempty"` + client *BaseMachineConfigClient } type BaseMachineConfigClient struct { @@ -46,9 +47,20 @@ func (c *BaseMachineConfigClient) Update(existing *BaseMachineConfig, updates in func (c *BaseMachineConfigClient) List(opts *ListOpts) (*BaseMachineConfigCollection, error) { resp := &BaseMachineConfigCollection{} err := c.rancherClient.doList(BASE_MACHINE_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *BaseMachineConfigCollection) Next() (*BaseMachineConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &BaseMachineConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *BaseMachineConfigClient) ById(id string) (*BaseMachineConfig, error) { resp := &BaseMachineConfig{} err := c.rancherClient.doById(BASE_MACHINE_CONFIG_TYPE, id, resp) 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 0000000..9cb4e17 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_binding.go @@ -0,0 +1,79 @@ +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"` + client *BindingClient +} + +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) + resp.client = c + return resp, err +} + +func (cc *BindingCollection) Next() (*BindingCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &BindingCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +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/client/generated_blkio_device_option.go b/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go similarity index 84% rename from vendor/github.com/rancher/go-rancher/client/generated_blkio_device_option.go rename to vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go index 4d00522..bc33c7c 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_blkio_device_option.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go @@ -20,7 +20,8 @@ type BlkioDeviceOption struct { type BlkioDeviceOptionCollection struct { Collection - Data []BlkioDeviceOption `json:"data,omitempty"` + Data []BlkioDeviceOption `json:"data,omitempty"` + client *BlkioDeviceOptionClient } type BlkioDeviceOptionClient struct { @@ -56,9 +57,20 @@ func (c *BlkioDeviceOptionClient) Update(existing *BlkioDeviceOption, updates in func (c *BlkioDeviceOptionClient) List(opts *ListOpts) (*BlkioDeviceOptionCollection, error) { resp := &BlkioDeviceOptionCollection{} err := c.rancherClient.doList(BLKIO_DEVICE_OPTION_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *BlkioDeviceOptionCollection) Next() (*BlkioDeviceOptionCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &BlkioDeviceOptionCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *BlkioDeviceOptionClient) ById(id string) (*BlkioDeviceOption, error) { resp := &BlkioDeviceOption{} err := c.rancherClient.doById(BLKIO_DEVICE_OPTION_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go new file mode 100644 index 0000000..67d073e --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go @@ -0,0 +1,93 @@ +package client + +const ( + CATALOG_TEMPLATE_TYPE = "catalogTemplate" +) + +type CatalogTemplate struct { + Resource + + Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` + + Binding Binding `json:"binding,omitempty" yaml:"binding,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` + + TemplateId string `json:"templateId,omitempty" yaml:"template_id,omitempty"` + + TemplateVersionId string `json:"templateVersionId,omitempty" yaml:"template_version_id,omitempty"` +} + +type CatalogTemplateCollection struct { + Collection + Data []CatalogTemplate `json:"data,omitempty"` + client *CatalogTemplateClient +} + +type CatalogTemplateClient struct { + rancherClient *RancherClient +} + +type CatalogTemplateOperations interface { + List(opts *ListOpts) (*CatalogTemplateCollection, error) + Create(opts *CatalogTemplate) (*CatalogTemplate, error) + Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) + ById(id string) (*CatalogTemplate, error) + Delete(container *CatalogTemplate) error +} + +func newCatalogTemplateClient(rancherClient *RancherClient) *CatalogTemplateClient { + return &CatalogTemplateClient{ + rancherClient: rancherClient, + } +} + +func (c *CatalogTemplateClient) Create(container *CatalogTemplate) (*CatalogTemplate, error) { + resp := &CatalogTemplate{} + err := c.rancherClient.doCreate(CATALOG_TEMPLATE_TYPE, container, resp) + return resp, err +} + +func (c *CatalogTemplateClient) Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) { + resp := &CatalogTemplate{} + err := c.rancherClient.doUpdate(CATALOG_TEMPLATE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *CatalogTemplateClient) List(opts *ListOpts) (*CatalogTemplateCollection, error) { + resp := &CatalogTemplateCollection{} + err := c.rancherClient.doList(CATALOG_TEMPLATE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *CatalogTemplateCollection) Next() (*CatalogTemplateCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &CatalogTemplateCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *CatalogTemplateClient) ById(id string) (*CatalogTemplate, error) { + resp := &CatalogTemplate{} + err := c.rancherClient.doById(CATALOG_TEMPLATE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *CatalogTemplateClient) Delete(container *CatalogTemplate) error { + return c.rancherClient.doResourceDelete(CATALOG_TEMPLATE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_certificate.go b/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go similarity index 91% rename from vendor/github.com/rancher/go-rancher/client/generated_certificate.go rename to vendor/github.com/rancher/go-rancher/v2/generated_certificate.go index 02f99e3..fc407e8 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_certificate.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go @@ -62,7 +62,8 @@ type Certificate struct { type CertificateCollection struct { Collection - Data []Certificate `json:"data,omitempty"` + Data []Certificate `json:"data,omitempty"` + client *CertificateClient } type CertificateClient struct { @@ -104,9 +105,20 @@ func (c *CertificateClient) Update(existing *Certificate, updates interface{}) ( func (c *CertificateClient) List(opts *ListOpts) (*CertificateCollection, error) { resp := &CertificateCollection{} err := c.rancherClient.doList(CERTIFICATE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *CertificateCollection) Next() (*CertificateCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &CertificateCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *CertificateClient) ById(id string) (*Certificate, error) { resp := &Certificate{} err := c.rancherClient.doById(CERTIFICATE_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_change_secret_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_change_secret_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go index 913c2ee..3f86681 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_change_secret_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go @@ -14,7 +14,8 @@ type ChangeSecretInput struct { type ChangeSecretInputCollection struct { Collection - Data []ChangeSecretInput `json:"data,omitempty"` + Data []ChangeSecretInput `json:"data,omitempty"` + client *ChangeSecretInputClient } type ChangeSecretInputClient struct { @@ -50,9 +51,20 @@ func (c *ChangeSecretInputClient) Update(existing *ChangeSecretInput, updates in func (c *ChangeSecretInputClient) List(opts *ListOpts) (*ChangeSecretInputCollection, error) { resp := &ChangeSecretInputCollection{} err := c.rancherClient.doList(CHANGE_SECRET_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ChangeSecretInputCollection) Next() (*ChangeSecretInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ChangeSecretInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ChangeSecretInputClient) ById(id string) (*ChangeSecretInput, error) { resp := &ChangeSecretInput{} err := c.rancherClient.doById(CHANGE_SECRET_INPUT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_client.go b/vendor/github.com/rancher/go-rancher/v2/generated_client.go similarity index 80% rename from vendor/github.com/rancher/go-rancher/client/generated_client.go rename to vendor/github.com/rancher/go-rancher/v2/generated_client.go index a5381d4..789622b 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_client.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_client.go @@ -6,18 +6,22 @@ type RancherClient struct { 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 + CatalogTemplate CatalogTemplateOperations Certificate CertificateOperations ChangeSecretInput ChangeSecretInputOperations + ClusterMembership ClusterMembershipOperations ComposeConfig ComposeConfigOperations ComposeConfigInput ComposeConfigInputOperations ComposeProject ComposeProjectOperations @@ -32,11 +36,11 @@ type RancherClient struct { Credential CredentialOperations Databasechangelog DatabasechangelogOperations Databasechangeloglock DatabasechangeloglockOperations + DefaultNetwork DefaultNetworkOperations + DigitaloceanConfig DigitaloceanConfigOperations DnsService DnsServiceOperations DockerBuild DockerBuildOperations DynamicSchema DynamicSchemaOperations - Environment EnvironmentOperations - EnvironmentUpgrade EnvironmentUpgradeOperations ExtensionImplementation ExtensionImplementationOperations ExtensionPoint ExtensionPointOperations ExternalDnsEvent ExternalDnsEventOperations @@ -51,10 +55,9 @@ type RancherClient struct { ExternalStoragePoolEvent ExternalStoragePoolEventOperations ExternalVolumeEvent ExternalVolumeEventOperations FieldDocumentation FieldDocumentationOperations - Githubconfig GithubconfigOperations + GenericObject GenericObjectOperations HaConfig HaConfigOperations HaConfigInput HaConfigInputOperations - HaproxyConfig HaproxyConfigOperations HealthcheckInstanceHostMap HealthcheckInstanceHostMapOperations Host HostOperations HostAccess HostAccessOperations @@ -69,32 +72,38 @@ type RancherClient struct { InstanceLink InstanceLinkOperations InstanceStop InstanceStopOperations IpAddress IpAddressOperations - IpAddressAssociateInput IpAddressAssociateInputOperations KubernetesService KubernetesServiceOperations + KubernetesStack KubernetesStackOperations + KubernetesStackUpgrade KubernetesStackUpgradeOperations Label LabelOperations LaunchConfig LaunchConfigOperations + LbConfig LbConfigOperations + LbTargetConfig LbTargetConfigOperations Ldapconfig LdapconfigOperations - LoadBalancerAppCookieStickinessPolicy LoadBalancerAppCookieStickinessPolicyOperations - LoadBalancerConfig LoadBalancerConfigOperations LoadBalancerCookieStickinessPolicy LoadBalancerCookieStickinessPolicyOperations LoadBalancerService LoadBalancerServiceOperations - LoadBalancerServiceLink LoadBalancerServiceLinkOperations LocalAuthConfig LocalAuthConfigOperations LogConfig LogConfigOperations Machine MachineOperations MachineDriver MachineDriverOperations Mount MountOperations + MountEntry MountEntryOperations Network NetworkOperations + NetworkDriver NetworkDriverOperations + NetworkDriverService NetworkDriverServiceOperations NfsConfig NfsConfigOperations Openldapconfig OpenldapconfigOperations + PacketConfig PacketConfigOperations Password PasswordOperations PhysicalHost PhysicalHostOperations Port PortOperations + PortRule PortRuleOperations ProcessDefinition ProcessDefinitionOperations ProcessExecution ProcessExecutionOperations ProcessInstance ProcessInstanceOperations Project ProjectOperations ProjectMember ProjectMemberOperations + ProjectTemplate ProjectTemplateOperations PublicEndpoint PublicEndpointOperations Publish PublishOperations PullTask PullTaskOperations @@ -111,58 +120,69 @@ type RancherClient struct { 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 + StorageDriver StorageDriverOperations + StorageDriverService StorageDriverServiceOperations StoragePool StoragePoolOperations + Subnet SubnetOperations Subscribe SubscribeOperations + TargetPortRule TargetPortRuleOperations Task TaskOperations TaskInstance TaskInstanceOperations ToServiceUpgradeStrategy ToServiceUpgradeStrategyOperations TypeDocumentation TypeDocumentationOperations + Ulimit UlimitOperations VirtualMachine VirtualMachineOperations VirtualMachineDisk VirtualMachineDiskOperations Volume VolumeOperations + VolumeActivateInput VolumeActivateInputOperations VolumeSnapshotInput VolumeSnapshotInputOperations + VolumeTemplate VolumeTemplateOperations } -func constructClient() *RancherClient { +func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient { client := &RancherClient{ - RancherBaseClient: RancherBaseClient{ - Types: map[string]Schema{}, - }, + RancherBaseClient: rancherBaseClient, } 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.CatalogTemplate = newCatalogTemplateClient(client) client.Certificate = newCertificateClient(client) client.ChangeSecretInput = newChangeSecretInputClient(client) + client.ClusterMembership = newClusterMembershipClient(client) client.ComposeConfig = newComposeConfigClient(client) client.ComposeConfigInput = newComposeConfigInputClient(client) client.ComposeProject = newComposeProjectClient(client) @@ -177,11 +197,11 @@ func constructClient() *RancherClient { client.Credential = newCredentialClient(client) client.Databasechangelog = newDatabasechangelogClient(client) client.Databasechangeloglock = newDatabasechangeloglockClient(client) + client.DefaultNetwork = newDefaultNetworkClient(client) + client.DigitaloceanConfig = newDigitaloceanConfigClient(client) client.DnsService = newDnsServiceClient(client) client.DockerBuild = newDockerBuildClient(client) client.DynamicSchema = newDynamicSchemaClient(client) - client.Environment = newEnvironmentClient(client) - client.EnvironmentUpgrade = newEnvironmentUpgradeClient(client) client.ExtensionImplementation = newExtensionImplementationClient(client) client.ExtensionPoint = newExtensionPointClient(client) client.ExternalDnsEvent = newExternalDnsEventClient(client) @@ -196,10 +216,9 @@ func constructClient() *RancherClient { client.ExternalStoragePoolEvent = newExternalStoragePoolEventClient(client) client.ExternalVolumeEvent = newExternalVolumeEventClient(client) client.FieldDocumentation = newFieldDocumentationClient(client) - client.Githubconfig = newGithubconfigClient(client) + client.GenericObject = newGenericObjectClient(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) @@ -214,32 +233,38 @@ func constructClient() *RancherClient { 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.LbConfig = newLbConfigClient(client) + client.LbTargetConfig = newLbTargetConfigClient(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.MountEntry = newMountEntryClient(client) client.Network = newNetworkClient(client) + client.NetworkDriver = newNetworkDriverClient(client) + client.NetworkDriverService = newNetworkDriverServiceClient(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.PortRule = newPortRuleClient(client) client.ProcessDefinition = newProcessDefinitionClient(client) client.ProcessExecution = newProcessExecutionClient(client) client.ProcessInstance = newProcessInstanceClient(client) client.Project = newProjectClient(client) client.ProjectMember = newProjectMemberClient(client) + client.ProjectTemplate = newProjectTemplateClient(client) client.PublicEndpoint = newPublicEndpointClient(client) client.Publish = newPublishClient(client) client.PullTask = newPullTaskClient(client) @@ -256,42 +281,54 @@ func constructClient() *RancherClient { 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.StorageDriver = newStorageDriverClient(client) + client.StorageDriverService = newStorageDriverServiceClient(client) client.StoragePool = newStoragePoolClient(client) + client.Subnet = newSubnetClient(client) client.Subscribe = newSubscribeClient(client) + client.TargetPortRule = newTargetPortRuleClient(client) client.Task = newTaskClient(client) client.TaskInstance = newTaskInstanceClient(client) client.ToServiceUpgradeStrategy = newToServiceUpgradeStrategyClient(client) client.TypeDocumentation = newTypeDocumentationClient(client) + client.Ulimit = newUlimitClient(client) client.VirtualMachine = newVirtualMachineClient(client) client.VirtualMachineDisk = newVirtualMachineDiskClient(client) client.Volume = newVolumeClient(client) + client.VolumeActivateInput = newVolumeActivateInputClient(client) client.VolumeSnapshotInput = newVolumeSnapshotInputClient(client) + client.VolumeTemplate = newVolumeTemplateClient(client) return client } func NewRancherClient(opts *ClientOpts) (*RancherClient, error) { - client := constructClient() + rancherBaseClient := &RancherBaseClientImpl{ + Types: map[string]Schema{}, + } + client := constructClient(rancherBaseClient) - err := setupRancherBaseClient(&client.RancherBaseClient, opts) + err := setupRancherBaseClient(rancherBaseClient, opts) if err != nil { return nil, err } diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go b/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go new file mode 100644 index 0000000..f584863 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go @@ -0,0 +1,87 @@ +package client + +const ( + CLUSTER_MEMBERSHIP_TYPE = "clusterMembership" +) + +type ClusterMembership struct { + Resource + + Clustered bool `json:"clustered,omitempty" yaml:"clustered,omitempty"` + + Config string `json:"config,omitempty" yaml:"config,omitempty"` + + Heartbeat int64 `json:"heartbeat,omitempty" yaml:"heartbeat,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ClusterMembershipCollection struct { + Collection + Data []ClusterMembership `json:"data,omitempty"` + client *ClusterMembershipClient +} + +type ClusterMembershipClient struct { + rancherClient *RancherClient +} + +type ClusterMembershipOperations interface { + List(opts *ListOpts) (*ClusterMembershipCollection, error) + Create(opts *ClusterMembership) (*ClusterMembership, error) + Update(existing *ClusterMembership, updates interface{}) (*ClusterMembership, error) + ById(id string) (*ClusterMembership, error) + Delete(container *ClusterMembership) error +} + +func newClusterMembershipClient(rancherClient *RancherClient) *ClusterMembershipClient { + return &ClusterMembershipClient{ + rancherClient: rancherClient, + } +} + +func (c *ClusterMembershipClient) Create(container *ClusterMembership) (*ClusterMembership, error) { + resp := &ClusterMembership{} + err := c.rancherClient.doCreate(CLUSTER_MEMBERSHIP_TYPE, container, resp) + return resp, err +} + +func (c *ClusterMembershipClient) Update(existing *ClusterMembership, updates interface{}) (*ClusterMembership, error) { + resp := &ClusterMembership{} + err := c.rancherClient.doUpdate(CLUSTER_MEMBERSHIP_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ClusterMembershipClient) List(opts *ListOpts) (*ClusterMembershipCollection, error) { + resp := &ClusterMembershipCollection{} + err := c.rancherClient.doList(CLUSTER_MEMBERSHIP_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *ClusterMembershipCollection) Next() (*ClusterMembershipCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ClusterMembershipCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *ClusterMembershipClient) ById(id string) (*ClusterMembership, error) { + resp := &ClusterMembership{} + err := c.rancherClient.doById(CLUSTER_MEMBERSHIP_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ClusterMembershipClient) Delete(container *ClusterMembership) error { + return c.rancherClient.doResourceDelete(CLUSTER_MEMBERSHIP_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_compose_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_compose_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go index 49ee5ba..b9bc013 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_compose_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go @@ -14,7 +14,8 @@ type ComposeConfig struct { type ComposeConfigCollection struct { Collection - Data []ComposeConfig `json:"data,omitempty"` + Data []ComposeConfig `json:"data,omitempty"` + client *ComposeConfigClient } type ComposeConfigClient struct { @@ -50,9 +51,20 @@ func (c *ComposeConfigClient) Update(existing *ComposeConfig, updates interface{ func (c *ComposeConfigClient) List(opts *ListOpts) (*ComposeConfigCollection, error) { resp := &ComposeConfigCollection{} err := c.rancherClient.doList(COMPOSE_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ComposeConfigCollection) Next() (*ComposeConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ComposeConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ComposeConfigClient) ById(id string) (*ComposeConfig, error) { resp := &ComposeConfig{} err := c.rancherClient.doById(COMPOSE_CONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_compose_config_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_compose_config_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go index e0cdc76..3d03d92 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_compose_config_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go @@ -12,7 +12,8 @@ type ComposeConfigInput struct { type ComposeConfigInputCollection struct { Collection - Data []ComposeConfigInput `json:"data,omitempty"` + Data []ComposeConfigInput `json:"data,omitempty"` + client *ComposeConfigInputClient } type ComposeConfigInputClient struct { @@ -48,9 +49,20 @@ func (c *ComposeConfigInputClient) Update(existing *ComposeConfigInput, updates func (c *ComposeConfigInputClient) List(opts *ListOpts) (*ComposeConfigInputCollection, error) { resp := &ComposeConfigInputCollection{} err := c.rancherClient.doList(COMPOSE_CONFIG_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ComposeConfigInputCollection) Next() (*ComposeConfigInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ComposeConfigInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ComposeConfigInputClient) ById(id string) (*ComposeConfigInput, error) { resp := &ComposeConfigInput{} err := c.rancherClient.doById(COMPOSE_CONFIG_INPUT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_compose_project.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go similarity index 78% rename from vendor/github.com/rancher/go-rancher/client/generated_compose_project.go rename to vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go index 7d41efa..d64e032 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_compose_project.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go @@ -9,6 +9,8 @@ type ComposeProject struct { 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"` @@ -19,6 +21,8 @@ type ComposeProject struct { ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + Group string `json:"group,omitempty" yaml:"group,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` @@ -33,8 +37,12 @@ type ComposeProject struct { Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` @@ -48,7 +56,8 @@ type ComposeProject struct { type ComposeProjectCollection struct { Collection - Data []ComposeProject `json:"data,omitempty"` + Data []ComposeProject `json:"data,omitempty"` + client *ComposeProjectClient } type ComposeProjectClient struct { @@ -62,19 +71,17 @@ type ComposeProjectOperations interface { ById(id string) (*ComposeProject, error) Delete(container *ComposeProject) error - ActionCancelrollback(*ComposeProject) (*Environment, error) + ActionCancelupgrade(*ComposeProject) (*Stack, error) - ActionCancelupgrade(*ComposeProject) (*Environment, error) + ActionCreate(*ComposeProject) (*Stack, error) - ActionCreate(*ComposeProject) (*Environment, error) + ActionError(*ComposeProject) (*Stack, error) - ActionError(*ComposeProject) (*Environment, error) + ActionFinishupgrade(*ComposeProject) (*Stack, error) - ActionFinishupgrade(*ComposeProject) (*Environment, error) + ActionRemove(*ComposeProject) (*Stack, error) - ActionRemove(*ComposeProject) (*Environment, error) - - ActionRollback(*ComposeProject) (*Environment, error) + ActionRollback(*ComposeProject) (*Stack, error) } func newComposeProjectClient(rancherClient *RancherClient) *ComposeProjectClient { @@ -98,9 +105,20 @@ func (c *ComposeProjectClient) Update(existing *ComposeProject, updates interfac func (c *ComposeProjectClient) List(opts *ListOpts) (*ComposeProjectCollection, error) { resp := &ComposeProjectCollection{} err := c.rancherClient.doList(COMPOSE_PROJECT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ComposeProjectCollection) Next() (*ComposeProjectCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ComposeProjectCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ComposeProjectClient) ById(id string) (*ComposeProject, error) { resp := &ComposeProject{} err := c.rancherClient.doById(COMPOSE_PROJECT_TYPE, id, resp) @@ -116,63 +134,54 @@ func (c *ComposeProjectClient) Delete(container *ComposeProject) error { return c.rancherClient.doResourceDelete(COMPOSE_PROJECT_TYPE, &container.Resource) } -func (c *ComposeProjectClient) ActionCancelrollback(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionCancelupgrade(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionCancelupgrade(resource *ComposeProject) (*Environment, error) { - - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "cancelupgrade", &resource.Resource, nil, resp) return resp, err } -func (c *ComposeProjectClient) ActionCreate(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionCreate(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "create", &resource.Resource, nil, resp) return resp, err } -func (c *ComposeProjectClient) ActionError(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionError(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "error", &resource.Resource, nil, resp) return resp, err } -func (c *ComposeProjectClient) ActionFinishupgrade(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionFinishupgrade(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "finishupgrade", &resource.Resource, nil, resp) return resp, err } -func (c *ComposeProjectClient) ActionRemove(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionRemove(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "remove", &resource.Resource, nil, resp) return resp, err } -func (c *ComposeProjectClient) ActionRollback(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionRollback(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "rollback", &resource.Resource, nil, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_compose_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_compose_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go index e8511e0..ca7a297 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_compose_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go @@ -17,21 +17,23 @@ type ComposeService struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,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"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` - PublicEndpoints []interface{} `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -45,10 +47,14 @@ type ComposeService struct { 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"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -62,7 +68,8 @@ type ComposeService struct { type ComposeServiceCollection struct { Collection - Data []ComposeService `json:"data,omitempty"` + Data []ComposeService `json:"data,omitempty"` + client *ComposeServiceClient } type ComposeServiceClient struct { @@ -78,10 +85,10 @@ type ComposeServiceOperations interface { ActionActivate(*ComposeService) (*Service, error) - ActionCancelrollback(*ComposeService) (*Service, error) - ActionCancelupgrade(*ComposeService) (*Service, error) + ActionContinueupgrade(*ComposeService) (*Service, error) + ActionCreate(*ComposeService) (*Service, error) ActionFinishupgrade(*ComposeService) (*Service, error) @@ -112,9 +119,20 @@ func (c *ComposeServiceClient) Update(existing *ComposeService, updates interfac func (c *ComposeServiceClient) List(opts *ListOpts) (*ComposeServiceCollection, error) { resp := &ComposeServiceCollection{} err := c.rancherClient.doList(COMPOSE_SERVICE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ComposeServiceCollection) Next() (*ComposeServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ComposeServiceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ComposeServiceClient) ById(id string) (*ComposeService, error) { resp := &ComposeService{} err := c.rancherClient.doById(COMPOSE_SERVICE_TYPE, id, resp) @@ -139,15 +157,6 @@ func (c *ComposeServiceClient) ActionActivate(resource *ComposeService) (*Servic return resp, err } -func (c *ComposeServiceClient) ActionCancelrollback(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ComposeServiceClient) ActionCancelupgrade(resource *ComposeService) (*Service, error) { resp := &Service{} @@ -157,6 +166,15 @@ func (c *ComposeServiceClient) ActionCancelupgrade(resource *ComposeService) (*S 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{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_config_item.go b/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_config_item.go rename to vendor/github.com/rancher/go-rancher/v2/generated_config_item.go index 71e687d..b973066 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_config_item.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go @@ -14,7 +14,8 @@ type ConfigItem struct { type ConfigItemCollection struct { Collection - Data []ConfigItem `json:"data,omitempty"` + Data []ConfigItem `json:"data,omitempty"` + client *ConfigItemClient } type ConfigItemClient struct { @@ -50,9 +51,20 @@ func (c *ConfigItemClient) Update(existing *ConfigItem, updates interface{}) (*C func (c *ConfigItemClient) List(opts *ListOpts) (*ConfigItemCollection, error) { resp := &ConfigItemCollection{} err := c.rancherClient.doList(CONFIG_ITEM_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ConfigItemCollection) Next() (*ConfigItemCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ConfigItemCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ConfigItemClient) ById(id string) (*ConfigItem, error) { resp := &ConfigItem{} err := c.rancherClient.doById(CONFIG_ITEM_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_config_item_status.go b/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go similarity index 85% rename from vendor/github.com/rancher/go-rancher/client/generated_config_item_status.go rename to vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go index 0ffef35..2ce32ca 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_config_item_status.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go @@ -26,7 +26,8 @@ type ConfigItemStatus struct { type ConfigItemStatusCollection struct { Collection - Data []ConfigItemStatus `json:"data,omitempty"` + Data []ConfigItemStatus `json:"data,omitempty"` + client *ConfigItemStatusClient } type ConfigItemStatusClient struct { @@ -62,9 +63,20 @@ func (c *ConfigItemStatusClient) Update(existing *ConfigItemStatus, updates inte func (c *ConfigItemStatusClient) List(opts *ListOpts) (*ConfigItemStatusCollection, error) { resp := &ConfigItemStatusCollection{} err := c.rancherClient.doList(CONFIG_ITEM_STATUS_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ConfigItemStatusCollection) Next() (*ConfigItemStatusCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ConfigItemStatusCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ConfigItemStatusClient) ById(id string) (*ConfigItemStatus, error) { resp := &ConfigItemStatus{} err := c.rancherClient.doById(CONFIG_ITEM_STATUS_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_container.go b/vendor/github.com/rancher/go-rancher/v2/generated_container.go similarity index 77% rename from vendor/github.com/rancher/go-rancher/client/generated_container.go rename to vendor/github.com/rancher/go-rancher/v2/generated_container.go index a41dcf3..366ecc5 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_container.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_container.go @@ -15,18 +15,32 @@ type Container struct { BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,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"` + CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` + Command []string `json:"command,omitempty" yaml:"command,omitempty"` Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` + + CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` + + CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` + + CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` @@ -47,8 +61,12 @@ type Container struct { Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` + DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` + Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` @@ -65,10 +83,20 @@ type Container struct { FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` + + HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` + + HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` @@ -77,6 +105,22 @@ type Container struct { InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` + + IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` + + IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` + + Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` + + Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` + + IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` + + Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` + + KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` @@ -87,24 +131,42 @@ type Container struct { Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` + MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` + + MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` + + Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,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"` + OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` + + OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` + PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` + PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` + Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` @@ -123,6 +185,10 @@ type Container struct { SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + + ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` + StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` @@ -131,7 +197,15 @@ type Container struct { StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - SystemContainer string `json:"systemContainer,omitempty" yaml:"system_container,omitempty"` + StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` + + StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` + + Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,omitempty"` + + Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` Token string `json:"token,omitempty" yaml:"token,omitempty"` @@ -143,8 +217,14 @@ type Container struct { Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` + Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` + User string `json:"user,omitempty" yaml:"user,omitempty"` + UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` + + Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` Version string `json:"version,omitempty" yaml:"version,omitempty"` @@ -156,7 +236,8 @@ type Container struct { type ContainerCollection struct { Collection - Data []Container `json:"data,omitempty"` + Data []Container `json:"data,omitempty"` + client *ContainerClient } type ContainerClient struct { @@ -196,8 +277,6 @@ type ContainerOperations interface { ActionRestore(*Container) (*Instance, error) - ActionSetlabels(*Container, *SetLabelsInput) (*Container, error) - ActionStart(*Container) (*Instance, error) ActionStop(*Container, *InstanceStop) (*Instance, error) @@ -232,9 +311,20 @@ func (c *ContainerClient) Update(existing *Container, updates interface{}) (*Con func (c *ContainerClient) List(opts *ListOpts) (*ContainerCollection, error) { resp := &ContainerCollection{} err := c.rancherClient.doList(CONTAINER_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ContainerCollection) Next() (*ContainerCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ContainerCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ContainerClient) ById(id string) (*Container, error) { resp := &Container{} err := c.rancherClient.doById(CONTAINER_TYPE, id, resp) @@ -367,15 +457,6 @@ func (c *ContainerClient) ActionRestore(resource *Container) (*Instance, error) 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{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_container_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_container_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_container_event.go index 414030b..8b95651 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_container_event.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go @@ -40,7 +40,8 @@ type ContainerEvent struct { type ContainerEventCollection struct { Collection - Data []ContainerEvent `json:"data,omitempty"` + Data []ContainerEvent `json:"data,omitempty"` + client *ContainerEventClient } type ContainerEventClient struct { @@ -80,9 +81,20 @@ func (c *ContainerEventClient) Update(existing *ContainerEvent, updates interfac func (c *ContainerEventClient) List(opts *ListOpts) (*ContainerEventCollection, error) { resp := &ContainerEventCollection{} err := c.rancherClient.doList(CONTAINER_EVENT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ContainerEventCollection) Next() (*ContainerEventCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ContainerEventCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ContainerEventClient) ById(id string) (*ContainerEvent, error) { resp := &ContainerEvent{} err := c.rancherClient.doById(CONTAINER_EVENT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_container_exec.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_container_exec.go rename to vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go index c97f770..196199b 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_container_exec.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go @@ -18,7 +18,8 @@ type ContainerExec struct { type ContainerExecCollection struct { Collection - Data []ContainerExec `json:"data,omitempty"` + Data []ContainerExec `json:"data,omitempty"` + client *ContainerExecClient } type ContainerExecClient struct { @@ -54,9 +55,20 @@ func (c *ContainerExecClient) Update(existing *ContainerExec, updates interface{ func (c *ContainerExecClient) List(opts *ListOpts) (*ContainerExecCollection, error) { resp := &ContainerExecCollection{} err := c.rancherClient.doList(CONTAINER_EXEC_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ContainerExecCollection) Next() (*ContainerExecCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ContainerExecCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ContainerExecClient) ById(id string) (*ContainerExec, error) { resp := &ContainerExec{} err := c.rancherClient.doById(CONTAINER_EXEC_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_container_logs.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_container_logs.go rename to vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go index 4d37dab..2149df1 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_container_logs.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go @@ -14,7 +14,8 @@ type ContainerLogs struct { type ContainerLogsCollection struct { Collection - Data []ContainerLogs `json:"data,omitempty"` + Data []ContainerLogs `json:"data,omitempty"` + client *ContainerLogsClient } type ContainerLogsClient struct { @@ -50,9 +51,20 @@ func (c *ContainerLogsClient) Update(existing *ContainerLogs, updates interface{ func (c *ContainerLogsClient) List(opts *ListOpts) (*ContainerLogsCollection, error) { resp := &ContainerLogsCollection{} err := c.rancherClient.doList(CONTAINER_LOGS_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ContainerLogsCollection) Next() (*ContainerLogsCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ContainerLogsCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ContainerLogsClient) ById(id string) (*ContainerLogs, error) { resp := &ContainerLogs{} err := c.rancherClient.doById(CONTAINER_LOGS_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_container_proxy.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_container_proxy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go index 19bcfd5..84d7670 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_container_proxy.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go @@ -14,7 +14,8 @@ type ContainerProxy struct { type ContainerProxyCollection struct { Collection - Data []ContainerProxy `json:"data,omitempty"` + Data []ContainerProxy `json:"data,omitempty"` + client *ContainerProxyClient } type ContainerProxyClient struct { @@ -50,9 +51,20 @@ func (c *ContainerProxyClient) Update(existing *ContainerProxy, updates interfac func (c *ContainerProxyClient) List(opts *ListOpts) (*ContainerProxyCollection, error) { resp := &ContainerProxyCollection{} err := c.rancherClient.doList(CONTAINER_PROXY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ContainerProxyCollection) Next() (*ContainerProxyCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ContainerProxyCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ContainerProxyClient) ById(id string) (*ContainerProxy, error) { resp := &ContainerProxy{} err := c.rancherClient.doById(CONTAINER_PROXY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_credential.go b/vendor/github.com/rancher/go-rancher/v2/generated_credential.go similarity index 91% rename from vendor/github.com/rancher/go-rancher/client/generated_credential.go rename to vendor/github.com/rancher/go-rancher/v2/generated_credential.go index e1586db..f34a563 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_credential.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_credential.go @@ -40,7 +40,8 @@ type Credential struct { type CredentialCollection struct { Collection - Data []Credential `json:"data,omitempty"` + Data []Credential `json:"data,omitempty"` + client *CredentialClient } type CredentialClient struct { @@ -88,9 +89,20 @@ func (c *CredentialClient) Update(existing *Credential, updates interface{}) (*C func (c *CredentialClient) List(opts *ListOpts) (*CredentialCollection, error) { resp := &CredentialCollection{} err := c.rancherClient.doList(CREDENTIAL_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *CredentialCollection) Next() (*CredentialCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &CredentialCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *CredentialClient) ById(id string) (*Credential, error) { resp := &Credential{} err := c.rancherClient.doById(CREDENTIAL_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_databasechangelog.go b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go similarity index 86% rename from vendor/github.com/rancher/go-rancher/client/generated_databasechangelog.go rename to vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go index 63b3ca6..0d935f8 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_databasechangelog.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go @@ -30,7 +30,8 @@ type Databasechangelog struct { type DatabasechangelogCollection struct { Collection - Data []Databasechangelog `json:"data,omitempty"` + Data []Databasechangelog `json:"data,omitempty"` + client *DatabasechangelogClient } type DatabasechangelogClient struct { @@ -66,9 +67,20 @@ func (c *DatabasechangelogClient) Update(existing *Databasechangelog, updates in func (c *DatabasechangelogClient) List(opts *ListOpts) (*DatabasechangelogCollection, error) { resp := &DatabasechangelogCollection{} err := c.rancherClient.doList(DATABASECHANGELOG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *DatabasechangelogCollection) Next() (*DatabasechangelogCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &DatabasechangelogCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *DatabasechangelogClient) ById(id string) (*Databasechangelog, error) { resp := &Databasechangelog{} err := c.rancherClient.doById(DATABASECHANGELOG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_databasechangeloglock.go b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_databasechangeloglock.go rename to vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go index f01b7bb..a93c015 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_databasechangeloglock.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go @@ -16,7 +16,8 @@ type Databasechangeloglock struct { type DatabasechangeloglockCollection struct { Collection - Data []Databasechangeloglock `json:"data,omitempty"` + Data []Databasechangeloglock `json:"data,omitempty"` + client *DatabasechangeloglockClient } type DatabasechangeloglockClient struct { @@ -52,9 +53,20 @@ func (c *DatabasechangeloglockClient) Update(existing *Databasechangeloglock, up func (c *DatabasechangeloglockClient) List(opts *ListOpts) (*DatabasechangeloglockCollection, error) { resp := &DatabasechangeloglockCollection{} err := c.rancherClient.doList(DATABASECHANGELOGLOCK_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *DatabasechangeloglockCollection) Next() (*DatabasechangeloglockCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &DatabasechangeloglockCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *DatabasechangeloglockClient) ById(id string) (*Databasechangeloglock, error) { resp := &Databasechangeloglock{} err := c.rancherClient.doById(DATABASECHANGELOGLOCK_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go b/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go new file mode 100644 index 0000000..a7578d6 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go @@ -0,0 +1,190 @@ +package client + +const ( + DEFAULT_NETWORK_TYPE = "defaultNetwork" +) + +type DefaultNetwork 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"` + + Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` + + HostPorts bool `json:"hostPorts,omitempty" yaml:"host_ports,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,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"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Subnets []Subnet `json:"subnets,omitempty" yaml:"subnets,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 DefaultNetworkCollection struct { + Collection + Data []DefaultNetwork `json:"data,omitempty"` + client *DefaultNetworkClient +} + +type DefaultNetworkClient struct { + rancherClient *RancherClient +} + +type DefaultNetworkOperations interface { + List(opts *ListOpts) (*DefaultNetworkCollection, error) + Create(opts *DefaultNetwork) (*DefaultNetwork, error) + Update(existing *DefaultNetwork, updates interface{}) (*DefaultNetwork, error) + ById(id string) (*DefaultNetwork, error) + Delete(container *DefaultNetwork) error + + ActionActivate(*DefaultNetwork) (*Network, error) + + ActionCreate(*DefaultNetwork) (*Network, error) + + ActionDeactivate(*DefaultNetwork) (*Network, error) + + ActionPurge(*DefaultNetwork) (*Network, error) + + ActionRemove(*DefaultNetwork) (*Network, error) + + ActionRestore(*DefaultNetwork) (*Network, error) + + ActionUpdate(*DefaultNetwork) (*Network, error) +} + +func newDefaultNetworkClient(rancherClient *RancherClient) *DefaultNetworkClient { + return &DefaultNetworkClient{ + rancherClient: rancherClient, + } +} + +func (c *DefaultNetworkClient) Create(container *DefaultNetwork) (*DefaultNetwork, error) { + resp := &DefaultNetwork{} + err := c.rancherClient.doCreate(DEFAULT_NETWORK_TYPE, container, resp) + return resp, err +} + +func (c *DefaultNetworkClient) Update(existing *DefaultNetwork, updates interface{}) (*DefaultNetwork, error) { + resp := &DefaultNetwork{} + err := c.rancherClient.doUpdate(DEFAULT_NETWORK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *DefaultNetworkClient) List(opts *ListOpts) (*DefaultNetworkCollection, error) { + resp := &DefaultNetworkCollection{} + err := c.rancherClient.doList(DEFAULT_NETWORK_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *DefaultNetworkCollection) Next() (*DefaultNetworkCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &DefaultNetworkCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *DefaultNetworkClient) ById(id string) (*DefaultNetwork, error) { + resp := &DefaultNetwork{} + err := c.rancherClient.doById(DEFAULT_NETWORK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *DefaultNetworkClient) Delete(container *DefaultNetwork) error { + return c.rancherClient.doResourceDelete(DEFAULT_NETWORK_TYPE, &container.Resource) +} + +func (c *DefaultNetworkClient) ActionActivate(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DefaultNetworkClient) ActionCreate(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DefaultNetworkClient) ActionDeactivate(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DefaultNetworkClient) ActionPurge(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DefaultNetworkClient) ActionRemove(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DefaultNetworkClient) ActionRestore(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DefaultNetworkClient) ActionUpdate(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_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/v2/generated_digitalocean_config.go similarity index 78% rename from vendor/github.com/rancher/go-rancher/client/generated_digitalocean_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go index c30234b..6459757 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_digitalocean_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go @@ -21,12 +21,19 @@ 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"` + + Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` } type DigitaloceanConfigCollection struct { Collection - Data []DigitaloceanConfig `json:"data,omitempty"` + Data []DigitaloceanConfig `json:"data,omitempty"` + client *DigitaloceanConfigClient } type DigitaloceanConfigClient struct { @@ -62,9 +69,20 @@ func (c *DigitaloceanConfigClient) Update(existing *DigitaloceanConfig, updates func (c *DigitaloceanConfigClient) List(opts *ListOpts) (*DigitaloceanConfigCollection, error) { resp := &DigitaloceanConfigCollection{} err := c.rancherClient.doList(DIGITALOCEAN_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *DigitaloceanConfigCollection) Next() (*DigitaloceanConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &DigitaloceanConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *DigitaloceanConfigClient) ById(id string) (*DigitaloceanConfig, error) { resp := &DigitaloceanConfig{} err := c.rancherClient.doById(DIGITALOCEAN_CONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_dns_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go similarity index 88% rename from vendor/github.com/rancher/go-rancher/client/generated_dns_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go index 4ebfbc2..d554562 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_dns_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go @@ -17,18 +17,20 @@ type DnsService struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,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"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` @@ -41,10 +43,14 @@ type DnsService struct { 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"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -58,7 +64,8 @@ type DnsService struct { type DnsServiceCollection struct { Collection - Data []DnsService `json:"data,omitempty"` + Data []DnsService `json:"data,omitempty"` + client *DnsServiceClient } type DnsServiceClient struct { @@ -76,10 +83,10 @@ type DnsServiceOperations interface { ActionAddservicelink(*DnsService, *AddRemoveServiceLinkInput) (*Service, error) - ActionCancelrollback(*DnsService) (*Service, error) - ActionCancelupgrade(*DnsService) (*Service, error) + ActionContinueupgrade(*DnsService) (*Service, error) + ActionCreate(*DnsService) (*Service, error) ActionDeactivate(*DnsService) (*Service, error) @@ -122,9 +129,20 @@ func (c *DnsServiceClient) Update(existing *DnsService, updates interface{}) (*D func (c *DnsServiceClient) List(opts *ListOpts) (*DnsServiceCollection, error) { resp := &DnsServiceCollection{} err := c.rancherClient.doList(DNS_SERVICE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *DnsServiceCollection) Next() (*DnsServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &DnsServiceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *DnsServiceClient) ById(id string) (*DnsService, error) { resp := &DnsService{} err := c.rancherClient.doById(DNS_SERVICE_TYPE, id, resp) @@ -158,15 +176,6 @@ func (c *DnsServiceClient) ActionAddservicelink(resource *DnsService, input *Add return resp, err } -func (c *DnsServiceClient) ActionCancelrollback(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *DnsServiceClient) ActionCancelupgrade(resource *DnsService) (*Service, error) { resp := &Service{} @@ -176,6 +185,15 @@ func (c *DnsServiceClient) ActionCancelupgrade(resource *DnsService) (*Service, 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{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_docker_build.go b/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go similarity index 84% rename from vendor/github.com/rancher/go-rancher/client/generated_docker_build.go rename to vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go index cd91f65..a1b1e37 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_docker_build.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go @@ -22,7 +22,8 @@ type DockerBuild struct { type DockerBuildCollection struct { Collection - Data []DockerBuild `json:"data,omitempty"` + Data []DockerBuild `json:"data,omitempty"` + client *DockerBuildClient } type DockerBuildClient struct { @@ -58,9 +59,20 @@ func (c *DockerBuildClient) Update(existing *DockerBuild, updates interface{}) ( func (c *DockerBuildClient) List(opts *ListOpts) (*DockerBuildCollection, error) { resp := &DockerBuildCollection{} err := c.rancherClient.doList(DOCKER_BUILD_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *DockerBuildCollection) Next() (*DockerBuildCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &DockerBuildCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *DockerBuildClient) ById(id string) (*DockerBuild, error) { resp := &DockerBuild{} err := c.rancherClient.doById(DOCKER_BUILD_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_dynamic_schema.go b/vendor/github.com/rancher/go-rancher/v2/generated_dynamic_schema.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_dynamic_schema.go rename to vendor/github.com/rancher/go-rancher/v2/generated_dynamic_schema.go index f9421dd..6ee3674 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_dynamic_schema.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_dynamic_schema.go @@ -40,7 +40,8 @@ type DynamicSchema struct { type DynamicSchemaCollection struct { Collection - Data []DynamicSchema `json:"data,omitempty"` + Data []DynamicSchema `json:"data,omitempty"` + client *DynamicSchemaClient } type DynamicSchemaClient struct { @@ -80,9 +81,20 @@ func (c *DynamicSchemaClient) Update(existing *DynamicSchema, updates interface{ func (c *DynamicSchemaClient) List(opts *ListOpts) (*DynamicSchemaCollection, error) { resp := &DynamicSchemaCollection{} err := c.rancherClient.doList(DYNAMIC_SCHEMA_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *DynamicSchemaCollection) Next() (*DynamicSchemaCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &DynamicSchemaCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *DynamicSchemaClient) ById(id string) (*DynamicSchema, error) { resp := &DynamicSchema{} err := c.rancherClient.doById(DYNAMIC_SCHEMA_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_extension_implementation.go b/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_extension_implementation.go rename to vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go index cfa7b4a..2163833 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_extension_implementation.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go @@ -16,7 +16,8 @@ type ExtensionImplementation struct { type ExtensionImplementationCollection struct { Collection - Data []ExtensionImplementation `json:"data,omitempty"` + Data []ExtensionImplementation `json:"data,omitempty"` + client *ExtensionImplementationClient } type ExtensionImplementationClient struct { @@ -52,9 +53,20 @@ func (c *ExtensionImplementationClient) Update(existing *ExtensionImplementation func (c *ExtensionImplementationClient) List(opts *ListOpts) (*ExtensionImplementationCollection, error) { resp := &ExtensionImplementationCollection{} err := c.rancherClient.doList(EXTENSION_IMPLEMENTATION_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExtensionImplementationCollection) Next() (*ExtensionImplementationCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExtensionImplementationCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExtensionImplementationClient) ById(id string) (*ExtensionImplementation, error) { resp := &ExtensionImplementation{} err := c.rancherClient.doById(EXTENSION_IMPLEMENTATION_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_extension_point.go b/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go similarity index 80% rename from vendor/github.com/rancher/go-rancher/client/generated_extension_point.go rename to vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go index 0b13cf5..e3c0b87 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_extension_point.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go @@ -9,7 +9,7 @@ type ExtensionPoint struct { ExcludeSetting string `json:"excludeSetting,omitempty" yaml:"exclude_setting,omitempty"` - Implementations []interface{} `json:"implementations,omitempty" yaml:"implementations,omitempty"` + Implementations []ExtensionImplementation `json:"implementations,omitempty" yaml:"implementations,omitempty"` IncludeSetting string `json:"includeSetting,omitempty" yaml:"include_setting,omitempty"` @@ -20,7 +20,8 @@ type ExtensionPoint struct { type ExtensionPointCollection struct { Collection - Data []ExtensionPoint `json:"data,omitempty"` + Data []ExtensionPoint `json:"data,omitempty"` + client *ExtensionPointClient } type ExtensionPointClient struct { @@ -56,9 +57,20 @@ func (c *ExtensionPointClient) Update(existing *ExtensionPoint, updates interfac func (c *ExtensionPointClient) List(opts *ListOpts) (*ExtensionPointCollection, error) { resp := &ExtensionPointCollection{} err := c.rancherClient.doList(EXTENSION_POINT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExtensionPointCollection) Next() (*ExtensionPointCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExtensionPointCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExtensionPointClient) ById(id string) (*ExtensionPoint, error) { resp := &ExtensionPoint{} err := c.rancherClient.doById(EXTENSION_POINT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_dns_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_external_dns_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go index 7f4ce25..e4c6c92 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_dns_event.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go @@ -40,7 +40,8 @@ type ExternalDnsEvent struct { type ExternalDnsEventCollection struct { Collection - Data []ExternalDnsEvent `json:"data,omitempty"` + Data []ExternalDnsEvent `json:"data,omitempty"` + client *ExternalDnsEventClient } type ExternalDnsEventClient struct { @@ -80,9 +81,20 @@ func (c *ExternalDnsEventClient) Update(existing *ExternalDnsEvent, updates inte func (c *ExternalDnsEventClient) List(opts *ListOpts) (*ExternalDnsEventCollection, error) { resp := &ExternalDnsEventCollection{} err := c.rancherClient.doList(EXTERNAL_DNS_EVENT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExternalDnsEventCollection) Next() (*ExternalDnsEventCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExternalDnsEventCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExternalDnsEventClient) ById(id string) (*ExternalDnsEvent, error) { resp := &ExternalDnsEvent{} err := c.rancherClient.doById(EXTERNAL_DNS_EVENT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_external_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_event.go index a1bf818..3b43545 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_event.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go @@ -34,7 +34,8 @@ type ExternalEvent struct { type ExternalEventCollection struct { Collection - Data []ExternalEvent `json:"data,omitempty"` + Data []ExternalEvent `json:"data,omitempty"` + client *ExternalEventClient } type ExternalEventClient struct { @@ -74,9 +75,20 @@ func (c *ExternalEventClient) Update(existing *ExternalEvent, updates interface{ func (c *ExternalEventClient) List(opts *ListOpts) (*ExternalEventCollection, error) { resp := &ExternalEventCollection{} err := c.rancherClient.doList(EXTERNAL_EVENT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExternalEventCollection) Next() (*ExternalEventCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExternalEventCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExternalEventClient) ById(id string) (*ExternalEvent, error) { resp := &ExternalEvent{} err := c.rancherClient.doById(EXTERNAL_EVENT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_handler.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go similarity index 90% rename from vendor/github.com/rancher/go-rancher/client/generated_external_handler.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go index d325b8d..09f1b6a 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_handler.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go @@ -19,7 +19,7 @@ type ExternalHandler struct { Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - ProcessConfigs []interface{} `json:"processConfigs,omitempty" yaml:"process_configs,omitempty"` + ProcessConfigs []ExternalHandlerProcessConfig `json:"processConfigs,omitempty" yaml:"process_configs,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -42,7 +42,8 @@ type ExternalHandler struct { type ExternalHandlerCollection struct { Collection - Data []ExternalHandler `json:"data,omitempty"` + Data []ExternalHandler `json:"data,omitempty"` + client *ExternalHandlerClient } type ExternalHandlerClient struct { @@ -92,9 +93,20 @@ func (c *ExternalHandlerClient) Update(existing *ExternalHandler, updates interf func (c *ExternalHandlerClient) List(opts *ListOpts) (*ExternalHandlerCollection, error) { resp := &ExternalHandlerCollection{} err := c.rancherClient.doList(EXTERNAL_HANDLER_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExternalHandlerCollection) Next() (*ExternalHandlerCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExternalHandlerCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExternalHandlerClient) ById(id string) (*ExternalHandler, error) { resp := &ExternalHandler{} err := c.rancherClient.doById(EXTERNAL_HANDLER_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_handler_external_handler_process_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_external_handler_external_handler_process_map.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go index 9852fa8..733fa8d 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_handler_external_handler_process_map.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go @@ -13,6 +13,8 @@ type ExternalHandlerExternalHandlerProcessMap struct { 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"` @@ -40,7 +42,8 @@ type ExternalHandlerExternalHandlerProcessMap struct { type ExternalHandlerExternalHandlerProcessMapCollection struct { Collection - Data []ExternalHandlerExternalHandlerProcessMap `json:"data,omitempty"` + Data []ExternalHandlerExternalHandlerProcessMap `json:"data,omitempty"` + client *ExternalHandlerExternalHandlerProcessMapClient } type ExternalHandlerExternalHandlerProcessMapClient struct { @@ -90,9 +93,20 @@ func (c *ExternalHandlerExternalHandlerProcessMapClient) Update(existing *Extern func (c *ExternalHandlerExternalHandlerProcessMapClient) List(opts *ListOpts) (*ExternalHandlerExternalHandlerProcessMapCollection, error) { resp := &ExternalHandlerExternalHandlerProcessMapCollection{} err := c.rancherClient.doList(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExternalHandlerExternalHandlerProcessMapCollection) Next() (*ExternalHandlerExternalHandlerProcessMapCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExternalHandlerExternalHandlerProcessMapCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExternalHandlerExternalHandlerProcessMapClient) ById(id string) (*ExternalHandlerExternalHandlerProcessMap, error) { resp := &ExternalHandlerExternalHandlerProcessMap{} err := c.rancherClient.doById(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_handler_process.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_external_handler_process.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go index a613365..81a1b8a 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_handler_process.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go @@ -34,7 +34,8 @@ type ExternalHandlerProcess struct { type ExternalHandlerProcessCollection struct { Collection - Data []ExternalHandlerProcess `json:"data,omitempty"` + Data []ExternalHandlerProcess `json:"data,omitempty"` + client *ExternalHandlerProcessClient } type ExternalHandlerProcessClient struct { @@ -84,9 +85,20 @@ func (c *ExternalHandlerProcessClient) Update(existing *ExternalHandlerProcess, func (c *ExternalHandlerProcessClient) List(opts *ListOpts) (*ExternalHandlerProcessCollection, error) { resp := &ExternalHandlerProcessCollection{} err := c.rancherClient.doList(EXTERNAL_HANDLER_PROCESS_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExternalHandlerProcessCollection) Next() (*ExternalHandlerProcessCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExternalHandlerProcessCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExternalHandlerProcessClient) ById(id string) (*ExternalHandlerProcess, error) { resp := &ExternalHandlerProcess{} err := c.rancherClient.doById(EXTERNAL_HANDLER_PROCESS_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_handler_process_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_external_handler_process_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go index de0d49e..08d4ab0 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_handler_process_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go @@ -14,7 +14,8 @@ type ExternalHandlerProcessConfig struct { type ExternalHandlerProcessConfigCollection struct { Collection - Data []ExternalHandlerProcessConfig `json:"data,omitempty"` + Data []ExternalHandlerProcessConfig `json:"data,omitempty"` + client *ExternalHandlerProcessConfigClient } type ExternalHandlerProcessConfigClient struct { @@ -50,9 +51,20 @@ func (c *ExternalHandlerProcessConfigClient) Update(existing *ExternalHandlerPro func (c *ExternalHandlerProcessConfigClient) List(opts *ListOpts) (*ExternalHandlerProcessConfigCollection, error) { resp := &ExternalHandlerProcessConfigCollection{} err := c.rancherClient.doList(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExternalHandlerProcessConfigCollection) Next() (*ExternalHandlerProcessConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExternalHandlerProcessConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExternalHandlerProcessConfigClient) ById(id string) (*ExternalHandlerProcessConfig, error) { resp := &ExternalHandlerProcessConfig{} err := c.rancherClient.doById(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_host_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_external_host_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go index ae8ec14..e35425e 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_host_event.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go @@ -40,7 +40,8 @@ type ExternalHostEvent struct { type ExternalHostEventCollection struct { Collection - Data []ExternalHostEvent `json:"data,omitempty"` + Data []ExternalHostEvent `json:"data,omitempty"` + client *ExternalHostEventClient } type ExternalHostEventClient struct { @@ -80,9 +81,20 @@ func (c *ExternalHostEventClient) Update(existing *ExternalHostEvent, updates in func (c *ExternalHostEventClient) List(opts *ListOpts) (*ExternalHostEventCollection, error) { resp := &ExternalHostEventCollection{} err := c.rancherClient.doList(EXTERNAL_HOST_EVENT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExternalHostEventCollection) Next() (*ExternalHostEventCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExternalHostEventCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExternalHostEventClient) ById(id string) (*ExternalHostEvent, error) { resp := &ExternalHostEvent{} err := c.rancherClient.doById(EXTERNAL_HOST_EVENT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go similarity index 86% rename from vendor/github.com/rancher/go-rancher/client/generated_external_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_service.go index 6bdc9d7..cc9cf4f 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go @@ -15,8 +15,6 @@ type ExternalService struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,omitempty"` - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` ExternalIpAddresses []string `json:"externalIpAddresses,omitempty" yaml:"external_ip_addresses,omitempty"` @@ -29,10 +27,14 @@ type ExternalService struct { Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` @@ -41,10 +43,14 @@ type ExternalService struct { 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"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -58,7 +64,8 @@ type ExternalService struct { type ExternalServiceCollection struct { Collection - Data []ExternalService `json:"data,omitempty"` + Data []ExternalService `json:"data,omitempty"` + client *ExternalServiceClient } type ExternalServiceClient struct { @@ -74,10 +81,10 @@ type ExternalServiceOperations interface { ActionActivate(*ExternalService) (*Service, error) - ActionCancelrollback(*ExternalService) (*Service, error) - ActionCancelupgrade(*ExternalService) (*Service, error) + ActionContinueupgrade(*ExternalService) (*Service, error) + ActionCreate(*ExternalService) (*Service, error) ActionDeactivate(*ExternalService) (*Service, error) @@ -116,9 +123,20 @@ func (c *ExternalServiceClient) Update(existing *ExternalService, updates interf func (c *ExternalServiceClient) List(opts *ListOpts) (*ExternalServiceCollection, error) { resp := &ExternalServiceCollection{} err := c.rancherClient.doList(EXTERNAL_SERVICE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExternalServiceCollection) Next() (*ExternalServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExternalServiceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExternalServiceClient) ById(id string) (*ExternalService, error) { resp := &ExternalService{} err := c.rancherClient.doById(EXTERNAL_SERVICE_TYPE, id, resp) @@ -143,15 +161,6 @@ func (c *ExternalServiceClient) ActionActivate(resource *ExternalService) (*Serv return resp, err } -func (c *ExternalServiceClient) ActionCancelrollback(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ExternalServiceClient) ActionCancelupgrade(resource *ExternalService) (*Service, error) { resp := &Service{} @@ -161,6 +170,15 @@ func (c *ExternalServiceClient) ActionCancelupgrade(resource *ExternalService) ( 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{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_service_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_external_service_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go index 1eb53a5..59913d2 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_service_event.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go @@ -38,7 +38,8 @@ type ExternalServiceEvent struct { type ExternalServiceEventCollection struct { Collection - Data []ExternalServiceEvent `json:"data,omitempty"` + Data []ExternalServiceEvent `json:"data,omitempty"` + client *ExternalServiceEventClient } type ExternalServiceEventClient struct { @@ -78,9 +79,20 @@ func (c *ExternalServiceEventClient) Update(existing *ExternalServiceEvent, upda func (c *ExternalServiceEventClient) List(opts *ListOpts) (*ExternalServiceEventCollection, error) { resp := &ExternalServiceEventCollection{} err := c.rancherClient.doList(EXTERNAL_SERVICE_EVENT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExternalServiceEventCollection) Next() (*ExternalServiceEventCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExternalServiceEventCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExternalServiceEventClient) ById(id string) (*ExternalServiceEvent, error) { resp := &ExternalServiceEvent{} err := c.rancherClient.doById(EXTERNAL_SERVICE_EVENT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_storage_pool_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_external_storage_pool_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go index 21d4ef3..30b8ca1 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_storage_pool_event.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go @@ -38,7 +38,8 @@ type ExternalStoragePoolEvent struct { type ExternalStoragePoolEventCollection struct { Collection - Data []ExternalStoragePoolEvent `json:"data,omitempty"` + Data []ExternalStoragePoolEvent `json:"data,omitempty"` + client *ExternalStoragePoolEventClient } type ExternalStoragePoolEventClient struct { @@ -78,9 +79,20 @@ func (c *ExternalStoragePoolEventClient) Update(existing *ExternalStoragePoolEve func (c *ExternalStoragePoolEventClient) List(opts *ListOpts) (*ExternalStoragePoolEventCollection, error) { resp := &ExternalStoragePoolEventCollection{} err := c.rancherClient.doList(EXTERNAL_STORAGE_POOL_EVENT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExternalStoragePoolEventCollection) Next() (*ExternalStoragePoolEventCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExternalStoragePoolEventCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExternalStoragePoolEventClient) ById(id string) (*ExternalStoragePoolEvent, error) { resp := &ExternalStoragePoolEvent{} err := c.rancherClient.doById(EXTERNAL_STORAGE_POOL_EVENT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_volume_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_external_volume_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go index 2c1fae7..785efb1 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_volume_event.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go @@ -36,7 +36,8 @@ type ExternalVolumeEvent struct { type ExternalVolumeEventCollection struct { Collection - Data []ExternalVolumeEvent `json:"data,omitempty"` + Data []ExternalVolumeEvent `json:"data,omitempty"` + client *ExternalVolumeEventClient } type ExternalVolumeEventClient struct { @@ -76,9 +77,20 @@ func (c *ExternalVolumeEventClient) Update(existing *ExternalVolumeEvent, update func (c *ExternalVolumeEventClient) List(opts *ListOpts) (*ExternalVolumeEventCollection, error) { resp := &ExternalVolumeEventCollection{} err := c.rancherClient.doList(EXTERNAL_VOLUME_EVENT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ExternalVolumeEventCollection) Next() (*ExternalVolumeEventCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ExternalVolumeEventCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ExternalVolumeEventClient) ById(id string) (*ExternalVolumeEvent, error) { resp := &ExternalVolumeEvent{} err := c.rancherClient.doById(EXTERNAL_VOLUME_EVENT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_field_documentation.go b/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_field_documentation.go rename to vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go index 035ac23..511d33b 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_field_documentation.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go @@ -12,7 +12,8 @@ type FieldDocumentation struct { type FieldDocumentationCollection struct { Collection - Data []FieldDocumentation `json:"data,omitempty"` + Data []FieldDocumentation `json:"data,omitempty"` + client *FieldDocumentationClient } type FieldDocumentationClient struct { @@ -48,9 +49,20 @@ func (c *FieldDocumentationClient) Update(existing *FieldDocumentation, updates func (c *FieldDocumentationClient) List(opts *ListOpts) (*FieldDocumentationCollection, error) { resp := &FieldDocumentationCollection{} err := c.rancherClient.doList(FIELD_DOCUMENTATION_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *FieldDocumentationCollection) Next() (*FieldDocumentationCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &FieldDocumentationCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *FieldDocumentationClient) ById(id string) (*FieldDocumentation, error) { resp := &FieldDocumentation{} err := c.rancherClient.doById(FIELD_DOCUMENTATION_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go b/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go new file mode 100644 index 0000000..4cfd367 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go @@ -0,0 +1,129 @@ +package client + +const ( + GENERIC_OBJECT_TYPE = "genericObject" +) + +type GenericObject 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"` + + ResourceData map[string]interface{} `json:"resourceData,omitempty" yaml:"resource_data,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 GenericObjectCollection struct { + Collection + Data []GenericObject `json:"data,omitempty"` + client *GenericObjectClient +} + +type GenericObjectClient struct { + rancherClient *RancherClient +} + +type GenericObjectOperations interface { + List(opts *ListOpts) (*GenericObjectCollection, error) + Create(opts *GenericObject) (*GenericObject, error) + Update(existing *GenericObject, updates interface{}) (*GenericObject, error) + ById(id string) (*GenericObject, error) + Delete(container *GenericObject) error + + ActionCreate(*GenericObject) (*GenericObject, error) + + ActionRemove(*GenericObject) (*GenericObject, error) +} + +func newGenericObjectClient(rancherClient *RancherClient) *GenericObjectClient { + return &GenericObjectClient{ + rancherClient: rancherClient, + } +} + +func (c *GenericObjectClient) Create(container *GenericObject) (*GenericObject, error) { + resp := &GenericObject{} + err := c.rancherClient.doCreate(GENERIC_OBJECT_TYPE, container, resp) + return resp, err +} + +func (c *GenericObjectClient) Update(existing *GenericObject, updates interface{}) (*GenericObject, error) { + resp := &GenericObject{} + err := c.rancherClient.doUpdate(GENERIC_OBJECT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *GenericObjectClient) List(opts *ListOpts) (*GenericObjectCollection, error) { + resp := &GenericObjectCollection{} + err := c.rancherClient.doList(GENERIC_OBJECT_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *GenericObjectCollection) Next() (*GenericObjectCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &GenericObjectCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *GenericObjectClient) ById(id string) (*GenericObject, error) { + resp := &GenericObject{} + err := c.rancherClient.doById(GENERIC_OBJECT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *GenericObjectClient) Delete(container *GenericObject) error { + return c.rancherClient.doResourceDelete(GENERIC_OBJECT_TYPE, &container.Resource) +} + +func (c *GenericObjectClient) ActionCreate(resource *GenericObject) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(GENERIC_OBJECT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *GenericObjectClient) ActionRemove(resource *GenericObject) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(GENERIC_OBJECT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_ha_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_ha_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go index 9b9d14c..f5bb82f 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_ha_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go @@ -18,7 +18,8 @@ type HaConfig struct { type HaConfigCollection struct { Collection - Data []HaConfig `json:"data,omitempty"` + Data []HaConfig `json:"data,omitempty"` + client *HaConfigClient } type HaConfigClient struct { @@ -54,9 +55,20 @@ func (c *HaConfigClient) Update(existing *HaConfig, updates interface{}) (*HaCon func (c *HaConfigClient) List(opts *ListOpts) (*HaConfigCollection, error) { resp := &HaConfigCollection{} err := c.rancherClient.doList(HA_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *HaConfigCollection) Next() (*HaConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &HaConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *HaConfigClient) ById(id string) (*HaConfig, error) { resp := &HaConfig{} err := c.rancherClient.doById(HA_CONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_ha_config_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go similarity index 88% rename from vendor/github.com/rancher/go-rancher/client/generated_ha_config_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go index fdff3ae..ce86936 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_ha_config_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go @@ -42,7 +42,8 @@ type HaConfigInput struct { type HaConfigInputCollection struct { Collection - Data []HaConfigInput `json:"data,omitempty"` + Data []HaConfigInput `json:"data,omitempty"` + client *HaConfigInputClient } type HaConfigInputClient struct { @@ -78,9 +79,20 @@ func (c *HaConfigInputClient) Update(existing *HaConfigInput, updates interface{ func (c *HaConfigInputClient) List(opts *ListOpts) (*HaConfigInputCollection, error) { resp := &HaConfigInputCollection{} err := c.rancherClient.doList(HA_CONFIG_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *HaConfigInputCollection) Next() (*HaConfigInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &HaConfigInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *HaConfigInputClient) ById(id string) (*HaConfigInput, error) { resp := &HaConfigInput{} err := c.rancherClient.doById(HA_CONFIG_INPUT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_healthcheck_instance_host_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_healthcheck_instance_host_map.go rename to vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go index 6329d2f..b30b9d8 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_healthcheck_instance_host_map.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go @@ -42,7 +42,8 @@ type HealthcheckInstanceHostMap struct { type HealthcheckInstanceHostMapCollection struct { Collection - Data []HealthcheckInstanceHostMap `json:"data,omitempty"` + Data []HealthcheckInstanceHostMap `json:"data,omitempty"` + client *HealthcheckInstanceHostMapClient } type HealthcheckInstanceHostMapClient struct { @@ -82,9 +83,20 @@ func (c *HealthcheckInstanceHostMapClient) Update(existing *HealthcheckInstanceH func (c *HealthcheckInstanceHostMapClient) List(opts *ListOpts) (*HealthcheckInstanceHostMapCollection, error) { resp := &HealthcheckInstanceHostMapCollection{} err := c.rancherClient.doList(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *HealthcheckInstanceHostMapCollection) Next() (*HealthcheckInstanceHostMapCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &HealthcheckInstanceHostMapCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *HealthcheckInstanceHostMapClient) ById(id string) (*HealthcheckInstanceHostMap, error) { resp := &HealthcheckInstanceHostMap{} err := c.rancherClient.doById(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_host.go b/vendor/github.com/rancher/go-rancher/v2/generated_host.go similarity index 63% rename from vendor/github.com/rancher/go-rancher/client/generated_host.go rename to vendor/github.com/rancher/go-rancher/v2/generated_host.go index f1ee943..5fd3625 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_host.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_host.go @@ -11,10 +11,20 @@ type Host struct { AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` + AgentIpAddress string `json:"agentIpAddress,omitempty" yaml:"agent_ip_address,omitempty"` + AgentState string `json:"agentState,omitempty" yaml:"agent_state,omitempty"` + Amazonec2Config *Amazonec2Config `json:"amazonec2Config,omitempty" yaml:"amazonec2config,omitempty"` + ApiProxy string `json:"apiProxy,omitempty" yaml:"api_proxy,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"` + ComputeTotal int64 `json:"computeTotal,omitempty" yaml:"compute_total,omitempty"` Created string `json:"created,omitempty" yaml:"created,omitempty"` @@ -23,19 +33,51 @@ type Host struct { 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"` + + ExtractedConfig string `json:"extractedConfig,omitempty" yaml:"extracted_config,omitempty"` + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` Info interface{} `json:"info,omitempty" yaml:"info,omitempty"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + LocalStorageMb int64 `json:"localStorageMb,omitempty" yaml:"local_storage_mb,omitempty"` + + Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` + + MilliCpu int64 `json:"milliCpu,omitempty" yaml:"milli_cpu,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + PacketConfig *PacketConfig `json:"packetConfig,omitempty" yaml:"packet_config,omitempty"` + PhysicalHostId string `json:"physicalHostId,omitempty" yaml:"physical_host_id,omitempty"` - PublicEndpoints []interface{} `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -54,7 +96,8 @@ type Host struct { type HostCollection struct { Collection - Data []Host `json:"data,omitempty"` + Data []Host `json:"data,omitempty"` + client *HostClient } type HostClient struct { @@ -76,6 +119,10 @@ type HostOperations interface { ActionDockersocket(*Host) (*HostAccess, error) + ActionError(*Host) (*Host, error) + + ActionProvision(*Host) (*Host, error) + ActionPurge(*Host) (*Host, error) ActionRemove(*Host) (*Host, error) @@ -106,9 +153,20 @@ func (c *HostClient) Update(existing *Host, updates interface{}) (*Host, error) func (c *HostClient) List(opts *ListOpts) (*HostCollection, error) { resp := &HostCollection{} err := c.rancherClient.doList(HOST_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *HostCollection) Next() (*HostCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &HostCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *HostClient) ById(id string) (*Host, error) { resp := &Host{} err := c.rancherClient.doById(HOST_TYPE, id, resp) @@ -160,6 +218,24 @@ func (c *HostClient) ActionDockersocket(resource *Host) (*HostAccess, error) { return resp, err } +func (c *HostClient) ActionError(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HostClient) ActionProvision(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "provision", &resource.Resource, nil, resp) + + return resp, err +} + func (c *HostClient) ActionPurge(resource *Host) (*Host, error) { resp := &Host{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_host_access.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go similarity index 81% rename from vendor/github.com/rancher/go-rancher/client/generated_host_access.go rename to vendor/github.com/rancher/go-rancher/v2/generated_host_access.go index ee4ab39..7ebc586 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_host_access.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go @@ -14,7 +14,8 @@ type HostAccess struct { type HostAccessCollection struct { Collection - Data []HostAccess `json:"data,omitempty"` + Data []HostAccess `json:"data,omitempty"` + client *HostAccessClient } type HostAccessClient struct { @@ -50,9 +51,20 @@ func (c *HostAccessClient) Update(existing *HostAccess, updates interface{}) (*H func (c *HostAccessClient) List(opts *ListOpts) (*HostAccessCollection, error) { resp := &HostAccessCollection{} err := c.rancherClient.doList(HOST_ACCESS_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *HostAccessCollection) Next() (*HostAccessCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &HostAccessCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *HostAccessClient) ById(id string) (*HostAccess, error) { resp := &HostAccess{} err := c.rancherClient.doById(HOST_ACCESS_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_host_api_proxy_token.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_host_api_proxy_token.go rename to vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go index e4c508a..1517b79 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_host_api_proxy_token.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go @@ -16,7 +16,8 @@ type HostApiProxyToken struct { type HostApiProxyTokenCollection struct { Collection - Data []HostApiProxyToken `json:"data,omitempty"` + Data []HostApiProxyToken `json:"data,omitempty"` + client *HostApiProxyTokenClient } type HostApiProxyTokenClient struct { @@ -52,9 +53,20 @@ func (c *HostApiProxyTokenClient) Update(existing *HostApiProxyToken, updates in func (c *HostApiProxyTokenClient) List(opts *ListOpts) (*HostApiProxyTokenCollection, error) { resp := &HostApiProxyTokenCollection{} err := c.rancherClient.doList(HOST_API_PROXY_TOKEN_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *HostApiProxyTokenCollection) Next() (*HostApiProxyTokenCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &HostApiProxyTokenCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *HostApiProxyTokenClient) ById(id string) (*HostApiProxyToken, error) { resp := &HostApiProxyToken{} err := c.rancherClient.doById(HOST_API_PROXY_TOKEN_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_identity.go b/vendor/github.com/rancher/go-rancher/v2/generated_identity.go similarity index 85% rename from vendor/github.com/rancher/go-rancher/client/generated_identity.go rename to vendor/github.com/rancher/go-rancher/v2/generated_identity.go index f78f7c7..1d92de6 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_identity.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_identity.go @@ -28,7 +28,8 @@ type Identity struct { type IdentityCollection struct { Collection - Data []Identity `json:"data,omitempty"` + Data []Identity `json:"data,omitempty"` + client *IdentityClient } type IdentityClient struct { @@ -64,9 +65,20 @@ func (c *IdentityClient) Update(existing *Identity, updates interface{}) (*Ident func (c *IdentityClient) List(opts *ListOpts) (*IdentityCollection, error) { resp := &IdentityCollection{} err := c.rancherClient.doList(IDENTITY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *IdentityCollection) Next() (*IdentityCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &IdentityCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *IdentityClient) ById(id string) (*Identity, error) { resp := &Identity{} err := c.rancherClient.doById(IDENTITY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_image.go b/vendor/github.com/rancher/go-rancher/v2/generated_image.go similarity index 91% rename from vendor/github.com/rancher/go-rancher/client/generated_image.go rename to vendor/github.com/rancher/go-rancher/v2/generated_image.go index 84d1d0f..b14103b 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_image.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_image.go @@ -36,7 +36,8 @@ type Image struct { type ImageCollection struct { Collection - Data []Image `json:"data,omitempty"` + Data []Image `json:"data,omitempty"` + client *ImageClient } type ImageClient struct { @@ -86,9 +87,20 @@ func (c *ImageClient) Update(existing *Image, updates interface{}) (*Image, erro func (c *ImageClient) List(opts *ListOpts) (*ImageCollection, error) { resp := &ImageCollection{} err := c.rancherClient.doList(IMAGE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ImageCollection) Next() (*ImageCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ImageCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ImageClient) ById(id string) (*Image, error) { resp := &Image{} err := c.rancherClient.doById(IMAGE_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_in_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go similarity index 77% rename from vendor/github.com/rancher/go-rancher/client/generated_in_service_upgrade_strategy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go index a928857..3e93a77 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_in_service_upgrade_strategy.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go @@ -15,16 +15,17 @@ type InServiceUpgradeStrategy struct { PreviousLaunchConfig *LaunchConfig `json:"previousLaunchConfig,omitempty" yaml:"previous_launch_config,omitempty"` - PreviousSecondaryLaunchConfigs []interface{} `json:"previousSecondaryLaunchConfigs,omitempty" yaml:"previous_secondary_launch_configs,omitempty"` + PreviousSecondaryLaunchConfigs []SecondaryLaunchConfig `json:"previousSecondaryLaunchConfigs,omitempty" yaml:"previous_secondary_launch_configs,omitempty"` - SecondaryLaunchConfigs []interface{} `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` + SecondaryLaunchConfigs []SecondaryLaunchConfig `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"` + Data []InServiceUpgradeStrategy `json:"data,omitempty"` + client *InServiceUpgradeStrategyClient } type InServiceUpgradeStrategyClient struct { @@ -60,9 +61,20 @@ func (c *InServiceUpgradeStrategyClient) Update(existing *InServiceUpgradeStrate func (c *InServiceUpgradeStrategyClient) List(opts *ListOpts) (*InServiceUpgradeStrategyCollection, error) { resp := &InServiceUpgradeStrategyCollection{} err := c.rancherClient.doList(IN_SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *InServiceUpgradeStrategyCollection) Next() (*InServiceUpgradeStrategyCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &InServiceUpgradeStrategyCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *InServiceUpgradeStrategyClient) ById(id string) (*InServiceUpgradeStrategy, error) { resp := &InServiceUpgradeStrategy{} err := c.rancherClient.doById(IN_SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance.go similarity index 94% rename from vendor/github.com/rancher/go-rancher/client/generated_instance.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance.go index f43f6bd..c552f3d 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_instance.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance.go @@ -40,7 +40,8 @@ type Instance struct { type InstanceCollection struct { Collection - Data []Instance `json:"data,omitempty"` + Data []Instance `json:"data,omitempty"` + client *InstanceClient } type InstanceClient struct { @@ -108,9 +109,20 @@ func (c *InstanceClient) Update(existing *Instance, updates interface{}) (*Insta func (c *InstanceClient) List(opts *ListOpts) (*InstanceCollection, error) { resp := &InstanceCollection{} err := c.rancherClient.doList(INSTANCE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *InstanceCollection) Next() (*InstanceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &InstanceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *InstanceClient) ById(id string) (*Instance, error) { resp := &Instance{} err := c.rancherClient.doById(INSTANCE_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance_console.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_instance_console.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go index bf38cb4..8574605 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_instance_console.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go @@ -16,7 +16,8 @@ type InstanceConsole struct { type InstanceConsoleCollection struct { Collection - Data []InstanceConsole `json:"data,omitempty"` + Data []InstanceConsole `json:"data,omitempty"` + client *InstanceConsoleClient } type InstanceConsoleClient struct { @@ -52,9 +53,20 @@ func (c *InstanceConsoleClient) Update(existing *InstanceConsole, updates interf func (c *InstanceConsoleClient) List(opts *ListOpts) (*InstanceConsoleCollection, error) { resp := &InstanceConsoleCollection{} err := c.rancherClient.doList(INSTANCE_CONSOLE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *InstanceConsoleCollection) Next() (*InstanceConsoleCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &InstanceConsoleCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *InstanceConsoleClient) ById(id string) (*InstanceConsole, error) { resp := &InstanceConsole{} err := c.rancherClient.doById(INSTANCE_CONSOLE_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance_console_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_instance_console_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go index 11a126f..5bfbe81 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_instance_console_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go @@ -10,7 +10,8 @@ type InstanceConsoleInput struct { type InstanceConsoleInputCollection struct { Collection - Data []InstanceConsoleInput `json:"data,omitempty"` + Data []InstanceConsoleInput `json:"data,omitempty"` + client *InstanceConsoleInputClient } type InstanceConsoleInputClient struct { @@ -46,9 +47,20 @@ func (c *InstanceConsoleInputClient) Update(existing *InstanceConsoleInput, upda func (c *InstanceConsoleInputClient) List(opts *ListOpts) (*InstanceConsoleInputCollection, error) { resp := &InstanceConsoleInputCollection{} err := c.rancherClient.doList(INSTANCE_CONSOLE_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *InstanceConsoleInputCollection) Next() (*InstanceConsoleInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &InstanceConsoleInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *InstanceConsoleInputClient) ById(id string) (*InstanceConsoleInput, error) { resp := &InstanceConsoleInput{} err := c.rancherClient.doById(INSTANCE_CONSOLE_INPUT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance_health_check.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go similarity index 87% rename from vendor/github.com/rancher/go-rancher/client/generated_instance_health_check.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go index 305798b..4f2ce46 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_instance_health_check.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go @@ -32,7 +32,8 @@ type InstanceHealthCheck struct { type InstanceHealthCheckCollection struct { Collection - Data []InstanceHealthCheck `json:"data,omitempty"` + Data []InstanceHealthCheck `json:"data,omitempty"` + client *InstanceHealthCheckClient } type InstanceHealthCheckClient struct { @@ -68,9 +69,20 @@ func (c *InstanceHealthCheckClient) Update(existing *InstanceHealthCheck, update func (c *InstanceHealthCheckClient) List(opts *ListOpts) (*InstanceHealthCheckCollection, error) { resp := &InstanceHealthCheckCollection{} err := c.rancherClient.doList(INSTANCE_HEALTH_CHECK_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *InstanceHealthCheckCollection) Next() (*InstanceHealthCheckCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &InstanceHealthCheckCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *InstanceHealthCheckClient) ById(id string) (*InstanceHealthCheck, error) { resp := &InstanceHealthCheck{} err := c.rancherClient.doById(INSTANCE_HEALTH_CHECK_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance_link.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_instance_link.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go index 5e71465..598d5e5 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_instance_link.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go @@ -44,7 +44,8 @@ type InstanceLink struct { type InstanceLinkCollection struct { Collection - Data []InstanceLink `json:"data,omitempty"` + Data []InstanceLink `json:"data,omitempty"` + client *InstanceLinkClient } type InstanceLinkClient struct { @@ -94,9 +95,20 @@ func (c *InstanceLinkClient) Update(existing *InstanceLink, updates interface{}) func (c *InstanceLinkClient) List(opts *ListOpts) (*InstanceLinkCollection, error) { resp := &InstanceLinkCollection{} err := c.rancherClient.doList(INSTANCE_LINK_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *InstanceLinkCollection) Next() (*InstanceLinkCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &InstanceLinkCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *InstanceLinkClient) ById(id string) (*InstanceLink, error) { resp := &InstanceLink{} err := c.rancherClient.doById(INSTANCE_LINK_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance_stop.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_instance_stop.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go index d034bd6..2e3b2b6 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_instance_stop.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go @@ -14,7 +14,8 @@ type InstanceStop struct { type InstanceStopCollection struct { Collection - Data []InstanceStop `json:"data,omitempty"` + Data []InstanceStop `json:"data,omitempty"` + client *InstanceStopClient } type InstanceStopClient struct { @@ -50,9 +51,20 @@ func (c *InstanceStopClient) Update(existing *InstanceStop, updates interface{}) func (c *InstanceStopClient) List(opts *ListOpts) (*InstanceStopCollection, error) { resp := &InstanceStopCollection{} err := c.rancherClient.doList(INSTANCE_STOP_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *InstanceStopCollection) Next() (*InstanceStopCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &InstanceStopCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *InstanceStopClient) ById(id string) (*InstanceStop, error) { resp := &InstanceStop{} err := c.rancherClient.doById(INSTANCE_STOP_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_ip_address.go b/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go similarity index 88% rename from vendor/github.com/rancher/go-rancher/client/generated_ip_address.go rename to vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go index ba7a0f3..bae4109 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_ip_address.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go @@ -40,7 +40,8 @@ type IpAddress struct { type IpAddressCollection struct { Collection - Data []IpAddress `json:"data,omitempty"` + Data []IpAddress `json:"data,omitempty"` + client *IpAddressClient } type IpAddressClient struct { @@ -56,6 +57,8 @@ type IpAddressOperations interface { ActionActivate(*IpAddress) (*IpAddress, error) + ActionAssociate(*IpAddress) (*IpAddress, error) + ActionCreate(*IpAddress) (*IpAddress, error) ActionDeactivate(*IpAddress) (*IpAddress, error) @@ -92,9 +95,20 @@ func (c *IpAddressClient) Update(existing *IpAddress, updates interface{}) (*IpA func (c *IpAddressClient) List(opts *ListOpts) (*IpAddressCollection, error) { resp := &IpAddressCollection{} err := c.rancherClient.doList(IP_ADDRESS_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *IpAddressCollection) Next() (*IpAddressCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &IpAddressCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *IpAddressClient) ById(id string) (*IpAddress, error) { resp := &IpAddress{} err := c.rancherClient.doById(IP_ADDRESS_TYPE, id, resp) @@ -119,6 +133,15 @@ func (c *IpAddressClient) ActionActivate(resource *IpAddress) (*IpAddress, error return resp, err } +func (c *IpAddressClient) ActionAssociate(resource *IpAddress) (*IpAddress, error) { + + resp := &IpAddress{} + + err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "associate", &resource.Resource, nil, resp) + + return resp, err +} + func (c *IpAddressClient) ActionCreate(resource *IpAddress) (*IpAddress, error) { resp := &IpAddress{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_kubernetes_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go similarity index 88% rename from vendor/github.com/rancher/go-rancher/client/generated_kubernetes_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go index a7e6f2a..15fa378 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_kubernetes_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go @@ -15,14 +15,16 @@ type KubernetesService struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,omitempty"` - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -31,8 +33,12 @@ type KubernetesService struct { 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"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Template interface{} `json:"template,omitempty" yaml:"template,omitempty"` Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` @@ -48,7 +54,8 @@ type KubernetesService struct { type KubernetesServiceCollection struct { Collection - Data []KubernetesService `json:"data,omitempty"` + Data []KubernetesService `json:"data,omitempty"` + client *KubernetesServiceClient } type KubernetesServiceClient struct { @@ -66,10 +73,10 @@ type KubernetesServiceOperations interface { ActionAddservicelink(*KubernetesService, *AddRemoveServiceLinkInput) (*Service, error) - ActionCancelrollback(*KubernetesService) (*Service, error) - ActionCancelupgrade(*KubernetesService) (*Service, error) + ActionContinueupgrade(*KubernetesService) (*Service, error) + ActionCreate(*KubernetesService) (*Service, error) ActionDeactivate(*KubernetesService) (*Service, error) @@ -112,9 +119,20 @@ func (c *KubernetesServiceClient) Update(existing *KubernetesService, updates in func (c *KubernetesServiceClient) List(opts *ListOpts) (*KubernetesServiceCollection, error) { resp := &KubernetesServiceCollection{} err := c.rancherClient.doList(KUBERNETES_SERVICE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *KubernetesServiceCollection) Next() (*KubernetesServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &KubernetesServiceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *KubernetesServiceClient) ById(id string) (*KubernetesService, error) { resp := &KubernetesService{} err := c.rancherClient.doById(KUBERNETES_SERVICE_TYPE, id, resp) @@ -148,15 +166,6 @@ func (c *KubernetesServiceClient) ActionAddservicelink(resource *KubernetesServi return resp, err } -func (c *KubernetesServiceClient) ActionCancelrollback(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *KubernetesServiceClient) ActionCancelupgrade(resource *KubernetesService) (*Service, error) { resp := &Service{} @@ -166,6 +175,15 @@ func (c *KubernetesServiceClient) ActionCancelupgrade(resource *KubernetesServic 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{} 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 0000000..08c3d7e --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go @@ -0,0 +1,202 @@ +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"` + + Group string `json:"group,omitempty" yaml:"group,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"` + + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,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"` + client *KubernetesStackClient +} + +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) + resp.client = c + return resp, err +} + +func (cc *KubernetesStackCollection) Next() (*KubernetesStackCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &KubernetesStackCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +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 0000000..58c6c5c --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go @@ -0,0 +1,83 @@ +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"` + client *KubernetesStackUpgradeClient +} + +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) + resp.client = c + return resp, err +} + +func (cc *KubernetesStackUpgradeCollection) Next() (*KubernetesStackUpgradeCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &KubernetesStackUpgradeCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +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/client/generated_label.go b/vendor/github.com/rancher/go-rancher/v2/generated_label.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_label.go rename to vendor/github.com/rancher/go-rancher/v2/generated_label.go index 004a75d..6b67a2e 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_label.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_label.go @@ -40,7 +40,8 @@ type Label struct { type LabelCollection struct { Collection - Data []Label `json:"data,omitempty"` + Data []Label `json:"data,omitempty"` + client *LabelClient } type LabelClient struct { @@ -80,9 +81,20 @@ func (c *LabelClient) Update(existing *Label, updates interface{}) (*Label, erro func (c *LabelClient) List(opts *ListOpts) (*LabelCollection, error) { resp := &LabelCollection{} err := c.rancherClient.doList(LABEL_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *LabelCollection) Next() (*LabelCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &LabelCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *LabelClient) ById(id string) (*Label, error) { resp := &Label{} err := c.rancherClient.doById(LABEL_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_launch_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go similarity index 77% rename from vendor/github.com/rancher/go-rancher/client/generated_launch_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go index b24cf4b..1e0c6d4 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_launch_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go @@ -15,18 +15,32 @@ type LaunchConfig struct { BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,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"` + CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` + Command []string `json:"command,omitempty" yaml:"command,omitempty"` Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` + + CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` + + CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` + + CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` @@ -49,10 +63,14 @@ type LaunchConfig struct { Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` - Disks []interface{} `json:"disks,omitempty" yaml:"disks,omitempty"` + DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` + + Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` @@ -69,10 +87,20 @@ type LaunchConfig struct { FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` + + HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` + + HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` @@ -81,6 +109,22 @@ type LaunchConfig struct { InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` + + IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` + + IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` + + Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` + + Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` + + IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` + + Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` + + KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` @@ -93,10 +137,20 @@ type LaunchConfig struct { MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` + MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` + + MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` + + Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` + NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` + NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` @@ -105,12 +159,20 @@ type LaunchConfig struct { NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` + OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` + + OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` + PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` + PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` + Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` @@ -129,6 +191,10 @@ type LaunchConfig struct { SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + + ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` + StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` @@ -137,7 +203,15 @@ type LaunchConfig struct { StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - SystemContainer string `json:"systemContainer,omitempty" yaml:"system_container,omitempty"` + StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` + + StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` + + Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,omitempty"` + + Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` Token string `json:"token,omitempty" yaml:"token,omitempty"` @@ -149,10 +223,16 @@ type LaunchConfig struct { Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` + Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` + User string `json:"user,omitempty" yaml:"user,omitempty"` Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` + UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` + + Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` @@ -166,7 +246,8 @@ type LaunchConfig struct { type LaunchConfigCollection struct { Collection - Data []LaunchConfig `json:"data,omitempty"` + Data []LaunchConfig `json:"data,omitempty"` + client *LaunchConfigClient } type LaunchConfigClient struct { @@ -204,8 +285,6 @@ type LaunchConfigOperations interface { ActionRestore(*LaunchConfig) (*Instance, error) - ActionSetlabels(*LaunchConfig, *SetLabelsInput) (*Container, error) - ActionStart(*LaunchConfig) (*Instance, error) ActionStop(*LaunchConfig, *InstanceStop) (*Instance, error) @@ -240,9 +319,20 @@ func (c *LaunchConfigClient) Update(existing *LaunchConfig, updates interface{}) func (c *LaunchConfigClient) List(opts *ListOpts) (*LaunchConfigCollection, error) { resp := &LaunchConfigCollection{} err := c.rancherClient.doList(LAUNCH_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *LaunchConfigCollection) Next() (*LaunchConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &LaunchConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *LaunchConfigClient) ById(id string) (*LaunchConfig, error) { resp := &LaunchConfig{} err := c.rancherClient.doById(LAUNCH_CONFIG_TYPE, id, resp) @@ -366,15 +456,6 @@ func (c *LaunchConfigClient) ActionRestore(resource *LaunchConfig) (*Instance, e 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{} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go new file mode 100644 index 0000000..80edbdf --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go @@ -0,0 +1,87 @@ +package client + +const ( + LB_CONFIG_TYPE = "lbConfig" +) + +type LbConfig struct { + Resource + + CertificateIds []string `json:"certificateIds,omitempty" yaml:"certificate_ids,omitempty"` + + Config string `json:"config,omitempty" yaml:"config,omitempty"` + + DefaultCertificateId string `json:"defaultCertificateId,omitempty" yaml:"default_certificate_id,omitempty"` + + PortRules []PortRule `json:"portRules,omitempty" yaml:"port_rules,omitempty"` + + StickinessPolicy *LoadBalancerCookieStickinessPolicy `json:"stickinessPolicy,omitempty" yaml:"stickiness_policy,omitempty"` +} + +type LbConfigCollection struct { + Collection + Data []LbConfig `json:"data,omitempty"` + client *LbConfigClient +} + +type LbConfigClient struct { + rancherClient *RancherClient +} + +type LbConfigOperations interface { + List(opts *ListOpts) (*LbConfigCollection, error) + Create(opts *LbConfig) (*LbConfig, error) + Update(existing *LbConfig, updates interface{}) (*LbConfig, error) + ById(id string) (*LbConfig, error) + Delete(container *LbConfig) error +} + +func newLbConfigClient(rancherClient *RancherClient) *LbConfigClient { + return &LbConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *LbConfigClient) Create(container *LbConfig) (*LbConfig, error) { + resp := &LbConfig{} + err := c.rancherClient.doCreate(LB_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *LbConfigClient) Update(existing *LbConfig, updates interface{}) (*LbConfig, error) { + resp := &LbConfig{} + err := c.rancherClient.doUpdate(LB_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LbConfigClient) List(opts *ListOpts) (*LbConfigCollection, error) { + resp := &LbConfigCollection{} + err := c.rancherClient.doList(LB_CONFIG_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *LbConfigCollection) Next() (*LbConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &LbConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *LbConfigClient) ById(id string) (*LbConfig, error) { + resp := &LbConfig{} + err := c.rancherClient.doById(LB_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LbConfigClient) Delete(container *LbConfig) error { + return c.rancherClient.doResourceDelete(LB_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go new file mode 100644 index 0000000..93088a6 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go @@ -0,0 +1,79 @@ +package client + +const ( + LB_TARGET_CONFIG_TYPE = "lbTargetConfig" +) + +type LbTargetConfig struct { + Resource + + PortRules []TargetPortRule `json:"portRules,omitempty" yaml:"port_rules,omitempty"` +} + +type LbTargetConfigCollection struct { + Collection + Data []LbTargetConfig `json:"data,omitempty"` + client *LbTargetConfigClient +} + +type LbTargetConfigClient struct { + rancherClient *RancherClient +} + +type LbTargetConfigOperations interface { + List(opts *ListOpts) (*LbTargetConfigCollection, error) + Create(opts *LbTargetConfig) (*LbTargetConfig, error) + Update(existing *LbTargetConfig, updates interface{}) (*LbTargetConfig, error) + ById(id string) (*LbTargetConfig, error) + Delete(container *LbTargetConfig) error +} + +func newLbTargetConfigClient(rancherClient *RancherClient) *LbTargetConfigClient { + return &LbTargetConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *LbTargetConfigClient) Create(container *LbTargetConfig) (*LbTargetConfig, error) { + resp := &LbTargetConfig{} + err := c.rancherClient.doCreate(LB_TARGET_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *LbTargetConfigClient) Update(existing *LbTargetConfig, updates interface{}) (*LbTargetConfig, error) { + resp := &LbTargetConfig{} + err := c.rancherClient.doUpdate(LB_TARGET_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LbTargetConfigClient) List(opts *ListOpts) (*LbTargetConfigCollection, error) { + resp := &LbTargetConfigCollection{} + err := c.rancherClient.doList(LB_TARGET_CONFIG_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *LbTargetConfigCollection) Next() (*LbTargetConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &LbTargetConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *LbTargetConfigClient) ById(id string) (*LbTargetConfig, error) { + resp := &LbTargetConfig{} + err := c.rancherClient.doById(LB_TARGET_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LbTargetConfigClient) Delete(container *LbTargetConfig) error { + return c.rancherClient.doResourceDelete(LB_TARGET_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_ldapconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_ldapconfig.go similarity index 87% rename from vendor/github.com/rancher/go-rancher/client/generated_ldapconfig.go rename to vendor/github.com/rancher/go-rancher/v2/generated_ldapconfig.go index f760cfc..747c911 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_ldapconfig.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ldapconfig.go @@ -9,7 +9,7 @@ type Ldapconfig struct { AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` - AllowedIdentities []interface{} `json:"allowedIdentities,omitempty" yaml:"allowed_identities,omitempty"` + AllowedIdentities []Identity `json:"allowedIdentities,omitempty" yaml:"allowed_identities,omitempty"` ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connection_timeout,omitempty"` @@ -56,7 +56,8 @@ type Ldapconfig struct { type LdapconfigCollection struct { Collection - Data []Ldapconfig `json:"data,omitempty"` + Data []Ldapconfig `json:"data,omitempty"` + client *LdapconfigClient } type LdapconfigClient struct { @@ -92,9 +93,20 @@ func (c *LdapconfigClient) Update(existing *Ldapconfig, updates interface{}) (*L func (c *LdapconfigClient) List(opts *ListOpts) (*LdapconfigCollection, error) { resp := &LdapconfigCollection{} err := c.rancherClient.doList(LDAPCONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *LdapconfigCollection) Next() (*LdapconfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &LdapconfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *LdapconfigClient) ById(id string) (*Ldapconfig, error) { resp := &Ldapconfig{} err := c.rancherClient.doById(LDAPCONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_cookie_stickiness_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go similarity index 85% rename from vendor/github.com/rancher/go-rancher/client/generated_load_balancer_cookie_stickiness_policy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go index 0fc5699..4a8d698 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_cookie_stickiness_policy.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go @@ -24,7 +24,8 @@ type LoadBalancerCookieStickinessPolicy struct { type LoadBalancerCookieStickinessPolicyCollection struct { Collection - Data []LoadBalancerCookieStickinessPolicy `json:"data,omitempty"` + Data []LoadBalancerCookieStickinessPolicy `json:"data,omitempty"` + client *LoadBalancerCookieStickinessPolicyClient } type LoadBalancerCookieStickinessPolicyClient struct { @@ -60,9 +61,20 @@ func (c *LoadBalancerCookieStickinessPolicyClient) Update(existing *LoadBalancer func (c *LoadBalancerCookieStickinessPolicyClient) List(opts *ListOpts) (*LoadBalancerCookieStickinessPolicyCollection, error) { resp := &LoadBalancerCookieStickinessPolicyCollection{} err := c.rancherClient.doList(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *LoadBalancerCookieStickinessPolicyCollection) Next() (*LoadBalancerCookieStickinessPolicyCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &LoadBalancerCookieStickinessPolicyCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *LoadBalancerCookieStickinessPolicyClient) ById(id string) (*LoadBalancerCookieStickinessPolicy, error) { resp := &LoadBalancerCookieStickinessPolicy{} err := c.rancherClient.doById(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go index ad6b7ba..941ccb0 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go @@ -11,37 +11,35 @@ type LoadBalancerService struct { 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"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,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"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,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"` + LbConfig *LbConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` + + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,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"` + PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -55,10 +53,14 @@ type LoadBalancerService struct { 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"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -74,7 +76,8 @@ type LoadBalancerService struct { type LoadBalancerServiceCollection struct { Collection - Data []LoadBalancerService `json:"data,omitempty"` + Data []LoadBalancerService `json:"data,omitempty"` + client *LoadBalancerServiceClient } type LoadBalancerServiceClient struct { @@ -90,12 +93,12 @@ type LoadBalancerServiceOperations interface { ActionActivate(*LoadBalancerService) (*Service, error) - ActionAddservicelink(*LoadBalancerService, *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) - - ActionCancelrollback(*LoadBalancerService) (*Service, error) + ActionAddservicelink(*LoadBalancerService, *AddRemoveServiceLinkInput) (*Service, error) ActionCancelupgrade(*LoadBalancerService) (*Service, error) + ActionContinueupgrade(*LoadBalancerService) (*Service, error) + ActionCreate(*LoadBalancerService) (*Service, error) ActionDeactivate(*LoadBalancerService) (*Service, error) @@ -104,13 +107,13 @@ type LoadBalancerServiceOperations interface { ActionRemove(*LoadBalancerService) (*Service, error) - ActionRemoveservicelink(*LoadBalancerService, *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) + ActionRemoveservicelink(*LoadBalancerService, *AddRemoveServiceLinkInput) (*Service, error) ActionRestart(*LoadBalancerService, *ServiceRestart) (*Service, error) ActionRollback(*LoadBalancerService) (*Service, error) - ActionSetservicelinks(*LoadBalancerService, *SetLoadBalancerServiceLinksInput) (*Service, error) + ActionSetservicelinks(*LoadBalancerService, *SetServiceLinksInput) (*Service, error) ActionUpdate(*LoadBalancerService) (*Service, error) @@ -138,9 +141,20 @@ func (c *LoadBalancerServiceClient) Update(existing *LoadBalancerService, update func (c *LoadBalancerServiceClient) List(opts *ListOpts) (*LoadBalancerServiceCollection, error) { resp := &LoadBalancerServiceCollection{} err := c.rancherClient.doList(LOAD_BALANCER_SERVICE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *LoadBalancerServiceCollection) Next() (*LoadBalancerServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &LoadBalancerServiceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *LoadBalancerServiceClient) ById(id string) (*LoadBalancerService, error) { resp := &LoadBalancerService{} err := c.rancherClient.doById(LOAD_BALANCER_SERVICE_TYPE, id, resp) @@ -165,7 +179,7 @@ func (c *LoadBalancerServiceClient) ActionActivate(resource *LoadBalancerService return resp, err } -func (c *LoadBalancerServiceClient) ActionAddservicelink(resource *LoadBalancerService, input *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) { +func (c *LoadBalancerServiceClient) ActionAddservicelink(resource *LoadBalancerService, input *AddRemoveServiceLinkInput) (*Service, error) { resp := &Service{} @@ -174,15 +188,6 @@ func (c *LoadBalancerServiceClient) ActionAddservicelink(resource *LoadBalancerS return resp, err } -func (c *LoadBalancerServiceClient) ActionCancelrollback(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *LoadBalancerServiceClient) ActionCancelupgrade(resource *LoadBalancerService) (*Service, error) { resp := &Service{} @@ -192,6 +197,15 @@ func (c *LoadBalancerServiceClient) ActionCancelupgrade(resource *LoadBalancerSe 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{} @@ -228,7 +242,7 @@ func (c *LoadBalancerServiceClient) ActionRemove(resource *LoadBalancerService) return resp, err } -func (c *LoadBalancerServiceClient) ActionRemoveservicelink(resource *LoadBalancerService, input *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) { +func (c *LoadBalancerServiceClient) ActionRemoveservicelink(resource *LoadBalancerService, input *AddRemoveServiceLinkInput) (*Service, error) { resp := &Service{} @@ -255,7 +269,7 @@ func (c *LoadBalancerServiceClient) ActionRollback(resource *LoadBalancerService return resp, err } -func (c *LoadBalancerServiceClient) ActionSetservicelinks(resource *LoadBalancerService, input *SetLoadBalancerServiceLinksInput) (*Service, error) { +func (c *LoadBalancerServiceClient) ActionSetservicelinks(resource *LoadBalancerService, input *SetServiceLinksInput) (*Service, error) { resp := &Service{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_local_auth_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go similarity index 84% rename from vendor/github.com/rancher/go-rancher/client/generated_local_auth_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go index 16d9855..664f137 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_local_auth_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go @@ -20,7 +20,8 @@ type LocalAuthConfig struct { type LocalAuthConfigCollection struct { Collection - Data []LocalAuthConfig `json:"data,omitempty"` + Data []LocalAuthConfig `json:"data,omitempty"` + client *LocalAuthConfigClient } type LocalAuthConfigClient struct { @@ -56,9 +57,20 @@ func (c *LocalAuthConfigClient) Update(existing *LocalAuthConfig, updates interf func (c *LocalAuthConfigClient) List(opts *ListOpts) (*LocalAuthConfigCollection, error) { resp := &LocalAuthConfigCollection{} err := c.rancherClient.doList(LOCAL_AUTH_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *LocalAuthConfigCollection) Next() (*LocalAuthConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &LocalAuthConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *LocalAuthConfigClient) ById(id string) (*LocalAuthConfig, error) { resp := &LocalAuthConfig{} err := c.rancherClient.doById(LOCAL_AUTH_CONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_log_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_log_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_log_config.go index 1abfc4c..3f799aa 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_log_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go @@ -14,7 +14,8 @@ type LogConfig struct { type LogConfigCollection struct { Collection - Data []LogConfig `json:"data,omitempty"` + Data []LogConfig `json:"data,omitempty"` + client *LogConfigClient } type LogConfigClient struct { @@ -50,9 +51,20 @@ func (c *LogConfigClient) Update(existing *LogConfig, updates interface{}) (*Log func (c *LogConfigClient) List(opts *ListOpts) (*LogConfigCollection, error) { resp := &LogConfigCollection{} err := c.rancherClient.doList(LOG_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *LogConfigCollection) Next() (*LogConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &LogConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *LogConfigClient) ById(id string) (*LogConfig, error) { resp := &LogConfig{} err := c.rancherClient.doById(LOG_CONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_machine.go b/vendor/github.com/rancher/go-rancher/v2/generated_machine.go similarity index 86% rename from vendor/github.com/rancher/go-rancher/client/generated_machine.go rename to vendor/github.com/rancher/go-rancher/v2/generated_machine.go index a62d077..be7be96 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_machine.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_machine.go @@ -9,16 +9,22 @@ type Machine struct { 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"` @@ -47,6 +53,8 @@ type Machine struct { 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"` @@ -64,7 +72,8 @@ type Machine struct { type MachineCollection struct { Collection - Data []Machine `json:"data,omitempty"` + Data []Machine `json:"data,omitempty"` + client *MachineClient } type MachineClient struct { @@ -110,9 +119,20 @@ func (c *MachineClient) Update(existing *Machine, updates interface{}) (*Machine func (c *MachineClient) List(opts *ListOpts) (*MachineCollection, error) { resp := &MachineCollection{} err := c.rancherClient.doList(MACHINE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *MachineCollection) Next() (*MachineCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &MachineCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *MachineClient) ById(id string) (*Machine, error) { resp := &Machine{} err := c.rancherClient.doById(MACHINE_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_machine_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go similarity index 90% rename from vendor/github.com/rancher/go-rancher/client/generated_machine_driver.go rename to vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go index c54bcd4..b20c78c 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_machine_driver.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go @@ -31,6 +31,8 @@ type MachineDriver struct { Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + SchemaVersion string `json:"schemaVersion,omitempty" yaml:"schema_version,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` @@ -48,7 +50,8 @@ type MachineDriver struct { type MachineDriverCollection struct { Collection - Data []MachineDriver `json:"data,omitempty"` + Data []MachineDriver `json:"data,omitempty"` + client *MachineDriverClient } type MachineDriverClient struct { @@ -96,9 +99,20 @@ func (c *MachineDriverClient) Update(existing *MachineDriver, updates interface{ func (c *MachineDriverClient) List(opts *ListOpts) (*MachineDriverCollection, error) { resp := &MachineDriverCollection{} err := c.rancherClient.doList(MACHINE_DRIVER_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *MachineDriverCollection) Next() (*MachineDriverCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &MachineDriverCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *MachineDriverClient) ById(id string) (*MachineDriver, error) { resp := &MachineDriver{} err := c.rancherClient.doById(MACHINE_DRIVER_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_mount.go b/vendor/github.com/rancher/go-rancher/v2/generated_mount.go similarity index 90% rename from vendor/github.com/rancher/go-rancher/client/generated_mount.go rename to vendor/github.com/rancher/go-rancher/v2/generated_mount.go index 59c9763..efa68a5 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_mount.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_mount.go @@ -44,7 +44,8 @@ type Mount struct { type MountCollection struct { Collection - Data []Mount `json:"data,omitempty"` + Data []Mount `json:"data,omitempty"` + client *MountClient } type MountClient struct { @@ -86,9 +87,20 @@ func (c *MountClient) Update(existing *Mount, updates interface{}) (*Mount, erro func (c *MountClient) List(opts *ListOpts) (*MountCollection, error) { resp := &MountCollection{} err := c.rancherClient.doList(MOUNT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *MountCollection) Next() (*MountCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &MountCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *MountClient) ById(id string) (*Mount, error) { resp := &Mount{} err := c.rancherClient.doById(MOUNT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go b/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go new file mode 100644 index 0000000..62d4f4f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go @@ -0,0 +1,87 @@ +package client + +const ( + MOUNT_ENTRY_TYPE = "mountEntry" +) + +type MountEntry struct { + Resource + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + InstanceName string `json:"instanceName,omitempty" yaml:"instance_name,omitempty"` + + Path string `json:"path,omitempty" yaml:"path,omitempty"` + + VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` + + VolumeName string `json:"volumeName,omitempty" yaml:"volume_name,omitempty"` +} + +type MountEntryCollection struct { + Collection + Data []MountEntry `json:"data,omitempty"` + client *MountEntryClient +} + +type MountEntryClient struct { + rancherClient *RancherClient +} + +type MountEntryOperations interface { + List(opts *ListOpts) (*MountEntryCollection, error) + Create(opts *MountEntry) (*MountEntry, error) + Update(existing *MountEntry, updates interface{}) (*MountEntry, error) + ById(id string) (*MountEntry, error) + Delete(container *MountEntry) error +} + +func newMountEntryClient(rancherClient *RancherClient) *MountEntryClient { + return &MountEntryClient{ + rancherClient: rancherClient, + } +} + +func (c *MountEntryClient) Create(container *MountEntry) (*MountEntry, error) { + resp := &MountEntry{} + err := c.rancherClient.doCreate(MOUNT_ENTRY_TYPE, container, resp) + return resp, err +} + +func (c *MountEntryClient) Update(existing *MountEntry, updates interface{}) (*MountEntry, error) { + resp := &MountEntry{} + err := c.rancherClient.doUpdate(MOUNT_ENTRY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *MountEntryClient) List(opts *ListOpts) (*MountEntryCollection, error) { + resp := &MountEntryCollection{} + err := c.rancherClient.doList(MOUNT_ENTRY_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *MountEntryCollection) Next() (*MountEntryCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &MountEntryCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *MountEntryClient) ById(id string) (*MountEntry, error) { + resp := &MountEntry{} + err := c.rancherClient.doById(MOUNT_ENTRY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *MountEntryClient) Delete(container *MountEntry) error { + return c.rancherClient.doResourceDelete(MOUNT_ENTRY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_network.go b/vendor/github.com/rancher/go-rancher/v2/generated_network.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_network.go rename to vendor/github.com/rancher/go-rancher/v2/generated_network.go index 53c59be..571acf9 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_network.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_network.go @@ -15,16 +15,28 @@ type Network struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` + Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` + + HostPorts bool `json:"hostPorts,omitempty" yaml:"host_ports,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + NetworkDriverId string `json:"networkDriverId,omitempty" yaml:"network_driver_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"` + Subnets []Subnet `json:"subnets,omitempty" yaml:"subnets,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -36,7 +48,8 @@ type Network struct { type NetworkCollection struct { Collection - Data []Network `json:"data,omitempty"` + Data []Network `json:"data,omitempty"` + client *NetworkClient } type NetworkClient struct { @@ -86,9 +99,20 @@ func (c *NetworkClient) Update(existing *Network, updates interface{}) (*Network func (c *NetworkClient) List(opts *ListOpts) (*NetworkCollection, error) { resp := &NetworkCollection{} err := c.rancherClient.doList(NETWORK_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *NetworkCollection) Next() (*NetworkCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &NetworkCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *NetworkClient) ById(id string) (*Network, error) { resp := &Network{} err := c.rancherClient.doById(NETWORK_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go new file mode 100644 index 0000000..ea35cfe --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go @@ -0,0 +1,166 @@ +package client + +const ( + NETWORK_DRIVER_TYPE = "networkDriver" +) + +type NetworkDriver struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + CniConfig map[string]interface{} `json:"cniConfig,omitempty" yaml:"cni_config,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + DefaultNetwork DefaultNetwork `json:"defaultNetwork,omitempty" yaml:"default_network,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"` + + NetworkMetadata map[string]interface{} `json:"networkMetadata,omitempty" yaml:"network_metadata,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 NetworkDriverCollection struct { + Collection + Data []NetworkDriver `json:"data,omitempty"` + client *NetworkDriverClient +} + +type NetworkDriverClient struct { + rancherClient *RancherClient +} + +type NetworkDriverOperations interface { + List(opts *ListOpts) (*NetworkDriverCollection, error) + Create(opts *NetworkDriver) (*NetworkDriver, error) + Update(existing *NetworkDriver, updates interface{}) (*NetworkDriver, error) + ById(id string) (*NetworkDriver, error) + Delete(container *NetworkDriver) error + + ActionActivate(*NetworkDriver) (*NetworkDriver, error) + + ActionCreate(*NetworkDriver) (*NetworkDriver, error) + + ActionDeactivate(*NetworkDriver) (*NetworkDriver, error) + + ActionRemove(*NetworkDriver) (*NetworkDriver, error) + + ActionUpdate(*NetworkDriver) (*NetworkDriver, error) +} + +func newNetworkDriverClient(rancherClient *RancherClient) *NetworkDriverClient { + return &NetworkDriverClient{ + rancherClient: rancherClient, + } +} + +func (c *NetworkDriverClient) Create(container *NetworkDriver) (*NetworkDriver, error) { + resp := &NetworkDriver{} + err := c.rancherClient.doCreate(NETWORK_DRIVER_TYPE, container, resp) + return resp, err +} + +func (c *NetworkDriverClient) Update(existing *NetworkDriver, updates interface{}) (*NetworkDriver, error) { + resp := &NetworkDriver{} + err := c.rancherClient.doUpdate(NETWORK_DRIVER_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *NetworkDriverClient) List(opts *ListOpts) (*NetworkDriverCollection, error) { + resp := &NetworkDriverCollection{} + err := c.rancherClient.doList(NETWORK_DRIVER_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *NetworkDriverCollection) Next() (*NetworkDriverCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &NetworkDriverCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *NetworkDriverClient) ById(id string) (*NetworkDriver, error) { + resp := &NetworkDriver{} + err := c.rancherClient.doById(NETWORK_DRIVER_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *NetworkDriverClient) Delete(container *NetworkDriver) error { + return c.rancherClient.doResourceDelete(NETWORK_DRIVER_TYPE, &container.Resource) +} + +func (c *NetworkDriverClient) ActionActivate(resource *NetworkDriver) (*NetworkDriver, error) { + + resp := &NetworkDriver{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverClient) ActionCreate(resource *NetworkDriver) (*NetworkDriver, error) { + + resp := &NetworkDriver{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverClient) ActionDeactivate(resource *NetworkDriver) (*NetworkDriver, error) { + + resp := &NetworkDriver{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverClient) ActionRemove(resource *NetworkDriver) (*NetworkDriver, error) { + + resp := &NetworkDriver{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverClient) ActionUpdate(resource *NetworkDriver) (*NetworkDriver, error) { + + resp := &NetworkDriver{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go new file mode 100644 index 0000000..9317af3 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go @@ -0,0 +1,305 @@ +package client + +const ( + NETWORK_DRIVER_SERVICE_TYPE = "networkDriverService" +) + +type NetworkDriverService 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"` + + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + + LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` + + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + NetworkDriver NetworkDriver `json:"networkDriver,omitempty" yaml:"network_driver,omitempty"` + + PublicEndpoints []PublicEndpoint `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 []SecondaryLaunchConfig `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"` + + System bool `json:"system,omitempty" yaml:"system,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 NetworkDriverServiceCollection struct { + Collection + Data []NetworkDriverService `json:"data,omitempty"` + client *NetworkDriverServiceClient +} + +type NetworkDriverServiceClient struct { + rancherClient *RancherClient +} + +type NetworkDriverServiceOperations interface { + List(opts *ListOpts) (*NetworkDriverServiceCollection, error) + Create(opts *NetworkDriverService) (*NetworkDriverService, error) + Update(existing *NetworkDriverService, updates interface{}) (*NetworkDriverService, error) + ById(id string) (*NetworkDriverService, error) + Delete(container *NetworkDriverService) error + + ActionActivate(*NetworkDriverService) (*Service, error) + + ActionAddservicelink(*NetworkDriverService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionCancelupgrade(*NetworkDriverService) (*Service, error) + + ActionContinueupgrade(*NetworkDriverService) (*Service, error) + + ActionCreate(*NetworkDriverService) (*Service, error) + + ActionDeactivate(*NetworkDriverService) (*Service, error) + + ActionFinishupgrade(*NetworkDriverService) (*Service, error) + + ActionRemove(*NetworkDriverService) (*Service, error) + + ActionRemoveservicelink(*NetworkDriverService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionRestart(*NetworkDriverService, *ServiceRestart) (*Service, error) + + ActionRollback(*NetworkDriverService) (*Service, error) + + ActionSetservicelinks(*NetworkDriverService, *SetServiceLinksInput) (*Service, error) + + ActionUpdate(*NetworkDriverService) (*Service, error) + + ActionUpgrade(*NetworkDriverService, *ServiceUpgrade) (*Service, error) +} + +func newNetworkDriverServiceClient(rancherClient *RancherClient) *NetworkDriverServiceClient { + return &NetworkDriverServiceClient{ + rancherClient: rancherClient, + } +} + +func (c *NetworkDriverServiceClient) Create(container *NetworkDriverService) (*NetworkDriverService, error) { + resp := &NetworkDriverService{} + err := c.rancherClient.doCreate(NETWORK_DRIVER_SERVICE_TYPE, container, resp) + return resp, err +} + +func (c *NetworkDriverServiceClient) Update(existing *NetworkDriverService, updates interface{}) (*NetworkDriverService, error) { + resp := &NetworkDriverService{} + err := c.rancherClient.doUpdate(NETWORK_DRIVER_SERVICE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *NetworkDriverServiceClient) List(opts *ListOpts) (*NetworkDriverServiceCollection, error) { + resp := &NetworkDriverServiceCollection{} + err := c.rancherClient.doList(NETWORK_DRIVER_SERVICE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *NetworkDriverServiceCollection) Next() (*NetworkDriverServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &NetworkDriverServiceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *NetworkDriverServiceClient) ById(id string) (*NetworkDriverService, error) { + resp := &NetworkDriverService{} + err := c.rancherClient.doById(NETWORK_DRIVER_SERVICE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *NetworkDriverServiceClient) Delete(container *NetworkDriverService) error { + return c.rancherClient.doResourceDelete(NETWORK_DRIVER_SERVICE_TYPE, &container.Resource) +} + +func (c *NetworkDriverServiceClient) ActionActivate(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionAddservicelink(resource *NetworkDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionCancelupgrade(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionContinueupgrade(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionCreate(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionDeactivate(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionFinishupgrade(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionRemove(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionRemoveservicelink(resource *NetworkDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionRestart(resource *NetworkDriverService, input *ServiceRestart) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "restart", &resource.Resource, input, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionRollback(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionSetservicelinks(resource *NetworkDriverService, input *SetServiceLinksInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionUpdate(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionUpgrade(resource *NetworkDriverService, input *ServiceUpgrade) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_nfs_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_nfs_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go index d7fecc4..1c0143f 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_nfs_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go @@ -16,7 +16,8 @@ type NfsConfig struct { type NfsConfigCollection struct { Collection - Data []NfsConfig `json:"data,omitempty"` + Data []NfsConfig `json:"data,omitempty"` + client *NfsConfigClient } type NfsConfigClient struct { @@ -52,9 +53,20 @@ func (c *NfsConfigClient) Update(existing *NfsConfig, updates interface{}) (*Nfs func (c *NfsConfigClient) List(opts *ListOpts) (*NfsConfigCollection, error) { resp := &NfsConfigCollection{} err := c.rancherClient.doList(NFS_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *NfsConfigCollection) Next() (*NfsConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &NfsConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *NfsConfigClient) ById(id string) (*NfsConfig, error) { resp := &NfsConfig{} err := c.rancherClient.doById(NFS_CONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_openldapconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go similarity index 85% rename from vendor/github.com/rancher/go-rancher/client/generated_openldapconfig.go rename to vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go index 7b24f41..07ab953 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_openldapconfig.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go @@ -15,8 +15,12 @@ type Openldapconfig struct { Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` + GroupDNField string `json:"groupDNField,omitempty" yaml:"group_dnfield,omitempty"` + GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"group_member_mapping_attribute,omitempty"` + GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" yaml:"group_member_user_attribute,omitempty"` + GroupNameField string `json:"groupNameField,omitempty" yaml:"group_name_field,omitempty"` GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"group_object_class,omitempty"` @@ -54,7 +58,8 @@ type Openldapconfig struct { type OpenldapconfigCollection struct { Collection - Data []Openldapconfig `json:"data,omitempty"` + Data []Openldapconfig `json:"data,omitempty"` + client *OpenldapconfigClient } type OpenldapconfigClient struct { @@ -90,9 +95,20 @@ func (c *OpenldapconfigClient) Update(existing *Openldapconfig, updates interfac func (c *OpenldapconfigClient) List(opts *ListOpts) (*OpenldapconfigCollection, error) { resp := &OpenldapconfigCollection{} err := c.rancherClient.doList(OPENLDAPCONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *OpenldapconfigCollection) Next() (*OpenldapconfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &OpenldapconfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *OpenldapconfigClient) ById(id string) (*Openldapconfig, error) { resp := &Openldapconfig{} err := c.rancherClient.doById(OPENLDAPCONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_packet_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go similarity index 84% rename from vendor/github.com/rancher/go-rancher/client/generated_packet_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go index f0d03e5..3f3c4ff 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_packet_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go @@ -22,7 +22,8 @@ type PacketConfig struct { type PacketConfigCollection struct { Collection - Data []PacketConfig `json:"data,omitempty"` + Data []PacketConfig `json:"data,omitempty"` + client *PacketConfigClient } type PacketConfigClient struct { @@ -58,9 +59,20 @@ func (c *PacketConfigClient) Update(existing *PacketConfig, updates interface{}) func (c *PacketConfigClient) List(opts *ListOpts) (*PacketConfigCollection, error) { resp := &PacketConfigCollection{} err := c.rancherClient.doList(PACKET_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *PacketConfigCollection) Next() (*PacketConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &PacketConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *PacketConfigClient) ById(id string) (*PacketConfig, error) { resp := &PacketConfig{} err := c.rancherClient.doById(PACKET_CONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_password.go b/vendor/github.com/rancher/go-rancher/v2/generated_password.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_password.go rename to vendor/github.com/rancher/go-rancher/v2/generated_password.go index 427eca3..5fb0d35 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_password.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_password.go @@ -40,7 +40,8 @@ type Password struct { type PasswordCollection struct { Collection - Data []Password `json:"data,omitempty"` + Data []Password `json:"data,omitempty"` + client *PasswordClient } type PasswordClient struct { @@ -90,9 +91,20 @@ func (c *PasswordClient) Update(existing *Password, updates interface{}) (*Passw func (c *PasswordClient) List(opts *ListOpts) (*PasswordCollection, error) { resp := &PasswordCollection{} err := c.rancherClient.doList(PASSWORD_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *PasswordCollection) Next() (*PasswordCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &PasswordCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *PasswordClient) ById(id string) (*Password, error) { resp := &Password{} err := c.rancherClient.doById(PASSWORD_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_physical_host.go b/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go similarity index 91% rename from vendor/github.com/rancher/go-rancher/client/generated_physical_host.go rename to vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go index 99b6236..30039c4 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_physical_host.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go @@ -40,7 +40,8 @@ type PhysicalHost struct { type PhysicalHostCollection struct { Collection - Data []PhysicalHost `json:"data,omitempty"` + Data []PhysicalHost `json:"data,omitempty"` + client *PhysicalHostClient } type PhysicalHostClient struct { @@ -86,9 +87,20 @@ func (c *PhysicalHostClient) Update(existing *PhysicalHost, updates interface{}) func (c *PhysicalHostClient) List(opts *ListOpts) (*PhysicalHostCollection, error) { resp := &PhysicalHostCollection{} err := c.rancherClient.doList(PHYSICAL_HOST_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *PhysicalHostCollection) Next() (*PhysicalHostCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &PhysicalHostCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *PhysicalHostClient) ById(id string) (*PhysicalHost, error) { resp := &PhysicalHost{} err := c.rancherClient.doById(PHYSICAL_HOST_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_port.go b/vendor/github.com/rancher/go-rancher/v2/generated_port.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_port.go rename to vendor/github.com/rancher/go-rancher/v2/generated_port.go index 3db9283..04261f7 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_port.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_port.go @@ -50,7 +50,8 @@ type Port struct { type PortCollection struct { Collection - Data []Port `json:"data,omitempty"` + Data []Port `json:"data,omitempty"` + client *PortClient } type PortClient struct { @@ -100,9 +101,20 @@ func (c *PortClient) Update(existing *Port, updates interface{}) (*Port, error) func (c *PortClient) List(opts *ListOpts) (*PortCollection, error) { resp := &PortCollection{} err := c.rancherClient.doList(PORT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *PortCollection) Next() (*PortCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &PortCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *PortClient) ById(id string) (*Port, error) { resp := &Port{} err := c.rancherClient.doById(PORT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go b/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go new file mode 100644 index 0000000..0e03656 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go @@ -0,0 +1,95 @@ +package client + +const ( + PORT_RULE_TYPE = "portRule" +) + +type PortRule struct { + Resource + + BackendName string `json:"backendName,omitempty" yaml:"backend_name,omitempty"` + + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + + Path string `json:"path,omitempty" yaml:"path,omitempty"` + + Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` + + Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` + + Selector string `json:"selector,omitempty" yaml:"selector,omitempty"` + + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + SourcePort int64 `json:"sourcePort,omitempty" yaml:"source_port,omitempty"` + + TargetPort int64 `json:"targetPort,omitempty" yaml:"target_port,omitempty"` +} + +type PortRuleCollection struct { + Collection + Data []PortRule `json:"data,omitempty"` + client *PortRuleClient +} + +type PortRuleClient struct { + rancherClient *RancherClient +} + +type PortRuleOperations interface { + List(opts *ListOpts) (*PortRuleCollection, error) + Create(opts *PortRule) (*PortRule, error) + Update(existing *PortRule, updates interface{}) (*PortRule, error) + ById(id string) (*PortRule, error) + Delete(container *PortRule) error +} + +func newPortRuleClient(rancherClient *RancherClient) *PortRuleClient { + return &PortRuleClient{ + rancherClient: rancherClient, + } +} + +func (c *PortRuleClient) Create(container *PortRule) (*PortRule, error) { + resp := &PortRule{} + err := c.rancherClient.doCreate(PORT_RULE_TYPE, container, resp) + return resp, err +} + +func (c *PortRuleClient) Update(existing *PortRule, updates interface{}) (*PortRule, error) { + resp := &PortRule{} + err := c.rancherClient.doUpdate(PORT_RULE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *PortRuleClient) List(opts *ListOpts) (*PortRuleCollection, error) { + resp := &PortRuleCollection{} + err := c.rancherClient.doList(PORT_RULE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *PortRuleCollection) Next() (*PortRuleCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &PortRuleCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *PortRuleClient) ById(id string) (*PortRule, error) { + resp := &PortRule{} + err := c.rancherClient.doById(PORT_RULE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *PortRuleClient) Delete(container *PortRule) error { + return c.rancherClient.doResourceDelete(PORT_RULE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_process_definition.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_process_definition.go rename to vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go index e640330..9da63d8 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_process_definition.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go @@ -19,12 +19,13 @@ type ProcessDefinition struct { ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` - StateTransitions []interface{} `json:"stateTransitions,omitempty" yaml:"state_transitions,omitempty"` + StateTransitions []StateTransition `json:"stateTransitions,omitempty" yaml:"state_transitions,omitempty"` } type ProcessDefinitionCollection struct { Collection - Data []ProcessDefinition `json:"data,omitempty"` + Data []ProcessDefinition `json:"data,omitempty"` + client *ProcessDefinitionClient } type ProcessDefinitionClient struct { @@ -60,9 +61,20 @@ func (c *ProcessDefinitionClient) Update(existing *ProcessDefinition, updates in func (c *ProcessDefinitionClient) List(opts *ListOpts) (*ProcessDefinitionCollection, error) { resp := &ProcessDefinitionCollection{} err := c.rancherClient.doList(PROCESS_DEFINITION_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ProcessDefinitionCollection) Next() (*ProcessDefinitionCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ProcessDefinitionCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ProcessDefinitionClient) ById(id string) (*ProcessDefinition, error) { resp := &ProcessDefinition{} err := c.rancherClient.doById(PROCESS_DEFINITION_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_process_execution.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_process_execution.go rename to vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go index 05e1291..7356dce 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_process_execution.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go @@ -18,7 +18,8 @@ type ProcessExecution struct { type ProcessExecutionCollection struct { Collection - Data []ProcessExecution `json:"data,omitempty"` + Data []ProcessExecution `json:"data,omitempty"` + client *ProcessExecutionClient } type ProcessExecutionClient struct { @@ -54,9 +55,20 @@ func (c *ProcessExecutionClient) Update(existing *ProcessExecution, updates inte func (c *ProcessExecutionClient) List(opts *ListOpts) (*ProcessExecutionCollection, error) { resp := &ProcessExecutionCollection{} err := c.rancherClient.doList(PROCESS_EXECUTION_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ProcessExecutionCollection) Next() (*ProcessExecutionCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ProcessExecutionCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ProcessExecutionClient) ById(id string) (*ProcessExecution, error) { resp := &ProcessExecution{} err := c.rancherClient.doById(PROCESS_EXECUTION_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_process_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_process_instance.go rename to vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go index 6ba08df..134967e 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_process_instance.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go @@ -11,6 +11,8 @@ type ProcessInstance struct { EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` + ExecutionCount int64 `json:"executionCount,omitempty" yaml:"execution_count,omitempty"` + ExitReason string `json:"exitReason,omitempty" yaml:"exit_reason,omitempty"` Phase string `json:"phase,omitempty" yaml:"phase,omitempty"` @@ -25,6 +27,8 @@ type ProcessInstance struct { Result string `json:"result,omitempty" yaml:"result,omitempty"` + RunAfter string `json:"runAfter,omitempty" yaml:"run_after,omitempty"` + RunningProcessServerId string `json:"runningProcessServerId,omitempty" yaml:"running_process_server_id,omitempty"` StartProcessServerId string `json:"startProcessServerId,omitempty" yaml:"start_process_server_id,omitempty"` @@ -34,7 +38,8 @@ type ProcessInstance struct { type ProcessInstanceCollection struct { Collection - Data []ProcessInstance `json:"data,omitempty"` + Data []ProcessInstance `json:"data,omitempty"` + client *ProcessInstanceClient } type ProcessInstanceClient struct { @@ -70,9 +75,20 @@ func (c *ProcessInstanceClient) Update(existing *ProcessInstance, updates interf func (c *ProcessInstanceClient) List(opts *ListOpts) (*ProcessInstanceCollection, error) { resp := &ProcessInstanceCollection{} err := c.rancherClient.doList(PROCESS_INSTANCE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ProcessInstanceCollection) Next() (*ProcessInstanceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ProcessInstanceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ProcessInstanceClient) ById(id string) (*ProcessInstance, error) { resp := &ProcessInstance{} err := c.rancherClient.doById(PROCESS_INSTANCE_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_project.go b/vendor/github.com/rancher/go-rancher/v2/generated_project.go similarity index 81% rename from vendor/github.com/rancher/go-rancher/client/generated_project.go rename to vendor/github.com/rancher/go-rancher/v2/generated_project.go index 17f2140..ef97af6 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_project.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_project.go @@ -13,19 +13,21 @@ type Project struct { Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + DefaultNetworkId string `json:"defaultNetworkId,omitempty" yaml:"default_network_id,omitempty"` + Description string `json:"description,omitempty" yaml:"description,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,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"` + Members []ProjectMember `json:"members,omitempty" yaml:"members,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` - PublicDns bool `json:"publicDns,omitempty" yaml:"public_dns,omitempty"` + Orchestration string `json:"orchestration,omitempty" yaml:"orchestration,omitempty"` + + ProjectTemplateId string `json:"projectTemplateId,omitempty" yaml:"project_template_id,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -35,8 +37,6 @@ type Project struct { 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"` @@ -45,12 +45,15 @@ type Project struct { Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + Version string `json:"version,omitempty" yaml:"version,omitempty"` + VirtualMachine bool `json:"virtualMachine,omitempty" yaml:"virtual_machine,omitempty"` } type ProjectCollection struct { Collection - Data []Project `json:"data,omitempty"` + Data []Project `json:"data,omitempty"` + client *ProjectClient } type ProjectClient struct { @@ -79,6 +82,8 @@ type ProjectOperations interface { ActionSetmembers(*Project, *SetProjectMembersInput) (*SetProjectMembersInput, error) ActionUpdate(*Project) (*Account, error) + + ActionUpgrade(*Project) (*Account, error) } func newProjectClient(rancherClient *RancherClient) *ProjectClient { @@ -102,9 +107,20 @@ func (c *ProjectClient) Update(existing *Project, updates interface{}) (*Project func (c *ProjectClient) List(opts *ListOpts) (*ProjectCollection, error) { resp := &ProjectCollection{} err := c.rancherClient.doList(PROJECT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ProjectCollection) Next() (*ProjectCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ProjectCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ProjectClient) ById(id string) (*Project, error) { resp := &Project{} err := c.rancherClient.doById(PROJECT_TYPE, id, resp) @@ -191,3 +207,12 @@ func (c *ProjectClient) ActionUpdate(resource *Project) (*Account, error) { return resp, err } + +func (c *ProjectClient) ActionUpgrade(resource *Project) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(PROJECT_TYPE, "upgrade", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_project_member.go b/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_project_member.go rename to vendor/github.com/rancher/go-rancher/v2/generated_project_member.go index 82ba10b..96c6a77 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_project_member.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go @@ -42,7 +42,8 @@ type ProjectMember struct { type ProjectMemberCollection struct { Collection - Data []ProjectMember `json:"data,omitempty"` + Data []ProjectMember `json:"data,omitempty"` + client *ProjectMemberClient } type ProjectMemberClient struct { @@ -92,9 +93,20 @@ func (c *ProjectMemberClient) Update(existing *ProjectMember, updates interface{ func (c *ProjectMemberClient) List(opts *ListOpts) (*ProjectMemberCollection, error) { resp := &ProjectMemberCollection{} err := c.rancherClient.doList(PROJECT_MEMBER_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ProjectMemberCollection) Next() (*ProjectMemberCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ProjectMemberCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ProjectMemberClient) ById(id string) (*ProjectMember, error) { resp := &ProjectMember{} err := c.rancherClient.doById(PROJECT_MEMBER_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go new file mode 100644 index 0000000..9c20883 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go @@ -0,0 +1,131 @@ +package client + +const ( + PROJECT_TEMPLATE_TYPE = "projectTemplate" +) + +type ProjectTemplate 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"` + + IsPublic bool `json:"isPublic,omitempty" yaml:"is_public,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"` + + Stacks []CatalogTemplate `json:"stacks,omitempty" yaml:"stacks,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 ProjectTemplateCollection struct { + Collection + Data []ProjectTemplate `json:"data,omitempty"` + client *ProjectTemplateClient +} + +type ProjectTemplateClient struct { + rancherClient *RancherClient +} + +type ProjectTemplateOperations interface { + List(opts *ListOpts) (*ProjectTemplateCollection, error) + Create(opts *ProjectTemplate) (*ProjectTemplate, error) + Update(existing *ProjectTemplate, updates interface{}) (*ProjectTemplate, error) + ById(id string) (*ProjectTemplate, error) + Delete(container *ProjectTemplate) error + + ActionCreate(*ProjectTemplate) (*ProjectTemplate, error) + + ActionRemove(*ProjectTemplate) (*ProjectTemplate, error) +} + +func newProjectTemplateClient(rancherClient *RancherClient) *ProjectTemplateClient { + return &ProjectTemplateClient{ + rancherClient: rancherClient, + } +} + +func (c *ProjectTemplateClient) Create(container *ProjectTemplate) (*ProjectTemplate, error) { + resp := &ProjectTemplate{} + err := c.rancherClient.doCreate(PROJECT_TEMPLATE_TYPE, container, resp) + return resp, err +} + +func (c *ProjectTemplateClient) Update(existing *ProjectTemplate, updates interface{}) (*ProjectTemplate, error) { + resp := &ProjectTemplate{} + err := c.rancherClient.doUpdate(PROJECT_TEMPLATE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ProjectTemplateClient) List(opts *ListOpts) (*ProjectTemplateCollection, error) { + resp := &ProjectTemplateCollection{} + err := c.rancherClient.doList(PROJECT_TEMPLATE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *ProjectTemplateCollection) Next() (*ProjectTemplateCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ProjectTemplateCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *ProjectTemplateClient) ById(id string) (*ProjectTemplate, error) { + resp := &ProjectTemplate{} + err := c.rancherClient.doById(PROJECT_TEMPLATE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ProjectTemplateClient) Delete(container *ProjectTemplate) error { + return c.rancherClient.doResourceDelete(PROJECT_TEMPLATE_TYPE, &container.Resource) +} + +func (c *ProjectTemplateClient) ActionCreate(resource *ProjectTemplate) (*ProjectTemplate, error) { + + resp := &ProjectTemplate{} + + err := c.rancherClient.doAction(PROJECT_TEMPLATE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectTemplateClient) ActionRemove(resource *ProjectTemplate) (*ProjectTemplate, error) { + + resp := &ProjectTemplate{} + + err := c.rancherClient.doAction(PROJECT_TEMPLATE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_public_endpoint.go b/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_public_endpoint.go rename to vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go index 3d85858..14898e4 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_public_endpoint.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go @@ -20,7 +20,8 @@ type PublicEndpoint struct { type PublicEndpointCollection struct { Collection - Data []PublicEndpoint `json:"data,omitempty"` + Data []PublicEndpoint `json:"data,omitempty"` + client *PublicEndpointClient } type PublicEndpointClient struct { @@ -56,9 +57,20 @@ func (c *PublicEndpointClient) Update(existing *PublicEndpoint, updates interfac func (c *PublicEndpointClient) List(opts *ListOpts) (*PublicEndpointCollection, error) { resp := &PublicEndpointCollection{} err := c.rancherClient.doList(PUBLIC_ENDPOINT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *PublicEndpointCollection) Next() (*PublicEndpointCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &PublicEndpointCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *PublicEndpointClient) ById(id string) (*PublicEndpoint, error) { resp := &PublicEndpoint{} err := c.rancherClient.doById(PUBLIC_ENDPOINT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_publish.go b/vendor/github.com/rancher/go-rancher/v2/generated_publish.go similarity index 86% rename from vendor/github.com/rancher/go-rancher/client/generated_publish.go rename to vendor/github.com/rancher/go-rancher/v2/generated_publish.go index 9071207..af7f7cd 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_publish.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_publish.go @@ -32,7 +32,8 @@ type Publish struct { type PublishCollection struct { Collection - Data []Publish `json:"data,omitempty"` + Data []Publish `json:"data,omitempty"` + client *PublishClient } type PublishClient struct { @@ -68,9 +69,20 @@ func (c *PublishClient) Update(existing *Publish, updates interface{}) (*Publish func (c *PublishClient) List(opts *ListOpts) (*PublishCollection, error) { resp := &PublishCollection{} err := c.rancherClient.doList(PUBLISH_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *PublishCollection) Next() (*PublishCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &PublishCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *PublishClient) ById(id string) (*Publish, error) { resp := &Publish{} err := c.rancherClient.doById(PUBLISH_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_pull_task.go b/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go similarity index 75% rename from vendor/github.com/rancher/go-rancher/client/generated_pull_task.go rename to vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go index a077e88..3958091 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_pull_task.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go @@ -44,7 +44,8 @@ type PullTask struct { type PullTaskCollection struct { Collection - Data []PullTask `json:"data,omitempty"` + Data []PullTask `json:"data,omitempty"` + client *PullTaskClient } type PullTaskClient struct { @@ -57,6 +58,10 @@ type PullTaskOperations interface { Update(existing *PullTask, updates interface{}) (*PullTask, error) ById(id string) (*PullTask, error) Delete(container *PullTask) error + + ActionCreate(*PullTask) (*GenericObject, error) + + ActionRemove(*PullTask) (*GenericObject, error) } func newPullTaskClient(rancherClient *RancherClient) *PullTaskClient { @@ -80,9 +85,20 @@ func (c *PullTaskClient) Update(existing *PullTask, updates interface{}) (*PullT func (c *PullTaskClient) List(opts *ListOpts) (*PullTaskCollection, error) { resp := &PullTaskCollection{} err := c.rancherClient.doList(PULL_TASK_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *PullTaskCollection) Next() (*PullTaskCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &PullTaskCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *PullTaskClient) ById(id string) (*PullTask, error) { resp := &PullTask{} err := c.rancherClient.doById(PULL_TASK_TYPE, id, resp) @@ -97,3 +113,21 @@ func (c *PullTaskClient) ById(id string) (*PullTask, error) { func (c *PullTaskClient) Delete(container *PullTask) error { return c.rancherClient.doResourceDelete(PULL_TASK_TYPE, &container.Resource) } + +func (c *PullTaskClient) ActionCreate(resource *PullTask) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(PULL_TASK_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PullTaskClient) ActionRemove(resource *PullTask) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(PULL_TASK_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_recreate_on_quorum_strategy_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_recreate_on_quorum_strategy_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go index a8a89ed..ad1e718 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_recreate_on_quorum_strategy_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go @@ -12,7 +12,8 @@ type RecreateOnQuorumStrategyConfig struct { type RecreateOnQuorumStrategyConfigCollection struct { Collection - Data []RecreateOnQuorumStrategyConfig `json:"data,omitempty"` + Data []RecreateOnQuorumStrategyConfig `json:"data,omitempty"` + client *RecreateOnQuorumStrategyConfigClient } type RecreateOnQuorumStrategyConfigClient struct { @@ -48,9 +49,20 @@ func (c *RecreateOnQuorumStrategyConfigClient) Update(existing *RecreateOnQuorum func (c *RecreateOnQuorumStrategyConfigClient) List(opts *ListOpts) (*RecreateOnQuorumStrategyConfigCollection, error) { resp := &RecreateOnQuorumStrategyConfigCollection{} err := c.rancherClient.doList(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *RecreateOnQuorumStrategyConfigCollection) Next() (*RecreateOnQuorumStrategyConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &RecreateOnQuorumStrategyConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *RecreateOnQuorumStrategyConfigClient) ById(id string) (*RecreateOnQuorumStrategyConfig, error) { resp := &RecreateOnQuorumStrategyConfig{} err := c.rancherClient.doById(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_register.go b/vendor/github.com/rancher/go-rancher/v2/generated_register.go similarity index 74% rename from vendor/github.com/rancher/go-rancher/client/generated_register.go rename to vendor/github.com/rancher/go-rancher/v2/generated_register.go index 510cd16..abbdd80 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_register.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_register.go @@ -27,6 +27,8 @@ type Register struct { Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + ResourceData map[string]interface{} `json:"resourceData,omitempty" yaml:"resource_data,omitempty"` + SecretKey string `json:"secretKey,omitempty" yaml:"secret_key,omitempty"` State string `json:"state,omitempty" yaml:"state,omitempty"` @@ -42,7 +44,8 @@ type Register struct { type RegisterCollection struct { Collection - Data []Register `json:"data,omitempty"` + Data []Register `json:"data,omitempty"` + client *RegisterClient } type RegisterClient struct { @@ -56,6 +59,10 @@ type RegisterOperations interface { ById(id string) (*Register, error) Delete(container *Register) error + ActionCreate(*Register) (*GenericObject, error) + + ActionRemove(*Register) (*GenericObject, error) + ActionStop(*Register, *InstanceStop) (*Instance, error) } @@ -80,9 +87,20 @@ func (c *RegisterClient) Update(existing *Register, updates interface{}) (*Regis func (c *RegisterClient) List(opts *ListOpts) (*RegisterCollection, error) { resp := &RegisterCollection{} err := c.rancherClient.doList(REGISTER_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *RegisterCollection) Next() (*RegisterCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &RegisterCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *RegisterClient) ById(id string) (*Register, error) { resp := &Register{} err := c.rancherClient.doById(REGISTER_TYPE, id, resp) @@ -98,6 +116,24 @@ func (c *RegisterClient) Delete(container *Register) error { return c.rancherClient.doResourceDelete(REGISTER_TYPE, &container.Resource) } +func (c *RegisterClient) ActionCreate(resource *Register) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(REGISTER_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegisterClient) ActionRemove(resource *Register) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(REGISTER_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + func (c *RegisterClient) ActionStop(resource *Register, input *InstanceStop) (*Instance, error) { resp := &Instance{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_registration_token.go b/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_registration_token.go rename to vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go index 01b8cd8..1cbf178 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_registration_token.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go @@ -44,7 +44,8 @@ type RegistrationToken struct { type RegistrationTokenCollection struct { Collection - Data []RegistrationToken `json:"data,omitempty"` + Data []RegistrationToken `json:"data,omitempty"` + client *RegistrationTokenClient } type RegistrationTokenClient struct { @@ -92,9 +93,20 @@ func (c *RegistrationTokenClient) Update(existing *RegistrationToken, updates in func (c *RegistrationTokenClient) List(opts *ListOpts) (*RegistrationTokenCollection, error) { resp := &RegistrationTokenCollection{} err := c.rancherClient.doList(REGISTRATION_TOKEN_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *RegistrationTokenCollection) Next() (*RegistrationTokenCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &RegistrationTokenCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *RegistrationTokenClient) ById(id string) (*RegistrationToken, error) { resp := &RegistrationToken{} err := c.rancherClient.doById(REGISTRATION_TOKEN_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_registry.go b/vendor/github.com/rancher/go-rancher/v2/generated_registry.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_registry.go rename to vendor/github.com/rancher/go-rancher/v2/generated_registry.go index 6dbeb4f..e5dae98 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_registry.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_registry.go @@ -48,7 +48,8 @@ type Registry struct { type RegistryCollection struct { Collection - Data []Registry `json:"data,omitempty"` + Data []Registry `json:"data,omitempty"` + client *RegistryClient } type RegistryClient struct { @@ -98,9 +99,20 @@ func (c *RegistryClient) Update(existing *Registry, updates interface{}) (*Regis func (c *RegistryClient) List(opts *ListOpts) (*RegistryCollection, error) { resp := &RegistryCollection{} err := c.rancherClient.doList(REGISTRY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *RegistryCollection) Next() (*RegistryCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &RegistryCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *RegistryClient) ById(id string) (*Registry, error) { resp := &Registry{} err := c.rancherClient.doById(REGISTRY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_registry_credential.go b/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_registry_credential.go rename to vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go index e17ab42..59bd5f8 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_registry_credential.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go @@ -44,7 +44,8 @@ type RegistryCredential struct { type RegistryCredentialCollection struct { Collection - Data []RegistryCredential `json:"data,omitempty"` + Data []RegistryCredential `json:"data,omitempty"` + client *RegistryCredentialClient } type RegistryCredentialClient struct { @@ -92,9 +93,20 @@ func (c *RegistryCredentialClient) Update(existing *RegistryCredential, updates func (c *RegistryCredentialClient) List(opts *ListOpts) (*RegistryCredentialCollection, error) { resp := &RegistryCredentialCollection{} err := c.rancherClient.doList(REGISTRY_CREDENTIAL_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *RegistryCredentialCollection) Next() (*RegistryCredentialCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &RegistryCredentialCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *RegistryCredentialClient) ById(id string) (*RegistryCredential, error) { resp := &RegistryCredential{} err := c.rancherClient.doById(REGISTRY_CREDENTIAL_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_resource_definition.go b/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_resource_definition.go rename to vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go index bb9a4a1..bc65daa 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_resource_definition.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go @@ -12,7 +12,8 @@ type ResourceDefinition struct { type ResourceDefinitionCollection struct { Collection - Data []ResourceDefinition `json:"data,omitempty"` + Data []ResourceDefinition `json:"data,omitempty"` + client *ResourceDefinitionClient } type ResourceDefinitionClient struct { @@ -48,9 +49,20 @@ func (c *ResourceDefinitionClient) Update(existing *ResourceDefinition, updates func (c *ResourceDefinitionClient) List(opts *ListOpts) (*ResourceDefinitionCollection, error) { resp := &ResourceDefinitionCollection{} err := c.rancherClient.doList(RESOURCE_DEFINITION_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ResourceDefinitionCollection) Next() (*ResourceDefinitionCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ResourceDefinitionCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ResourceDefinitionClient) ById(id string) (*ResourceDefinition, error) { resp := &ResourceDefinition{} err := c.rancherClient.doById(RESOURCE_DEFINITION_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_restart_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_restart_policy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go index f301adb..23c4d81 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_restart_policy.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go @@ -14,7 +14,8 @@ type RestartPolicy struct { type RestartPolicyCollection struct { Collection - Data []RestartPolicy `json:"data,omitempty"` + Data []RestartPolicy `json:"data,omitempty"` + client *RestartPolicyClient } type RestartPolicyClient struct { @@ -50,9 +51,20 @@ func (c *RestartPolicyClient) Update(existing *RestartPolicy, updates interface{ func (c *RestartPolicyClient) List(opts *ListOpts) (*RestartPolicyCollection, error) { resp := &RestartPolicyCollection{} err := c.rancherClient.doList(RESTART_POLICY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *RestartPolicyCollection) Next() (*RestartPolicyCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &RestartPolicyCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *RestartPolicyClient) ById(id string) (*RestartPolicy, error) { resp := &RestartPolicy{} err := c.rancherClient.doById(RESTART_POLICY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_restore_from_backup_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_restore_from_backup_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go index a4878de..f417808 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_restore_from_backup_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go @@ -12,7 +12,8 @@ type RestoreFromBackupInput struct { type RestoreFromBackupInputCollection struct { Collection - Data []RestoreFromBackupInput `json:"data,omitempty"` + Data []RestoreFromBackupInput `json:"data,omitempty"` + client *RestoreFromBackupInputClient } type RestoreFromBackupInputClient struct { @@ -48,9 +49,20 @@ func (c *RestoreFromBackupInputClient) Update(existing *RestoreFromBackupInput, func (c *RestoreFromBackupInputClient) List(opts *ListOpts) (*RestoreFromBackupInputCollection, error) { resp := &RestoreFromBackupInputCollection{} err := c.rancherClient.doList(RESTORE_FROM_BACKUP_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *RestoreFromBackupInputCollection) Next() (*RestoreFromBackupInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &RestoreFromBackupInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *RestoreFromBackupInputClient) ById(id string) (*RestoreFromBackupInput, error) { resp := &RestoreFromBackupInput{} err := c.rancherClient.doById(RESTORE_FROM_BACKUP_INPUT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_revert_to_snapshot_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_revert_to_snapshot_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go index db702c9..0612f81 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_revert_to_snapshot_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go @@ -12,7 +12,8 @@ type RevertToSnapshotInput struct { type RevertToSnapshotInputCollection struct { Collection - Data []RevertToSnapshotInput `json:"data,omitempty"` + Data []RevertToSnapshotInput `json:"data,omitempty"` + client *RevertToSnapshotInputClient } type RevertToSnapshotInputClient struct { @@ -48,9 +49,20 @@ func (c *RevertToSnapshotInputClient) Update(existing *RevertToSnapshotInput, up func (c *RevertToSnapshotInputClient) List(opts *ListOpts) (*RevertToSnapshotInputCollection, error) { resp := &RevertToSnapshotInputCollection{} err := c.rancherClient.doList(REVERT_TO_SNAPSHOT_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *RevertToSnapshotInputCollection) Next() (*RevertToSnapshotInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &RevertToSnapshotInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *RevertToSnapshotInputClient) ById(id string) (*RevertToSnapshotInput, error) { resp := &RevertToSnapshotInput{} err := c.rancherClient.doById(REVERT_TO_SNAPSHOT_INPUT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_rolling_restart_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_rolling_restart_strategy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go index 443f9f1..f2384cd 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_rolling_restart_strategy.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go @@ -14,7 +14,8 @@ type RollingRestartStrategy struct { type RollingRestartStrategyCollection struct { Collection - Data []RollingRestartStrategy `json:"data,omitempty"` + Data []RollingRestartStrategy `json:"data,omitempty"` + client *RollingRestartStrategyClient } type RollingRestartStrategyClient struct { @@ -50,9 +51,20 @@ func (c *RollingRestartStrategyClient) Update(existing *RollingRestartStrategy, func (c *RollingRestartStrategyClient) List(opts *ListOpts) (*RollingRestartStrategyCollection, error) { resp := &RollingRestartStrategyCollection{} err := c.rancherClient.doList(ROLLING_RESTART_STRATEGY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *RollingRestartStrategyCollection) Next() (*RollingRestartStrategyCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &RollingRestartStrategyCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *RollingRestartStrategyClient) ById(id string) (*RollingRestartStrategy, error) { resp := &RollingRestartStrategy{} err := c.rancherClient.doById(ROLLING_RESTART_STRATEGY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_scale_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_scale_policy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go index abcd1bb..eb0ac83 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_scale_policy.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go @@ -16,7 +16,8 @@ type ScalePolicy struct { type ScalePolicyCollection struct { Collection - Data []ScalePolicy `json:"data,omitempty"` + Data []ScalePolicy `json:"data,omitempty"` + client *ScalePolicyClient } type ScalePolicyClient struct { @@ -52,9 +53,20 @@ func (c *ScalePolicyClient) Update(existing *ScalePolicy, updates interface{}) ( func (c *ScalePolicyClient) List(opts *ListOpts) (*ScalePolicyCollection, error) { resp := &ScalePolicyCollection{} err := c.rancherClient.doList(SCALE_POLICY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ScalePolicyCollection) Next() (*ScalePolicyCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ScalePolicyCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ScalePolicyClient) ById(id string) (*ScalePolicy, error) { resp := &ScalePolicy{} err := c.rancherClient.doById(SCALE_POLICY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_secondary_launch_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go similarity index 78% rename from vendor/github.com/rancher/go-rancher/client/generated_secondary_launch_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go index ab74255..a5a17fb 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_secondary_launch_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go @@ -15,18 +15,32 @@ type SecondaryLaunchConfig struct { BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,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"` + CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` + Command []string `json:"command,omitempty" yaml:"command,omitempty"` Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` + + CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` + + CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` + + CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` @@ -49,10 +63,14 @@ type SecondaryLaunchConfig struct { Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` - Disks []interface{} `json:"disks,omitempty" yaml:"disks,omitempty"` + DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` + + Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` @@ -69,10 +87,20 @@ type SecondaryLaunchConfig struct { FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` + + HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` + + HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` @@ -81,6 +109,22 @@ type SecondaryLaunchConfig struct { InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` + + IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` + + IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` + + Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` + + Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` + + IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` + + Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` + + KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` @@ -93,12 +137,22 @@ type SecondaryLaunchConfig struct { MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` + MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` + + MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` + + Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` + NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` @@ -107,12 +161,20 @@ type SecondaryLaunchConfig struct { NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` + OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` + + OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` + PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` + PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` + Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` @@ -131,6 +193,10 @@ type SecondaryLaunchConfig struct { SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + + ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` + StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` @@ -139,7 +205,15 @@ type SecondaryLaunchConfig struct { StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - SystemContainer string `json:"systemContainer,omitempty" yaml:"system_container,omitempty"` + StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` + + StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` + + Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,omitempty"` + + Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` Token string `json:"token,omitempty" yaml:"token,omitempty"` @@ -151,10 +225,16 @@ type SecondaryLaunchConfig struct { Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` + Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` + User string `json:"user,omitempty" yaml:"user,omitempty"` Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` + UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` + + Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` @@ -168,7 +248,8 @@ type SecondaryLaunchConfig struct { type SecondaryLaunchConfigCollection struct { Collection - Data []SecondaryLaunchConfig `json:"data,omitempty"` + Data []SecondaryLaunchConfig `json:"data,omitempty"` + client *SecondaryLaunchConfigClient } type SecondaryLaunchConfigClient struct { @@ -206,8 +287,6 @@ type SecondaryLaunchConfigOperations interface { ActionRestore(*SecondaryLaunchConfig) (*Instance, error) - ActionSetlabels(*SecondaryLaunchConfig, *SetLabelsInput) (*Container, error) - ActionStart(*SecondaryLaunchConfig) (*Instance, error) ActionStop(*SecondaryLaunchConfig, *InstanceStop) (*Instance, error) @@ -242,9 +321,20 @@ func (c *SecondaryLaunchConfigClient) Update(existing *SecondaryLaunchConfig, up func (c *SecondaryLaunchConfigClient) List(opts *ListOpts) (*SecondaryLaunchConfigCollection, error) { resp := &SecondaryLaunchConfigCollection{} err := c.rancherClient.doList(SECONDARY_LAUNCH_CONFIG_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *SecondaryLaunchConfigCollection) Next() (*SecondaryLaunchConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SecondaryLaunchConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *SecondaryLaunchConfigClient) ById(id string) (*SecondaryLaunchConfig, error) { resp := &SecondaryLaunchConfig{} err := c.rancherClient.doById(SECONDARY_LAUNCH_CONFIG_TYPE, id, resp) @@ -368,15 +458,6 @@ func (c *SecondaryLaunchConfigClient) ActionRestore(resource *SecondaryLaunchCon 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{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_service.go similarity index 85% rename from vendor/github.com/rancher/go-rancher/client/generated_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service.go index 063bcff..4cfb480 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service.go @@ -21,23 +21,27 @@ type Service struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,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"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` + + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,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"` + PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -49,16 +53,20 @@ type Service struct { ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - SecondaryLaunchConfigs []interface{} `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` + SecondaryLaunchConfigs []SecondaryLaunchConfig `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"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -74,7 +82,8 @@ type Service struct { type ServiceCollection struct { Collection - Data []Service `json:"data,omitempty"` + Data []Service `json:"data,omitempty"` + client *ServiceClient } type ServiceClient struct { @@ -92,10 +101,10 @@ type ServiceOperations interface { ActionAddservicelink(*Service, *AddRemoveServiceLinkInput) (*Service, error) - ActionCancelrollback(*Service) (*Service, error) - ActionCancelupgrade(*Service) (*Service, error) + ActionContinueupgrade(*Service) (*Service, error) + ActionCreate(*Service) (*Service, error) ActionDeactivate(*Service) (*Service, error) @@ -138,9 +147,20 @@ func (c *ServiceClient) Update(existing *Service, updates interface{}) (*Service func (c *ServiceClient) List(opts *ListOpts) (*ServiceCollection, error) { resp := &ServiceCollection{} err := c.rancherClient.doList(SERVICE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ServiceCollection) Next() (*ServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ServiceClient) ById(id string) (*Service, error) { resp := &Service{} err := c.rancherClient.doById(SERVICE_TYPE, id, resp) @@ -174,15 +194,6 @@ func (c *ServiceClient) ActionAddservicelink(resource *Service, input *AddRemove return resp, err } -func (c *ServiceClient) ActionCancelrollback(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ServiceClient) ActionCancelupgrade(resource *Service) (*Service, error) { resp := &Service{} @@ -192,6 +203,15 @@ func (c *ServiceClient) ActionCancelupgrade(resource *Service) (*Service, error) 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{} 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 0000000..3626917 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go @@ -0,0 +1,81 @@ +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"` +} + +type ServiceBindingCollection struct { + Collection + Data []ServiceBinding `json:"data,omitempty"` + client *ServiceBindingClient +} + +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) + resp.client = c + return resp, err +} + +func (cc *ServiceBindingCollection) Next() (*ServiceBindingCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceBindingCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +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/client/generated_service_consume_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go similarity index 90% rename from vendor/github.com/rancher/go-rancher/client/generated_service_consume_map.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go index 822a9aa..138afde 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_service_consume_map.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go @@ -42,7 +42,8 @@ type ServiceConsumeMap struct { type ServiceConsumeMapCollection struct { Collection - Data []ServiceConsumeMap `json:"data,omitempty"` + Data []ServiceConsumeMap `json:"data,omitempty"` + client *ServiceConsumeMapClient } type ServiceConsumeMapClient struct { @@ -84,9 +85,20 @@ func (c *ServiceConsumeMapClient) Update(existing *ServiceConsumeMap, updates in func (c *ServiceConsumeMapClient) List(opts *ListOpts) (*ServiceConsumeMapCollection, error) { resp := &ServiceConsumeMapCollection{} err := c.rancherClient.doList(SERVICE_CONSUME_MAP_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ServiceConsumeMapCollection) Next() (*ServiceConsumeMapCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceConsumeMapCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ServiceConsumeMapClient) ById(id string) (*ServiceConsumeMap, error) { resp := &ServiceConsumeMap{} err := c.rancherClient.doById(SERVICE_CONSUME_MAP_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go similarity index 90% rename from vendor/github.com/rancher/go-rancher/client/generated_service_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_event.go index 7d046b3..71b3082 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_service_event.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go @@ -46,7 +46,8 @@ type ServiceEvent struct { type ServiceEventCollection struct { Collection - Data []ServiceEvent `json:"data,omitempty"` + Data []ServiceEvent `json:"data,omitempty"` + client *ServiceEventClient } type ServiceEventClient struct { @@ -86,9 +87,20 @@ func (c *ServiceEventClient) Update(existing *ServiceEvent, updates interface{}) func (c *ServiceEventClient) List(opts *ListOpts) (*ServiceEventCollection, error) { resp := &ServiceEventCollection{} err := c.rancherClient.doList(SERVICE_EVENT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ServiceEventCollection) Next() (*ServiceEventCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceEventCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ServiceEventClient) ById(id string) (*ServiceEvent, error) { resp := &ServiceEvent{} err := c.rancherClient.doById(SERVICE_EVENT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_expose_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go similarity index 90% rename from vendor/github.com/rancher/go-rancher/client/generated_service_expose_map.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go index 60fe5f2..06453bf 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_service_expose_map.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go @@ -44,7 +44,8 @@ type ServiceExposeMap struct { type ServiceExposeMapCollection struct { Collection - Data []ServiceExposeMap `json:"data,omitempty"` + Data []ServiceExposeMap `json:"data,omitempty"` + client *ServiceExposeMapClient } type ServiceExposeMapClient struct { @@ -84,9 +85,20 @@ func (c *ServiceExposeMapClient) Update(existing *ServiceExposeMap, updates inte func (c *ServiceExposeMapClient) List(opts *ListOpts) (*ServiceExposeMapCollection, error) { resp := &ServiceExposeMapCollection{} err := c.rancherClient.doList(SERVICE_EXPOSE_MAP_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ServiceExposeMapCollection) Next() (*ServiceExposeMapCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceExposeMapCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ServiceExposeMapClient) ById(id string) (*ServiceExposeMap, error) { resp := &ServiceExposeMap{} err := c.rancherClient.doById(SERVICE_EXPOSE_MAP_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_link.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_service_link.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_link.go index 52c75ac..9532b2a 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_service_link.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go @@ -16,7 +16,8 @@ type ServiceLink struct { type ServiceLinkCollection struct { Collection - Data []ServiceLink `json:"data,omitempty"` + Data []ServiceLink `json:"data,omitempty"` + client *ServiceLinkClient } type ServiceLinkClient struct { @@ -52,9 +53,20 @@ func (c *ServiceLinkClient) Update(existing *ServiceLink, updates interface{}) ( func (c *ServiceLinkClient) List(opts *ListOpts) (*ServiceLinkCollection, error) { resp := &ServiceLinkCollection{} err := c.rancherClient.doList(SERVICE_LINK_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ServiceLinkCollection) Next() (*ServiceLinkCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceLinkCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ServiceLinkClient) ById(id string) (*ServiceLink, error) { resp := &ServiceLink{} err := c.rancherClient.doById(SERVICE_LINK_TYPE, id, resp) 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 0000000..81c2236 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go @@ -0,0 +1,101 @@ +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"` + client *ServiceLogClient +} + +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) + resp.client = c + return resp, err +} + +func (cc *ServiceLogCollection) Next() (*ServiceLogCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceLogCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +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/client/generated_service_proxy.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_service_proxy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go index fd6c328..2af160e 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_service_proxy.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go @@ -20,7 +20,8 @@ type ServiceProxy struct { type ServiceProxyCollection struct { Collection - Data []ServiceProxy `json:"data,omitempty"` + Data []ServiceProxy `json:"data,omitempty"` + client *ServiceProxyClient } type ServiceProxyClient struct { @@ -56,9 +57,20 @@ func (c *ServiceProxyClient) Update(existing *ServiceProxy, updates interface{}) func (c *ServiceProxyClient) List(opts *ListOpts) (*ServiceProxyCollection, error) { resp := &ServiceProxyCollection{} err := c.rancherClient.doList(SERVICE_PROXY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ServiceProxyCollection) Next() (*ServiceProxyCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceProxyCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ServiceProxyClient) ById(id string) (*ServiceProxy, error) { resp := &ServiceProxy{} err := c.rancherClient.doById(SERVICE_PROXY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_restart.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_service_restart.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go index 5b95e8c..5a47018 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_service_restart.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go @@ -12,7 +12,8 @@ type ServiceRestart struct { type ServiceRestartCollection struct { Collection - Data []ServiceRestart `json:"data,omitempty"` + Data []ServiceRestart `json:"data,omitempty"` + client *ServiceRestartClient } type ServiceRestartClient struct { @@ -48,9 +49,20 @@ func (c *ServiceRestartClient) Update(existing *ServiceRestart, updates interfac func (c *ServiceRestartClient) List(opts *ListOpts) (*ServiceRestartCollection, error) { resp := &ServiceRestartCollection{} err := c.rancherClient.doList(SERVICE_RESTART_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ServiceRestartCollection) Next() (*ServiceRestartCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceRestartCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ServiceRestartClient) ById(id string) (*ServiceRestart, error) { resp := &ServiceRestart{} err := c.rancherClient.doById(SERVICE_RESTART_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_service_upgrade.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go index 25b453f..1c97481 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_service_upgrade.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go @@ -14,7 +14,8 @@ type ServiceUpgrade struct { type ServiceUpgradeCollection struct { Collection - Data []ServiceUpgrade `json:"data,omitempty"` + Data []ServiceUpgrade `json:"data,omitempty"` + client *ServiceUpgradeClient } type ServiceUpgradeClient struct { @@ -50,9 +51,20 @@ func (c *ServiceUpgradeClient) Update(existing *ServiceUpgrade, updates interfac func (c *ServiceUpgradeClient) List(opts *ListOpts) (*ServiceUpgradeCollection, error) { resp := &ServiceUpgradeCollection{} err := c.rancherClient.doList(SERVICE_UPGRADE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ServiceUpgradeCollection) Next() (*ServiceUpgradeCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceUpgradeCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ServiceUpgradeClient) ById(id string) (*ServiceUpgrade, error) { resp := &ServiceUpgrade{} err := c.rancherClient.doById(SERVICE_UPGRADE_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_service_upgrade_strategy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go index 834606b..621403d 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_service_upgrade_strategy.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go @@ -14,7 +14,8 @@ type ServiceUpgradeStrategy struct { type ServiceUpgradeStrategyCollection struct { Collection - Data []ServiceUpgradeStrategy `json:"data,omitempty"` + Data []ServiceUpgradeStrategy `json:"data,omitempty"` + client *ServiceUpgradeStrategyClient } type ServiceUpgradeStrategyClient struct { @@ -50,9 +51,20 @@ func (c *ServiceUpgradeStrategyClient) Update(existing *ServiceUpgradeStrategy, func (c *ServiceUpgradeStrategyClient) List(opts *ListOpts) (*ServiceUpgradeStrategyCollection, error) { resp := &ServiceUpgradeStrategyCollection{} err := c.rancherClient.doList(SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ServiceUpgradeStrategyCollection) Next() (*ServiceUpgradeStrategyCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceUpgradeStrategyCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ServiceUpgradeStrategyClient) ById(id string) (*ServiceUpgradeStrategy, error) { resp := &ServiceUpgradeStrategy{} err := c.rancherClient.doById(SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_services_port_range.go b/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_services_port_range.go rename to vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go index d3c0eb9..1d112c7 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_services_port_range.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go @@ -14,7 +14,8 @@ type ServicesPortRange struct { type ServicesPortRangeCollection struct { Collection - Data []ServicesPortRange `json:"data,omitempty"` + Data []ServicesPortRange `json:"data,omitempty"` + client *ServicesPortRangeClient } type ServicesPortRangeClient struct { @@ -50,9 +51,20 @@ func (c *ServicesPortRangeClient) Update(existing *ServicesPortRange, updates in func (c *ServicesPortRangeClient) List(opts *ListOpts) (*ServicesPortRangeCollection, error) { resp := &ServicesPortRangeCollection{} err := c.rancherClient.doList(SERVICES_PORT_RANGE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ServicesPortRangeCollection) Next() (*ServicesPortRangeCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServicesPortRangeCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ServicesPortRangeClient) ById(id string) (*ServicesPortRange, error) { resp := &ServicesPortRange{} err := c.rancherClient.doById(SERVICES_PORT_RANGE_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_set_project_members_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go similarity index 80% rename from vendor/github.com/rancher/go-rancher/client/generated_set_project_members_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go index bc8c2f2..6d09c9c 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_set_project_members_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go @@ -7,12 +7,13 @@ const ( type SetProjectMembersInput struct { Resource - Members []interface{} `json:"members,omitempty" yaml:"members,omitempty"` + Members []ProjectMember `json:"members,omitempty" yaml:"members,omitempty"` } type SetProjectMembersInputCollection struct { Collection - Data []SetProjectMembersInput `json:"data,omitempty"` + Data []SetProjectMembersInput `json:"data,omitempty"` + client *SetProjectMembersInputClient } type SetProjectMembersInputClient struct { @@ -48,9 +49,20 @@ func (c *SetProjectMembersInputClient) Update(existing *SetProjectMembersInput, func (c *SetProjectMembersInputClient) List(opts *ListOpts) (*SetProjectMembersInputCollection, error) { resp := &SetProjectMembersInputCollection{} err := c.rancherClient.doList(SET_PROJECT_MEMBERS_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *SetProjectMembersInputCollection) Next() (*SetProjectMembersInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SetProjectMembersInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *SetProjectMembersInputClient) ById(id string) (*SetProjectMembersInput, error) { resp := &SetProjectMembersInput{} err := c.rancherClient.doById(SET_PROJECT_MEMBERS_INPUT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_set_service_links_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go similarity index 80% rename from vendor/github.com/rancher/go-rancher/client/generated_set_service_links_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go index b471e96..a67d8c4 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_set_service_links_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go @@ -7,12 +7,13 @@ const ( type SetServiceLinksInput struct { Resource - ServiceLinks []interface{} `json:"serviceLinks,omitempty" yaml:"service_links,omitempty"` + ServiceLinks []ServiceLink `json:"serviceLinks,omitempty" yaml:"service_links,omitempty"` } type SetServiceLinksInputCollection struct { Collection - Data []SetServiceLinksInput `json:"data,omitempty"` + Data []SetServiceLinksInput `json:"data,omitempty"` + client *SetServiceLinksInputClient } type SetServiceLinksInputClient struct { @@ -48,9 +49,20 @@ func (c *SetServiceLinksInputClient) Update(existing *SetServiceLinksInput, upda func (c *SetServiceLinksInputClient) List(opts *ListOpts) (*SetServiceLinksInputCollection, error) { resp := &SetServiceLinksInputCollection{} err := c.rancherClient.doList(SET_SERVICE_LINKS_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *SetServiceLinksInputCollection) Next() (*SetServiceLinksInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SetServiceLinksInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *SetServiceLinksInputClient) ById(id string) (*SetServiceLinksInput, error) { resp := &SetServiceLinksInput{} err := c.rancherClient.doById(SET_SERVICE_LINKS_INPUT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_setting.go b/vendor/github.com/rancher/go-rancher/v2/generated_setting.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_setting.go rename to vendor/github.com/rancher/go-rancher/v2/generated_setting.go index 1aa7655..02dd2df 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_setting.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_setting.go @@ -20,7 +20,8 @@ type Setting struct { type SettingCollection struct { Collection - Data []Setting `json:"data,omitempty"` + Data []Setting `json:"data,omitempty"` + client *SettingClient } type SettingClient struct { @@ -56,9 +57,20 @@ func (c *SettingClient) Update(existing *Setting, updates interface{}) (*Setting func (c *SettingClient) List(opts *ListOpts) (*SettingCollection, error) { resp := &SettingCollection{} err := c.rancherClient.doList(SETTING_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *SettingCollection) Next() (*SettingCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SettingCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *SettingClient) ById(id string) (*Setting, error) { resp := &Setting{} err := c.rancherClient.doById(SETTING_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_snapshot.go b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go similarity index 90% rename from vendor/github.com/rancher/go-rancher/client/generated_snapshot.go rename to vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go index 5540356..1c4ea03 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_snapshot.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go @@ -38,7 +38,8 @@ type Snapshot struct { type SnapshotCollection struct { Collection - Data []Snapshot `json:"data,omitempty"` + Data []Snapshot `json:"data,omitempty"` + client *SnapshotClient } type SnapshotClient struct { @@ -80,9 +81,20 @@ func (c *SnapshotClient) Update(existing *Snapshot, updates interface{}) (*Snaps func (c *SnapshotClient) List(opts *ListOpts) (*SnapshotCollection, error) { resp := &SnapshotCollection{} err := c.rancherClient.doList(SNAPSHOT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *SnapshotCollection) Next() (*SnapshotCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SnapshotCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *SnapshotClient) ById(id string) (*Snapshot, error) { resp := &Snapshot{} err := c.rancherClient.doById(SNAPSHOT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_snapshot_backup_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go similarity index 86% rename from vendor/github.com/rancher/go-rancher/client/generated_snapshot_backup_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go index deb2fcc..9577ee6 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_snapshot_backup_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go @@ -18,7 +18,8 @@ type SnapshotBackupInput struct { type SnapshotBackupInputCollection struct { Collection - Data []SnapshotBackupInput `json:"data,omitempty"` + Data []SnapshotBackupInput `json:"data,omitempty"` + client *SnapshotBackupInputClient } type SnapshotBackupInputClient struct { @@ -58,9 +59,20 @@ func (c *SnapshotBackupInputClient) Update(existing *SnapshotBackupInput, update func (c *SnapshotBackupInputClient) List(opts *ListOpts) (*SnapshotBackupInputCollection, error) { resp := &SnapshotBackupInputCollection{} err := c.rancherClient.doList(SNAPSHOT_BACKUP_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *SnapshotBackupInputCollection) Next() (*SnapshotBackupInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SnapshotBackupInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *SnapshotBackupInputClient) ById(id string) (*SnapshotBackupInput, error) { resp := &SnapshotBackupInput{} err := c.rancherClient.doById(SNAPSHOT_BACKUP_INPUT_TYPE, id, resp) 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 0000000..d1d3b43 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_stack.go @@ -0,0 +1,261 @@ +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"` + + Group string `json:"group,omitempty" yaml:"group,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"` + + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,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"` + client *StackClient +} + +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) + resp.client = c + return resp, err +} + +func (cc *StackCollection) Next() (*StackCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &StackCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +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 0000000..a167ab5 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go @@ -0,0 +1,85 @@ +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"` + client *StackUpgradeClient +} + +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) + resp.client = c + return resp, err +} + +func (cc *StackUpgradeCollection) Next() (*StackUpgradeCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &StackUpgradeCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +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/client/generated_state_transition.go b/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go similarity index 81% rename from vendor/github.com/rancher/go-rancher/client/generated_state_transition.go rename to vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go index d763903..4fb5655 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_state_transition.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go @@ -10,7 +10,8 @@ type StateTransition struct { type StateTransitionCollection struct { Collection - Data []StateTransition `json:"data,omitempty"` + Data []StateTransition `json:"data,omitempty"` + client *StateTransitionClient } type StateTransitionClient struct { @@ -46,9 +47,20 @@ func (c *StateTransitionClient) Update(existing *StateTransition, updates interf func (c *StateTransitionClient) List(opts *ListOpts) (*StateTransitionCollection, error) { resp := &StateTransitionCollection{} err := c.rancherClient.doList(STATE_TRANSITION_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *StateTransitionCollection) Next() (*StateTransitionCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &StateTransitionCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *StateTransitionClient) ById(id string) (*StateTransition, error) { resp := &StateTransition{} err := c.rancherClient.doById(STATE_TRANSITION_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_stats_access.go b/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_stats_access.go rename to vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go index 1ec4d45..1b7d814 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_stats_access.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go @@ -14,7 +14,8 @@ type StatsAccess struct { type StatsAccessCollection struct { Collection - Data []StatsAccess `json:"data,omitempty"` + Data []StatsAccess `json:"data,omitempty"` + client *StatsAccessClient } type StatsAccessClient struct { @@ -50,9 +51,20 @@ func (c *StatsAccessClient) Update(existing *StatsAccess, updates interface{}) ( func (c *StatsAccessClient) List(opts *ListOpts) (*StatsAccessCollection, error) { resp := &StatsAccessCollection{} err := c.rancherClient.doList(STATS_ACCESS_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *StatsAccessCollection) Next() (*StatsAccessCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &StatsAccessCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *StatsAccessClient) ById(id string) (*StatsAccess, error) { resp := &StatsAccess{} err := c.rancherClient.doById(STATS_ACCESS_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go new file mode 100644 index 0000000..bf54aa4 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go @@ -0,0 +1,168 @@ +package client + +const ( + STORAGE_DRIVER_TYPE = "storageDriver" +) + +type StorageDriver 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"` + + 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"` + + Scope string `json:"scope,omitempty" yaml:"scope,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"` + + VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` + + VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` +} + +type StorageDriverCollection struct { + Collection + Data []StorageDriver `json:"data,omitempty"` + client *StorageDriverClient +} + +type StorageDriverClient struct { + rancherClient *RancherClient +} + +type StorageDriverOperations interface { + List(opts *ListOpts) (*StorageDriverCollection, error) + Create(opts *StorageDriver) (*StorageDriver, error) + Update(existing *StorageDriver, updates interface{}) (*StorageDriver, error) + ById(id string) (*StorageDriver, error) + Delete(container *StorageDriver) error + + ActionActivate(*StorageDriver) (*StorageDriver, error) + + ActionCreate(*StorageDriver) (*StorageDriver, error) + + ActionDeactivate(*StorageDriver) (*StorageDriver, error) + + ActionRemove(*StorageDriver) (*StorageDriver, error) + + ActionUpdate(*StorageDriver) (*StorageDriver, error) +} + +func newStorageDriverClient(rancherClient *RancherClient) *StorageDriverClient { + return &StorageDriverClient{ + rancherClient: rancherClient, + } +} + +func (c *StorageDriverClient) Create(container *StorageDriver) (*StorageDriver, error) { + resp := &StorageDriver{} + err := c.rancherClient.doCreate(STORAGE_DRIVER_TYPE, container, resp) + return resp, err +} + +func (c *StorageDriverClient) Update(existing *StorageDriver, updates interface{}) (*StorageDriver, error) { + resp := &StorageDriver{} + err := c.rancherClient.doUpdate(STORAGE_DRIVER_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *StorageDriverClient) List(opts *ListOpts) (*StorageDriverCollection, error) { + resp := &StorageDriverCollection{} + err := c.rancherClient.doList(STORAGE_DRIVER_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *StorageDriverCollection) Next() (*StorageDriverCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &StorageDriverCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *StorageDriverClient) ById(id string) (*StorageDriver, error) { + resp := &StorageDriver{} + err := c.rancherClient.doById(STORAGE_DRIVER_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *StorageDriverClient) Delete(container *StorageDriver) error { + return c.rancherClient.doResourceDelete(STORAGE_DRIVER_TYPE, &container.Resource) +} + +func (c *StorageDriverClient) ActionActivate(resource *StorageDriver) (*StorageDriver, error) { + + resp := &StorageDriver{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverClient) ActionCreate(resource *StorageDriver) (*StorageDriver, error) { + + resp := &StorageDriver{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverClient) ActionDeactivate(resource *StorageDriver) (*StorageDriver, error) { + + resp := &StorageDriver{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverClient) ActionRemove(resource *StorageDriver) (*StorageDriver, error) { + + resp := &StorageDriver{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverClient) ActionUpdate(resource *StorageDriver) (*StorageDriver, error) { + + resp := &StorageDriver{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go new file mode 100644 index 0000000..9fbc365 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go @@ -0,0 +1,305 @@ +package client + +const ( + STORAGE_DRIVER_SERVICE_TYPE = "storageDriverService" +) + +type StorageDriverService 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"` + + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + + LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` + + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PublicEndpoints []PublicEndpoint `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 []SecondaryLaunchConfig `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"` + + StorageDriver StorageDriver `json:"storageDriver,omitempty" yaml:"storage_driver,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,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 StorageDriverServiceCollection struct { + Collection + Data []StorageDriverService `json:"data,omitempty"` + client *StorageDriverServiceClient +} + +type StorageDriverServiceClient struct { + rancherClient *RancherClient +} + +type StorageDriverServiceOperations interface { + List(opts *ListOpts) (*StorageDriverServiceCollection, error) + Create(opts *StorageDriverService) (*StorageDriverService, error) + Update(existing *StorageDriverService, updates interface{}) (*StorageDriverService, error) + ById(id string) (*StorageDriverService, error) + Delete(container *StorageDriverService) error + + ActionActivate(*StorageDriverService) (*Service, error) + + ActionAddservicelink(*StorageDriverService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionCancelupgrade(*StorageDriverService) (*Service, error) + + ActionContinueupgrade(*StorageDriverService) (*Service, error) + + ActionCreate(*StorageDriverService) (*Service, error) + + ActionDeactivate(*StorageDriverService) (*Service, error) + + ActionFinishupgrade(*StorageDriverService) (*Service, error) + + ActionRemove(*StorageDriverService) (*Service, error) + + ActionRemoveservicelink(*StorageDriverService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionRestart(*StorageDriverService, *ServiceRestart) (*Service, error) + + ActionRollback(*StorageDriverService) (*Service, error) + + ActionSetservicelinks(*StorageDriverService, *SetServiceLinksInput) (*Service, error) + + ActionUpdate(*StorageDriverService) (*Service, error) + + ActionUpgrade(*StorageDriverService, *ServiceUpgrade) (*Service, error) +} + +func newStorageDriverServiceClient(rancherClient *RancherClient) *StorageDriverServiceClient { + return &StorageDriverServiceClient{ + rancherClient: rancherClient, + } +} + +func (c *StorageDriverServiceClient) Create(container *StorageDriverService) (*StorageDriverService, error) { + resp := &StorageDriverService{} + err := c.rancherClient.doCreate(STORAGE_DRIVER_SERVICE_TYPE, container, resp) + return resp, err +} + +func (c *StorageDriverServiceClient) Update(existing *StorageDriverService, updates interface{}) (*StorageDriverService, error) { + resp := &StorageDriverService{} + err := c.rancherClient.doUpdate(STORAGE_DRIVER_SERVICE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *StorageDriverServiceClient) List(opts *ListOpts) (*StorageDriverServiceCollection, error) { + resp := &StorageDriverServiceCollection{} + err := c.rancherClient.doList(STORAGE_DRIVER_SERVICE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *StorageDriverServiceCollection) Next() (*StorageDriverServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &StorageDriverServiceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *StorageDriverServiceClient) ById(id string) (*StorageDriverService, error) { + resp := &StorageDriverService{} + err := c.rancherClient.doById(STORAGE_DRIVER_SERVICE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *StorageDriverServiceClient) Delete(container *StorageDriverService) error { + return c.rancherClient.doResourceDelete(STORAGE_DRIVER_SERVICE_TYPE, &container.Resource) +} + +func (c *StorageDriverServiceClient) ActionActivate(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionAddservicelink(resource *StorageDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionCancelupgrade(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionContinueupgrade(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionCreate(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionDeactivate(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionFinishupgrade(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionRemove(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionRemoveservicelink(resource *StorageDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionRestart(resource *StorageDriverService, input *ServiceRestart) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "restart", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionRollback(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionSetservicelinks(resource *StorageDriverService, input *SetServiceLinksInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionUpdate(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionUpgrade(resource *StorageDriverService, input *ServiceUpgrade) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_storage_pool.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go similarity index 88% rename from vendor/github.com/rancher/go-rancher/client/generated_storage_pool.go rename to vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go index 1175cfd..45f8436 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_storage_pool.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go @@ -21,6 +21,8 @@ type StoragePool struct { ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + HostIds []string `json:"hostIds,omitempty" yaml:"host_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` @@ -31,6 +33,8 @@ type StoragePool struct { State string `json:"state,omitempty" yaml:"state,omitempty"` + StorageDriverId string `json:"storageDriverId,omitempty" yaml:"storage_driver_id,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -42,11 +46,14 @@ type StoragePool struct { VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` + + VolumeIds []string `json:"volumeIds,omitempty" yaml:"volume_ids,omitempty"` } type StoragePoolCollection struct { Collection - Data []StoragePool `json:"data,omitempty"` + Data []StoragePool `json:"data,omitempty"` + client *StoragePoolClient } type StoragePoolClient struct { @@ -96,9 +103,20 @@ func (c *StoragePoolClient) Update(existing *StoragePool, updates interface{}) ( func (c *StoragePoolClient) List(opts *ListOpts) (*StoragePoolCollection, error) { resp := &StoragePoolCollection{} err := c.rancherClient.doList(STORAGE_POOL_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *StoragePoolCollection) Next() (*StoragePoolCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &StoragePoolCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *StoragePoolClient) ById(id string) (*StoragePool, error) { resp := &StoragePool{} err := c.rancherClient.doById(STORAGE_POOL_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go b/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go new file mode 100644 index 0000000..431504f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go @@ -0,0 +1,192 @@ +package client + +const ( + SUBNET_TYPE = "subnet" +) + +type Subnet struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + CidrSize int64 `json:"cidrSize,omitempty" yaml:"cidr_size,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"` + + EndAddress string `json:"endAddress,omitempty" yaml:"end_address,omitempty"` + + Gateway string `json:"gateway,omitempty" yaml:"gateway,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + NetworkAddress string `json:"networkAddress,omitempty" yaml:"network_address,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"` + + StartAddress string `json:"startAddress,omitempty" yaml:"start_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"` +} + +type SubnetCollection struct { + Collection + Data []Subnet `json:"data,omitempty"` + client *SubnetClient +} + +type SubnetClient struct { + rancherClient *RancherClient +} + +type SubnetOperations interface { + List(opts *ListOpts) (*SubnetCollection, error) + Create(opts *Subnet) (*Subnet, error) + Update(existing *Subnet, updates interface{}) (*Subnet, error) + ById(id string) (*Subnet, error) + Delete(container *Subnet) error + + ActionActivate(*Subnet) (*Subnet, error) + + ActionCreate(*Subnet) (*Subnet, error) + + ActionDeactivate(*Subnet) (*Subnet, error) + + ActionPurge(*Subnet) (*Subnet, error) + + ActionRemove(*Subnet) (*Subnet, error) + + ActionRestore(*Subnet) (*Subnet, error) + + ActionUpdate(*Subnet) (*Subnet, error) +} + +func newSubnetClient(rancherClient *RancherClient) *SubnetClient { + return &SubnetClient{ + rancherClient: rancherClient, + } +} + +func (c *SubnetClient) Create(container *Subnet) (*Subnet, error) { + resp := &Subnet{} + err := c.rancherClient.doCreate(SUBNET_TYPE, container, resp) + return resp, err +} + +func (c *SubnetClient) Update(existing *Subnet, updates interface{}) (*Subnet, error) { + resp := &Subnet{} + err := c.rancherClient.doUpdate(SUBNET_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SubnetClient) List(opts *ListOpts) (*SubnetCollection, error) { + resp := &SubnetCollection{} + err := c.rancherClient.doList(SUBNET_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *SubnetCollection) Next() (*SubnetCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SubnetCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *SubnetClient) ById(id string) (*Subnet, error) { + resp := &Subnet{} + err := c.rancherClient.doById(SUBNET_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SubnetClient) Delete(container *Subnet) error { + return c.rancherClient.doResourceDelete(SUBNET_TYPE, &container.Resource) +} + +func (c *SubnetClient) ActionActivate(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SubnetClient) ActionCreate(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SubnetClient) ActionDeactivate(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SubnetClient) ActionPurge(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SubnetClient) ActionRemove(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SubnetClient) ActionRestore(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SubnetClient) ActionUpdate(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_subscribe.go b/vendor/github.com/rancher/go-rancher/v2/generated_subscribe.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_subscribe.go rename to vendor/github.com/rancher/go-rancher/v2/generated_subscribe.go index b8c6aa0..ec90898 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_subscribe.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_subscribe.go @@ -14,7 +14,8 @@ type Subscribe struct { type SubscribeCollection struct { Collection - Data []Subscribe `json:"data,omitempty"` + Data []Subscribe `json:"data,omitempty"` + client *SubscribeClient } type SubscribeClient struct { @@ -50,9 +51,20 @@ func (c *SubscribeClient) Update(existing *Subscribe, updates interface{}) (*Sub func (c *SubscribeClient) List(opts *ListOpts) (*SubscribeCollection, error) { resp := &SubscribeCollection{} err := c.rancherClient.doList(SUBSCRIBE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *SubscribeCollection) Next() (*SubscribeCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SubscribeCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *SubscribeClient) ById(id string) (*Subscribe, error) { resp := &Subscribe{} err := c.rancherClient.doById(SUBSCRIBE_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go b/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go new file mode 100644 index 0000000..2acc180 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go @@ -0,0 +1,85 @@ +package client + +const ( + TARGET_PORT_RULE_TYPE = "targetPortRule" +) + +type TargetPortRule struct { + Resource + + BackendName string `json:"backendName,omitempty" yaml:"backend_name,omitempty"` + + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + + Path string `json:"path,omitempty" yaml:"path,omitempty"` + + TargetPort int64 `json:"targetPort,omitempty" yaml:"target_port,omitempty"` +} + +type TargetPortRuleCollection struct { + Collection + Data []TargetPortRule `json:"data,omitempty"` + client *TargetPortRuleClient +} + +type TargetPortRuleClient struct { + rancherClient *RancherClient +} + +type TargetPortRuleOperations interface { + List(opts *ListOpts) (*TargetPortRuleCollection, error) + Create(opts *TargetPortRule) (*TargetPortRule, error) + Update(existing *TargetPortRule, updates interface{}) (*TargetPortRule, error) + ById(id string) (*TargetPortRule, error) + Delete(container *TargetPortRule) error +} + +func newTargetPortRuleClient(rancherClient *RancherClient) *TargetPortRuleClient { + return &TargetPortRuleClient{ + rancherClient: rancherClient, + } +} + +func (c *TargetPortRuleClient) Create(container *TargetPortRule) (*TargetPortRule, error) { + resp := &TargetPortRule{} + err := c.rancherClient.doCreate(TARGET_PORT_RULE_TYPE, container, resp) + return resp, err +} + +func (c *TargetPortRuleClient) Update(existing *TargetPortRule, updates interface{}) (*TargetPortRule, error) { + resp := &TargetPortRule{} + err := c.rancherClient.doUpdate(TARGET_PORT_RULE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *TargetPortRuleClient) List(opts *ListOpts) (*TargetPortRuleCollection, error) { + resp := &TargetPortRuleCollection{} + err := c.rancherClient.doList(TARGET_PORT_RULE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *TargetPortRuleCollection) Next() (*TargetPortRuleCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &TargetPortRuleCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *TargetPortRuleClient) ById(id string) (*TargetPortRule, error) { + resp := &TargetPortRule{} + err := c.rancherClient.doById(TARGET_PORT_RULE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *TargetPortRuleClient) Delete(container *TargetPortRule) error { + return c.rancherClient.doResourceDelete(TARGET_PORT_RULE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_task.go b/vendor/github.com/rancher/go-rancher/v2/generated_task.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_task.go rename to vendor/github.com/rancher/go-rancher/v2/generated_task.go index 13730c4..8fa65e2 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_task.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_task.go @@ -12,7 +12,8 @@ type Task struct { type TaskCollection struct { Collection - Data []Task `json:"data,omitempty"` + Data []Task `json:"data,omitempty"` + client *TaskClient } type TaskClient struct { @@ -50,9 +51,20 @@ func (c *TaskClient) Update(existing *Task, updates interface{}) (*Task, error) func (c *TaskClient) List(opts *ListOpts) (*TaskCollection, error) { resp := &TaskCollection{} err := c.rancherClient.doList(TASK_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *TaskCollection) Next() (*TaskCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &TaskCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *TaskClient) ById(id string) (*Task, error) { resp := &Task{} err := c.rancherClient.doById(TASK_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_task_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go similarity index 84% rename from vendor/github.com/rancher/go-rancher/client/generated_task_instance.go rename to vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go index 52739b1..5bb5827 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_task_instance.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go @@ -22,7 +22,8 @@ type TaskInstance struct { type TaskInstanceCollection struct { Collection - Data []TaskInstance `json:"data,omitempty"` + Data []TaskInstance `json:"data,omitempty"` + client *TaskInstanceClient } type TaskInstanceClient struct { @@ -58,9 +59,20 @@ func (c *TaskInstanceClient) Update(existing *TaskInstance, updates interface{}) func (c *TaskInstanceClient) List(opts *ListOpts) (*TaskInstanceCollection, error) { resp := &TaskInstanceCollection{} err := c.rancherClient.doList(TASK_INSTANCE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *TaskInstanceCollection) Next() (*TaskInstanceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &TaskInstanceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *TaskInstanceClient) ById(id string) (*TaskInstance, error) { resp := &TaskInstance{} err := c.rancherClient.doById(TASK_INSTANCE_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_to_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go similarity index 84% rename from vendor/github.com/rancher/go-rancher/client/generated_to_service_upgrade_strategy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go index 3abdc45..3ed7411 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_to_service_upgrade_strategy.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go @@ -20,7 +20,8 @@ type ToServiceUpgradeStrategy struct { type ToServiceUpgradeStrategyCollection struct { Collection - Data []ToServiceUpgradeStrategy `json:"data,omitempty"` + Data []ToServiceUpgradeStrategy `json:"data,omitempty"` + client *ToServiceUpgradeStrategyClient } type ToServiceUpgradeStrategyClient struct { @@ -56,9 +57,20 @@ func (c *ToServiceUpgradeStrategyClient) Update(existing *ToServiceUpgradeStrate func (c *ToServiceUpgradeStrategyClient) List(opts *ListOpts) (*ToServiceUpgradeStrategyCollection, error) { resp := &ToServiceUpgradeStrategyCollection{} err := c.rancherClient.doList(TO_SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *ToServiceUpgradeStrategyCollection) Next() (*ToServiceUpgradeStrategyCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ToServiceUpgradeStrategyCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *ToServiceUpgradeStrategyClient) ById(id string) (*ToServiceUpgradeStrategy, error) { resp := &ToServiceUpgradeStrategy{} err := c.rancherClient.doById(TO_SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_type_documentation.go b/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_type_documentation.go rename to vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go index dc1d5ef..cdfe186 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_type_documentation.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go @@ -14,7 +14,8 @@ type TypeDocumentation struct { type TypeDocumentationCollection struct { Collection - Data []TypeDocumentation `json:"data,omitempty"` + Data []TypeDocumentation `json:"data,omitempty"` + client *TypeDocumentationClient } type TypeDocumentationClient struct { @@ -50,9 +51,20 @@ func (c *TypeDocumentationClient) Update(existing *TypeDocumentation, updates in func (c *TypeDocumentationClient) List(opts *ListOpts) (*TypeDocumentationCollection, error) { resp := &TypeDocumentationCollection{} err := c.rancherClient.doList(TYPE_DOCUMENTATION_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *TypeDocumentationCollection) Next() (*TypeDocumentationCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &TypeDocumentationCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *TypeDocumentationClient) ById(id string) (*TypeDocumentation, error) { resp := &TypeDocumentation{} err := c.rancherClient.doById(TYPE_DOCUMENTATION_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go b/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go new file mode 100644 index 0000000..7449c26 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go @@ -0,0 +1,83 @@ +package client + +const ( + ULIMIT_TYPE = "ulimit" +) + +type Ulimit struct { + Resource + + Hard int64 `json:"hard,omitempty" yaml:"hard,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Soft int64 `json:"soft,omitempty" yaml:"soft,omitempty"` +} + +type UlimitCollection struct { + Collection + Data []Ulimit `json:"data,omitempty"` + client *UlimitClient +} + +type UlimitClient struct { + rancherClient *RancherClient +} + +type UlimitOperations interface { + List(opts *ListOpts) (*UlimitCollection, error) + Create(opts *Ulimit) (*Ulimit, error) + Update(existing *Ulimit, updates interface{}) (*Ulimit, error) + ById(id string) (*Ulimit, error) + Delete(container *Ulimit) error +} + +func newUlimitClient(rancherClient *RancherClient) *UlimitClient { + return &UlimitClient{ + rancherClient: rancherClient, + } +} + +func (c *UlimitClient) Create(container *Ulimit) (*Ulimit, error) { + resp := &Ulimit{} + err := c.rancherClient.doCreate(ULIMIT_TYPE, container, resp) + return resp, err +} + +func (c *UlimitClient) Update(existing *Ulimit, updates interface{}) (*Ulimit, error) { + resp := &Ulimit{} + err := c.rancherClient.doUpdate(ULIMIT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *UlimitClient) List(opts *ListOpts) (*UlimitCollection, error) { + resp := &UlimitCollection{} + err := c.rancherClient.doList(ULIMIT_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *UlimitCollection) Next() (*UlimitCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &UlimitCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *UlimitClient) ById(id string) (*Ulimit, error) { + resp := &Ulimit{} + err := c.rancherClient.doById(ULIMIT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *UlimitClient) Delete(container *Ulimit) error { + return c.rancherClient.doResourceDelete(ULIMIT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_virtual_machine.go b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go similarity index 76% rename from vendor/github.com/rancher/go-rancher/client/generated_virtual_machine.go rename to vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go index cf8abed..f420e6d 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_virtual_machine.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go @@ -15,12 +15,26 @@ type VirtualMachine struct { BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` + + CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` + Command []string `json:"command,omitempty" yaml:"command,omitempty"` Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` + + CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` + + CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` + + CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` @@ -33,10 +47,14 @@ type VirtualMachine struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - Disks []interface{} `json:"disks,omitempty" yaml:"disks,omitempty"` + DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` + + Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` @@ -49,10 +67,20 @@ type VirtualMachine struct { FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` + + HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` + + HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` @@ -61,6 +89,22 @@ type VirtualMachine struct { InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` + + IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` + + IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` + + Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` + + Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` + + IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` + + Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` + + KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` @@ -71,20 +115,38 @@ type VirtualMachine struct { MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` + MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` + + MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` + + Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` + NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` + OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` + + OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` + + PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` + RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -97,13 +159,25 @@ type VirtualMachine struct { SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + + ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,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"` + StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` + + StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` + + Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,omitempty"` + + Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` Token string `json:"token,omitempty" yaml:"token,omitempty"` @@ -113,8 +187,14 @@ type VirtualMachine struct { TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` + Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` + UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` + + Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` @@ -126,7 +206,8 @@ type VirtualMachine struct { type VirtualMachineCollection struct { Collection - Data []VirtualMachine `json:"data,omitempty"` + Data []VirtualMachine `json:"data,omitempty"` + client *VirtualMachineClient } type VirtualMachineClient struct { @@ -166,8 +247,6 @@ type VirtualMachineOperations interface { ActionRestore(*VirtualMachine) (*Instance, error) - ActionSetlabels(*VirtualMachine, *SetLabelsInput) (*Container, error) - ActionStart(*VirtualMachine) (*Instance, error) ActionStop(*VirtualMachine, *InstanceStop) (*Instance, error) @@ -202,9 +281,20 @@ func (c *VirtualMachineClient) Update(existing *VirtualMachine, updates interfac func (c *VirtualMachineClient) List(opts *ListOpts) (*VirtualMachineCollection, error) { resp := &VirtualMachineCollection{} err := c.rancherClient.doList(VIRTUAL_MACHINE_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *VirtualMachineCollection) Next() (*VirtualMachineCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &VirtualMachineCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *VirtualMachineClient) ById(id string) (*VirtualMachine, error) { resp := &VirtualMachine{} err := c.rancherClient.doById(VIRTUAL_MACHINE_TYPE, id, resp) @@ -337,15 +427,6 @@ func (c *VirtualMachineClient) ActionRestore(resource *VirtualMachine) (*Instanc 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{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_virtual_machine_disk.go b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go similarity index 84% rename from vendor/github.com/rancher/go-rancher/client/generated_virtual_machine_disk.go rename to vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go index 7e1e8a5..af52418 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_virtual_machine_disk.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go @@ -24,7 +24,8 @@ type VirtualMachineDisk struct { type VirtualMachineDiskCollection struct { Collection - Data []VirtualMachineDisk `json:"data,omitempty"` + Data []VirtualMachineDisk `json:"data,omitempty"` + client *VirtualMachineDiskClient } type VirtualMachineDiskClient struct { @@ -60,9 +61,20 @@ func (c *VirtualMachineDiskClient) Update(existing *VirtualMachineDisk, updates func (c *VirtualMachineDiskClient) List(opts *ListOpts) (*VirtualMachineDiskCollection, error) { resp := &VirtualMachineDiskCollection{} err := c.rancherClient.doList(VIRTUAL_MACHINE_DISK_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *VirtualMachineDiskCollection) Next() (*VirtualMachineDiskCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &VirtualMachineDiskCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *VirtualMachineDiskClient) ById(id string) (*VirtualMachineDisk, error) { resp := &VirtualMachineDisk{} err := c.rancherClient.doById(VIRTUAL_MACHINE_DISK_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_volume.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume.go similarity index 87% rename from vendor/github.com/rancher/go-rancher/client/generated_volume.go rename to vendor/github.com/rancher/go-rancher/v2/generated_volume.go index 395deb6..2b6ed23 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_volume.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_volume.go @@ -23,6 +23,8 @@ type Volume struct { ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + ImageId string `json:"imageId,omitempty" yaml:"image_id,omitempty"` InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` @@ -31,14 +33,22 @@ type Volume struct { Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,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"` + SizeMb int64 `json:"sizeMb,omitempty" yaml:"size_mb,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + StorageDriverId string `json:"storageDriverId,omitempty" yaml:"storage_driver_id,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -48,11 +58,14 @@ type Volume struct { Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + VolumeTemplateId string `json:"volumeTemplateId,omitempty" yaml:"volume_template_id,omitempty"` } type VolumeCollection struct { Collection - Data []Volume `json:"data,omitempty"` + Data []Volume `json:"data,omitempty"` + client *VolumeClient } type VolumeClient struct { @@ -66,8 +79,6 @@ type VolumeOperations interface { ById(id string) (*Volume, error) Delete(container *Volume) error - ActionActivate(*Volume) (*Volume, error) - ActionAllocate(*Volume) (*Volume, error) ActionCreate(*Volume) (*Volume, error) @@ -110,9 +121,20 @@ func (c *VolumeClient) Update(existing *Volume, updates interface{}) (*Volume, e func (c *VolumeClient) List(opts *ListOpts) (*VolumeCollection, error) { resp := &VolumeCollection{} err := c.rancherClient.doList(VOLUME_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *VolumeCollection) Next() (*VolumeCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &VolumeCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *VolumeClient) ById(id string) (*Volume, error) { resp := &Volume{} err := c.rancherClient.doById(VOLUME_TYPE, id, resp) @@ -128,15 +150,6 @@ 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{} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go new file mode 100644 index 0000000..be4269a --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go @@ -0,0 +1,79 @@ +package client + +const ( + VOLUME_ACTIVATE_INPUT_TYPE = "volumeActivateInput" +) + +type VolumeActivateInput struct { + Resource + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` +} + +type VolumeActivateInputCollection struct { + Collection + Data []VolumeActivateInput `json:"data,omitempty"` + client *VolumeActivateInputClient +} + +type VolumeActivateInputClient struct { + rancherClient *RancherClient +} + +type VolumeActivateInputOperations interface { + List(opts *ListOpts) (*VolumeActivateInputCollection, error) + Create(opts *VolumeActivateInput) (*VolumeActivateInput, error) + Update(existing *VolumeActivateInput, updates interface{}) (*VolumeActivateInput, error) + ById(id string) (*VolumeActivateInput, error) + Delete(container *VolumeActivateInput) error +} + +func newVolumeActivateInputClient(rancherClient *RancherClient) *VolumeActivateInputClient { + return &VolumeActivateInputClient{ + rancherClient: rancherClient, + } +} + +func (c *VolumeActivateInputClient) Create(container *VolumeActivateInput) (*VolumeActivateInput, error) { + resp := &VolumeActivateInput{} + err := c.rancherClient.doCreate(VOLUME_ACTIVATE_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *VolumeActivateInputClient) Update(existing *VolumeActivateInput, updates interface{}) (*VolumeActivateInput, error) { + resp := &VolumeActivateInput{} + err := c.rancherClient.doUpdate(VOLUME_ACTIVATE_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *VolumeActivateInputClient) List(opts *ListOpts) (*VolumeActivateInputCollection, error) { + resp := &VolumeActivateInputCollection{} + err := c.rancherClient.doList(VOLUME_ACTIVATE_INPUT_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *VolumeActivateInputCollection) Next() (*VolumeActivateInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &VolumeActivateInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *VolumeActivateInputClient) ById(id string) (*VolumeActivateInput, error) { + resp := &VolumeActivateInput{} + err := c.rancherClient.doById(VOLUME_ACTIVATE_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *VolumeActivateInputClient) Delete(container *VolumeActivateInput) error { + return c.rancherClient.doResourceDelete(VOLUME_ACTIVATE_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_volume_snapshot_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go similarity index 82% rename from vendor/github.com/rancher/go-rancher/client/generated_volume_snapshot_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go index 10df7ed..2e2425a 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_volume_snapshot_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go @@ -12,7 +12,8 @@ type VolumeSnapshotInput struct { type VolumeSnapshotInputCollection struct { Collection - Data []VolumeSnapshotInput `json:"data,omitempty"` + Data []VolumeSnapshotInput `json:"data,omitempty"` + client *VolumeSnapshotInputClient } type VolumeSnapshotInputClient struct { @@ -48,9 +49,20 @@ func (c *VolumeSnapshotInputClient) Update(existing *VolumeSnapshotInput, update func (c *VolumeSnapshotInputClient) List(opts *ListOpts) (*VolumeSnapshotInputCollection, error) { resp := &VolumeSnapshotInputCollection{} err := c.rancherClient.doList(VOLUME_SNAPSHOT_INPUT_TYPE, opts, resp) + resp.client = c return resp, err } +func (cc *VolumeSnapshotInputCollection) Next() (*VolumeSnapshotInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &VolumeSnapshotInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + func (c *VolumeSnapshotInputClient) ById(id string) (*VolumeSnapshotInput, error) { resp := &VolumeSnapshotInput{} err := c.rancherClient.doById(VOLUME_SNAPSHOT_INPUT_TYPE, id, resp) diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go new file mode 100644 index 0000000..a2433ba --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go @@ -0,0 +1,190 @@ +package client + +const ( + VOLUME_TEMPLATE_TYPE = "volumeTemplate" +) + +type VolumeTemplate 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"` + + DriverOpts map[string]interface{} `json:"driverOpts,omitempty" yaml:"driver_opts,omitempty"` + + External bool `json:"external,omitempty" yaml:"external,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PerContainer bool `json:"perContainer,omitempty" yaml:"per_container,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"` + + 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 VolumeTemplateCollection struct { + Collection + Data []VolumeTemplate `json:"data,omitempty"` + client *VolumeTemplateClient +} + +type VolumeTemplateClient struct { + rancherClient *RancherClient +} + +type VolumeTemplateOperations interface { + List(opts *ListOpts) (*VolumeTemplateCollection, error) + Create(opts *VolumeTemplate) (*VolumeTemplate, error) + Update(existing *VolumeTemplate, updates interface{}) (*VolumeTemplate, error) + ById(id string) (*VolumeTemplate, error) + Delete(container *VolumeTemplate) error + + ActionActivate(*VolumeTemplate) (*VolumeTemplate, error) + + ActionCreate(*VolumeTemplate) (*VolumeTemplate, error) + + ActionDeactivate(*VolumeTemplate) (*VolumeTemplate, error) + + ActionPurge(*VolumeTemplate) (*VolumeTemplate, error) + + ActionRemove(*VolumeTemplate) (*VolumeTemplate, error) + + ActionRestore(*VolumeTemplate) (*VolumeTemplate, error) + + ActionUpdate(*VolumeTemplate) (*VolumeTemplate, error) +} + +func newVolumeTemplateClient(rancherClient *RancherClient) *VolumeTemplateClient { + return &VolumeTemplateClient{ + rancherClient: rancherClient, + } +} + +func (c *VolumeTemplateClient) Create(container *VolumeTemplate) (*VolumeTemplate, error) { + resp := &VolumeTemplate{} + err := c.rancherClient.doCreate(VOLUME_TEMPLATE_TYPE, container, resp) + return resp, err +} + +func (c *VolumeTemplateClient) Update(existing *VolumeTemplate, updates interface{}) (*VolumeTemplate, error) { + resp := &VolumeTemplate{} + err := c.rancherClient.doUpdate(VOLUME_TEMPLATE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *VolumeTemplateClient) List(opts *ListOpts) (*VolumeTemplateCollection, error) { + resp := &VolumeTemplateCollection{} + err := c.rancherClient.doList(VOLUME_TEMPLATE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *VolumeTemplateCollection) Next() (*VolumeTemplateCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &VolumeTemplateCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *VolumeTemplateClient) ById(id string) (*VolumeTemplate, error) { + resp := &VolumeTemplate{} + err := c.rancherClient.doById(VOLUME_TEMPLATE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *VolumeTemplateClient) Delete(container *VolumeTemplate) error { + return c.rancherClient.doResourceDelete(VOLUME_TEMPLATE_TYPE, &container.Resource) +} + +func (c *VolumeTemplateClient) ActionActivate(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeTemplateClient) ActionCreate(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeTemplateClient) ActionDeactivate(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeTemplateClient) ActionPurge(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeTemplateClient) ActionRemove(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeTemplateClient) ActionRestore(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "restore", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeTemplateClient) ActionUpdate(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/schemas.go b/vendor/github.com/rancher/go-rancher/v2/schemas.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/schemas.go rename to vendor/github.com/rancher/go-rancher/v2/schemas.go diff --git a/vendor/github.com/rancher/go-rancher/client/types.go b/vendor/github.com/rancher/go-rancher/v2/types.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/types.go rename to vendor/github.com/rancher/go-rancher/v2/types.go