├── .gitignore ├── .vscode └── settings.json ├── Dockerfile ├── Dockerfile.non-multi ├── LICENSE ├── Makefile ├── QuickStart.md ├── README.md ├── handlers ├── const.go ├── delete.go ├── delete_test.go ├── deploy.go ├── deploy_test.go ├── handler.go ├── proxy.go ├── proxy_test.go ├── reader.go ├── reader_test.go ├── replicas.go └── types.go ├── mocks ├── BridgeClient.go └── HttpDoer.go ├── rancher ├── client.go └── config.go ├── server.go ├── types └── requests.go ├── vendor.conf └── vendor └── github.com ├── alexellis ├── faas-provider │ ├── .gitignore │ ├── Dockerfile │ ├── LICENSE │ ├── README.md │ ├── serve.go │ ├── types │ │ ├── config.go │ │ └── requests.go │ └── vendor.conf └── faas │ ├── .gitignore │ ├── .travis.yml │ ├── CNAME │ ├── CONTRIBUTING.md │ ├── DEV.md │ ├── LICENSE │ ├── README.md │ ├── ROADMAP.md │ ├── TestDrive.md │ ├── _config.yml │ ├── appveyor.yml │ ├── build.armhf.sh │ ├── build.sh │ ├── community.md │ ├── debug.md │ ├── deploy_extended.sh │ ├── deploy_stack.armhf.sh │ ├── deploy_stack.ps1 │ ├── deploy_stack.sh │ ├── docker-compose.armhf.yml │ ├── docker-compose.extended.yml │ ├── docker-compose.yml │ └── gateway │ ├── .gitignore │ ├── Dockerfile │ ├── Dockerfile.armhf │ ├── build.armhf.sh │ ├── build.sh │ ├── requests │ └── requests.go │ └── vendor.conf ├── gorilla ├── mux │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── context_gorilla.go │ ├── context_native.go │ ├── doc.go │ ├── mux.go │ ├── regexp.go │ └── route.go └── websocket │ ├── .gitignore │ ├── .travis.yml │ ├── AUTHORS │ ├── LICENSE │ ├── README.md │ ├── client.go │ ├── conn.go │ ├── doc.go │ ├── json.go │ ├── server.go │ └── util.go ├── pkg └── errors │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── appveyor.yml │ ├── errors.go │ └── stack.go ├── rancher └── go-rancher │ ├── .dockerignore │ ├── .drone.yml │ ├── .gitignore │ ├── Dockerfile.dapper │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── trash.conf │ └── v2 │ ├── client.go │ ├── common.go │ ├── generated_account.go │ ├── generated_active_setting.go │ ├── generated_add_outputs_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_azureadconfig.go │ ├── generated_backup.go │ ├── generated_backup_target.go │ ├── generated_base_machine_config.go │ ├── generated_binding.go │ ├── generated_blkio_device_option.go │ ├── generated_catalog_template.go │ ├── generated_certificate.go │ ├── generated_change_secret_input.go │ ├── generated_client.go │ ├── generated_cluster_membership.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_default_network.go │ ├── generated_digitalocean_config.go │ ├── generated_dns_service.go │ ├── generated_docker_build.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_generic_object.go │ ├── generated_ha_config.go │ ├── generated_ha_config_input.go │ ├── generated_healthcheck_instance_host_map.go │ ├── generated_host.go │ ├── generated_host_access.go │ ├── generated_host_api_proxy_token.go │ ├── generated_host_template.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_kubernetes_service.go │ ├── generated_kubernetes_stack.go │ ├── generated_kubernetes_stack_upgrade.go │ ├── generated_label.go │ ├── generated_launch_config.go │ ├── generated_lb_config.go │ ├── generated_lb_target_config.go │ ├── generated_load_balancer_cookie_stickiness_policy.go │ ├── generated_load_balancer_service.go │ ├── generated_local_auth_config.go │ ├── generated_log_config.go │ ├── generated_machine.go │ ├── generated_machine_driver.go │ ├── generated_mount.go │ ├── generated_mount_entry.go │ ├── generated_network.go │ ├── generated_network_driver.go │ ├── generated_network_driver_service.go │ ├── generated_network_policy_rule.go │ ├── generated_network_policy_rule_between.go │ ├── generated_network_policy_rule_member.go │ ├── generated_network_policy_rule_within.go │ ├── generated_nfs_config.go │ ├── generated_openldapconfig.go │ ├── generated_packet_config.go │ ├── generated_password.go │ ├── generated_physical_host.go │ ├── generated_port.go │ ├── generated_port_rule.go │ ├── generated_process_definition.go │ ├── generated_process_execution.go │ ├── generated_process_instance.go │ ├── generated_process_pool.go │ ├── generated_process_summary.go │ ├── generated_project.go │ ├── generated_project_member.go │ ├── generated_project_template.go │ ├── generated_public_endpoint.go │ ├── generated_publish.go │ ├── generated_pull_task.go │ ├── generated_recreate_on_quorum_strategy_config.go │ ├── generated_register.go │ ├── generated_registration_token.go │ ├── generated_registry.go │ ├── generated_registry_credential.go │ ├── generated_resource_definition.go │ ├── generated_restart_policy.go │ ├── generated_restore_from_backup_input.go │ ├── generated_revert_to_snapshot_input.go │ ├── generated_rolling_restart_strategy.go │ ├── generated_scale_policy.go │ ├── generated_scheduled_upgrade.go │ ├── generated_secondary_launch_config.go │ ├── generated_secret.go │ ├── generated_secret_reference.go │ ├── generated_service.go │ ├── generated_service_binding.go │ ├── generated_service_consume_map.go │ ├── generated_service_event.go │ ├── generated_service_expose_map.go │ ├── generated_service_link.go │ ├── generated_service_log.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_project_members_input.go │ ├── generated_set_service_links_input.go │ ├── generated_setting.go │ ├── generated_snapshot.go │ ├── generated_snapshot_backup_input.go │ ├── generated_stack.go │ ├── generated_stack_upgrade.go │ ├── generated_state_transition.go │ ├── generated_stats_access.go │ ├── generated_storage_driver.go │ ├── generated_storage_driver_service.go │ ├── generated_storage_pool.go │ ├── generated_subnet.go │ ├── generated_target_port_rule.go │ ├── generated_task.go │ ├── generated_task_instance.go │ ├── generated_to_service_upgrade_strategy.go │ ├── generated_type_documentation.go │ ├── generated_ulimit.go │ ├── generated_user_preference.go │ ├── generated_virtual_machine.go │ ├── generated_virtual_machine_disk.go │ ├── generated_volume.go │ ├── generated_volume_activate_input.go │ ├── generated_volume_snapshot_input.go │ ├── generated_volume_template.go │ ├── schemas.go │ └── types.go └── stretchr └── testify ├── .gitignore ├── .travis.yml ├── LICENCE.txt ├── LICENSE ├── README.md ├── assert ├── assertion_forward.go ├── assertion_forward.go.tmpl ├── assertions.go ├── doc.go ├── errors.go ├── forward_assertions.go └── http_assertions.go └── mock ├── doc.go └── mock.go /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | 7 | # Test binary, build with `go test -c` 8 | *.test 9 | 10 | # Output of the go coverage tool, specifically when used with LiteIDE 11 | *.out 12 | 13 | # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 14 | .glide/ 15 | 16 | faas-netes 17 | 18 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "licenser.license": "MIT" 3 | } -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.7.5 2 | 3 | RUN mkdir -p /go/src/github.com/kenfdev/faas-rancher/ 4 | 5 | WORKDIR /go/src/github.com/kenfdev/faas-rancher 6 | 7 | COPY vendor vendor 8 | COPY handlers handlers 9 | COPY types types 10 | COPY rancher rancher 11 | COPY server.go . 12 | 13 | RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*") \ 14 | && CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o faas-rancher . 15 | 16 | FROM alpine:3.5 17 | RUN apk --no-cache add ca-certificates 18 | WORKDIR /root/ 19 | 20 | EXPOSE 8080 21 | ENV http_proxy "" 22 | ENV https_proxy "" 23 | 24 | COPY --from=0 /go/src/github.com/kenfdev/faas-rancher/faas-rancher . 25 | 26 | CMD ["./faas-rancher"] 27 | -------------------------------------------------------------------------------- /Dockerfile.non-multi: -------------------------------------------------------------------------------- 1 | FROM golang:1.7.5 2 | 3 | RUN mkdir -p /go/src/github.com/kenfdev/faas-rancher/ 4 | 5 | WORKDIR /go/src/github.com/kenfdev/faas-rancher 6 | 7 | COPY vendor vendor 8 | COPY handlers handlers 9 | COPY types types 10 | COPY rancher rancher 11 | COPY server.go . 12 | 13 | RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*") \ 14 | && CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o faas-rancher . 15 | 16 | # FROM alpine:3.5 17 | # RUN apk --no-cache add ca-certificates 18 | # WORKDIR /root/ 19 | 20 | EXPOSE 8080 21 | ENV http_proxy "" 22 | ENV https_proxy "" 23 | 24 | # COPY --from=0 /go/src/github.com/kenfdev/faas-rancher/faas-rancher . 25 | 26 | CMD ["./faas-rancher"] 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Alex Ellis 4 | Copyright (c) 2017 Ken Fukuyama 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TAG?=latest 2 | 3 | build: 4 | docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy -t kenfdev/faas-rancher:$(TAG) . 5 | 6 | push: 7 | docker push kenfdev/faas-rancher:$(TAG) 8 | -------------------------------------------------------------------------------- /QuickStart.md: -------------------------------------------------------------------------------- 1 | Preparing... -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **DEPRECATED** This repository is deprecated. Please refer https://github.com/openfaas-incubator/faas-rancher 2 | 3 | 4 | faas-rancher 5 | =========== 6 | 7 | ![OpenFaaS on Rancher](https://pbs.twimg.com/media/DI-IU-1UIAACfYe.png) 8 | 9 | This is a plugin to enable Rancher as a [FaaS](https://github.com/alexellis/faas) backend. 10 | 11 | [FaaS](https://github.com/alexellis/faas) is an event-driven serverless framework for containers. Any container for Windows or Linux can be leveraged as a serverless function. FaaS is quick and easy to deploy (less than 60 secs) and lets you avoid writing boiler-plate code. 12 | 13 | If you'd like to know more about the FaaS project head over to - https://github.com/alexellis/faas 14 | 15 | The code in this repository is a daemon or micro-service which can provide the basic functionality the FaaS Gateway requires: 16 | 17 | * List functions 18 | * Deploy function 19 | * Delete function 20 | * Invoke function synchronously 21 | 22 | Any other metrics or UI components will be maintained separately in the main FaaS project. 23 | 24 | ### QuickStart 25 | 26 | For now, [this blog post](https://medium.com/cloud-academy-inc/openfaas-on-rancher-684650cc078e) shows how you can deploy OpenFaaS on Rancher via the Catalog. 27 | 28 | ### Get started with the code 29 | 30 | Under construction... 31 | -------------------------------------------------------------------------------- /handlers/const.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 Ken Fukuyama 2 | // 3 | // This software is released under the MIT License. 4 | // https://opensource.org/licenses/MIT 5 | 6 | package handlers 7 | 8 | const ( 9 | // FaasFunctionLabel is the label set to faas function containers 10 | FaasFunctionLabel = "faas_function" 11 | ) 12 | -------------------------------------------------------------------------------- /handlers/delete.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017, Ken Fukuyama 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package handlers 5 | 6 | import ( 7 | "encoding/json" 8 | "io/ioutil" 9 | "net/http" 10 | 11 | "github.com/alexellis/faas/gateway/requests" 12 | "github.com/kenfdev/faas-rancher/rancher" 13 | ) 14 | 15 | // MakeDeleteHandler delete a function 16 | func MakeDeleteHandler(client rancher.BridgeClient) VarsHandler { 17 | return func(w http.ResponseWriter, r *http.Request, vars map[string]string) { 18 | 19 | defer r.Body.Close() 20 | 21 | body, _ := ioutil.ReadAll(r.Body) 22 | 23 | request := requests.DeleteFunctionRequest{} 24 | err := json.Unmarshal(body, &request) 25 | if err != nil { 26 | w.WriteHeader(http.StatusBadRequest) 27 | return 28 | } 29 | 30 | if len(request.FunctionName) == 0 { 31 | w.WriteHeader(http.StatusBadRequest) 32 | return 33 | } 34 | 35 | // This makes sure we don't delete non-labelled deployments 36 | service, findErr := client.FindServiceByName(request.FunctionName) 37 | if findErr != nil { 38 | w.WriteHeader(http.StatusInternalServerError) 39 | return 40 | } else if service == nil { 41 | w.WriteHeader(http.StatusNotFound) 42 | return 43 | } 44 | 45 | delErr := client.DeleteService(service) 46 | if delErr != nil { 47 | w.WriteHeader(http.StatusBadRequest) 48 | return 49 | } 50 | 51 | w.WriteHeader(http.StatusOK) 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /handlers/deploy.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017, Ken Fukuyama 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package handlers 5 | 6 | import ( 7 | "encoding/json" 8 | "fmt" 9 | "io/ioutil" 10 | "log" 11 | "net/http" 12 | "regexp" 13 | 14 | "github.com/alexellis/faas/gateway/requests" 15 | "github.com/kenfdev/faas-rancher/rancher" 16 | "github.com/rancher/go-rancher/v2" 17 | ) 18 | 19 | // ValidateDeployRequest validates that the service name is valid for Kubernetes 20 | func ValidateDeployRequest(request *requests.CreateFunctionRequest) error { 21 | var validDNS = regexp.MustCompile(`^[a-zA-Z\-]+$`) 22 | matched := validDNS.MatchString(request.Service) 23 | if matched { 24 | return nil 25 | } 26 | 27 | return fmt.Errorf("(%s) must be a valid DNS entry for service name", request.Service) 28 | } 29 | 30 | // MakeDeployHandler creates a handler to create new functions in the cluster 31 | func MakeDeployHandler(client rancher.BridgeClient) VarsHandler { 32 | return func(w http.ResponseWriter, r *http.Request, vars map[string]string) { 33 | 34 | defer r.Body.Close() 35 | 36 | body, _ := ioutil.ReadAll(r.Body) 37 | 38 | request := requests.CreateFunctionRequest{} 39 | err := json.Unmarshal(body, &request) 40 | if err != nil { 41 | w.WriteHeader(http.StatusBadRequest) 42 | return 43 | } 44 | 45 | if err := ValidateDeployRequest(&request); err != nil { 46 | w.WriteHeader(http.StatusBadRequest) 47 | w.Write([]byte(err.Error())) 48 | return 49 | } 50 | 51 | serviceSpec := makeServiceSpec(request) 52 | 53 | _, err = client.CreateService(serviceSpec) 54 | if err != nil { 55 | log.Println(err) 56 | w.WriteHeader(http.StatusInternalServerError) 57 | w.Write([]byte(err.Error())) 58 | return 59 | } 60 | 61 | log.Println("Created service - " + request.Service) 62 | log.Println(string(body)) 63 | 64 | w.WriteHeader(http.StatusAccepted) 65 | 66 | } 67 | } 68 | 69 | func makeServiceSpec(request requests.CreateFunctionRequest) *client.Service { 70 | 71 | envVars := make(map[string]interface{}) 72 | for k, v := range request.EnvVars { 73 | envVars[k] = v 74 | } 75 | 76 | if len(request.EnvProcess) > 0 { 77 | envVars["fprocess"] = request.EnvProcess 78 | } 79 | 80 | labels := make(map[string]interface{}) 81 | labels[FaasFunctionLabel] = request.Service 82 | labels["io.rancher.container.pull_image"] = "always" 83 | 84 | launchConfig := &client.LaunchConfig{ 85 | Environment: envVars, 86 | ImageUuid: "docker:" + request.Image, // not sure if it's ok to just prefix with 'docker:' 87 | Labels: labels, 88 | } 89 | 90 | serviceSpec := &client.Service{ 91 | Name: request.Service, 92 | Scale: 1, 93 | StartOnCreate: true, 94 | LaunchConfig: launchConfig, 95 | } 96 | 97 | return serviceSpec 98 | } 99 | -------------------------------------------------------------------------------- /handlers/handler.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 Ken Fukuyama 2 | // 3 | // This software is released under the MIT License. 4 | // https://opensource.org/licenses/MIT 5 | 6 | package handlers 7 | 8 | import ( 9 | "net/http" 10 | 11 | "github.com/gorilla/mux" 12 | ) 13 | 14 | // VarsHandler a wrapper type for mux.Vars 15 | type VarsHandler func(w http.ResponseWriter, r *http.Request, vars map[string]string) 16 | 17 | // ServeHTTP a wrapper function for mux.Vars 18 | func (vh VarsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 19 | vars := mux.Vars(r) 20 | vh(w, r, vars) 21 | } 22 | -------------------------------------------------------------------------------- /handlers/proxy.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017, Ken Fukuyama 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package handlers 5 | 6 | import ( 7 | "bytes" 8 | "fmt" 9 | "log" 10 | "net/http" 11 | "strconv" 12 | "time" 13 | 14 | "io/ioutil" 15 | ) 16 | 17 | // MakeProxy creates a proxy for HTTP web requests which can be routed to a function. 18 | func MakeProxy(httpDoer HttpDoer, stackName string) VarsHandler { 19 | 20 | return func(w http.ResponseWriter, r *http.Request, vars map[string]string) { 21 | defer r.Body.Close() 22 | 23 | if r.Method != "POST" { 24 | // Requests other than POST are not suppored yet 25 | w.WriteHeader(http.StatusBadRequest) 26 | return 27 | } 28 | 29 | service := vars["name"] 30 | 31 | stamp := strconv.FormatInt(time.Now().Unix(), 10) 32 | 33 | defer func(when time.Time) { 34 | seconds := time.Since(when).Seconds() 35 | log.Printf("[%s] took %f seconds\n", stamp, seconds) 36 | }(time.Now()) 37 | 38 | watchdogPort := 8080 39 | 40 | requestBody, _ := ioutil.ReadAll(r.Body) 41 | defer r.Body.Close() 42 | 43 | url := fmt.Sprintf("http://%s.%s:%d/", service, stackName, watchdogPort) 44 | 45 | request, _ := http.NewRequest("POST", url, bytes.NewReader(requestBody)) 46 | 47 | copyHeaders(&request.Header, &r.Header) 48 | 49 | defer request.Body.Close() 50 | 51 | response, err := httpDoer.Do(request) 52 | if err != nil { 53 | log.Println(err.Error()) 54 | w.WriteHeader(http.StatusInternalServerError) 55 | buf := bytes.NewBufferString("Can't reach service: " + service) 56 | w.Write(buf.Bytes()) 57 | return 58 | } 59 | 60 | clientHeader := w.Header() 61 | copyHeaders(&clientHeader, &response.Header) 62 | 63 | responseBody, _ := ioutil.ReadAll(response.Body) 64 | 65 | w.WriteHeader(http.StatusOK) 66 | w.Write(responseBody) 67 | 68 | } 69 | } 70 | 71 | func copyHeaders(destination *http.Header, source *http.Header) { 72 | for k, vv := range *source { 73 | vvClone := make([]string, len(vv)) 74 | copy(vvClone, vv) 75 | (*destination)[k] = vvClone 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /handlers/proxy_test.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "bytes" 5 | "io/ioutil" 6 | "log" 7 | "net/http" 8 | "net/http/httptest" 9 | "testing" 10 | 11 | "github.com/stretchr/testify/mock" 12 | 13 | "github.com/kenfdev/faas-rancher/mocks" 14 | "github.com/stretchr/testify/assert" 15 | ) 16 | 17 | func Test_MakeProxyHandler_Create_Service_Success(t *testing.T) { 18 | assert := assert.New(t) 19 | // Arrange 20 | mockClient := new(mocks.HttpDoer) 21 | stackName := "some_stackname" 22 | serviceName := "some-service" 23 | vars := map[string]string{ 24 | "name": serviceName, 25 | } 26 | handler := MakeProxy(mockClient, stackName) 27 | 28 | reqBody := []byte(`{ "data": "some_data" }`) 29 | req, err := http.NewRequest("POST", "/system/function/"+serviceName, bytes.NewReader(reqBody)) 30 | // req.Header.Add("Content-Type", "Some-Content-Type") 31 | if err != nil { 32 | log.Fatal(err) 33 | } 34 | 35 | responseBody := []byte(`{ "data": "some-data"}`) 36 | response := &http.Response{ 37 | Header: make(http.Header, 0), 38 | Body: ioutil.NopCloser(bytes.NewReader(responseBody)), 39 | } 40 | response.Header.Add("Content-Type", "Some-Content-Type") 41 | 42 | mockClient.On("Do", mock.MatchedBy(func(r *http.Request) bool { 43 | pBody, _ := ioutil.ReadAll(r.Body) 44 | // chek if proxied request is called 45 | return r.Method == req.Method && 46 | bytes.Equal(pBody, reqBody) 47 | })).Return(response, nil) 48 | 49 | rr := httptest.NewRecorder() 50 | 51 | // Act 52 | handler(rr, req, vars) 53 | 54 | // Assert 55 | assert.Equal(rr.Code, http.StatusOK) 56 | 57 | proxiedBody, _ := ioutil.ReadAll(rr.Body) 58 | assert.True(bytes.Equal(responseBody, proxiedBody)) 59 | assert.Equal("Some-Content-Type", rr.Header().Get("Content-Type"), "Headers weren't copied") 60 | } 61 | -------------------------------------------------------------------------------- /handlers/reader.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017, Ken Fukuyama 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package handlers 5 | 6 | import ( 7 | "encoding/json" 8 | "net/http" 9 | 10 | "github.com/alexellis/faas/gateway/requests" 11 | "github.com/kenfdev/faas-rancher/rancher" 12 | ) 13 | 14 | // MakeFunctionReader handler for reading functions deployed in the cluster as deployments. 15 | func MakeFunctionReader(client rancher.BridgeClient) VarsHandler { 16 | return func(w http.ResponseWriter, r *http.Request, vars map[string]string) { 17 | 18 | functions, err := getServiceList(client) 19 | if err != nil { 20 | http.Error(w, err.Error(), http.StatusInternalServerError) 21 | return 22 | } 23 | 24 | functionBytes, marshalErr := json.Marshal(functions) 25 | if marshalErr != nil { 26 | http.Error(w, err.Error(), http.StatusInternalServerError) 27 | return 28 | } 29 | w.Header().Set("Content-Type", "application/json") 30 | w.WriteHeader(http.StatusOK) 31 | w.Write(functionBytes) 32 | } 33 | } 34 | 35 | func getServiceList(client rancher.BridgeClient) ([]requests.Function, error) { 36 | functions := []requests.Function{} 37 | 38 | services, err := client.ListServices() 39 | if err != nil { 40 | return nil, err 41 | } 42 | 43 | for _, service := range services { 44 | if service.State != "active" { 45 | // ignore inactive services 46 | continue 47 | } 48 | 49 | if _, ok := service.LaunchConfig.Labels[FaasFunctionLabel]; ok { 50 | // filter to faas function services 51 | replicas := uint64(service.Scale) 52 | function := requests.Function{ 53 | Name: service.Name, 54 | Replicas: replicas, 55 | Image: service.LaunchConfig.ImageUuid, 56 | InvocationCount: 0, 57 | } 58 | functions = append(functions, function) 59 | 60 | } 61 | } 62 | 63 | return functions, nil 64 | } 65 | -------------------------------------------------------------------------------- /handlers/replicas.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017, Ken Fukuyama 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package handlers 5 | 6 | import ( 7 | "encoding/json" 8 | "io/ioutil" 9 | "log" 10 | "net/http" 11 | "strconv" 12 | 13 | "github.com/alexellis/faas/gateway/requests" 14 | "github.com/kenfdev/faas-rancher/rancher" 15 | "github.com/kenfdev/faas-rancher/types" 16 | ) 17 | 18 | // MakeReplicaUpdater updates desired count of replicas 19 | func MakeReplicaUpdater(client rancher.BridgeClient) VarsHandler { 20 | return func(w http.ResponseWriter, r *http.Request, vars map[string]string) { 21 | 22 | log.Println("Update replicas") 23 | 24 | functionName := vars["name"] 25 | 26 | req := types.ScaleServiceRequest{} 27 | if r.Body != nil { 28 | defer r.Body.Close() 29 | bytesIn, _ := ioutil.ReadAll(r.Body) 30 | marshalErr := json.Unmarshal(bytesIn, &req) 31 | if marshalErr != nil { 32 | w.WriteHeader(http.StatusBadRequest) 33 | msg := "Cannot parse request. Please pass valid JSON." 34 | w.Write([]byte(msg)) 35 | log.Println(msg, marshalErr) 36 | return 37 | } 38 | } 39 | 40 | service, findErr := client.FindServiceByName(functionName) 41 | if findErr != nil { 42 | w.WriteHeader(500) 43 | w.Write([]byte("Unable to lookup function deployment " + functionName)) 44 | log.Println(findErr) 45 | return 46 | } 47 | 48 | updates := make(map[string]string) 49 | updates["scale"] = strconv.FormatInt(req.Replicas, 10) 50 | _, upgradeErr := client.UpdateService(service, updates) 51 | if upgradeErr != nil { 52 | w.WriteHeader(500) 53 | w.Write([]byte("Unable to update function deployment " + functionName)) 54 | log.Println(upgradeErr) 55 | return 56 | } 57 | 58 | } 59 | } 60 | 61 | // MakeReplicaReader reads the amount of replicas for a deployment 62 | func MakeReplicaReader(client rancher.BridgeClient) VarsHandler { 63 | return func(w http.ResponseWriter, r *http.Request, vars map[string]string) { 64 | 65 | log.Println("Read replicas") 66 | 67 | functionName := vars["name"] 68 | 69 | functions, err := getServiceList(client) 70 | if err != nil { 71 | w.WriteHeader(500) 72 | return 73 | } 74 | 75 | var found *requests.Function 76 | for _, function := range functions { 77 | if function.Name == functionName { 78 | found = &function 79 | break 80 | } 81 | } 82 | 83 | if found == nil { 84 | w.WriteHeader(404) 85 | return 86 | } 87 | 88 | functionBytes, _ := json.Marshal(found) 89 | w.Header().Set("Content-Type", "application/json") 90 | w.WriteHeader(200) 91 | w.Write(functionBytes) 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /handlers/types.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | type HttpDoer interface { 6 | Do(req *http.Request) (*http.Response, error) 7 | } 8 | -------------------------------------------------------------------------------- /mocks/HttpDoer.go: -------------------------------------------------------------------------------- 1 | // Code generated by mockery v1.0.0 2 | package mocks 3 | 4 | import http "net/http" 5 | import mock "github.com/stretchr/testify/mock" 6 | 7 | // HttpDoer is an autogenerated mock type for the HttpDoer type 8 | type HttpDoer struct { 9 | mock.Mock 10 | } 11 | 12 | // Do provides a mock function with given fields: req 13 | func (_m *HttpDoer) Do(req *http.Request) (*http.Response, error) { 14 | ret := _m.Called(req) 15 | 16 | var r0 *http.Response 17 | if rf, ok := ret.Get(0).(func(*http.Request) *http.Response); ok { 18 | r0 = rf(req) 19 | } else { 20 | if ret.Get(0) != nil { 21 | r0 = ret.Get(0).(*http.Response) 22 | } 23 | } 24 | 25 | var r1 error 26 | if rf, ok := ret.Get(1).(func(*http.Request) error); ok { 27 | r1 = rf(req) 28 | } else { 29 | r1 = ret.Error(1) 30 | } 31 | 32 | return r0, r1 33 | } 34 | -------------------------------------------------------------------------------- /rancher/config.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Ken Fukuyama 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package rancher 5 | 6 | // Config for the rancher REST client 7 | type Config struct { 8 | // Stack name where the faas functions get deployed 9 | FunctionsStackName string 10 | // cattle API url 11 | CattleURL string 12 | // cattle access key 13 | CattleAccessKey string 14 | // cattle secret key 15 | CattleSecretKey string 16 | } 17 | 18 | // NewClientConfig creates a new config for rancher REST client 19 | func NewClientConfig(fn string, url string, aKey string, sKey string) (*Config, error) { 20 | config := Config{ 21 | FunctionsStackName: fn, 22 | CattleURL: url, 23 | CattleAccessKey: aKey, 24 | CattleSecretKey: sKey, 25 | } 26 | return &config, nil 27 | } 28 | -------------------------------------------------------------------------------- /server.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017, Ken Fukuyama 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package main 5 | 6 | import ( 7 | "fmt" 8 | "net" 9 | "net/http" 10 | "os" 11 | "time" 12 | 13 | "github.com/alexellis/faas-provider" 14 | bootTypes "github.com/alexellis/faas-provider/types" 15 | "github.com/kenfdev/faas-rancher/handlers" 16 | "github.com/kenfdev/faas-rancher/rancher" 17 | ) 18 | 19 | const ( 20 | // TimeoutSeconds seconds untile timeout for http client 21 | TimeoutSeconds = 2 22 | ) 23 | 24 | func main() { 25 | functionStackName := os.Getenv("FUNCTION_STACK_NAME") 26 | cattleURL := os.Getenv("CATTLE_URL") 27 | cattleAccessKey := os.Getenv("CATTLE_ACCESS_KEY") 28 | cattleSecretKey := os.Getenv("CATTLE_SECRET_KEY") 29 | 30 | // creates the rancher client config 31 | config, err := rancher.NewClientConfig( 32 | functionStackName, 33 | cattleURL, 34 | cattleAccessKey, 35 | cattleSecretKey) 36 | if err != nil { 37 | panic(err.Error()) 38 | } 39 | 40 | // create the rancher REST client 41 | rancherClient, err := rancher.NewClientForConfig(config) 42 | if err != nil { 43 | panic(err.Error()) 44 | } 45 | fmt.Println("Created Rancher Client") 46 | 47 | proxyClient := http.Client{ 48 | Transport: &http.Transport{ 49 | Proxy: http.ProxyFromEnvironment, 50 | DialContext: (&net.Dialer{ 51 | Timeout: 3 * time.Second, 52 | KeepAlive: 0, 53 | }).DialContext, 54 | MaxIdleConns: 1, 55 | DisableKeepAlives: true, 56 | IdleConnTimeout: 120 * time.Millisecond, 57 | ExpectContinueTimeout: 1500 * time.Millisecond, 58 | }, 59 | } 60 | bootstrapHandlers := bootTypes.FaaSHandlers{ 61 | FunctionProxy: handlers.MakeProxy(&proxyClient, config.FunctionsStackName).ServeHTTP, 62 | DeleteHandler: handlers.MakeDeleteHandler(rancherClient).ServeHTTP, 63 | DeployHandler: handlers.MakeDeployHandler(rancherClient).ServeHTTP, 64 | FunctionReader: handlers.MakeFunctionReader(rancherClient).ServeHTTP, 65 | ReplicaReader: handlers.MakeReplicaReader(rancherClient).ServeHTTP, 66 | ReplicaUpdater: handlers.MakeReplicaUpdater(rancherClient).ServeHTTP, 67 | } 68 | var port int 69 | port = 8080 70 | bootstrapConfig := bootTypes.FaaSConfig{ 71 | ReadTimeout: time.Second * 8, 72 | WriteTimeout: time.Second * 8, 73 | TCPPort: &port, 74 | } 75 | 76 | bootstrap.Serve(&bootstrapHandlers, &bootstrapConfig) 77 | 78 | } 79 | -------------------------------------------------------------------------------- /types/requests.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package types 5 | 6 | type ScaleServiceRequest struct { 7 | ServiceName string `json:"serviceName"` 8 | Replicas int64 `json:"replicas"` 9 | } 10 | -------------------------------------------------------------------------------- /vendor.conf: -------------------------------------------------------------------------------- 1 | github.com/gorilla/mux v1.4.0 https://github.com/gorilla/mux.git 2 | github.com/alexellis/faas 0.6.4 https://github.com/alexellis/faas.git 3 | github.com/alexellis/faas-provider 0.1 https://github.com/alexellis/faas-provider.git 4 | github.com/rancher/go-rancher 821d581 5 | github.com/gorilla/websocket 1551221275a7bd42978745a376b2531f791d88f3 6 | github.com/pkg/errors 1d2e60385a13aaa66134984235061c2f9302520e 7 | github.com/stretchr/testify v1.1.4 -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas-provider/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | 7 | # Test binary, build with `go test -c` 8 | *.test 9 | 10 | # Output of the go coverage tool, specifically when used with LiteIDE 11 | *.out 12 | 13 | # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 14 | .glide/ 15 | 16 | faas-backend 17 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas-provider/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.7.5 2 | 3 | RUN mkdir -p /go/src/github.com/alexellis/faas-netes/ 4 | 5 | WORKDIR /go/src/github.com/alexellis/faas-netes 6 | 7 | COPY vendor vendor 8 | COPY handlers handlers 9 | COPY types types 10 | COPY server.go . 11 | 12 | RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o faas-netes . 13 | 14 | FROM alpine:3.5 15 | RUN apk --no-cache add ca-certificates 16 | WORKDIR /root/ 17 | 18 | EXPOSE 8080 19 | ENV http_proxy "" 20 | ENV https_proxy "" 21 | 22 | COPY --from=0 /go/src/github.com/alexellis/faas-netes/faas-netes . 23 | 24 | CMD ["./faas-netes"] 25 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas-provider/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Alex Ellis 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 all 13 | 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 THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas-provider/README.md: -------------------------------------------------------------------------------- 1 | Common template or interface for you to start building your own OpenFaaS backend. 2 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas-provider/serve.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package bootstrap 5 | 6 | import ( 7 | "fmt" 8 | "log" 9 | "net/http" 10 | 11 | "github.com/alexellis/faas-provider/types" 12 | "github.com/gorilla/mux" 13 | ) 14 | 15 | // Mark this as a Golang "package" 16 | func init() { 17 | 18 | } 19 | 20 | // Serve load your handlers into the correct OpenFaaS route spec. This function is blocking. 21 | func Serve(handlers *types.FaaSHandlers, config *types.FaaSConfig) { 22 | r := mux.NewRouter() 23 | 24 | r.HandleFunc("/system/functions", handlers.FunctionReader).Methods("GET") 25 | r.HandleFunc("/system/functions", handlers.DeployHandler).Methods("POST") 26 | r.HandleFunc("/system/functions", handlers.DeleteHandler).Methods("DELETE") 27 | 28 | r.HandleFunc("/system/function/{name:[-a-zA-Z_0-9]+}", handlers.ReplicaReader).Methods("GET") 29 | r.HandleFunc("/system/scale-function/{name:[-a-zA-Z_0-9]+}", handlers.ReplicaUpdater).Methods("POST") 30 | 31 | r.HandleFunc("/function/{name:[-a-zA-Z_0-9]+}", handlers.FunctionProxy) 32 | r.HandleFunc("/function/{name:[-a-zA-Z_0-9]+}/", handlers.FunctionProxy) 33 | 34 | readTimeout := config.ReadTimeout 35 | writeTimeout := config.WriteTimeout 36 | tcpPort := 8080 37 | if config.TCPPort != nil { 38 | tcpPort = *config.TCPPort 39 | } 40 | 41 | s := &http.Server{ 42 | Addr: fmt.Sprintf(":%d", tcpPort), 43 | ReadTimeout: readTimeout, 44 | WriteTimeout: writeTimeout, 45 | MaxHeaderBytes: http.DefaultMaxHeaderBytes, // 1MB - can be overridden by setting Server.MaxHeaderBytes. 46 | Handler: r, 47 | } 48 | 49 | log.Fatal(s.ListenAndServe()) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas-provider/types/config.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "net/http" 5 | "time" 6 | ) 7 | 8 | // FaaSHandlers provide handlers for OpenFaaS 9 | type FaaSHandlers struct { 10 | FunctionReader http.HandlerFunc 11 | DeployHandler http.HandlerFunc 12 | DeleteHandler http.HandlerFunc 13 | ReplicaReader http.HandlerFunc 14 | FunctionProxy http.HandlerFunc 15 | ReplicaUpdater http.HandlerFunc 16 | } 17 | 18 | // FaaSConfig set config for HTTP handlers 19 | type FaaSConfig struct { 20 | TCPPort *int 21 | ReadTimeout time.Duration 22 | WriteTimeout time.Duration 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas-provider/types/requests.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package types 5 | 6 | type ScaleServiceRequest struct { 7 | ServiceName string `json:"serviceName"` 8 | Replicas uint64 `json:"replicas"` 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas-provider/vendor.conf: -------------------------------------------------------------------------------- 1 | github.com/gorilla/mux 24fca303ac6da784b9e8269f724ddeb0b2eea5e7 2 | github.com/gorilla/context 08b5f424b9271eedf6f9f0ce86cb9396ed337a42 3 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/.gitignore: -------------------------------------------------------------------------------- 1 | fwatchdog 2 | fwatchdog-armhf 3 | **/node_modules/ 4 | **/*.DS_Store 5 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | services: 4 | - docker 5 | before_install: 6 | - docker pull golang:1.7.5 7 | 8 | script: 9 | - sh build.sh 10 | 11 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/CNAME: -------------------------------------------------------------------------------- 1 | docs.get-faas.com -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016-2017 Alex Ellis 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 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | image: Visual Studio 2017 3 | 4 | install: 5 | - docker version 6 | 7 | build_script: 8 | - ps: .\watchdog\build.ps1 9 | 10 | artifacts: 11 | - path: watchdog\watchdog.exe 12 | name: watchdog 13 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/build.armhf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | (cd gateway && ./build.armhf.sh) && \ 4 | (cd watchdog && ./build.armhf.sh) 5 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | (cd gateway && ./build.sh) 4 | (cd watchdog && ./build.sh) 5 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/debug.md: -------------------------------------------------------------------------------- 1 | ### Debug information 2 | 3 | This is a useful Prometheus query to show: 4 | 5 | * Service replicas 6 | * Rate of invocation 7 | * Execution time of events 8 | 9 | http://localhost:9090/graph?g0.range_input=15m&g0.expr=gateway_service_count&g0.tab=0&g1.range_input=15m&g1.expr=rate(gateway_function_invocation_total%5B20s%5D)&g1.tab=0&g2.range_input=15m&g2.expr=gateway_functions_seconds_sum+%2F+gateway_functions_seconds_count&g2.tab=0 10 | 11 | 12 | ``` 13 | $ docker service ls -q |xargs -n 1 -I {} docker service scale {}=10;docker service scale func_gateway=1 ; 14 | $ docker service scale func_prometheus=1 ; docker service scale func_alertmanager=1 15 | ``` 16 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/deploy_extended.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if ! [ -x "$(command -v docker)" ]; then 4 | echo 'Unable to find docker command, please install Docker (https://www.docker.com/) and retry' >&2 5 | exit 1 6 | fi 7 | 8 | echo "Deploying extended stack" 9 | docker stack deploy func --compose-file docker-compose.extended.yml 10 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/deploy_stack.armhf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if ! [ -x "$(command -v docker)" ]; then 4 | echo 'Unable to find docker command, please install Docker (https://www.docker.com/) and retry' >&2 5 | exit 1 6 | fi 7 | 8 | echo "Deploying stack" 9 | docker stack deploy func --compose-file docker-compose.armhf.yml 10 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/deploy_stack.ps1: -------------------------------------------------------------------------------- 1 | #!ps1 2 | 3 | if (Get-Command docker -errorAction SilentlyContinue) 4 | { 5 | Write-Host "Deploying stack" 6 | docker stack deploy func --compose-file ./docker-compose.yml 7 | } 8 | else 9 | { 10 | Write-Host "Unable to find docker command, please install Docker (https://www.docker.com/) and retry" 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/deploy_stack.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if ! [ -x "$(command -v docker)" ]; then 4 | echo 'Unable to find docker command, please install Docker (https://www.docker.com/) and retry' >&2 5 | exit 1 6 | fi 7 | 8 | echo "Deploying stack" 9 | docker stack deploy func --compose-file docker-compose.yml 10 | 11 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/gateway/.gitignore: -------------------------------------------------------------------------------- 1 | gateway 2 | sample.txt 3 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/gateway/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.7.5 as build 2 | WORKDIR /go/src/github.com/alexellis/faas/gateway 3 | 4 | COPY vendor vendor 5 | 6 | COPY handlers handlers 7 | COPY metrics metrics 8 | COPY requests requests 9 | COPY tests tests 10 | 11 | COPY types types 12 | COPY queue queue 13 | COPY plugin plugin 14 | COPY server.go . 15 | 16 | RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gateway . 17 | 18 | FROM alpine:latest 19 | WORKDIR /root/ 20 | 21 | EXPOSE 8080 22 | ENV http_proxy "" 23 | ENV https_proxy "" 24 | 25 | COPY --from=build /go/src/github.com/alexellis/faas/gateway/gateway . 26 | 27 | COPY assets assets 28 | 29 | CMD ["./gateway"] 30 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/gateway/Dockerfile.armhf: -------------------------------------------------------------------------------- 1 | FROM alexellis2/go-armhf:1.7.4 2 | 3 | WORKDIR /go/src/github.com/alexellis/faas/gateway 4 | 5 | COPY vendor vendor 6 | 7 | COPY handlers handlers 8 | COPY metrics metrics 9 | COPY requests requests 10 | COPY tests tests 11 | COPY server.go . 12 | COPY types types 13 | COPY plugin plugin 14 | 15 | RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gateway . 16 | 17 | FROM armhf/alpine:latest 18 | WORKDIR /root/ 19 | 20 | EXPOSE 8080 21 | ENV http_proxy "" 22 | ENV https_proxy "" 23 | 24 | COPY --from=0 /go/src/github.com/alexellis/faas/gateway/gateway . 25 | 26 | COPY assets assets 27 | 28 | CMD ["./gateway"] 29 | 30 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/gateway/build.armhf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo Building functions/gateway:build-armhf 3 | 4 | docker build --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy \ 5 | -t functions/gateway:build-armhf . -f Dockerfile.build.armhf 6 | 7 | docker create --name gateway_extract functions/gateway:build-armhf echo 8 | docker cp gateway_extract:/go/src/github.com/alexellis/faas/gateway/app ./gateway 9 | docker rm -f gateway_extract 10 | 11 | echo Building functions/gateway:latest-armhf-dev 12 | 13 | docker build -t functions/gateway:latest-armhf-dev . 14 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/gateway/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export eTAG="latest-dev" 4 | echo $1 5 | if [ $1 ] ; then 6 | echo "set this" 7 | eTAG=$1 8 | fi 9 | 10 | echo Building functions/gateway:$eTAG 11 | 12 | docker build --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy \ 13 | -t functions/gateway:$eTAG . 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/gateway/requests/requests.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package requests 5 | 6 | // CreateFunctionRequest create a function in the swarm. 7 | type CreateFunctionRequest struct { 8 | // Service corresponds to a Docker Service 9 | Service string `json:"service"` 10 | 11 | // Image corresponds to a Docker image 12 | Image string `json:"image"` 13 | 14 | // Network is specific to Docker Swarm - default overlay network is: func_functions 15 | Network string `json:"network"` 16 | 17 | // EnvProcess corresponds to the fprocess variable for your container watchdog. 18 | EnvProcess string `json:"envProcess"` 19 | 20 | // EnvVars provides overrides for functions. 21 | EnvVars map[string]string `json:"envVars"` 22 | 23 | // RegistryAuth is the registry authentication (optional) 24 | // in the same encoded format as Docker native credentials 25 | // (see ~/.docker/config.json) 26 | RegistryAuth string `json:"registryAuth,omitempty"` 27 | 28 | // Constraints are specific to back-end orchestration platform 29 | Constraints []string `json:"constraints"` 30 | } 31 | 32 | // DeleteFunctionRequest delete a deployed function 33 | type DeleteFunctionRequest struct { 34 | FunctionName string `json:"functionName"` 35 | } 36 | 37 | // PrometheusInnerAlertLabel PrometheusInnerAlertLabel 38 | type PrometheusInnerAlertLabel struct { 39 | AlertName string `json:"alertname"` 40 | FunctionName string `json:"function_name"` 41 | } 42 | 43 | // PrometheusInnerAlert PrometheusInnerAlert 44 | type PrometheusInnerAlert struct { 45 | Status string `json:"status"` 46 | Labels PrometheusInnerAlertLabel `json:"labels"` 47 | } 48 | 49 | // PrometheusAlert as produced by AlertManager 50 | type PrometheusAlert struct { 51 | Status string `json:"status"` 52 | Receiver string `json:"receiver"` 53 | Alerts []PrometheusInnerAlert `json:"alerts"` 54 | } 55 | 56 | // Function exported for system/functions endpoint 57 | type Function struct { 58 | Name string `json:"name"` 59 | Image string `json:"image"` 60 | InvocationCount float64 `json:"invocationCount"` // TODO: shouldn't this be int64? 61 | Replicas uint64 `json:"replicas"` 62 | EnvProcess string `json:"envProcess"` 63 | } 64 | 65 | // AsyncReport is the report from a function executed on a queue worker. 66 | type AsyncReport struct { 67 | FunctionName string `json:"name"` 68 | StatusCode int `json:"statusCode"` 69 | TimeTaken float64 `json:"timeTaken"` 70 | } 71 | -------------------------------------------------------------------------------- /vendor/github.com/alexellis/faas/gateway/vendor.conf: -------------------------------------------------------------------------------- 1 | github.com/docker/docker 89658bed64c2a8fe05a978e5b87dbec409d57a0f 2 | github.com/gogo/protobuf dda3e8acadcc9affc16faf33fbb229db78399245 3 | github.com/opencontainers/image-spec 9e2ed30b411505b510b4ab080c4035d71bd56b44 4 | github.com/opencontainers/go-digest 279bed98673dd5bef374d3b6e4b09e2af76183bf 5 | github.com/gorilla/mux ac112f7d75a0714af1bd86ab17749b31f7809640 6 | github.com/prometheus/client_golang 26b897001974f2b4ee6688377873e4d6f61d533c 7 | github.com/prometheus/client_model 6f3806018612930941127f2a7c6c453ba2c527d2 8 | github.com/golang/protobuf 0a4f71a498b7c4812f64969510bcb4eca251e33a 9 | github.com/beorn7/perks 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9 10 | github.com/prometheus/common 3e6a7635bac6573d43f49f97b47eb9bda195dba8 11 | github.com/prometheus/procfs e645f4e5aaa8506fc71d6edbc5c4ff02c04c46f2 12 | github.com/matttproud/golang_protobuf_extensions c12348ce28de40eed0136aa2b644d0ee0650e56c 13 | github.com/gorilla/context 08b5f424b9271eedf6f9f0ce86cb9396ed337a42 14 | github.com/docker/distribution f86db6b22663a27ba4d278220b7e34be528b1e79 15 | github.com/spf13/pflag e57e3eeb33f795204c1ca35f56c44f83227c6e66 16 | github.com/Nvveen/Gotty cd527374f1e5bff4938207604a14f2e38a9cf512 17 | github.com/Azure/go-ansiterm 19f72df4d05d31cbe1c56bfc8045c96babff6c7e 18 | golang.org/x/sys abf9c25f54453410d0c6668e519582a9e1115027 19 | github.com/Sirupsen/logrus 10f801ebc38b33738c9d17d50860f484a0988ff5 20 | github.com/docker/libtrust aabc10ec26b754e797f9028f4589c5b7bd90dc20 21 | github.com/Microsoft/go-winio c4dc1301f1dc0307acd38e611aa375a64dfe0642 22 | github.com/docker/go-connections 3ede32e2033de7505e6500d6c868c2b9ed9f169d 23 | github.com/docker/go-units 0dadbb0345b35ec7ef35e228dabb8de89a65bf52 24 | github.com/pkg/errors c605e284fe17294bda444b34710735b29d1a9d90 25 | 26 | -------------------------------------------------------------------------------- /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: 1.7 12 | - go: 1.8 13 | - go: tip 14 | 15 | install: 16 | - # Skip 17 | 18 | script: 19 | - go get -t -v ./... 20 | - diff -u <(echo -n) <(gofmt -d .) 21 | - go tool vet . 22 | - go test -v -race ./... 23 | -------------------------------------------------------------------------------- /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/context_gorilla.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "net/http" 7 | 8 | "github.com/gorilla/context" 9 | ) 10 | 11 | func contextGet(r *http.Request, key interface{}) interface{} { 12 | return context.Get(r, key) 13 | } 14 | 15 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 16 | if val == nil { 17 | return r 18 | } 19 | 20 | context.Set(r, key, val) 21 | return r 22 | } 23 | 24 | func contextClear(r *http.Request) { 25 | context.Clear(r) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/context_native.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "context" 7 | "net/http" 8 | ) 9 | 10 | func contextGet(r *http.Request, key interface{}) interface{} { 11 | return r.Context().Value(key) 12 | } 13 | 14 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 15 | if val == nil { 16 | return r 17 | } 18 | 19 | return r.WithContext(context.WithValue(r.Context(), key, val)) 20 | } 21 | 22 | func contextClear(r *http.Request) { 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /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 | 3 | go: 4 | - 1.1 5 | - 1.2 6 | - tip 7 | -------------------------------------------------------------------------------- /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/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 | // Decode returns io.EOF when the message is empty or all whitespace. 52 | // Convert to io.ErrUnexpectedEOF so that application can distinguish 53 | // between an error reading the JSON value and the connection closing. 54 | err = io.ErrUnexpectedEOF 55 | } 56 | return err 57 | } 58 | -------------------------------------------------------------------------------- /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/pkg/errors/.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 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.4.3 5 | - 1.5.4 6 | - 1.6.2 7 | - tip 8 | 9 | script: 10 | - go test -v ./... 11 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Dave Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/README.md: -------------------------------------------------------------------------------- 1 | # errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) 2 | 3 | Package errors provides simple error handling primitives. 4 | 5 | `go get github.com/pkg/errors` 6 | 7 | The traditional error handling idiom in Go is roughly akin to 8 | ```go 9 | if err != nil { 10 | return err 11 | } 12 | ``` 13 | which applied recursively up the call stack results in error reports without context or debugging information. The errors package allows programmers to add context to the failure path in their code in a way that does not destroy the original value of the error. 14 | 15 | ## Adding context to an error 16 | 17 | The errors.Wrap function returns a new error that adds context to the original error. For example 18 | ```go 19 | _, err := ioutil.ReadAll(r) 20 | if err != nil { 21 | return errors.Wrap(err, "read failed") 22 | } 23 | ``` 24 | ## Retrieving the cause of an error 25 | 26 | Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`. 27 | ```go 28 | type causer interface { 29 | Cause() error 30 | } 31 | ``` 32 | `errors.Cause` will recursively retrieve the topmost error which does not implement `causer`, which is assumed to be the original cause. For example: 33 | ```go 34 | switch err := errors.Cause(err).(type) { 35 | case *MyError: 36 | // handle specifically 37 | default: 38 | // unknown error 39 | } 40 | ``` 41 | 42 | [Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). 43 | 44 | ## Contributing 45 | 46 | We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high. 47 | 48 | Before proposing a change, please discuss your change by raising an issue. 49 | 50 | ## Licence 51 | 52 | BSD-2-Clause 53 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/.dockerignore: -------------------------------------------------------------------------------- 1 | ./bin 2 | ./.dapper 3 | ./dist 4 | ./.trash-cache 5 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/.drone.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | build: 3 | image: rancher/dapper:1.10.3 4 | volumes: 5 | - /var/run/docker.sock:/var/run/docker.sock 6 | commands: 7 | - dapper ci 8 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/.gitignore: -------------------------------------------------------------------------------- 1 | /.dapper 2 | /bin 3 | /dist 4 | *.swp 5 | /.trash-cache 6 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/Dockerfile.dapper: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | # FROM arm=armhf/ubuntu:16.04 3 | 4 | ARG DAPPER_HOST_ARCH=amd64 5 | ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} 6 | 7 | RUN apt-get update && \ 8 | apt-get install -y gcc ca-certificates git wget curl vim less file && \ 9 | rm -f /bin/sh && ln -s /bin/bash /bin/sh 10 | 11 | ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \ 12 | GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash 13 | 14 | ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \ 15 | DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \ 16 | DOCKER_URL=DOCKER_URL_${ARCH} 17 | RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker 18 | 19 | RUN wget -O - https://storage.googleapis.com/golang/go1.7.1.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \ 20 | go get github.com/rancher/trash && go get github.com/golang/lint/golint 21 | 22 | ENV DAPPER_SOURCE /go/src/github.com/rancher/go-rancher/ 23 | ENV DAPPER_OUTPUT ./bin 24 | ENV DAPPER_DOCKER_SOCKET true 25 | ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache 26 | ENV HOME ${DAPPER_SOURCE} 27 | WORKDIR ${DAPPER_SOURCE} 28 | 29 | ENTRYPOINT ["./scripts/entry"] 30 | CMD ["ci"] 31 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/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 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/README.md: -------------------------------------------------------------------------------- 1 | # Go Bindings for Rancher API 2 | 3 | # Generating Code 4 | First, you must have a master version of Rancher running. The best way to do this is: 5 | ```sh 6 | docker run -p 8080:8080 -d rancher/server:master 7 | ``` 8 | 9 | Once Rancher is running, you can run the gen-schema.sh script: 10 | ```sh 11 | ./scripts/gen-schema.sh http://:8080 12 | 13 | # The default url is http://localhost:8080, so if rancher/server is listening on localhost, you can omit the url: 14 | ./scripts/gen-schema.sh 15 | ``` 16 | 17 | This will add, remove, and modify go files appropriately. Submit a PR that includes *all* these changes. 18 | 19 | ## Important caveats 20 | 1. If you are running on macOS, you must have gnu-sed installed as sed for this to work properly. 21 | 2. If you are running against cattle that is running out of an IDE and you don't have go-machine-service running (you probably don't), you'll see a number of unexpected removed or modified files like `generated_host.go` `generated_machine.go` and `generated_*config.go`. 22 | 23 | # Building 24 | 25 | ```sh 26 | godep go build ./client 27 | ``` 28 | 29 | # Tests 30 | 31 | ```sh 32 | godep go test ./client 33 | ``` 34 | # Contact 35 | For bugs, questions, comments, corrections, suggestions, etc., open an issue in 36 | [rancher/rancher](//github.com/rancher/rancher/issues) with a title starting with `[go-rancher] `. 37 | 38 | Or just [click here](//github.com/rancher/rancher/issues/new?title=%5Bgo-rancher%5D%20) to create a new issue. 39 | 40 | 41 | # License 42 | Copyright (c) 2014-2015 [Rancher Labs, Inc.](http://rancher.com) 43 | 44 | Licensed under the Apache License, Version 2.0 (the "License"); 45 | you may not use this file except in compliance with the License. 46 | You may obtain a copy of the License at 47 | 48 | [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) 49 | 50 | Unless required by applicable law or agreed to in writing, software 51 | distributed under the License is distributed on an "AS IS" BASIS, 52 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 53 | See the License for the specific language governing permissions and 54 | limitations under the License. 55 | 56 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/trash.conf: -------------------------------------------------------------------------------- 1 | github.com/pkg/errors 1d2e60385a13aaa66134984235061c2f9302520e 2 | github.com/gorilla/context 215affda49addc4c8ef7e2534915df2c8c35c6cd 3 | github.com/gorilla/mux f15e0c49460fd49eebe2bcc8486b05d1bef68d3a 4 | github.com/gorilla/websocket 1551221275a7bd42978745a376b2531f791d88f3 5 | github.com/Sirupsen/logrus 26709e2714106fb8ad40b773b711ebce25b78914 6 | gopkg.in/yaml.v2 a83829b6f1293c91addabc89d0571c246397bbf4 7 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/gorilla/websocket" 7 | ) 8 | 9 | type RancherBaseClientImpl struct { 10 | Opts *ClientOpts 11 | Schemas *Schemas 12 | Types map[string]Schema 13 | } 14 | 15 | type RancherBaseClient interface { 16 | Websocket(string, map[string][]string) (*websocket.Conn, *http.Response, error) 17 | List(string, *ListOpts, interface{}) error 18 | Post(string, interface{}, interface{}) error 19 | GetLink(Resource, string, interface{}) error 20 | Create(string, interface{}, interface{}) error 21 | Update(string, *Resource, interface{}, interface{}) error 22 | ById(string, string, interface{}) error 23 | Delete(*Resource) error 24 | Reload(*Resource, interface{}) error 25 | Action(string, string, *Resource, interface{}, interface{}) error 26 | GetOpts() *ClientOpts 27 | GetSchemas() *Schemas 28 | GetTypes() map[string]Schema 29 | 30 | doGet(string, *ListOpts, interface{}) error 31 | doList(string, *ListOpts, interface{}) error 32 | doNext(string, interface{}) error 33 | doModify(string, string, interface{}, interface{}) error 34 | doCreate(string, interface{}, interface{}) error 35 | doUpdate(string, *Resource, interface{}, interface{}) error 36 | doById(string, string, interface{}) error 37 | doResourceDelete(string, *Resource) error 38 | doAction(string, string, *Resource, interface{}, interface{}) error 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ActiveSettingClient 25 | } 26 | 27 | type ActiveSettingClient struct { 28 | rancherClient *RancherClient 29 | } 30 | 31 | type ActiveSettingOperations interface { 32 | List(opts *ListOpts) (*ActiveSettingCollection, error) 33 | Create(opts *ActiveSetting) (*ActiveSetting, error) 34 | Update(existing *ActiveSetting, updates interface{}) (*ActiveSetting, error) 35 | ById(id string) (*ActiveSetting, error) 36 | Delete(container *ActiveSetting) error 37 | } 38 | 39 | func newActiveSettingClient(rancherClient *RancherClient) *ActiveSettingClient { 40 | return &ActiveSettingClient{ 41 | rancherClient: rancherClient, 42 | } 43 | } 44 | 45 | func (c *ActiveSettingClient) Create(container *ActiveSetting) (*ActiveSetting, error) { 46 | resp := &ActiveSetting{} 47 | err := c.rancherClient.doCreate(ACTIVE_SETTING_TYPE, container, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *ActiveSettingClient) Update(existing *ActiveSetting, updates interface{}) (*ActiveSetting, error) { 52 | resp := &ActiveSetting{} 53 | err := c.rancherClient.doUpdate(ACTIVE_SETTING_TYPE, &existing.Resource, updates, resp) 54 | return resp, err 55 | } 56 | 57 | func (c *ActiveSettingClient) List(opts *ListOpts) (*ActiveSettingCollection, error) { 58 | resp := &ActiveSettingCollection{} 59 | err := c.rancherClient.doList(ACTIVE_SETTING_TYPE, opts, resp) 60 | resp.client = c 61 | return resp, err 62 | } 63 | 64 | func (cc *ActiveSettingCollection) Next() (*ActiveSettingCollection, error) { 65 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 66 | resp := &ActiveSettingCollection{} 67 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 68 | resp.client = cc.client 69 | return resp, err 70 | } 71 | return nil, nil 72 | } 73 | 74 | func (c *ActiveSettingClient) ById(id string) (*ActiveSetting, error) { 75 | resp := &ActiveSetting{} 76 | err := c.rancherClient.doById(ACTIVE_SETTING_TYPE, id, resp) 77 | if apiError, ok := err.(*ApiError); ok { 78 | if apiError.StatusCode == 404 { 79 | return nil, nil 80 | } 81 | } 82 | return resp, err 83 | } 84 | 85 | func (c *ActiveSettingClient) Delete(container *ActiveSetting) error { 86 | return c.rancherClient.doResourceDelete(ACTIVE_SETTING_TYPE, &container.Resource) 87 | } 88 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *AddOutputsInputClient 17 | } 18 | 19 | type AddOutputsInputClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type AddOutputsInputOperations interface { 24 | List(opts *ListOpts) (*AddOutputsInputCollection, error) 25 | Create(opts *AddOutputsInput) (*AddOutputsInput, error) 26 | Update(existing *AddOutputsInput, updates interface{}) (*AddOutputsInput, error) 27 | ById(id string) (*AddOutputsInput, error) 28 | Delete(container *AddOutputsInput) error 29 | } 30 | 31 | func newAddOutputsInputClient(rancherClient *RancherClient) *AddOutputsInputClient { 32 | return &AddOutputsInputClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *AddOutputsInputClient) Create(container *AddOutputsInput) (*AddOutputsInput, error) { 38 | resp := &AddOutputsInput{} 39 | err := c.rancherClient.doCreate(ADD_OUTPUTS_INPUT_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *AddOutputsInputClient) Update(existing *AddOutputsInput, updates interface{}) (*AddOutputsInput, error) { 44 | resp := &AddOutputsInput{} 45 | err := c.rancherClient.doUpdate(ADD_OUTPUTS_INPUT_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *AddOutputsInputClient) List(opts *ListOpts) (*AddOutputsInputCollection, error) { 50 | resp := &AddOutputsInputCollection{} 51 | err := c.rancherClient.doList(ADD_OUTPUTS_INPUT_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *AddOutputsInputCollection) Next() (*AddOutputsInputCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &AddOutputsInputCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *AddOutputsInputClient) ById(id string) (*AddOutputsInput, error) { 67 | resp := &AddOutputsInput{} 68 | err := c.rancherClient.doById(ADD_OUTPUTS_INPUT_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *AddOutputsInputClient) Delete(container *AddOutputsInput) error { 78 | return c.rancherClient.doResourceDelete(ADD_OUTPUTS_INPUT_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *BaseMachineConfigClient 15 | } 16 | 17 | type BaseMachineConfigClient struct { 18 | rancherClient *RancherClient 19 | } 20 | 21 | type BaseMachineConfigOperations interface { 22 | List(opts *ListOpts) (*BaseMachineConfigCollection, error) 23 | Create(opts *BaseMachineConfig) (*BaseMachineConfig, error) 24 | Update(existing *BaseMachineConfig, updates interface{}) (*BaseMachineConfig, error) 25 | ById(id string) (*BaseMachineConfig, error) 26 | Delete(container *BaseMachineConfig) error 27 | } 28 | 29 | func newBaseMachineConfigClient(rancherClient *RancherClient) *BaseMachineConfigClient { 30 | return &BaseMachineConfigClient{ 31 | rancherClient: rancherClient, 32 | } 33 | } 34 | 35 | func (c *BaseMachineConfigClient) Create(container *BaseMachineConfig) (*BaseMachineConfig, error) { 36 | resp := &BaseMachineConfig{} 37 | err := c.rancherClient.doCreate(BASE_MACHINE_CONFIG_TYPE, container, resp) 38 | return resp, err 39 | } 40 | 41 | func (c *BaseMachineConfigClient) Update(existing *BaseMachineConfig, updates interface{}) (*BaseMachineConfig, error) { 42 | resp := &BaseMachineConfig{} 43 | err := c.rancherClient.doUpdate(BASE_MACHINE_CONFIG_TYPE, &existing.Resource, updates, resp) 44 | return resp, err 45 | } 46 | 47 | func (c *BaseMachineConfigClient) List(opts *ListOpts) (*BaseMachineConfigCollection, error) { 48 | resp := &BaseMachineConfigCollection{} 49 | err := c.rancherClient.doList(BASE_MACHINE_CONFIG_TYPE, opts, resp) 50 | resp.client = c 51 | return resp, err 52 | } 53 | 54 | func (cc *BaseMachineConfigCollection) Next() (*BaseMachineConfigCollection, error) { 55 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 56 | resp := &BaseMachineConfigCollection{} 57 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 58 | resp.client = cc.client 59 | return resp, err 60 | } 61 | return nil, nil 62 | } 63 | 64 | func (c *BaseMachineConfigClient) ById(id string) (*BaseMachineConfig, error) { 65 | resp := &BaseMachineConfig{} 66 | err := c.rancherClient.doById(BASE_MACHINE_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 *BaseMachineConfigClient) Delete(container *BaseMachineConfig) error { 76 | return c.rancherClient.doResourceDelete(BASE_MACHINE_CONFIG_TYPE, &container.Resource) 77 | } 78 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_binding.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | BINDING_TYPE = "binding" 5 | ) 6 | 7 | type Binding struct { 8 | Resource 9 | 10 | Services map[string]interface{} `json:"services,omitempty" yaml:"services,omitempty"` 11 | } 12 | 13 | type BindingCollection struct { 14 | Collection 15 | Data []Binding `json:"data,omitempty"` 16 | client *BindingClient 17 | } 18 | 19 | type BindingClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type BindingOperations interface { 24 | List(opts *ListOpts) (*BindingCollection, error) 25 | Create(opts *Binding) (*Binding, error) 26 | Update(existing *Binding, updates interface{}) (*Binding, error) 27 | ById(id string) (*Binding, error) 28 | Delete(container *Binding) error 29 | } 30 | 31 | func newBindingClient(rancherClient *RancherClient) *BindingClient { 32 | return &BindingClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *BindingClient) Create(container *Binding) (*Binding, error) { 38 | resp := &Binding{} 39 | err := c.rancherClient.doCreate(BINDING_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *BindingClient) Update(existing *Binding, updates interface{}) (*Binding, error) { 44 | resp := &Binding{} 45 | err := c.rancherClient.doUpdate(BINDING_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *BindingClient) List(opts *ListOpts) (*BindingCollection, error) { 50 | resp := &BindingCollection{} 51 | err := c.rancherClient.doList(BINDING_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *BindingCollection) Next() (*BindingCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &BindingCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *BindingClient) ById(id string) (*Binding, error) { 67 | resp := &Binding{} 68 | err := c.rancherClient.doById(BINDING_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *BindingClient) Delete(container *Binding) error { 78 | return c.rancherClient.doResourceDelete(BINDING_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ChangeSecretInputClient 19 | } 20 | 21 | type ChangeSecretInputClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type ChangeSecretInputOperations interface { 26 | List(opts *ListOpts) (*ChangeSecretInputCollection, error) 27 | Create(opts *ChangeSecretInput) (*ChangeSecretInput, error) 28 | Update(existing *ChangeSecretInput, updates interface{}) (*ChangeSecretInput, error) 29 | ById(id string) (*ChangeSecretInput, error) 30 | Delete(container *ChangeSecretInput) error 31 | } 32 | 33 | func newChangeSecretInputClient(rancherClient *RancherClient) *ChangeSecretInputClient { 34 | return &ChangeSecretInputClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *ChangeSecretInputClient) Create(container *ChangeSecretInput) (*ChangeSecretInput, error) { 40 | resp := &ChangeSecretInput{} 41 | err := c.rancherClient.doCreate(CHANGE_SECRET_INPUT_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *ChangeSecretInputClient) Update(existing *ChangeSecretInput, updates interface{}) (*ChangeSecretInput, error) { 46 | resp := &ChangeSecretInput{} 47 | err := c.rancherClient.doUpdate(CHANGE_SECRET_INPUT_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *ChangeSecretInputClient) List(opts *ListOpts) (*ChangeSecretInputCollection, error) { 52 | resp := &ChangeSecretInputCollection{} 53 | err := c.rancherClient.doList(CHANGE_SECRET_INPUT_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *ChangeSecretInputCollection) Next() (*ChangeSecretInputCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &ChangeSecretInputCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *ChangeSecretInputClient) ById(id string) (*ChangeSecretInput, error) { 69 | resp := &ChangeSecretInput{} 70 | err := c.rancherClient.doById(CHANGE_SECRET_INPUT_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 *ChangeSecretInputClient) Delete(container *ChangeSecretInput) error { 80 | return c.rancherClient.doResourceDelete(CHANGE_SECRET_INPUT_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ComposeConfigClient 19 | } 20 | 21 | type ComposeConfigClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type ComposeConfigOperations interface { 26 | List(opts *ListOpts) (*ComposeConfigCollection, error) 27 | Create(opts *ComposeConfig) (*ComposeConfig, error) 28 | Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error) 29 | ById(id string) (*ComposeConfig, error) 30 | Delete(container *ComposeConfig) error 31 | } 32 | 33 | func newComposeConfigClient(rancherClient *RancherClient) *ComposeConfigClient { 34 | return &ComposeConfigClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *ComposeConfigClient) Create(container *ComposeConfig) (*ComposeConfig, error) { 40 | resp := &ComposeConfig{} 41 | err := c.rancherClient.doCreate(COMPOSE_CONFIG_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *ComposeConfigClient) Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error) { 46 | resp := &ComposeConfig{} 47 | err := c.rancherClient.doUpdate(COMPOSE_CONFIG_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *ComposeConfigClient) List(opts *ListOpts) (*ComposeConfigCollection, error) { 52 | resp := &ComposeConfigCollection{} 53 | err := c.rancherClient.doList(COMPOSE_CONFIG_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *ComposeConfigCollection) Next() (*ComposeConfigCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &ComposeConfigCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *ComposeConfigClient) ById(id string) (*ComposeConfig, error) { 69 | resp := &ComposeConfig{} 70 | err := c.rancherClient.doById(COMPOSE_CONFIG_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 *ComposeConfigClient) Delete(container *ComposeConfig) error { 80 | return c.rancherClient.doResourceDelete(COMPOSE_CONFIG_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ComposeConfigInputClient 17 | } 18 | 19 | type ComposeConfigInputClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type ComposeConfigInputOperations interface { 24 | List(opts *ListOpts) (*ComposeConfigInputCollection, error) 25 | Create(opts *ComposeConfigInput) (*ComposeConfigInput, error) 26 | Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error) 27 | ById(id string) (*ComposeConfigInput, error) 28 | Delete(container *ComposeConfigInput) error 29 | } 30 | 31 | func newComposeConfigInputClient(rancherClient *RancherClient) *ComposeConfigInputClient { 32 | return &ComposeConfigInputClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *ComposeConfigInputClient) Create(container *ComposeConfigInput) (*ComposeConfigInput, error) { 38 | resp := &ComposeConfigInput{} 39 | err := c.rancherClient.doCreate(COMPOSE_CONFIG_INPUT_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *ComposeConfigInputClient) Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error) { 44 | resp := &ComposeConfigInput{} 45 | err := c.rancherClient.doUpdate(COMPOSE_CONFIG_INPUT_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *ComposeConfigInputClient) List(opts *ListOpts) (*ComposeConfigInputCollection, error) { 50 | resp := &ComposeConfigInputCollection{} 51 | err := c.rancherClient.doList(COMPOSE_CONFIG_INPUT_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *ComposeConfigInputCollection) Next() (*ComposeConfigInputCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &ComposeConfigInputCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *ComposeConfigInputClient) ById(id string) (*ComposeConfigInput, error) { 67 | resp := &ComposeConfigInput{} 68 | err := c.rancherClient.doById(COMPOSE_CONFIG_INPUT_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *ComposeConfigInputClient) Delete(container *ComposeConfigInput) error { 78 | return c.rancherClient.doResourceDelete(COMPOSE_CONFIG_INPUT_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ConfigItemClient 19 | } 20 | 21 | type ConfigItemClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type ConfigItemOperations interface { 26 | List(opts *ListOpts) (*ConfigItemCollection, error) 27 | Create(opts *ConfigItem) (*ConfigItem, error) 28 | Update(existing *ConfigItem, updates interface{}) (*ConfigItem, error) 29 | ById(id string) (*ConfigItem, error) 30 | Delete(container *ConfigItem) error 31 | } 32 | 33 | func newConfigItemClient(rancherClient *RancherClient) *ConfigItemClient { 34 | return &ConfigItemClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *ConfigItemClient) Create(container *ConfigItem) (*ConfigItem, error) { 40 | resp := &ConfigItem{} 41 | err := c.rancherClient.doCreate(CONFIG_ITEM_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *ConfigItemClient) Update(existing *ConfigItem, updates interface{}) (*ConfigItem, error) { 46 | resp := &ConfigItem{} 47 | err := c.rancherClient.doUpdate(CONFIG_ITEM_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *ConfigItemClient) List(opts *ListOpts) (*ConfigItemCollection, error) { 52 | resp := &ConfigItemCollection{} 53 | err := c.rancherClient.doList(CONFIG_ITEM_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *ConfigItemCollection) Next() (*ConfigItemCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &ConfigItemCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *ConfigItemClient) ById(id string) (*ConfigItem, error) { 69 | resp := &ConfigItem{} 70 | err := c.rancherClient.doById(CONFIG_ITEM_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 *ConfigItemClient) Delete(container *ConfigItem) error { 80 | return c.rancherClient.doResourceDelete(CONFIG_ITEM_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ContainerExecClient 23 | } 24 | 25 | type ContainerExecClient struct { 26 | rancherClient *RancherClient 27 | } 28 | 29 | type ContainerExecOperations interface { 30 | List(opts *ListOpts) (*ContainerExecCollection, error) 31 | Create(opts *ContainerExec) (*ContainerExec, error) 32 | Update(existing *ContainerExec, updates interface{}) (*ContainerExec, error) 33 | ById(id string) (*ContainerExec, error) 34 | Delete(container *ContainerExec) error 35 | } 36 | 37 | func newContainerExecClient(rancherClient *RancherClient) *ContainerExecClient { 38 | return &ContainerExecClient{ 39 | rancherClient: rancherClient, 40 | } 41 | } 42 | 43 | func (c *ContainerExecClient) Create(container *ContainerExec) (*ContainerExec, error) { 44 | resp := &ContainerExec{} 45 | err := c.rancherClient.doCreate(CONTAINER_EXEC_TYPE, container, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *ContainerExecClient) Update(existing *ContainerExec, updates interface{}) (*ContainerExec, error) { 50 | resp := &ContainerExec{} 51 | err := c.rancherClient.doUpdate(CONTAINER_EXEC_TYPE, &existing.Resource, updates, resp) 52 | return resp, err 53 | } 54 | 55 | func (c *ContainerExecClient) List(opts *ListOpts) (*ContainerExecCollection, error) { 56 | resp := &ContainerExecCollection{} 57 | err := c.rancherClient.doList(CONTAINER_EXEC_TYPE, opts, resp) 58 | resp.client = c 59 | return resp, err 60 | } 61 | 62 | func (cc *ContainerExecCollection) Next() (*ContainerExecCollection, error) { 63 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 64 | resp := &ContainerExecCollection{} 65 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 66 | resp.client = cc.client 67 | return resp, err 68 | } 69 | return nil, nil 70 | } 71 | 72 | func (c *ContainerExecClient) ById(id string) (*ContainerExec, error) { 73 | resp := &ContainerExec{} 74 | err := c.rancherClient.doById(CONTAINER_EXEC_TYPE, id, resp) 75 | if apiError, ok := err.(*ApiError); ok { 76 | if apiError.StatusCode == 404 { 77 | return nil, nil 78 | } 79 | } 80 | return resp, err 81 | } 82 | 83 | func (c *ContainerExecClient) Delete(container *ContainerExec) error { 84 | return c.rancherClient.doResourceDelete(CONTAINER_EXEC_TYPE, &container.Resource) 85 | } 86 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ContainerLogsClient 19 | } 20 | 21 | type ContainerLogsClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type ContainerLogsOperations interface { 26 | List(opts *ListOpts) (*ContainerLogsCollection, error) 27 | Create(opts *ContainerLogs) (*ContainerLogs, error) 28 | Update(existing *ContainerLogs, updates interface{}) (*ContainerLogs, error) 29 | ById(id string) (*ContainerLogs, error) 30 | Delete(container *ContainerLogs) error 31 | } 32 | 33 | func newContainerLogsClient(rancherClient *RancherClient) *ContainerLogsClient { 34 | return &ContainerLogsClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *ContainerLogsClient) Create(container *ContainerLogs) (*ContainerLogs, error) { 40 | resp := &ContainerLogs{} 41 | err := c.rancherClient.doCreate(CONTAINER_LOGS_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *ContainerLogsClient) Update(existing *ContainerLogs, updates interface{}) (*ContainerLogs, error) { 46 | resp := &ContainerLogs{} 47 | err := c.rancherClient.doUpdate(CONTAINER_LOGS_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *ContainerLogsClient) List(opts *ListOpts) (*ContainerLogsCollection, error) { 52 | resp := &ContainerLogsCollection{} 53 | err := c.rancherClient.doList(CONTAINER_LOGS_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *ContainerLogsCollection) Next() (*ContainerLogsCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &ContainerLogsCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *ContainerLogsClient) ById(id string) (*ContainerLogs, error) { 69 | resp := &ContainerLogs{} 70 | err := c.rancherClient.doById(CONTAINER_LOGS_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 *ContainerLogsClient) Delete(container *ContainerLogs) error { 80 | return c.rancherClient.doResourceDelete(CONTAINER_LOGS_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ContainerProxyClient 19 | } 20 | 21 | type ContainerProxyClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type ContainerProxyOperations interface { 26 | List(opts *ListOpts) (*ContainerProxyCollection, error) 27 | Create(opts *ContainerProxy) (*ContainerProxy, error) 28 | Update(existing *ContainerProxy, updates interface{}) (*ContainerProxy, error) 29 | ById(id string) (*ContainerProxy, error) 30 | Delete(container *ContainerProxy) error 31 | } 32 | 33 | func newContainerProxyClient(rancherClient *RancherClient) *ContainerProxyClient { 34 | return &ContainerProxyClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *ContainerProxyClient) Create(container *ContainerProxy) (*ContainerProxy, error) { 40 | resp := &ContainerProxy{} 41 | err := c.rancherClient.doCreate(CONTAINER_PROXY_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *ContainerProxyClient) Update(existing *ContainerProxy, updates interface{}) (*ContainerProxy, error) { 46 | resp := &ContainerProxy{} 47 | err := c.rancherClient.doUpdate(CONTAINER_PROXY_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *ContainerProxyClient) List(opts *ListOpts) (*ContainerProxyCollection, error) { 52 | resp := &ContainerProxyCollection{} 53 | err := c.rancherClient.doList(CONTAINER_PROXY_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *ContainerProxyCollection) Next() (*ContainerProxyCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &ContainerProxyCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *ContainerProxyClient) ById(id string) (*ContainerProxy, error) { 69 | resp := &ContainerProxy{} 70 | err := c.rancherClient.doById(CONTAINER_PROXY_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 *ContainerProxyClient) Delete(container *ContainerProxy) error { 80 | return c.rancherClient.doResourceDelete(CONTAINER_PROXY_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *DockerBuildClient 27 | } 28 | 29 | type DockerBuildClient struct { 30 | rancherClient *RancherClient 31 | } 32 | 33 | type DockerBuildOperations interface { 34 | List(opts *ListOpts) (*DockerBuildCollection, error) 35 | Create(opts *DockerBuild) (*DockerBuild, error) 36 | Update(existing *DockerBuild, updates interface{}) (*DockerBuild, error) 37 | ById(id string) (*DockerBuild, error) 38 | Delete(container *DockerBuild) error 39 | } 40 | 41 | func newDockerBuildClient(rancherClient *RancherClient) *DockerBuildClient { 42 | return &DockerBuildClient{ 43 | rancherClient: rancherClient, 44 | } 45 | } 46 | 47 | func (c *DockerBuildClient) Create(container *DockerBuild) (*DockerBuild, error) { 48 | resp := &DockerBuild{} 49 | err := c.rancherClient.doCreate(DOCKER_BUILD_TYPE, container, resp) 50 | return resp, err 51 | } 52 | 53 | func (c *DockerBuildClient) Update(existing *DockerBuild, updates interface{}) (*DockerBuild, error) { 54 | resp := &DockerBuild{} 55 | err := c.rancherClient.doUpdate(DOCKER_BUILD_TYPE, &existing.Resource, updates, resp) 56 | return resp, err 57 | } 58 | 59 | func (c *DockerBuildClient) List(opts *ListOpts) (*DockerBuildCollection, error) { 60 | resp := &DockerBuildCollection{} 61 | err := c.rancherClient.doList(DOCKER_BUILD_TYPE, opts, resp) 62 | resp.client = c 63 | return resp, err 64 | } 65 | 66 | func (cc *DockerBuildCollection) Next() (*DockerBuildCollection, error) { 67 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 68 | resp := &DockerBuildCollection{} 69 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 70 | resp.client = cc.client 71 | return resp, err 72 | } 73 | return nil, nil 74 | } 75 | 76 | func (c *DockerBuildClient) ById(id string) (*DockerBuild, error) { 77 | resp := &DockerBuild{} 78 | err := c.rancherClient.doById(DOCKER_BUILD_TYPE, id, resp) 79 | if apiError, ok := err.(*ApiError); ok { 80 | if apiError.StatusCode == 404 { 81 | return nil, nil 82 | } 83 | } 84 | return resp, err 85 | } 86 | 87 | func (c *DockerBuildClient) Delete(container *DockerBuild) error { 88 | return c.rancherClient.doResourceDelete(DOCKER_BUILD_TYPE, &container.Resource) 89 | } 90 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *FieldDocumentationClient 17 | } 18 | 19 | type FieldDocumentationClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type FieldDocumentationOperations interface { 24 | List(opts *ListOpts) (*FieldDocumentationCollection, error) 25 | Create(opts *FieldDocumentation) (*FieldDocumentation, error) 26 | Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error) 27 | ById(id string) (*FieldDocumentation, error) 28 | Delete(container *FieldDocumentation) error 29 | } 30 | 31 | func newFieldDocumentationClient(rancherClient *RancherClient) *FieldDocumentationClient { 32 | return &FieldDocumentationClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *FieldDocumentationClient) Create(container *FieldDocumentation) (*FieldDocumentation, error) { 38 | resp := &FieldDocumentation{} 39 | err := c.rancherClient.doCreate(FIELD_DOCUMENTATION_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *FieldDocumentationClient) Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error) { 44 | resp := &FieldDocumentation{} 45 | err := c.rancherClient.doUpdate(FIELD_DOCUMENTATION_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *FieldDocumentationClient) List(opts *ListOpts) (*FieldDocumentationCollection, error) { 50 | resp := &FieldDocumentationCollection{} 51 | err := c.rancherClient.doList(FIELD_DOCUMENTATION_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *FieldDocumentationCollection) Next() (*FieldDocumentationCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &FieldDocumentationCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *FieldDocumentationClient) ById(id string) (*FieldDocumentation, error) { 67 | resp := &FieldDocumentation{} 68 | err := c.rancherClient.doById(FIELD_DOCUMENTATION_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *FieldDocumentationClient) Delete(container *FieldDocumentation) error { 78 | return c.rancherClient.doResourceDelete(FIELD_DOCUMENTATION_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *HaConfigClient 23 | } 24 | 25 | type HaConfigClient struct { 26 | rancherClient *RancherClient 27 | } 28 | 29 | type HaConfigOperations interface { 30 | List(opts *ListOpts) (*HaConfigCollection, error) 31 | Create(opts *HaConfig) (*HaConfig, error) 32 | Update(existing *HaConfig, updates interface{}) (*HaConfig, error) 33 | ById(id string) (*HaConfig, error) 34 | Delete(container *HaConfig) error 35 | } 36 | 37 | func newHaConfigClient(rancherClient *RancherClient) *HaConfigClient { 38 | return &HaConfigClient{ 39 | rancherClient: rancherClient, 40 | } 41 | } 42 | 43 | func (c *HaConfigClient) Create(container *HaConfig) (*HaConfig, error) { 44 | resp := &HaConfig{} 45 | err := c.rancherClient.doCreate(HA_CONFIG_TYPE, container, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *HaConfigClient) Update(existing *HaConfig, updates interface{}) (*HaConfig, error) { 50 | resp := &HaConfig{} 51 | err := c.rancherClient.doUpdate(HA_CONFIG_TYPE, &existing.Resource, updates, resp) 52 | return resp, err 53 | } 54 | 55 | func (c *HaConfigClient) List(opts *ListOpts) (*HaConfigCollection, error) { 56 | resp := &HaConfigCollection{} 57 | err := c.rancherClient.doList(HA_CONFIG_TYPE, opts, resp) 58 | resp.client = c 59 | return resp, err 60 | } 61 | 62 | func (cc *HaConfigCollection) Next() (*HaConfigCollection, error) { 63 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 64 | resp := &HaConfigCollection{} 65 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 66 | resp.client = cc.client 67 | return resp, err 68 | } 69 | return nil, nil 70 | } 71 | 72 | func (c *HaConfigClient) ById(id string) (*HaConfig, error) { 73 | resp := &HaConfig{} 74 | err := c.rancherClient.doById(HA_CONFIG_TYPE, id, resp) 75 | if apiError, ok := err.(*ApiError); ok { 76 | if apiError.StatusCode == 404 { 77 | return nil, nil 78 | } 79 | } 80 | return resp, err 81 | } 82 | 83 | func (c *HaConfigClient) Delete(container *HaConfig) error { 84 | return c.rancherClient.doResourceDelete(HA_CONFIG_TYPE, &container.Resource) 85 | } 86 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *HostAccessClient 19 | } 20 | 21 | type HostAccessClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type HostAccessOperations interface { 26 | List(opts *ListOpts) (*HostAccessCollection, error) 27 | Create(opts *HostAccess) (*HostAccess, error) 28 | Update(existing *HostAccess, updates interface{}) (*HostAccess, error) 29 | ById(id string) (*HostAccess, error) 30 | Delete(container *HostAccess) error 31 | } 32 | 33 | func newHostAccessClient(rancherClient *RancherClient) *HostAccessClient { 34 | return &HostAccessClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *HostAccessClient) Create(container *HostAccess) (*HostAccess, error) { 40 | resp := &HostAccess{} 41 | err := c.rancherClient.doCreate(HOST_ACCESS_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *HostAccessClient) Update(existing *HostAccess, updates interface{}) (*HostAccess, error) { 46 | resp := &HostAccess{} 47 | err := c.rancherClient.doUpdate(HOST_ACCESS_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *HostAccessClient) List(opts *ListOpts) (*HostAccessCollection, error) { 52 | resp := &HostAccessCollection{} 53 | err := c.rancherClient.doList(HOST_ACCESS_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *HostAccessCollection) Next() (*HostAccessCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &HostAccessCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *HostAccessClient) ById(id string) (*HostAccess, error) { 69 | resp := &HostAccess{} 70 | err := c.rancherClient.doById(HOST_ACCESS_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 *HostAccessClient) Delete(container *HostAccess) error { 80 | return c.rancherClient.doResourceDelete(HOST_ACCESS_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *HostApiProxyTokenClient 21 | } 22 | 23 | type HostApiProxyTokenClient struct { 24 | rancherClient *RancherClient 25 | } 26 | 27 | type HostApiProxyTokenOperations interface { 28 | List(opts *ListOpts) (*HostApiProxyTokenCollection, error) 29 | Create(opts *HostApiProxyToken) (*HostApiProxyToken, error) 30 | Update(existing *HostApiProxyToken, updates interface{}) (*HostApiProxyToken, error) 31 | ById(id string) (*HostApiProxyToken, error) 32 | Delete(container *HostApiProxyToken) error 33 | } 34 | 35 | func newHostApiProxyTokenClient(rancherClient *RancherClient) *HostApiProxyTokenClient { 36 | return &HostApiProxyTokenClient{ 37 | rancherClient: rancherClient, 38 | } 39 | } 40 | 41 | func (c *HostApiProxyTokenClient) Create(container *HostApiProxyToken) (*HostApiProxyToken, error) { 42 | resp := &HostApiProxyToken{} 43 | err := c.rancherClient.doCreate(HOST_API_PROXY_TOKEN_TYPE, container, resp) 44 | return resp, err 45 | } 46 | 47 | func (c *HostApiProxyTokenClient) Update(existing *HostApiProxyToken, updates interface{}) (*HostApiProxyToken, error) { 48 | resp := &HostApiProxyToken{} 49 | err := c.rancherClient.doUpdate(HOST_API_PROXY_TOKEN_TYPE, &existing.Resource, updates, resp) 50 | return resp, err 51 | } 52 | 53 | func (c *HostApiProxyTokenClient) List(opts *ListOpts) (*HostApiProxyTokenCollection, error) { 54 | resp := &HostApiProxyTokenCollection{} 55 | err := c.rancherClient.doList(HOST_API_PROXY_TOKEN_TYPE, opts, resp) 56 | resp.client = c 57 | return resp, err 58 | } 59 | 60 | func (cc *HostApiProxyTokenCollection) Next() (*HostApiProxyTokenCollection, error) { 61 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 62 | resp := &HostApiProxyTokenCollection{} 63 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 64 | resp.client = cc.client 65 | return resp, err 66 | } 67 | return nil, nil 68 | } 69 | 70 | func (c *HostApiProxyTokenClient) ById(id string) (*HostApiProxyToken, error) { 71 | resp := &HostApiProxyToken{} 72 | err := c.rancherClient.doById(HOST_API_PROXY_TOKEN_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 *HostApiProxyTokenClient) Delete(container *HostApiProxyToken) error { 82 | return c.rancherClient.doResourceDelete(HOST_API_PROXY_TOKEN_TYPE, &container.Resource) 83 | } 84 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *InstanceConsoleClient 21 | } 22 | 23 | type InstanceConsoleClient struct { 24 | rancherClient *RancherClient 25 | } 26 | 27 | type InstanceConsoleOperations interface { 28 | List(opts *ListOpts) (*InstanceConsoleCollection, error) 29 | Create(opts *InstanceConsole) (*InstanceConsole, error) 30 | Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error) 31 | ById(id string) (*InstanceConsole, error) 32 | Delete(container *InstanceConsole) error 33 | } 34 | 35 | func newInstanceConsoleClient(rancherClient *RancherClient) *InstanceConsoleClient { 36 | return &InstanceConsoleClient{ 37 | rancherClient: rancherClient, 38 | } 39 | } 40 | 41 | func (c *InstanceConsoleClient) Create(container *InstanceConsole) (*InstanceConsole, error) { 42 | resp := &InstanceConsole{} 43 | err := c.rancherClient.doCreate(INSTANCE_CONSOLE_TYPE, container, resp) 44 | return resp, err 45 | } 46 | 47 | func (c *InstanceConsoleClient) Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error) { 48 | resp := &InstanceConsole{} 49 | err := c.rancherClient.doUpdate(INSTANCE_CONSOLE_TYPE, &existing.Resource, updates, resp) 50 | return resp, err 51 | } 52 | 53 | func (c *InstanceConsoleClient) List(opts *ListOpts) (*InstanceConsoleCollection, error) { 54 | resp := &InstanceConsoleCollection{} 55 | err := c.rancherClient.doList(INSTANCE_CONSOLE_TYPE, opts, resp) 56 | resp.client = c 57 | return resp, err 58 | } 59 | 60 | func (cc *InstanceConsoleCollection) Next() (*InstanceConsoleCollection, error) { 61 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 62 | resp := &InstanceConsoleCollection{} 63 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 64 | resp.client = cc.client 65 | return resp, err 66 | } 67 | return nil, nil 68 | } 69 | 70 | func (c *InstanceConsoleClient) ById(id string) (*InstanceConsole, error) { 71 | resp := &InstanceConsole{} 72 | err := c.rancherClient.doById(INSTANCE_CONSOLE_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 *InstanceConsoleClient) Delete(container *InstanceConsole) error { 82 | return c.rancherClient.doResourceDelete(INSTANCE_CONSOLE_TYPE, &container.Resource) 83 | } 84 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *InstanceConsoleInputClient 15 | } 16 | 17 | type InstanceConsoleInputClient struct { 18 | rancherClient *RancherClient 19 | } 20 | 21 | type InstanceConsoleInputOperations interface { 22 | List(opts *ListOpts) (*InstanceConsoleInputCollection, error) 23 | Create(opts *InstanceConsoleInput) (*InstanceConsoleInput, error) 24 | Update(existing *InstanceConsoleInput, updates interface{}) (*InstanceConsoleInput, error) 25 | ById(id string) (*InstanceConsoleInput, error) 26 | Delete(container *InstanceConsoleInput) error 27 | } 28 | 29 | func newInstanceConsoleInputClient(rancherClient *RancherClient) *InstanceConsoleInputClient { 30 | return &InstanceConsoleInputClient{ 31 | rancherClient: rancherClient, 32 | } 33 | } 34 | 35 | func (c *InstanceConsoleInputClient) Create(container *InstanceConsoleInput) (*InstanceConsoleInput, error) { 36 | resp := &InstanceConsoleInput{} 37 | err := c.rancherClient.doCreate(INSTANCE_CONSOLE_INPUT_TYPE, container, resp) 38 | return resp, err 39 | } 40 | 41 | func (c *InstanceConsoleInputClient) Update(existing *InstanceConsoleInput, updates interface{}) (*InstanceConsoleInput, error) { 42 | resp := &InstanceConsoleInput{} 43 | err := c.rancherClient.doUpdate(INSTANCE_CONSOLE_INPUT_TYPE, &existing.Resource, updates, resp) 44 | return resp, err 45 | } 46 | 47 | func (c *InstanceConsoleInputClient) List(opts *ListOpts) (*InstanceConsoleInputCollection, error) { 48 | resp := &InstanceConsoleInputCollection{} 49 | err := c.rancherClient.doList(INSTANCE_CONSOLE_INPUT_TYPE, opts, resp) 50 | resp.client = c 51 | return resp, err 52 | } 53 | 54 | func (cc *InstanceConsoleInputCollection) Next() (*InstanceConsoleInputCollection, error) { 55 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 56 | resp := &InstanceConsoleInputCollection{} 57 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 58 | resp.client = cc.client 59 | return resp, err 60 | } 61 | return nil, nil 62 | } 63 | 64 | func (c *InstanceConsoleInputClient) ById(id string) (*InstanceConsoleInput, error) { 65 | resp := &InstanceConsoleInput{} 66 | err := c.rancherClient.doById(INSTANCE_CONSOLE_INPUT_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 *InstanceConsoleInputClient) Delete(container *InstanceConsoleInput) error { 76 | return c.rancherClient.doResourceDelete(INSTANCE_CONSOLE_INPUT_TYPE, &container.Resource) 77 | } 78 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *InstanceStopClient 19 | } 20 | 21 | type InstanceStopClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type InstanceStopOperations interface { 26 | List(opts *ListOpts) (*InstanceStopCollection, error) 27 | Create(opts *InstanceStop) (*InstanceStop, error) 28 | Update(existing *InstanceStop, updates interface{}) (*InstanceStop, error) 29 | ById(id string) (*InstanceStop, error) 30 | Delete(container *InstanceStop) error 31 | } 32 | 33 | func newInstanceStopClient(rancherClient *RancherClient) *InstanceStopClient { 34 | return &InstanceStopClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *InstanceStopClient) Create(container *InstanceStop) (*InstanceStop, error) { 40 | resp := &InstanceStop{} 41 | err := c.rancherClient.doCreate(INSTANCE_STOP_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *InstanceStopClient) Update(existing *InstanceStop, updates interface{}) (*InstanceStop, error) { 46 | resp := &InstanceStop{} 47 | err := c.rancherClient.doUpdate(INSTANCE_STOP_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *InstanceStopClient) List(opts *ListOpts) (*InstanceStopCollection, error) { 52 | resp := &InstanceStopCollection{} 53 | err := c.rancherClient.doList(INSTANCE_STOP_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *InstanceStopCollection) Next() (*InstanceStopCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &InstanceStopCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *InstanceStopClient) ById(id string) (*InstanceStop, error) { 69 | resp := &InstanceStop{} 70 | err := c.rancherClient.doById(INSTANCE_STOP_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 *InstanceStopClient) Delete(container *InstanceStop) error { 80 | return c.rancherClient.doResourceDelete(INSTANCE_STOP_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | LB_CONFIG_TYPE = "lbConfig" 5 | ) 6 | 7 | type LbConfig struct { 8 | Resource 9 | 10 | CertificateIds []string `json:"certificateIds,omitempty" yaml:"certificate_ids,omitempty"` 11 | 12 | Config string `json:"config,omitempty" yaml:"config,omitempty"` 13 | 14 | DefaultCertificateId string `json:"defaultCertificateId,omitempty" yaml:"default_certificate_id,omitempty"` 15 | 16 | PortRules []PortRule `json:"portRules,omitempty" yaml:"port_rules,omitempty"` 17 | 18 | StickinessPolicy *LoadBalancerCookieStickinessPolicy `json:"stickinessPolicy,omitempty" yaml:"stickiness_policy,omitempty"` 19 | } 20 | 21 | type LbConfigCollection struct { 22 | Collection 23 | Data []LbConfig `json:"data,omitempty"` 24 | client *LbConfigClient 25 | } 26 | 27 | type LbConfigClient struct { 28 | rancherClient *RancherClient 29 | } 30 | 31 | type LbConfigOperations interface { 32 | List(opts *ListOpts) (*LbConfigCollection, error) 33 | Create(opts *LbConfig) (*LbConfig, error) 34 | Update(existing *LbConfig, updates interface{}) (*LbConfig, error) 35 | ById(id string) (*LbConfig, error) 36 | Delete(container *LbConfig) error 37 | } 38 | 39 | func newLbConfigClient(rancherClient *RancherClient) *LbConfigClient { 40 | return &LbConfigClient{ 41 | rancherClient: rancherClient, 42 | } 43 | } 44 | 45 | func (c *LbConfigClient) Create(container *LbConfig) (*LbConfig, error) { 46 | resp := &LbConfig{} 47 | err := c.rancherClient.doCreate(LB_CONFIG_TYPE, container, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *LbConfigClient) Update(existing *LbConfig, updates interface{}) (*LbConfig, error) { 52 | resp := &LbConfig{} 53 | err := c.rancherClient.doUpdate(LB_CONFIG_TYPE, &existing.Resource, updates, resp) 54 | return resp, err 55 | } 56 | 57 | func (c *LbConfigClient) List(opts *ListOpts) (*LbConfigCollection, error) { 58 | resp := &LbConfigCollection{} 59 | err := c.rancherClient.doList(LB_CONFIG_TYPE, opts, resp) 60 | resp.client = c 61 | return resp, err 62 | } 63 | 64 | func (cc *LbConfigCollection) Next() (*LbConfigCollection, error) { 65 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 66 | resp := &LbConfigCollection{} 67 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 68 | resp.client = cc.client 69 | return resp, err 70 | } 71 | return nil, nil 72 | } 73 | 74 | func (c *LbConfigClient) ById(id string) (*LbConfig, error) { 75 | resp := &LbConfig{} 76 | err := c.rancherClient.doById(LB_CONFIG_TYPE, id, resp) 77 | if apiError, ok := err.(*ApiError); ok { 78 | if apiError.StatusCode == 404 { 79 | return nil, nil 80 | } 81 | } 82 | return resp, err 83 | } 84 | 85 | func (c *LbConfigClient) Delete(container *LbConfig) error { 86 | return c.rancherClient.doResourceDelete(LB_CONFIG_TYPE, &container.Resource) 87 | } 88 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | LB_TARGET_CONFIG_TYPE = "lbTargetConfig" 5 | ) 6 | 7 | type LbTargetConfig struct { 8 | Resource 9 | 10 | PortRules []TargetPortRule `json:"portRules,omitempty" yaml:"port_rules,omitempty"` 11 | } 12 | 13 | type LbTargetConfigCollection struct { 14 | Collection 15 | Data []LbTargetConfig `json:"data,omitempty"` 16 | client *LbTargetConfigClient 17 | } 18 | 19 | type LbTargetConfigClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type LbTargetConfigOperations interface { 24 | List(opts *ListOpts) (*LbTargetConfigCollection, error) 25 | Create(opts *LbTargetConfig) (*LbTargetConfig, error) 26 | Update(existing *LbTargetConfig, updates interface{}) (*LbTargetConfig, error) 27 | ById(id string) (*LbTargetConfig, error) 28 | Delete(container *LbTargetConfig) error 29 | } 30 | 31 | func newLbTargetConfigClient(rancherClient *RancherClient) *LbTargetConfigClient { 32 | return &LbTargetConfigClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *LbTargetConfigClient) Create(container *LbTargetConfig) (*LbTargetConfig, error) { 38 | resp := &LbTargetConfig{} 39 | err := c.rancherClient.doCreate(LB_TARGET_CONFIG_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *LbTargetConfigClient) Update(existing *LbTargetConfig, updates interface{}) (*LbTargetConfig, error) { 44 | resp := &LbTargetConfig{} 45 | err := c.rancherClient.doUpdate(LB_TARGET_CONFIG_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *LbTargetConfigClient) List(opts *ListOpts) (*LbTargetConfigCollection, error) { 50 | resp := &LbTargetConfigCollection{} 51 | err := c.rancherClient.doList(LB_TARGET_CONFIG_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *LbTargetConfigCollection) Next() (*LbTargetConfigCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &LbTargetConfigCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *LbTargetConfigClient) ById(id string) (*LbTargetConfig, error) { 67 | resp := &LbTargetConfig{} 68 | err := c.rancherClient.doById(LB_TARGET_CONFIG_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *LbTargetConfigClient) Delete(container *LbTargetConfig) error { 78 | return c.rancherClient.doResourceDelete(LB_TARGET_CONFIG_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *LogConfigClient 19 | } 20 | 21 | type LogConfigClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type LogConfigOperations interface { 26 | List(opts *ListOpts) (*LogConfigCollection, error) 27 | Create(opts *LogConfig) (*LogConfig, error) 28 | Update(existing *LogConfig, updates interface{}) (*LogConfig, error) 29 | ById(id string) (*LogConfig, error) 30 | Delete(container *LogConfig) error 31 | } 32 | 33 | func newLogConfigClient(rancherClient *RancherClient) *LogConfigClient { 34 | return &LogConfigClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *LogConfigClient) Create(container *LogConfig) (*LogConfig, error) { 40 | resp := &LogConfig{} 41 | err := c.rancherClient.doCreate(LOG_CONFIG_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *LogConfigClient) Update(existing *LogConfig, updates interface{}) (*LogConfig, error) { 46 | resp := &LogConfig{} 47 | err := c.rancherClient.doUpdate(LOG_CONFIG_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *LogConfigClient) List(opts *ListOpts) (*LogConfigCollection, error) { 52 | resp := &LogConfigCollection{} 53 | err := c.rancherClient.doList(LOG_CONFIG_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *LogConfigCollection) Next() (*LogConfigCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &LogConfigCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *LogConfigClient) ById(id string) (*LogConfig, error) { 69 | resp := &LogConfig{} 70 | err := c.rancherClient.doById(LOG_CONFIG_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 *LogConfigClient) Delete(container *LogConfig) error { 80 | return c.rancherClient.doResourceDelete(LOG_CONFIG_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | MOUNT_ENTRY_TYPE = "mountEntry" 5 | ) 6 | 7 | type MountEntry struct { 8 | Resource 9 | 10 | InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` 11 | 12 | InstanceName string `json:"instanceName,omitempty" yaml:"instance_name,omitempty"` 13 | 14 | Path string `json:"path,omitempty" yaml:"path,omitempty"` 15 | 16 | VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` 17 | 18 | VolumeName string `json:"volumeName,omitempty" yaml:"volume_name,omitempty"` 19 | } 20 | 21 | type MountEntryCollection struct { 22 | Collection 23 | Data []MountEntry `json:"data,omitempty"` 24 | client *MountEntryClient 25 | } 26 | 27 | type MountEntryClient struct { 28 | rancherClient *RancherClient 29 | } 30 | 31 | type MountEntryOperations interface { 32 | List(opts *ListOpts) (*MountEntryCollection, error) 33 | Create(opts *MountEntry) (*MountEntry, error) 34 | Update(existing *MountEntry, updates interface{}) (*MountEntry, error) 35 | ById(id string) (*MountEntry, error) 36 | Delete(container *MountEntry) error 37 | } 38 | 39 | func newMountEntryClient(rancherClient *RancherClient) *MountEntryClient { 40 | return &MountEntryClient{ 41 | rancherClient: rancherClient, 42 | } 43 | } 44 | 45 | func (c *MountEntryClient) Create(container *MountEntry) (*MountEntry, error) { 46 | resp := &MountEntry{} 47 | err := c.rancherClient.doCreate(MOUNT_ENTRY_TYPE, container, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *MountEntryClient) Update(existing *MountEntry, updates interface{}) (*MountEntry, error) { 52 | resp := &MountEntry{} 53 | err := c.rancherClient.doUpdate(MOUNT_ENTRY_TYPE, &existing.Resource, updates, resp) 54 | return resp, err 55 | } 56 | 57 | func (c *MountEntryClient) List(opts *ListOpts) (*MountEntryCollection, error) { 58 | resp := &MountEntryCollection{} 59 | err := c.rancherClient.doList(MOUNT_ENTRY_TYPE, opts, resp) 60 | resp.client = c 61 | return resp, err 62 | } 63 | 64 | func (cc *MountEntryCollection) Next() (*MountEntryCollection, error) { 65 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 66 | resp := &MountEntryCollection{} 67 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 68 | resp.client = cc.client 69 | return resp, err 70 | } 71 | return nil, nil 72 | } 73 | 74 | func (c *MountEntryClient) ById(id string) (*MountEntry, error) { 75 | resp := &MountEntry{} 76 | err := c.rancherClient.doById(MOUNT_ENTRY_TYPE, id, resp) 77 | if apiError, ok := err.(*ApiError); ok { 78 | if apiError.StatusCode == 404 { 79 | return nil, nil 80 | } 81 | } 82 | return resp, err 83 | } 84 | 85 | func (c *MountEntryClient) Delete(container *MountEntry) error { 86 | return c.rancherClient.doResourceDelete(MOUNT_ENTRY_TYPE, &container.Resource) 87 | } 88 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | NETWORK_POLICY_RULE_WITHIN_TYPE = "networkPolicyRuleWithin" 5 | ) 6 | 7 | type NetworkPolicyRuleWithin struct { 8 | Resource 9 | } 10 | 11 | type NetworkPolicyRuleWithinCollection struct { 12 | Collection 13 | Data []NetworkPolicyRuleWithin `json:"data,omitempty"` 14 | client *NetworkPolicyRuleWithinClient 15 | } 16 | 17 | type NetworkPolicyRuleWithinClient struct { 18 | rancherClient *RancherClient 19 | } 20 | 21 | type NetworkPolicyRuleWithinOperations interface { 22 | List(opts *ListOpts) (*NetworkPolicyRuleWithinCollection, error) 23 | Create(opts *NetworkPolicyRuleWithin) (*NetworkPolicyRuleWithin, error) 24 | Update(existing *NetworkPolicyRuleWithin, updates interface{}) (*NetworkPolicyRuleWithin, error) 25 | ById(id string) (*NetworkPolicyRuleWithin, error) 26 | Delete(container *NetworkPolicyRuleWithin) error 27 | } 28 | 29 | func newNetworkPolicyRuleWithinClient(rancherClient *RancherClient) *NetworkPolicyRuleWithinClient { 30 | return &NetworkPolicyRuleWithinClient{ 31 | rancherClient: rancherClient, 32 | } 33 | } 34 | 35 | func (c *NetworkPolicyRuleWithinClient) Create(container *NetworkPolicyRuleWithin) (*NetworkPolicyRuleWithin, error) { 36 | resp := &NetworkPolicyRuleWithin{} 37 | err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_WITHIN_TYPE, container, resp) 38 | return resp, err 39 | } 40 | 41 | func (c *NetworkPolicyRuleWithinClient) Update(existing *NetworkPolicyRuleWithin, updates interface{}) (*NetworkPolicyRuleWithin, error) { 42 | resp := &NetworkPolicyRuleWithin{} 43 | err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_WITHIN_TYPE, &existing.Resource, updates, resp) 44 | return resp, err 45 | } 46 | 47 | func (c *NetworkPolicyRuleWithinClient) List(opts *ListOpts) (*NetworkPolicyRuleWithinCollection, error) { 48 | resp := &NetworkPolicyRuleWithinCollection{} 49 | err := c.rancherClient.doList(NETWORK_POLICY_RULE_WITHIN_TYPE, opts, resp) 50 | resp.client = c 51 | return resp, err 52 | } 53 | 54 | func (cc *NetworkPolicyRuleWithinCollection) Next() (*NetworkPolicyRuleWithinCollection, error) { 55 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 56 | resp := &NetworkPolicyRuleWithinCollection{} 57 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 58 | resp.client = cc.client 59 | return resp, err 60 | } 61 | return nil, nil 62 | } 63 | 64 | func (c *NetworkPolicyRuleWithinClient) ById(id string) (*NetworkPolicyRuleWithin, error) { 65 | resp := &NetworkPolicyRuleWithin{} 66 | err := c.rancherClient.doById(NETWORK_POLICY_RULE_WITHIN_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 *NetworkPolicyRuleWithinClient) Delete(container *NetworkPolicyRuleWithin) error { 76 | return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_WITHIN_TYPE, &container.Resource) 77 | } 78 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | NFS_CONFIG_TYPE = "nfsConfig" 5 | ) 6 | 7 | type NfsConfig struct { 8 | Resource 9 | 10 | MountOptions string `json:"mountOptions,omitempty" yaml:"mount_options,omitempty"` 11 | 12 | Server string `json:"server,omitempty" yaml:"server,omitempty"` 13 | 14 | Share string `json:"share,omitempty" yaml:"share,omitempty"` 15 | } 16 | 17 | type NfsConfigCollection struct { 18 | Collection 19 | Data []NfsConfig `json:"data,omitempty"` 20 | client *NfsConfigClient 21 | } 22 | 23 | type NfsConfigClient struct { 24 | rancherClient *RancherClient 25 | } 26 | 27 | type NfsConfigOperations interface { 28 | List(opts *ListOpts) (*NfsConfigCollection, error) 29 | Create(opts *NfsConfig) (*NfsConfig, error) 30 | Update(existing *NfsConfig, updates interface{}) (*NfsConfig, error) 31 | ById(id string) (*NfsConfig, error) 32 | Delete(container *NfsConfig) error 33 | } 34 | 35 | func newNfsConfigClient(rancherClient *RancherClient) *NfsConfigClient { 36 | return &NfsConfigClient{ 37 | rancherClient: rancherClient, 38 | } 39 | } 40 | 41 | func (c *NfsConfigClient) Create(container *NfsConfig) (*NfsConfig, error) { 42 | resp := &NfsConfig{} 43 | err := c.rancherClient.doCreate(NFS_CONFIG_TYPE, container, resp) 44 | return resp, err 45 | } 46 | 47 | func (c *NfsConfigClient) Update(existing *NfsConfig, updates interface{}) (*NfsConfig, error) { 48 | resp := &NfsConfig{} 49 | err := c.rancherClient.doUpdate(NFS_CONFIG_TYPE, &existing.Resource, updates, resp) 50 | return resp, err 51 | } 52 | 53 | func (c *NfsConfigClient) List(opts *ListOpts) (*NfsConfigCollection, error) { 54 | resp := &NfsConfigCollection{} 55 | err := c.rancherClient.doList(NFS_CONFIG_TYPE, opts, resp) 56 | resp.client = c 57 | return resp, err 58 | } 59 | 60 | func (cc *NfsConfigCollection) Next() (*NfsConfigCollection, error) { 61 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 62 | resp := &NfsConfigCollection{} 63 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 64 | resp.client = cc.client 65 | return resp, err 66 | } 67 | return nil, nil 68 | } 69 | 70 | func (c *NfsConfigClient) ById(id string) (*NfsConfig, error) { 71 | resp := &NfsConfig{} 72 | err := c.rancherClient.doById(NFS_CONFIG_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 *NfsConfigClient) Delete(container *NfsConfig) error { 82 | return c.rancherClient.doResourceDelete(NFS_CONFIG_TYPE, &container.Resource) 83 | } 84 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *PacketConfigClient 27 | } 28 | 29 | type PacketConfigClient struct { 30 | rancherClient *RancherClient 31 | } 32 | 33 | type PacketConfigOperations interface { 34 | List(opts *ListOpts) (*PacketConfigCollection, error) 35 | Create(opts *PacketConfig) (*PacketConfig, error) 36 | Update(existing *PacketConfig, updates interface{}) (*PacketConfig, error) 37 | ById(id string) (*PacketConfig, error) 38 | Delete(container *PacketConfig) error 39 | } 40 | 41 | func newPacketConfigClient(rancherClient *RancherClient) *PacketConfigClient { 42 | return &PacketConfigClient{ 43 | rancherClient: rancherClient, 44 | } 45 | } 46 | 47 | func (c *PacketConfigClient) Create(container *PacketConfig) (*PacketConfig, error) { 48 | resp := &PacketConfig{} 49 | err := c.rancherClient.doCreate(PACKET_CONFIG_TYPE, container, resp) 50 | return resp, err 51 | } 52 | 53 | func (c *PacketConfigClient) Update(existing *PacketConfig, updates interface{}) (*PacketConfig, error) { 54 | resp := &PacketConfig{} 55 | err := c.rancherClient.doUpdate(PACKET_CONFIG_TYPE, &existing.Resource, updates, resp) 56 | return resp, err 57 | } 58 | 59 | func (c *PacketConfigClient) List(opts *ListOpts) (*PacketConfigCollection, error) { 60 | resp := &PacketConfigCollection{} 61 | err := c.rancherClient.doList(PACKET_CONFIG_TYPE, opts, resp) 62 | resp.client = c 63 | return resp, err 64 | } 65 | 66 | func (cc *PacketConfigCollection) Next() (*PacketConfigCollection, error) { 67 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 68 | resp := &PacketConfigCollection{} 69 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 70 | resp.client = cc.client 71 | return resp, err 72 | } 73 | return nil, nil 74 | } 75 | 76 | func (c *PacketConfigClient) ById(id string) (*PacketConfig, error) { 77 | resp := &PacketConfig{} 78 | err := c.rancherClient.doById(PACKET_CONFIG_TYPE, id, resp) 79 | if apiError, ok := err.(*ApiError); ok { 80 | if apiError.StatusCode == 404 { 81 | return nil, nil 82 | } 83 | } 84 | return resp, err 85 | } 86 | 87 | func (c *PacketConfigClient) Delete(container *PacketConfig) error { 88 | return c.rancherClient.doResourceDelete(PACKET_CONFIG_TYPE, &container.Resource) 89 | } 90 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ProcessExecutionClient 23 | } 24 | 25 | type ProcessExecutionClient struct { 26 | rancherClient *RancherClient 27 | } 28 | 29 | type ProcessExecutionOperations interface { 30 | List(opts *ListOpts) (*ProcessExecutionCollection, error) 31 | Create(opts *ProcessExecution) (*ProcessExecution, error) 32 | Update(existing *ProcessExecution, updates interface{}) (*ProcessExecution, error) 33 | ById(id string) (*ProcessExecution, error) 34 | Delete(container *ProcessExecution) error 35 | } 36 | 37 | func newProcessExecutionClient(rancherClient *RancherClient) *ProcessExecutionClient { 38 | return &ProcessExecutionClient{ 39 | rancherClient: rancherClient, 40 | } 41 | } 42 | 43 | func (c *ProcessExecutionClient) Create(container *ProcessExecution) (*ProcessExecution, error) { 44 | resp := &ProcessExecution{} 45 | err := c.rancherClient.doCreate(PROCESS_EXECUTION_TYPE, container, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *ProcessExecutionClient) Update(existing *ProcessExecution, updates interface{}) (*ProcessExecution, error) { 50 | resp := &ProcessExecution{} 51 | err := c.rancherClient.doUpdate(PROCESS_EXECUTION_TYPE, &existing.Resource, updates, resp) 52 | return resp, err 53 | } 54 | 55 | func (c *ProcessExecutionClient) List(opts *ListOpts) (*ProcessExecutionCollection, error) { 56 | resp := &ProcessExecutionCollection{} 57 | err := c.rancherClient.doList(PROCESS_EXECUTION_TYPE, opts, resp) 58 | resp.client = c 59 | return resp, err 60 | } 61 | 62 | func (cc *ProcessExecutionCollection) Next() (*ProcessExecutionCollection, error) { 63 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 64 | resp := &ProcessExecutionCollection{} 65 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 66 | resp.client = cc.client 67 | return resp, err 68 | } 69 | return nil, nil 70 | } 71 | 72 | func (c *ProcessExecutionClient) ById(id string) (*ProcessExecution, error) { 73 | resp := &ProcessExecution{} 74 | err := c.rancherClient.doById(PROCESS_EXECUTION_TYPE, id, resp) 75 | if apiError, ok := err.(*ApiError); ok { 76 | if apiError.StatusCode == 404 { 77 | return nil, nil 78 | } 79 | } 80 | return resp, err 81 | } 82 | 83 | func (c *ProcessExecutionClient) Delete(container *ProcessExecution) error { 84 | return c.rancherClient.doResourceDelete(PROCESS_EXECUTION_TYPE, &container.Resource) 85 | } 86 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | PROCESS_SUMMARY_TYPE = "processSummary" 5 | ) 6 | 7 | type ProcessSummary struct { 8 | Resource 9 | 10 | Delay int64 `json:"delay,omitempty" yaml:"delay,omitempty"` 11 | 12 | ProcessName string `json:"processName,omitempty" yaml:"process_name,omitempty"` 13 | 14 | Ready int64 `json:"ready,omitempty" yaml:"ready,omitempty"` 15 | 16 | Running int64 `json:"running,omitempty" yaml:"running,omitempty"` 17 | } 18 | 19 | type ProcessSummaryCollection struct { 20 | Collection 21 | Data []ProcessSummary `json:"data,omitempty"` 22 | client *ProcessSummaryClient 23 | } 24 | 25 | type ProcessSummaryClient struct { 26 | rancherClient *RancherClient 27 | } 28 | 29 | type ProcessSummaryOperations interface { 30 | List(opts *ListOpts) (*ProcessSummaryCollection, error) 31 | Create(opts *ProcessSummary) (*ProcessSummary, error) 32 | Update(existing *ProcessSummary, updates interface{}) (*ProcessSummary, error) 33 | ById(id string) (*ProcessSummary, error) 34 | Delete(container *ProcessSummary) error 35 | } 36 | 37 | func newProcessSummaryClient(rancherClient *RancherClient) *ProcessSummaryClient { 38 | return &ProcessSummaryClient{ 39 | rancherClient: rancherClient, 40 | } 41 | } 42 | 43 | func (c *ProcessSummaryClient) Create(container *ProcessSummary) (*ProcessSummary, error) { 44 | resp := &ProcessSummary{} 45 | err := c.rancherClient.doCreate(PROCESS_SUMMARY_TYPE, container, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *ProcessSummaryClient) Update(existing *ProcessSummary, updates interface{}) (*ProcessSummary, error) { 50 | resp := &ProcessSummary{} 51 | err := c.rancherClient.doUpdate(PROCESS_SUMMARY_TYPE, &existing.Resource, updates, resp) 52 | return resp, err 53 | } 54 | 55 | func (c *ProcessSummaryClient) List(opts *ListOpts) (*ProcessSummaryCollection, error) { 56 | resp := &ProcessSummaryCollection{} 57 | err := c.rancherClient.doList(PROCESS_SUMMARY_TYPE, opts, resp) 58 | resp.client = c 59 | return resp, err 60 | } 61 | 62 | func (cc *ProcessSummaryCollection) Next() (*ProcessSummaryCollection, error) { 63 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 64 | resp := &ProcessSummaryCollection{} 65 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 66 | resp.client = cc.client 67 | return resp, err 68 | } 69 | return nil, nil 70 | } 71 | 72 | func (c *ProcessSummaryClient) ById(id string) (*ProcessSummary, error) { 73 | resp := &ProcessSummary{} 74 | err := c.rancherClient.doById(PROCESS_SUMMARY_TYPE, id, resp) 75 | if apiError, ok := err.(*ApiError); ok { 76 | if apiError.StatusCode == 404 { 77 | return nil, nil 78 | } 79 | } 80 | return resp, err 81 | } 82 | 83 | func (c *ProcessSummaryClient) Delete(container *ProcessSummary) error { 84 | return c.rancherClient.doResourceDelete(PROCESS_SUMMARY_TYPE, &container.Resource) 85 | } 86 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *PublicEndpointClient 25 | } 26 | 27 | type PublicEndpointClient struct { 28 | rancherClient *RancherClient 29 | } 30 | 31 | type PublicEndpointOperations interface { 32 | List(opts *ListOpts) (*PublicEndpointCollection, error) 33 | Create(opts *PublicEndpoint) (*PublicEndpoint, error) 34 | Update(existing *PublicEndpoint, updates interface{}) (*PublicEndpoint, error) 35 | ById(id string) (*PublicEndpoint, error) 36 | Delete(container *PublicEndpoint) error 37 | } 38 | 39 | func newPublicEndpointClient(rancherClient *RancherClient) *PublicEndpointClient { 40 | return &PublicEndpointClient{ 41 | rancherClient: rancherClient, 42 | } 43 | } 44 | 45 | func (c *PublicEndpointClient) Create(container *PublicEndpoint) (*PublicEndpoint, error) { 46 | resp := &PublicEndpoint{} 47 | err := c.rancherClient.doCreate(PUBLIC_ENDPOINT_TYPE, container, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *PublicEndpointClient) Update(existing *PublicEndpoint, updates interface{}) (*PublicEndpoint, error) { 52 | resp := &PublicEndpoint{} 53 | err := c.rancherClient.doUpdate(PUBLIC_ENDPOINT_TYPE, &existing.Resource, updates, resp) 54 | return resp, err 55 | } 56 | 57 | func (c *PublicEndpointClient) List(opts *ListOpts) (*PublicEndpointCollection, error) { 58 | resp := &PublicEndpointCollection{} 59 | err := c.rancherClient.doList(PUBLIC_ENDPOINT_TYPE, opts, resp) 60 | resp.client = c 61 | return resp, err 62 | } 63 | 64 | func (cc *PublicEndpointCollection) Next() (*PublicEndpointCollection, error) { 65 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 66 | resp := &PublicEndpointCollection{} 67 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 68 | resp.client = cc.client 69 | return resp, err 70 | } 71 | return nil, nil 72 | } 73 | 74 | func (c *PublicEndpointClient) ById(id string) (*PublicEndpoint, error) { 75 | resp := &PublicEndpoint{} 76 | err := c.rancherClient.doById(PUBLIC_ENDPOINT_TYPE, id, resp) 77 | if apiError, ok := err.(*ApiError); ok { 78 | if apiError.StatusCode == 404 { 79 | return nil, nil 80 | } 81 | } 82 | return resp, err 83 | } 84 | 85 | func (c *PublicEndpointClient) Delete(container *PublicEndpoint) error { 86 | return c.rancherClient.doResourceDelete(PUBLIC_ENDPOINT_TYPE, &container.Resource) 87 | } 88 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ResourceDefinitionClient 17 | } 18 | 19 | type ResourceDefinitionClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type ResourceDefinitionOperations interface { 24 | List(opts *ListOpts) (*ResourceDefinitionCollection, error) 25 | Create(opts *ResourceDefinition) (*ResourceDefinition, error) 26 | Update(existing *ResourceDefinition, updates interface{}) (*ResourceDefinition, error) 27 | ById(id string) (*ResourceDefinition, error) 28 | Delete(container *ResourceDefinition) error 29 | } 30 | 31 | func newResourceDefinitionClient(rancherClient *RancherClient) *ResourceDefinitionClient { 32 | return &ResourceDefinitionClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *ResourceDefinitionClient) Create(container *ResourceDefinition) (*ResourceDefinition, error) { 38 | resp := &ResourceDefinition{} 39 | err := c.rancherClient.doCreate(RESOURCE_DEFINITION_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *ResourceDefinitionClient) Update(existing *ResourceDefinition, updates interface{}) (*ResourceDefinition, error) { 44 | resp := &ResourceDefinition{} 45 | err := c.rancherClient.doUpdate(RESOURCE_DEFINITION_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *ResourceDefinitionClient) List(opts *ListOpts) (*ResourceDefinitionCollection, error) { 50 | resp := &ResourceDefinitionCollection{} 51 | err := c.rancherClient.doList(RESOURCE_DEFINITION_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *ResourceDefinitionCollection) Next() (*ResourceDefinitionCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &ResourceDefinitionCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *ResourceDefinitionClient) ById(id string) (*ResourceDefinition, error) { 67 | resp := &ResourceDefinition{} 68 | err := c.rancherClient.doById(RESOURCE_DEFINITION_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *ResourceDefinitionClient) Delete(container *ResourceDefinition) error { 78 | return c.rancherClient.doResourceDelete(RESOURCE_DEFINITION_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *RestartPolicyClient 19 | } 20 | 21 | type RestartPolicyClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type RestartPolicyOperations interface { 26 | List(opts *ListOpts) (*RestartPolicyCollection, error) 27 | Create(opts *RestartPolicy) (*RestartPolicy, error) 28 | Update(existing *RestartPolicy, updates interface{}) (*RestartPolicy, error) 29 | ById(id string) (*RestartPolicy, error) 30 | Delete(container *RestartPolicy) error 31 | } 32 | 33 | func newRestartPolicyClient(rancherClient *RancherClient) *RestartPolicyClient { 34 | return &RestartPolicyClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *RestartPolicyClient) Create(container *RestartPolicy) (*RestartPolicy, error) { 40 | resp := &RestartPolicy{} 41 | err := c.rancherClient.doCreate(RESTART_POLICY_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *RestartPolicyClient) Update(existing *RestartPolicy, updates interface{}) (*RestartPolicy, error) { 46 | resp := &RestartPolicy{} 47 | err := c.rancherClient.doUpdate(RESTART_POLICY_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *RestartPolicyClient) List(opts *ListOpts) (*RestartPolicyCollection, error) { 52 | resp := &RestartPolicyCollection{} 53 | err := c.rancherClient.doList(RESTART_POLICY_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *RestartPolicyCollection) Next() (*RestartPolicyCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &RestartPolicyCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *RestartPolicyClient) ById(id string) (*RestartPolicy, error) { 69 | resp := &RestartPolicy{} 70 | err := c.rancherClient.doById(RESTART_POLICY_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 *RestartPolicyClient) Delete(container *RestartPolicy) error { 80 | return c.rancherClient.doResourceDelete(RESTART_POLICY_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | RESTORE_FROM_BACKUP_INPUT_TYPE = "restoreFromBackupInput" 5 | ) 6 | 7 | type RestoreFromBackupInput struct { 8 | Resource 9 | 10 | BackupId string `json:"backupId,omitempty" yaml:"backup_id,omitempty"` 11 | } 12 | 13 | type RestoreFromBackupInputCollection struct { 14 | Collection 15 | Data []RestoreFromBackupInput `json:"data,omitempty"` 16 | client *RestoreFromBackupInputClient 17 | } 18 | 19 | type RestoreFromBackupInputClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type RestoreFromBackupInputOperations interface { 24 | List(opts *ListOpts) (*RestoreFromBackupInputCollection, error) 25 | Create(opts *RestoreFromBackupInput) (*RestoreFromBackupInput, error) 26 | Update(existing *RestoreFromBackupInput, updates interface{}) (*RestoreFromBackupInput, error) 27 | ById(id string) (*RestoreFromBackupInput, error) 28 | Delete(container *RestoreFromBackupInput) error 29 | } 30 | 31 | func newRestoreFromBackupInputClient(rancherClient *RancherClient) *RestoreFromBackupInputClient { 32 | return &RestoreFromBackupInputClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *RestoreFromBackupInputClient) Create(container *RestoreFromBackupInput) (*RestoreFromBackupInput, error) { 38 | resp := &RestoreFromBackupInput{} 39 | err := c.rancherClient.doCreate(RESTORE_FROM_BACKUP_INPUT_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *RestoreFromBackupInputClient) Update(existing *RestoreFromBackupInput, updates interface{}) (*RestoreFromBackupInput, error) { 44 | resp := &RestoreFromBackupInput{} 45 | err := c.rancherClient.doUpdate(RESTORE_FROM_BACKUP_INPUT_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *RestoreFromBackupInputClient) List(opts *ListOpts) (*RestoreFromBackupInputCollection, error) { 50 | resp := &RestoreFromBackupInputCollection{} 51 | err := c.rancherClient.doList(RESTORE_FROM_BACKUP_INPUT_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *RestoreFromBackupInputCollection) Next() (*RestoreFromBackupInputCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &RestoreFromBackupInputCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *RestoreFromBackupInputClient) ById(id string) (*RestoreFromBackupInput, error) { 67 | resp := &RestoreFromBackupInput{} 68 | err := c.rancherClient.doById(RESTORE_FROM_BACKUP_INPUT_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *RestoreFromBackupInputClient) Delete(container *RestoreFromBackupInput) error { 78 | return c.rancherClient.doResourceDelete(RESTORE_FROM_BACKUP_INPUT_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | REVERT_TO_SNAPSHOT_INPUT_TYPE = "revertToSnapshotInput" 5 | ) 6 | 7 | type RevertToSnapshotInput struct { 8 | Resource 9 | 10 | SnapshotId string `json:"snapshotId,omitempty" yaml:"snapshot_id,omitempty"` 11 | } 12 | 13 | type RevertToSnapshotInputCollection struct { 14 | Collection 15 | Data []RevertToSnapshotInput `json:"data,omitempty"` 16 | client *RevertToSnapshotInputClient 17 | } 18 | 19 | type RevertToSnapshotInputClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type RevertToSnapshotInputOperations interface { 24 | List(opts *ListOpts) (*RevertToSnapshotInputCollection, error) 25 | Create(opts *RevertToSnapshotInput) (*RevertToSnapshotInput, error) 26 | Update(existing *RevertToSnapshotInput, updates interface{}) (*RevertToSnapshotInput, error) 27 | ById(id string) (*RevertToSnapshotInput, error) 28 | Delete(container *RevertToSnapshotInput) error 29 | } 30 | 31 | func newRevertToSnapshotInputClient(rancherClient *RancherClient) *RevertToSnapshotInputClient { 32 | return &RevertToSnapshotInputClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *RevertToSnapshotInputClient) Create(container *RevertToSnapshotInput) (*RevertToSnapshotInput, error) { 38 | resp := &RevertToSnapshotInput{} 39 | err := c.rancherClient.doCreate(REVERT_TO_SNAPSHOT_INPUT_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *RevertToSnapshotInputClient) Update(existing *RevertToSnapshotInput, updates interface{}) (*RevertToSnapshotInput, error) { 44 | resp := &RevertToSnapshotInput{} 45 | err := c.rancherClient.doUpdate(REVERT_TO_SNAPSHOT_INPUT_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *RevertToSnapshotInputClient) List(opts *ListOpts) (*RevertToSnapshotInputCollection, error) { 50 | resp := &RevertToSnapshotInputCollection{} 51 | err := c.rancherClient.doList(REVERT_TO_SNAPSHOT_INPUT_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *RevertToSnapshotInputCollection) Next() (*RevertToSnapshotInputCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &RevertToSnapshotInputCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *RevertToSnapshotInputClient) ById(id string) (*RevertToSnapshotInput, error) { 67 | resp := &RevertToSnapshotInput{} 68 | err := c.rancherClient.doById(REVERT_TO_SNAPSHOT_INPUT_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *RevertToSnapshotInputClient) Delete(container *RevertToSnapshotInput) error { 78 | return c.rancherClient.doResourceDelete(REVERT_TO_SNAPSHOT_INPUT_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | SCALE_POLICY_TYPE = "scalePolicy" 5 | ) 6 | 7 | type ScalePolicy struct { 8 | Resource 9 | 10 | Increment int64 `json:"increment,omitempty" yaml:"increment,omitempty"` 11 | 12 | Max int64 `json:"max,omitempty" yaml:"max,omitempty"` 13 | 14 | Min int64 `json:"min,omitempty" yaml:"min,omitempty"` 15 | } 16 | 17 | type ScalePolicyCollection struct { 18 | Collection 19 | Data []ScalePolicy `json:"data,omitempty"` 20 | client *ScalePolicyClient 21 | } 22 | 23 | type ScalePolicyClient struct { 24 | rancherClient *RancherClient 25 | } 26 | 27 | type ScalePolicyOperations interface { 28 | List(opts *ListOpts) (*ScalePolicyCollection, error) 29 | Create(opts *ScalePolicy) (*ScalePolicy, error) 30 | Update(existing *ScalePolicy, updates interface{}) (*ScalePolicy, error) 31 | ById(id string) (*ScalePolicy, error) 32 | Delete(container *ScalePolicy) error 33 | } 34 | 35 | func newScalePolicyClient(rancherClient *RancherClient) *ScalePolicyClient { 36 | return &ScalePolicyClient{ 37 | rancherClient: rancherClient, 38 | } 39 | } 40 | 41 | func (c *ScalePolicyClient) Create(container *ScalePolicy) (*ScalePolicy, error) { 42 | resp := &ScalePolicy{} 43 | err := c.rancherClient.doCreate(SCALE_POLICY_TYPE, container, resp) 44 | return resp, err 45 | } 46 | 47 | func (c *ScalePolicyClient) Update(existing *ScalePolicy, updates interface{}) (*ScalePolicy, error) { 48 | resp := &ScalePolicy{} 49 | err := c.rancherClient.doUpdate(SCALE_POLICY_TYPE, &existing.Resource, updates, resp) 50 | return resp, err 51 | } 52 | 53 | func (c *ScalePolicyClient) List(opts *ListOpts) (*ScalePolicyCollection, error) { 54 | resp := &ScalePolicyCollection{} 55 | err := c.rancherClient.doList(SCALE_POLICY_TYPE, opts, resp) 56 | resp.client = c 57 | return resp, err 58 | } 59 | 60 | func (cc *ScalePolicyCollection) Next() (*ScalePolicyCollection, error) { 61 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 62 | resp := &ScalePolicyCollection{} 63 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 64 | resp.client = cc.client 65 | return resp, err 66 | } 67 | return nil, nil 68 | } 69 | 70 | func (c *ScalePolicyClient) ById(id string) (*ScalePolicy, error) { 71 | resp := &ScalePolicy{} 72 | err := c.rancherClient.doById(SCALE_POLICY_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 *ScalePolicyClient) Delete(container *ScalePolicy) error { 82 | return c.rancherClient.doResourceDelete(SCALE_POLICY_TYPE, &container.Resource) 83 | } 84 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | SECRET_REFERENCE_TYPE = "secretReference" 5 | ) 6 | 7 | type SecretReference struct { 8 | Resource 9 | 10 | Gid string `json:"gid,omitempty" yaml:"gid,omitempty"` 11 | 12 | Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` 13 | 14 | Name string `json:"name,omitempty" yaml:"name,omitempty"` 15 | 16 | SecretId string `json:"secretId,omitempty" yaml:"secret_id,omitempty"` 17 | 18 | Uid string `json:"uid,omitempty" yaml:"uid,omitempty"` 19 | } 20 | 21 | type SecretReferenceCollection struct { 22 | Collection 23 | Data []SecretReference `json:"data,omitempty"` 24 | client *SecretReferenceClient 25 | } 26 | 27 | type SecretReferenceClient struct { 28 | rancherClient *RancherClient 29 | } 30 | 31 | type SecretReferenceOperations interface { 32 | List(opts *ListOpts) (*SecretReferenceCollection, error) 33 | Create(opts *SecretReference) (*SecretReference, error) 34 | Update(existing *SecretReference, updates interface{}) (*SecretReference, error) 35 | ById(id string) (*SecretReference, error) 36 | Delete(container *SecretReference) error 37 | } 38 | 39 | func newSecretReferenceClient(rancherClient *RancherClient) *SecretReferenceClient { 40 | return &SecretReferenceClient{ 41 | rancherClient: rancherClient, 42 | } 43 | } 44 | 45 | func (c *SecretReferenceClient) Create(container *SecretReference) (*SecretReference, error) { 46 | resp := &SecretReference{} 47 | err := c.rancherClient.doCreate(SECRET_REFERENCE_TYPE, container, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *SecretReferenceClient) Update(existing *SecretReference, updates interface{}) (*SecretReference, error) { 52 | resp := &SecretReference{} 53 | err := c.rancherClient.doUpdate(SECRET_REFERENCE_TYPE, &existing.Resource, updates, resp) 54 | return resp, err 55 | } 56 | 57 | func (c *SecretReferenceClient) List(opts *ListOpts) (*SecretReferenceCollection, error) { 58 | resp := &SecretReferenceCollection{} 59 | err := c.rancherClient.doList(SECRET_REFERENCE_TYPE, opts, resp) 60 | resp.client = c 61 | return resp, err 62 | } 63 | 64 | func (cc *SecretReferenceCollection) Next() (*SecretReferenceCollection, error) { 65 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 66 | resp := &SecretReferenceCollection{} 67 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 68 | resp.client = cc.client 69 | return resp, err 70 | } 71 | return nil, nil 72 | } 73 | 74 | func (c *SecretReferenceClient) ById(id string) (*SecretReference, error) { 75 | resp := &SecretReference{} 76 | err := c.rancherClient.doById(SECRET_REFERENCE_TYPE, id, resp) 77 | if apiError, ok := err.(*ApiError); ok { 78 | if apiError.StatusCode == 404 { 79 | return nil, nil 80 | } 81 | } 82 | return resp, err 83 | } 84 | 85 | func (c *SecretReferenceClient) Delete(container *SecretReference) error { 86 | return c.rancherClient.doResourceDelete(SECRET_REFERENCE_TYPE, &container.Resource) 87 | } 88 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | SERVICE_BINDING_TYPE = "serviceBinding" 5 | ) 6 | 7 | type ServiceBinding struct { 8 | Resource 9 | 10 | Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` 11 | 12 | Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` 13 | } 14 | 15 | type ServiceBindingCollection struct { 16 | Collection 17 | Data []ServiceBinding `json:"data,omitempty"` 18 | client *ServiceBindingClient 19 | } 20 | 21 | type ServiceBindingClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type ServiceBindingOperations interface { 26 | List(opts *ListOpts) (*ServiceBindingCollection, error) 27 | Create(opts *ServiceBinding) (*ServiceBinding, error) 28 | Update(existing *ServiceBinding, updates interface{}) (*ServiceBinding, error) 29 | ById(id string) (*ServiceBinding, error) 30 | Delete(container *ServiceBinding) error 31 | } 32 | 33 | func newServiceBindingClient(rancherClient *RancherClient) *ServiceBindingClient { 34 | return &ServiceBindingClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *ServiceBindingClient) Create(container *ServiceBinding) (*ServiceBinding, error) { 40 | resp := &ServiceBinding{} 41 | err := c.rancherClient.doCreate(SERVICE_BINDING_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *ServiceBindingClient) Update(existing *ServiceBinding, updates interface{}) (*ServiceBinding, error) { 46 | resp := &ServiceBinding{} 47 | err := c.rancherClient.doUpdate(SERVICE_BINDING_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *ServiceBindingClient) List(opts *ListOpts) (*ServiceBindingCollection, error) { 52 | resp := &ServiceBindingCollection{} 53 | err := c.rancherClient.doList(SERVICE_BINDING_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *ServiceBindingCollection) Next() (*ServiceBindingCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &ServiceBindingCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *ServiceBindingClient) ById(id string) (*ServiceBinding, error) { 69 | resp := &ServiceBinding{} 70 | err := c.rancherClient.doById(SERVICE_BINDING_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 *ServiceBindingClient) Delete(container *ServiceBinding) error { 80 | return c.rancherClient.doResourceDelete(SERVICE_BINDING_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ServiceLinkClient 21 | } 22 | 23 | type ServiceLinkClient struct { 24 | rancherClient *RancherClient 25 | } 26 | 27 | type ServiceLinkOperations interface { 28 | List(opts *ListOpts) (*ServiceLinkCollection, error) 29 | Create(opts *ServiceLink) (*ServiceLink, error) 30 | Update(existing *ServiceLink, updates interface{}) (*ServiceLink, error) 31 | ById(id string) (*ServiceLink, error) 32 | Delete(container *ServiceLink) error 33 | } 34 | 35 | func newServiceLinkClient(rancherClient *RancherClient) *ServiceLinkClient { 36 | return &ServiceLinkClient{ 37 | rancherClient: rancherClient, 38 | } 39 | } 40 | 41 | func (c *ServiceLinkClient) Create(container *ServiceLink) (*ServiceLink, error) { 42 | resp := &ServiceLink{} 43 | err := c.rancherClient.doCreate(SERVICE_LINK_TYPE, container, resp) 44 | return resp, err 45 | } 46 | 47 | func (c *ServiceLinkClient) Update(existing *ServiceLink, updates interface{}) (*ServiceLink, error) { 48 | resp := &ServiceLink{} 49 | err := c.rancherClient.doUpdate(SERVICE_LINK_TYPE, &existing.Resource, updates, resp) 50 | return resp, err 51 | } 52 | 53 | func (c *ServiceLinkClient) List(opts *ListOpts) (*ServiceLinkCollection, error) { 54 | resp := &ServiceLinkCollection{} 55 | err := c.rancherClient.doList(SERVICE_LINK_TYPE, opts, resp) 56 | resp.client = c 57 | return resp, err 58 | } 59 | 60 | func (cc *ServiceLinkCollection) Next() (*ServiceLinkCollection, error) { 61 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 62 | resp := &ServiceLinkCollection{} 63 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 64 | resp.client = cc.client 65 | return resp, err 66 | } 67 | return nil, nil 68 | } 69 | 70 | func (c *ServiceLinkClient) ById(id string) (*ServiceLink, error) { 71 | resp := &ServiceLink{} 72 | err := c.rancherClient.doById(SERVICE_LINK_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 *ServiceLinkClient) Delete(container *ServiceLink) error { 82 | return c.rancherClient.doResourceDelete(SERVICE_LINK_TYPE, &container.Resource) 83 | } 84 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ServiceProxyClient 25 | } 26 | 27 | type ServiceProxyClient struct { 28 | rancherClient *RancherClient 29 | } 30 | 31 | type ServiceProxyOperations interface { 32 | List(opts *ListOpts) (*ServiceProxyCollection, error) 33 | Create(opts *ServiceProxy) (*ServiceProxy, error) 34 | Update(existing *ServiceProxy, updates interface{}) (*ServiceProxy, error) 35 | ById(id string) (*ServiceProxy, error) 36 | Delete(container *ServiceProxy) error 37 | } 38 | 39 | func newServiceProxyClient(rancherClient *RancherClient) *ServiceProxyClient { 40 | return &ServiceProxyClient{ 41 | rancherClient: rancherClient, 42 | } 43 | } 44 | 45 | func (c *ServiceProxyClient) Create(container *ServiceProxy) (*ServiceProxy, error) { 46 | resp := &ServiceProxy{} 47 | err := c.rancherClient.doCreate(SERVICE_PROXY_TYPE, container, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *ServiceProxyClient) Update(existing *ServiceProxy, updates interface{}) (*ServiceProxy, error) { 52 | resp := &ServiceProxy{} 53 | err := c.rancherClient.doUpdate(SERVICE_PROXY_TYPE, &existing.Resource, updates, resp) 54 | return resp, err 55 | } 56 | 57 | func (c *ServiceProxyClient) List(opts *ListOpts) (*ServiceProxyCollection, error) { 58 | resp := &ServiceProxyCollection{} 59 | err := c.rancherClient.doList(SERVICE_PROXY_TYPE, opts, resp) 60 | resp.client = c 61 | return resp, err 62 | } 63 | 64 | func (cc *ServiceProxyCollection) Next() (*ServiceProxyCollection, error) { 65 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 66 | resp := &ServiceProxyCollection{} 67 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 68 | resp.client = cc.client 69 | return resp, err 70 | } 71 | return nil, nil 72 | } 73 | 74 | func (c *ServiceProxyClient) ById(id string) (*ServiceProxy, error) { 75 | resp := &ServiceProxy{} 76 | err := c.rancherClient.doById(SERVICE_PROXY_TYPE, id, resp) 77 | if apiError, ok := err.(*ApiError); ok { 78 | if apiError.StatusCode == 404 { 79 | return nil, nil 80 | } 81 | } 82 | return resp, err 83 | } 84 | 85 | func (c *ServiceProxyClient) Delete(container *ServiceProxy) error { 86 | return c.rancherClient.doResourceDelete(SERVICE_PROXY_TYPE, &container.Resource) 87 | } 88 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ServiceRestartClient 17 | } 18 | 19 | type ServiceRestartClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type ServiceRestartOperations interface { 24 | List(opts *ListOpts) (*ServiceRestartCollection, error) 25 | Create(opts *ServiceRestart) (*ServiceRestart, error) 26 | Update(existing *ServiceRestart, updates interface{}) (*ServiceRestart, error) 27 | ById(id string) (*ServiceRestart, error) 28 | Delete(container *ServiceRestart) error 29 | } 30 | 31 | func newServiceRestartClient(rancherClient *RancherClient) *ServiceRestartClient { 32 | return &ServiceRestartClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *ServiceRestartClient) Create(container *ServiceRestart) (*ServiceRestart, error) { 38 | resp := &ServiceRestart{} 39 | err := c.rancherClient.doCreate(SERVICE_RESTART_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *ServiceRestartClient) Update(existing *ServiceRestart, updates interface{}) (*ServiceRestart, error) { 44 | resp := &ServiceRestart{} 45 | err := c.rancherClient.doUpdate(SERVICE_RESTART_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *ServiceRestartClient) List(opts *ListOpts) (*ServiceRestartCollection, error) { 50 | resp := &ServiceRestartCollection{} 51 | err := c.rancherClient.doList(SERVICE_RESTART_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *ServiceRestartCollection) Next() (*ServiceRestartCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &ServiceRestartCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *ServiceRestartClient) ById(id string) (*ServiceRestart, error) { 67 | resp := &ServiceRestart{} 68 | err := c.rancherClient.doById(SERVICE_RESTART_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *ServiceRestartClient) Delete(container *ServiceRestart) error { 78 | return c.rancherClient.doResourceDelete(SERVICE_RESTART_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ServiceUpgradeClient 19 | } 20 | 21 | type ServiceUpgradeClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type ServiceUpgradeOperations interface { 26 | List(opts *ListOpts) (*ServiceUpgradeCollection, error) 27 | Create(opts *ServiceUpgrade) (*ServiceUpgrade, error) 28 | Update(existing *ServiceUpgrade, updates interface{}) (*ServiceUpgrade, error) 29 | ById(id string) (*ServiceUpgrade, error) 30 | Delete(container *ServiceUpgrade) error 31 | } 32 | 33 | func newServiceUpgradeClient(rancherClient *RancherClient) *ServiceUpgradeClient { 34 | return &ServiceUpgradeClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *ServiceUpgradeClient) Create(container *ServiceUpgrade) (*ServiceUpgrade, error) { 40 | resp := &ServiceUpgrade{} 41 | err := c.rancherClient.doCreate(SERVICE_UPGRADE_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *ServiceUpgradeClient) Update(existing *ServiceUpgrade, updates interface{}) (*ServiceUpgrade, error) { 46 | resp := &ServiceUpgrade{} 47 | err := c.rancherClient.doUpdate(SERVICE_UPGRADE_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *ServiceUpgradeClient) List(opts *ListOpts) (*ServiceUpgradeCollection, error) { 52 | resp := &ServiceUpgradeCollection{} 53 | err := c.rancherClient.doList(SERVICE_UPGRADE_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *ServiceUpgradeCollection) Next() (*ServiceUpgradeCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &ServiceUpgradeCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *ServiceUpgradeClient) ById(id string) (*ServiceUpgrade, error) { 69 | resp := &ServiceUpgrade{} 70 | err := c.rancherClient.doById(SERVICE_UPGRADE_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 *ServiceUpgradeClient) Delete(container *ServiceUpgrade) error { 80 | return c.rancherClient.doResourceDelete(SERVICE_UPGRADE_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *ServicesPortRangeClient 19 | } 20 | 21 | type ServicesPortRangeClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type ServicesPortRangeOperations interface { 26 | List(opts *ListOpts) (*ServicesPortRangeCollection, error) 27 | Create(opts *ServicesPortRange) (*ServicesPortRange, error) 28 | Update(existing *ServicesPortRange, updates interface{}) (*ServicesPortRange, error) 29 | ById(id string) (*ServicesPortRange, error) 30 | Delete(container *ServicesPortRange) error 31 | } 32 | 33 | func newServicesPortRangeClient(rancherClient *RancherClient) *ServicesPortRangeClient { 34 | return &ServicesPortRangeClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *ServicesPortRangeClient) Create(container *ServicesPortRange) (*ServicesPortRange, error) { 40 | resp := &ServicesPortRange{} 41 | err := c.rancherClient.doCreate(SERVICES_PORT_RANGE_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *ServicesPortRangeClient) Update(existing *ServicesPortRange, updates interface{}) (*ServicesPortRange, error) { 46 | resp := &ServicesPortRange{} 47 | err := c.rancherClient.doUpdate(SERVICES_PORT_RANGE_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *ServicesPortRangeClient) List(opts *ListOpts) (*ServicesPortRangeCollection, error) { 52 | resp := &ServicesPortRangeCollection{} 53 | err := c.rancherClient.doList(SERVICES_PORT_RANGE_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *ServicesPortRangeCollection) Next() (*ServicesPortRangeCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &ServicesPortRangeCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *ServicesPortRangeClient) ById(id string) (*ServicesPortRange, error) { 69 | resp := &ServicesPortRange{} 70 | err := c.rancherClient.doById(SERVICES_PORT_RANGE_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 *ServicesPortRangeClient) Delete(container *ServicesPortRange) error { 80 | return c.rancherClient.doResourceDelete(SERVICES_PORT_RANGE_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 []ProjectMember `json:"members,omitempty" yaml:"members,omitempty"` 11 | } 12 | 13 | type SetProjectMembersInputCollection struct { 14 | Collection 15 | Data []SetProjectMembersInput `json:"data,omitempty"` 16 | client *SetProjectMembersInputClient 17 | } 18 | 19 | type SetProjectMembersInputClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type SetProjectMembersInputOperations interface { 24 | List(opts *ListOpts) (*SetProjectMembersInputCollection, error) 25 | Create(opts *SetProjectMembersInput) (*SetProjectMembersInput, error) 26 | Update(existing *SetProjectMembersInput, updates interface{}) (*SetProjectMembersInput, error) 27 | ById(id string) (*SetProjectMembersInput, error) 28 | Delete(container *SetProjectMembersInput) error 29 | } 30 | 31 | func newSetProjectMembersInputClient(rancherClient *RancherClient) *SetProjectMembersInputClient { 32 | return &SetProjectMembersInputClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *SetProjectMembersInputClient) Create(container *SetProjectMembersInput) (*SetProjectMembersInput, error) { 38 | resp := &SetProjectMembersInput{} 39 | err := c.rancherClient.doCreate(SET_PROJECT_MEMBERS_INPUT_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *SetProjectMembersInputClient) Update(existing *SetProjectMembersInput, updates interface{}) (*SetProjectMembersInput, error) { 44 | resp := &SetProjectMembersInput{} 45 | err := c.rancherClient.doUpdate(SET_PROJECT_MEMBERS_INPUT_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *SetProjectMembersInputClient) List(opts *ListOpts) (*SetProjectMembersInputCollection, error) { 50 | resp := &SetProjectMembersInputCollection{} 51 | err := c.rancherClient.doList(SET_PROJECT_MEMBERS_INPUT_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *SetProjectMembersInputCollection) Next() (*SetProjectMembersInputCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &SetProjectMembersInputCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *SetProjectMembersInputClient) ById(id string) (*SetProjectMembersInput, error) { 67 | resp := &SetProjectMembersInput{} 68 | err := c.rancherClient.doById(SET_PROJECT_MEMBERS_INPUT_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *SetProjectMembersInputClient) Delete(container *SetProjectMembersInput) error { 78 | return c.rancherClient.doResourceDelete(SET_PROJECT_MEMBERS_INPUT_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 []ServiceLink `json:"serviceLinks,omitempty" yaml:"service_links,omitempty"` 11 | } 12 | 13 | type SetServiceLinksInputCollection struct { 14 | Collection 15 | Data []SetServiceLinksInput `json:"data,omitempty"` 16 | client *SetServiceLinksInputClient 17 | } 18 | 19 | type SetServiceLinksInputClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type SetServiceLinksInputOperations interface { 24 | List(opts *ListOpts) (*SetServiceLinksInputCollection, error) 25 | Create(opts *SetServiceLinksInput) (*SetServiceLinksInput, error) 26 | Update(existing *SetServiceLinksInput, updates interface{}) (*SetServiceLinksInput, error) 27 | ById(id string) (*SetServiceLinksInput, error) 28 | Delete(container *SetServiceLinksInput) error 29 | } 30 | 31 | func newSetServiceLinksInputClient(rancherClient *RancherClient) *SetServiceLinksInputClient { 32 | return &SetServiceLinksInputClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *SetServiceLinksInputClient) Create(container *SetServiceLinksInput) (*SetServiceLinksInput, error) { 38 | resp := &SetServiceLinksInput{} 39 | err := c.rancherClient.doCreate(SET_SERVICE_LINKS_INPUT_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *SetServiceLinksInputClient) Update(existing *SetServiceLinksInput, updates interface{}) (*SetServiceLinksInput, error) { 44 | resp := &SetServiceLinksInput{} 45 | err := c.rancherClient.doUpdate(SET_SERVICE_LINKS_INPUT_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *SetServiceLinksInputClient) List(opts *ListOpts) (*SetServiceLinksInputCollection, error) { 50 | resp := &SetServiceLinksInputCollection{} 51 | err := c.rancherClient.doList(SET_SERVICE_LINKS_INPUT_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *SetServiceLinksInputCollection) Next() (*SetServiceLinksInputCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &SetServiceLinksInputCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *SetServiceLinksInputClient) ById(id string) (*SetServiceLinksInput, error) { 67 | resp := &SetServiceLinksInput{} 68 | err := c.rancherClient.doById(SET_SERVICE_LINKS_INPUT_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *SetServiceLinksInputClient) Delete(container *SetServiceLinksInput) error { 78 | return c.rancherClient.doResourceDelete(SET_SERVICE_LINKS_INPUT_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *SettingClient 25 | } 26 | 27 | type SettingClient struct { 28 | rancherClient *RancherClient 29 | } 30 | 31 | type SettingOperations interface { 32 | List(opts *ListOpts) (*SettingCollection, error) 33 | Create(opts *Setting) (*Setting, error) 34 | Update(existing *Setting, updates interface{}) (*Setting, error) 35 | ById(id string) (*Setting, error) 36 | Delete(container *Setting) error 37 | } 38 | 39 | func newSettingClient(rancherClient *RancherClient) *SettingClient { 40 | return &SettingClient{ 41 | rancherClient: rancherClient, 42 | } 43 | } 44 | 45 | func (c *SettingClient) Create(container *Setting) (*Setting, error) { 46 | resp := &Setting{} 47 | err := c.rancherClient.doCreate(SETTING_TYPE, container, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *SettingClient) Update(existing *Setting, updates interface{}) (*Setting, error) { 52 | resp := &Setting{} 53 | err := c.rancherClient.doUpdate(SETTING_TYPE, &existing.Resource, updates, resp) 54 | return resp, err 55 | } 56 | 57 | func (c *SettingClient) List(opts *ListOpts) (*SettingCollection, error) { 58 | resp := &SettingCollection{} 59 | err := c.rancherClient.doList(SETTING_TYPE, opts, resp) 60 | resp.client = c 61 | return resp, err 62 | } 63 | 64 | func (cc *SettingCollection) Next() (*SettingCollection, error) { 65 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 66 | resp := &SettingCollection{} 67 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 68 | resp.client = cc.client 69 | return resp, err 70 | } 71 | return nil, nil 72 | } 73 | 74 | func (c *SettingClient) ById(id string) (*Setting, error) { 75 | resp := &Setting{} 76 | err := c.rancherClient.doById(SETTING_TYPE, id, resp) 77 | if apiError, ok := err.(*ApiError); ok { 78 | if apiError.StatusCode == 404 { 79 | return nil, nil 80 | } 81 | } 82 | return resp, err 83 | } 84 | 85 | func (c *SettingClient) Delete(container *Setting) error { 86 | return c.rancherClient.doResourceDelete(SETTING_TYPE, &container.Resource) 87 | } 88 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *StateTransitionClient 15 | } 16 | 17 | type StateTransitionClient struct { 18 | rancherClient *RancherClient 19 | } 20 | 21 | type StateTransitionOperations interface { 22 | List(opts *ListOpts) (*StateTransitionCollection, error) 23 | Create(opts *StateTransition) (*StateTransition, error) 24 | Update(existing *StateTransition, updates interface{}) (*StateTransition, error) 25 | ById(id string) (*StateTransition, error) 26 | Delete(container *StateTransition) error 27 | } 28 | 29 | func newStateTransitionClient(rancherClient *RancherClient) *StateTransitionClient { 30 | return &StateTransitionClient{ 31 | rancherClient: rancherClient, 32 | } 33 | } 34 | 35 | func (c *StateTransitionClient) Create(container *StateTransition) (*StateTransition, error) { 36 | resp := &StateTransition{} 37 | err := c.rancherClient.doCreate(STATE_TRANSITION_TYPE, container, resp) 38 | return resp, err 39 | } 40 | 41 | func (c *StateTransitionClient) Update(existing *StateTransition, updates interface{}) (*StateTransition, error) { 42 | resp := &StateTransition{} 43 | err := c.rancherClient.doUpdate(STATE_TRANSITION_TYPE, &existing.Resource, updates, resp) 44 | return resp, err 45 | } 46 | 47 | func (c *StateTransitionClient) List(opts *ListOpts) (*StateTransitionCollection, error) { 48 | resp := &StateTransitionCollection{} 49 | err := c.rancherClient.doList(STATE_TRANSITION_TYPE, opts, resp) 50 | resp.client = c 51 | return resp, err 52 | } 53 | 54 | func (cc *StateTransitionCollection) Next() (*StateTransitionCollection, error) { 55 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 56 | resp := &StateTransitionCollection{} 57 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 58 | resp.client = cc.client 59 | return resp, err 60 | } 61 | return nil, nil 62 | } 63 | 64 | func (c *StateTransitionClient) ById(id string) (*StateTransition, error) { 65 | resp := &StateTransition{} 66 | err := c.rancherClient.doById(STATE_TRANSITION_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 *StateTransitionClient) Delete(container *StateTransition) error { 76 | return c.rancherClient.doResourceDelete(STATE_TRANSITION_TYPE, &container.Resource) 77 | } 78 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *StatsAccessClient 19 | } 20 | 21 | type StatsAccessClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type StatsAccessOperations interface { 26 | List(opts *ListOpts) (*StatsAccessCollection, error) 27 | Create(opts *StatsAccess) (*StatsAccess, error) 28 | Update(existing *StatsAccess, updates interface{}) (*StatsAccess, error) 29 | ById(id string) (*StatsAccess, error) 30 | Delete(container *StatsAccess) error 31 | } 32 | 33 | func newStatsAccessClient(rancherClient *RancherClient) *StatsAccessClient { 34 | return &StatsAccessClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *StatsAccessClient) Create(container *StatsAccess) (*StatsAccess, error) { 40 | resp := &StatsAccess{} 41 | err := c.rancherClient.doCreate(STATS_ACCESS_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *StatsAccessClient) Update(existing *StatsAccess, updates interface{}) (*StatsAccess, error) { 46 | resp := &StatsAccess{} 47 | err := c.rancherClient.doUpdate(STATS_ACCESS_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *StatsAccessClient) List(opts *ListOpts) (*StatsAccessCollection, error) { 52 | resp := &StatsAccessCollection{} 53 | err := c.rancherClient.doList(STATS_ACCESS_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *StatsAccessCollection) Next() (*StatsAccessCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &StatsAccessCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *StatsAccessClient) ById(id string) (*StatsAccess, error) { 69 | resp := &StatsAccess{} 70 | err := c.rancherClient.doById(STATS_ACCESS_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 *StatsAccessClient) Delete(container *StatsAccess) error { 80 | return c.rancherClient.doResourceDelete(STATS_ACCESS_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | TARGET_PORT_RULE_TYPE = "targetPortRule" 5 | ) 6 | 7 | type TargetPortRule struct { 8 | Resource 9 | 10 | BackendName string `json:"backendName,omitempty" yaml:"backend_name,omitempty"` 11 | 12 | Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` 13 | 14 | Path string `json:"path,omitempty" yaml:"path,omitempty"` 15 | 16 | TargetPort int64 `json:"targetPort,omitempty" yaml:"target_port,omitempty"` 17 | } 18 | 19 | type TargetPortRuleCollection struct { 20 | Collection 21 | Data []TargetPortRule `json:"data,omitempty"` 22 | client *TargetPortRuleClient 23 | } 24 | 25 | type TargetPortRuleClient struct { 26 | rancherClient *RancherClient 27 | } 28 | 29 | type TargetPortRuleOperations interface { 30 | List(opts *ListOpts) (*TargetPortRuleCollection, error) 31 | Create(opts *TargetPortRule) (*TargetPortRule, error) 32 | Update(existing *TargetPortRule, updates interface{}) (*TargetPortRule, error) 33 | ById(id string) (*TargetPortRule, error) 34 | Delete(container *TargetPortRule) error 35 | } 36 | 37 | func newTargetPortRuleClient(rancherClient *RancherClient) *TargetPortRuleClient { 38 | return &TargetPortRuleClient{ 39 | rancherClient: rancherClient, 40 | } 41 | } 42 | 43 | func (c *TargetPortRuleClient) Create(container *TargetPortRule) (*TargetPortRule, error) { 44 | resp := &TargetPortRule{} 45 | err := c.rancherClient.doCreate(TARGET_PORT_RULE_TYPE, container, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *TargetPortRuleClient) Update(existing *TargetPortRule, updates interface{}) (*TargetPortRule, error) { 50 | resp := &TargetPortRule{} 51 | err := c.rancherClient.doUpdate(TARGET_PORT_RULE_TYPE, &existing.Resource, updates, resp) 52 | return resp, err 53 | } 54 | 55 | func (c *TargetPortRuleClient) List(opts *ListOpts) (*TargetPortRuleCollection, error) { 56 | resp := &TargetPortRuleCollection{} 57 | err := c.rancherClient.doList(TARGET_PORT_RULE_TYPE, opts, resp) 58 | resp.client = c 59 | return resp, err 60 | } 61 | 62 | func (cc *TargetPortRuleCollection) Next() (*TargetPortRuleCollection, error) { 63 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 64 | resp := &TargetPortRuleCollection{} 65 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 66 | resp.client = cc.client 67 | return resp, err 68 | } 69 | return nil, nil 70 | } 71 | 72 | func (c *TargetPortRuleClient) ById(id string) (*TargetPortRule, error) { 73 | resp := &TargetPortRule{} 74 | err := c.rancherClient.doById(TARGET_PORT_RULE_TYPE, id, resp) 75 | if apiError, ok := err.(*ApiError); ok { 76 | if apiError.StatusCode == 404 { 77 | return nil, nil 78 | } 79 | } 80 | return resp, err 81 | } 82 | 83 | func (c *TargetPortRuleClient) Delete(container *TargetPortRule) error { 84 | return c.rancherClient.doResourceDelete(TARGET_PORT_RULE_TYPE, &container.Resource) 85 | } 86 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *TaskClient 17 | } 18 | 19 | type TaskClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type TaskOperations interface { 24 | List(opts *ListOpts) (*TaskCollection, error) 25 | Create(opts *Task) (*Task, error) 26 | Update(existing *Task, updates interface{}) (*Task, error) 27 | ById(id string) (*Task, error) 28 | Delete(container *Task) error 29 | 30 | ActionExecute(*Task) (*Task, error) 31 | } 32 | 33 | func newTaskClient(rancherClient *RancherClient) *TaskClient { 34 | return &TaskClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *TaskClient) Create(container *Task) (*Task, error) { 40 | resp := &Task{} 41 | err := c.rancherClient.doCreate(TASK_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *TaskClient) Update(existing *Task, updates interface{}) (*Task, error) { 46 | resp := &Task{} 47 | err := c.rancherClient.doUpdate(TASK_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *TaskClient) List(opts *ListOpts) (*TaskCollection, error) { 52 | resp := &TaskCollection{} 53 | err := c.rancherClient.doList(TASK_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *TaskCollection) Next() (*TaskCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &TaskCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *TaskClient) ById(id string) (*Task, error) { 69 | resp := &Task{} 70 | err := c.rancherClient.doById(TASK_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 *TaskClient) Delete(container *Task) error { 80 | return c.rancherClient.doResourceDelete(TASK_TYPE, &container.Resource) 81 | } 82 | 83 | func (c *TaskClient) ActionExecute(resource *Task) (*Task, error) { 84 | 85 | resp := &Task{} 86 | 87 | err := c.rancherClient.doAction(TASK_TYPE, "execute", &resource.Resource, nil, resp) 88 | 89 | return resp, err 90 | } 91 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *TaskInstanceClient 27 | } 28 | 29 | type TaskInstanceClient struct { 30 | rancherClient *RancherClient 31 | } 32 | 33 | type TaskInstanceOperations interface { 34 | List(opts *ListOpts) (*TaskInstanceCollection, error) 35 | Create(opts *TaskInstance) (*TaskInstance, error) 36 | Update(existing *TaskInstance, updates interface{}) (*TaskInstance, error) 37 | ById(id string) (*TaskInstance, error) 38 | Delete(container *TaskInstance) error 39 | } 40 | 41 | func newTaskInstanceClient(rancherClient *RancherClient) *TaskInstanceClient { 42 | return &TaskInstanceClient{ 43 | rancherClient: rancherClient, 44 | } 45 | } 46 | 47 | func (c *TaskInstanceClient) Create(container *TaskInstance) (*TaskInstance, error) { 48 | resp := &TaskInstance{} 49 | err := c.rancherClient.doCreate(TASK_INSTANCE_TYPE, container, resp) 50 | return resp, err 51 | } 52 | 53 | func (c *TaskInstanceClient) Update(existing *TaskInstance, updates interface{}) (*TaskInstance, error) { 54 | resp := &TaskInstance{} 55 | err := c.rancherClient.doUpdate(TASK_INSTANCE_TYPE, &existing.Resource, updates, resp) 56 | return resp, err 57 | } 58 | 59 | func (c *TaskInstanceClient) List(opts *ListOpts) (*TaskInstanceCollection, error) { 60 | resp := &TaskInstanceCollection{} 61 | err := c.rancherClient.doList(TASK_INSTANCE_TYPE, opts, resp) 62 | resp.client = c 63 | return resp, err 64 | } 65 | 66 | func (cc *TaskInstanceCollection) Next() (*TaskInstanceCollection, error) { 67 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 68 | resp := &TaskInstanceCollection{} 69 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 70 | resp.client = cc.client 71 | return resp, err 72 | } 73 | return nil, nil 74 | } 75 | 76 | func (c *TaskInstanceClient) ById(id string) (*TaskInstance, error) { 77 | resp := &TaskInstance{} 78 | err := c.rancherClient.doById(TASK_INSTANCE_TYPE, id, resp) 79 | if apiError, ok := err.(*ApiError); ok { 80 | if apiError.StatusCode == 404 { 81 | return nil, nil 82 | } 83 | } 84 | return resp, err 85 | } 86 | 87 | func (c *TaskInstanceClient) Delete(container *TaskInstance) error { 88 | return c.rancherClient.doResourceDelete(TASK_INSTANCE_TYPE, &container.Resource) 89 | } 90 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/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 | client *TypeDocumentationClient 19 | } 20 | 21 | type TypeDocumentationClient struct { 22 | rancherClient *RancherClient 23 | } 24 | 25 | type TypeDocumentationOperations interface { 26 | List(opts *ListOpts) (*TypeDocumentationCollection, error) 27 | Create(opts *TypeDocumentation) (*TypeDocumentation, error) 28 | Update(existing *TypeDocumentation, updates interface{}) (*TypeDocumentation, error) 29 | ById(id string) (*TypeDocumentation, error) 30 | Delete(container *TypeDocumentation) error 31 | } 32 | 33 | func newTypeDocumentationClient(rancherClient *RancherClient) *TypeDocumentationClient { 34 | return &TypeDocumentationClient{ 35 | rancherClient: rancherClient, 36 | } 37 | } 38 | 39 | func (c *TypeDocumentationClient) Create(container *TypeDocumentation) (*TypeDocumentation, error) { 40 | resp := &TypeDocumentation{} 41 | err := c.rancherClient.doCreate(TYPE_DOCUMENTATION_TYPE, container, resp) 42 | return resp, err 43 | } 44 | 45 | func (c *TypeDocumentationClient) Update(existing *TypeDocumentation, updates interface{}) (*TypeDocumentation, error) { 46 | resp := &TypeDocumentation{} 47 | err := c.rancherClient.doUpdate(TYPE_DOCUMENTATION_TYPE, &existing.Resource, updates, resp) 48 | return resp, err 49 | } 50 | 51 | func (c *TypeDocumentationClient) List(opts *ListOpts) (*TypeDocumentationCollection, error) { 52 | resp := &TypeDocumentationCollection{} 53 | err := c.rancherClient.doList(TYPE_DOCUMENTATION_TYPE, opts, resp) 54 | resp.client = c 55 | return resp, err 56 | } 57 | 58 | func (cc *TypeDocumentationCollection) Next() (*TypeDocumentationCollection, error) { 59 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 60 | resp := &TypeDocumentationCollection{} 61 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 62 | resp.client = cc.client 63 | return resp, err 64 | } 65 | return nil, nil 66 | } 67 | 68 | func (c *TypeDocumentationClient) ById(id string) (*TypeDocumentation, error) { 69 | resp := &TypeDocumentation{} 70 | err := c.rancherClient.doById(TYPE_DOCUMENTATION_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 *TypeDocumentationClient) Delete(container *TypeDocumentation) error { 80 | return c.rancherClient.doResourceDelete(TYPE_DOCUMENTATION_TYPE, &container.Resource) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | ULIMIT_TYPE = "ulimit" 5 | ) 6 | 7 | type Ulimit struct { 8 | Resource 9 | 10 | Hard int64 `json:"hard,omitempty" yaml:"hard,omitempty"` 11 | 12 | Name string `json:"name,omitempty" yaml:"name,omitempty"` 13 | 14 | Soft int64 `json:"soft,omitempty" yaml:"soft,omitempty"` 15 | } 16 | 17 | type UlimitCollection struct { 18 | Collection 19 | Data []Ulimit `json:"data,omitempty"` 20 | client *UlimitClient 21 | } 22 | 23 | type UlimitClient struct { 24 | rancherClient *RancherClient 25 | } 26 | 27 | type UlimitOperations interface { 28 | List(opts *ListOpts) (*UlimitCollection, error) 29 | Create(opts *Ulimit) (*Ulimit, error) 30 | Update(existing *Ulimit, updates interface{}) (*Ulimit, error) 31 | ById(id string) (*Ulimit, error) 32 | Delete(container *Ulimit) error 33 | } 34 | 35 | func newUlimitClient(rancherClient *RancherClient) *UlimitClient { 36 | return &UlimitClient{ 37 | rancherClient: rancherClient, 38 | } 39 | } 40 | 41 | func (c *UlimitClient) Create(container *Ulimit) (*Ulimit, error) { 42 | resp := &Ulimit{} 43 | err := c.rancherClient.doCreate(ULIMIT_TYPE, container, resp) 44 | return resp, err 45 | } 46 | 47 | func (c *UlimitClient) Update(existing *Ulimit, updates interface{}) (*Ulimit, error) { 48 | resp := &Ulimit{} 49 | err := c.rancherClient.doUpdate(ULIMIT_TYPE, &existing.Resource, updates, resp) 50 | return resp, err 51 | } 52 | 53 | func (c *UlimitClient) List(opts *ListOpts) (*UlimitCollection, error) { 54 | resp := &UlimitCollection{} 55 | err := c.rancherClient.doList(ULIMIT_TYPE, opts, resp) 56 | resp.client = c 57 | return resp, err 58 | } 59 | 60 | func (cc *UlimitCollection) Next() (*UlimitCollection, error) { 61 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 62 | resp := &UlimitCollection{} 63 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 64 | resp.client = cc.client 65 | return resp, err 66 | } 67 | return nil, nil 68 | } 69 | 70 | func (c *UlimitClient) ById(id string) (*Ulimit, error) { 71 | resp := &Ulimit{} 72 | err := c.rancherClient.doById(ULIMIT_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 *UlimitClient) Delete(container *Ulimit) error { 82 | return c.rancherClient.doResourceDelete(ULIMIT_TYPE, &container.Resource) 83 | } 84 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | VOLUME_ACTIVATE_INPUT_TYPE = "volumeActivateInput" 5 | ) 6 | 7 | type VolumeActivateInput struct { 8 | Resource 9 | 10 | HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` 11 | } 12 | 13 | type VolumeActivateInputCollection struct { 14 | Collection 15 | Data []VolumeActivateInput `json:"data,omitempty"` 16 | client *VolumeActivateInputClient 17 | } 18 | 19 | type VolumeActivateInputClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type VolumeActivateInputOperations interface { 24 | List(opts *ListOpts) (*VolumeActivateInputCollection, error) 25 | Create(opts *VolumeActivateInput) (*VolumeActivateInput, error) 26 | Update(existing *VolumeActivateInput, updates interface{}) (*VolumeActivateInput, error) 27 | ById(id string) (*VolumeActivateInput, error) 28 | Delete(container *VolumeActivateInput) error 29 | } 30 | 31 | func newVolumeActivateInputClient(rancherClient *RancherClient) *VolumeActivateInputClient { 32 | return &VolumeActivateInputClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *VolumeActivateInputClient) Create(container *VolumeActivateInput) (*VolumeActivateInput, error) { 38 | resp := &VolumeActivateInput{} 39 | err := c.rancherClient.doCreate(VOLUME_ACTIVATE_INPUT_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *VolumeActivateInputClient) Update(existing *VolumeActivateInput, updates interface{}) (*VolumeActivateInput, error) { 44 | resp := &VolumeActivateInput{} 45 | err := c.rancherClient.doUpdate(VOLUME_ACTIVATE_INPUT_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *VolumeActivateInputClient) List(opts *ListOpts) (*VolumeActivateInputCollection, error) { 50 | resp := &VolumeActivateInputCollection{} 51 | err := c.rancherClient.doList(VOLUME_ACTIVATE_INPUT_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *VolumeActivateInputCollection) Next() (*VolumeActivateInputCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &VolumeActivateInputCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *VolumeActivateInputClient) ById(id string) (*VolumeActivateInput, error) { 67 | resp := &VolumeActivateInput{} 68 | err := c.rancherClient.doById(VOLUME_ACTIVATE_INPUT_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *VolumeActivateInputClient) Delete(container *VolumeActivateInput) error { 78 | return c.rancherClient.doResourceDelete(VOLUME_ACTIVATE_INPUT_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | const ( 4 | VOLUME_SNAPSHOT_INPUT_TYPE = "volumeSnapshotInput" 5 | ) 6 | 7 | type VolumeSnapshotInput struct { 8 | Resource 9 | 10 | Name string `json:"name,omitempty" yaml:"name,omitempty"` 11 | } 12 | 13 | type VolumeSnapshotInputCollection struct { 14 | Collection 15 | Data []VolumeSnapshotInput `json:"data,omitempty"` 16 | client *VolumeSnapshotInputClient 17 | } 18 | 19 | type VolumeSnapshotInputClient struct { 20 | rancherClient *RancherClient 21 | } 22 | 23 | type VolumeSnapshotInputOperations interface { 24 | List(opts *ListOpts) (*VolumeSnapshotInputCollection, error) 25 | Create(opts *VolumeSnapshotInput) (*VolumeSnapshotInput, error) 26 | Update(existing *VolumeSnapshotInput, updates interface{}) (*VolumeSnapshotInput, error) 27 | ById(id string) (*VolumeSnapshotInput, error) 28 | Delete(container *VolumeSnapshotInput) error 29 | } 30 | 31 | func newVolumeSnapshotInputClient(rancherClient *RancherClient) *VolumeSnapshotInputClient { 32 | return &VolumeSnapshotInputClient{ 33 | rancherClient: rancherClient, 34 | } 35 | } 36 | 37 | func (c *VolumeSnapshotInputClient) Create(container *VolumeSnapshotInput) (*VolumeSnapshotInput, error) { 38 | resp := &VolumeSnapshotInput{} 39 | err := c.rancherClient.doCreate(VOLUME_SNAPSHOT_INPUT_TYPE, container, resp) 40 | return resp, err 41 | } 42 | 43 | func (c *VolumeSnapshotInputClient) Update(existing *VolumeSnapshotInput, updates interface{}) (*VolumeSnapshotInput, error) { 44 | resp := &VolumeSnapshotInput{} 45 | err := c.rancherClient.doUpdate(VOLUME_SNAPSHOT_INPUT_TYPE, &existing.Resource, updates, resp) 46 | return resp, err 47 | } 48 | 49 | func (c *VolumeSnapshotInputClient) List(opts *ListOpts) (*VolumeSnapshotInputCollection, error) { 50 | resp := &VolumeSnapshotInputCollection{} 51 | err := c.rancherClient.doList(VOLUME_SNAPSHOT_INPUT_TYPE, opts, resp) 52 | resp.client = c 53 | return resp, err 54 | } 55 | 56 | func (cc *VolumeSnapshotInputCollection) Next() (*VolumeSnapshotInputCollection, error) { 57 | if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { 58 | resp := &VolumeSnapshotInputCollection{} 59 | err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) 60 | resp.client = cc.client 61 | return resp, err 62 | } 63 | return nil, nil 64 | } 65 | 66 | func (c *VolumeSnapshotInputClient) ById(id string) (*VolumeSnapshotInput, error) { 67 | resp := &VolumeSnapshotInput{} 68 | err := c.rancherClient.doById(VOLUME_SNAPSHOT_INPUT_TYPE, id, resp) 69 | if apiError, ok := err.(*ApiError); ok { 70 | if apiError.StatusCode == 404 { 71 | return nil, nil 72 | } 73 | } 74 | return resp, err 75 | } 76 | 77 | func (c *VolumeSnapshotInputClient) Delete(container *VolumeSnapshotInput) error { 78 | return c.rancherClient.doResourceDelete(VOLUME_SNAPSHOT_INPUT_TYPE, &container.Resource) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.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 | 24 | .DS_Store 25 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | go: 6 | - 1.1 7 | - 1.2 8 | - 1.3 9 | - 1.4 10 | - 1.5 11 | - 1.6 12 | - 1.7 13 | - tip 14 | 15 | script: 16 | - go test -v ./... 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENCE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell 2 | 3 | Please consider promoting this project if you find it useful. 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, 10 | and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 21 | OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 22 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell 2 | 3 | Please consider promoting this project if you find it useful. 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, 10 | and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 21 | OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 22 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/doc.go: -------------------------------------------------------------------------------- 1 | // Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. 2 | // 3 | // Example Usage 4 | // 5 | // The following is a complete example using assert in a standard test function: 6 | // import ( 7 | // "testing" 8 | // "github.com/stretchr/testify/assert" 9 | // ) 10 | // 11 | // func TestSomething(t *testing.T) { 12 | // 13 | // var a string = "Hello" 14 | // var b string = "Hello" 15 | // 16 | // assert.Equal(t, a, b, "The two words should be the same.") 17 | // 18 | // } 19 | // 20 | // if you assert many times, use the format below: 21 | // 22 | // import ( 23 | // "testing" 24 | // "github.com/stretchr/testify/assert" 25 | // ) 26 | // 27 | // func TestSomething(t *testing.T) { 28 | // assert := assert.New(t) 29 | // 30 | // var a string = "Hello" 31 | // var b string = "Hello" 32 | // 33 | // assert.Equal(a, b, "The two words should be the same.") 34 | // } 35 | // 36 | // Assertions 37 | // 38 | // Assertions allow you to easily write test code, and are global funcs in the `assert` package. 39 | // All assertion functions take, as the first argument, the `*testing.T` object provided by the 40 | // testing framework. This allows the assertion funcs to write the failings and other details to 41 | // the correct place. 42 | // 43 | // Every assertion function also takes an optional string message as the final argument, 44 | // allowing custom error messages to be appended to the message the assertion method outputs. 45 | package assert 46 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/mock/doc.go: -------------------------------------------------------------------------------- 1 | // Package mock provides a system by which it is possible to mock your objects 2 | // and verify calls are happening as expected. 3 | // 4 | // Example Usage 5 | // 6 | // The mock package provides an object, Mock, that tracks activity on another object. It is usually 7 | // embedded into a test object as shown below: 8 | // 9 | // type MyTestObject struct { 10 | // // add a Mock object instance 11 | // mock.Mock 12 | // 13 | // // other fields go here as normal 14 | // } 15 | // 16 | // When implementing the methods of an interface, you wire your functions up 17 | // to call the Mock.Called(args...) method, and return the appropriate values. 18 | // 19 | // For example, to mock a method that saves the name and age of a person and returns 20 | // the year of their birth or an error, you might write this: 21 | // 22 | // func (o *MyTestObject) SavePersonDetails(firstname, lastname string, age int) (int, error) { 23 | // args := o.Called(firstname, lastname, age) 24 | // return args.Int(0), args.Error(1) 25 | // } 26 | // 27 | // The Int, Error and Bool methods are examples of strongly typed getters that take the argument 28 | // index position. Given this argument list: 29 | // 30 | // (12, true, "Something") 31 | // 32 | // You could read them out strongly typed like this: 33 | // 34 | // args.Int(0) 35 | // args.Bool(1) 36 | // args.String(2) 37 | // 38 | // For objects of your own type, use the generic Arguments.Get(index) method and make a type assertion: 39 | // 40 | // return args.Get(0).(*MyObject), args.Get(1).(*AnotherObjectOfMine) 41 | // 42 | // This may cause a panic if the object you are getting is nil (the type assertion will fail), in those 43 | // cases you should check for nil first. 44 | package mock 45 | --------------------------------------------------------------------------------