├── .dockerignore
├── .drone.yml
├── .gitignore
├── Dockerfile.dapper
├── LICENSE
├── Makefile
├── README.md
├── compose
├── client.go
└── compose.go
├── job
└── job.go
├── main.go
├── package
└── Dockerfile
├── scripts
├── build
├── ci
├── entry
├── package
├── release
├── test
├── validate
└── version
├── server
├── router.go
├── server.go
└── templates.go
├── templates
└── cowbell
│ ├── 0
│ ├── docker-compose.yml
│ └── rancher-compose.yml
│ ├── catalogIcon-cowbell.svg
│ └── config.yml
├── trash.yml
└── vendor
└── github.com
├── Sirupsen
└── logrus
│ ├── .gitignore
│ ├── .travis.yml
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── doc.go
│ ├── entry.go
│ ├── entry_test.go
│ ├── exported.go
│ ├── formatter.go
│ ├── formatter_bench_test.go
│ ├── hook_test.go
│ ├── hooks.go
│ ├── json_formatter.go
│ ├── json_formatter_test.go
│ ├── logger.go
│ ├── logrus.go
│ ├── logrus_test.go
│ ├── terminal_bsd.go
│ ├── terminal_linux.go
│ ├── terminal_notwindows.go
│ ├── terminal_solaris.go
│ ├── terminal_windows.go
│ ├── text_formatter.go
│ ├── text_formatter_test.go
│ └── writer.go
├── gorilla
├── context
│ ├── .travis.yml
│ ├── LICENSE
│ ├── README.md
│ ├── context.go
│ ├── context_test.go
│ └── doc.go
├── mux
│ ├── .travis.yml
│ ├── LICENSE
│ ├── README.md
│ ├── bench_test.go
│ ├── doc.go
│ ├── mux.go
│ ├── mux_test.go
│ ├── old_test.go
│ ├── regexp.go
│ └── route.go
└── websocket
│ ├── .gitignore
│ ├── .travis.yml
│ ├── AUTHORS
│ ├── LICENSE
│ ├── README.md
│ ├── bench_test.go
│ ├── client.go
│ ├── client_server_test.go
│ ├── client_test.go
│ ├── conn.go
│ ├── conn_test.go
│ ├── doc.go
│ ├── example_test.go
│ ├── json.go
│ ├── json_test.go
│ ├── server.go
│ ├── server_test.go
│ ├── util.go
│ └── util_test.go
└── rancher
└── go-rancher
├── .drone.yml
├── .gitignore
├── .package
├── .wrap-docker-args
├── Dockerfile
├── LICENSE
├── README.md
├── client
├── client.go
├── client_test.go
├── common.go
├── generated_account.go
├── generated_active_setting.go
├── generated_add_label_input.go
├── generated_add_load_balancer_input.go
├── generated_add_outputs_input.go
├── generated_add_remove_cluster_host_input.go
├── generated_add_remove_load_balancer_host_input.go
├── generated_add_remove_load_balancer_listener_input.go
├── generated_add_remove_load_balancer_service_link_input.go
├── generated_add_remove_load_balancer_target_input.go
├── generated_add_remove_service_link_input.go
├── generated_agent.go
├── generated_amazonec2config.go
├── generated_api_key.go
├── generated_audit_log.go
├── generated_azure_config.go
├── generated_base_machine_config.go
├── generated_certificate.go
├── generated_change_secret_input.go
├── generated_client.go
├── generated_cluster.go
├── generated_compose_config.go
├── generated_compose_config_input.go
├── generated_compose_project.go
├── generated_compose_service.go
├── generated_config_item.go
├── generated_config_item_status.go
├── generated_container.go
├── generated_container_event.go
├── generated_container_exec.go
├── generated_container_logs.go
├── generated_container_proxy.go
├── generated_credential.go
├── generated_databasechangelog.go
├── generated_databasechangeloglock.go
├── generated_digitalocean_config.go
├── generated_dns_service.go
├── generated_docker_build.go
├── generated_dynamic_schema.go
├── generated_environment.go
├── generated_environment_upgrade.go
├── generated_exoscale_config.go
├── generated_extension_implementation.go
├── generated_extension_point.go
├── generated_external_dns_event.go
├── generated_external_event.go
├── generated_external_handler.go
├── generated_external_handler_external_handler_process_map.go
├── generated_external_handler_process.go
├── generated_external_handler_process_config.go
├── generated_external_host_event.go
├── generated_external_service.go
├── generated_external_service_event.go
├── generated_external_storage_pool_event.go
├── generated_external_volume_event.go
├── generated_field_documentation.go
├── generated_githubconfig.go
├── generated_global_load_balancer.go
├── generated_global_load_balancer_health_check.go
├── generated_global_load_balancer_policy.go
├── generated_ha_config.go
├── generated_ha_config_input.go
├── generated_haproxy_config.go
├── generated_healthcheck_instance_host_map.go
├── generated_host.go
├── generated_host_access.go
├── generated_host_api_proxy_token.go
├── generated_identity.go
├── generated_image.go
├── generated_in_service_upgrade_strategy.go
├── generated_instance.go
├── generated_instance_console.go
├── generated_instance_console_input.go
├── generated_instance_health_check.go
├── generated_instance_link.go
├── generated_instance_stop.go
├── generated_ip_address.go
├── generated_ip_address_associate_input.go
├── generated_kubernetes_service.go
├── generated_label.go
├── generated_launch_config.go
├── generated_ldapconfig.go
├── generated_load_balancer.go
├── generated_load_balancer_app_cookie_stickiness_policy.go
├── generated_load_balancer_config.go
├── generated_load_balancer_config_listener_map.go
├── generated_load_balancer_cookie_stickiness_policy.go
├── generated_load_balancer_health_check.go
├── generated_load_balancer_host_map.go
├── generated_load_balancer_listener.go
├── generated_load_balancer_service.go
├── generated_load_balancer_service_link.go
├── generated_load_balancer_target.go
├── generated_local_auth_config.go
├── generated_log_config.go
├── generated_machine.go
├── generated_machine_driver.go
├── generated_machine_driver_error_input.go
├── generated_machine_driver_update_input.go
├── generated_mount.go
├── generated_network.go
├── generated_openldapconfig.go
├── generated_openstack_config.go
├── generated_packet_config.go
├── generated_password.go
├── generated_physical_host.go
├── generated_port.go
├── generated_process_definition.go
├── generated_process_execution.go
├── generated_process_instance.go
├── generated_project.go
├── generated_project_member.go
├── generated_public_endpoint.go
├── generated_publish.go
├── generated_pull_task.go
├── generated_rackspace_config.go
├── generated_recreate_on_quorum_strategy_config.go
├── generated_register.go
├── generated_registration_token.go
├── generated_registry.go
├── generated_registry_credential.go
├── generated_remove_label_input.go
├── generated_remove_load_balancer_input.go
├── generated_resource_definition.go
├── generated_restart_policy.go
├── generated_rolling_restart_strategy.go
├── generated_secondary_launch_config.go
├── generated_service.go
├── generated_service_consume_map.go
├── generated_service_event.go
├── generated_service_expose_map.go
├── generated_service_link.go
├── generated_service_proxy.go
├── generated_service_restart.go
├── generated_service_upgrade.go
├── generated_service_upgrade_strategy.go
├── generated_services_port_range.go
├── generated_set_labels_input.go
├── generated_set_load_balancer_hosts_input.go
├── generated_set_load_balancer_listeners_input.go
├── generated_set_load_balancer_service_links_input.go
├── generated_set_load_balancer_targets_input.go
├── generated_set_project_members_input.go
├── generated_set_service_links_input.go
├── generated_setting.go
├── generated_snapshot.go
├── generated_softlayer_config.go
├── generated_state_transition.go
├── generated_stats_access.go
├── generated_storage_pool.go
├── generated_subscribe.go
├── generated_task.go
├── generated_task_instance.go
├── generated_to_service_upgrade_strategy.go
├── generated_type_documentation.go
├── generated_ubiquity_config.go
├── generated_user_preference.go
├── generated_virtual_machine.go
├── generated_virtual_machine_disk.go
├── generated_virtualbox_config.go
├── generated_vmwarevcloudair_config.go
├── generated_vmwarevsphere_config.go
├── generated_volume.go
├── schemas.go
└── types.go
├── main.go
└── schemas.json
/.dockerignore:
--------------------------------------------------------------------------------
1 | ./bin
2 | ./.dapper
3 | ./dist
4 | ./.trash-cache
5 |
--------------------------------------------------------------------------------
/.drone.yml:
--------------------------------------------------------------------------------
1 | image: rancher/dind:v1.10.0-rancher1
2 | script:
3 | - wrapdocker
4 | - make ci
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.dapper
2 | /bin
3 | *.swp
4 | /.trash-cache
5 |
--------------------------------------------------------------------------------
/Dockerfile.dapper:
--------------------------------------------------------------------------------
1 | FROM golang:1.6
2 | RUN go get github.com/rancher/trash
3 | RUN go get github.com/golang/lint/golint
4 | RUN curl -sL https://get.docker.com/builds/Linux/x86_64/docker-1.9.1 > /usr/bin/docker && \
5 | chmod +x /usr/bin/docker
6 | ENV PATH /go/bin:$PATH
7 | ENV DAPPER_SOURCE /go/src/github.com/rancher/cowbell
8 | ENV DAPPER_OUTPUT bin
9 | ENV DAPPER_DOCKER_SOCKET true
10 | ENV DAPPER_ENV TAG REPO
11 | ENV GO15VENDOREXPERIMENT 1
12 | ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache
13 | WORKDIR ${DAPPER_SOURCE}
14 | ENTRYPOINT ["./scripts/entry"]
15 | CMD ["ci"]
16 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | TARGETS := $(shell ls scripts)
2 |
3 | .dapper:
4 | @echo Downloading dapper
5 | @curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp
6 | @@chmod +x .dapper.tmp
7 | @./.dapper.tmp -v
8 | @mv .dapper.tmp .dapper
9 |
10 | $(TARGETS): .dapper
11 | ./.dapper $@
12 |
13 | trash: .dapper
14 | ./.dapper -m bind trash
15 |
16 | trash-keep: .dapper
17 | ./.dapper -m bind trash -k
18 |
19 | deps: trash
20 |
21 | .DEFAULT_GOAL := ci
22 |
23 | .PHONY: $(TARGETS)
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | cowbell
2 | ========
3 |
4 | A microservice that does micro things.
5 |
6 | ## Building
7 |
8 | `make`
9 |
10 |
11 | ## Running
12 |
13 | `./bin/cowbell`
14 |
15 | ## License
16 | Copyright (c) 2014-2016 [Rancher Labs, Inc.](http://rancher.com)
17 |
18 | Licensed under the Apache License, Version 2.0 (the "License");
19 | you may not use this file except in compliance with the License.
20 | You may obtain a copy of the License at
21 |
22 | [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
23 |
24 | Unless required by applicable law or agreed to in writing, software
25 | distributed under the License is distributed on an "AS IS" BASIS,
26 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27 | See the License for the specific language governing permissions and
28 | limitations under the License.
29 |
--------------------------------------------------------------------------------
/compose/compose.go:
--------------------------------------------------------------------------------
1 | package compose
2 |
3 | import (
4 | "fmt"
5 | "strconv"
6 | "strings"
7 |
8 | "github.com/rancher/cowbell/job"
9 | "github.com/rancher/go-rancher/client"
10 | )
11 |
12 | type Compose struct {
13 | c *Client
14 | jm *job.Manager
15 | }
16 |
17 | func NewCompose(url, accessKey, secretKey string, jm *job.Manager) (*Compose, error) {
18 | rancherClient, err := client.NewRancherClient(&client.ClientOpts{
19 | Url: url,
20 | AccessKey: accessKey,
21 | SecretKey: secretKey,
22 | })
23 | if err != nil {
24 | return nil, err
25 | }
26 |
27 | return &Compose{
28 | c: &Client{
29 | c: rancherClient,
30 | },
31 | jm: jm,
32 | }, nil
33 | }
34 |
35 | func (c *Compose) Scale(stack, service, scale string) error {
36 | job, err := c.newJob(stack, "", "")
37 | if err != nil {
38 | return err
39 | }
40 |
41 | newScale, err := c.c.getCurrentScale(stack, service)
42 | if err != nil {
43 | return job.SetErr(err)
44 | }
45 |
46 | if strings.EqualFold(scale, "up") {
47 | newScale++
48 | } else if strings.EqualFold(scale, "down") {
49 | newScale--
50 | if newScale < 1 {
51 | newScale = 1
52 | }
53 | } else {
54 | n, err := strconv.Atoi(scale)
55 | if err != nil {
56 | return job.SetErr(err)
57 | }
58 | newScale = int64(n)
59 | }
60 |
61 | return job.Run("-p", stack, "scale", fmt.Sprintf("%s=%d", service, newScale))
62 | }
63 |
64 | func (c *Compose) Upgrade(stack, service, dockerComposeURL, rancherComposeURL string) error {
65 | job, err := c.newJob(stack, dockerComposeURL, rancherComposeURL)
66 | if err != nil {
67 | return err
68 | }
69 |
70 | args := []string{"-p", stack, "up", "-d", "-u", "-c", "-p"}
71 | if service != "" {
72 | args = append(args, service)
73 | }
74 | return job.Run(args...)
75 | }
76 |
77 | func (c *Compose) Redeploy(stack, service string) error {
78 | job, err := c.newJob(stack, "", "")
79 | if err != nil {
80 | return err
81 | }
82 |
83 | args := []string{"-p", stack, "up", "-d", "--force-upgrade", "-c", "-p"}
84 | if service != "" {
85 | args = append(args, service)
86 | }
87 | return job.Run(args...)
88 | }
89 |
90 | func (c *Compose) newJob(stack, dockerComposeURL, rancherComposeURL string) (*job.Job, error) {
91 | job, err := c.jm.NewJob()
92 |
93 | if dockerComposeURL == "" {
94 | job.DockerCompose, job.RancherCompose, err = c.c.getTemplates(stack)
95 | } else {
96 | job.DockerCompose, job.RancherCompose, err = c.c.downloadURL(dockerComposeURL, rancherComposeURL)
97 | }
98 | if err != nil {
99 | return nil, job.SetErr(err)
100 | }
101 | return job, nil
102 | }
103 |
--------------------------------------------------------------------------------
/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "math/rand"
5 | "net/http"
6 | "os"
7 | "strconv"
8 | "time"
9 |
10 | "github.com/Sirupsen/logrus"
11 | "github.com/rancher/cowbell/compose"
12 | "github.com/rancher/cowbell/job"
13 | "github.com/rancher/cowbell/server"
14 | )
15 |
16 | func main() {
17 | token := os.Getenv("TOKEN")
18 | listen := os.Getenv("LISTEN")
19 |
20 | url := os.Getenv("CATTLE_URL")
21 | accessKey := os.Getenv("CATTLE_ACCESS_KEY")
22 | secretKey := os.Getenv("CATTLE_SECRET_KEY")
23 |
24 | os.Setenv("RANCHER_URL", url)
25 | os.Setenv("RANCHER_ACCESS_KEY", accessKey)
26 | os.Setenv("RANCHER_SECRET_KEY", secretKey)
27 |
28 | if listen == "" {
29 | listen = ":8080"
30 | }
31 |
32 | if token == "" {
33 | r := rand.New(rand.NewSource(time.Now().UnixNano()))
34 | token = strconv.FormatInt(r.Int63(), 10)
35 | }
36 |
37 | logrus.Infof("Listening on %s with token %s", listen, token)
38 |
39 | jm := job.NewJobManager()
40 | compose, err := compose.NewCompose(url, accessKey, secretKey, jm)
41 | if err != nil {
42 | logrus.Fatalf("Failed to construct client to %s with access key %s: %v", url, accessKey, err)
43 | }
44 |
45 | router := server.NewRouter(server.NewServer(jm, compose), token)
46 | if err := http.ListenAndServe(listen, router); err != nil {
47 | logrus.Fatal(err)
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/package/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:15.10
2 | ADD https://releases.rancher.com/compose/v0.7.4/binaries/linux-amd64/rancher-compose /usr/bin
3 | RUN chmod +x /usr/bin/rancher-compose
4 | COPY cowbell /usr/bin/
5 | CMD ["cowbell"]
6 |
--------------------------------------------------------------------------------
/scripts/build:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | source $(dirname $0)/version
5 |
6 | cd $(dirname $0)/..
7 |
8 | mkdir -p bin
9 | go build -ldflags "-X main.VERSION=$VERSION -linkmode external -extldflags -static" -o bin/cowbell
10 |
--------------------------------------------------------------------------------
/scripts/ci:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | cd $(dirname $0)
5 |
6 | ./build
7 | ./test
8 | ./validate
9 | ./package
10 |
--------------------------------------------------------------------------------
/scripts/entry:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | trap "chown -R $DAPPER_UID:$DAPPER_GID ." exit
5 |
6 | mkdir -p bin
7 | if [ -e ./scripts/$1 ]; then
8 | ./scripts/"$@"
9 | else
10 | "$@"
11 | fi
12 |
--------------------------------------------------------------------------------
/scripts/package:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | source $(dirname $0)/version
5 |
6 | cd $(dirname $0)/../package
7 |
8 | TAG=${TAG:-${VERSION}}
9 | REPO=${REPO:-rancher}
10 |
11 | cp ../bin/cowbell .
12 | docker build -t ${REPO}/cowbell:${TAG} .
13 |
14 | echo Built ${REPO}/cowbell:${TAG}
15 |
--------------------------------------------------------------------------------
/scripts/release:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | exec $(dirname $0)/ci
4 |
--------------------------------------------------------------------------------
/scripts/test:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | cd $(dirname $0)/..
5 |
6 | echo Running tests
7 |
8 | PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')"
9 |
10 | go test -race -cover -tags=test ${PACKAGES}
11 |
--------------------------------------------------------------------------------
/scripts/validate:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | cd $(dirname $0)/..
5 |
6 | echo Running validation
7 |
8 | PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')"
9 |
10 | echo Running: go vet
11 | go vet ${PACKAGES}
12 | echo Running: golint
13 | for i in ${PACKAGES}; do
14 | if [ -n "$(golint $i | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then
15 | failed=true
16 | fi
17 | done
18 | test -z "$failed"
19 | echo Running: go fmt
20 | test -z "$(go fmt ${PACKAGES} | tee /dev/stderr)"
21 |
--------------------------------------------------------------------------------
/scripts/version:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
4 | DIRTY="-dirty"
5 | fi
6 |
7 | COMMIT=$(git rev-parse --short HEAD)
8 | GIT_TAG=$(git tag -l --contains HEAD | head -n 1)
9 |
10 | if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
11 | VERSION=$GIT_TAG
12 | else
13 | VERSION="${COMMIT}${DIRTY}"
14 | fi
15 |
--------------------------------------------------------------------------------
/server/router.go:
--------------------------------------------------------------------------------
1 | package server
2 |
3 | import (
4 | "net/http"
5 |
6 | "github.com/gorilla/mux"
7 | )
8 |
9 | func f(t func(http.ResponseWriter, *http.Request) error) http.Handler {
10 | return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
11 | if err := t(rw, req); err != nil {
12 | rw.WriteHeader(http.StatusInternalServerError)
13 | rw.Write([]byte(err.Error()))
14 | }
15 | })
16 | }
17 |
18 | func NewRouter(s *Server, token string) *mux.Router {
19 | router := mux.NewRouter().StrictSlash(true)
20 |
21 | // API framework routes
22 | router.Methods("GET").Path("/").Handler(f(s.Info))
23 | router.Methods("GET").Path("/" + token + "/jobs").Handler(f(s.ListJobs))
24 | router.Methods("GET").Path("/" + token + "/jobs/{id}/output").Handler(f(s.GetJobOutput))
25 |
26 | router.Methods("POST").Path("/" + token + "/scale/{stack}/{service}/{scale}").Handler(f(s.Scale))
27 | router.Methods("POST").Path("/" + token + "/upgrade/{stack}").Handler(f(s.Upgrade))
28 | router.Methods("POST").Path("/" + token + "/upgrade/{stack}/{service}").Handler(f(s.Upgrade))
29 | router.Methods("POST").Path("/" + token + "/redeploy/{stack}").Handler(f(s.Redeploy))
30 | router.Methods("POST").Path("/" + token + "/redeploy/{stack}/{service}").Handler(f(s.Redeploy))
31 |
32 | return router
33 | }
34 |
--------------------------------------------------------------------------------
/server/server.go:
--------------------------------------------------------------------------------
1 | package server
2 |
3 | import (
4 | "net/http"
5 | "sort"
6 | "strconv"
7 |
8 | "github.com/gorilla/mux"
9 | "github.com/rancher/cowbell/compose"
10 | "github.com/rancher/cowbell/job"
11 | )
12 |
13 | type jobSorter []*job.Job
14 |
15 | func (js jobSorter) Len() int {
16 | return len(js)
17 | }
18 |
19 | func (js jobSorter) Swap(i, j int) {
20 | js[i], js[j] = js[j], js[i]
21 | }
22 |
23 | func (js jobSorter) Less(i, j int) bool {
24 | return js[i].ID < js[j].ID
25 | }
26 |
27 | type Server struct {
28 | jm *job.Manager
29 | c *compose.Compose
30 | }
31 |
32 | func NewServer(jm *job.Manager, c *compose.Compose) *Server {
33 | return &Server{
34 | c: c,
35 | jm: jm,
36 | }
37 | }
38 |
39 | func (s *Server) Info(rw http.ResponseWriter, req *http.Request) error {
40 | return infoTemplate.Execute(rw, nil)
41 | }
42 |
43 | func (s *Server) ListJobs(rw http.ResponseWriter, req *http.Request) error {
44 | jobs := s.jm.ListJobs()
45 | sort.Sort(jobSorter(jobs))
46 | return listTemplate.Execute(rw, map[string]interface{}{
47 | "jobs": jobs,
48 | })
49 | }
50 |
51 | func (s *Server) GetJobOutput(rw http.ResponseWriter, req *http.Request) error {
52 | id := mux.Vars(req)["id"]
53 | idNum, err := strconv.Atoi(id)
54 | if err != nil {
55 | return err
56 | }
57 |
58 | job := s.jm.GetJob(int32(idNum))
59 | if job != nil {
60 | rw.Write(job.GetOutput())
61 | }
62 |
63 | return nil
64 | }
65 |
66 | func (s *Server) Scale(rw http.ResponseWriter, req *http.Request) error {
67 | vars := mux.Vars(req)
68 |
69 | return s.c.Scale(vars["stack"], vars["service"], vars["scale"])
70 | }
71 |
72 | func (s *Server) Upgrade(rw http.ResponseWriter, req *http.Request) error {
73 | vars := mux.Vars(req)
74 |
75 | return s.c.Upgrade(vars["stack"], vars["service"],
76 | req.URL.Query().Get("dockerComposeUrl"),
77 | req.URL.Query().Get("rancherComposeUrl"))
78 | }
79 |
80 | func (s *Server) Redeploy(rw http.ResponseWriter, req *http.Request) error {
81 | vars := mux.Vars(req)
82 |
83 | return s.c.Redeploy(vars["stack"], vars["service"])
84 | }
85 |
--------------------------------------------------------------------------------
/server/templates.go:
--------------------------------------------------------------------------------
1 | package server
2 |
3 | import "html/template"
4 |
5 | const (
6 | info = `
7 | Available web hooks receivers
8 |
9 | Scale up
10 |
11 | curl -X POST http://server/{token}/scale/{stack}/{service}/up
12 |
13 | Scale down
14 |
15 | curl -X POST http://server/{token}/scale/{stack}/{service}/down
16 |
17 | Scale to X
18 |
19 | curl -X POST http://server/{token}/scale/{stack}/{service}/1
20 |
21 | Upgrade
22 |
23 | curl -X POST http://server/{token}/upgrade/{stack}?dockerComposeUrl=http://...&rancherComposeUrl=http://...
24 | curl -X POST http://server/{token}/upgrade/{stack}/{service}?dockerComposeUrl=http://...&rancherComposeUrl=http://...
25 |
26 | Redeploy
27 |
28 | curl -X POST http://server/{token}/redeploy/{stack}
29 | curl -X POST http://server/{token}/redeploy/{stack}/{service}
30 |
31 | List jobs
32 |
33 | curl http://server/{token}/jobs
34 | `
35 | list = `
36 |
37 |
38 |
39 |
40 | ID
41 | |
42 |
43 | State
44 | |
45 |
46 | Output Link
47 | |
48 |
49 | Created
50 | |
51 |
52 | {{range .jobs}}
53 |
54 |
55 | {{.ID}}
56 | |
57 |
58 | {{.State}}
59 | |
60 |
61 | Output
62 | |
63 |
64 | {{.Created}}
65 | |
66 |
67 | {{end}}
68 |
69 |
70 | `
71 | )
72 |
73 | var (
74 | infoTemplate = template.Must(template.New("info").Parse(info))
75 | listTemplate = template.Must(template.New("list").Parse(list))
76 | )
77 |
--------------------------------------------------------------------------------
/templates/cowbell/0/docker-compose.yml:
--------------------------------------------------------------------------------
1 | cowbell:
2 | image: ibuildthecloud/cowbell:dev
3 | labels:
4 | io.rancher.container.create_agent: 'true'
5 | io.rancher.container.agent.role: environment
6 | environment:
7 | TOKEN: ${token}
8 | ports:
9 | - ${port}:8080
10 |
--------------------------------------------------------------------------------
/templates/cowbell/0/rancher-compose.yml:
--------------------------------------------------------------------------------
1 | .catalog:
2 | name: "Cowbell"
3 | version: 0.0.1
4 | description: |
5 | Webhook Receivers for Rancher
6 | questions:
7 | - variable: "token"
8 | type: string
9 | required: true
10 | label: "Random Token"
11 | description: "This should be some fairly unique string that nobody can guess."
12 | - variable: "port"
13 | type: int
14 | required: true
15 | label: "Public Port"
16 | description: "The public port the service will listen on."
17 |
--------------------------------------------------------------------------------
/templates/cowbell/config.yml:
--------------------------------------------------------------------------------
1 | name: Cowbell
2 | description: |
3 | Webhook Receivers for Rancher
4 | version: 0.0.1
5 | category: Continuous Integration
6 |
--------------------------------------------------------------------------------
/trash.yml:
--------------------------------------------------------------------------------
1 | import:
2 | - package: github.com/gorilla/mux
3 | version: 0eeaf8392f5b04950925b8a69fe70f110fa7cbfc
4 | - package: github.com/gorilla/websocket
5 | version: a724ba452858d5b6d30c22d2d13ae77e1ed67cad
6 | - package: github.com/gorilla/context
7 | version: a8d44e7d8e4d532b6a27a02dd82abb31cc1b01bd
8 | - package: github.com/Sirupsen/logrus
9 | version: 446d1c146faa8ed3f4218f056fcd165f6bcfda81
10 | - package: github.com/rancher/go-rancher-metadata
11 | version: 721b783c9983a17ec0d63d5530337610de9519ec
12 | - package: github.com/rancher/go-rancher
13 | version: 80f15a052d778601e047286669edda02e83383cc
14 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/.gitignore:
--------------------------------------------------------------------------------
1 | logrus
2 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - 1.3
4 | - 1.4
5 | - tip
6 | install:
7 | - go get -t ./...
8 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 0.9.0 (Unreleased)
2 |
3 | * logrus/text_formatter: don't emit empty msg
4 | * logrus/hooks/airbrake: move out of main repository
5 | * logrus/hooks/sentry: move out of main repository
6 | * logrus/hooks/papertrail: move out of main repository
7 | * logrus/hooks/bugsnag: move out of main repository
8 |
9 | # 0.8.7
10 |
11 | * logrus/core: fix possible race (#216)
12 | * logrus/doc: small typo fixes and doc improvements
13 |
14 |
15 | # 0.8.6
16 |
17 | * hooks/raven: allow passing an initialized client
18 |
19 | # 0.8.5
20 |
21 | * logrus/core: revert #208
22 |
23 | # 0.8.4
24 |
25 | * formatter/text: fix data race (#218)
26 |
27 | # 0.8.3
28 |
29 | * logrus/core: fix entry log level (#208)
30 | * logrus/core: improve performance of text formatter by 40%
31 | * logrus/core: expose `LevelHooks` type
32 | * logrus/core: add support for DragonflyBSD and NetBSD
33 | * formatter/text: print structs more verbosely
34 |
35 | # 0.8.2
36 |
37 | * logrus: fix more Fatal family functions
38 |
39 | # 0.8.1
40 |
41 | * logrus: fix not exiting on `Fatalf` and `Fatalln`
42 |
43 | # 0.8.0
44 |
45 | * logrus: defaults to stderr instead of stdout
46 | * hooks/sentry: add special field for `*http.Request`
47 | * formatter/text: ignore Windows for colors
48 |
49 | # 0.7.3
50 |
51 | * formatter/\*: allow configuration of timestamp layout
52 |
53 | # 0.7.2
54 |
55 | * formatter/text: Add configuration option for time format (#158)
56 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Simon Eskildsen
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
3 |
4 |
5 | The simplest way to use Logrus is simply the package-level exported logger:
6 |
7 | package main
8 |
9 | import (
10 | log "github.com/Sirupsen/logrus"
11 | )
12 |
13 | func main() {
14 | log.WithFields(log.Fields{
15 | "animal": "walrus",
16 | "number": 1,
17 | "size": 10,
18 | }).Info("A walrus appears")
19 | }
20 |
21 | Output:
22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10
23 |
24 | For a full guide visit https://github.com/Sirupsen/logrus
25 | */
26 | package logrus
27 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/entry_test.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | import (
4 | "bytes"
5 | "fmt"
6 | "testing"
7 |
8 | "github.com/stretchr/testify/assert"
9 | )
10 |
11 | func TestEntryWithError(t *testing.T) {
12 |
13 | assert := assert.New(t)
14 |
15 | defer func() {
16 | ErrorKey = "error"
17 | }()
18 |
19 | err := fmt.Errorf("kaboom at layer %d", 4711)
20 |
21 | assert.Equal(err, WithError(err).Data["error"])
22 |
23 | logger := New()
24 | logger.Out = &bytes.Buffer{}
25 | entry := NewEntry(logger)
26 |
27 | assert.Equal(err, entry.WithError(err).Data["error"])
28 |
29 | ErrorKey = "err"
30 |
31 | assert.Equal(err, entry.WithError(err).Data["err"])
32 |
33 | }
34 |
35 | func TestEntryPanicln(t *testing.T) {
36 | errBoom := fmt.Errorf("boom time")
37 |
38 | defer func() {
39 | p := recover()
40 | assert.NotNil(t, p)
41 |
42 | switch pVal := p.(type) {
43 | case *Entry:
44 | assert.Equal(t, "kaboom", pVal.Message)
45 | assert.Equal(t, errBoom, pVal.Data["err"])
46 | default:
47 | t.Fatalf("want type *Entry, got %T: %#v", pVal, pVal)
48 | }
49 | }()
50 |
51 | logger := New()
52 | logger.Out = &bytes.Buffer{}
53 | entry := NewEntry(logger)
54 | entry.WithField("err", errBoom).Panicln("kaboom")
55 | }
56 |
57 | func TestEntryPanicf(t *testing.T) {
58 | errBoom := fmt.Errorf("boom again")
59 |
60 | defer func() {
61 | p := recover()
62 | assert.NotNil(t, p)
63 |
64 | switch pVal := p.(type) {
65 | case *Entry:
66 | assert.Equal(t, "kaboom true", pVal.Message)
67 | assert.Equal(t, errBoom, pVal.Data["err"])
68 | default:
69 | t.Fatalf("want type *Entry, got %T: %#v", pVal, pVal)
70 | }
71 | }()
72 |
73 | logger := New()
74 | logger.Out = &bytes.Buffer{}
75 | entry := NewEntry(logger)
76 | entry.WithField("err", errBoom).Panicf("kaboom %v", true)
77 | }
78 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/formatter.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | import "time"
4 |
5 | const DefaultTimestampFormat = time.RFC3339
6 |
7 | // The Formatter interface is used to implement a custom Formatter. It takes an
8 | // `Entry`. It exposes all the fields, including the default ones:
9 | //
10 | // * `entry.Data["msg"]`. The message passed from Info, Warn, Error ..
11 | // * `entry.Data["time"]`. The timestamp.
12 | // * `entry.Data["level"]. The level the entry was logged at.
13 | //
14 | // Any additional fields added with `WithField` or `WithFields` are also in
15 | // `entry.Data`. Format is expected to return an array of bytes which are then
16 | // logged to `logger.Out`.
17 | type Formatter interface {
18 | Format(*Entry) ([]byte, error)
19 | }
20 |
21 | // This is to not silently overwrite `time`, `msg` and `level` fields when
22 | // dumping it. If this code wasn't there doing:
23 | //
24 | // logrus.WithField("level", 1).Info("hello")
25 | //
26 | // Would just silently drop the user provided level. Instead with this code
27 | // it'll logged as:
28 | //
29 | // {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."}
30 | //
31 | // It's not exported because it's still using Data in an opinionated way. It's to
32 | // avoid code duplication between the two default formatters.
33 | func prefixFieldClashes(data Fields) {
34 | _, ok := data["time"]
35 | if ok {
36 | data["fields.time"] = data["time"]
37 | }
38 |
39 | _, ok = data["msg"]
40 | if ok {
41 | data["fields.msg"] = data["msg"]
42 | }
43 |
44 | _, ok = data["level"]
45 | if ok {
46 | data["fields.level"] = data["level"]
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/formatter_bench_test.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | import (
4 | "fmt"
5 | "testing"
6 | "time"
7 | )
8 |
9 | // smallFields is a small size data set for benchmarking
10 | var smallFields = Fields{
11 | "foo": "bar",
12 | "baz": "qux",
13 | "one": "two",
14 | "three": "four",
15 | }
16 |
17 | // largeFields is a large size data set for benchmarking
18 | var largeFields = Fields{
19 | "foo": "bar",
20 | "baz": "qux",
21 | "one": "two",
22 | "three": "four",
23 | "five": "six",
24 | "seven": "eight",
25 | "nine": "ten",
26 | "eleven": "twelve",
27 | "thirteen": "fourteen",
28 | "fifteen": "sixteen",
29 | "seventeen": "eighteen",
30 | "nineteen": "twenty",
31 | "a": "b",
32 | "c": "d",
33 | "e": "f",
34 | "g": "h",
35 | "i": "j",
36 | "k": "l",
37 | "m": "n",
38 | "o": "p",
39 | "q": "r",
40 | "s": "t",
41 | "u": "v",
42 | "w": "x",
43 | "y": "z",
44 | "this": "will",
45 | "make": "thirty",
46 | "entries": "yeah",
47 | }
48 |
49 | var errorFields = Fields{
50 | "foo": fmt.Errorf("bar"),
51 | "baz": fmt.Errorf("qux"),
52 | }
53 |
54 | func BenchmarkErrorTextFormatter(b *testing.B) {
55 | doBenchmark(b, &TextFormatter{DisableColors: true}, errorFields)
56 | }
57 |
58 | func BenchmarkSmallTextFormatter(b *testing.B) {
59 | doBenchmark(b, &TextFormatter{DisableColors: true}, smallFields)
60 | }
61 |
62 | func BenchmarkLargeTextFormatter(b *testing.B) {
63 | doBenchmark(b, &TextFormatter{DisableColors: true}, largeFields)
64 | }
65 |
66 | func BenchmarkSmallColoredTextFormatter(b *testing.B) {
67 | doBenchmark(b, &TextFormatter{ForceColors: true}, smallFields)
68 | }
69 |
70 | func BenchmarkLargeColoredTextFormatter(b *testing.B) {
71 | doBenchmark(b, &TextFormatter{ForceColors: true}, largeFields)
72 | }
73 |
74 | func BenchmarkSmallJSONFormatter(b *testing.B) {
75 | doBenchmark(b, &JSONFormatter{}, smallFields)
76 | }
77 |
78 | func BenchmarkLargeJSONFormatter(b *testing.B) {
79 | doBenchmark(b, &JSONFormatter{}, largeFields)
80 | }
81 |
82 | func doBenchmark(b *testing.B, formatter Formatter, fields Fields) {
83 | entry := &Entry{
84 | Time: time.Time{},
85 | Level: InfoLevel,
86 | Message: "message",
87 | Data: fields,
88 | }
89 | var d []byte
90 | var err error
91 | for i := 0; i < b.N; i++ {
92 | d, err = formatter.Format(entry)
93 | if err != nil {
94 | b.Fatal(err)
95 | }
96 | b.SetBytes(int64(len(d)))
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/hook_test.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/stretchr/testify/assert"
7 | )
8 |
9 | type TestHook struct {
10 | Fired bool
11 | }
12 |
13 | func (hook *TestHook) Fire(entry *Entry) error {
14 | hook.Fired = true
15 | return nil
16 | }
17 |
18 | func (hook *TestHook) Levels() []Level {
19 | return []Level{
20 | DebugLevel,
21 | InfoLevel,
22 | WarnLevel,
23 | ErrorLevel,
24 | FatalLevel,
25 | PanicLevel,
26 | }
27 | }
28 |
29 | func TestHookFires(t *testing.T) {
30 | hook := new(TestHook)
31 |
32 | LogAndAssertJSON(t, func(log *Logger) {
33 | log.Hooks.Add(hook)
34 | assert.Equal(t, hook.Fired, false)
35 |
36 | log.Print("test")
37 | }, func(fields Fields) {
38 | assert.Equal(t, hook.Fired, true)
39 | })
40 | }
41 |
42 | type ModifyHook struct {
43 | }
44 |
45 | func (hook *ModifyHook) Fire(entry *Entry) error {
46 | entry.Data["wow"] = "whale"
47 | return nil
48 | }
49 |
50 | func (hook *ModifyHook) Levels() []Level {
51 | return []Level{
52 | DebugLevel,
53 | InfoLevel,
54 | WarnLevel,
55 | ErrorLevel,
56 | FatalLevel,
57 | PanicLevel,
58 | }
59 | }
60 |
61 | func TestHookCanModifyEntry(t *testing.T) {
62 | hook := new(ModifyHook)
63 |
64 | LogAndAssertJSON(t, func(log *Logger) {
65 | log.Hooks.Add(hook)
66 | log.WithField("wow", "elephant").Print("test")
67 | }, func(fields Fields) {
68 | assert.Equal(t, fields["wow"], "whale")
69 | })
70 | }
71 |
72 | func TestCanFireMultipleHooks(t *testing.T) {
73 | hook1 := new(ModifyHook)
74 | hook2 := new(TestHook)
75 |
76 | LogAndAssertJSON(t, func(log *Logger) {
77 | log.Hooks.Add(hook1)
78 | log.Hooks.Add(hook2)
79 |
80 | log.WithField("wow", "elephant").Print("test")
81 | }, func(fields Fields) {
82 | assert.Equal(t, fields["wow"], "whale")
83 | assert.Equal(t, hook2.Fired, true)
84 | })
85 | }
86 |
87 | type ErrorHook struct {
88 | Fired bool
89 | }
90 |
91 | func (hook *ErrorHook) Fire(entry *Entry) error {
92 | hook.Fired = true
93 | return nil
94 | }
95 |
96 | func (hook *ErrorHook) Levels() []Level {
97 | return []Level{
98 | ErrorLevel,
99 | }
100 | }
101 |
102 | func TestErrorHookShouldntFireOnInfo(t *testing.T) {
103 | hook := new(ErrorHook)
104 |
105 | LogAndAssertJSON(t, func(log *Logger) {
106 | log.Hooks.Add(hook)
107 | log.Info("test")
108 | }, func(fields Fields) {
109 | assert.Equal(t, hook.Fired, false)
110 | })
111 | }
112 |
113 | func TestErrorHookShouldFireOnError(t *testing.T) {
114 | hook := new(ErrorHook)
115 |
116 | LogAndAssertJSON(t, func(log *Logger) {
117 | log.Hooks.Add(hook)
118 | log.Error("test")
119 | }, func(fields Fields) {
120 | assert.Equal(t, hook.Fired, true)
121 | })
122 | }
123 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/hooks.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | // A hook to be fired when logging on the logging levels returned from
4 | // `Levels()` on your implementation of the interface. Note that this is not
5 | // fired in a goroutine or a channel with workers, you should handle such
6 | // functionality yourself if your call is non-blocking and you don't wish for
7 | // the logging calls for levels returned from `Levels()` to block.
8 | type Hook interface {
9 | Levels() []Level
10 | Fire(*Entry) error
11 | }
12 |
13 | // Internal type for storing the hooks on a logger instance.
14 | type LevelHooks map[Level][]Hook
15 |
16 | // Add a hook to an instance of logger. This is called with
17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface.
18 | func (hooks LevelHooks) Add(hook Hook) {
19 | for _, level := range hook.Levels() {
20 | hooks[level] = append(hooks[level], hook)
21 | }
22 | }
23 |
24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire
25 | // appropriate hooks for a log entry.
26 | func (hooks LevelHooks) Fire(level Level, entry *Entry) error {
27 | for _, hook := range hooks[level] {
28 | if err := hook.Fire(entry); err != nil {
29 | return err
30 | }
31 | }
32 |
33 | return nil
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/json_formatter.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | import (
4 | "encoding/json"
5 | "fmt"
6 | )
7 |
8 | type JSONFormatter struct {
9 | // TimestampFormat sets the format used for marshaling timestamps.
10 | TimestampFormat string
11 | }
12 |
13 | func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) {
14 | data := make(Fields, len(entry.Data)+3)
15 | for k, v := range entry.Data {
16 | switch v := v.(type) {
17 | case error:
18 | // Otherwise errors are ignored by `encoding/json`
19 | // https://github.com/Sirupsen/logrus/issues/137
20 | data[k] = v.Error()
21 | default:
22 | data[k] = v
23 | }
24 | }
25 | prefixFieldClashes(data)
26 |
27 | timestampFormat := f.TimestampFormat
28 | if timestampFormat == "" {
29 | timestampFormat = DefaultTimestampFormat
30 | }
31 |
32 | data["time"] = entry.Time.Format(timestampFormat)
33 | data["msg"] = entry.Message
34 | data["level"] = entry.Level.String()
35 |
36 | serialized, err := json.Marshal(data)
37 | if err != nil {
38 | return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err)
39 | }
40 | return append(serialized, '\n'), nil
41 | }
42 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/terminal_bsd.go:
--------------------------------------------------------------------------------
1 | // +build darwin freebsd openbsd netbsd dragonfly
2 |
3 | package logrus
4 |
5 | import "syscall"
6 |
7 | const ioctlReadTermios = syscall.TIOCGETA
8 |
9 | type Termios syscall.Termios
10 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/terminal_linux.go:
--------------------------------------------------------------------------------
1 | // Based on ssh/terminal:
2 | // Copyright 2013 The Go Authors. All rights reserved.
3 | // Use of this source code is governed by a BSD-style
4 | // license that can be found in the LICENSE file.
5 |
6 | package logrus
7 |
8 | import "syscall"
9 |
10 | const ioctlReadTermios = syscall.TCGETS
11 |
12 | type Termios syscall.Termios
13 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go:
--------------------------------------------------------------------------------
1 | // Based on ssh/terminal:
2 | // Copyright 2011 The Go Authors. All rights reserved.
3 | // Use of this source code is governed by a BSD-style
4 | // license that can be found in the LICENSE file.
5 |
6 | // +build linux darwin freebsd openbsd netbsd dragonfly
7 |
8 | package logrus
9 |
10 | import (
11 | "syscall"
12 | "unsafe"
13 | )
14 |
15 | // IsTerminal returns true if stderr's file descriptor is a terminal.
16 | func IsTerminal() bool {
17 | fd := syscall.Stderr
18 | var termios Termios
19 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
20 | return err == 0
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/terminal_solaris.go:
--------------------------------------------------------------------------------
1 | // +build solaris
2 |
3 | package logrus
4 |
5 | import (
6 | "os"
7 |
8 | "golang.org/x/sys/unix"
9 | )
10 |
11 | // IsTerminal returns true if the given file descriptor is a terminal.
12 | func IsTerminal() bool {
13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA)
14 | return err == nil
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/terminal_windows.go:
--------------------------------------------------------------------------------
1 | // Based on ssh/terminal:
2 | // Copyright 2011 The Go Authors. All rights reserved.
3 | // Use of this source code is governed by a BSD-style
4 | // license that can be found in the LICENSE file.
5 |
6 | // +build windows
7 |
8 | package logrus
9 |
10 | import (
11 | "syscall"
12 | "unsafe"
13 | )
14 |
15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll")
16 |
17 | var (
18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode")
19 | )
20 |
21 | // IsTerminal returns true if stderr's file descriptor is a terminal.
22 | func IsTerminal() bool {
23 | fd := syscall.Stderr
24 | var st uint32
25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)
26 | return r != 0 && e == 0
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/text_formatter_test.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | import (
4 | "bytes"
5 | "errors"
6 | "testing"
7 | "time"
8 | )
9 |
10 | func TestQuoting(t *testing.T) {
11 | tf := &TextFormatter{DisableColors: true}
12 |
13 | checkQuoting := func(q bool, value interface{}) {
14 | b, _ := tf.Format(WithField("test", value))
15 | idx := bytes.Index(b, ([]byte)("test="))
16 | cont := bytes.Contains(b[idx+5:], []byte{'"'})
17 | if cont != q {
18 | if q {
19 | t.Errorf("quoting expected for: %#v", value)
20 | } else {
21 | t.Errorf("quoting not expected for: %#v", value)
22 | }
23 | }
24 | }
25 |
26 | checkQuoting(false, "abcd")
27 | checkQuoting(false, "v1.0")
28 | checkQuoting(false, "1234567890")
29 | checkQuoting(true, "/foobar")
30 | checkQuoting(true, "x y")
31 | checkQuoting(true, "x,y")
32 | checkQuoting(false, errors.New("invalid"))
33 | checkQuoting(true, errors.New("invalid argument"))
34 | }
35 |
36 | func TestTimestampFormat(t *testing.T) {
37 | checkTimeStr := func(format string) {
38 | customFormatter := &TextFormatter{DisableColors: true, TimestampFormat: format}
39 | customStr, _ := customFormatter.Format(WithField("test", "test"))
40 | timeStart := bytes.Index(customStr, ([]byte)("time="))
41 | timeEnd := bytes.Index(customStr, ([]byte)("level="))
42 | timeStr := customStr[timeStart+5 : timeEnd-1]
43 | if timeStr[0] == '"' && timeStr[len(timeStr)-1] == '"' {
44 | timeStr = timeStr[1 : len(timeStr)-1]
45 | }
46 | if format == "" {
47 | format = time.RFC3339
48 | }
49 | _, e := time.Parse(format, (string)(timeStr))
50 | if e != nil {
51 | t.Errorf("time string \"%s\" did not match provided time format \"%s\": %s", timeStr, format, e)
52 | }
53 | }
54 |
55 | checkTimeStr("2006-01-02T15:04:05.000000000Z07:00")
56 | checkTimeStr("Mon Jan _2 15:04:05 2006")
57 | checkTimeStr("")
58 | }
59 |
60 | // TODO add tests for sorting etc., this requires a parser for the text
61 | // formatter output.
62 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/writer.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | import (
4 | "bufio"
5 | "io"
6 | "runtime"
7 | )
8 |
9 | func (logger *Logger) Writer() *io.PipeWriter {
10 | reader, writer := io.Pipe()
11 |
12 | go logger.writerScanner(reader)
13 | runtime.SetFinalizer(writer, writerFinalizer)
14 |
15 | return writer
16 | }
17 |
18 | func (logger *Logger) writerScanner(reader *io.PipeReader) {
19 | scanner := bufio.NewScanner(reader)
20 | for scanner.Scan() {
21 | logger.Print(scanner.Text())
22 | }
23 | if err := scanner.Err(); err != nil {
24 | logger.Errorf("Error while reading from Writer: %s", err)
25 | }
26 | reader.Close()
27 | }
28 |
29 | func writerFinalizer(writer *io.PipeWriter) {
30 | writer.Close()
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/context/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | sudo: false
3 |
4 | matrix:
5 | include:
6 | - go: 1.3
7 | - go: 1.4
8 | - go: 1.5
9 | - go: 1.6
10 | - go: tip
11 | allow_failures:
12 | - go: tip
13 |
14 | script:
15 | - go get -t -v ./...
16 | - diff -u <(echo -n) <(gofmt -d .)
17 | - go vet $(go list ./... | grep -v /vendor/)
18 | - go test -v -race ./...
19 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/context/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012 Rodrigo Moraes. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/context/README.md:
--------------------------------------------------------------------------------
1 | context
2 | =======
3 | [](https://travis-ci.org/gorilla/context)
4 |
5 | gorilla/context is a general purpose registry for global request variables.
6 |
7 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/context
8 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/context/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Gorilla Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | /*
6 | Package context stores values shared during a request lifetime.
7 |
8 | For example, a router can set variables extracted from the URL and later
9 | application handlers can access those values, or it can be used to store
10 | sessions values to be saved at the end of a request. There are several
11 | others common uses.
12 |
13 | The idea was posted by Brad Fitzpatrick to the go-nuts mailing list:
14 |
15 | http://groups.google.com/group/golang-nuts/msg/e2d679d303aa5d53
16 |
17 | Here's the basic usage: first define the keys that you will need. The key
18 | type is interface{} so a key can be of any type that supports equality.
19 | Here we define a key using a custom int type to avoid name collisions:
20 |
21 | package foo
22 |
23 | import (
24 | "github.com/gorilla/context"
25 | )
26 |
27 | type key int
28 |
29 | const MyKey key = 0
30 |
31 | Then set a variable. Variables are bound to an http.Request object, so you
32 | need a request instance to set a value:
33 |
34 | context.Set(r, MyKey, "bar")
35 |
36 | The application can later access the variable using the same key you provided:
37 |
38 | func MyHandler(w http.ResponseWriter, r *http.Request) {
39 | // val is "bar".
40 | val := context.Get(r, foo.MyKey)
41 |
42 | // returns ("bar", true)
43 | val, ok := context.GetOk(r, foo.MyKey)
44 | // ...
45 | }
46 |
47 | And that's all about the basic usage. We discuss some other ideas below.
48 |
49 | Any type can be stored in the context. To enforce a given type, make the key
50 | private and wrap Get() and Set() to accept and return values of a specific
51 | type:
52 |
53 | type key int
54 |
55 | const mykey key = 0
56 |
57 | // GetMyKey returns a value for this package from the request values.
58 | func GetMyKey(r *http.Request) SomeType {
59 | if rv := context.Get(r, mykey); rv != nil {
60 | return rv.(SomeType)
61 | }
62 | return nil
63 | }
64 |
65 | // SetMyKey sets a value for this package in the request values.
66 | func SetMyKey(r *http.Request, val SomeType) {
67 | context.Set(r, mykey, val)
68 | }
69 |
70 | Variables must be cleared at the end of a request, to remove all values
71 | that were stored. This can be done in an http.Handler, after a request was
72 | served. Just call Clear() passing the request:
73 |
74 | context.Clear(r)
75 |
76 | ...or use ClearHandler(), which conveniently wraps an http.Handler to clear
77 | variables at the end of a request lifetime.
78 |
79 | The Routers from the packages gorilla/mux and gorilla/pat call Clear()
80 | so if you are using either of them you don't need to clear the context manually.
81 | */
82 | package context
83 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/mux/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | sudo: false
3 |
4 | matrix:
5 | include:
6 | - go: 1.2
7 | - go: 1.3
8 | - go: 1.4
9 | - go: 1.5
10 | - go: 1.6
11 | - go: tip
12 |
13 | install:
14 | - go get golang.org/x/tools/cmd/vet
15 |
16 | script:
17 | - go get -t -v ./...
18 | - diff -u <(echo -n) <(gofmt -d .)
19 | - go tool vet .
20 | - go test -v -race ./...
21 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/mux/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012 Rodrigo Moraes. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/mux/bench_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Gorilla Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package mux
6 |
7 | import (
8 | "net/http"
9 | "net/http/httptest"
10 | "testing"
11 | )
12 |
13 | func BenchmarkMux(b *testing.B) {
14 | router := new(Router)
15 | handler := func(w http.ResponseWriter, r *http.Request) {}
16 | router.HandleFunc("/v1/{v1}", handler)
17 |
18 | request, _ := http.NewRequest("GET", "/v1/anything", nil)
19 | for i := 0; i < b.N; i++ {
20 | router.ServeHTTP(nil, request)
21 | }
22 | }
23 |
24 | func BenchmarkMuxAlternativeInRegexp(b *testing.B) {
25 | router := new(Router)
26 | handler := func(w http.ResponseWriter, r *http.Request) {}
27 | router.HandleFunc("/v1/{v1:(a|b)}", handler)
28 |
29 | requestA, _ := http.NewRequest("GET", "/v1/a", nil)
30 | requestB, _ := http.NewRequest("GET", "/v1/b", nil)
31 | for i := 0; i < b.N; i++ {
32 | router.ServeHTTP(nil, requestA)
33 | router.ServeHTTP(nil, requestB)
34 | }
35 | }
36 |
37 | func BenchmarkManyPathVariables(b *testing.B) {
38 | router := new(Router)
39 | handler := func(w http.ResponseWriter, r *http.Request) {}
40 | router.HandleFunc("/v1/{v1}/{v2}/{v3}/{v4}/{v5}", handler)
41 |
42 | matchingRequest, _ := http.NewRequest("GET", "/v1/1/2/3/4/5", nil)
43 | notMatchingRequest, _ := http.NewRequest("GET", "/v1/1/2/3/4", nil)
44 | recorder := httptest.NewRecorder()
45 | for i := 0; i < b.N; i++ {
46 | router.ServeHTTP(nil, matchingRequest)
47 | router.ServeHTTP(recorder, notMatchingRequest)
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
2 | *.o
3 | *.a
4 | *.so
5 |
6 | # Folders
7 | _obj
8 | _test
9 |
10 | # Architecture specific extensions/prefixes
11 | *.[568vq]
12 | [568vq].out
13 |
14 | *.cgo1.go
15 | *.cgo2.c
16 | _cgo_defun.c
17 | _cgo_gotypes.go
18 | _cgo_export.*
19 |
20 | _testmain.go
21 |
22 | *.exe
23 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | sudo: false
3 |
4 | matrix:
5 | include:
6 | - go: 1.4
7 | - go: 1.5
8 | - go: 1.6
9 | - go: tip
10 | allow_failures:
11 | - go: tip
12 |
13 | script:
14 | - go get -t -v ./...
15 | - diff -u <(echo -n) <(gofmt -d .)
16 | - go vet $(go list ./... | grep -v /vendor/)
17 | - go test -v -race ./...
18 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/AUTHORS:
--------------------------------------------------------------------------------
1 | # This is the official list of Gorilla WebSocket authors for copyright
2 | # purposes.
3 | #
4 | # Please keep the list sorted.
5 |
6 | Gary Burd
7 | Joachim Bauch
8 |
9 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are met:
5 |
6 | Redistributions of source code must retain the above copyright notice, this
7 | list of conditions and the following disclaimer.
8 |
9 | Redistributions in binary form must reproduce the above copyright notice,
10 | this list of conditions and the following disclaimer in the documentation
11 | and/or other materials provided with the distribution.
12 |
13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/bench_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package websocket
6 |
7 | import (
8 | "testing"
9 | )
10 |
11 | func BenchmarkMaskBytes(b *testing.B) {
12 | var key [4]byte
13 | data := make([]byte, 1024)
14 | pos := 0
15 | for i := 0; i < b.N; i++ {
16 | pos = maskBytes(key, pos, data)
17 | }
18 | b.SetBytes(int64(len(data)))
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/client_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package websocket
6 |
7 | import (
8 | "net/url"
9 | "reflect"
10 | "testing"
11 | )
12 |
13 | var parseURLTests = []struct {
14 | s string
15 | u *url.URL
16 | rui string
17 | }{
18 | {"ws://example.com/", &url.URL{Scheme: "ws", Host: "example.com", Opaque: "/"}, "/"},
19 | {"ws://example.com", &url.URL{Scheme: "ws", Host: "example.com", Opaque: "/"}, "/"},
20 | {"ws://example.com:7777/", &url.URL{Scheme: "ws", Host: "example.com:7777", Opaque: "/"}, "/"},
21 | {"wss://example.com/", &url.URL{Scheme: "wss", Host: "example.com", Opaque: "/"}, "/"},
22 | {"wss://example.com/a/b", &url.URL{Scheme: "wss", Host: "example.com", Opaque: "/a/b"}, "/a/b"},
23 | {"ss://example.com/a/b", nil, ""},
24 | {"ws://webmaster@example.com/", nil, ""},
25 | {"wss://example.com/a/b?x=y", &url.URL{Scheme: "wss", Host: "example.com", Opaque: "/a/b", RawQuery: "x=y"}, "/a/b?x=y"},
26 | {"wss://example.com?x=y", &url.URL{Scheme: "wss", Host: "example.com", Opaque: "/", RawQuery: "x=y"}, "/?x=y"},
27 | }
28 |
29 | func TestParseURL(t *testing.T) {
30 | for _, tt := range parseURLTests {
31 | u, err := parseURL(tt.s)
32 | if tt.u != nil && err != nil {
33 | t.Errorf("parseURL(%q) returned error %v", tt.s, err)
34 | continue
35 | }
36 | if tt.u == nil {
37 | if err == nil {
38 | t.Errorf("parseURL(%q) did not return error", tt.s)
39 | }
40 | continue
41 | }
42 | if !reflect.DeepEqual(u, tt.u) {
43 | t.Errorf("parseURL(%q) = %v, want %v", tt.s, u, tt.u)
44 | continue
45 | }
46 | if u.RequestURI() != tt.rui {
47 | t.Errorf("parseURL(%q).RequestURI() = %v, want %v", tt.s, u.RequestURI(), tt.rui)
48 | }
49 | }
50 | }
51 |
52 | var hostPortNoPortTests = []struct {
53 | u *url.URL
54 | hostPort, hostNoPort string
55 | }{
56 | {&url.URL{Scheme: "ws", Host: "example.com"}, "example.com:80", "example.com"},
57 | {&url.URL{Scheme: "wss", Host: "example.com"}, "example.com:443", "example.com"},
58 | {&url.URL{Scheme: "ws", Host: "example.com:7777"}, "example.com:7777", "example.com"},
59 | {&url.URL{Scheme: "wss", Host: "example.com:7777"}, "example.com:7777", "example.com"},
60 | }
61 |
62 | func TestHostPortNoPort(t *testing.T) {
63 | for _, tt := range hostPortNoPortTests {
64 | hostPort, hostNoPort := hostPortNoPort(tt.u)
65 | if hostPort != tt.hostPort {
66 | t.Errorf("hostPortNoPort(%v) returned hostPort %q, want %q", tt.u, hostPort, tt.hostPort)
67 | }
68 | if hostNoPort != tt.hostNoPort {
69 | t.Errorf("hostPortNoPort(%v) returned hostNoPort %q, want %q", tt.u, hostNoPort, tt.hostNoPort)
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/example_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package websocket_test
6 |
7 | import (
8 | "log"
9 | "net/http"
10 | "testing"
11 |
12 | "github.com/gorilla/websocket"
13 | )
14 |
15 | var (
16 | c *websocket.Conn
17 | req *http.Request
18 | )
19 |
20 | // The websocket.IsUnexpectedCloseError function is useful for identifying
21 | // application and protocol errors.
22 | //
23 | // This server application works with a client application running in the
24 | // browser. The client application does not explicitly close the websocket. The
25 | // only expected close message from the client has the code
26 | // websocket.CloseGoingAway. All other other close messages are likely the
27 | // result of an application or protocol error and are logged to aid debugging.
28 | func ExampleIsUnexpectedCloseError() {
29 |
30 | for {
31 | messageType, p, err := c.ReadMessage()
32 | if err != nil {
33 | if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway) {
34 | log.Printf("error: %v, user-agent: %v", err, req.Header.Get("User-Agent"))
35 | }
36 | return
37 | }
38 | processMesage(messageType, p)
39 | }
40 | }
41 |
42 | func processMesage(mt int, p []byte) {}
43 |
44 | // TestX prevents godoc from showing this entire file in the example. Remove
45 | // this function when a second example is added.
46 | func TestX(t *testing.T) {}
47 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/json.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package websocket
6 |
7 | import (
8 | "encoding/json"
9 | "io"
10 | )
11 |
12 | // WriteJSON is deprecated, use c.WriteJSON instead.
13 | func WriteJSON(c *Conn, v interface{}) error {
14 | return c.WriteJSON(v)
15 | }
16 |
17 | // WriteJSON writes the JSON encoding of v to the connection.
18 | //
19 | // See the documentation for encoding/json Marshal for details about the
20 | // conversion of Go values to JSON.
21 | func (c *Conn) WriteJSON(v interface{}) error {
22 | w, err := c.NextWriter(TextMessage)
23 | if err != nil {
24 | return err
25 | }
26 | err1 := json.NewEncoder(w).Encode(v)
27 | err2 := w.Close()
28 | if err1 != nil {
29 | return err1
30 | }
31 | return err2
32 | }
33 |
34 | // ReadJSON is deprecated, use c.ReadJSON instead.
35 | func ReadJSON(c *Conn, v interface{}) error {
36 | return c.ReadJSON(v)
37 | }
38 |
39 | // ReadJSON reads the next JSON-encoded message from the connection and stores
40 | // it in the value pointed to by v.
41 | //
42 | // See the documentation for the encoding/json Unmarshal function for details
43 | // about the conversion of JSON to a Go value.
44 | func (c *Conn) ReadJSON(v interface{}) error {
45 | _, r, err := c.NextReader()
46 | if err != nil {
47 | return err
48 | }
49 | err = json.NewDecoder(r).Decode(v)
50 | if err == io.EOF {
51 | // One value is expected in the message.
52 | err = io.ErrUnexpectedEOF
53 | }
54 | return err
55 | }
56 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/server_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package websocket
6 |
7 | import (
8 | "net/http"
9 | "reflect"
10 | "testing"
11 | )
12 |
13 | var subprotocolTests = []struct {
14 | h string
15 | protocols []string
16 | }{
17 | {"", nil},
18 | {"foo", []string{"foo"}},
19 | {"foo,bar", []string{"foo", "bar"}},
20 | {"foo, bar", []string{"foo", "bar"}},
21 | {" foo, bar", []string{"foo", "bar"}},
22 | {" foo, bar ", []string{"foo", "bar"}},
23 | }
24 |
25 | func TestSubprotocols(t *testing.T) {
26 | for _, st := range subprotocolTests {
27 | r := http.Request{Header: http.Header{"Sec-Websocket-Protocol": {st.h}}}
28 | protocols := Subprotocols(&r)
29 | if !reflect.DeepEqual(st.protocols, protocols) {
30 | t.Errorf("SubProtocols(%q) returned %#v, want %#v", st.h, protocols, st.protocols)
31 | }
32 | }
33 | }
34 |
35 | var isWebSocketUpgradeTests = []struct {
36 | ok bool
37 | h http.Header
38 | }{
39 | {false, http.Header{"Upgrade": {"websocket"}}},
40 | {false, http.Header{"Connection": {"upgrade"}}},
41 | {true, http.Header{"Connection": {"upgRade"}, "Upgrade": {"WebSocket"}}},
42 | }
43 |
44 | func TestIsWebSocketUpgrade(t *testing.T) {
45 | for _, tt := range isWebSocketUpgradeTests {
46 | ok := IsWebSocketUpgrade(&http.Request{Header: tt.h})
47 | if tt.ok != ok {
48 | t.Errorf("IsWebSocketUpgrade(%v) returned %v, want %v", tt.h, ok, tt.ok)
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/util.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package websocket
6 |
7 | import (
8 | "crypto/rand"
9 | "crypto/sha1"
10 | "encoding/base64"
11 | "io"
12 | "net/http"
13 | "strings"
14 | )
15 |
16 | // tokenListContainsValue returns true if the 1#token header with the given
17 | // name contains token.
18 | func tokenListContainsValue(header http.Header, name string, value string) bool {
19 | for _, v := range header[name] {
20 | for _, s := range strings.Split(v, ",") {
21 | if strings.EqualFold(value, strings.TrimSpace(s)) {
22 | return true
23 | }
24 | }
25 | }
26 | return false
27 | }
28 |
29 | var keyGUID = []byte("258EAFA5-E914-47DA-95CA-C5AB0DC85B11")
30 |
31 | func computeAcceptKey(challengeKey string) string {
32 | h := sha1.New()
33 | h.Write([]byte(challengeKey))
34 | h.Write(keyGUID)
35 | return base64.StdEncoding.EncodeToString(h.Sum(nil))
36 | }
37 |
38 | func generateChallengeKey() (string, error) {
39 | p := make([]byte, 16)
40 | if _, err := io.ReadFull(rand.Reader, p); err != nil {
41 | return "", err
42 | }
43 | return base64.StdEncoding.EncodeToString(p), nil
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/util_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package websocket
6 |
7 | import (
8 | "net/http"
9 | "testing"
10 | )
11 |
12 | var tokenListContainsValueTests = []struct {
13 | value string
14 | ok bool
15 | }{
16 | {"WebSocket", true},
17 | {"WEBSOCKET", true},
18 | {"websocket", true},
19 | {"websockets", false},
20 | {"x websocket", false},
21 | {"websocket x", false},
22 | {"other,websocket,more", true},
23 | {"other, websocket, more", true},
24 | }
25 |
26 | func TestTokenListContainsValue(t *testing.T) {
27 | for _, tt := range tokenListContainsValueTests {
28 | h := http.Header{"Upgrade": {tt.value}}
29 | ok := tokenListContainsValue(h, "Upgrade", "websocket")
30 | if ok != tt.ok {
31 | t.Errorf("tokenListContainsValue(h, n, %q) = %v, want %v", tt.value, ok, tt.ok)
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/.drone.yml:
--------------------------------------------------------------------------------
1 | image: rancher/dind:v0.3.0
2 | script:
3 | - ./scripts/ci
4 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/.gitignore:
--------------------------------------------------------------------------------
1 | *.swp
2 |
3 | /build
4 | /bin
5 | /gopath
6 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/.package:
--------------------------------------------------------------------------------
1 | github.com/rancher/go-rancher
2 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/.wrap-docker-args:
--------------------------------------------------------------------------------
1 | --privileged
2 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rancher/dind:v0.3.0
2 | COPY ./scripts/bootstrap /scripts/bootstrap
3 | RUN /scripts/bootstrap
4 | WORKDIR /source
5 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/README.md:
--------------------------------------------------------------------------------
1 | # Go Bindings for Rancher API
2 |
3 | # Building
4 |
5 | ```sh
6 | godep go build ./client
7 | ```
8 |
9 | # Tests
10 |
11 | ```sh
12 | godep go test ./client
13 | ```
14 | # Contact
15 | For bugs, questions, comments, corrections, suggestions, etc., open an issue in
16 | [rancher/rancher](//github.com/rancher/rancher/issues) with a title starting with `[go-rancher] `.
17 |
18 | Or just [click here](//github.com/rancher/rancher/issues/new?title=%5Bgo-rancher%5D%20) to create a new issue.
19 |
20 |
21 | # License
22 | Copyright (c) 2014-2015 [Rancher Labs, Inc.](http://rancher.com)
23 |
24 | Licensed under the Apache License, Version 2.0 (the "License");
25 | you may not use this file except in compliance with the License.
26 | You may obtain a copy of the License at
27 |
28 | [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
29 |
30 | Unless required by applicable law or agreed to in writing, software
31 | distributed under the License is distributed on an "AS IS" BASIS,
32 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33 | See the License for the specific language governing permissions and
34 | limitations under the License.
35 |
36 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/client.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | type RancherBaseClient struct {
4 | Opts *ClientOpts
5 | Schemas *Schemas
6 | Types map[string]Schema
7 | }
8 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_active_setting.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | ACTIVE_SETTING_TYPE = "activeSetting"
5 | )
6 |
7 | type ActiveSetting struct {
8 | Resource
9 |
10 | ActiveValue interface{} `json:"activeValue,omitempty" yaml:"active_value,omitempty"`
11 |
12 | InDb bool `json:"inDb,omitempty" yaml:"in_db,omitempty"`
13 |
14 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
15 |
16 | Source string `json:"source,omitempty" yaml:"source,omitempty"`
17 |
18 | Value string `json:"value,omitempty" yaml:"value,omitempty"`
19 | }
20 |
21 | type ActiveSettingCollection struct {
22 | Collection
23 | Data []ActiveSetting `json:"data,omitempty"`
24 | }
25 |
26 | type ActiveSettingClient struct {
27 | rancherClient *RancherClient
28 | }
29 |
30 | type ActiveSettingOperations interface {
31 | List(opts *ListOpts) (*ActiveSettingCollection, error)
32 | Create(opts *ActiveSetting) (*ActiveSetting, error)
33 | Update(existing *ActiveSetting, updates interface{}) (*ActiveSetting, error)
34 | ById(id string) (*ActiveSetting, error)
35 | Delete(container *ActiveSetting) error
36 | }
37 |
38 | func newActiveSettingClient(rancherClient *RancherClient) *ActiveSettingClient {
39 | return &ActiveSettingClient{
40 | rancherClient: rancherClient,
41 | }
42 | }
43 |
44 | func (c *ActiveSettingClient) Create(container *ActiveSetting) (*ActiveSetting, error) {
45 | resp := &ActiveSetting{}
46 | err := c.rancherClient.doCreate(ACTIVE_SETTING_TYPE, container, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *ActiveSettingClient) Update(existing *ActiveSetting, updates interface{}) (*ActiveSetting, error) {
51 | resp := &ActiveSetting{}
52 | err := c.rancherClient.doUpdate(ACTIVE_SETTING_TYPE, &existing.Resource, updates, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *ActiveSettingClient) List(opts *ListOpts) (*ActiveSettingCollection, error) {
57 | resp := &ActiveSettingCollection{}
58 | err := c.rancherClient.doList(ACTIVE_SETTING_TYPE, opts, resp)
59 | return resp, err
60 | }
61 |
62 | func (c *ActiveSettingClient) ById(id string) (*ActiveSetting, error) {
63 | resp := &ActiveSetting{}
64 | err := c.rancherClient.doById(ACTIVE_SETTING_TYPE, id, resp)
65 | if apiError, ok := err.(*ApiError); ok {
66 | if apiError.StatusCode == 404 {
67 | return nil, nil
68 | }
69 | }
70 | return resp, err
71 | }
72 |
73 | func (c *ActiveSettingClient) Delete(container *ActiveSetting) error {
74 | return c.rancherClient.doResourceDelete(ACTIVE_SETTING_TYPE, &container.Resource)
75 | }
76 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_add_label_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | ADD_LABEL_INPUT_TYPE = "addLabelInput"
5 | )
6 |
7 | type AddLabelInput struct {
8 | Resource
9 |
10 | Key string `json:"key,omitempty"`
11 |
12 | Value string `json:"value,omitempty"`
13 | }
14 |
15 | type AddLabelInputCollection struct {
16 | Collection
17 | Data []AddLabelInput `json:"data,omitempty"`
18 | }
19 |
20 | type AddLabelInputClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type AddLabelInputOperations interface {
25 | List(opts *ListOpts) (*AddLabelInputCollection, error)
26 | Create(opts *AddLabelInput) (*AddLabelInput, error)
27 | Update(existing *AddLabelInput, updates interface{}) (*AddLabelInput, error)
28 | ById(id string) (*AddLabelInput, error)
29 | Delete(container *AddLabelInput) error
30 | }
31 |
32 | func newAddLabelInputClient(rancherClient *RancherClient) *AddLabelInputClient {
33 | return &AddLabelInputClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *AddLabelInputClient) Create(container *AddLabelInput) (*AddLabelInput, error) {
39 | resp := &AddLabelInput{}
40 | err := c.rancherClient.doCreate(ADD_LABEL_INPUT_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *AddLabelInputClient) Update(existing *AddLabelInput, updates interface{}) (*AddLabelInput, error) {
45 | resp := &AddLabelInput{}
46 | err := c.rancherClient.doUpdate(ADD_LABEL_INPUT_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *AddLabelInputClient) List(opts *ListOpts) (*AddLabelInputCollection, error) {
51 | resp := &AddLabelInputCollection{}
52 | err := c.rancherClient.doList(ADD_LABEL_INPUT_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *AddLabelInputClient) ById(id string) (*AddLabelInput, error) {
57 | resp := &AddLabelInput{}
58 | err := c.rancherClient.doById(ADD_LABEL_INPUT_TYPE, id, resp)
59 | return resp, err
60 | }
61 |
62 | func (c *AddLabelInputClient) Delete(container *AddLabelInput) error {
63 | return c.rancherClient.doResourceDelete(ADD_LABEL_INPUT_TYPE, &container.Resource)
64 | }
65 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_add_load_balancer_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | ADD_LOAD_BALANCER_INPUT_TYPE = "addLoadBalancerInput"
5 | )
6 |
7 | type AddLoadBalancerInput struct {
8 | Resource
9 |
10 | LoadBalancerId string `json:"loadBalancerId,omitempty" yaml:"load_balancer_id,omitempty"`
11 |
12 | Weight int64 `json:"weight,omitempty" yaml:"weight,omitempty"`
13 | }
14 |
15 | type AddLoadBalancerInputCollection struct {
16 | Collection
17 | Data []AddLoadBalancerInput `json:"data,omitempty"`
18 | }
19 |
20 | type AddLoadBalancerInputClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type AddLoadBalancerInputOperations interface {
25 | List(opts *ListOpts) (*AddLoadBalancerInputCollection, error)
26 | Create(opts *AddLoadBalancerInput) (*AddLoadBalancerInput, error)
27 | Update(existing *AddLoadBalancerInput, updates interface{}) (*AddLoadBalancerInput, error)
28 | ById(id string) (*AddLoadBalancerInput, error)
29 | Delete(container *AddLoadBalancerInput) error
30 | }
31 |
32 | func newAddLoadBalancerInputClient(rancherClient *RancherClient) *AddLoadBalancerInputClient {
33 | return &AddLoadBalancerInputClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *AddLoadBalancerInputClient) Create(container *AddLoadBalancerInput) (*AddLoadBalancerInput, error) {
39 | resp := &AddLoadBalancerInput{}
40 | err := c.rancherClient.doCreate(ADD_LOAD_BALANCER_INPUT_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *AddLoadBalancerInputClient) Update(existing *AddLoadBalancerInput, updates interface{}) (*AddLoadBalancerInput, error) {
45 | resp := &AddLoadBalancerInput{}
46 | err := c.rancherClient.doUpdate(ADD_LOAD_BALANCER_INPUT_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *AddLoadBalancerInputClient) List(opts *ListOpts) (*AddLoadBalancerInputCollection, error) {
51 | resp := &AddLoadBalancerInputCollection{}
52 | err := c.rancherClient.doList(ADD_LOAD_BALANCER_INPUT_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *AddLoadBalancerInputClient) ById(id string) (*AddLoadBalancerInput, error) {
57 | resp := &AddLoadBalancerInput{}
58 | err := c.rancherClient.doById(ADD_LOAD_BALANCER_INPUT_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *AddLoadBalancerInputClient) Delete(container *AddLoadBalancerInput) error {
68 | return c.rancherClient.doResourceDelete(ADD_LOAD_BALANCER_INPUT_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_add_outputs_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | ADD_OUTPUTS_INPUT_TYPE = "addOutputsInput"
5 | )
6 |
7 | type AddOutputsInput struct {
8 | Resource
9 |
10 | Outputs map[string]interface{} `json:"outputs,omitempty" yaml:"outputs,omitempty"`
11 | }
12 |
13 | type AddOutputsInputCollection struct {
14 | Collection
15 | Data []AddOutputsInput `json:"data,omitempty"`
16 | }
17 |
18 | type AddOutputsInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type AddOutputsInputOperations interface {
23 | List(opts *ListOpts) (*AddOutputsInputCollection, error)
24 | Create(opts *AddOutputsInput) (*AddOutputsInput, error)
25 | Update(existing *AddOutputsInput, updates interface{}) (*AddOutputsInput, error)
26 | ById(id string) (*AddOutputsInput, error)
27 | Delete(container *AddOutputsInput) error
28 | }
29 |
30 | func newAddOutputsInputClient(rancherClient *RancherClient) *AddOutputsInputClient {
31 | return &AddOutputsInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *AddOutputsInputClient) Create(container *AddOutputsInput) (*AddOutputsInput, error) {
37 | resp := &AddOutputsInput{}
38 | err := c.rancherClient.doCreate(ADD_OUTPUTS_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *AddOutputsInputClient) Update(existing *AddOutputsInput, updates interface{}) (*AddOutputsInput, error) {
43 | resp := &AddOutputsInput{}
44 | err := c.rancherClient.doUpdate(ADD_OUTPUTS_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *AddOutputsInputClient) List(opts *ListOpts) (*AddOutputsInputCollection, error) {
49 | resp := &AddOutputsInputCollection{}
50 | err := c.rancherClient.doList(ADD_OUTPUTS_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *AddOutputsInputClient) ById(id string) (*AddOutputsInput, error) {
55 | resp := &AddOutputsInput{}
56 | err := c.rancherClient.doById(ADD_OUTPUTS_INPUT_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *AddOutputsInputClient) Delete(container *AddOutputsInput) error {
66 | return c.rancherClient.doResourceDelete(ADD_OUTPUTS_INPUT_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_add_remove_cluster_host_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE = "addRemoveClusterHostInput"
5 | )
6 |
7 | type AddRemoveClusterHostInput struct {
8 | Resource
9 |
10 | HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"`
11 | }
12 |
13 | type AddRemoveClusterHostInputCollection struct {
14 | Collection
15 | Data []AddRemoveClusterHostInput `json:"data,omitempty"`
16 | }
17 |
18 | type AddRemoveClusterHostInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type AddRemoveClusterHostInputOperations interface {
23 | List(opts *ListOpts) (*AddRemoveClusterHostInputCollection, error)
24 | Create(opts *AddRemoveClusterHostInput) (*AddRemoveClusterHostInput, error)
25 | Update(existing *AddRemoveClusterHostInput, updates interface{}) (*AddRemoveClusterHostInput, error)
26 | ById(id string) (*AddRemoveClusterHostInput, error)
27 | Delete(container *AddRemoveClusterHostInput) error
28 | }
29 |
30 | func newAddRemoveClusterHostInputClient(rancherClient *RancherClient) *AddRemoveClusterHostInputClient {
31 | return &AddRemoveClusterHostInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *AddRemoveClusterHostInputClient) Create(container *AddRemoveClusterHostInput) (*AddRemoveClusterHostInput, error) {
37 | resp := &AddRemoveClusterHostInput{}
38 | err := c.rancherClient.doCreate(ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *AddRemoveClusterHostInputClient) Update(existing *AddRemoveClusterHostInput, updates interface{}) (*AddRemoveClusterHostInput, error) {
43 | resp := &AddRemoveClusterHostInput{}
44 | err := c.rancherClient.doUpdate(ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *AddRemoveClusterHostInputClient) List(opts *ListOpts) (*AddRemoveClusterHostInputCollection, error) {
49 | resp := &AddRemoveClusterHostInputCollection{}
50 | err := c.rancherClient.doList(ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *AddRemoveClusterHostInputClient) ById(id string) (*AddRemoveClusterHostInput, error) {
55 | resp := &AddRemoveClusterHostInput{}
56 | err := c.rancherClient.doById(ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *AddRemoveClusterHostInputClient) Delete(container *AddRemoveClusterHostInput) error {
66 | return c.rancherClient.doResourceDelete(ADD_REMOVE_CLUSTER_HOST_INPUT_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_add_remove_service_link_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | ADD_REMOVE_SERVICE_LINK_INPUT_TYPE = "addRemoveServiceLinkInput"
5 | )
6 |
7 | type AddRemoveServiceLinkInput struct {
8 | Resource
9 |
10 | ServiceLink ServiceLink `json:"serviceLink,omitempty" yaml:"service_link,omitempty"`
11 | }
12 |
13 | type AddRemoveServiceLinkInputCollection struct {
14 | Collection
15 | Data []AddRemoveServiceLinkInput `json:"data,omitempty"`
16 | }
17 |
18 | type AddRemoveServiceLinkInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type AddRemoveServiceLinkInputOperations interface {
23 | List(opts *ListOpts) (*AddRemoveServiceLinkInputCollection, error)
24 | Create(opts *AddRemoveServiceLinkInput) (*AddRemoveServiceLinkInput, error)
25 | Update(existing *AddRemoveServiceLinkInput, updates interface{}) (*AddRemoveServiceLinkInput, error)
26 | ById(id string) (*AddRemoveServiceLinkInput, error)
27 | Delete(container *AddRemoveServiceLinkInput) error
28 | }
29 |
30 | func newAddRemoveServiceLinkInputClient(rancherClient *RancherClient) *AddRemoveServiceLinkInputClient {
31 | return &AddRemoveServiceLinkInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *AddRemoveServiceLinkInputClient) Create(container *AddRemoveServiceLinkInput) (*AddRemoveServiceLinkInput, error) {
37 | resp := &AddRemoveServiceLinkInput{}
38 | err := c.rancherClient.doCreate(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *AddRemoveServiceLinkInputClient) Update(existing *AddRemoveServiceLinkInput, updates interface{}) (*AddRemoveServiceLinkInput, error) {
43 | resp := &AddRemoveServiceLinkInput{}
44 | err := c.rancherClient.doUpdate(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *AddRemoveServiceLinkInputClient) List(opts *ListOpts) (*AddRemoveServiceLinkInputCollection, error) {
49 | resp := &AddRemoveServiceLinkInputCollection{}
50 | err := c.rancherClient.doList(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *AddRemoveServiceLinkInputClient) ById(id string) (*AddRemoveServiceLinkInput, error) {
55 | resp := &AddRemoveServiceLinkInput{}
56 | err := c.rancherClient.doById(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *AddRemoveServiceLinkInputClient) Delete(container *AddRemoveServiceLinkInput) error {
66 | return c.rancherClient.doResourceDelete(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_base_machine_config.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | BASE_MACHINE_CONFIG_TYPE = "baseMachineConfig"
5 | )
6 |
7 | type BaseMachineConfig struct {
8 | Resource
9 | }
10 |
11 | type BaseMachineConfigCollection struct {
12 | Collection
13 | Data []BaseMachineConfig `json:"data,omitempty"`
14 | }
15 |
16 | type BaseMachineConfigClient struct {
17 | rancherClient *RancherClient
18 | }
19 |
20 | type BaseMachineConfigOperations interface {
21 | List(opts *ListOpts) (*BaseMachineConfigCollection, error)
22 | Create(opts *BaseMachineConfig) (*BaseMachineConfig, error)
23 | Update(existing *BaseMachineConfig, updates interface{}) (*BaseMachineConfig, error)
24 | ById(id string) (*BaseMachineConfig, error)
25 | Delete(container *BaseMachineConfig) error
26 | }
27 |
28 | func newBaseMachineConfigClient(rancherClient *RancherClient) *BaseMachineConfigClient {
29 | return &BaseMachineConfigClient{
30 | rancherClient: rancherClient,
31 | }
32 | }
33 |
34 | func (c *BaseMachineConfigClient) Create(container *BaseMachineConfig) (*BaseMachineConfig, error) {
35 | resp := &BaseMachineConfig{}
36 | err := c.rancherClient.doCreate(BASE_MACHINE_CONFIG_TYPE, container, resp)
37 | return resp, err
38 | }
39 |
40 | func (c *BaseMachineConfigClient) Update(existing *BaseMachineConfig, updates interface{}) (*BaseMachineConfig, error) {
41 | resp := &BaseMachineConfig{}
42 | err := c.rancherClient.doUpdate(BASE_MACHINE_CONFIG_TYPE, &existing.Resource, updates, resp)
43 | return resp, err
44 | }
45 |
46 | func (c *BaseMachineConfigClient) List(opts *ListOpts) (*BaseMachineConfigCollection, error) {
47 | resp := &BaseMachineConfigCollection{}
48 | err := c.rancherClient.doList(BASE_MACHINE_CONFIG_TYPE, opts, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *BaseMachineConfigClient) ById(id string) (*BaseMachineConfig, error) {
53 | resp := &BaseMachineConfig{}
54 | err := c.rancherClient.doById(BASE_MACHINE_CONFIG_TYPE, id, resp)
55 | if apiError, ok := err.(*ApiError); ok {
56 | if apiError.StatusCode == 404 {
57 | return nil, nil
58 | }
59 | }
60 | return resp, err
61 | }
62 |
63 | func (c *BaseMachineConfigClient) Delete(container *BaseMachineConfig) error {
64 | return c.rancherClient.doResourceDelete(BASE_MACHINE_CONFIG_TYPE, &container.Resource)
65 | }
66 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_change_secret_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | CHANGE_SECRET_INPUT_TYPE = "changeSecretInput"
5 | )
6 |
7 | type ChangeSecretInput struct {
8 | Resource
9 |
10 | NewSecret string `json:"newSecret,omitempty" yaml:"new_secret,omitempty"`
11 |
12 | OldSecret string `json:"oldSecret,omitempty" yaml:"old_secret,omitempty"`
13 | }
14 |
15 | type ChangeSecretInputCollection struct {
16 | Collection
17 | Data []ChangeSecretInput `json:"data,omitempty"`
18 | }
19 |
20 | type ChangeSecretInputClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type ChangeSecretInputOperations interface {
25 | List(opts *ListOpts) (*ChangeSecretInputCollection, error)
26 | Create(opts *ChangeSecretInput) (*ChangeSecretInput, error)
27 | Update(existing *ChangeSecretInput, updates interface{}) (*ChangeSecretInput, error)
28 | ById(id string) (*ChangeSecretInput, error)
29 | Delete(container *ChangeSecretInput) error
30 | }
31 |
32 | func newChangeSecretInputClient(rancherClient *RancherClient) *ChangeSecretInputClient {
33 | return &ChangeSecretInputClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *ChangeSecretInputClient) Create(container *ChangeSecretInput) (*ChangeSecretInput, error) {
39 | resp := &ChangeSecretInput{}
40 | err := c.rancherClient.doCreate(CHANGE_SECRET_INPUT_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *ChangeSecretInputClient) Update(existing *ChangeSecretInput, updates interface{}) (*ChangeSecretInput, error) {
45 | resp := &ChangeSecretInput{}
46 | err := c.rancherClient.doUpdate(CHANGE_SECRET_INPUT_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *ChangeSecretInputClient) List(opts *ListOpts) (*ChangeSecretInputCollection, error) {
51 | resp := &ChangeSecretInputCollection{}
52 | err := c.rancherClient.doList(CHANGE_SECRET_INPUT_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *ChangeSecretInputClient) ById(id string) (*ChangeSecretInput, error) {
57 | resp := &ChangeSecretInput{}
58 | err := c.rancherClient.doById(CHANGE_SECRET_INPUT_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *ChangeSecretInputClient) Delete(container *ChangeSecretInput) error {
68 | return c.rancherClient.doResourceDelete(CHANGE_SECRET_INPUT_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_compose_config.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | COMPOSE_CONFIG_TYPE = "composeConfig"
5 | )
6 |
7 | type ComposeConfig struct {
8 | Resource
9 |
10 | DockerComposeConfig string `json:"dockerComposeConfig,omitempty" yaml:"docker_compose_config,omitempty"`
11 |
12 | RancherComposeConfig string `json:"rancherComposeConfig,omitempty" yaml:"rancher_compose_config,omitempty"`
13 | }
14 |
15 | type ComposeConfigCollection struct {
16 | Collection
17 | Data []ComposeConfig `json:"data,omitempty"`
18 | }
19 |
20 | type ComposeConfigClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type ComposeConfigOperations interface {
25 | List(opts *ListOpts) (*ComposeConfigCollection, error)
26 | Create(opts *ComposeConfig) (*ComposeConfig, error)
27 | Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error)
28 | ById(id string) (*ComposeConfig, error)
29 | Delete(container *ComposeConfig) error
30 | }
31 |
32 | func newComposeConfigClient(rancherClient *RancherClient) *ComposeConfigClient {
33 | return &ComposeConfigClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *ComposeConfigClient) Create(container *ComposeConfig) (*ComposeConfig, error) {
39 | resp := &ComposeConfig{}
40 | err := c.rancherClient.doCreate(COMPOSE_CONFIG_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *ComposeConfigClient) Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error) {
45 | resp := &ComposeConfig{}
46 | err := c.rancherClient.doUpdate(COMPOSE_CONFIG_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *ComposeConfigClient) List(opts *ListOpts) (*ComposeConfigCollection, error) {
51 | resp := &ComposeConfigCollection{}
52 | err := c.rancherClient.doList(COMPOSE_CONFIG_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *ComposeConfigClient) ById(id string) (*ComposeConfig, error) {
57 | resp := &ComposeConfig{}
58 | err := c.rancherClient.doById(COMPOSE_CONFIG_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *ComposeConfigClient) Delete(container *ComposeConfig) error {
68 | return c.rancherClient.doResourceDelete(COMPOSE_CONFIG_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_compose_config_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | COMPOSE_CONFIG_INPUT_TYPE = "composeConfigInput"
5 | )
6 |
7 | type ComposeConfigInput struct {
8 | Resource
9 |
10 | ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"`
11 | }
12 |
13 | type ComposeConfigInputCollection struct {
14 | Collection
15 | Data []ComposeConfigInput `json:"data,omitempty"`
16 | }
17 |
18 | type ComposeConfigInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type ComposeConfigInputOperations interface {
23 | List(opts *ListOpts) (*ComposeConfigInputCollection, error)
24 | Create(opts *ComposeConfigInput) (*ComposeConfigInput, error)
25 | Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error)
26 | ById(id string) (*ComposeConfigInput, error)
27 | Delete(container *ComposeConfigInput) error
28 | }
29 |
30 | func newComposeConfigInputClient(rancherClient *RancherClient) *ComposeConfigInputClient {
31 | return &ComposeConfigInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *ComposeConfigInputClient) Create(container *ComposeConfigInput) (*ComposeConfigInput, error) {
37 | resp := &ComposeConfigInput{}
38 | err := c.rancherClient.doCreate(COMPOSE_CONFIG_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *ComposeConfigInputClient) Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error) {
43 | resp := &ComposeConfigInput{}
44 | err := c.rancherClient.doUpdate(COMPOSE_CONFIG_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *ComposeConfigInputClient) List(opts *ListOpts) (*ComposeConfigInputCollection, error) {
49 | resp := &ComposeConfigInputCollection{}
50 | err := c.rancherClient.doList(COMPOSE_CONFIG_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *ComposeConfigInputClient) ById(id string) (*ComposeConfigInput, error) {
55 | resp := &ComposeConfigInput{}
56 | err := c.rancherClient.doById(COMPOSE_CONFIG_INPUT_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *ComposeConfigInputClient) Delete(container *ComposeConfigInput) error {
66 | return c.rancherClient.doResourceDelete(COMPOSE_CONFIG_INPUT_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_config_item.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | CONFIG_ITEM_TYPE = "configItem"
5 | )
6 |
7 | type ConfigItem struct {
8 | Resource
9 |
10 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
11 |
12 | SourceVersion string `json:"sourceVersion,omitempty" yaml:"source_version,omitempty"`
13 | }
14 |
15 | type ConfigItemCollection struct {
16 | Collection
17 | Data []ConfigItem `json:"data,omitempty"`
18 | }
19 |
20 | type ConfigItemClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type ConfigItemOperations interface {
25 | List(opts *ListOpts) (*ConfigItemCollection, error)
26 | Create(opts *ConfigItem) (*ConfigItem, error)
27 | Update(existing *ConfigItem, updates interface{}) (*ConfigItem, error)
28 | ById(id string) (*ConfigItem, error)
29 | Delete(container *ConfigItem) error
30 | }
31 |
32 | func newConfigItemClient(rancherClient *RancherClient) *ConfigItemClient {
33 | return &ConfigItemClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *ConfigItemClient) Create(container *ConfigItem) (*ConfigItem, error) {
39 | resp := &ConfigItem{}
40 | err := c.rancherClient.doCreate(CONFIG_ITEM_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *ConfigItemClient) Update(existing *ConfigItem, updates interface{}) (*ConfigItem, error) {
45 | resp := &ConfigItem{}
46 | err := c.rancherClient.doUpdate(CONFIG_ITEM_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *ConfigItemClient) List(opts *ListOpts) (*ConfigItemCollection, error) {
51 | resp := &ConfigItemCollection{}
52 | err := c.rancherClient.doList(CONFIG_ITEM_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *ConfigItemClient) ById(id string) (*ConfigItem, error) {
57 | resp := &ConfigItem{}
58 | err := c.rancherClient.doById(CONFIG_ITEM_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *ConfigItemClient) Delete(container *ConfigItem) error {
68 | return c.rancherClient.doResourceDelete(CONFIG_ITEM_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_container_exec.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | CONTAINER_EXEC_TYPE = "containerExec"
5 | )
6 |
7 | type ContainerExec struct {
8 | Resource
9 |
10 | AttachStdin bool `json:"attachStdin,omitempty" yaml:"attach_stdin,omitempty"`
11 |
12 | AttachStdout bool `json:"attachStdout,omitempty" yaml:"attach_stdout,omitempty"`
13 |
14 | Command []string `json:"command,omitempty" yaml:"command,omitempty"`
15 |
16 | Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"`
17 | }
18 |
19 | type ContainerExecCollection struct {
20 | Collection
21 | Data []ContainerExec `json:"data,omitempty"`
22 | }
23 |
24 | type ContainerExecClient struct {
25 | rancherClient *RancherClient
26 | }
27 |
28 | type ContainerExecOperations interface {
29 | List(opts *ListOpts) (*ContainerExecCollection, error)
30 | Create(opts *ContainerExec) (*ContainerExec, error)
31 | Update(existing *ContainerExec, updates interface{}) (*ContainerExec, error)
32 | ById(id string) (*ContainerExec, error)
33 | Delete(container *ContainerExec) error
34 | }
35 |
36 | func newContainerExecClient(rancherClient *RancherClient) *ContainerExecClient {
37 | return &ContainerExecClient{
38 | rancherClient: rancherClient,
39 | }
40 | }
41 |
42 | func (c *ContainerExecClient) Create(container *ContainerExec) (*ContainerExec, error) {
43 | resp := &ContainerExec{}
44 | err := c.rancherClient.doCreate(CONTAINER_EXEC_TYPE, container, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *ContainerExecClient) Update(existing *ContainerExec, updates interface{}) (*ContainerExec, error) {
49 | resp := &ContainerExec{}
50 | err := c.rancherClient.doUpdate(CONTAINER_EXEC_TYPE, &existing.Resource, updates, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *ContainerExecClient) List(opts *ListOpts) (*ContainerExecCollection, error) {
55 | resp := &ContainerExecCollection{}
56 | err := c.rancherClient.doList(CONTAINER_EXEC_TYPE, opts, resp)
57 | return resp, err
58 | }
59 |
60 | func (c *ContainerExecClient) ById(id string) (*ContainerExec, error) {
61 | resp := &ContainerExec{}
62 | err := c.rancherClient.doById(CONTAINER_EXEC_TYPE, id, resp)
63 | if apiError, ok := err.(*ApiError); ok {
64 | if apiError.StatusCode == 404 {
65 | return nil, nil
66 | }
67 | }
68 | return resp, err
69 | }
70 |
71 | func (c *ContainerExecClient) Delete(container *ContainerExec) error {
72 | return c.rancherClient.doResourceDelete(CONTAINER_EXEC_TYPE, &container.Resource)
73 | }
74 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_container_logs.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | CONTAINER_LOGS_TYPE = "containerLogs"
5 | )
6 |
7 | type ContainerLogs struct {
8 | Resource
9 |
10 | Follow bool `json:"follow,omitempty" yaml:"follow,omitempty"`
11 |
12 | Lines int64 `json:"lines,omitempty" yaml:"lines,omitempty"`
13 | }
14 |
15 | type ContainerLogsCollection struct {
16 | Collection
17 | Data []ContainerLogs `json:"data,omitempty"`
18 | }
19 |
20 | type ContainerLogsClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type ContainerLogsOperations interface {
25 | List(opts *ListOpts) (*ContainerLogsCollection, error)
26 | Create(opts *ContainerLogs) (*ContainerLogs, error)
27 | Update(existing *ContainerLogs, updates interface{}) (*ContainerLogs, error)
28 | ById(id string) (*ContainerLogs, error)
29 | Delete(container *ContainerLogs) error
30 | }
31 |
32 | func newContainerLogsClient(rancherClient *RancherClient) *ContainerLogsClient {
33 | return &ContainerLogsClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *ContainerLogsClient) Create(container *ContainerLogs) (*ContainerLogs, error) {
39 | resp := &ContainerLogs{}
40 | err := c.rancherClient.doCreate(CONTAINER_LOGS_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *ContainerLogsClient) Update(existing *ContainerLogs, updates interface{}) (*ContainerLogs, error) {
45 | resp := &ContainerLogs{}
46 | err := c.rancherClient.doUpdate(CONTAINER_LOGS_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *ContainerLogsClient) List(opts *ListOpts) (*ContainerLogsCollection, error) {
51 | resp := &ContainerLogsCollection{}
52 | err := c.rancherClient.doList(CONTAINER_LOGS_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *ContainerLogsClient) ById(id string) (*ContainerLogs, error) {
57 | resp := &ContainerLogs{}
58 | err := c.rancherClient.doById(CONTAINER_LOGS_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *ContainerLogsClient) Delete(container *ContainerLogs) error {
68 | return c.rancherClient.doResourceDelete(CONTAINER_LOGS_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_container_proxy.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | CONTAINER_PROXY_TYPE = "containerProxy"
5 | )
6 |
7 | type ContainerProxy struct {
8 | Resource
9 |
10 | Port int64 `json:"port,omitempty" yaml:"port,omitempty"`
11 |
12 | Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
13 | }
14 |
15 | type ContainerProxyCollection struct {
16 | Collection
17 | Data []ContainerProxy `json:"data,omitempty"`
18 | }
19 |
20 | type ContainerProxyClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type ContainerProxyOperations interface {
25 | List(opts *ListOpts) (*ContainerProxyCollection, error)
26 | Create(opts *ContainerProxy) (*ContainerProxy, error)
27 | Update(existing *ContainerProxy, updates interface{}) (*ContainerProxy, error)
28 | ById(id string) (*ContainerProxy, error)
29 | Delete(container *ContainerProxy) error
30 | }
31 |
32 | func newContainerProxyClient(rancherClient *RancherClient) *ContainerProxyClient {
33 | return &ContainerProxyClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *ContainerProxyClient) Create(container *ContainerProxy) (*ContainerProxy, error) {
39 | resp := &ContainerProxy{}
40 | err := c.rancherClient.doCreate(CONTAINER_PROXY_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *ContainerProxyClient) Update(existing *ContainerProxy, updates interface{}) (*ContainerProxy, error) {
45 | resp := &ContainerProxy{}
46 | err := c.rancherClient.doUpdate(CONTAINER_PROXY_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *ContainerProxyClient) List(opts *ListOpts) (*ContainerProxyCollection, error) {
51 | resp := &ContainerProxyCollection{}
52 | err := c.rancherClient.doList(CONTAINER_PROXY_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *ContainerProxyClient) ById(id string) (*ContainerProxy, error) {
57 | resp := &ContainerProxy{}
58 | err := c.rancherClient.doById(CONTAINER_PROXY_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *ContainerProxyClient) Delete(container *ContainerProxy) error {
68 | return c.rancherClient.doResourceDelete(CONTAINER_PROXY_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_databasechangeloglock.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | DATABASECHANGELOGLOCK_TYPE = "databasechangeloglock"
5 | )
6 |
7 | type Databasechangeloglock struct {
8 | Resource
9 |
10 | Locked bool `json:"locked,omitempty" yaml:"locked,omitempty"`
11 |
12 | Lockedby string `json:"lockedby,omitempty" yaml:"lockedby,omitempty"`
13 |
14 | Lockgranted string `json:"lockgranted,omitempty" yaml:"lockgranted,omitempty"`
15 | }
16 |
17 | type DatabasechangeloglockCollection struct {
18 | Collection
19 | Data []Databasechangeloglock `json:"data,omitempty"`
20 | }
21 |
22 | type DatabasechangeloglockClient struct {
23 | rancherClient *RancherClient
24 | }
25 |
26 | type DatabasechangeloglockOperations interface {
27 | List(opts *ListOpts) (*DatabasechangeloglockCollection, error)
28 | Create(opts *Databasechangeloglock) (*Databasechangeloglock, error)
29 | Update(existing *Databasechangeloglock, updates interface{}) (*Databasechangeloglock, error)
30 | ById(id string) (*Databasechangeloglock, error)
31 | Delete(container *Databasechangeloglock) error
32 | }
33 |
34 | func newDatabasechangeloglockClient(rancherClient *RancherClient) *DatabasechangeloglockClient {
35 | return &DatabasechangeloglockClient{
36 | rancherClient: rancherClient,
37 | }
38 | }
39 |
40 | func (c *DatabasechangeloglockClient) Create(container *Databasechangeloglock) (*Databasechangeloglock, error) {
41 | resp := &Databasechangeloglock{}
42 | err := c.rancherClient.doCreate(DATABASECHANGELOGLOCK_TYPE, container, resp)
43 | return resp, err
44 | }
45 |
46 | func (c *DatabasechangeloglockClient) Update(existing *Databasechangeloglock, updates interface{}) (*Databasechangeloglock, error) {
47 | resp := &Databasechangeloglock{}
48 | err := c.rancherClient.doUpdate(DATABASECHANGELOGLOCK_TYPE, &existing.Resource, updates, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *DatabasechangeloglockClient) List(opts *ListOpts) (*DatabasechangeloglockCollection, error) {
53 | resp := &DatabasechangeloglockCollection{}
54 | err := c.rancherClient.doList(DATABASECHANGELOGLOCK_TYPE, opts, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *DatabasechangeloglockClient) ById(id string) (*Databasechangeloglock, error) {
59 | resp := &Databasechangeloglock{}
60 | err := c.rancherClient.doById(DATABASECHANGELOGLOCK_TYPE, id, resp)
61 | if apiError, ok := err.(*ApiError); ok {
62 | if apiError.StatusCode == 404 {
63 | return nil, nil
64 | }
65 | }
66 | return resp, err
67 | }
68 |
69 | func (c *DatabasechangeloglockClient) Delete(container *Databasechangeloglock) error {
70 | return c.rancherClient.doResourceDelete(DATABASECHANGELOGLOCK_TYPE, &container.Resource)
71 | }
72 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_docker_build.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | DOCKER_BUILD_TYPE = "dockerBuild"
5 | )
6 |
7 | type DockerBuild struct {
8 | Resource
9 |
10 | Context string `json:"context,omitempty" yaml:"context,omitempty"`
11 |
12 | Dockerfile string `json:"dockerfile,omitempty" yaml:"dockerfile,omitempty"`
13 |
14 | Forcerm bool `json:"forcerm,omitempty" yaml:"forcerm,omitempty"`
15 |
16 | Nocache bool `json:"nocache,omitempty" yaml:"nocache,omitempty"`
17 |
18 | Remote string `json:"remote,omitempty" yaml:"remote,omitempty"`
19 |
20 | Rm bool `json:"rm,omitempty" yaml:"rm,omitempty"`
21 | }
22 |
23 | type DockerBuildCollection struct {
24 | Collection
25 | Data []DockerBuild `json:"data,omitempty"`
26 | }
27 |
28 | type DockerBuildClient struct {
29 | rancherClient *RancherClient
30 | }
31 |
32 | type DockerBuildOperations interface {
33 | List(opts *ListOpts) (*DockerBuildCollection, error)
34 | Create(opts *DockerBuild) (*DockerBuild, error)
35 | Update(existing *DockerBuild, updates interface{}) (*DockerBuild, error)
36 | ById(id string) (*DockerBuild, error)
37 | Delete(container *DockerBuild) error
38 | }
39 |
40 | func newDockerBuildClient(rancherClient *RancherClient) *DockerBuildClient {
41 | return &DockerBuildClient{
42 | rancherClient: rancherClient,
43 | }
44 | }
45 |
46 | func (c *DockerBuildClient) Create(container *DockerBuild) (*DockerBuild, error) {
47 | resp := &DockerBuild{}
48 | err := c.rancherClient.doCreate(DOCKER_BUILD_TYPE, container, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *DockerBuildClient) Update(existing *DockerBuild, updates interface{}) (*DockerBuild, error) {
53 | resp := &DockerBuild{}
54 | err := c.rancherClient.doUpdate(DOCKER_BUILD_TYPE, &existing.Resource, updates, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *DockerBuildClient) List(opts *ListOpts) (*DockerBuildCollection, error) {
59 | resp := &DockerBuildCollection{}
60 | err := c.rancherClient.doList(DOCKER_BUILD_TYPE, opts, resp)
61 | return resp, err
62 | }
63 |
64 | func (c *DockerBuildClient) ById(id string) (*DockerBuild, error) {
65 | resp := &DockerBuild{}
66 | err := c.rancherClient.doById(DOCKER_BUILD_TYPE, id, resp)
67 | if apiError, ok := err.(*ApiError); ok {
68 | if apiError.StatusCode == 404 {
69 | return nil, nil
70 | }
71 | }
72 | return resp, err
73 | }
74 |
75 | func (c *DockerBuildClient) Delete(container *DockerBuild) error {
76 | return c.rancherClient.doResourceDelete(DOCKER_BUILD_TYPE, &container.Resource)
77 | }
78 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_environment_upgrade.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | ENVIRONMENT_UPGRADE_TYPE = "environmentUpgrade"
5 | )
6 |
7 | type EnvironmentUpgrade struct {
8 | Resource
9 |
10 | DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"`
11 |
12 | Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"`
13 |
14 | ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"`
15 |
16 | RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"`
17 | }
18 |
19 | type EnvironmentUpgradeCollection struct {
20 | Collection
21 | Data []EnvironmentUpgrade `json:"data,omitempty"`
22 | }
23 |
24 | type EnvironmentUpgradeClient struct {
25 | rancherClient *RancherClient
26 | }
27 |
28 | type EnvironmentUpgradeOperations interface {
29 | List(opts *ListOpts) (*EnvironmentUpgradeCollection, error)
30 | Create(opts *EnvironmentUpgrade) (*EnvironmentUpgrade, error)
31 | Update(existing *EnvironmentUpgrade, updates interface{}) (*EnvironmentUpgrade, error)
32 | ById(id string) (*EnvironmentUpgrade, error)
33 | Delete(container *EnvironmentUpgrade) error
34 | }
35 |
36 | func newEnvironmentUpgradeClient(rancherClient *RancherClient) *EnvironmentUpgradeClient {
37 | return &EnvironmentUpgradeClient{
38 | rancherClient: rancherClient,
39 | }
40 | }
41 |
42 | func (c *EnvironmentUpgradeClient) Create(container *EnvironmentUpgrade) (*EnvironmentUpgrade, error) {
43 | resp := &EnvironmentUpgrade{}
44 | err := c.rancherClient.doCreate(ENVIRONMENT_UPGRADE_TYPE, container, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *EnvironmentUpgradeClient) Update(existing *EnvironmentUpgrade, updates interface{}) (*EnvironmentUpgrade, error) {
49 | resp := &EnvironmentUpgrade{}
50 | err := c.rancherClient.doUpdate(ENVIRONMENT_UPGRADE_TYPE, &existing.Resource, updates, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *EnvironmentUpgradeClient) List(opts *ListOpts) (*EnvironmentUpgradeCollection, error) {
55 | resp := &EnvironmentUpgradeCollection{}
56 | err := c.rancherClient.doList(ENVIRONMENT_UPGRADE_TYPE, opts, resp)
57 | return resp, err
58 | }
59 |
60 | func (c *EnvironmentUpgradeClient) ById(id string) (*EnvironmentUpgrade, error) {
61 | resp := &EnvironmentUpgrade{}
62 | err := c.rancherClient.doById(ENVIRONMENT_UPGRADE_TYPE, id, resp)
63 | if apiError, ok := err.(*ApiError); ok {
64 | if apiError.StatusCode == 404 {
65 | return nil, nil
66 | }
67 | }
68 | return resp, err
69 | }
70 |
71 | func (c *EnvironmentUpgradeClient) Delete(container *EnvironmentUpgrade) error {
72 | return c.rancherClient.doResourceDelete(ENVIRONMENT_UPGRADE_TYPE, &container.Resource)
73 | }
74 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_extension_implementation.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | EXTENSION_IMPLEMENTATION_TYPE = "extensionImplementation"
5 | )
6 |
7 | type ExtensionImplementation struct {
8 | Resource
9 |
10 | ClassName string `json:"className,omitempty" yaml:"class_name,omitempty"`
11 |
12 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
13 |
14 | Properties map[string]interface{} `json:"properties,omitempty" yaml:"properties,omitempty"`
15 | }
16 |
17 | type ExtensionImplementationCollection struct {
18 | Collection
19 | Data []ExtensionImplementation `json:"data,omitempty"`
20 | }
21 |
22 | type ExtensionImplementationClient struct {
23 | rancherClient *RancherClient
24 | }
25 |
26 | type ExtensionImplementationOperations interface {
27 | List(opts *ListOpts) (*ExtensionImplementationCollection, error)
28 | Create(opts *ExtensionImplementation) (*ExtensionImplementation, error)
29 | Update(existing *ExtensionImplementation, updates interface{}) (*ExtensionImplementation, error)
30 | ById(id string) (*ExtensionImplementation, error)
31 | Delete(container *ExtensionImplementation) error
32 | }
33 |
34 | func newExtensionImplementationClient(rancherClient *RancherClient) *ExtensionImplementationClient {
35 | return &ExtensionImplementationClient{
36 | rancherClient: rancherClient,
37 | }
38 | }
39 |
40 | func (c *ExtensionImplementationClient) Create(container *ExtensionImplementation) (*ExtensionImplementation, error) {
41 | resp := &ExtensionImplementation{}
42 | err := c.rancherClient.doCreate(EXTENSION_IMPLEMENTATION_TYPE, container, resp)
43 | return resp, err
44 | }
45 |
46 | func (c *ExtensionImplementationClient) Update(existing *ExtensionImplementation, updates interface{}) (*ExtensionImplementation, error) {
47 | resp := &ExtensionImplementation{}
48 | err := c.rancherClient.doUpdate(EXTENSION_IMPLEMENTATION_TYPE, &existing.Resource, updates, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *ExtensionImplementationClient) List(opts *ListOpts) (*ExtensionImplementationCollection, error) {
53 | resp := &ExtensionImplementationCollection{}
54 | err := c.rancherClient.doList(EXTENSION_IMPLEMENTATION_TYPE, opts, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *ExtensionImplementationClient) ById(id string) (*ExtensionImplementation, error) {
59 | resp := &ExtensionImplementation{}
60 | err := c.rancherClient.doById(EXTENSION_IMPLEMENTATION_TYPE, id, resp)
61 | if apiError, ok := err.(*ApiError); ok {
62 | if apiError.StatusCode == 404 {
63 | return nil, nil
64 | }
65 | }
66 | return resp, err
67 | }
68 |
69 | func (c *ExtensionImplementationClient) Delete(container *ExtensionImplementation) error {
70 | return c.rancherClient.doResourceDelete(EXTENSION_IMPLEMENTATION_TYPE, &container.Resource)
71 | }
72 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_extension_point.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | EXTENSION_POINT_TYPE = "extensionPoint"
5 | )
6 |
7 | type ExtensionPoint struct {
8 | Resource
9 |
10 | ExcludeSetting string `json:"excludeSetting,omitempty" yaml:"exclude_setting,omitempty"`
11 |
12 | Implementations []interface{} `json:"implementations,omitempty" yaml:"implementations,omitempty"`
13 |
14 | IncludeSetting string `json:"includeSetting,omitempty" yaml:"include_setting,omitempty"`
15 |
16 | ListSetting string `json:"listSetting,omitempty" yaml:"list_setting,omitempty"`
17 |
18 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
19 | }
20 |
21 | type ExtensionPointCollection struct {
22 | Collection
23 | Data []ExtensionPoint `json:"data,omitempty"`
24 | }
25 |
26 | type ExtensionPointClient struct {
27 | rancherClient *RancherClient
28 | }
29 |
30 | type ExtensionPointOperations interface {
31 | List(opts *ListOpts) (*ExtensionPointCollection, error)
32 | Create(opts *ExtensionPoint) (*ExtensionPoint, error)
33 | Update(existing *ExtensionPoint, updates interface{}) (*ExtensionPoint, error)
34 | ById(id string) (*ExtensionPoint, error)
35 | Delete(container *ExtensionPoint) error
36 | }
37 |
38 | func newExtensionPointClient(rancherClient *RancherClient) *ExtensionPointClient {
39 | return &ExtensionPointClient{
40 | rancherClient: rancherClient,
41 | }
42 | }
43 |
44 | func (c *ExtensionPointClient) Create(container *ExtensionPoint) (*ExtensionPoint, error) {
45 | resp := &ExtensionPoint{}
46 | err := c.rancherClient.doCreate(EXTENSION_POINT_TYPE, container, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *ExtensionPointClient) Update(existing *ExtensionPoint, updates interface{}) (*ExtensionPoint, error) {
51 | resp := &ExtensionPoint{}
52 | err := c.rancherClient.doUpdate(EXTENSION_POINT_TYPE, &existing.Resource, updates, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *ExtensionPointClient) List(opts *ListOpts) (*ExtensionPointCollection, error) {
57 | resp := &ExtensionPointCollection{}
58 | err := c.rancherClient.doList(EXTENSION_POINT_TYPE, opts, resp)
59 | return resp, err
60 | }
61 |
62 | func (c *ExtensionPointClient) ById(id string) (*ExtensionPoint, error) {
63 | resp := &ExtensionPoint{}
64 | err := c.rancherClient.doById(EXTENSION_POINT_TYPE, id, resp)
65 | if apiError, ok := err.(*ApiError); ok {
66 | if apiError.StatusCode == 404 {
67 | return nil, nil
68 | }
69 | }
70 | return resp, err
71 | }
72 |
73 | func (c *ExtensionPointClient) Delete(container *ExtensionPoint) error {
74 | return c.rancherClient.doResourceDelete(EXTENSION_POINT_TYPE, &container.Resource)
75 | }
76 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_field_documentation.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | FIELD_DOCUMENTATION_TYPE = "fieldDocumentation"
5 | )
6 |
7 | type FieldDocumentation struct {
8 | Resource
9 |
10 | Description string `json:"description,omitempty" yaml:"description,omitempty"`
11 | }
12 |
13 | type FieldDocumentationCollection struct {
14 | Collection
15 | Data []FieldDocumentation `json:"data,omitempty"`
16 | }
17 |
18 | type FieldDocumentationClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type FieldDocumentationOperations interface {
23 | List(opts *ListOpts) (*FieldDocumentationCollection, error)
24 | Create(opts *FieldDocumentation) (*FieldDocumentation, error)
25 | Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error)
26 | ById(id string) (*FieldDocumentation, error)
27 | Delete(container *FieldDocumentation) error
28 | }
29 |
30 | func newFieldDocumentationClient(rancherClient *RancherClient) *FieldDocumentationClient {
31 | return &FieldDocumentationClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *FieldDocumentationClient) Create(container *FieldDocumentation) (*FieldDocumentation, error) {
37 | resp := &FieldDocumentation{}
38 | err := c.rancherClient.doCreate(FIELD_DOCUMENTATION_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *FieldDocumentationClient) Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error) {
43 | resp := &FieldDocumentation{}
44 | err := c.rancherClient.doUpdate(FIELD_DOCUMENTATION_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *FieldDocumentationClient) List(opts *ListOpts) (*FieldDocumentationCollection, error) {
49 | resp := &FieldDocumentationCollection{}
50 | err := c.rancherClient.doList(FIELD_DOCUMENTATION_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *FieldDocumentationClient) ById(id string) (*FieldDocumentation, error) {
55 | resp := &FieldDocumentation{}
56 | err := c.rancherClient.doById(FIELD_DOCUMENTATION_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *FieldDocumentationClient) Delete(container *FieldDocumentation) error {
66 | return c.rancherClient.doResourceDelete(FIELD_DOCUMENTATION_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_githubconfig.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | GITHUBCONFIG_TYPE = "githubconfig"
5 | )
6 |
7 | type Githubconfig struct {
8 | Resource
9 |
10 | AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"`
11 |
12 | AllowedIdentities []interface{} `json:"allowedIdentities,omitempty" yaml:"allowed_identities,omitempty"`
13 |
14 | ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"`
15 |
16 | ClientSecret string `json:"clientSecret,omitempty" yaml:"client_secret,omitempty"`
17 |
18 | Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
19 |
20 | Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"`
21 |
22 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
23 |
24 | Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
25 | }
26 |
27 | type GithubconfigCollection struct {
28 | Collection
29 | Data []Githubconfig `json:"data,omitempty"`
30 | }
31 |
32 | type GithubconfigClient struct {
33 | rancherClient *RancherClient
34 | }
35 |
36 | type GithubconfigOperations interface {
37 | List(opts *ListOpts) (*GithubconfigCollection, error)
38 | Create(opts *Githubconfig) (*Githubconfig, error)
39 | Update(existing *Githubconfig, updates interface{}) (*Githubconfig, error)
40 | ById(id string) (*Githubconfig, error)
41 | Delete(container *Githubconfig) error
42 | }
43 |
44 | func newGithubconfigClient(rancherClient *RancherClient) *GithubconfigClient {
45 | return &GithubconfigClient{
46 | rancherClient: rancherClient,
47 | }
48 | }
49 |
50 | func (c *GithubconfigClient) Create(container *Githubconfig) (*Githubconfig, error) {
51 | resp := &Githubconfig{}
52 | err := c.rancherClient.doCreate(GITHUBCONFIG_TYPE, container, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *GithubconfigClient) Update(existing *Githubconfig, updates interface{}) (*Githubconfig, error) {
57 | resp := &Githubconfig{}
58 | err := c.rancherClient.doUpdate(GITHUBCONFIG_TYPE, &existing.Resource, updates, resp)
59 | return resp, err
60 | }
61 |
62 | func (c *GithubconfigClient) List(opts *ListOpts) (*GithubconfigCollection, error) {
63 | resp := &GithubconfigCollection{}
64 | err := c.rancherClient.doList(GITHUBCONFIG_TYPE, opts, resp)
65 | return resp, err
66 | }
67 |
68 | func (c *GithubconfigClient) ById(id string) (*Githubconfig, error) {
69 | resp := &Githubconfig{}
70 | err := c.rancherClient.doById(GITHUBCONFIG_TYPE, id, resp)
71 | if apiError, ok := err.(*ApiError); ok {
72 | if apiError.StatusCode == 404 {
73 | return nil, nil
74 | }
75 | }
76 | return resp, err
77 | }
78 |
79 | func (c *GithubconfigClient) Delete(container *Githubconfig) error {
80 | return c.rancherClient.doResourceDelete(GITHUBCONFIG_TYPE, &container.Resource)
81 | }
82 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_global_load_balancer_policy.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | GLOBAL_LOAD_BALANCER_POLICY_TYPE = "globalLoadBalancerPolicy"
5 | )
6 |
7 | type GlobalLoadBalancerPolicy struct {
8 | Resource
9 |
10 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
11 | }
12 |
13 | type GlobalLoadBalancerPolicyCollection struct {
14 | Collection
15 | Data []GlobalLoadBalancerPolicy `json:"data,omitempty"`
16 | }
17 |
18 | type GlobalLoadBalancerPolicyClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type GlobalLoadBalancerPolicyOperations interface {
23 | List(opts *ListOpts) (*GlobalLoadBalancerPolicyCollection, error)
24 | Create(opts *GlobalLoadBalancerPolicy) (*GlobalLoadBalancerPolicy, error)
25 | Update(existing *GlobalLoadBalancerPolicy, updates interface{}) (*GlobalLoadBalancerPolicy, error)
26 | ById(id string) (*GlobalLoadBalancerPolicy, error)
27 | Delete(container *GlobalLoadBalancerPolicy) error
28 | }
29 |
30 | func newGlobalLoadBalancerPolicyClient(rancherClient *RancherClient) *GlobalLoadBalancerPolicyClient {
31 | return &GlobalLoadBalancerPolicyClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *GlobalLoadBalancerPolicyClient) Create(container *GlobalLoadBalancerPolicy) (*GlobalLoadBalancerPolicy, error) {
37 | resp := &GlobalLoadBalancerPolicy{}
38 | err := c.rancherClient.doCreate(GLOBAL_LOAD_BALANCER_POLICY_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *GlobalLoadBalancerPolicyClient) Update(existing *GlobalLoadBalancerPolicy, updates interface{}) (*GlobalLoadBalancerPolicy, error) {
43 | resp := &GlobalLoadBalancerPolicy{}
44 | err := c.rancherClient.doUpdate(GLOBAL_LOAD_BALANCER_POLICY_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *GlobalLoadBalancerPolicyClient) List(opts *ListOpts) (*GlobalLoadBalancerPolicyCollection, error) {
49 | resp := &GlobalLoadBalancerPolicyCollection{}
50 | err := c.rancherClient.doList(GLOBAL_LOAD_BALANCER_POLICY_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *GlobalLoadBalancerPolicyClient) ById(id string) (*GlobalLoadBalancerPolicy, error) {
55 | resp := &GlobalLoadBalancerPolicy{}
56 | err := c.rancherClient.doById(GLOBAL_LOAD_BALANCER_POLICY_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *GlobalLoadBalancerPolicyClient) Delete(container *GlobalLoadBalancerPolicy) error {
66 | return c.rancherClient.doResourceDelete(GLOBAL_LOAD_BALANCER_POLICY_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_ha_config.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | HA_CONFIG_TYPE = "haConfig"
5 | )
6 |
7 | type HaConfig struct {
8 | Resource
9 |
10 | ClusterSize int64 `json:"clusterSize,omitempty" yaml:"cluster_size,omitempty"`
11 |
12 | DbHost string `json:"dbHost,omitempty" yaml:"db_host,omitempty"`
13 |
14 | DbSize int64 `json:"dbSize,omitempty" yaml:"db_size,omitempty"`
15 |
16 | Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
17 | }
18 |
19 | type HaConfigCollection struct {
20 | Collection
21 | Data []HaConfig `json:"data,omitempty"`
22 | }
23 |
24 | type HaConfigClient struct {
25 | rancherClient *RancherClient
26 | }
27 |
28 | type HaConfigOperations interface {
29 | List(opts *ListOpts) (*HaConfigCollection, error)
30 | Create(opts *HaConfig) (*HaConfig, error)
31 | Update(existing *HaConfig, updates interface{}) (*HaConfig, error)
32 | ById(id string) (*HaConfig, error)
33 | Delete(container *HaConfig) error
34 | }
35 |
36 | func newHaConfigClient(rancherClient *RancherClient) *HaConfigClient {
37 | return &HaConfigClient{
38 | rancherClient: rancherClient,
39 | }
40 | }
41 |
42 | func (c *HaConfigClient) Create(container *HaConfig) (*HaConfig, error) {
43 | resp := &HaConfig{}
44 | err := c.rancherClient.doCreate(HA_CONFIG_TYPE, container, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *HaConfigClient) Update(existing *HaConfig, updates interface{}) (*HaConfig, error) {
49 | resp := &HaConfig{}
50 | err := c.rancherClient.doUpdate(HA_CONFIG_TYPE, &existing.Resource, updates, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *HaConfigClient) List(opts *ListOpts) (*HaConfigCollection, error) {
55 | resp := &HaConfigCollection{}
56 | err := c.rancherClient.doList(HA_CONFIG_TYPE, opts, resp)
57 | return resp, err
58 | }
59 |
60 | func (c *HaConfigClient) ById(id string) (*HaConfig, error) {
61 | resp := &HaConfig{}
62 | err := c.rancherClient.doById(HA_CONFIG_TYPE, id, resp)
63 | if apiError, ok := err.(*ApiError); ok {
64 | if apiError.StatusCode == 404 {
65 | return nil, nil
66 | }
67 | }
68 | return resp, err
69 | }
70 |
71 | func (c *HaConfigClient) Delete(container *HaConfig) error {
72 | return c.rancherClient.doResourceDelete(HA_CONFIG_TYPE, &container.Resource)
73 | }
74 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_haproxy_config.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | HAPROXY_CONFIG_TYPE = "haproxyConfig"
5 | )
6 |
7 | type HaproxyConfig struct {
8 | Resource
9 |
10 | Defaults string `json:"defaults,omitempty" yaml:"defaults,omitempty"`
11 |
12 | Global string `json:"global,omitempty" yaml:"global,omitempty"`
13 | }
14 |
15 | type HaproxyConfigCollection struct {
16 | Collection
17 | Data []HaproxyConfig `json:"data,omitempty"`
18 | }
19 |
20 | type HaproxyConfigClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type HaproxyConfigOperations interface {
25 | List(opts *ListOpts) (*HaproxyConfigCollection, error)
26 | Create(opts *HaproxyConfig) (*HaproxyConfig, error)
27 | Update(existing *HaproxyConfig, updates interface{}) (*HaproxyConfig, error)
28 | ById(id string) (*HaproxyConfig, error)
29 | Delete(container *HaproxyConfig) error
30 | }
31 |
32 | func newHaproxyConfigClient(rancherClient *RancherClient) *HaproxyConfigClient {
33 | return &HaproxyConfigClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *HaproxyConfigClient) Create(container *HaproxyConfig) (*HaproxyConfig, error) {
39 | resp := &HaproxyConfig{}
40 | err := c.rancherClient.doCreate(HAPROXY_CONFIG_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *HaproxyConfigClient) Update(existing *HaproxyConfig, updates interface{}) (*HaproxyConfig, error) {
45 | resp := &HaproxyConfig{}
46 | err := c.rancherClient.doUpdate(HAPROXY_CONFIG_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *HaproxyConfigClient) List(opts *ListOpts) (*HaproxyConfigCollection, error) {
51 | resp := &HaproxyConfigCollection{}
52 | err := c.rancherClient.doList(HAPROXY_CONFIG_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *HaproxyConfigClient) ById(id string) (*HaproxyConfig, error) {
57 | resp := &HaproxyConfig{}
58 | err := c.rancherClient.doById(HAPROXY_CONFIG_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *HaproxyConfigClient) Delete(container *HaproxyConfig) error {
68 | return c.rancherClient.doResourceDelete(HAPROXY_CONFIG_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_host_access.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | HOST_ACCESS_TYPE = "hostAccess"
5 | )
6 |
7 | type HostAccess struct {
8 | Resource
9 |
10 | Token string `json:"token,omitempty" yaml:"token,omitempty"`
11 |
12 | Url string `json:"url,omitempty" yaml:"url,omitempty"`
13 | }
14 |
15 | type HostAccessCollection struct {
16 | Collection
17 | Data []HostAccess `json:"data,omitempty"`
18 | }
19 |
20 | type HostAccessClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type HostAccessOperations interface {
25 | List(opts *ListOpts) (*HostAccessCollection, error)
26 | Create(opts *HostAccess) (*HostAccess, error)
27 | Update(existing *HostAccess, updates interface{}) (*HostAccess, error)
28 | ById(id string) (*HostAccess, error)
29 | Delete(container *HostAccess) error
30 | }
31 |
32 | func newHostAccessClient(rancherClient *RancherClient) *HostAccessClient {
33 | return &HostAccessClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *HostAccessClient) Create(container *HostAccess) (*HostAccess, error) {
39 | resp := &HostAccess{}
40 | err := c.rancherClient.doCreate(HOST_ACCESS_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *HostAccessClient) Update(existing *HostAccess, updates interface{}) (*HostAccess, error) {
45 | resp := &HostAccess{}
46 | err := c.rancherClient.doUpdate(HOST_ACCESS_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *HostAccessClient) List(opts *ListOpts) (*HostAccessCollection, error) {
51 | resp := &HostAccessCollection{}
52 | err := c.rancherClient.doList(HOST_ACCESS_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *HostAccessClient) ById(id string) (*HostAccess, error) {
57 | resp := &HostAccess{}
58 | err := c.rancherClient.doById(HOST_ACCESS_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *HostAccessClient) Delete(container *HostAccess) error {
68 | return c.rancherClient.doResourceDelete(HOST_ACCESS_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_host_api_proxy_token.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | HOST_API_PROXY_TOKEN_TYPE = "hostApiProxyToken"
5 | )
6 |
7 | type HostApiProxyToken struct {
8 | Resource
9 |
10 | ReportedUuid string `json:"reportedUuid,omitempty" yaml:"reported_uuid,omitempty"`
11 |
12 | Token string `json:"token,omitempty" yaml:"token,omitempty"`
13 |
14 | Url string `json:"url,omitempty" yaml:"url,omitempty"`
15 | }
16 |
17 | type HostApiProxyTokenCollection struct {
18 | Collection
19 | Data []HostApiProxyToken `json:"data,omitempty"`
20 | }
21 |
22 | type HostApiProxyTokenClient struct {
23 | rancherClient *RancherClient
24 | }
25 |
26 | type HostApiProxyTokenOperations interface {
27 | List(opts *ListOpts) (*HostApiProxyTokenCollection, error)
28 | Create(opts *HostApiProxyToken) (*HostApiProxyToken, error)
29 | Update(existing *HostApiProxyToken, updates interface{}) (*HostApiProxyToken, error)
30 | ById(id string) (*HostApiProxyToken, error)
31 | Delete(container *HostApiProxyToken) error
32 | }
33 |
34 | func newHostApiProxyTokenClient(rancherClient *RancherClient) *HostApiProxyTokenClient {
35 | return &HostApiProxyTokenClient{
36 | rancherClient: rancherClient,
37 | }
38 | }
39 |
40 | func (c *HostApiProxyTokenClient) Create(container *HostApiProxyToken) (*HostApiProxyToken, error) {
41 | resp := &HostApiProxyToken{}
42 | err := c.rancherClient.doCreate(HOST_API_PROXY_TOKEN_TYPE, container, resp)
43 | return resp, err
44 | }
45 |
46 | func (c *HostApiProxyTokenClient) Update(existing *HostApiProxyToken, updates interface{}) (*HostApiProxyToken, error) {
47 | resp := &HostApiProxyToken{}
48 | err := c.rancherClient.doUpdate(HOST_API_PROXY_TOKEN_TYPE, &existing.Resource, updates, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *HostApiProxyTokenClient) List(opts *ListOpts) (*HostApiProxyTokenCollection, error) {
53 | resp := &HostApiProxyTokenCollection{}
54 | err := c.rancherClient.doList(HOST_API_PROXY_TOKEN_TYPE, opts, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *HostApiProxyTokenClient) ById(id string) (*HostApiProxyToken, error) {
59 | resp := &HostApiProxyToken{}
60 | err := c.rancherClient.doById(HOST_API_PROXY_TOKEN_TYPE, id, resp)
61 | if apiError, ok := err.(*ApiError); ok {
62 | if apiError.StatusCode == 404 {
63 | return nil, nil
64 | }
65 | }
66 | return resp, err
67 | }
68 |
69 | func (c *HostApiProxyTokenClient) Delete(container *HostApiProxyToken) error {
70 | return c.rancherClient.doResourceDelete(HOST_API_PROXY_TOKEN_TYPE, &container.Resource)
71 | }
72 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_identity.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | IDENTITY_TYPE = "identity"
5 | )
6 |
7 | type Identity struct {
8 | Resource
9 |
10 | All string `json:"all,omitempty" yaml:"all,omitempty"`
11 |
12 | ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"`
13 |
14 | ExternalIdType string `json:"externalIdType,omitempty" yaml:"external_id_type,omitempty"`
15 |
16 | Login string `json:"login,omitempty" yaml:"login,omitempty"`
17 |
18 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
19 |
20 | ProfilePicture string `json:"profilePicture,omitempty" yaml:"profile_picture,omitempty"`
21 |
22 | ProfileUrl string `json:"profileUrl,omitempty" yaml:"profile_url,omitempty"`
23 |
24 | ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"`
25 |
26 | Role string `json:"role,omitempty" yaml:"role,omitempty"`
27 | }
28 |
29 | type IdentityCollection struct {
30 | Collection
31 | Data []Identity `json:"data,omitempty"`
32 | }
33 |
34 | type IdentityClient struct {
35 | rancherClient *RancherClient
36 | }
37 |
38 | type IdentityOperations interface {
39 | List(opts *ListOpts) (*IdentityCollection, error)
40 | Create(opts *Identity) (*Identity, error)
41 | Update(existing *Identity, updates interface{}) (*Identity, error)
42 | ById(id string) (*Identity, error)
43 | Delete(container *Identity) error
44 | }
45 |
46 | func newIdentityClient(rancherClient *RancherClient) *IdentityClient {
47 | return &IdentityClient{
48 | rancherClient: rancherClient,
49 | }
50 | }
51 |
52 | func (c *IdentityClient) Create(container *Identity) (*Identity, error) {
53 | resp := &Identity{}
54 | err := c.rancherClient.doCreate(IDENTITY_TYPE, container, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *IdentityClient) Update(existing *Identity, updates interface{}) (*Identity, error) {
59 | resp := &Identity{}
60 | err := c.rancherClient.doUpdate(IDENTITY_TYPE, &existing.Resource, updates, resp)
61 | return resp, err
62 | }
63 |
64 | func (c *IdentityClient) List(opts *ListOpts) (*IdentityCollection, error) {
65 | resp := &IdentityCollection{}
66 | err := c.rancherClient.doList(IDENTITY_TYPE, opts, resp)
67 | return resp, err
68 | }
69 |
70 | func (c *IdentityClient) ById(id string) (*Identity, error) {
71 | resp := &Identity{}
72 | err := c.rancherClient.doById(IDENTITY_TYPE, id, resp)
73 | if apiError, ok := err.(*ApiError); ok {
74 | if apiError.StatusCode == 404 {
75 | return nil, nil
76 | }
77 | }
78 | return resp, err
79 | }
80 |
81 | func (c *IdentityClient) Delete(container *Identity) error {
82 | return c.rancherClient.doResourceDelete(IDENTITY_TYPE, &container.Resource)
83 | }
84 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_instance_console.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | INSTANCE_CONSOLE_TYPE = "instanceConsole"
5 | )
6 |
7 | type InstanceConsole struct {
8 | Resource
9 |
10 | Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
11 |
12 | Password string `json:"password,omitempty" yaml:"password,omitempty"`
13 |
14 | Url string `json:"url,omitempty" yaml:"url,omitempty"`
15 | }
16 |
17 | type InstanceConsoleCollection struct {
18 | Collection
19 | Data []InstanceConsole `json:"data,omitempty"`
20 | }
21 |
22 | type InstanceConsoleClient struct {
23 | rancherClient *RancherClient
24 | }
25 |
26 | type InstanceConsoleOperations interface {
27 | List(opts *ListOpts) (*InstanceConsoleCollection, error)
28 | Create(opts *InstanceConsole) (*InstanceConsole, error)
29 | Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error)
30 | ById(id string) (*InstanceConsole, error)
31 | Delete(container *InstanceConsole) error
32 | }
33 |
34 | func newInstanceConsoleClient(rancherClient *RancherClient) *InstanceConsoleClient {
35 | return &InstanceConsoleClient{
36 | rancherClient: rancherClient,
37 | }
38 | }
39 |
40 | func (c *InstanceConsoleClient) Create(container *InstanceConsole) (*InstanceConsole, error) {
41 | resp := &InstanceConsole{}
42 | err := c.rancherClient.doCreate(INSTANCE_CONSOLE_TYPE, container, resp)
43 | return resp, err
44 | }
45 |
46 | func (c *InstanceConsoleClient) Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error) {
47 | resp := &InstanceConsole{}
48 | err := c.rancherClient.doUpdate(INSTANCE_CONSOLE_TYPE, &existing.Resource, updates, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *InstanceConsoleClient) List(opts *ListOpts) (*InstanceConsoleCollection, error) {
53 | resp := &InstanceConsoleCollection{}
54 | err := c.rancherClient.doList(INSTANCE_CONSOLE_TYPE, opts, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *InstanceConsoleClient) ById(id string) (*InstanceConsole, error) {
59 | resp := &InstanceConsole{}
60 | err := c.rancherClient.doById(INSTANCE_CONSOLE_TYPE, id, resp)
61 | if apiError, ok := err.(*ApiError); ok {
62 | if apiError.StatusCode == 404 {
63 | return nil, nil
64 | }
65 | }
66 | return resp, err
67 | }
68 |
69 | func (c *InstanceConsoleClient) Delete(container *InstanceConsole) error {
70 | return c.rancherClient.doResourceDelete(INSTANCE_CONSOLE_TYPE, &container.Resource)
71 | }
72 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_instance_console_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | INSTANCE_CONSOLE_INPUT_TYPE = "instanceConsoleInput"
5 | )
6 |
7 | type InstanceConsoleInput struct {
8 | Resource
9 | }
10 |
11 | type InstanceConsoleInputCollection struct {
12 | Collection
13 | Data []InstanceConsoleInput `json:"data,omitempty"`
14 | }
15 |
16 | type InstanceConsoleInputClient struct {
17 | rancherClient *RancherClient
18 | }
19 |
20 | type InstanceConsoleInputOperations interface {
21 | List(opts *ListOpts) (*InstanceConsoleInputCollection, error)
22 | Create(opts *InstanceConsoleInput) (*InstanceConsoleInput, error)
23 | Update(existing *InstanceConsoleInput, updates interface{}) (*InstanceConsoleInput, error)
24 | ById(id string) (*InstanceConsoleInput, error)
25 | Delete(container *InstanceConsoleInput) error
26 | }
27 |
28 | func newInstanceConsoleInputClient(rancherClient *RancherClient) *InstanceConsoleInputClient {
29 | return &InstanceConsoleInputClient{
30 | rancherClient: rancherClient,
31 | }
32 | }
33 |
34 | func (c *InstanceConsoleInputClient) Create(container *InstanceConsoleInput) (*InstanceConsoleInput, error) {
35 | resp := &InstanceConsoleInput{}
36 | err := c.rancherClient.doCreate(INSTANCE_CONSOLE_INPUT_TYPE, container, resp)
37 | return resp, err
38 | }
39 |
40 | func (c *InstanceConsoleInputClient) Update(existing *InstanceConsoleInput, updates interface{}) (*InstanceConsoleInput, error) {
41 | resp := &InstanceConsoleInput{}
42 | err := c.rancherClient.doUpdate(INSTANCE_CONSOLE_INPUT_TYPE, &existing.Resource, updates, resp)
43 | return resp, err
44 | }
45 |
46 | func (c *InstanceConsoleInputClient) List(opts *ListOpts) (*InstanceConsoleInputCollection, error) {
47 | resp := &InstanceConsoleInputCollection{}
48 | err := c.rancherClient.doList(INSTANCE_CONSOLE_INPUT_TYPE, opts, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *InstanceConsoleInputClient) ById(id string) (*InstanceConsoleInput, error) {
53 | resp := &InstanceConsoleInput{}
54 | err := c.rancherClient.doById(INSTANCE_CONSOLE_INPUT_TYPE, id, resp)
55 | if apiError, ok := err.(*ApiError); ok {
56 | if apiError.StatusCode == 404 {
57 | return nil, nil
58 | }
59 | }
60 | return resp, err
61 | }
62 |
63 | func (c *InstanceConsoleInputClient) Delete(container *InstanceConsoleInput) error {
64 | return c.rancherClient.doResourceDelete(INSTANCE_CONSOLE_INPUT_TYPE, &container.Resource)
65 | }
66 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_instance_stop.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | INSTANCE_STOP_TYPE = "instanceStop"
5 | )
6 |
7 | type InstanceStop struct {
8 | Resource
9 |
10 | Remove bool `json:"remove,omitempty" yaml:"remove,omitempty"`
11 |
12 | Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"`
13 | }
14 |
15 | type InstanceStopCollection struct {
16 | Collection
17 | Data []InstanceStop `json:"data,omitempty"`
18 | }
19 |
20 | type InstanceStopClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type InstanceStopOperations interface {
25 | List(opts *ListOpts) (*InstanceStopCollection, error)
26 | Create(opts *InstanceStop) (*InstanceStop, error)
27 | Update(existing *InstanceStop, updates interface{}) (*InstanceStop, error)
28 | ById(id string) (*InstanceStop, error)
29 | Delete(container *InstanceStop) error
30 | }
31 |
32 | func newInstanceStopClient(rancherClient *RancherClient) *InstanceStopClient {
33 | return &InstanceStopClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *InstanceStopClient) Create(container *InstanceStop) (*InstanceStop, error) {
39 | resp := &InstanceStop{}
40 | err := c.rancherClient.doCreate(INSTANCE_STOP_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *InstanceStopClient) Update(existing *InstanceStop, updates interface{}) (*InstanceStop, error) {
45 | resp := &InstanceStop{}
46 | err := c.rancherClient.doUpdate(INSTANCE_STOP_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *InstanceStopClient) List(opts *ListOpts) (*InstanceStopCollection, error) {
51 | resp := &InstanceStopCollection{}
52 | err := c.rancherClient.doList(INSTANCE_STOP_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *InstanceStopClient) ById(id string) (*InstanceStop, error) {
57 | resp := &InstanceStop{}
58 | err := c.rancherClient.doById(INSTANCE_STOP_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *InstanceStopClient) Delete(container *InstanceStop) error {
68 | return c.rancherClient.doResourceDelete(INSTANCE_STOP_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_ip_address_associate_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | IP_ADDRESS_ASSOCIATE_INPUT_TYPE = "ipAddressAssociateInput"
5 | )
6 |
7 | type IpAddressAssociateInput struct {
8 | Resource
9 |
10 | IpAddressId string `json:"ipAddressId,omitempty" yaml:"ip_address_id,omitempty"`
11 | }
12 |
13 | type IpAddressAssociateInputCollection struct {
14 | Collection
15 | Data []IpAddressAssociateInput `json:"data,omitempty"`
16 | }
17 |
18 | type IpAddressAssociateInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type IpAddressAssociateInputOperations interface {
23 | List(opts *ListOpts) (*IpAddressAssociateInputCollection, error)
24 | Create(opts *IpAddressAssociateInput) (*IpAddressAssociateInput, error)
25 | Update(existing *IpAddressAssociateInput, updates interface{}) (*IpAddressAssociateInput, error)
26 | ById(id string) (*IpAddressAssociateInput, error)
27 | Delete(container *IpAddressAssociateInput) error
28 | }
29 |
30 | func newIpAddressAssociateInputClient(rancherClient *RancherClient) *IpAddressAssociateInputClient {
31 | return &IpAddressAssociateInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *IpAddressAssociateInputClient) Create(container *IpAddressAssociateInput) (*IpAddressAssociateInput, error) {
37 | resp := &IpAddressAssociateInput{}
38 | err := c.rancherClient.doCreate(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *IpAddressAssociateInputClient) Update(existing *IpAddressAssociateInput, updates interface{}) (*IpAddressAssociateInput, error) {
43 | resp := &IpAddressAssociateInput{}
44 | err := c.rancherClient.doUpdate(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *IpAddressAssociateInputClient) List(opts *ListOpts) (*IpAddressAssociateInputCollection, error) {
49 | resp := &IpAddressAssociateInputCollection{}
50 | err := c.rancherClient.doList(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *IpAddressAssociateInputClient) ById(id string) (*IpAddressAssociateInput, error) {
55 | resp := &IpAddressAssociateInput{}
56 | err := c.rancherClient.doById(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *IpAddressAssociateInputClient) Delete(container *IpAddressAssociateInput) error {
66 | return c.rancherClient.doResourceDelete(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_config.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | LOAD_BALANCER_CONFIG_TYPE = "loadBalancerConfig"
5 | )
6 |
7 | type LoadBalancerConfig struct {
8 | Resource
9 |
10 | HaproxyConfig *HaproxyConfig `json:"haproxyConfig,omitempty" yaml:"haproxy_config,omitempty"`
11 |
12 | LbCookieStickinessPolicy *LoadBalancerCookieStickinessPolicy `json:"lbCookieStickinessPolicy,omitempty" yaml:"lb_cookie_stickiness_policy,omitempty"`
13 | }
14 |
15 | type LoadBalancerConfigCollection struct {
16 | Collection
17 | Data []LoadBalancerConfig `json:"data,omitempty"`
18 | }
19 |
20 | type LoadBalancerConfigClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type LoadBalancerConfigOperations interface {
25 | List(opts *ListOpts) (*LoadBalancerConfigCollection, error)
26 | Create(opts *LoadBalancerConfig) (*LoadBalancerConfig, error)
27 | Update(existing *LoadBalancerConfig, updates interface{}) (*LoadBalancerConfig, error)
28 | ById(id string) (*LoadBalancerConfig, error)
29 | Delete(container *LoadBalancerConfig) error
30 | }
31 |
32 | func newLoadBalancerConfigClient(rancherClient *RancherClient) *LoadBalancerConfigClient {
33 | return &LoadBalancerConfigClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *LoadBalancerConfigClient) Create(container *LoadBalancerConfig) (*LoadBalancerConfig, error) {
39 | resp := &LoadBalancerConfig{}
40 | err := c.rancherClient.doCreate(LOAD_BALANCER_CONFIG_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *LoadBalancerConfigClient) Update(existing *LoadBalancerConfig, updates interface{}) (*LoadBalancerConfig, error) {
45 | resp := &LoadBalancerConfig{}
46 | err := c.rancherClient.doUpdate(LOAD_BALANCER_CONFIG_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *LoadBalancerConfigClient) List(opts *ListOpts) (*LoadBalancerConfigCollection, error) {
51 | resp := &LoadBalancerConfigCollection{}
52 | err := c.rancherClient.doList(LOAD_BALANCER_CONFIG_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *LoadBalancerConfigClient) ById(id string) (*LoadBalancerConfig, error) {
57 | resp := &LoadBalancerConfig{}
58 | err := c.rancherClient.doById(LOAD_BALANCER_CONFIG_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *LoadBalancerConfigClient) Delete(container *LoadBalancerConfig) error {
68 | return c.rancherClient.doResourceDelete(LOAD_BALANCER_CONFIG_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service_link.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | LOAD_BALANCER_SERVICE_LINK_TYPE = "loadBalancerServiceLink"
5 | )
6 |
7 | type LoadBalancerServiceLink struct {
8 | Resource
9 |
10 | Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"`
11 |
12 | ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"`
13 |
14 | Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
15 | }
16 |
17 | type LoadBalancerServiceLinkCollection struct {
18 | Collection
19 | Data []LoadBalancerServiceLink `json:"data,omitempty"`
20 | }
21 |
22 | type LoadBalancerServiceLinkClient struct {
23 | rancherClient *RancherClient
24 | }
25 |
26 | type LoadBalancerServiceLinkOperations interface {
27 | List(opts *ListOpts) (*LoadBalancerServiceLinkCollection, error)
28 | Create(opts *LoadBalancerServiceLink) (*LoadBalancerServiceLink, error)
29 | Update(existing *LoadBalancerServiceLink, updates interface{}) (*LoadBalancerServiceLink, error)
30 | ById(id string) (*LoadBalancerServiceLink, error)
31 | Delete(container *LoadBalancerServiceLink) error
32 | }
33 |
34 | func newLoadBalancerServiceLinkClient(rancherClient *RancherClient) *LoadBalancerServiceLinkClient {
35 | return &LoadBalancerServiceLinkClient{
36 | rancherClient: rancherClient,
37 | }
38 | }
39 |
40 | func (c *LoadBalancerServiceLinkClient) Create(container *LoadBalancerServiceLink) (*LoadBalancerServiceLink, error) {
41 | resp := &LoadBalancerServiceLink{}
42 | err := c.rancherClient.doCreate(LOAD_BALANCER_SERVICE_LINK_TYPE, container, resp)
43 | return resp, err
44 | }
45 |
46 | func (c *LoadBalancerServiceLinkClient) Update(existing *LoadBalancerServiceLink, updates interface{}) (*LoadBalancerServiceLink, error) {
47 | resp := &LoadBalancerServiceLink{}
48 | err := c.rancherClient.doUpdate(LOAD_BALANCER_SERVICE_LINK_TYPE, &existing.Resource, updates, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *LoadBalancerServiceLinkClient) List(opts *ListOpts) (*LoadBalancerServiceLinkCollection, error) {
53 | resp := &LoadBalancerServiceLinkCollection{}
54 | err := c.rancherClient.doList(LOAD_BALANCER_SERVICE_LINK_TYPE, opts, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *LoadBalancerServiceLinkClient) ById(id string) (*LoadBalancerServiceLink, error) {
59 | resp := &LoadBalancerServiceLink{}
60 | err := c.rancherClient.doById(LOAD_BALANCER_SERVICE_LINK_TYPE, id, resp)
61 | if apiError, ok := err.(*ApiError); ok {
62 | if apiError.StatusCode == 404 {
63 | return nil, nil
64 | }
65 | }
66 | return resp, err
67 | }
68 |
69 | func (c *LoadBalancerServiceLinkClient) Delete(container *LoadBalancerServiceLink) error {
70 | return c.rancherClient.doResourceDelete(LOAD_BALANCER_SERVICE_LINK_TYPE, &container.Resource)
71 | }
72 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_local_auth_config.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | LOCAL_AUTH_CONFIG_TYPE = "localAuthConfig"
5 | )
6 |
7 | type LocalAuthConfig struct {
8 | Resource
9 |
10 | AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"`
11 |
12 | Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
13 |
14 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
15 |
16 | Password string `json:"password,omitempty" yaml:"password,omitempty"`
17 |
18 | Username string `json:"username,omitempty" yaml:"username,omitempty"`
19 | }
20 |
21 | type LocalAuthConfigCollection struct {
22 | Collection
23 | Data []LocalAuthConfig `json:"data,omitempty"`
24 | }
25 |
26 | type LocalAuthConfigClient struct {
27 | rancherClient *RancherClient
28 | }
29 |
30 | type LocalAuthConfigOperations interface {
31 | List(opts *ListOpts) (*LocalAuthConfigCollection, error)
32 | Create(opts *LocalAuthConfig) (*LocalAuthConfig, error)
33 | Update(existing *LocalAuthConfig, updates interface{}) (*LocalAuthConfig, error)
34 | ById(id string) (*LocalAuthConfig, error)
35 | Delete(container *LocalAuthConfig) error
36 | }
37 |
38 | func newLocalAuthConfigClient(rancherClient *RancherClient) *LocalAuthConfigClient {
39 | return &LocalAuthConfigClient{
40 | rancherClient: rancherClient,
41 | }
42 | }
43 |
44 | func (c *LocalAuthConfigClient) Create(container *LocalAuthConfig) (*LocalAuthConfig, error) {
45 | resp := &LocalAuthConfig{}
46 | err := c.rancherClient.doCreate(LOCAL_AUTH_CONFIG_TYPE, container, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *LocalAuthConfigClient) Update(existing *LocalAuthConfig, updates interface{}) (*LocalAuthConfig, error) {
51 | resp := &LocalAuthConfig{}
52 | err := c.rancherClient.doUpdate(LOCAL_AUTH_CONFIG_TYPE, &existing.Resource, updates, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *LocalAuthConfigClient) List(opts *ListOpts) (*LocalAuthConfigCollection, error) {
57 | resp := &LocalAuthConfigCollection{}
58 | err := c.rancherClient.doList(LOCAL_AUTH_CONFIG_TYPE, opts, resp)
59 | return resp, err
60 | }
61 |
62 | func (c *LocalAuthConfigClient) ById(id string) (*LocalAuthConfig, error) {
63 | resp := &LocalAuthConfig{}
64 | err := c.rancherClient.doById(LOCAL_AUTH_CONFIG_TYPE, id, resp)
65 | if apiError, ok := err.(*ApiError); ok {
66 | if apiError.StatusCode == 404 {
67 | return nil, nil
68 | }
69 | }
70 | return resp, err
71 | }
72 |
73 | func (c *LocalAuthConfigClient) Delete(container *LocalAuthConfig) error {
74 | return c.rancherClient.doResourceDelete(LOCAL_AUTH_CONFIG_TYPE, &container.Resource)
75 | }
76 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_log_config.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | LOG_CONFIG_TYPE = "logConfig"
5 | )
6 |
7 | type LogConfig struct {
8 | Resource
9 |
10 | Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"`
11 |
12 | Driver string `json:"driver,omitempty" yaml:"driver,omitempty"`
13 | }
14 |
15 | type LogConfigCollection struct {
16 | Collection
17 | Data []LogConfig `json:"data,omitempty"`
18 | }
19 |
20 | type LogConfigClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type LogConfigOperations interface {
25 | List(opts *ListOpts) (*LogConfigCollection, error)
26 | Create(opts *LogConfig) (*LogConfig, error)
27 | Update(existing *LogConfig, updates interface{}) (*LogConfig, error)
28 | ById(id string) (*LogConfig, error)
29 | Delete(container *LogConfig) error
30 | }
31 |
32 | func newLogConfigClient(rancherClient *RancherClient) *LogConfigClient {
33 | return &LogConfigClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *LogConfigClient) Create(container *LogConfig) (*LogConfig, error) {
39 | resp := &LogConfig{}
40 | err := c.rancherClient.doCreate(LOG_CONFIG_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *LogConfigClient) Update(existing *LogConfig, updates interface{}) (*LogConfig, error) {
45 | resp := &LogConfig{}
46 | err := c.rancherClient.doUpdate(LOG_CONFIG_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *LogConfigClient) List(opts *ListOpts) (*LogConfigCollection, error) {
51 | resp := &LogConfigCollection{}
52 | err := c.rancherClient.doList(LOG_CONFIG_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *LogConfigClient) ById(id string) (*LogConfig, error) {
57 | resp := &LogConfig{}
58 | err := c.rancherClient.doById(LOG_CONFIG_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *LogConfigClient) Delete(container *LogConfig) error {
68 | return c.rancherClient.doResourceDelete(LOG_CONFIG_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_machine_driver_error_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | MACHINE_DRIVER_ERROR_INPUT_TYPE = "machineDriverErrorInput"
5 | )
6 |
7 | type MachineDriverErrorInput struct {
8 | Resource
9 |
10 | ErrorMessage string `json:"errorMessage,omitempty" yaml:"error_message,omitempty"`
11 | }
12 |
13 | type MachineDriverErrorInputCollection struct {
14 | Collection
15 | Data []MachineDriverErrorInput `json:"data,omitempty"`
16 | }
17 |
18 | type MachineDriverErrorInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type MachineDriverErrorInputOperations interface {
23 | List(opts *ListOpts) (*MachineDriverErrorInputCollection, error)
24 | Create(opts *MachineDriverErrorInput) (*MachineDriverErrorInput, error)
25 | Update(existing *MachineDriverErrorInput, updates interface{}) (*MachineDriverErrorInput, error)
26 | ById(id string) (*MachineDriverErrorInput, error)
27 | Delete(container *MachineDriverErrorInput) error
28 | }
29 |
30 | func newMachineDriverErrorInputClient(rancherClient *RancherClient) *MachineDriverErrorInputClient {
31 | return &MachineDriverErrorInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *MachineDriverErrorInputClient) Create(container *MachineDriverErrorInput) (*MachineDriverErrorInput, error) {
37 | resp := &MachineDriverErrorInput{}
38 | err := c.rancherClient.doCreate(MACHINE_DRIVER_ERROR_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *MachineDriverErrorInputClient) Update(existing *MachineDriverErrorInput, updates interface{}) (*MachineDriverErrorInput, error) {
43 | resp := &MachineDriverErrorInput{}
44 | err := c.rancherClient.doUpdate(MACHINE_DRIVER_ERROR_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *MachineDriverErrorInputClient) List(opts *ListOpts) (*MachineDriverErrorInputCollection, error) {
49 | resp := &MachineDriverErrorInputCollection{}
50 | err := c.rancherClient.doList(MACHINE_DRIVER_ERROR_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *MachineDriverErrorInputClient) ById(id string) (*MachineDriverErrorInput, error) {
55 | resp := &MachineDriverErrorInput{}
56 | err := c.rancherClient.doById(MACHINE_DRIVER_ERROR_INPUT_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *MachineDriverErrorInputClient) Delete(container *MachineDriverErrorInput) error {
66 | return c.rancherClient.doResourceDelete(MACHINE_DRIVER_ERROR_INPUT_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_machine_driver_update_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | MACHINE_DRIVER_UPDATE_INPUT_TYPE = "machineDriverUpdateInput"
5 | )
6 |
7 | type MachineDriverUpdateInput struct {
8 | Resource
9 |
10 | Md5checksum string `json:"md5checksum,omitempty" yaml:"md5checksum,omitempty"`
11 |
12 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
13 |
14 | Uri string `json:"uri,omitempty" yaml:"uri,omitempty"`
15 | }
16 |
17 | type MachineDriverUpdateInputCollection struct {
18 | Collection
19 | Data []MachineDriverUpdateInput `json:"data,omitempty"`
20 | }
21 |
22 | type MachineDriverUpdateInputClient struct {
23 | rancherClient *RancherClient
24 | }
25 |
26 | type MachineDriverUpdateInputOperations interface {
27 | List(opts *ListOpts) (*MachineDriverUpdateInputCollection, error)
28 | Create(opts *MachineDriverUpdateInput) (*MachineDriverUpdateInput, error)
29 | Update(existing *MachineDriverUpdateInput, updates interface{}) (*MachineDriverUpdateInput, error)
30 | ById(id string) (*MachineDriverUpdateInput, error)
31 | Delete(container *MachineDriverUpdateInput) error
32 | }
33 |
34 | func newMachineDriverUpdateInputClient(rancherClient *RancherClient) *MachineDriverUpdateInputClient {
35 | return &MachineDriverUpdateInputClient{
36 | rancherClient: rancherClient,
37 | }
38 | }
39 |
40 | func (c *MachineDriverUpdateInputClient) Create(container *MachineDriverUpdateInput) (*MachineDriverUpdateInput, error) {
41 | resp := &MachineDriverUpdateInput{}
42 | err := c.rancherClient.doCreate(MACHINE_DRIVER_UPDATE_INPUT_TYPE, container, resp)
43 | return resp, err
44 | }
45 |
46 | func (c *MachineDriverUpdateInputClient) Update(existing *MachineDriverUpdateInput, updates interface{}) (*MachineDriverUpdateInput, error) {
47 | resp := &MachineDriverUpdateInput{}
48 | err := c.rancherClient.doUpdate(MACHINE_DRIVER_UPDATE_INPUT_TYPE, &existing.Resource, updates, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *MachineDriverUpdateInputClient) List(opts *ListOpts) (*MachineDriverUpdateInputCollection, error) {
53 | resp := &MachineDriverUpdateInputCollection{}
54 | err := c.rancherClient.doList(MACHINE_DRIVER_UPDATE_INPUT_TYPE, opts, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *MachineDriverUpdateInputClient) ById(id string) (*MachineDriverUpdateInput, error) {
59 | resp := &MachineDriverUpdateInput{}
60 | err := c.rancherClient.doById(MACHINE_DRIVER_UPDATE_INPUT_TYPE, id, resp)
61 | if apiError, ok := err.(*ApiError); ok {
62 | if apiError.StatusCode == 404 {
63 | return nil, nil
64 | }
65 | }
66 | return resp, err
67 | }
68 |
69 | func (c *MachineDriverUpdateInputClient) Delete(container *MachineDriverUpdateInput) error {
70 | return c.rancherClient.doResourceDelete(MACHINE_DRIVER_UPDATE_INPUT_TYPE, &container.Resource)
71 | }
72 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_packet_config.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | PACKET_CONFIG_TYPE = "packetConfig"
5 | )
6 |
7 | type PacketConfig struct {
8 | Resource
9 |
10 | ApiKey string `json:"apiKey,omitempty" yaml:"api_key,omitempty"`
11 |
12 | BillingCycle string `json:"billingCycle,omitempty" yaml:"billing_cycle,omitempty"`
13 |
14 | FacilityCode string `json:"facilityCode,omitempty" yaml:"facility_code,omitempty"`
15 |
16 | Os string `json:"os,omitempty" yaml:"os,omitempty"`
17 |
18 | Plan string `json:"plan,omitempty" yaml:"plan,omitempty"`
19 |
20 | ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"`
21 | }
22 |
23 | type PacketConfigCollection struct {
24 | Collection
25 | Data []PacketConfig `json:"data,omitempty"`
26 | }
27 |
28 | type PacketConfigClient struct {
29 | rancherClient *RancherClient
30 | }
31 |
32 | type PacketConfigOperations interface {
33 | List(opts *ListOpts) (*PacketConfigCollection, error)
34 | Create(opts *PacketConfig) (*PacketConfig, error)
35 | Update(existing *PacketConfig, updates interface{}) (*PacketConfig, error)
36 | ById(id string) (*PacketConfig, error)
37 | Delete(container *PacketConfig) error
38 | }
39 |
40 | func newPacketConfigClient(rancherClient *RancherClient) *PacketConfigClient {
41 | return &PacketConfigClient{
42 | rancherClient: rancherClient,
43 | }
44 | }
45 |
46 | func (c *PacketConfigClient) Create(container *PacketConfig) (*PacketConfig, error) {
47 | resp := &PacketConfig{}
48 | err := c.rancherClient.doCreate(PACKET_CONFIG_TYPE, container, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *PacketConfigClient) Update(existing *PacketConfig, updates interface{}) (*PacketConfig, error) {
53 | resp := &PacketConfig{}
54 | err := c.rancherClient.doUpdate(PACKET_CONFIG_TYPE, &existing.Resource, updates, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *PacketConfigClient) List(opts *ListOpts) (*PacketConfigCollection, error) {
59 | resp := &PacketConfigCollection{}
60 | err := c.rancherClient.doList(PACKET_CONFIG_TYPE, opts, resp)
61 | return resp, err
62 | }
63 |
64 | func (c *PacketConfigClient) ById(id string) (*PacketConfig, error) {
65 | resp := &PacketConfig{}
66 | err := c.rancherClient.doById(PACKET_CONFIG_TYPE, id, resp)
67 | if apiError, ok := err.(*ApiError); ok {
68 | if apiError.StatusCode == 404 {
69 | return nil, nil
70 | }
71 | }
72 | return resp, err
73 | }
74 |
75 | func (c *PacketConfigClient) Delete(container *PacketConfig) error {
76 | return c.rancherClient.doResourceDelete(PACKET_CONFIG_TYPE, &container.Resource)
77 | }
78 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_process_execution.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | PROCESS_EXECUTION_TYPE = "processExecution"
5 | )
6 |
7 | type ProcessExecution struct {
8 | Resource
9 |
10 | Created string `json:"created,omitempty" yaml:"created,omitempty"`
11 |
12 | Log map[string]interface{} `json:"log,omitempty" yaml:"log,omitempty"`
13 |
14 | ProcessInstanceId string `json:"processInstanceId,omitempty" yaml:"process_instance_id,omitempty"`
15 |
16 | Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
17 | }
18 |
19 | type ProcessExecutionCollection struct {
20 | Collection
21 | Data []ProcessExecution `json:"data,omitempty"`
22 | }
23 |
24 | type ProcessExecutionClient struct {
25 | rancherClient *RancherClient
26 | }
27 |
28 | type ProcessExecutionOperations interface {
29 | List(opts *ListOpts) (*ProcessExecutionCollection, error)
30 | Create(opts *ProcessExecution) (*ProcessExecution, error)
31 | Update(existing *ProcessExecution, updates interface{}) (*ProcessExecution, error)
32 | ById(id string) (*ProcessExecution, error)
33 | Delete(container *ProcessExecution) error
34 | }
35 |
36 | func newProcessExecutionClient(rancherClient *RancherClient) *ProcessExecutionClient {
37 | return &ProcessExecutionClient{
38 | rancherClient: rancherClient,
39 | }
40 | }
41 |
42 | func (c *ProcessExecutionClient) Create(container *ProcessExecution) (*ProcessExecution, error) {
43 | resp := &ProcessExecution{}
44 | err := c.rancherClient.doCreate(PROCESS_EXECUTION_TYPE, container, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *ProcessExecutionClient) Update(existing *ProcessExecution, updates interface{}) (*ProcessExecution, error) {
49 | resp := &ProcessExecution{}
50 | err := c.rancherClient.doUpdate(PROCESS_EXECUTION_TYPE, &existing.Resource, updates, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *ProcessExecutionClient) List(opts *ListOpts) (*ProcessExecutionCollection, error) {
55 | resp := &ProcessExecutionCollection{}
56 | err := c.rancherClient.doList(PROCESS_EXECUTION_TYPE, opts, resp)
57 | return resp, err
58 | }
59 |
60 | func (c *ProcessExecutionClient) ById(id string) (*ProcessExecution, error) {
61 | resp := &ProcessExecution{}
62 | err := c.rancherClient.doById(PROCESS_EXECUTION_TYPE, id, resp)
63 | if apiError, ok := err.(*ApiError); ok {
64 | if apiError.StatusCode == 404 {
65 | return nil, nil
66 | }
67 | }
68 | return resp, err
69 | }
70 |
71 | func (c *ProcessExecutionClient) Delete(container *ProcessExecution) error {
72 | return c.rancherClient.doResourceDelete(PROCESS_EXECUTION_TYPE, &container.Resource)
73 | }
74 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_public_endpoint.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | PUBLIC_ENDPOINT_TYPE = "publicEndpoint"
5 | )
6 |
7 | type PublicEndpoint struct {
8 | Resource
9 |
10 | HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"`
11 |
12 | InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"`
13 |
14 | IpAddress string `json:"ipAddress,omitempty" yaml:"ip_address,omitempty"`
15 |
16 | Port int64 `json:"port,omitempty" yaml:"port,omitempty"`
17 |
18 | ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"`
19 | }
20 |
21 | type PublicEndpointCollection struct {
22 | Collection
23 | Data []PublicEndpoint `json:"data,omitempty"`
24 | }
25 |
26 | type PublicEndpointClient struct {
27 | rancherClient *RancherClient
28 | }
29 |
30 | type PublicEndpointOperations interface {
31 | List(opts *ListOpts) (*PublicEndpointCollection, error)
32 | Create(opts *PublicEndpoint) (*PublicEndpoint, error)
33 | Update(existing *PublicEndpoint, updates interface{}) (*PublicEndpoint, error)
34 | ById(id string) (*PublicEndpoint, error)
35 | Delete(container *PublicEndpoint) error
36 | }
37 |
38 | func newPublicEndpointClient(rancherClient *RancherClient) *PublicEndpointClient {
39 | return &PublicEndpointClient{
40 | rancherClient: rancherClient,
41 | }
42 | }
43 |
44 | func (c *PublicEndpointClient) Create(container *PublicEndpoint) (*PublicEndpoint, error) {
45 | resp := &PublicEndpoint{}
46 | err := c.rancherClient.doCreate(PUBLIC_ENDPOINT_TYPE, container, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *PublicEndpointClient) Update(existing *PublicEndpoint, updates interface{}) (*PublicEndpoint, error) {
51 | resp := &PublicEndpoint{}
52 | err := c.rancherClient.doUpdate(PUBLIC_ENDPOINT_TYPE, &existing.Resource, updates, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *PublicEndpointClient) List(opts *ListOpts) (*PublicEndpointCollection, error) {
57 | resp := &PublicEndpointCollection{}
58 | err := c.rancherClient.doList(PUBLIC_ENDPOINT_TYPE, opts, resp)
59 | return resp, err
60 | }
61 |
62 | func (c *PublicEndpointClient) ById(id string) (*PublicEndpoint, error) {
63 | resp := &PublicEndpoint{}
64 | err := c.rancherClient.doById(PUBLIC_ENDPOINT_TYPE, id, resp)
65 | if apiError, ok := err.(*ApiError); ok {
66 | if apiError.StatusCode == 404 {
67 | return nil, nil
68 | }
69 | }
70 | return resp, err
71 | }
72 |
73 | func (c *PublicEndpointClient) Delete(container *PublicEndpoint) error {
74 | return c.rancherClient.doResourceDelete(PUBLIC_ENDPOINT_TYPE, &container.Resource)
75 | }
76 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_remove_label_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | REMOVE_LABEL_INPUT_TYPE = "removeLabelInput"
5 | )
6 |
7 | type RemoveLabelInput struct {
8 | Resource
9 |
10 | Label string `json:"label,omitempty"`
11 | }
12 |
13 | type RemoveLabelInputCollection struct {
14 | Collection
15 | Data []RemoveLabelInput `json:"data,omitempty"`
16 | }
17 |
18 | type RemoveLabelInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type RemoveLabelInputOperations interface {
23 | List(opts *ListOpts) (*RemoveLabelInputCollection, error)
24 | Create(opts *RemoveLabelInput) (*RemoveLabelInput, error)
25 | Update(existing *RemoveLabelInput, updates interface{}) (*RemoveLabelInput, error)
26 | ById(id string) (*RemoveLabelInput, error)
27 | Delete(container *RemoveLabelInput) error
28 | }
29 |
30 | func newRemoveLabelInputClient(rancherClient *RancherClient) *RemoveLabelInputClient {
31 | return &RemoveLabelInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *RemoveLabelInputClient) Create(container *RemoveLabelInput) (*RemoveLabelInput, error) {
37 | resp := &RemoveLabelInput{}
38 | err := c.rancherClient.doCreate(REMOVE_LABEL_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *RemoveLabelInputClient) Update(existing *RemoveLabelInput, updates interface{}) (*RemoveLabelInput, error) {
43 | resp := &RemoveLabelInput{}
44 | err := c.rancherClient.doUpdate(REMOVE_LABEL_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *RemoveLabelInputClient) List(opts *ListOpts) (*RemoveLabelInputCollection, error) {
49 | resp := &RemoveLabelInputCollection{}
50 | err := c.rancherClient.doList(REMOVE_LABEL_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *RemoveLabelInputClient) ById(id string) (*RemoveLabelInput, error) {
55 | resp := &RemoveLabelInput{}
56 | err := c.rancherClient.doById(REMOVE_LABEL_INPUT_TYPE, id, resp)
57 | return resp, err
58 | }
59 |
60 | func (c *RemoveLabelInputClient) Delete(container *RemoveLabelInput) error {
61 | return c.rancherClient.doResourceDelete(REMOVE_LABEL_INPUT_TYPE, &container.Resource)
62 | }
63 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_remove_load_balancer_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | REMOVE_LOAD_BALANCER_INPUT_TYPE = "removeLoadBalancerInput"
5 | )
6 |
7 | type RemoveLoadBalancerInput struct {
8 | Resource
9 |
10 | LoadBalancerId string `json:"loadBalancerId,omitempty" yaml:"load_balancer_id,omitempty"`
11 | }
12 |
13 | type RemoveLoadBalancerInputCollection struct {
14 | Collection
15 | Data []RemoveLoadBalancerInput `json:"data,omitempty"`
16 | }
17 |
18 | type RemoveLoadBalancerInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type RemoveLoadBalancerInputOperations interface {
23 | List(opts *ListOpts) (*RemoveLoadBalancerInputCollection, error)
24 | Create(opts *RemoveLoadBalancerInput) (*RemoveLoadBalancerInput, error)
25 | Update(existing *RemoveLoadBalancerInput, updates interface{}) (*RemoveLoadBalancerInput, error)
26 | ById(id string) (*RemoveLoadBalancerInput, error)
27 | Delete(container *RemoveLoadBalancerInput) error
28 | }
29 |
30 | func newRemoveLoadBalancerInputClient(rancherClient *RancherClient) *RemoveLoadBalancerInputClient {
31 | return &RemoveLoadBalancerInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *RemoveLoadBalancerInputClient) Create(container *RemoveLoadBalancerInput) (*RemoveLoadBalancerInput, error) {
37 | resp := &RemoveLoadBalancerInput{}
38 | err := c.rancherClient.doCreate(REMOVE_LOAD_BALANCER_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *RemoveLoadBalancerInputClient) Update(existing *RemoveLoadBalancerInput, updates interface{}) (*RemoveLoadBalancerInput, error) {
43 | resp := &RemoveLoadBalancerInput{}
44 | err := c.rancherClient.doUpdate(REMOVE_LOAD_BALANCER_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *RemoveLoadBalancerInputClient) List(opts *ListOpts) (*RemoveLoadBalancerInputCollection, error) {
49 | resp := &RemoveLoadBalancerInputCollection{}
50 | err := c.rancherClient.doList(REMOVE_LOAD_BALANCER_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *RemoveLoadBalancerInputClient) ById(id string) (*RemoveLoadBalancerInput, error) {
55 | resp := &RemoveLoadBalancerInput{}
56 | err := c.rancherClient.doById(REMOVE_LOAD_BALANCER_INPUT_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *RemoveLoadBalancerInputClient) Delete(container *RemoveLoadBalancerInput) error {
66 | return c.rancherClient.doResourceDelete(REMOVE_LOAD_BALANCER_INPUT_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_resource_definition.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | RESOURCE_DEFINITION_TYPE = "resourceDefinition"
5 | )
6 |
7 | type ResourceDefinition struct {
8 | Resource
9 |
10 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
11 | }
12 |
13 | type ResourceDefinitionCollection struct {
14 | Collection
15 | Data []ResourceDefinition `json:"data,omitempty"`
16 | }
17 |
18 | type ResourceDefinitionClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type ResourceDefinitionOperations interface {
23 | List(opts *ListOpts) (*ResourceDefinitionCollection, error)
24 | Create(opts *ResourceDefinition) (*ResourceDefinition, error)
25 | Update(existing *ResourceDefinition, updates interface{}) (*ResourceDefinition, error)
26 | ById(id string) (*ResourceDefinition, error)
27 | Delete(container *ResourceDefinition) error
28 | }
29 |
30 | func newResourceDefinitionClient(rancherClient *RancherClient) *ResourceDefinitionClient {
31 | return &ResourceDefinitionClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *ResourceDefinitionClient) Create(container *ResourceDefinition) (*ResourceDefinition, error) {
37 | resp := &ResourceDefinition{}
38 | err := c.rancherClient.doCreate(RESOURCE_DEFINITION_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *ResourceDefinitionClient) Update(existing *ResourceDefinition, updates interface{}) (*ResourceDefinition, error) {
43 | resp := &ResourceDefinition{}
44 | err := c.rancherClient.doUpdate(RESOURCE_DEFINITION_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *ResourceDefinitionClient) List(opts *ListOpts) (*ResourceDefinitionCollection, error) {
49 | resp := &ResourceDefinitionCollection{}
50 | err := c.rancherClient.doList(RESOURCE_DEFINITION_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *ResourceDefinitionClient) ById(id string) (*ResourceDefinition, error) {
55 | resp := &ResourceDefinition{}
56 | err := c.rancherClient.doById(RESOURCE_DEFINITION_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *ResourceDefinitionClient) Delete(container *ResourceDefinition) error {
66 | return c.rancherClient.doResourceDelete(RESOURCE_DEFINITION_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_restart_policy.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | RESTART_POLICY_TYPE = "restartPolicy"
5 | )
6 |
7 | type RestartPolicy struct {
8 | Resource
9 |
10 | MaximumRetryCount int64 `json:"maximumRetryCount,omitempty" yaml:"maximum_retry_count,omitempty"`
11 |
12 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
13 | }
14 |
15 | type RestartPolicyCollection struct {
16 | Collection
17 | Data []RestartPolicy `json:"data,omitempty"`
18 | }
19 |
20 | type RestartPolicyClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type RestartPolicyOperations interface {
25 | List(opts *ListOpts) (*RestartPolicyCollection, error)
26 | Create(opts *RestartPolicy) (*RestartPolicy, error)
27 | Update(existing *RestartPolicy, updates interface{}) (*RestartPolicy, error)
28 | ById(id string) (*RestartPolicy, error)
29 | Delete(container *RestartPolicy) error
30 | }
31 |
32 | func newRestartPolicyClient(rancherClient *RancherClient) *RestartPolicyClient {
33 | return &RestartPolicyClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *RestartPolicyClient) Create(container *RestartPolicy) (*RestartPolicy, error) {
39 | resp := &RestartPolicy{}
40 | err := c.rancherClient.doCreate(RESTART_POLICY_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *RestartPolicyClient) Update(existing *RestartPolicy, updates interface{}) (*RestartPolicy, error) {
45 | resp := &RestartPolicy{}
46 | err := c.rancherClient.doUpdate(RESTART_POLICY_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *RestartPolicyClient) List(opts *ListOpts) (*RestartPolicyCollection, error) {
51 | resp := &RestartPolicyCollection{}
52 | err := c.rancherClient.doList(RESTART_POLICY_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *RestartPolicyClient) ById(id string) (*RestartPolicy, error) {
57 | resp := &RestartPolicy{}
58 | err := c.rancherClient.doById(RESTART_POLICY_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *RestartPolicyClient) Delete(container *RestartPolicy) error {
68 | return c.rancherClient.doResourceDelete(RESTART_POLICY_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_rolling_restart_strategy.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | ROLLING_RESTART_STRATEGY_TYPE = "rollingRestartStrategy"
5 | )
6 |
7 | type RollingRestartStrategy struct {
8 | Resource
9 |
10 | BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"`
11 |
12 | IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"`
13 | }
14 |
15 | type RollingRestartStrategyCollection struct {
16 | Collection
17 | Data []RollingRestartStrategy `json:"data,omitempty"`
18 | }
19 |
20 | type RollingRestartStrategyClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type RollingRestartStrategyOperations interface {
25 | List(opts *ListOpts) (*RollingRestartStrategyCollection, error)
26 | Create(opts *RollingRestartStrategy) (*RollingRestartStrategy, error)
27 | Update(existing *RollingRestartStrategy, updates interface{}) (*RollingRestartStrategy, error)
28 | ById(id string) (*RollingRestartStrategy, error)
29 | Delete(container *RollingRestartStrategy) error
30 | }
31 |
32 | func newRollingRestartStrategyClient(rancherClient *RancherClient) *RollingRestartStrategyClient {
33 | return &RollingRestartStrategyClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *RollingRestartStrategyClient) Create(container *RollingRestartStrategy) (*RollingRestartStrategy, error) {
39 | resp := &RollingRestartStrategy{}
40 | err := c.rancherClient.doCreate(ROLLING_RESTART_STRATEGY_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *RollingRestartStrategyClient) Update(existing *RollingRestartStrategy, updates interface{}) (*RollingRestartStrategy, error) {
45 | resp := &RollingRestartStrategy{}
46 | err := c.rancherClient.doUpdate(ROLLING_RESTART_STRATEGY_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *RollingRestartStrategyClient) List(opts *ListOpts) (*RollingRestartStrategyCollection, error) {
51 | resp := &RollingRestartStrategyCollection{}
52 | err := c.rancherClient.doList(ROLLING_RESTART_STRATEGY_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *RollingRestartStrategyClient) ById(id string) (*RollingRestartStrategy, error) {
57 | resp := &RollingRestartStrategy{}
58 | err := c.rancherClient.doById(ROLLING_RESTART_STRATEGY_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *RollingRestartStrategyClient) Delete(container *RollingRestartStrategy) error {
68 | return c.rancherClient.doResourceDelete(ROLLING_RESTART_STRATEGY_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_service_link.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SERVICE_LINK_TYPE = "serviceLink"
5 | )
6 |
7 | type ServiceLink struct {
8 | Resource
9 |
10 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
11 |
12 | ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"`
13 |
14 | Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
15 | }
16 |
17 | type ServiceLinkCollection struct {
18 | Collection
19 | Data []ServiceLink `json:"data,omitempty"`
20 | }
21 |
22 | type ServiceLinkClient struct {
23 | rancherClient *RancherClient
24 | }
25 |
26 | type ServiceLinkOperations interface {
27 | List(opts *ListOpts) (*ServiceLinkCollection, error)
28 | Create(opts *ServiceLink) (*ServiceLink, error)
29 | Update(existing *ServiceLink, updates interface{}) (*ServiceLink, error)
30 | ById(id string) (*ServiceLink, error)
31 | Delete(container *ServiceLink) error
32 | }
33 |
34 | func newServiceLinkClient(rancherClient *RancherClient) *ServiceLinkClient {
35 | return &ServiceLinkClient{
36 | rancherClient: rancherClient,
37 | }
38 | }
39 |
40 | func (c *ServiceLinkClient) Create(container *ServiceLink) (*ServiceLink, error) {
41 | resp := &ServiceLink{}
42 | err := c.rancherClient.doCreate(SERVICE_LINK_TYPE, container, resp)
43 | return resp, err
44 | }
45 |
46 | func (c *ServiceLinkClient) Update(existing *ServiceLink, updates interface{}) (*ServiceLink, error) {
47 | resp := &ServiceLink{}
48 | err := c.rancherClient.doUpdate(SERVICE_LINK_TYPE, &existing.Resource, updates, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *ServiceLinkClient) List(opts *ListOpts) (*ServiceLinkCollection, error) {
53 | resp := &ServiceLinkCollection{}
54 | err := c.rancherClient.doList(SERVICE_LINK_TYPE, opts, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *ServiceLinkClient) ById(id string) (*ServiceLink, error) {
59 | resp := &ServiceLink{}
60 | err := c.rancherClient.doById(SERVICE_LINK_TYPE, id, resp)
61 | if apiError, ok := err.(*ApiError); ok {
62 | if apiError.StatusCode == 404 {
63 | return nil, nil
64 | }
65 | }
66 | return resp, err
67 | }
68 |
69 | func (c *ServiceLinkClient) Delete(container *ServiceLink) error {
70 | return c.rancherClient.doResourceDelete(SERVICE_LINK_TYPE, &container.Resource)
71 | }
72 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_service_proxy.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SERVICE_PROXY_TYPE = "serviceProxy"
5 | )
6 |
7 | type ServiceProxy struct {
8 | Resource
9 |
10 | Port int64 `json:"port,omitempty" yaml:"port,omitempty"`
11 |
12 | Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
13 |
14 | Service string `json:"service,omitempty" yaml:"service,omitempty"`
15 |
16 | Token string `json:"token,omitempty" yaml:"token,omitempty"`
17 |
18 | Url string `json:"url,omitempty" yaml:"url,omitempty"`
19 | }
20 |
21 | type ServiceProxyCollection struct {
22 | Collection
23 | Data []ServiceProxy `json:"data,omitempty"`
24 | }
25 |
26 | type ServiceProxyClient struct {
27 | rancherClient *RancherClient
28 | }
29 |
30 | type ServiceProxyOperations interface {
31 | List(opts *ListOpts) (*ServiceProxyCollection, error)
32 | Create(opts *ServiceProxy) (*ServiceProxy, error)
33 | Update(existing *ServiceProxy, updates interface{}) (*ServiceProxy, error)
34 | ById(id string) (*ServiceProxy, error)
35 | Delete(container *ServiceProxy) error
36 | }
37 |
38 | func newServiceProxyClient(rancherClient *RancherClient) *ServiceProxyClient {
39 | return &ServiceProxyClient{
40 | rancherClient: rancherClient,
41 | }
42 | }
43 |
44 | func (c *ServiceProxyClient) Create(container *ServiceProxy) (*ServiceProxy, error) {
45 | resp := &ServiceProxy{}
46 | err := c.rancherClient.doCreate(SERVICE_PROXY_TYPE, container, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *ServiceProxyClient) Update(existing *ServiceProxy, updates interface{}) (*ServiceProxy, error) {
51 | resp := &ServiceProxy{}
52 | err := c.rancherClient.doUpdate(SERVICE_PROXY_TYPE, &existing.Resource, updates, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *ServiceProxyClient) List(opts *ListOpts) (*ServiceProxyCollection, error) {
57 | resp := &ServiceProxyCollection{}
58 | err := c.rancherClient.doList(SERVICE_PROXY_TYPE, opts, resp)
59 | return resp, err
60 | }
61 |
62 | func (c *ServiceProxyClient) ById(id string) (*ServiceProxy, error) {
63 | resp := &ServiceProxy{}
64 | err := c.rancherClient.doById(SERVICE_PROXY_TYPE, id, resp)
65 | if apiError, ok := err.(*ApiError); ok {
66 | if apiError.StatusCode == 404 {
67 | return nil, nil
68 | }
69 | }
70 | return resp, err
71 | }
72 |
73 | func (c *ServiceProxyClient) Delete(container *ServiceProxy) error {
74 | return c.rancherClient.doResourceDelete(SERVICE_PROXY_TYPE, &container.Resource)
75 | }
76 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_service_restart.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SERVICE_RESTART_TYPE = "serviceRestart"
5 | )
6 |
7 | type ServiceRestart struct {
8 | Resource
9 |
10 | RollingRestartStrategy RollingRestartStrategy `json:"rollingRestartStrategy,omitempty" yaml:"rolling_restart_strategy,omitempty"`
11 | }
12 |
13 | type ServiceRestartCollection struct {
14 | Collection
15 | Data []ServiceRestart `json:"data,omitempty"`
16 | }
17 |
18 | type ServiceRestartClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type ServiceRestartOperations interface {
23 | List(opts *ListOpts) (*ServiceRestartCollection, error)
24 | Create(opts *ServiceRestart) (*ServiceRestart, error)
25 | Update(existing *ServiceRestart, updates interface{}) (*ServiceRestart, error)
26 | ById(id string) (*ServiceRestart, error)
27 | Delete(container *ServiceRestart) error
28 | }
29 |
30 | func newServiceRestartClient(rancherClient *RancherClient) *ServiceRestartClient {
31 | return &ServiceRestartClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *ServiceRestartClient) Create(container *ServiceRestart) (*ServiceRestart, error) {
37 | resp := &ServiceRestart{}
38 | err := c.rancherClient.doCreate(SERVICE_RESTART_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *ServiceRestartClient) Update(existing *ServiceRestart, updates interface{}) (*ServiceRestart, error) {
43 | resp := &ServiceRestart{}
44 | err := c.rancherClient.doUpdate(SERVICE_RESTART_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *ServiceRestartClient) List(opts *ListOpts) (*ServiceRestartCollection, error) {
49 | resp := &ServiceRestartCollection{}
50 | err := c.rancherClient.doList(SERVICE_RESTART_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *ServiceRestartClient) ById(id string) (*ServiceRestart, error) {
55 | resp := &ServiceRestart{}
56 | err := c.rancherClient.doById(SERVICE_RESTART_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *ServiceRestartClient) Delete(container *ServiceRestart) error {
66 | return c.rancherClient.doResourceDelete(SERVICE_RESTART_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_service_upgrade.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SERVICE_UPGRADE_TYPE = "serviceUpgrade"
5 | )
6 |
7 | type ServiceUpgrade struct {
8 | Resource
9 |
10 | InServiceStrategy *InServiceUpgradeStrategy `json:"inServiceStrategy,omitempty" yaml:"in_service_strategy,omitempty"`
11 |
12 | ToServiceStrategy *ToServiceUpgradeStrategy `json:"toServiceStrategy,omitempty" yaml:"to_service_strategy,omitempty"`
13 | }
14 |
15 | type ServiceUpgradeCollection struct {
16 | Collection
17 | Data []ServiceUpgrade `json:"data,omitempty"`
18 | }
19 |
20 | type ServiceUpgradeClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type ServiceUpgradeOperations interface {
25 | List(opts *ListOpts) (*ServiceUpgradeCollection, error)
26 | Create(opts *ServiceUpgrade) (*ServiceUpgrade, error)
27 | Update(existing *ServiceUpgrade, updates interface{}) (*ServiceUpgrade, error)
28 | ById(id string) (*ServiceUpgrade, error)
29 | Delete(container *ServiceUpgrade) error
30 | }
31 |
32 | func newServiceUpgradeClient(rancherClient *RancherClient) *ServiceUpgradeClient {
33 | return &ServiceUpgradeClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *ServiceUpgradeClient) Create(container *ServiceUpgrade) (*ServiceUpgrade, error) {
39 | resp := &ServiceUpgrade{}
40 | err := c.rancherClient.doCreate(SERVICE_UPGRADE_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *ServiceUpgradeClient) Update(existing *ServiceUpgrade, updates interface{}) (*ServiceUpgrade, error) {
45 | resp := &ServiceUpgrade{}
46 | err := c.rancherClient.doUpdate(SERVICE_UPGRADE_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *ServiceUpgradeClient) List(opts *ListOpts) (*ServiceUpgradeCollection, error) {
51 | resp := &ServiceUpgradeCollection{}
52 | err := c.rancherClient.doList(SERVICE_UPGRADE_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *ServiceUpgradeClient) ById(id string) (*ServiceUpgrade, error) {
57 | resp := &ServiceUpgrade{}
58 | err := c.rancherClient.doById(SERVICE_UPGRADE_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *ServiceUpgradeClient) Delete(container *ServiceUpgrade) error {
68 | return c.rancherClient.doResourceDelete(SERVICE_UPGRADE_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_service_upgrade_strategy.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SERVICE_UPGRADE_STRATEGY_TYPE = "serviceUpgradeStrategy"
5 | )
6 |
7 | type ServiceUpgradeStrategy struct {
8 | Resource
9 |
10 | BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"`
11 |
12 | IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"`
13 | }
14 |
15 | type ServiceUpgradeStrategyCollection struct {
16 | Collection
17 | Data []ServiceUpgradeStrategy `json:"data,omitempty"`
18 | }
19 |
20 | type ServiceUpgradeStrategyClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type ServiceUpgradeStrategyOperations interface {
25 | List(opts *ListOpts) (*ServiceUpgradeStrategyCollection, error)
26 | Create(opts *ServiceUpgradeStrategy) (*ServiceUpgradeStrategy, error)
27 | Update(existing *ServiceUpgradeStrategy, updates interface{}) (*ServiceUpgradeStrategy, error)
28 | ById(id string) (*ServiceUpgradeStrategy, error)
29 | Delete(container *ServiceUpgradeStrategy) error
30 | }
31 |
32 | func newServiceUpgradeStrategyClient(rancherClient *RancherClient) *ServiceUpgradeStrategyClient {
33 | return &ServiceUpgradeStrategyClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *ServiceUpgradeStrategyClient) Create(container *ServiceUpgradeStrategy) (*ServiceUpgradeStrategy, error) {
39 | resp := &ServiceUpgradeStrategy{}
40 | err := c.rancherClient.doCreate(SERVICE_UPGRADE_STRATEGY_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *ServiceUpgradeStrategyClient) Update(existing *ServiceUpgradeStrategy, updates interface{}) (*ServiceUpgradeStrategy, error) {
45 | resp := &ServiceUpgradeStrategy{}
46 | err := c.rancherClient.doUpdate(SERVICE_UPGRADE_STRATEGY_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *ServiceUpgradeStrategyClient) List(opts *ListOpts) (*ServiceUpgradeStrategyCollection, error) {
51 | resp := &ServiceUpgradeStrategyCollection{}
52 | err := c.rancherClient.doList(SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *ServiceUpgradeStrategyClient) ById(id string) (*ServiceUpgradeStrategy, error) {
57 | resp := &ServiceUpgradeStrategy{}
58 | err := c.rancherClient.doById(SERVICE_UPGRADE_STRATEGY_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *ServiceUpgradeStrategyClient) Delete(container *ServiceUpgradeStrategy) error {
68 | return c.rancherClient.doResourceDelete(SERVICE_UPGRADE_STRATEGY_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_services_port_range.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SERVICES_PORT_RANGE_TYPE = "servicesPortRange"
5 | )
6 |
7 | type ServicesPortRange struct {
8 | Resource
9 |
10 | EndPort int64 `json:"endPort,omitempty" yaml:"end_port,omitempty"`
11 |
12 | StartPort int64 `json:"startPort,omitempty" yaml:"start_port,omitempty"`
13 | }
14 |
15 | type ServicesPortRangeCollection struct {
16 | Collection
17 | Data []ServicesPortRange `json:"data,omitempty"`
18 | }
19 |
20 | type ServicesPortRangeClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type ServicesPortRangeOperations interface {
25 | List(opts *ListOpts) (*ServicesPortRangeCollection, error)
26 | Create(opts *ServicesPortRange) (*ServicesPortRange, error)
27 | Update(existing *ServicesPortRange, updates interface{}) (*ServicesPortRange, error)
28 | ById(id string) (*ServicesPortRange, error)
29 | Delete(container *ServicesPortRange) error
30 | }
31 |
32 | func newServicesPortRangeClient(rancherClient *RancherClient) *ServicesPortRangeClient {
33 | return &ServicesPortRangeClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *ServicesPortRangeClient) Create(container *ServicesPortRange) (*ServicesPortRange, error) {
39 | resp := &ServicesPortRange{}
40 | err := c.rancherClient.doCreate(SERVICES_PORT_RANGE_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *ServicesPortRangeClient) Update(existing *ServicesPortRange, updates interface{}) (*ServicesPortRange, error) {
45 | resp := &ServicesPortRange{}
46 | err := c.rancherClient.doUpdate(SERVICES_PORT_RANGE_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *ServicesPortRangeClient) List(opts *ListOpts) (*ServicesPortRangeCollection, error) {
51 | resp := &ServicesPortRangeCollection{}
52 | err := c.rancherClient.doList(SERVICES_PORT_RANGE_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *ServicesPortRangeClient) ById(id string) (*ServicesPortRange, error) {
57 | resp := &ServicesPortRange{}
58 | err := c.rancherClient.doById(SERVICES_PORT_RANGE_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *ServicesPortRangeClient) Delete(container *ServicesPortRange) error {
68 | return c.rancherClient.doResourceDelete(SERVICES_PORT_RANGE_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_set_labels_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SET_LABELS_INPUT_TYPE = "setLabelsInput"
5 | )
6 |
7 | type SetLabelsInput struct {
8 | Resource
9 |
10 | Labels interface{} `json:"labels,omitempty" yaml:"labels,omitempty"`
11 | }
12 |
13 | type SetLabelsInputCollection struct {
14 | Collection
15 | Data []SetLabelsInput `json:"data,omitempty"`
16 | }
17 |
18 | type SetLabelsInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type SetLabelsInputOperations interface {
23 | List(opts *ListOpts) (*SetLabelsInputCollection, error)
24 | Create(opts *SetLabelsInput) (*SetLabelsInput, error)
25 | Update(existing *SetLabelsInput, updates interface{}) (*SetLabelsInput, error)
26 | ById(id string) (*SetLabelsInput, error)
27 | Delete(container *SetLabelsInput) error
28 | }
29 |
30 | func newSetLabelsInputClient(rancherClient *RancherClient) *SetLabelsInputClient {
31 | return &SetLabelsInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *SetLabelsInputClient) Create(container *SetLabelsInput) (*SetLabelsInput, error) {
37 | resp := &SetLabelsInput{}
38 | err := c.rancherClient.doCreate(SET_LABELS_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *SetLabelsInputClient) Update(existing *SetLabelsInput, updates interface{}) (*SetLabelsInput, error) {
43 | resp := &SetLabelsInput{}
44 | err := c.rancherClient.doUpdate(SET_LABELS_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *SetLabelsInputClient) List(opts *ListOpts) (*SetLabelsInputCollection, error) {
49 | resp := &SetLabelsInputCollection{}
50 | err := c.rancherClient.doList(SET_LABELS_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *SetLabelsInputClient) ById(id string) (*SetLabelsInput, error) {
55 | resp := &SetLabelsInput{}
56 | err := c.rancherClient.doById(SET_LABELS_INPUT_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *SetLabelsInputClient) Delete(container *SetLabelsInput) error {
66 | return c.rancherClient.doResourceDelete(SET_LABELS_INPUT_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_hosts_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SET_LOAD_BALANCER_HOSTS_INPUT_TYPE = "setLoadBalancerHostsInput"
5 | )
6 |
7 | type SetLoadBalancerHostsInput struct {
8 | Resource
9 |
10 | HostIds []string `json:"hostIds,omitempty" yaml:"host_ids,omitempty"`
11 | }
12 |
13 | type SetLoadBalancerHostsInputCollection struct {
14 | Collection
15 | Data []SetLoadBalancerHostsInput `json:"data,omitempty"`
16 | }
17 |
18 | type SetLoadBalancerHostsInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type SetLoadBalancerHostsInputOperations interface {
23 | List(opts *ListOpts) (*SetLoadBalancerHostsInputCollection, error)
24 | Create(opts *SetLoadBalancerHostsInput) (*SetLoadBalancerHostsInput, error)
25 | Update(existing *SetLoadBalancerHostsInput, updates interface{}) (*SetLoadBalancerHostsInput, error)
26 | ById(id string) (*SetLoadBalancerHostsInput, error)
27 | Delete(container *SetLoadBalancerHostsInput) error
28 | }
29 |
30 | func newSetLoadBalancerHostsInputClient(rancherClient *RancherClient) *SetLoadBalancerHostsInputClient {
31 | return &SetLoadBalancerHostsInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *SetLoadBalancerHostsInputClient) Create(container *SetLoadBalancerHostsInput) (*SetLoadBalancerHostsInput, error) {
37 | resp := &SetLoadBalancerHostsInput{}
38 | err := c.rancherClient.doCreate(SET_LOAD_BALANCER_HOSTS_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *SetLoadBalancerHostsInputClient) Update(existing *SetLoadBalancerHostsInput, updates interface{}) (*SetLoadBalancerHostsInput, error) {
43 | resp := &SetLoadBalancerHostsInput{}
44 | err := c.rancherClient.doUpdate(SET_LOAD_BALANCER_HOSTS_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *SetLoadBalancerHostsInputClient) List(opts *ListOpts) (*SetLoadBalancerHostsInputCollection, error) {
49 | resp := &SetLoadBalancerHostsInputCollection{}
50 | err := c.rancherClient.doList(SET_LOAD_BALANCER_HOSTS_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *SetLoadBalancerHostsInputClient) ById(id string) (*SetLoadBalancerHostsInput, error) {
55 | resp := &SetLoadBalancerHostsInput{}
56 | err := c.rancherClient.doById(SET_LOAD_BALANCER_HOSTS_INPUT_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *SetLoadBalancerHostsInputClient) Delete(container *SetLoadBalancerHostsInput) error {
66 | return c.rancherClient.doResourceDelete(SET_LOAD_BALANCER_HOSTS_INPUT_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_set_project_members_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SET_PROJECT_MEMBERS_INPUT_TYPE = "setProjectMembersInput"
5 | )
6 |
7 | type SetProjectMembersInput struct {
8 | Resource
9 |
10 | Members []interface{} `json:"members,omitempty" yaml:"members,omitempty"`
11 | }
12 |
13 | type SetProjectMembersInputCollection struct {
14 | Collection
15 | Data []SetProjectMembersInput `json:"data,omitempty"`
16 | }
17 |
18 | type SetProjectMembersInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type SetProjectMembersInputOperations interface {
23 | List(opts *ListOpts) (*SetProjectMembersInputCollection, error)
24 | Create(opts *SetProjectMembersInput) (*SetProjectMembersInput, error)
25 | Update(existing *SetProjectMembersInput, updates interface{}) (*SetProjectMembersInput, error)
26 | ById(id string) (*SetProjectMembersInput, error)
27 | Delete(container *SetProjectMembersInput) error
28 | }
29 |
30 | func newSetProjectMembersInputClient(rancherClient *RancherClient) *SetProjectMembersInputClient {
31 | return &SetProjectMembersInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *SetProjectMembersInputClient) Create(container *SetProjectMembersInput) (*SetProjectMembersInput, error) {
37 | resp := &SetProjectMembersInput{}
38 | err := c.rancherClient.doCreate(SET_PROJECT_MEMBERS_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *SetProjectMembersInputClient) Update(existing *SetProjectMembersInput, updates interface{}) (*SetProjectMembersInput, error) {
43 | resp := &SetProjectMembersInput{}
44 | err := c.rancherClient.doUpdate(SET_PROJECT_MEMBERS_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *SetProjectMembersInputClient) List(opts *ListOpts) (*SetProjectMembersInputCollection, error) {
49 | resp := &SetProjectMembersInputCollection{}
50 | err := c.rancherClient.doList(SET_PROJECT_MEMBERS_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *SetProjectMembersInputClient) ById(id string) (*SetProjectMembersInput, error) {
55 | resp := &SetProjectMembersInput{}
56 | err := c.rancherClient.doById(SET_PROJECT_MEMBERS_INPUT_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *SetProjectMembersInputClient) Delete(container *SetProjectMembersInput) error {
66 | return c.rancherClient.doResourceDelete(SET_PROJECT_MEMBERS_INPUT_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_set_service_links_input.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SET_SERVICE_LINKS_INPUT_TYPE = "setServiceLinksInput"
5 | )
6 |
7 | type SetServiceLinksInput struct {
8 | Resource
9 |
10 | ServiceLinks []interface{} `json:"serviceLinks,omitempty" yaml:"service_links,omitempty"`
11 | }
12 |
13 | type SetServiceLinksInputCollection struct {
14 | Collection
15 | Data []SetServiceLinksInput `json:"data,omitempty"`
16 | }
17 |
18 | type SetServiceLinksInputClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type SetServiceLinksInputOperations interface {
23 | List(opts *ListOpts) (*SetServiceLinksInputCollection, error)
24 | Create(opts *SetServiceLinksInput) (*SetServiceLinksInput, error)
25 | Update(existing *SetServiceLinksInput, updates interface{}) (*SetServiceLinksInput, error)
26 | ById(id string) (*SetServiceLinksInput, error)
27 | Delete(container *SetServiceLinksInput) error
28 | }
29 |
30 | func newSetServiceLinksInputClient(rancherClient *RancherClient) *SetServiceLinksInputClient {
31 | return &SetServiceLinksInputClient{
32 | rancherClient: rancherClient,
33 | }
34 | }
35 |
36 | func (c *SetServiceLinksInputClient) Create(container *SetServiceLinksInput) (*SetServiceLinksInput, error) {
37 | resp := &SetServiceLinksInput{}
38 | err := c.rancherClient.doCreate(SET_SERVICE_LINKS_INPUT_TYPE, container, resp)
39 | return resp, err
40 | }
41 |
42 | func (c *SetServiceLinksInputClient) Update(existing *SetServiceLinksInput, updates interface{}) (*SetServiceLinksInput, error) {
43 | resp := &SetServiceLinksInput{}
44 | err := c.rancherClient.doUpdate(SET_SERVICE_LINKS_INPUT_TYPE, &existing.Resource, updates, resp)
45 | return resp, err
46 | }
47 |
48 | func (c *SetServiceLinksInputClient) List(opts *ListOpts) (*SetServiceLinksInputCollection, error) {
49 | resp := &SetServiceLinksInputCollection{}
50 | err := c.rancherClient.doList(SET_SERVICE_LINKS_INPUT_TYPE, opts, resp)
51 | return resp, err
52 | }
53 |
54 | func (c *SetServiceLinksInputClient) ById(id string) (*SetServiceLinksInput, error) {
55 | resp := &SetServiceLinksInput{}
56 | err := c.rancherClient.doById(SET_SERVICE_LINKS_INPUT_TYPE, id, resp)
57 | if apiError, ok := err.(*ApiError); ok {
58 | if apiError.StatusCode == 404 {
59 | return nil, nil
60 | }
61 | }
62 | return resp, err
63 | }
64 |
65 | func (c *SetServiceLinksInputClient) Delete(container *SetServiceLinksInput) error {
66 | return c.rancherClient.doResourceDelete(SET_SERVICE_LINKS_INPUT_TYPE, &container.Resource)
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_setting.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SETTING_TYPE = "setting"
5 | )
6 |
7 | type Setting struct {
8 | Resource
9 |
10 | ActiveValue string `json:"activeValue,omitempty" yaml:"active_value,omitempty"`
11 |
12 | InDb bool `json:"inDb,omitempty" yaml:"in_db,omitempty"`
13 |
14 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
15 |
16 | Source string `json:"source,omitempty" yaml:"source,omitempty"`
17 |
18 | Value string `json:"value,omitempty" yaml:"value,omitempty"`
19 | }
20 |
21 | type SettingCollection struct {
22 | Collection
23 | Data []Setting `json:"data,omitempty"`
24 | }
25 |
26 | type SettingClient struct {
27 | rancherClient *RancherClient
28 | }
29 |
30 | type SettingOperations interface {
31 | List(opts *ListOpts) (*SettingCollection, error)
32 | Create(opts *Setting) (*Setting, error)
33 | Update(existing *Setting, updates interface{}) (*Setting, error)
34 | ById(id string) (*Setting, error)
35 | Delete(container *Setting) error
36 | }
37 |
38 | func newSettingClient(rancherClient *RancherClient) *SettingClient {
39 | return &SettingClient{
40 | rancherClient: rancherClient,
41 | }
42 | }
43 |
44 | func (c *SettingClient) Create(container *Setting) (*Setting, error) {
45 | resp := &Setting{}
46 | err := c.rancherClient.doCreate(SETTING_TYPE, container, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *SettingClient) Update(existing *Setting, updates interface{}) (*Setting, error) {
51 | resp := &Setting{}
52 | err := c.rancherClient.doUpdate(SETTING_TYPE, &existing.Resource, updates, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *SettingClient) List(opts *ListOpts) (*SettingCollection, error) {
57 | resp := &SettingCollection{}
58 | err := c.rancherClient.doList(SETTING_TYPE, opts, resp)
59 | return resp, err
60 | }
61 |
62 | func (c *SettingClient) ById(id string) (*Setting, error) {
63 | resp := &Setting{}
64 | err := c.rancherClient.doById(SETTING_TYPE, id, resp)
65 | if apiError, ok := err.(*ApiError); ok {
66 | if apiError.StatusCode == 404 {
67 | return nil, nil
68 | }
69 | }
70 | return resp, err
71 | }
72 |
73 | func (c *SettingClient) Delete(container *Setting) error {
74 | return c.rancherClient.doResourceDelete(SETTING_TYPE, &container.Resource)
75 | }
76 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_state_transition.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | STATE_TRANSITION_TYPE = "stateTransition"
5 | )
6 |
7 | type StateTransition struct {
8 | Resource
9 | }
10 |
11 | type StateTransitionCollection struct {
12 | Collection
13 | Data []StateTransition `json:"data,omitempty"`
14 | }
15 |
16 | type StateTransitionClient struct {
17 | rancherClient *RancherClient
18 | }
19 |
20 | type StateTransitionOperations interface {
21 | List(opts *ListOpts) (*StateTransitionCollection, error)
22 | Create(opts *StateTransition) (*StateTransition, error)
23 | Update(existing *StateTransition, updates interface{}) (*StateTransition, error)
24 | ById(id string) (*StateTransition, error)
25 | Delete(container *StateTransition) error
26 | }
27 |
28 | func newStateTransitionClient(rancherClient *RancherClient) *StateTransitionClient {
29 | return &StateTransitionClient{
30 | rancherClient: rancherClient,
31 | }
32 | }
33 |
34 | func (c *StateTransitionClient) Create(container *StateTransition) (*StateTransition, error) {
35 | resp := &StateTransition{}
36 | err := c.rancherClient.doCreate(STATE_TRANSITION_TYPE, container, resp)
37 | return resp, err
38 | }
39 |
40 | func (c *StateTransitionClient) Update(existing *StateTransition, updates interface{}) (*StateTransition, error) {
41 | resp := &StateTransition{}
42 | err := c.rancherClient.doUpdate(STATE_TRANSITION_TYPE, &existing.Resource, updates, resp)
43 | return resp, err
44 | }
45 |
46 | func (c *StateTransitionClient) List(opts *ListOpts) (*StateTransitionCollection, error) {
47 | resp := &StateTransitionCollection{}
48 | err := c.rancherClient.doList(STATE_TRANSITION_TYPE, opts, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *StateTransitionClient) ById(id string) (*StateTransition, error) {
53 | resp := &StateTransition{}
54 | err := c.rancherClient.doById(STATE_TRANSITION_TYPE, id, resp)
55 | if apiError, ok := err.(*ApiError); ok {
56 | if apiError.StatusCode == 404 {
57 | return nil, nil
58 | }
59 | }
60 | return resp, err
61 | }
62 |
63 | func (c *StateTransitionClient) Delete(container *StateTransition) error {
64 | return c.rancherClient.doResourceDelete(STATE_TRANSITION_TYPE, &container.Resource)
65 | }
66 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_stats_access.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | STATS_ACCESS_TYPE = "statsAccess"
5 | )
6 |
7 | type StatsAccess struct {
8 | Resource
9 |
10 | Token string `json:"token,omitempty" yaml:"token,omitempty"`
11 |
12 | Url string `json:"url,omitempty" yaml:"url,omitempty"`
13 | }
14 |
15 | type StatsAccessCollection struct {
16 | Collection
17 | Data []StatsAccess `json:"data,omitempty"`
18 | }
19 |
20 | type StatsAccessClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type StatsAccessOperations interface {
25 | List(opts *ListOpts) (*StatsAccessCollection, error)
26 | Create(opts *StatsAccess) (*StatsAccess, error)
27 | Update(existing *StatsAccess, updates interface{}) (*StatsAccess, error)
28 | ById(id string) (*StatsAccess, error)
29 | Delete(container *StatsAccess) error
30 | }
31 |
32 | func newStatsAccessClient(rancherClient *RancherClient) *StatsAccessClient {
33 | return &StatsAccessClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *StatsAccessClient) Create(container *StatsAccess) (*StatsAccess, error) {
39 | resp := &StatsAccess{}
40 | err := c.rancherClient.doCreate(STATS_ACCESS_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *StatsAccessClient) Update(existing *StatsAccess, updates interface{}) (*StatsAccess, error) {
45 | resp := &StatsAccess{}
46 | err := c.rancherClient.doUpdate(STATS_ACCESS_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *StatsAccessClient) List(opts *ListOpts) (*StatsAccessCollection, error) {
51 | resp := &StatsAccessCollection{}
52 | err := c.rancherClient.doList(STATS_ACCESS_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *StatsAccessClient) ById(id string) (*StatsAccess, error) {
57 | resp := &StatsAccess{}
58 | err := c.rancherClient.doById(STATS_ACCESS_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *StatsAccessClient) Delete(container *StatsAccess) error {
68 | return c.rancherClient.doResourceDelete(STATS_ACCESS_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_subscribe.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | SUBSCRIBE_TYPE = "subscribe"
5 | )
6 |
7 | type Subscribe struct {
8 | Resource
9 |
10 | AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"`
11 |
12 | EventNames []string `json:"eventNames,omitempty" yaml:"event_names,omitempty"`
13 | }
14 |
15 | type SubscribeCollection struct {
16 | Collection
17 | Data []Subscribe `json:"data,omitempty"`
18 | }
19 |
20 | type SubscribeClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type SubscribeOperations interface {
25 | List(opts *ListOpts) (*SubscribeCollection, error)
26 | Create(opts *Subscribe) (*Subscribe, error)
27 | Update(existing *Subscribe, updates interface{}) (*Subscribe, error)
28 | ById(id string) (*Subscribe, error)
29 | Delete(container *Subscribe) error
30 | }
31 |
32 | func newSubscribeClient(rancherClient *RancherClient) *SubscribeClient {
33 | return &SubscribeClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *SubscribeClient) Create(container *Subscribe) (*Subscribe, error) {
39 | resp := &Subscribe{}
40 | err := c.rancherClient.doCreate(SUBSCRIBE_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *SubscribeClient) Update(existing *Subscribe, updates interface{}) (*Subscribe, error) {
45 | resp := &Subscribe{}
46 | err := c.rancherClient.doUpdate(SUBSCRIBE_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *SubscribeClient) List(opts *ListOpts) (*SubscribeCollection, error) {
51 | resp := &SubscribeCollection{}
52 | err := c.rancherClient.doList(SUBSCRIBE_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *SubscribeClient) ById(id string) (*Subscribe, error) {
57 | resp := &Subscribe{}
58 | err := c.rancherClient.doById(SUBSCRIBE_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *SubscribeClient) Delete(container *Subscribe) error {
68 | return c.rancherClient.doResourceDelete(SUBSCRIBE_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_task.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | TASK_TYPE = "task"
5 | )
6 |
7 | type Task struct {
8 | Resource
9 |
10 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
11 | }
12 |
13 | type TaskCollection struct {
14 | Collection
15 | Data []Task `json:"data,omitempty"`
16 | }
17 |
18 | type TaskClient struct {
19 | rancherClient *RancherClient
20 | }
21 |
22 | type TaskOperations interface {
23 | List(opts *ListOpts) (*TaskCollection, error)
24 | Create(opts *Task) (*Task, error)
25 | Update(existing *Task, updates interface{}) (*Task, error)
26 | ById(id string) (*Task, error)
27 | Delete(container *Task) error
28 |
29 | ActionExecute(*Task) (*Task, error)
30 | }
31 |
32 | func newTaskClient(rancherClient *RancherClient) *TaskClient {
33 | return &TaskClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *TaskClient) Create(container *Task) (*Task, error) {
39 | resp := &Task{}
40 | err := c.rancherClient.doCreate(TASK_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *TaskClient) Update(existing *Task, updates interface{}) (*Task, error) {
45 | resp := &Task{}
46 | err := c.rancherClient.doUpdate(TASK_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *TaskClient) List(opts *ListOpts) (*TaskCollection, error) {
51 | resp := &TaskCollection{}
52 | err := c.rancherClient.doList(TASK_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *TaskClient) ById(id string) (*Task, error) {
57 | resp := &Task{}
58 | err := c.rancherClient.doById(TASK_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *TaskClient) Delete(container *Task) error {
68 | return c.rancherClient.doResourceDelete(TASK_TYPE, &container.Resource)
69 | }
70 |
71 | func (c *TaskClient) ActionExecute(resource *Task) (*Task, error) {
72 |
73 | resp := &Task{}
74 |
75 | err := c.rancherClient.doAction(TASK_TYPE, "execute", &resource.Resource, nil, resp)
76 |
77 | return resp, err
78 | }
79 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_task_instance.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | TASK_INSTANCE_TYPE = "taskInstance"
5 | )
6 |
7 | type TaskInstance struct {
8 | Resource
9 |
10 | EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"`
11 |
12 | Exception string `json:"exception,omitempty" yaml:"exception,omitempty"`
13 |
14 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
15 |
16 | ServerId string `json:"serverId,omitempty" yaml:"server_id,omitempty"`
17 |
18 | StartTime string `json:"startTime,omitempty" yaml:"start_time,omitempty"`
19 |
20 | TaskId string `json:"taskId,omitempty" yaml:"task_id,omitempty"`
21 | }
22 |
23 | type TaskInstanceCollection struct {
24 | Collection
25 | Data []TaskInstance `json:"data,omitempty"`
26 | }
27 |
28 | type TaskInstanceClient struct {
29 | rancherClient *RancherClient
30 | }
31 |
32 | type TaskInstanceOperations interface {
33 | List(opts *ListOpts) (*TaskInstanceCollection, error)
34 | Create(opts *TaskInstance) (*TaskInstance, error)
35 | Update(existing *TaskInstance, updates interface{}) (*TaskInstance, error)
36 | ById(id string) (*TaskInstance, error)
37 | Delete(container *TaskInstance) error
38 | }
39 |
40 | func newTaskInstanceClient(rancherClient *RancherClient) *TaskInstanceClient {
41 | return &TaskInstanceClient{
42 | rancherClient: rancherClient,
43 | }
44 | }
45 |
46 | func (c *TaskInstanceClient) Create(container *TaskInstance) (*TaskInstance, error) {
47 | resp := &TaskInstance{}
48 | err := c.rancherClient.doCreate(TASK_INSTANCE_TYPE, container, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *TaskInstanceClient) Update(existing *TaskInstance, updates interface{}) (*TaskInstance, error) {
53 | resp := &TaskInstance{}
54 | err := c.rancherClient.doUpdate(TASK_INSTANCE_TYPE, &existing.Resource, updates, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *TaskInstanceClient) List(opts *ListOpts) (*TaskInstanceCollection, error) {
59 | resp := &TaskInstanceCollection{}
60 | err := c.rancherClient.doList(TASK_INSTANCE_TYPE, opts, resp)
61 | return resp, err
62 | }
63 |
64 | func (c *TaskInstanceClient) ById(id string) (*TaskInstance, error) {
65 | resp := &TaskInstance{}
66 | err := c.rancherClient.doById(TASK_INSTANCE_TYPE, id, resp)
67 | if apiError, ok := err.(*ApiError); ok {
68 | if apiError.StatusCode == 404 {
69 | return nil, nil
70 | }
71 | }
72 | return resp, err
73 | }
74 |
75 | func (c *TaskInstanceClient) Delete(container *TaskInstance) error {
76 | return c.rancherClient.doResourceDelete(TASK_INSTANCE_TYPE, &container.Resource)
77 | }
78 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_type_documentation.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | TYPE_DOCUMENTATION_TYPE = "typeDocumentation"
5 | )
6 |
7 | type TypeDocumentation struct {
8 | Resource
9 |
10 | Description string `json:"description,omitempty" yaml:"description,omitempty"`
11 |
12 | ResourceFields map[string]interface{} `json:"resourceFields,omitempty" yaml:"resource_fields,omitempty"`
13 | }
14 |
15 | type TypeDocumentationCollection struct {
16 | Collection
17 | Data []TypeDocumentation `json:"data,omitempty"`
18 | }
19 |
20 | type TypeDocumentationClient struct {
21 | rancherClient *RancherClient
22 | }
23 |
24 | type TypeDocumentationOperations interface {
25 | List(opts *ListOpts) (*TypeDocumentationCollection, error)
26 | Create(opts *TypeDocumentation) (*TypeDocumentation, error)
27 | Update(existing *TypeDocumentation, updates interface{}) (*TypeDocumentation, error)
28 | ById(id string) (*TypeDocumentation, error)
29 | Delete(container *TypeDocumentation) error
30 | }
31 |
32 | func newTypeDocumentationClient(rancherClient *RancherClient) *TypeDocumentationClient {
33 | return &TypeDocumentationClient{
34 | rancherClient: rancherClient,
35 | }
36 | }
37 |
38 | func (c *TypeDocumentationClient) Create(container *TypeDocumentation) (*TypeDocumentation, error) {
39 | resp := &TypeDocumentation{}
40 | err := c.rancherClient.doCreate(TYPE_DOCUMENTATION_TYPE, container, resp)
41 | return resp, err
42 | }
43 |
44 | func (c *TypeDocumentationClient) Update(existing *TypeDocumentation, updates interface{}) (*TypeDocumentation, error) {
45 | resp := &TypeDocumentation{}
46 | err := c.rancherClient.doUpdate(TYPE_DOCUMENTATION_TYPE, &existing.Resource, updates, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *TypeDocumentationClient) List(opts *ListOpts) (*TypeDocumentationCollection, error) {
51 | resp := &TypeDocumentationCollection{}
52 | err := c.rancherClient.doList(TYPE_DOCUMENTATION_TYPE, opts, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *TypeDocumentationClient) ById(id string) (*TypeDocumentation, error) {
57 | resp := &TypeDocumentation{}
58 | err := c.rancherClient.doById(TYPE_DOCUMENTATION_TYPE, id, resp)
59 | if apiError, ok := err.(*ApiError); ok {
60 | if apiError.StatusCode == 404 {
61 | return nil, nil
62 | }
63 | }
64 | return resp, err
65 | }
66 |
67 | func (c *TypeDocumentationClient) Delete(container *TypeDocumentation) error {
68 | return c.rancherClient.doResourceDelete(TYPE_DOCUMENTATION_TYPE, &container.Resource)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_ubiquity_config.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | UBIQUITY_CONFIG_TYPE = "ubiquityConfig"
5 | )
6 |
7 | type UbiquityConfig struct {
8 | Resource
9 |
10 | ApiToken string `json:"apiToken,omitempty" yaml:"api_token,omitempty"`
11 |
12 | ApiUsername string `json:"apiUsername,omitempty" yaml:"api_username,omitempty"`
13 |
14 | ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"`
15 |
16 | FlavorId string `json:"flavorId,omitempty" yaml:"flavor_id,omitempty"`
17 |
18 | ImageId string `json:"imageId,omitempty" yaml:"image_id,omitempty"`
19 |
20 | ZoneId string `json:"zoneId,omitempty" yaml:"zone_id,omitempty"`
21 | }
22 |
23 | type UbiquityConfigCollection struct {
24 | Collection
25 | Data []UbiquityConfig `json:"data,omitempty"`
26 | }
27 |
28 | type UbiquityConfigClient struct {
29 | rancherClient *RancherClient
30 | }
31 |
32 | type UbiquityConfigOperations interface {
33 | List(opts *ListOpts) (*UbiquityConfigCollection, error)
34 | Create(opts *UbiquityConfig) (*UbiquityConfig, error)
35 | Update(existing *UbiquityConfig, updates interface{}) (*UbiquityConfig, error)
36 | ById(id string) (*UbiquityConfig, error)
37 | Delete(container *UbiquityConfig) error
38 | }
39 |
40 | func newUbiquityConfigClient(rancherClient *RancherClient) *UbiquityConfigClient {
41 | return &UbiquityConfigClient{
42 | rancherClient: rancherClient,
43 | }
44 | }
45 |
46 | func (c *UbiquityConfigClient) Create(container *UbiquityConfig) (*UbiquityConfig, error) {
47 | resp := &UbiquityConfig{}
48 | err := c.rancherClient.doCreate(UBIQUITY_CONFIG_TYPE, container, resp)
49 | return resp, err
50 | }
51 |
52 | func (c *UbiquityConfigClient) Update(existing *UbiquityConfig, updates interface{}) (*UbiquityConfig, error) {
53 | resp := &UbiquityConfig{}
54 | err := c.rancherClient.doUpdate(UBIQUITY_CONFIG_TYPE, &existing.Resource, updates, resp)
55 | return resp, err
56 | }
57 |
58 | func (c *UbiquityConfigClient) List(opts *ListOpts) (*UbiquityConfigCollection, error) {
59 | resp := &UbiquityConfigCollection{}
60 | err := c.rancherClient.doList(UBIQUITY_CONFIG_TYPE, opts, resp)
61 | return resp, err
62 | }
63 |
64 | func (c *UbiquityConfigClient) ById(id string) (*UbiquityConfig, error) {
65 | resp := &UbiquityConfig{}
66 | err := c.rancherClient.doById(UBIQUITY_CONFIG_TYPE, id, resp)
67 | if apiError, ok := err.(*ApiError); ok {
68 | if apiError.StatusCode == 404 {
69 | return nil, nil
70 | }
71 | }
72 | return resp, err
73 | }
74 |
75 | func (c *UbiquityConfigClient) Delete(container *UbiquityConfig) error {
76 | return c.rancherClient.doResourceDelete(UBIQUITY_CONFIG_TYPE, &container.Resource)
77 | }
78 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/client/generated_virtual_machine_disk.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | const (
4 | VIRTUAL_MACHINE_DISK_TYPE = "virtualMachineDisk"
5 | )
6 |
7 | type VirtualMachineDisk struct {
8 | Resource
9 |
10 | Driver string `json:"driver,omitempty" yaml:"driver,omitempty"`
11 |
12 | Name string `json:"name,omitempty" yaml:"name,omitempty"`
13 |
14 | Opts map[string]interface{} `json:"opts,omitempty" yaml:"opts,omitempty"`
15 |
16 | Root bool `json:"root,omitempty" yaml:"root,omitempty"`
17 |
18 | Size string `json:"size,omitempty" yaml:"size,omitempty"`
19 | }
20 |
21 | type VirtualMachineDiskCollection struct {
22 | Collection
23 | Data []VirtualMachineDisk `json:"data,omitempty"`
24 | }
25 |
26 | type VirtualMachineDiskClient struct {
27 | rancherClient *RancherClient
28 | }
29 |
30 | type VirtualMachineDiskOperations interface {
31 | List(opts *ListOpts) (*VirtualMachineDiskCollection, error)
32 | Create(opts *VirtualMachineDisk) (*VirtualMachineDisk, error)
33 | Update(existing *VirtualMachineDisk, updates interface{}) (*VirtualMachineDisk, error)
34 | ById(id string) (*VirtualMachineDisk, error)
35 | Delete(container *VirtualMachineDisk) error
36 | }
37 |
38 | func newVirtualMachineDiskClient(rancherClient *RancherClient) *VirtualMachineDiskClient {
39 | return &VirtualMachineDiskClient{
40 | rancherClient: rancherClient,
41 | }
42 | }
43 |
44 | func (c *VirtualMachineDiskClient) Create(container *VirtualMachineDisk) (*VirtualMachineDisk, error) {
45 | resp := &VirtualMachineDisk{}
46 | err := c.rancherClient.doCreate(VIRTUAL_MACHINE_DISK_TYPE, container, resp)
47 | return resp, err
48 | }
49 |
50 | func (c *VirtualMachineDiskClient) Update(existing *VirtualMachineDisk, updates interface{}) (*VirtualMachineDisk, error) {
51 | resp := &VirtualMachineDisk{}
52 | err := c.rancherClient.doUpdate(VIRTUAL_MACHINE_DISK_TYPE, &existing.Resource, updates, resp)
53 | return resp, err
54 | }
55 |
56 | func (c *VirtualMachineDiskClient) List(opts *ListOpts) (*VirtualMachineDiskCollection, error) {
57 | resp := &VirtualMachineDiskCollection{}
58 | err := c.rancherClient.doList(VIRTUAL_MACHINE_DISK_TYPE, opts, resp)
59 | return resp, err
60 | }
61 |
62 | func (c *VirtualMachineDiskClient) ById(id string) (*VirtualMachineDisk, error) {
63 | resp := &VirtualMachineDisk{}
64 | err := c.rancherClient.doById(VIRTUAL_MACHINE_DISK_TYPE, id, resp)
65 | if apiError, ok := err.(*ApiError); ok {
66 | if apiError.StatusCode == 404 {
67 | return nil, nil
68 | }
69 | }
70 | return resp, err
71 | }
72 |
73 | func (c *VirtualMachineDiskClient) Delete(container *VirtualMachineDisk) error {
74 | return c.rancherClient.doResourceDelete(VIRTUAL_MACHINE_DISK_TYPE, &container.Resource)
75 | }
76 |
--------------------------------------------------------------------------------
/vendor/github.com/rancher/go-rancher/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | _ "github.com/rancher/go-rancher/client"
6 | )
7 |
8 | func main() {
9 | fmt.Println("I have nothing to do...")
10 | }
11 |
--------------------------------------------------------------------------------