Switch to Rancher v2 API

This commit is contained in:
janeczku
2017-01-28 17:50:49 +01:00
parent 9686ce1e81
commit 987123d0ca
220 changed files with 6730 additions and 4421 deletions
+1 -1
View File
@@ -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"]
ENTRYPOINT ["/usr/bin/rancher-letsencrypt", "-debug", "-test-mode"]
+8 -6
View File
@@ -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",
+5 -1
View File
@@ -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)
+10
View File
@@ -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))
}
+3 -1
View File
@@ -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)
}
+13 -6
View File
@@ -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
}
+6 -6
View File
@@ -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
}
+1 -1
View File
@@ -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 {
+18 -35
View File
@@ -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
}
+1 -1
View File
@@ -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 {
+24
View File
@@ -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
+11
View File
@@ -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 ./...
+23
View File
@@ -0,0 +1,23 @@
Copyright (c) 2015, Dave Cheney <dave@cheney.net>
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.
+52
View File
@@ -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
+32
View File
@@ -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
+269
View File
@@ -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
}
+178
View File
@@ -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
}
-7
View File
@@ -1,7 +0,0 @@
package client
type RancherBaseClient struct {
Opts *ClientOpts
Schemas *Schemas
Types map[string]Schema
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
-223
View File
@@ -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
}
-252
View File
@@ -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
}
@@ -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)
}
@@ -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)
}
-81
View File
@@ -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)
}
@@ -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
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
-224
View File
@@ -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
}
@@ -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)
}
@@ -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)
}
@@ -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
}
@@ -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)
}
@@ -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)
}
@@ -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
}
@@ -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)
}
@@ -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
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
@@ -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
}
@@ -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)
}
@@ -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)
}
@@ -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)
}
+39
View File
@@ -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
}
@@ -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 {
@@ -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
}
@@ -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)
@@ -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)
@@ -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)
@@ -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{}
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
+79
View File
@@ -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)
}
@@ -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)
+93
View File
@@ -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)
}
@@ -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)
@@ -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)
@@ -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
}
@@ -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)
}
@@ -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)
@@ -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)
@@ -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)
@@ -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{}
@@ -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)
@@ -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)
@@ -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{}
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
+190
View File
@@ -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
}
@@ -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)
@@ -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{}

Some files were not shown because too many files have changed in this diff Show More