diff --git a/docs/configuration/backends/rancher.md b/docs/configuration/backends/rancher.md index a3d31c046..e1667dc74 100644 --- a/docs/configuration/backends/rancher.md +++ b/docs/configuration/backends/rancher.md @@ -110,6 +110,12 @@ secretKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" To enable Traefik to fetch information about the Environment it's deployed in only, you need to create an `Environment API Key`. This can be found within the API Key advanced options. + Add these labels to traefik docker deployment to autogenerated these values: + ``` + io.rancher.container.agent.role: environment + io.rancher.container.create_agent: true + ``` + ## Labels: overriding default behaviour Labels can be used on task containers to override default behaviour: diff --git a/glide.lock b/glide.lock index 2be78ea15..021c4e213 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 70e3ed39d2777d36b679ff55b8b0f2eb8d0b239fdfb8108f41b8b7239bc7920c -updated: 2017-10-25T10:18:20.438135-04:00 +hash: 1d18b9c76989feed304a8781b18ea24b43e858091b775316af97bfc210a06ea0 +updated: 2017-11-02T11:39:20.438135-04:00 imports: - name: cloud.google.com/go version: 2e6a95edb1071d750f6d7db777bf66cd2997af6c @@ -436,11 +436,11 @@ imports: - name: github.com/PuerkitoBio/urlesc version: 5bd2802263f21d8788851d5305584c82a5c75d7e - name: github.com/rancher/go-rancher - version: 5b8f6cc26b355ba03d7611fce3844155b7baf05b + version: 52e2f489534007ae843065468c5a1920d542afa4 subpackages: - - client + - v2 - name: github.com/rancher/go-rancher-metadata - version: 95d4962a8f0420be24fb49c2cb4f5491284c62f1 + version: d2103caca5873119ff423d29cba09b4d03cd69b8 subpackages: - metadata - name: github.com/ryanuber/go-glob diff --git a/glide.yaml b/glide.yaml index 72c622c80..700019e91 100644 --- a/glide.yaml +++ b/glide.yaml @@ -166,7 +166,7 @@ import: - package: github.com/golang/protobuf version: 2bba0603135d7d7f5cb73b2125beeda19c09f4ef - package: github.com/rancher/go-rancher - version: 5b8f6cc26b355ba03d7611fce3844155b7baf05b + version: 52e2f489534007ae843065468c5a1920d542afa4 - package: golang.org/x/oauth2 version: 7fdf09982454086d5570c7db3e11f360194830ca subpackages: @@ -174,7 +174,7 @@ import: - package: golang.org/x/time version: 8be79e1e0910c292df4e79c241bb7e8f7e725959 - package: github.com/rancher/go-rancher-metadata - version: 95d4962a8f0420be24fb49c2cb4f5491284c62f1 + version: d2103caca5873119ff423d29cba09b4d03cd69b8 - package: github.com/googleapis/gax-go version: 9af46dd5a1713e8b5cd71106287eba3cefdde50b - package: google.golang.org/grpc diff --git a/provider/rancher/api.go b/provider/rancher/api.go index d00e13ac7..dff55a361 100644 --- a/provider/rancher/api.go +++ b/provider/rancher/api.go @@ -11,7 +11,7 @@ import ( "github.com/containous/traefik/safe" "github.com/containous/traefik/types" "github.com/mitchellh/mapstructure" - rancher "github.com/rancher/go-rancher/client" + rancher "github.com/rancher/go-rancher/v2" ) const ( @@ -72,11 +72,11 @@ func (p *Provider) apiProvide(configurationChan chan<- types.ConfigMessage, pool } ctx := context.Background() - var environments = listRancherEnvironments(rancherClient) + var stacks = listRancherStacks(rancherClient) var services = listRancherServices(rancherClient) var container = listRancherContainer(rancherClient) - var rancherData = parseAPISourcedRancherData(environments, services, container) + var rancherData = parseAPISourcedRancherData(stacks, services, container) configuration := p.loadRancherConfig(rancherData) configurationChan <- types.ConfigMessage{ @@ -93,11 +93,11 @@ func (p *Provider) apiProvide(configurationChan chan<- types.ConfigMessage, pool case <-ticker.C: log.Debugf("Refreshing new Data from Provider API") - var environments = listRancherEnvironments(rancherClient) + var stacks = listRancherStacks(rancherClient) var services = listRancherServices(rancherClient) var container = listRancherContainer(rancherClient) - rancherData := parseAPISourcedRancherData(environments, services, container) + rancherData := parseAPISourcedRancherData(stacks, services, container) configuration := p.loadRancherConfig(rancherData) if configuration != nil { @@ -129,24 +129,21 @@ func (p *Provider) apiProvide(configurationChan chan<- types.ConfigMessage, pool return nil } -func listRancherEnvironments(client *rancher.RancherClient) []*rancher.Environment { +func listRancherStacks(client *rancher.RancherClient) []*rancher.Stack { - // Rancher Environment in frontend UI is actually a stack - // https://forums.rancher.com/t/api-key-for-all-environments/279/9 + var stackList = []*rancher.Stack{} - var environmentList = []*rancher.Environment{} - - environments, err := client.Environment.List(nil) + stacks, err := client.Stack.List(withoutPagination) if err != nil { - log.Errorf("Cannot get Rancher Environments %+v", err) + log.Errorf("Cannot get Provider Stacks %+v", err) } - for k := range environments.Data { - environmentList = append(environmentList, &environments.Data[k]) + for k := range stacks.Data { + stackList = append(stackList, &stacks.Data[k]) } - return environmentList + return stackList } func listRancherServices(client *rancher.RancherClient) []*rancher.Service { @@ -197,19 +194,19 @@ func listRancherContainer(client *rancher.RancherClient) []*rancher.Container { return containerList } -func parseAPISourcedRancherData(environments []*rancher.Environment, services []*rancher.Service, containers []*rancher.Container) []rancherData { +func parseAPISourcedRancherData(stacks []*rancher.Stack, services []*rancher.Service, containers []*rancher.Container) []rancherData { var rancherDataList []rancherData - for _, environment := range environments { + for _, stack := range stacks { for _, service := range services { - if service.EnvironmentId != environment.Id { + if service.StackId != stack.Id { continue } rancherData := rancherData{ - Name: environment.Name + "/" + service.Name, + Name: service.Name + "/" + stack.Name, Health: service.HealthState, State: service.State, Labels: make(map[string]string), @@ -217,7 +214,7 @@ func parseAPISourcedRancherData(environments []*rancher.Environment, services [] } if service.LaunchConfig == nil || service.LaunchConfig.Labels == nil { - log.Warnf("Rancher Service Labels are missing. Environment: %s, service: %s", environment.Name, service.Name) + log.Warnf("Rancher Service Labels are missing. Stack: %s, service: %s", stack.Name, service.Name) } else { for key, value := range service.LaunchConfig.Labels { rancherData.Labels[key] = value.(string) @@ -225,7 +222,7 @@ func parseAPISourcedRancherData(environments []*rancher.Environment, services [] } for _, container := range containers { - if container.Labels[labelRancherStackServiceName] == rancherData.Name && + if container.Labels[labelRancherStackServiceName] == stack.Name+"/"+service.Name && containerFilter(container.Name, container.HealthState, container.State) { if container.NetworkMode == hostNetwork { diff --git a/provider/rancher/metadata.go b/provider/rancher/metadata.go index 37c470ecc..01ac2e48c 100644 --- a/provider/rancher/metadata.go +++ b/provider/rancher/metadata.go @@ -129,7 +129,7 @@ func parseMetadataSourcedRancherData(stacks []rancher.Stack) (rancherDataList [] } rancherDataList = append(rancherDataList, rancherData{ - Name: stack.Name + "/" + service.Name, + Name: service.Name + "/" + stack.Name, State: service.State, Labels: service.Labels, Containers: containerIPAddresses, diff --git a/vendor/github.com/rancher/go-rancher-metadata/metadata/metadata.go b/vendor/github.com/rancher/go-rancher-metadata/metadata/metadata.go index f06b181aa..d536d686b 100644 --- a/vendor/github.com/rancher/go-rancher-metadata/metadata/metadata.go +++ b/vendor/github.com/rancher/go-rancher-metadata/metadata/metadata.go @@ -20,6 +20,7 @@ type Client interface { GetSelfStack() (Stack, error) GetServices() ([]Service, error) GetStacks() ([]Stack, error) + GetStackByName(string) (Stack, error) GetContainers() ([]Container, error) GetServiceContainers(string, string) ([]Container, error) GetHosts() ([]Host, error) @@ -190,6 +191,20 @@ func (m *client) GetStacks() ([]Stack, error) { return stacks, nil } +func (m *client) GetStackByName(name string) (Stack, error) { + resp, err := m.SendRequest("/stacks/" + name) + var stack Stack + if err != nil { + return stack, err + } + + if err = json.Unmarshal(resp, &stack); err != nil { + return stack, err + } + + return stack, nil +} + func (m *client) GetContainers() ([]Container, error) { resp, err := m.SendRequest("/containers") var containers []Container diff --git a/vendor/github.com/rancher/go-rancher-metadata/metadata/types.go b/vendor/github.com/rancher/go-rancher-metadata/metadata/types.go index f4b938e92..d07999150 100644 --- a/vendor/github.com/rancher/go-rancher-metadata/metadata/types.go +++ b/vendor/github.com/rancher/go-rancher-metadata/metadata/types.go @@ -43,6 +43,8 @@ type Service struct { EnvironmentUUID string `json:"environment_uuid"` State string `json:"state"` System bool `json:"system"` + EnvironmentName string `json:"environment_name"` + Selector string `json:"selector"` } type Container struct { @@ -54,6 +56,7 @@ type Container struct { ServiceName string `json:"service_name"` ServiceIndex string `json:"service_index"` StackName string `json:"stack_name"` + StackUUID string `json:"stack_uuid"` Labels map[string]string `json:"labels"` CreateIndex int `json:"create_index"` HostUUID string `json:"host_uuid"` @@ -73,6 +76,8 @@ type Container struct { System bool `json:"system"` EnvironmentUUID string `json:"environment_uuid"` HealthCheck HealthCheck `json:"health_check"` + EnvironmentName string `json:"environment_name"` + ServiceUUID string `json:"service_uuid"` } type Network struct { @@ -97,27 +102,29 @@ type Host struct { MilliCPU int64 `json:"milli_cpu"` LocalStorageMb int64 `json:"local_storage_mb"` EnvironmentUUID string `json:"environment_uuid"` + State string `json:"state"` } type PortRule struct { - SourcePort int `json:"source_port"` - Protocol string `json:"protocol"` - Path string `json:"path"` - Hostname string `json:"hostname"` - Service string `json:"service"` - TargetPort int `json:"target_port"` - Priority int `json:"priority"` - BackendName string `json:"backend_name"` - Selector string `json:"selector"` - Container string `json:"container"` + SourcePort int `json:"source_port"` + Protocol string `json:"protocol"` + Path string `json:"path"` + Hostname string `json:"hostname"` + Service string `json:"service"` + TargetPort int `json:"target_port"` + Priority int `json:"priority"` + BackendName string `json:"backend_name"` + Selector string `json:"selector"` + Container string `json:"container"` + ContainerUUID string `json:"container_uuid"` } type LBConfig struct { - Certs []string `json:"certs"` - DefaultCert string `json:"default_cert"` - PortRules []PortRule `json:"port_rules"` - Config string `json:"config"` - StickinessPolicy LBStickinessPolicy `json:"stickiness_policy"` + CertificateIDs []string `json:"certificate_ids"` + DefaultCertificateID string `json:"default_certificate_id"` + PortRules []PortRule `json:"port_rules"` + Config string `json:"config"` + StickinessPolicy LBStickinessPolicy `json:"stickiness_policy"` } type LBStickinessPolicy struct { diff --git a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_service_link_input.go b/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_service_link_input.go deleted file mode 100644 index bcffcd35e..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_load_balancer_service_link_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE = "addRemoveLoadBalancerServiceLinkInput" -) - -type AddRemoveLoadBalancerServiceLinkInput struct { - Resource - - ServiceLink LoadBalancerServiceLink `json:"serviceLink,omitempty" yaml:"service_link,omitempty"` -} - -type AddRemoveLoadBalancerServiceLinkInputCollection struct { - Collection - Data []AddRemoveLoadBalancerServiceLinkInput `json:"data,omitempty"` - client *AddRemoveLoadBalancerServiceLinkInputClient -} - -type AddRemoveLoadBalancerServiceLinkInputClient struct { - rancherClient *RancherClient -} - -type AddRemoveLoadBalancerServiceLinkInputOperations interface { - List(opts *ListOpts) (*AddRemoveLoadBalancerServiceLinkInputCollection, error) - Create(opts *AddRemoveLoadBalancerServiceLinkInput) (*AddRemoveLoadBalancerServiceLinkInput, error) - Update(existing *AddRemoveLoadBalancerServiceLinkInput, updates interface{}) (*AddRemoveLoadBalancerServiceLinkInput, error) - ById(id string) (*AddRemoveLoadBalancerServiceLinkInput, error) - Delete(container *AddRemoveLoadBalancerServiceLinkInput) error -} - -func newAddRemoveLoadBalancerServiceLinkInputClient(rancherClient *RancherClient) *AddRemoveLoadBalancerServiceLinkInputClient { - return &AddRemoveLoadBalancerServiceLinkInputClient{ - rancherClient: rancherClient, - } -} - -func (c *AddRemoveLoadBalancerServiceLinkInputClient) Create(container *AddRemoveLoadBalancerServiceLinkInput) (*AddRemoveLoadBalancerServiceLinkInput, error) { - resp := &AddRemoveLoadBalancerServiceLinkInput{} - err := c.rancherClient.doCreate(ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *AddRemoveLoadBalancerServiceLinkInputClient) Update(existing *AddRemoveLoadBalancerServiceLinkInput, updates interface{}) (*AddRemoveLoadBalancerServiceLinkInput, error) { - resp := &AddRemoveLoadBalancerServiceLinkInput{} - err := c.rancherClient.doUpdate(ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AddRemoveLoadBalancerServiceLinkInputClient) List(opts *ListOpts) (*AddRemoveLoadBalancerServiceLinkInputCollection, error) { - resp := &AddRemoveLoadBalancerServiceLinkInputCollection{} - err := c.rancherClient.doList(ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AddRemoveLoadBalancerServiceLinkInputCollection) Next() (*AddRemoveLoadBalancerServiceLinkInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AddRemoveLoadBalancerServiceLinkInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AddRemoveLoadBalancerServiceLinkInputClient) ById(id string) (*AddRemoveLoadBalancerServiceLinkInput, error) { - resp := &AddRemoveLoadBalancerServiceLinkInput{} - err := c.rancherClient.doById(ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AddRemoveLoadBalancerServiceLinkInputClient) Delete(container *AddRemoveLoadBalancerServiceLinkInput) error { - return c.rancherClient.doResourceDelete(ADD_REMOVE_LOAD_BALANCER_SERVICE_LINK_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_dynamic_schema.go b/vendor/github.com/rancher/go-rancher/client/generated_dynamic_schema.go deleted file mode 100644 index 6ee36740c..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_dynamic_schema.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - DYNAMIC_SCHEMA_TYPE = "dynamicSchema" -) - -type DynamicSchema struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Definition string `json:"definition,omitempty" yaml:"definition,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Parent string `json:"parent,omitempty" yaml:"parent,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - Roles []string `json:"roles,omitempty" yaml:"roles,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type DynamicSchemaCollection struct { - Collection - Data []DynamicSchema `json:"data,omitempty"` - client *DynamicSchemaClient -} - -type DynamicSchemaClient struct { - rancherClient *RancherClient -} - -type DynamicSchemaOperations interface { - List(opts *ListOpts) (*DynamicSchemaCollection, error) - Create(opts *DynamicSchema) (*DynamicSchema, error) - Update(existing *DynamicSchema, updates interface{}) (*DynamicSchema, error) - ById(id string) (*DynamicSchema, error) - Delete(container *DynamicSchema) error - - ActionCreate(*DynamicSchema) (*DynamicSchema, error) - - ActionRemove(*DynamicSchema) (*DynamicSchema, error) -} - -func newDynamicSchemaClient(rancherClient *RancherClient) *DynamicSchemaClient { - return &DynamicSchemaClient{ - rancherClient: rancherClient, - } -} - -func (c *DynamicSchemaClient) Create(container *DynamicSchema) (*DynamicSchema, error) { - resp := &DynamicSchema{} - err := c.rancherClient.doCreate(DYNAMIC_SCHEMA_TYPE, container, resp) - return resp, err -} - -func (c *DynamicSchemaClient) Update(existing *DynamicSchema, updates interface{}) (*DynamicSchema, error) { - resp := &DynamicSchema{} - err := c.rancherClient.doUpdate(DYNAMIC_SCHEMA_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DynamicSchemaClient) List(opts *ListOpts) (*DynamicSchemaCollection, error) { - resp := &DynamicSchemaCollection{} - err := c.rancherClient.doList(DYNAMIC_SCHEMA_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DynamicSchemaCollection) Next() (*DynamicSchemaCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DynamicSchemaCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DynamicSchemaClient) ById(id string) (*DynamicSchema, error) { - resp := &DynamicSchema{} - err := c.rancherClient.doById(DYNAMIC_SCHEMA_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DynamicSchemaClient) Delete(container *DynamicSchema) error { - return c.rancherClient.doResourceDelete(DYNAMIC_SCHEMA_TYPE, &container.Resource) -} - -func (c *DynamicSchemaClient) ActionCreate(resource *DynamicSchema) (*DynamicSchema, error) { - - resp := &DynamicSchema{} - - err := c.rancherClient.doAction(DYNAMIC_SCHEMA_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DynamicSchemaClient) ActionRemove(resource *DynamicSchema) (*DynamicSchema, error) { - - resp := &DynamicSchema{} - - err := c.rancherClient.doAction(DYNAMIC_SCHEMA_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_environment.go b/vendor/github.com/rancher/go-rancher/client/generated_environment.go deleted file mode 100644 index bbf3caeff..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_environment.go +++ /dev/null @@ -1,264 +0,0 @@ -package client - -const ( - ENVIRONMENT_TYPE = "environment" -) - -type Environment struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Outputs map[string]interface{} `json:"outputs,omitempty" yaml:"outputs,omitempty"` - - PreviousEnvironment map[string]interface{} `json:"previousEnvironment,omitempty" yaml:"previous_environment,omitempty"` - - PreviousExternalId string `json:"previousExternalId,omitempty" yaml:"previous_external_id,omitempty"` - - RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type EnvironmentCollection struct { - Collection - Data []Environment `json:"data,omitempty"` - client *EnvironmentClient -} - -type EnvironmentClient struct { - rancherClient *RancherClient -} - -type EnvironmentOperations interface { - List(opts *ListOpts) (*EnvironmentCollection, error) - Create(opts *Environment) (*Environment, error) - Update(existing *Environment, updates interface{}) (*Environment, error) - ById(id string) (*Environment, error) - Delete(container *Environment) error - - ActionActivateservices(*Environment) (*Environment, error) - - ActionAddoutputs(*Environment, *AddOutputsInput) (*Environment, error) - - ActionCancelrollback(*Environment) (*Environment, error) - - ActionCancelupgrade(*Environment) (*Environment, error) - - ActionCreate(*Environment) (*Environment, error) - - ActionDeactivateservices(*Environment) (*Environment, error) - - ActionError(*Environment) (*Environment, error) - - ActionExportconfig(*Environment, *ComposeConfigInput) (*ComposeConfig, error) - - ActionFinishupgrade(*Environment) (*Environment, error) - - ActionRemove(*Environment) (*Environment, error) - - ActionRollback(*Environment) (*Environment, error) - - ActionUpdate(*Environment) (*Environment, error) - - ActionUpgrade(*Environment, *EnvironmentUpgrade) (*Environment, error) -} - -func newEnvironmentClient(rancherClient *RancherClient) *EnvironmentClient { - return &EnvironmentClient{ - rancherClient: rancherClient, - } -} - -func (c *EnvironmentClient) Create(container *Environment) (*Environment, error) { - resp := &Environment{} - err := c.rancherClient.doCreate(ENVIRONMENT_TYPE, container, resp) - return resp, err -} - -func (c *EnvironmentClient) Update(existing *Environment, updates interface{}) (*Environment, error) { - resp := &Environment{} - err := c.rancherClient.doUpdate(ENVIRONMENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *EnvironmentClient) List(opts *ListOpts) (*EnvironmentCollection, error) { - resp := &EnvironmentCollection{} - err := c.rancherClient.doList(ENVIRONMENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *EnvironmentCollection) Next() (*EnvironmentCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &EnvironmentCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *EnvironmentClient) ById(id string) (*Environment, error) { - resp := &Environment{} - err := c.rancherClient.doById(ENVIRONMENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *EnvironmentClient) Delete(container *Environment) error { - return c.rancherClient.doResourceDelete(ENVIRONMENT_TYPE, &container.Resource) -} - -func (c *EnvironmentClient) ActionActivateservices(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "activateservices", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionAddoutputs(resource *Environment, input *AddOutputsInput) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "addoutputs", &resource.Resource, input, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionCancelrollback(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionCancelupgrade(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionCreate(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionDeactivateservices(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "deactivateservices", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionError(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionExportconfig(resource *Environment, input *ComposeConfigInput) (*ComposeConfig, error) { - - resp := &ComposeConfig{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "exportconfig", &resource.Resource, input, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionFinishupgrade(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionRemove(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionRollback(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionUpdate(resource *Environment) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *EnvironmentClient) ActionUpgrade(resource *Environment, input *EnvironmentUpgrade) (*Environment, error) { - - resp := &Environment{} - - err := c.rancherClient.doAction(ENVIRONMENT_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_environment_upgrade.go b/vendor/github.com/rancher/go-rancher/client/generated_environment_upgrade.go deleted file mode 100644 index 7a7700f71..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_environment_upgrade.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - ENVIRONMENT_UPGRADE_TYPE = "environmentUpgrade" -) - -type EnvironmentUpgrade struct { - Resource - - DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` -} - -type EnvironmentUpgradeCollection struct { - Collection - Data []EnvironmentUpgrade `json:"data,omitempty"` - client *EnvironmentUpgradeClient -} - -type EnvironmentUpgradeClient struct { - rancherClient *RancherClient -} - -type EnvironmentUpgradeOperations interface { - List(opts *ListOpts) (*EnvironmentUpgradeCollection, error) - Create(opts *EnvironmentUpgrade) (*EnvironmentUpgrade, error) - Update(existing *EnvironmentUpgrade, updates interface{}) (*EnvironmentUpgrade, error) - ById(id string) (*EnvironmentUpgrade, error) - Delete(container *EnvironmentUpgrade) error -} - -func newEnvironmentUpgradeClient(rancherClient *RancherClient) *EnvironmentUpgradeClient { - return &EnvironmentUpgradeClient{ - rancherClient: rancherClient, - } -} - -func (c *EnvironmentUpgradeClient) Create(container *EnvironmentUpgrade) (*EnvironmentUpgrade, error) { - resp := &EnvironmentUpgrade{} - err := c.rancherClient.doCreate(ENVIRONMENT_UPGRADE_TYPE, container, resp) - return resp, err -} - -func (c *EnvironmentUpgradeClient) Update(existing *EnvironmentUpgrade, updates interface{}) (*EnvironmentUpgrade, error) { - resp := &EnvironmentUpgrade{} - err := c.rancherClient.doUpdate(ENVIRONMENT_UPGRADE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *EnvironmentUpgradeClient) List(opts *ListOpts) (*EnvironmentUpgradeCollection, error) { - resp := &EnvironmentUpgradeCollection{} - err := c.rancherClient.doList(ENVIRONMENT_UPGRADE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *EnvironmentUpgradeCollection) Next() (*EnvironmentUpgradeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &EnvironmentUpgradeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *EnvironmentUpgradeClient) ById(id string) (*EnvironmentUpgrade, error) { - resp := &EnvironmentUpgrade{} - err := c.rancherClient.doById(ENVIRONMENT_UPGRADE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *EnvironmentUpgradeClient) Delete(container *EnvironmentUpgrade) error { - return c.rancherClient.doResourceDelete(ENVIRONMENT_UPGRADE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_githubconfig.go b/vendor/github.com/rancher/go-rancher/client/generated_githubconfig.go deleted file mode 100644 index c053fc3fc..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_githubconfig.go +++ /dev/null @@ -1,93 +0,0 @@ -package client - -const ( - GITHUBCONFIG_TYPE = "githubconfig" -) - -type Githubconfig struct { - Resource - - AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` - - AllowedIdentities []interface{} `json:"allowedIdentities,omitempty" yaml:"allowed_identities,omitempty"` - - ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"` - - ClientSecret string `json:"clientSecret,omitempty" yaml:"client_secret,omitempty"` - - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"` -} - -type GithubconfigCollection struct { - Collection - Data []Githubconfig `json:"data,omitempty"` - client *GithubconfigClient -} - -type GithubconfigClient struct { - rancherClient *RancherClient -} - -type GithubconfigOperations interface { - List(opts *ListOpts) (*GithubconfigCollection, error) - Create(opts *Githubconfig) (*Githubconfig, error) - Update(existing *Githubconfig, updates interface{}) (*Githubconfig, error) - ById(id string) (*Githubconfig, error) - Delete(container *Githubconfig) error -} - -func newGithubconfigClient(rancherClient *RancherClient) *GithubconfigClient { - return &GithubconfigClient{ - rancherClient: rancherClient, - } -} - -func (c *GithubconfigClient) Create(container *Githubconfig) (*Githubconfig, error) { - resp := &Githubconfig{} - err := c.rancherClient.doCreate(GITHUBCONFIG_TYPE, container, resp) - return resp, err -} - -func (c *GithubconfigClient) Update(existing *Githubconfig, updates interface{}) (*Githubconfig, error) { - resp := &Githubconfig{} - err := c.rancherClient.doUpdate(GITHUBCONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GithubconfigClient) List(opts *ListOpts) (*GithubconfigCollection, error) { - resp := &GithubconfigCollection{} - err := c.rancherClient.doList(GITHUBCONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *GithubconfigCollection) Next() (*GithubconfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &GithubconfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *GithubconfigClient) ById(id string) (*Githubconfig, error) { - resp := &Githubconfig{} - err := c.rancherClient.doById(GITHUBCONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *GithubconfigClient) Delete(container *Githubconfig) error { - return c.rancherClient.doResourceDelete(GITHUBCONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_haproxy_config.go b/vendor/github.com/rancher/go-rancher/client/generated_haproxy_config.go deleted file mode 100644 index e8f6cc36b..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_haproxy_config.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - HAPROXY_CONFIG_TYPE = "haproxyConfig" -) - -type HaproxyConfig struct { - Resource - - Defaults string `json:"defaults,omitempty" yaml:"defaults,omitempty"` - - Global string `json:"global,omitempty" yaml:"global,omitempty"` -} - -type HaproxyConfigCollection struct { - Collection - Data []HaproxyConfig `json:"data,omitempty"` - client *HaproxyConfigClient -} - -type HaproxyConfigClient struct { - rancherClient *RancherClient -} - -type HaproxyConfigOperations interface { - List(opts *ListOpts) (*HaproxyConfigCollection, error) - Create(opts *HaproxyConfig) (*HaproxyConfig, error) - Update(existing *HaproxyConfig, updates interface{}) (*HaproxyConfig, error) - ById(id string) (*HaproxyConfig, error) - Delete(container *HaproxyConfig) error -} - -func newHaproxyConfigClient(rancherClient *RancherClient) *HaproxyConfigClient { - return &HaproxyConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *HaproxyConfigClient) Create(container *HaproxyConfig) (*HaproxyConfig, error) { - resp := &HaproxyConfig{} - err := c.rancherClient.doCreate(HAPROXY_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *HaproxyConfigClient) Update(existing *HaproxyConfig, updates interface{}) (*HaproxyConfig, error) { - resp := &HaproxyConfig{} - err := c.rancherClient.doUpdate(HAPROXY_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HaproxyConfigClient) List(opts *ListOpts) (*HaproxyConfigCollection, error) { - resp := &HaproxyConfigCollection{} - err := c.rancherClient.doList(HAPROXY_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HaproxyConfigCollection) Next() (*HaproxyConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HaproxyConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HaproxyConfigClient) ById(id string) (*HaproxyConfig, error) { - resp := &HaproxyConfig{} - err := c.rancherClient.doById(HAPROXY_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HaproxyConfigClient) Delete(container *HaproxyConfig) error { - return c.rancherClient.doResourceDelete(HAPROXY_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_ip_address_associate_input.go b/vendor/github.com/rancher/go-rancher/client/generated_ip_address_associate_input.go deleted file mode 100644 index 2fb5fe2e8..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_ip_address_associate_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - IP_ADDRESS_ASSOCIATE_INPUT_TYPE = "ipAddressAssociateInput" -) - -type IpAddressAssociateInput struct { - Resource - - IpAddressId string `json:"ipAddressId,omitempty" yaml:"ip_address_id,omitempty"` -} - -type IpAddressAssociateInputCollection struct { - Collection - Data []IpAddressAssociateInput `json:"data,omitempty"` - client *IpAddressAssociateInputClient -} - -type IpAddressAssociateInputClient struct { - rancherClient *RancherClient -} - -type IpAddressAssociateInputOperations interface { - List(opts *ListOpts) (*IpAddressAssociateInputCollection, error) - Create(opts *IpAddressAssociateInput) (*IpAddressAssociateInput, error) - Update(existing *IpAddressAssociateInput, updates interface{}) (*IpAddressAssociateInput, error) - ById(id string) (*IpAddressAssociateInput, error) - Delete(container *IpAddressAssociateInput) error -} - -func newIpAddressAssociateInputClient(rancherClient *RancherClient) *IpAddressAssociateInputClient { - return &IpAddressAssociateInputClient{ - rancherClient: rancherClient, - } -} - -func (c *IpAddressAssociateInputClient) Create(container *IpAddressAssociateInput) (*IpAddressAssociateInput, error) { - resp := &IpAddressAssociateInput{} - err := c.rancherClient.doCreate(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *IpAddressAssociateInputClient) Update(existing *IpAddressAssociateInput, updates interface{}) (*IpAddressAssociateInput, error) { - resp := &IpAddressAssociateInput{} - err := c.rancherClient.doUpdate(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *IpAddressAssociateInputClient) List(opts *ListOpts) (*IpAddressAssociateInputCollection, error) { - resp := &IpAddressAssociateInputCollection{} - err := c.rancherClient.doList(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *IpAddressAssociateInputCollection) Next() (*IpAddressAssociateInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &IpAddressAssociateInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *IpAddressAssociateInputClient) ById(id string) (*IpAddressAssociateInput, error) { - resp := &IpAddressAssociateInput{} - err := c.rancherClient.doById(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *IpAddressAssociateInputClient) Delete(container *IpAddressAssociateInput) error { - return c.rancherClient.doResourceDelete(IP_ADDRESS_ASSOCIATE_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_ldapconfig.go b/vendor/github.com/rancher/go-rancher/client/generated_ldapconfig.go deleted file mode 100644 index fb8a1c937..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_ldapconfig.go +++ /dev/null @@ -1,123 +0,0 @@ -package client - -const ( - LDAPCONFIG_TYPE = "ldapconfig" -) - -type Ldapconfig struct { - Resource - - AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` - - AllowedIdentities []interface{} `json:"allowedIdentities,omitempty" yaml:"allowed_identities,omitempty"` - - ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connection_timeout,omitempty"` - - Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` - - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - - GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"group_member_mapping_attribute,omitempty"` - - GroupNameField string `json:"groupNameField,omitempty" yaml:"group_name_field,omitempty"` - - GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"group_object_class,omitempty"` - - GroupSearchField string `json:"groupSearchField,omitempty" yaml:"group_search_field,omitempty"` - - LoginDomain string `json:"loginDomain,omitempty" yaml:"login_domain,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - Server string `json:"server,omitempty" yaml:"server,omitempty"` - - ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" yaml:"service_account_password,omitempty"` - - ServiceAccountUsername string `json:"serviceAccountUsername,omitempty" yaml:"service_account_username,omitempty"` - - Tls bool `json:"tls,omitempty" yaml:"tls,omitempty"` - - UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" yaml:"user_disabled_bit_mask,omitempty"` - - UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" yaml:"user_enabled_attribute,omitempty"` - - UserLoginField string `json:"userLoginField,omitempty" yaml:"user_login_field,omitempty"` - - UserMemberAttribute string `json:"userMemberAttribute,omitempty" yaml:"user_member_attribute,omitempty"` - - UserNameField string `json:"userNameField,omitempty" yaml:"user_name_field,omitempty"` - - UserObjectClass string `json:"userObjectClass,omitempty" yaml:"user_object_class,omitempty"` - - UserSearchField string `json:"userSearchField,omitempty" yaml:"user_search_field,omitempty"` -} - -type LdapconfigCollection struct { - Collection - Data []Ldapconfig `json:"data,omitempty"` - client *LdapconfigClient -} - -type LdapconfigClient struct { - rancherClient *RancherClient -} - -type LdapconfigOperations interface { - List(opts *ListOpts) (*LdapconfigCollection, error) - Create(opts *Ldapconfig) (*Ldapconfig, error) - Update(existing *Ldapconfig, updates interface{}) (*Ldapconfig, error) - ById(id string) (*Ldapconfig, error) - Delete(container *Ldapconfig) error -} - -func newLdapconfigClient(rancherClient *RancherClient) *LdapconfigClient { - return &LdapconfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LdapconfigClient) Create(container *Ldapconfig) (*Ldapconfig, error) { - resp := &Ldapconfig{} - err := c.rancherClient.doCreate(LDAPCONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LdapconfigClient) Update(existing *Ldapconfig, updates interface{}) (*Ldapconfig, error) { - resp := &Ldapconfig{} - err := c.rancherClient.doUpdate(LDAPCONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LdapconfigClient) List(opts *ListOpts) (*LdapconfigCollection, error) { - resp := &LdapconfigCollection{} - err := c.rancherClient.doList(LDAPCONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LdapconfigCollection) Next() (*LdapconfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LdapconfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LdapconfigClient) ById(id string) (*Ldapconfig, error) { - resp := &Ldapconfig{} - err := c.rancherClient.doById(LDAPCONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LdapconfigClient) Delete(container *Ldapconfig) error { - return c.rancherClient.doResourceDelete(LDAPCONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_app_cookie_stickiness_policy.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_app_cookie_stickiness_policy.go deleted file mode 100644 index 9a0e7407e..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_app_cookie_stickiness_policy.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -const ( - LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE = "loadBalancerAppCookieStickinessPolicy" -) - -type LoadBalancerAppCookieStickinessPolicy struct { - Resource - - Cookie string `json:"cookie,omitempty" yaml:"cookie,omitempty"` - - MaxLength int64 `json:"maxLength,omitempty" yaml:"max_length,omitempty"` - - Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Prefix bool `json:"prefix,omitempty" yaml:"prefix,omitempty"` - - RequestLearn bool `json:"requestLearn,omitempty" yaml:"request_learn,omitempty"` - - Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` -} - -type LoadBalancerAppCookieStickinessPolicyCollection struct { - Collection - Data []LoadBalancerAppCookieStickinessPolicy `json:"data,omitempty"` - client *LoadBalancerAppCookieStickinessPolicyClient -} - -type LoadBalancerAppCookieStickinessPolicyClient struct { - rancherClient *RancherClient -} - -type LoadBalancerAppCookieStickinessPolicyOperations interface { - List(opts *ListOpts) (*LoadBalancerAppCookieStickinessPolicyCollection, error) - Create(opts *LoadBalancerAppCookieStickinessPolicy) (*LoadBalancerAppCookieStickinessPolicy, error) - Update(existing *LoadBalancerAppCookieStickinessPolicy, updates interface{}) (*LoadBalancerAppCookieStickinessPolicy, error) - ById(id string) (*LoadBalancerAppCookieStickinessPolicy, error) - Delete(container *LoadBalancerAppCookieStickinessPolicy) error -} - -func newLoadBalancerAppCookieStickinessPolicyClient(rancherClient *RancherClient) *LoadBalancerAppCookieStickinessPolicyClient { - return &LoadBalancerAppCookieStickinessPolicyClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerAppCookieStickinessPolicyClient) Create(container *LoadBalancerAppCookieStickinessPolicy) (*LoadBalancerAppCookieStickinessPolicy, error) { - resp := &LoadBalancerAppCookieStickinessPolicy{} - err := c.rancherClient.doCreate(LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerAppCookieStickinessPolicyClient) Update(existing *LoadBalancerAppCookieStickinessPolicy, updates interface{}) (*LoadBalancerAppCookieStickinessPolicy, error) { - resp := &LoadBalancerAppCookieStickinessPolicy{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerAppCookieStickinessPolicyClient) List(opts *ListOpts) (*LoadBalancerAppCookieStickinessPolicyCollection, error) { - resp := &LoadBalancerAppCookieStickinessPolicyCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LoadBalancerAppCookieStickinessPolicyCollection) Next() (*LoadBalancerAppCookieStickinessPolicyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LoadBalancerAppCookieStickinessPolicyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LoadBalancerAppCookieStickinessPolicyClient) ById(id string) (*LoadBalancerAppCookieStickinessPolicy, error) { - resp := &LoadBalancerAppCookieStickinessPolicy{} - err := c.rancherClient.doById(LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerAppCookieStickinessPolicyClient) Delete(container *LoadBalancerAppCookieStickinessPolicy) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_APP_COOKIE_STICKINESS_POLICY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_config.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_config.go deleted file mode 100644 index aabc4ef64..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_config.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - LOAD_BALANCER_CONFIG_TYPE = "loadBalancerConfig" -) - -type LoadBalancerConfig struct { - Resource - - HaproxyConfig *HaproxyConfig `json:"haproxyConfig,omitempty" yaml:"haproxy_config,omitempty"` - - LbCookieStickinessPolicy *LoadBalancerCookieStickinessPolicy `json:"lbCookieStickinessPolicy,omitempty" yaml:"lb_cookie_stickiness_policy,omitempty"` -} - -type LoadBalancerConfigCollection struct { - Collection - Data []LoadBalancerConfig `json:"data,omitempty"` - client *LoadBalancerConfigClient -} - -type LoadBalancerConfigClient struct { - rancherClient *RancherClient -} - -type LoadBalancerConfigOperations interface { - List(opts *ListOpts) (*LoadBalancerConfigCollection, error) - Create(opts *LoadBalancerConfig) (*LoadBalancerConfig, error) - Update(existing *LoadBalancerConfig, updates interface{}) (*LoadBalancerConfig, error) - ById(id string) (*LoadBalancerConfig, error) - Delete(container *LoadBalancerConfig) error -} - -func newLoadBalancerConfigClient(rancherClient *RancherClient) *LoadBalancerConfigClient { - return &LoadBalancerConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerConfigClient) Create(container *LoadBalancerConfig) (*LoadBalancerConfig, error) { - resp := &LoadBalancerConfig{} - err := c.rancherClient.doCreate(LOAD_BALANCER_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerConfigClient) Update(existing *LoadBalancerConfig, updates interface{}) (*LoadBalancerConfig, error) { - resp := &LoadBalancerConfig{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerConfigClient) List(opts *ListOpts) (*LoadBalancerConfigCollection, error) { - resp := &LoadBalancerConfigCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LoadBalancerConfigCollection) Next() (*LoadBalancerConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LoadBalancerConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LoadBalancerConfigClient) ById(id string) (*LoadBalancerConfig, error) { - resp := &LoadBalancerConfig{} - err := c.rancherClient.doById(LOAD_BALANCER_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerConfigClient) Delete(container *LoadBalancerConfig) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service_link.go b/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service_link.go deleted file mode 100644 index 87b74c3de..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service_link.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - LOAD_BALANCER_SERVICE_LINK_TYPE = "loadBalancerServiceLink" -) - -type LoadBalancerServiceLink struct { - Resource - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type LoadBalancerServiceLinkCollection struct { - Collection - Data []LoadBalancerServiceLink `json:"data,omitempty"` - client *LoadBalancerServiceLinkClient -} - -type LoadBalancerServiceLinkClient struct { - rancherClient *RancherClient -} - -type LoadBalancerServiceLinkOperations interface { - List(opts *ListOpts) (*LoadBalancerServiceLinkCollection, error) - Create(opts *LoadBalancerServiceLink) (*LoadBalancerServiceLink, error) - Update(existing *LoadBalancerServiceLink, updates interface{}) (*LoadBalancerServiceLink, error) - ById(id string) (*LoadBalancerServiceLink, error) - Delete(container *LoadBalancerServiceLink) error -} - -func newLoadBalancerServiceLinkClient(rancherClient *RancherClient) *LoadBalancerServiceLinkClient { - return &LoadBalancerServiceLinkClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerServiceLinkClient) Create(container *LoadBalancerServiceLink) (*LoadBalancerServiceLink, error) { - resp := &LoadBalancerServiceLink{} - err := c.rancherClient.doCreate(LOAD_BALANCER_SERVICE_LINK_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerServiceLinkClient) Update(existing *LoadBalancerServiceLink, updates interface{}) (*LoadBalancerServiceLink, error) { - resp := &LoadBalancerServiceLink{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_SERVICE_LINK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerServiceLinkClient) List(opts *ListOpts) (*LoadBalancerServiceLinkCollection, error) { - resp := &LoadBalancerServiceLinkCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_SERVICE_LINK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LoadBalancerServiceLinkCollection) Next() (*LoadBalancerServiceLinkCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LoadBalancerServiceLinkCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LoadBalancerServiceLinkClient) ById(id string) (*LoadBalancerServiceLink, error) { - resp := &LoadBalancerServiceLink{} - err := c.rancherClient.doById(LOAD_BALANCER_SERVICE_LINK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerServiceLinkClient) Delete(container *LoadBalancerServiceLink) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_SERVICE_LINK_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_set_labels_input.go b/vendor/github.com/rancher/go-rancher/client/generated_set_labels_input.go deleted file mode 100644 index 55d2e3115..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_set_labels_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - SET_LABELS_INPUT_TYPE = "setLabelsInput" -) - -type SetLabelsInput struct { - Resource - - Labels interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` -} - -type SetLabelsInputCollection struct { - Collection - Data []SetLabelsInput `json:"data,omitempty"` - client *SetLabelsInputClient -} - -type SetLabelsInputClient struct { - rancherClient *RancherClient -} - -type SetLabelsInputOperations interface { - List(opts *ListOpts) (*SetLabelsInputCollection, error) - Create(opts *SetLabelsInput) (*SetLabelsInput, error) - Update(existing *SetLabelsInput, updates interface{}) (*SetLabelsInput, error) - ById(id string) (*SetLabelsInput, error) - Delete(container *SetLabelsInput) error -} - -func newSetLabelsInputClient(rancherClient *RancherClient) *SetLabelsInputClient { - return &SetLabelsInputClient{ - rancherClient: rancherClient, - } -} - -func (c *SetLabelsInputClient) Create(container *SetLabelsInput) (*SetLabelsInput, error) { - resp := &SetLabelsInput{} - err := c.rancherClient.doCreate(SET_LABELS_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *SetLabelsInputClient) Update(existing *SetLabelsInput, updates interface{}) (*SetLabelsInput, error) { - resp := &SetLabelsInput{} - err := c.rancherClient.doUpdate(SET_LABELS_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SetLabelsInputClient) List(opts *ListOpts) (*SetLabelsInputCollection, error) { - resp := &SetLabelsInputCollection{} - err := c.rancherClient.doList(SET_LABELS_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SetLabelsInputCollection) Next() (*SetLabelsInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SetLabelsInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SetLabelsInputClient) ById(id string) (*SetLabelsInput, error) { - resp := &SetLabelsInput{} - err := c.rancherClient.doById(SET_LABELS_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SetLabelsInputClient) Delete(container *SetLabelsInput) error { - return c.rancherClient.doResourceDelete(SET_LABELS_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_service_links_input.go b/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_service_links_input.go deleted file mode 100644 index dd57f60cd..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_set_load_balancer_service_links_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE = "setLoadBalancerServiceLinksInput" -) - -type SetLoadBalancerServiceLinksInput struct { - Resource - - ServiceLinks []interface{} `json:"serviceLinks,omitempty" yaml:"service_links,omitempty"` -} - -type SetLoadBalancerServiceLinksInputCollection struct { - Collection - Data []SetLoadBalancerServiceLinksInput `json:"data,omitempty"` - client *SetLoadBalancerServiceLinksInputClient -} - -type SetLoadBalancerServiceLinksInputClient struct { - rancherClient *RancherClient -} - -type SetLoadBalancerServiceLinksInputOperations interface { - List(opts *ListOpts) (*SetLoadBalancerServiceLinksInputCollection, error) - Create(opts *SetLoadBalancerServiceLinksInput) (*SetLoadBalancerServiceLinksInput, error) - Update(existing *SetLoadBalancerServiceLinksInput, updates interface{}) (*SetLoadBalancerServiceLinksInput, error) - ById(id string) (*SetLoadBalancerServiceLinksInput, error) - Delete(container *SetLoadBalancerServiceLinksInput) error -} - -func newSetLoadBalancerServiceLinksInputClient(rancherClient *RancherClient) *SetLoadBalancerServiceLinksInputClient { - return &SetLoadBalancerServiceLinksInputClient{ - rancherClient: rancherClient, - } -} - -func (c *SetLoadBalancerServiceLinksInputClient) Create(container *SetLoadBalancerServiceLinksInput) (*SetLoadBalancerServiceLinksInput, error) { - resp := &SetLoadBalancerServiceLinksInput{} - err := c.rancherClient.doCreate(SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *SetLoadBalancerServiceLinksInputClient) Update(existing *SetLoadBalancerServiceLinksInput, updates interface{}) (*SetLoadBalancerServiceLinksInput, error) { - resp := &SetLoadBalancerServiceLinksInput{} - err := c.rancherClient.doUpdate(SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SetLoadBalancerServiceLinksInputClient) List(opts *ListOpts) (*SetLoadBalancerServiceLinksInputCollection, error) { - resp := &SetLoadBalancerServiceLinksInputCollection{} - err := c.rancherClient.doList(SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SetLoadBalancerServiceLinksInputCollection) Next() (*SetLoadBalancerServiceLinksInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SetLoadBalancerServiceLinksInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SetLoadBalancerServiceLinksInputClient) ById(id string) (*SetLoadBalancerServiceLinksInput, error) { - resp := &SetLoadBalancerServiceLinksInput{} - err := c.rancherClient.doById(SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SetLoadBalancerServiceLinksInputClient) Delete(container *SetLoadBalancerServiceLinksInput) error { - return c.rancherClient.doResourceDelete(SET_LOAD_BALANCER_SERVICE_LINKS_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_subscribe.go b/vendor/github.com/rancher/go-rancher/client/generated_subscribe.go deleted file mode 100644 index ec908982a..000000000 --- a/vendor/github.com/rancher/go-rancher/client/generated_subscribe.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - SUBSCRIBE_TYPE = "subscribe" -) - -type Subscribe struct { - Resource - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - EventNames []string `json:"eventNames,omitempty" yaml:"event_names,omitempty"` -} - -type SubscribeCollection struct { - Collection - Data []Subscribe `json:"data,omitempty"` - client *SubscribeClient -} - -type SubscribeClient struct { - rancherClient *RancherClient -} - -type SubscribeOperations interface { - List(opts *ListOpts) (*SubscribeCollection, error) - Create(opts *Subscribe) (*Subscribe, error) - Update(existing *Subscribe, updates interface{}) (*Subscribe, error) - ById(id string) (*Subscribe, error) - Delete(container *Subscribe) error -} - -func newSubscribeClient(rancherClient *RancherClient) *SubscribeClient { - return &SubscribeClient{ - rancherClient: rancherClient, - } -} - -func (c *SubscribeClient) Create(container *Subscribe) (*Subscribe, error) { - resp := &Subscribe{} - err := c.rancherClient.doCreate(SUBSCRIBE_TYPE, container, resp) - return resp, err -} - -func (c *SubscribeClient) Update(existing *Subscribe, updates interface{}) (*Subscribe, error) { - resp := &Subscribe{} - err := c.rancherClient.doUpdate(SUBSCRIBE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SubscribeClient) List(opts *ListOpts) (*SubscribeCollection, error) { - resp := &SubscribeCollection{} - err := c.rancherClient.doList(SUBSCRIBE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SubscribeCollection) Next() (*SubscribeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SubscribeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SubscribeClient) ById(id string) (*Subscribe, error) { - resp := &Subscribe{} - err := c.rancherClient.doById(SUBSCRIBE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SubscribeClient) Delete(container *Subscribe) error { - return c.rancherClient.doResourceDelete(SUBSCRIBE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/client/client.go b/vendor/github.com/rancher/go-rancher/v2/client.go similarity index 93% rename from vendor/github.com/rancher/go-rancher/client/client.go rename to vendor/github.com/rancher/go-rancher/v2/client.go index 6d943ce03..fef9e40fa 100644 --- a/vendor/github.com/rancher/go-rancher/client/client.go +++ b/vendor/github.com/rancher/go-rancher/v2/client.go @@ -23,6 +23,9 @@ type RancherBaseClient interface { Delete(*Resource) error Reload(*Resource, interface{}) error Action(string, string, *Resource, interface{}, interface{}) error + GetOpts() *ClientOpts + GetSchemas() *Schemas + GetTypes() map[string]Schema doGet(string, *ListOpts, interface{}) error doList(string, *ListOpts, interface{}) error diff --git a/vendor/github.com/rancher/go-rancher/client/common.go b/vendor/github.com/rancher/go-rancher/v2/common.go similarity index 91% rename from vendor/github.com/rancher/go-rancher/client/common.go rename to vendor/github.com/rancher/go-rancher/v2/common.go index e74145c5a..977016582 100644 --- a/vendor/github.com/rancher/go-rancher/client/common.go +++ b/vendor/github.com/rancher/go-rancher/v2/common.go @@ -2,6 +2,7 @@ package client import ( "bytes" + "encoding/base64" "encoding/json" "fmt" "io" @@ -10,6 +11,7 @@ import ( "net/url" "os" "regexp" + "strings" "time" "github.com/gorilla/websocket" @@ -22,8 +24,9 @@ const ( ) var ( - debug = false - dialer = &websocket.Dialer{} + debug = false + dialer = &websocket.Dialer{} + privateFieldRegex = regexp.MustCompile("^[[:lower:]]") ) type ClientOpts struct { @@ -128,7 +131,28 @@ func appendFilters(urlString string, filters map[string]interface{}) (string, er return u.String(), nil } +func NormalizeUrl(existingUrl string) (string, error) { + u, err := url.Parse(existingUrl) + if err != nil { + return "", err + } + + if u.Path == "" || u.Path == "/" { + u.Path = "v2-beta" + } else if u.Path == "/v1" || strings.HasPrefix(u.Path, "/v1/") { + u.Path = strings.Replace(u.Path, "/v1", "/v2-beta", 1) + } + + return u.String(), nil +} + func setupRancherBaseClient(rancherClient *RancherBaseClientImpl, opts *ClientOpts) error { + var err error + opts.Url, err = NormalizeUrl(opts.Url) + if err != nil { + return err + } + if opts.Timeout == 0 { opts.Timeout = time.Second * 10 } @@ -238,7 +262,17 @@ func (rancherClient *RancherBaseClientImpl) doDelete(url string) error { } func (rancherClient *RancherBaseClientImpl) Websocket(url string, headers map[string][]string) (*websocket.Conn, *http.Response, error) { - return dialer.Dial(url, http.Header(headers)) + httpHeaders := http.Header{} + for k, v := range httpHeaders { + httpHeaders[k] = v + } + + if rancherClient.Opts != nil { + s := rancherClient.Opts.AccessKey + ":" + rancherClient.Opts.SecretKey + httpHeaders.Add("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(s))) + } + + return dialer.Dial(url, http.Header(httpHeaders)) } func (rancherClient *RancherBaseClientImpl) doGet(url string, opts *ListOpts, respObject interface{}) error { @@ -566,6 +600,18 @@ func (rancherClient *RancherBaseClientImpl) doAction(schemaType string, action s return json.Unmarshal(byteContent, respObject) } +func (rancherClient *RancherBaseClientImpl) GetOpts() *ClientOpts { + return rancherClient.Opts +} + +func (rancherClient *RancherBaseClientImpl) GetSchemas() *Schemas { + return rancherClient.Schemas +} + +func (rancherClient *RancherBaseClientImpl) GetTypes() map[string]Schema { + return rancherClient.Types +} + func init() { debug = os.Getenv("RANCHER_CLIENT_DEBUG") == "true" if debug { diff --git a/vendor/github.com/rancher/go-rancher/client/generated_account.go b/vendor/github.com/rancher/go-rancher/v2/generated_account.go similarity index 95% rename from vendor/github.com/rancher/go-rancher/client/generated_account.go rename to vendor/github.com/rancher/go-rancher/v2/generated_account.go index 1697ae0dd..c4b86be32 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_account.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_account.go @@ -36,6 +36,8 @@ type Account struct { TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Version string `json:"version,omitempty" yaml:"version,omitempty"` } type AccountCollection struct { @@ -65,9 +67,9 @@ type AccountOperations interface { ActionRemove(*Account) (*Account, error) - ActionRestore(*Account) (*Account, error) - ActionUpdate(*Account) (*Account, error) + + ActionUpgrade(*Account) (*Account, error) } func newAccountClient(rancherClient *RancherClient) *AccountClient { @@ -165,15 +167,6 @@ func (c *AccountClient) ActionRemove(resource *Account) (*Account, error) { return resp, err } -func (c *AccountClient) ActionRestore(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *AccountClient) ActionUpdate(resource *Account) (*Account, error) { resp := &Account{} @@ -182,3 +175,12 @@ func (c *AccountClient) ActionUpdate(resource *Account) (*Account, error) { return resp, err } + +func (c *AccountClient) ActionUpgrade(resource *Account) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(ACCOUNT_TYPE, "upgrade", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_active_setting.go b/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_active_setting.go rename to vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_add_outputs_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_add_outputs_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_add_remove_service_link_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_add_remove_service_link_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_agent.go b/vendor/github.com/rancher/go-rancher/v2/generated_agent.go similarity index 95% rename from vendor/github.com/rancher/go-rancher/client/generated_agent.go rename to vendor/github.com/rancher/go-rancher/v2/generated_agent.go index 3a1f423ec..d38463117 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_agent.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_agent.go @@ -63,14 +63,14 @@ type AgentOperations interface { ActionDisconnect(*Agent) (*Agent, error) + ActionFinishreconnect(*Agent) (*Agent, error) + ActionPurge(*Agent) (*Agent, error) ActionReconnect(*Agent) (*Agent, error) ActionRemove(*Agent) (*Agent, error) - ActionRestore(*Agent) (*Agent, error) - ActionUpdate(*Agent) (*Agent, error) } @@ -160,6 +160,15 @@ func (c *AgentClient) ActionDisconnect(resource *Agent) (*Agent, error) { return resp, err } +func (c *AgentClient) ActionFinishreconnect(resource *Agent) (*Agent, error) { + + resp := &Agent{} + + err := c.rancherClient.doAction(AGENT_TYPE, "finishreconnect", &resource.Resource, nil, resp) + + return resp, err +} + func (c *AgentClient) ActionPurge(resource *Agent) (*Agent, error) { resp := &Agent{} @@ -187,15 +196,6 @@ func (c *AgentClient) ActionRemove(resource *Agent) (*Agent, error) { return resp, err } -func (c *AgentClient) ActionRestore(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *AgentClient) ActionUpdate(resource *Agent) (*Agent, error) { resp := &Agent{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_amazonec2config.go b/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go similarity index 90% rename from vendor/github.com/rancher/go-rancher/client/generated_amazonec2config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go index 2a88ca4eb..d75359519 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_amazonec2config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go @@ -11,16 +11,24 @@ type Amazonec2Config struct { Ami string `json:"ami,omitempty" yaml:"ami,omitempty"` + BlockDurationMinutes string `json:"blockDurationMinutes,omitempty" yaml:"block_duration_minutes,omitempty"` + DeviceName string `json:"deviceName,omitempty" yaml:"device_name,omitempty"` + Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` + IamInstanceProfile string `json:"iamInstanceProfile,omitempty" yaml:"iam_instance_profile,omitempty"` + InsecureTransport bool `json:"insecureTransport,omitempty" yaml:"insecure_transport,omitempty"` + InstanceType string `json:"instanceType,omitempty" yaml:"instance_type,omitempty"` KeypairName string `json:"keypairName,omitempty" yaml:"keypair_name,omitempty"` Monitoring bool `json:"monitoring,omitempty" yaml:"monitoring,omitempty"` + OpenPort []string `json:"openPort,omitempty" yaml:"open_port,omitempty"` + PrivateAddressOnly bool `json:"privateAddressOnly,omitempty" yaml:"private_address_only,omitempty"` Region string `json:"region,omitempty" yaml:"region,omitempty"` @@ -51,6 +59,8 @@ type Amazonec2Config struct { UsePrivateAddress bool `json:"usePrivateAddress,omitempty" yaml:"use_private_address,omitempty"` + Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` + VolumeType string `json:"volumeType,omitempty" yaml:"volume_type,omitempty"` VpcId string `json:"vpcId,omitempty" yaml:"vpc_id,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/client/generated_api_key.go b/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_api_key.go rename to vendor/github.com/rancher/go-rancher/v2/generated_api_key.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_audit_log.go b/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_audit_log.go rename to vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_azure_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go similarity index 98% rename from vendor/github.com/rancher/go-rancher/client/generated_azure_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go index 14868d7e5..12d1b30d5 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_azure_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go @@ -15,6 +15,8 @@ type AzureConfig struct { CustomData string `json:"customData,omitempty" yaml:"custom_data,omitempty"` + Dns string `json:"dns,omitempty" yaml:"dns,omitempty"` + DockerPort string `json:"dockerPort,omitempty" yaml:"docker_port,omitempty"` Environment string `json:"environment,omitempty" yaml:"environment,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/client/generated_azureadconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_azureadconfig.go rename to vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_backup.go b/vendor/github.com/rancher/go-rancher/v2/generated_backup.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_backup.go rename to vendor/github.com/rancher/go-rancher/v2/generated_backup.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_backup_target.go b/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_backup_target.go rename to vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_base_machine_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_base_machine_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_binding.go b/vendor/github.com/rancher/go-rancher/v2/generated_binding.go new file mode 100644 index 000000000..9cb4e1758 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_binding.go @@ -0,0 +1,79 @@ +package client + +const ( + BINDING_TYPE = "binding" +) + +type Binding struct { + Resource + + Services map[string]interface{} `json:"services,omitempty" yaml:"services,omitempty"` +} + +type BindingCollection struct { + Collection + Data []Binding `json:"data,omitempty"` + client *BindingClient +} + +type BindingClient struct { + rancherClient *RancherClient +} + +type BindingOperations interface { + List(opts *ListOpts) (*BindingCollection, error) + Create(opts *Binding) (*Binding, error) + Update(existing *Binding, updates interface{}) (*Binding, error) + ById(id string) (*Binding, error) + Delete(container *Binding) error +} + +func newBindingClient(rancherClient *RancherClient) *BindingClient { + return &BindingClient{ + rancherClient: rancherClient, + } +} + +func (c *BindingClient) Create(container *Binding) (*Binding, error) { + resp := &Binding{} + err := c.rancherClient.doCreate(BINDING_TYPE, container, resp) + return resp, err +} + +func (c *BindingClient) Update(existing *Binding, updates interface{}) (*Binding, error) { + resp := &Binding{} + err := c.rancherClient.doUpdate(BINDING_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *BindingClient) List(opts *ListOpts) (*BindingCollection, error) { + resp := &BindingCollection{} + err := c.rancherClient.doList(BINDING_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *BindingCollection) Next() (*BindingCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &BindingCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *BindingClient) ById(id string) (*Binding, error) { + resp := &Binding{} + err := c.rancherClient.doById(BINDING_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *BindingClient) Delete(container *Binding) error { + return c.rancherClient.doResourceDelete(BINDING_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_blkio_device_option.go b/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_blkio_device_option.go rename to vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go new file mode 100644 index 000000000..67d073e16 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go @@ -0,0 +1,93 @@ +package client + +const ( + CATALOG_TEMPLATE_TYPE = "catalogTemplate" +) + +type CatalogTemplate struct { + Resource + + Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` + + Binding Binding `json:"binding,omitempty" yaml:"binding,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` + + TemplateId string `json:"templateId,omitempty" yaml:"template_id,omitempty"` + + TemplateVersionId string `json:"templateVersionId,omitempty" yaml:"template_version_id,omitempty"` +} + +type CatalogTemplateCollection struct { + Collection + Data []CatalogTemplate `json:"data,omitempty"` + client *CatalogTemplateClient +} + +type CatalogTemplateClient struct { + rancherClient *RancherClient +} + +type CatalogTemplateOperations interface { + List(opts *ListOpts) (*CatalogTemplateCollection, error) + Create(opts *CatalogTemplate) (*CatalogTemplate, error) + Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) + ById(id string) (*CatalogTemplate, error) + Delete(container *CatalogTemplate) error +} + +func newCatalogTemplateClient(rancherClient *RancherClient) *CatalogTemplateClient { + return &CatalogTemplateClient{ + rancherClient: rancherClient, + } +} + +func (c *CatalogTemplateClient) Create(container *CatalogTemplate) (*CatalogTemplate, error) { + resp := &CatalogTemplate{} + err := c.rancherClient.doCreate(CATALOG_TEMPLATE_TYPE, container, resp) + return resp, err +} + +func (c *CatalogTemplateClient) Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) { + resp := &CatalogTemplate{} + err := c.rancherClient.doUpdate(CATALOG_TEMPLATE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *CatalogTemplateClient) List(opts *ListOpts) (*CatalogTemplateCollection, error) { + resp := &CatalogTemplateCollection{} + err := c.rancherClient.doList(CATALOG_TEMPLATE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *CatalogTemplateCollection) Next() (*CatalogTemplateCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &CatalogTemplateCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *CatalogTemplateClient) ById(id string) (*CatalogTemplate, error) { + resp := &CatalogTemplate{} + err := c.rancherClient.doById(CATALOG_TEMPLATE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *CatalogTemplateClient) Delete(container *CatalogTemplate) error { + return c.rancherClient.doResourceDelete(CATALOG_TEMPLATE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_certificate.go b/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_certificate.go rename to vendor/github.com/rancher/go-rancher/v2/generated_certificate.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_change_secret_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_change_secret_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_client.go b/vendor/github.com/rancher/go-rancher/v2/generated_client.go similarity index 80% rename from vendor/github.com/rancher/go-rancher/client/generated_client.go rename to vendor/github.com/rancher/go-rancher/v2/generated_client.go index 4ce5a4963..244ddb752 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_client.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_client.go @@ -6,7 +6,6 @@ type RancherClient struct { Account AccountOperations ActiveSetting ActiveSettingOperations AddOutputsInput AddOutputsInputOperations - AddRemoveLoadBalancerServiceLinkInput AddRemoveLoadBalancerServiceLinkInputOperations AddRemoveServiceLinkInput AddRemoveServiceLinkInputOperations Agent AgentOperations Amazonec2Config Amazonec2ConfigOperations @@ -17,9 +16,12 @@ type RancherClient struct { Backup BackupOperations BackupTarget BackupTargetOperations BaseMachineConfig BaseMachineConfigOperations + Binding BindingOperations BlkioDeviceOption BlkioDeviceOptionOperations + CatalogTemplate CatalogTemplateOperations Certificate CertificateOperations ChangeSecretInput ChangeSecretInputOperations + ClusterMembership ClusterMembershipOperations ComposeConfig ComposeConfigOperations ComposeConfigInput ComposeConfigInputOperations ComposeProject ComposeProjectOperations @@ -34,12 +36,10 @@ type RancherClient struct { Credential CredentialOperations Databasechangelog DatabasechangelogOperations Databasechangeloglock DatabasechangeloglockOperations + DefaultNetwork DefaultNetworkOperations DigitaloceanConfig DigitaloceanConfigOperations DnsService DnsServiceOperations DockerBuild DockerBuildOperations - DynamicSchema DynamicSchemaOperations - Environment EnvironmentOperations - EnvironmentUpgrade EnvironmentUpgradeOperations ExtensionImplementation ExtensionImplementationOperations ExtensionPoint ExtensionPointOperations ExternalDnsEvent ExternalDnsEventOperations @@ -54,14 +54,14 @@ type RancherClient struct { ExternalStoragePoolEvent ExternalStoragePoolEventOperations ExternalVolumeEvent ExternalVolumeEventOperations FieldDocumentation FieldDocumentationOperations - Githubconfig GithubconfigOperations + GenericObject GenericObjectOperations HaConfig HaConfigOperations HaConfigInput HaConfigInputOperations - HaproxyConfig HaproxyConfigOperations HealthcheckInstanceHostMap HealthcheckInstanceHostMapOperations Host HostOperations HostAccess HostAccessOperations HostApiProxyToken HostApiProxyTokenOperations + HostTemplate HostTemplateOperations Identity IdentityOperations Image ImageOperations InServiceUpgradeStrategy InServiceUpgradeStrategyOperations @@ -72,35 +72,43 @@ type RancherClient struct { InstanceLink InstanceLinkOperations InstanceStop InstanceStopOperations IpAddress IpAddressOperations - IpAddressAssociateInput IpAddressAssociateInputOperations KubernetesService KubernetesServiceOperations KubernetesStack KubernetesStackOperations KubernetesStackUpgrade KubernetesStackUpgradeOperations Label LabelOperations LaunchConfig LaunchConfigOperations - Ldapconfig LdapconfigOperations - LoadBalancerAppCookieStickinessPolicy LoadBalancerAppCookieStickinessPolicyOperations - LoadBalancerConfig LoadBalancerConfigOperations + LbConfig LbConfigOperations + LbTargetConfig LbTargetConfigOperations LoadBalancerCookieStickinessPolicy LoadBalancerCookieStickinessPolicyOperations LoadBalancerService LoadBalancerServiceOperations - LoadBalancerServiceLink LoadBalancerServiceLinkOperations LocalAuthConfig LocalAuthConfigOperations LogConfig LogConfigOperations Machine MachineOperations MachineDriver MachineDriverOperations Mount MountOperations + MountEntry MountEntryOperations Network NetworkOperations + NetworkDriver NetworkDriverOperations + NetworkDriverService NetworkDriverServiceOperations + NetworkPolicyRule NetworkPolicyRuleOperations + NetworkPolicyRuleBetween NetworkPolicyRuleBetweenOperations + NetworkPolicyRuleMember NetworkPolicyRuleMemberOperations + NetworkPolicyRuleWithin NetworkPolicyRuleWithinOperations NfsConfig NfsConfigOperations Openldapconfig OpenldapconfigOperations PacketConfig PacketConfigOperations Password PasswordOperations PhysicalHost PhysicalHostOperations Port PortOperations + PortRule PortRuleOperations ProcessDefinition ProcessDefinitionOperations ProcessExecution ProcessExecutionOperations ProcessInstance ProcessInstanceOperations + ProcessPool ProcessPoolOperations + ProcessSummary ProcessSummaryOperations Project ProjectOperations ProjectMember ProjectMemberOperations + ProjectTemplate ProjectTemplateOperations PublicEndpoint PublicEndpointOperations Publish PublishOperations PullTask PullTaskOperations @@ -115,36 +123,48 @@ type RancherClient struct { RevertToSnapshotInput RevertToSnapshotInputOperations RollingRestartStrategy RollingRestartStrategyOperations ScalePolicy ScalePolicyOperations + ScheduledUpgrade ScheduledUpgradeOperations SecondaryLaunchConfig SecondaryLaunchConfigOperations + Secret SecretOperations + SecretReference SecretReferenceOperations Service ServiceOperations + ServiceBinding ServiceBindingOperations ServiceConsumeMap ServiceConsumeMapOperations ServiceEvent ServiceEventOperations ServiceExposeMap ServiceExposeMapOperations ServiceLink ServiceLinkOperations + ServiceLog ServiceLogOperations ServiceProxy ServiceProxyOperations ServiceRestart ServiceRestartOperations ServiceUpgrade ServiceUpgradeOperations ServiceUpgradeStrategy ServiceUpgradeStrategyOperations ServicesPortRange ServicesPortRangeOperations - SetLabelsInput SetLabelsInputOperations - SetLoadBalancerServiceLinksInput SetLoadBalancerServiceLinksInputOperations SetProjectMembersInput SetProjectMembersInputOperations SetServiceLinksInput SetServiceLinksInputOperations Setting SettingOperations Snapshot SnapshotOperations SnapshotBackupInput SnapshotBackupInputOperations + Stack StackOperations + StackUpgrade StackUpgradeOperations StateTransition StateTransitionOperations StatsAccess StatsAccessOperations + StorageDriver StorageDriverOperations + StorageDriverService StorageDriverServiceOperations StoragePool StoragePoolOperations - Subscribe SubscribeOperations + Subnet SubnetOperations + TargetPortRule TargetPortRuleOperations Task TaskOperations TaskInstance TaskInstanceOperations ToServiceUpgradeStrategy ToServiceUpgradeStrategyOperations TypeDocumentation TypeDocumentationOperations + Ulimit UlimitOperations + UserPreference UserPreferenceOperations VirtualMachine VirtualMachineOperations VirtualMachineDisk VirtualMachineDiskOperations Volume VolumeOperations + VolumeActivateInput VolumeActivateInputOperations VolumeSnapshotInput VolumeSnapshotInputOperations + VolumeTemplate VolumeTemplateOperations } func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient { @@ -155,7 +175,6 @@ func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient { client.Account = newAccountClient(client) client.ActiveSetting = newActiveSettingClient(client) client.AddOutputsInput = newAddOutputsInputClient(client) - client.AddRemoveLoadBalancerServiceLinkInput = newAddRemoveLoadBalancerServiceLinkInputClient(client) client.AddRemoveServiceLinkInput = newAddRemoveServiceLinkInputClient(client) client.Agent = newAgentClient(client) client.Amazonec2Config = newAmazonec2ConfigClient(client) @@ -166,9 +185,12 @@ func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient { client.Backup = newBackupClient(client) client.BackupTarget = newBackupTargetClient(client) client.BaseMachineConfig = newBaseMachineConfigClient(client) + client.Binding = newBindingClient(client) client.BlkioDeviceOption = newBlkioDeviceOptionClient(client) + client.CatalogTemplate = newCatalogTemplateClient(client) client.Certificate = newCertificateClient(client) client.ChangeSecretInput = newChangeSecretInputClient(client) + client.ClusterMembership = newClusterMembershipClient(client) client.ComposeConfig = newComposeConfigClient(client) client.ComposeConfigInput = newComposeConfigInputClient(client) client.ComposeProject = newComposeProjectClient(client) @@ -183,12 +205,10 @@ func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient { client.Credential = newCredentialClient(client) client.Databasechangelog = newDatabasechangelogClient(client) client.Databasechangeloglock = newDatabasechangeloglockClient(client) + client.DefaultNetwork = newDefaultNetworkClient(client) client.DigitaloceanConfig = newDigitaloceanConfigClient(client) client.DnsService = newDnsServiceClient(client) client.DockerBuild = newDockerBuildClient(client) - client.DynamicSchema = newDynamicSchemaClient(client) - client.Environment = newEnvironmentClient(client) - client.EnvironmentUpgrade = newEnvironmentUpgradeClient(client) client.ExtensionImplementation = newExtensionImplementationClient(client) client.ExtensionPoint = newExtensionPointClient(client) client.ExternalDnsEvent = newExternalDnsEventClient(client) @@ -203,14 +223,14 @@ func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient { client.ExternalStoragePoolEvent = newExternalStoragePoolEventClient(client) client.ExternalVolumeEvent = newExternalVolumeEventClient(client) client.FieldDocumentation = newFieldDocumentationClient(client) - client.Githubconfig = newGithubconfigClient(client) + client.GenericObject = newGenericObjectClient(client) client.HaConfig = newHaConfigClient(client) client.HaConfigInput = newHaConfigInputClient(client) - client.HaproxyConfig = newHaproxyConfigClient(client) client.HealthcheckInstanceHostMap = newHealthcheckInstanceHostMapClient(client) client.Host = newHostClient(client) client.HostAccess = newHostAccessClient(client) client.HostApiProxyToken = newHostApiProxyTokenClient(client) + client.HostTemplate = newHostTemplateClient(client) client.Identity = newIdentityClient(client) client.Image = newImageClient(client) client.InServiceUpgradeStrategy = newInServiceUpgradeStrategyClient(client) @@ -221,35 +241,43 @@ func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient { client.InstanceLink = newInstanceLinkClient(client) client.InstanceStop = newInstanceStopClient(client) client.IpAddress = newIpAddressClient(client) - client.IpAddressAssociateInput = newIpAddressAssociateInputClient(client) client.KubernetesService = newKubernetesServiceClient(client) client.KubernetesStack = newKubernetesStackClient(client) client.KubernetesStackUpgrade = newKubernetesStackUpgradeClient(client) client.Label = newLabelClient(client) client.LaunchConfig = newLaunchConfigClient(client) - client.Ldapconfig = newLdapconfigClient(client) - client.LoadBalancerAppCookieStickinessPolicy = newLoadBalancerAppCookieStickinessPolicyClient(client) - client.LoadBalancerConfig = newLoadBalancerConfigClient(client) + client.LbConfig = newLbConfigClient(client) + client.LbTargetConfig = newLbTargetConfigClient(client) client.LoadBalancerCookieStickinessPolicy = newLoadBalancerCookieStickinessPolicyClient(client) client.LoadBalancerService = newLoadBalancerServiceClient(client) - client.LoadBalancerServiceLink = newLoadBalancerServiceLinkClient(client) client.LocalAuthConfig = newLocalAuthConfigClient(client) client.LogConfig = newLogConfigClient(client) client.Machine = newMachineClient(client) client.MachineDriver = newMachineDriverClient(client) client.Mount = newMountClient(client) + client.MountEntry = newMountEntryClient(client) client.Network = newNetworkClient(client) + client.NetworkDriver = newNetworkDriverClient(client) + client.NetworkDriverService = newNetworkDriverServiceClient(client) + client.NetworkPolicyRule = newNetworkPolicyRuleClient(client) + client.NetworkPolicyRuleBetween = newNetworkPolicyRuleBetweenClient(client) + client.NetworkPolicyRuleMember = newNetworkPolicyRuleMemberClient(client) + client.NetworkPolicyRuleWithin = newNetworkPolicyRuleWithinClient(client) client.NfsConfig = newNfsConfigClient(client) client.Openldapconfig = newOpenldapconfigClient(client) client.PacketConfig = newPacketConfigClient(client) client.Password = newPasswordClient(client) client.PhysicalHost = newPhysicalHostClient(client) client.Port = newPortClient(client) + client.PortRule = newPortRuleClient(client) client.ProcessDefinition = newProcessDefinitionClient(client) client.ProcessExecution = newProcessExecutionClient(client) client.ProcessInstance = newProcessInstanceClient(client) + client.ProcessPool = newProcessPoolClient(client) + client.ProcessSummary = newProcessSummaryClient(client) client.Project = newProjectClient(client) client.ProjectMember = newProjectMemberClient(client) + client.ProjectTemplate = newProjectTemplateClient(client) client.PublicEndpoint = newPublicEndpointClient(client) client.Publish = newPublishClient(client) client.PullTask = newPullTaskClient(client) @@ -264,36 +292,48 @@ func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient { client.RevertToSnapshotInput = newRevertToSnapshotInputClient(client) client.RollingRestartStrategy = newRollingRestartStrategyClient(client) client.ScalePolicy = newScalePolicyClient(client) + client.ScheduledUpgrade = newScheduledUpgradeClient(client) client.SecondaryLaunchConfig = newSecondaryLaunchConfigClient(client) + client.Secret = newSecretClient(client) + client.SecretReference = newSecretReferenceClient(client) client.Service = newServiceClient(client) + client.ServiceBinding = newServiceBindingClient(client) client.ServiceConsumeMap = newServiceConsumeMapClient(client) client.ServiceEvent = newServiceEventClient(client) client.ServiceExposeMap = newServiceExposeMapClient(client) client.ServiceLink = newServiceLinkClient(client) + client.ServiceLog = newServiceLogClient(client) client.ServiceProxy = newServiceProxyClient(client) client.ServiceRestart = newServiceRestartClient(client) client.ServiceUpgrade = newServiceUpgradeClient(client) client.ServiceUpgradeStrategy = newServiceUpgradeStrategyClient(client) client.ServicesPortRange = newServicesPortRangeClient(client) - client.SetLabelsInput = newSetLabelsInputClient(client) - client.SetLoadBalancerServiceLinksInput = newSetLoadBalancerServiceLinksInputClient(client) client.SetProjectMembersInput = newSetProjectMembersInputClient(client) client.SetServiceLinksInput = newSetServiceLinksInputClient(client) client.Setting = newSettingClient(client) client.Snapshot = newSnapshotClient(client) client.SnapshotBackupInput = newSnapshotBackupInputClient(client) + client.Stack = newStackClient(client) + client.StackUpgrade = newStackUpgradeClient(client) client.StateTransition = newStateTransitionClient(client) client.StatsAccess = newStatsAccessClient(client) + client.StorageDriver = newStorageDriverClient(client) + client.StorageDriverService = newStorageDriverServiceClient(client) client.StoragePool = newStoragePoolClient(client) - client.Subscribe = newSubscribeClient(client) + client.Subnet = newSubnetClient(client) + client.TargetPortRule = newTargetPortRuleClient(client) client.Task = newTaskClient(client) client.TaskInstance = newTaskInstanceClient(client) client.ToServiceUpgradeStrategy = newToServiceUpgradeStrategyClient(client) client.TypeDocumentation = newTypeDocumentationClient(client) + client.Ulimit = newUlimitClient(client) + client.UserPreference = newUserPreferenceClient(client) client.VirtualMachine = newVirtualMachineClient(client) client.VirtualMachineDisk = newVirtualMachineDiskClient(client) client.Volume = newVolumeClient(client) + client.VolumeActivateInput = newVolumeActivateInputClient(client) client.VolumeSnapshotInput = newVolumeSnapshotInputClient(client) + client.VolumeTemplate = newVolumeTemplateClient(client) return client } diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go b/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go new file mode 100644 index 000000000..f5848633e --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go @@ -0,0 +1,87 @@ +package client + +const ( + CLUSTER_MEMBERSHIP_TYPE = "clusterMembership" +) + +type ClusterMembership struct { + Resource + + Clustered bool `json:"clustered,omitempty" yaml:"clustered,omitempty"` + + Config string `json:"config,omitempty" yaml:"config,omitempty"` + + Heartbeat int64 `json:"heartbeat,omitempty" yaml:"heartbeat,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ClusterMembershipCollection struct { + Collection + Data []ClusterMembership `json:"data,omitempty"` + client *ClusterMembershipClient +} + +type ClusterMembershipClient struct { + rancherClient *RancherClient +} + +type ClusterMembershipOperations interface { + List(opts *ListOpts) (*ClusterMembershipCollection, error) + Create(opts *ClusterMembership) (*ClusterMembership, error) + Update(existing *ClusterMembership, updates interface{}) (*ClusterMembership, error) + ById(id string) (*ClusterMembership, error) + Delete(container *ClusterMembership) error +} + +func newClusterMembershipClient(rancherClient *RancherClient) *ClusterMembershipClient { + return &ClusterMembershipClient{ + rancherClient: rancherClient, + } +} + +func (c *ClusterMembershipClient) Create(container *ClusterMembership) (*ClusterMembership, error) { + resp := &ClusterMembership{} + err := c.rancherClient.doCreate(CLUSTER_MEMBERSHIP_TYPE, container, resp) + return resp, err +} + +func (c *ClusterMembershipClient) Update(existing *ClusterMembership, updates interface{}) (*ClusterMembership, error) { + resp := &ClusterMembership{} + err := c.rancherClient.doUpdate(CLUSTER_MEMBERSHIP_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ClusterMembershipClient) List(opts *ListOpts) (*ClusterMembershipCollection, error) { + resp := &ClusterMembershipCollection{} + err := c.rancherClient.doList(CLUSTER_MEMBERSHIP_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *ClusterMembershipCollection) Next() (*ClusterMembershipCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ClusterMembershipCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *ClusterMembershipClient) ById(id string) (*ClusterMembership, error) { + resp := &ClusterMembership{} + err := c.rancherClient.doById(CLUSTER_MEMBERSHIP_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ClusterMembershipClient) Delete(container *ClusterMembership) error { + return c.rancherClient.doResourceDelete(CLUSTER_MEMBERSHIP_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_compose_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_compose_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_compose_config_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_compose_config_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_compose_project.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go similarity index 83% rename from vendor/github.com/rancher/go-rancher/client/generated_compose_project.go rename to vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go index cf5c918aa..b191a887d 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_compose_project.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go @@ -9,6 +9,10 @@ type ComposeProject struct { AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` + + Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` + Created string `json:"created,omitempty" yaml:"created,omitempty"` Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` @@ -19,6 +23,8 @@ type ComposeProject struct { ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + Group string `json:"group,omitempty" yaml:"group,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` @@ -33,8 +39,12 @@ type ComposeProject struct { Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` @@ -63,19 +73,17 @@ type ComposeProjectOperations interface { ById(id string) (*ComposeProject, error) Delete(container *ComposeProject) error - ActionCancelrollback(*ComposeProject) (*Environment, error) + ActionCancelupgrade(*ComposeProject) (*Stack, error) - ActionCancelupgrade(*ComposeProject) (*Environment, error) + ActionCreate(*ComposeProject) (*Stack, error) - ActionCreate(*ComposeProject) (*Environment, error) + ActionError(*ComposeProject) (*Stack, error) - ActionError(*ComposeProject) (*Environment, error) + ActionFinishupgrade(*ComposeProject) (*Stack, error) - ActionFinishupgrade(*ComposeProject) (*Environment, error) + ActionRemove(*ComposeProject) (*Stack, error) - ActionRemove(*ComposeProject) (*Environment, error) - - ActionRollback(*ComposeProject) (*Environment, error) + ActionRollback(*ComposeProject) (*Stack, error) } func newComposeProjectClient(rancherClient *RancherClient) *ComposeProjectClient { @@ -128,63 +136,54 @@ func (c *ComposeProjectClient) Delete(container *ComposeProject) error { return c.rancherClient.doResourceDelete(COMPOSE_PROJECT_TYPE, &container.Resource) } -func (c *ComposeProjectClient) ActionCancelrollback(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionCancelupgrade(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionCancelupgrade(resource *ComposeProject) (*Environment, error) { - - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "cancelupgrade", &resource.Resource, nil, resp) return resp, err } -func (c *ComposeProjectClient) ActionCreate(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionCreate(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "create", &resource.Resource, nil, resp) return resp, err } -func (c *ComposeProjectClient) ActionError(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionError(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "error", &resource.Resource, nil, resp) return resp, err } -func (c *ComposeProjectClient) ActionFinishupgrade(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionFinishupgrade(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "finishupgrade", &resource.Resource, nil, resp) return resp, err } -func (c *ComposeProjectClient) ActionRemove(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionRemove(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "remove", &resource.Resource, nil, resp) return resp, err } -func (c *ComposeProjectClient) ActionRollback(resource *ComposeProject) (*Environment, error) { +func (c *ComposeProjectClient) ActionRollback(resource *ComposeProject) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "rollback", &resource.Resource, nil, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_compose_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go similarity index 89% rename from vendor/github.com/rancher/go-rancher/client/generated_compose_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go index 1af137748..ca7a297f4 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_compose_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go @@ -17,21 +17,23 @@ type ComposeService struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,omitempty"` - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` - PublicEndpoints []interface{} `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -45,10 +47,14 @@ type ComposeService struct { SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` State string `json:"state,omitempty" yaml:"state,omitempty"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -79,10 +85,10 @@ type ComposeServiceOperations interface { ActionActivate(*ComposeService) (*Service, error) - ActionCancelrollback(*ComposeService) (*Service, error) - ActionCancelupgrade(*ComposeService) (*Service, error) + ActionContinueupgrade(*ComposeService) (*Service, error) + ActionCreate(*ComposeService) (*Service, error) ActionFinishupgrade(*ComposeService) (*Service, error) @@ -151,15 +157,6 @@ func (c *ComposeServiceClient) ActionActivate(resource *ComposeService) (*Servic return resp, err } -func (c *ComposeServiceClient) ActionCancelrollback(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ComposeServiceClient) ActionCancelupgrade(resource *ComposeService) (*Service, error) { resp := &Service{} @@ -169,6 +166,15 @@ func (c *ComposeServiceClient) ActionCancelupgrade(resource *ComposeService) (*S return resp, err } +func (c *ComposeServiceClient) ActionContinueupgrade(resource *ComposeService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + func (c *ComposeServiceClient) ActionCreate(resource *ComposeService) (*Service, error) { resp := &Service{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_config_item.go b/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_config_item.go rename to vendor/github.com/rancher/go-rancher/v2/generated_config_item.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_config_item_status.go b/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_config_item_status.go rename to vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_container.go b/vendor/github.com/rancher/go-rancher/v2/generated_container.go similarity index 76% rename from vendor/github.com/rancher/go-rancher/client/generated_container.go rename to vendor/github.com/rancher/go-rancher/v2/generated_container.go index da3f17481..4cdf2a4e4 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_container.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_container.go @@ -15,18 +15,36 @@ type Container struct { BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` + Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` + CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` + Command []string `json:"command,omitempty" yaml:"command,omitempty"` Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` + + CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` + + CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` + + CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` + + CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` + + CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` @@ -47,8 +65,12 @@ type Container struct { Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` + DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` + Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` @@ -65,10 +87,20 @@ type Container struct { FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` + + HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` + + HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` @@ -77,6 +109,22 @@ type Container struct { InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` + + IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` + + IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` + + Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` + + Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` + + IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` + + Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` + + KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` @@ -87,24 +135,42 @@ type Container struct { Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` + MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` + + MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` + + Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` + NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` + OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` + + OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` + PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` + PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` + Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` @@ -121,8 +187,20 @@ type Container struct { RestartPolicy *RestartPolicy `json:"restartPolicy,omitempty" yaml:"restart_policy,omitempty"` + RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` + + Secrets []SecretReference `json:"secrets,omitempty" yaml:"secrets,omitempty"` + SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + + ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` @@ -131,7 +209,17 @@ type Container struct { StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - SystemContainer string `json:"systemContainer,omitempty" yaml:"system_container,omitempty"` + StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` + + StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` + + StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` + + Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,omitempty"` + + Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` Token string `json:"token,omitempty" yaml:"token,omitempty"` @@ -143,8 +231,16 @@ type Container struct { Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` + Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` + User string `json:"user,omitempty" yaml:"user,omitempty"` + UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` + + UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` + + Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` Version string `json:"version,omitempty" yaml:"version,omitempty"` @@ -195,10 +291,6 @@ type ContainerOperations interface { ActionRestart(*Container) (*Instance, error) - ActionRestore(*Container) (*Instance, error) - - ActionSetlabels(*Container, *SetLabelsInput) (*Container, error) - ActionStart(*Container) (*Instance, error) ActionStop(*Container, *InstanceStop) (*Instance, error) @@ -370,24 +462,6 @@ func (c *ContainerClient) ActionRestart(resource *Container) (*Instance, error) return resp, err } -func (c *ContainerClient) ActionRestore(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionSetlabels(resource *Container, input *SetLabelsInput) (*Container, error) { - - resp := &Container{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "setlabels", &resource.Resource, input, resp) - - return resp, err -} - func (c *ContainerClient) ActionStart(resource *Container) (*Instance, error) { resp := &Instance{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_container_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_container_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_container_event.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_container_exec.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_container_exec.go rename to vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_container_logs.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_container_logs.go rename to vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_container_proxy.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_container_proxy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_credential.go b/vendor/github.com/rancher/go-rancher/v2/generated_credential.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_credential.go rename to vendor/github.com/rancher/go-rancher/v2/generated_credential.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_databasechangelog.go b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_databasechangelog.go rename to vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_databasechangeloglock.go b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_databasechangeloglock.go rename to vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go b/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go new file mode 100644 index 000000000..8cdb206fc --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go @@ -0,0 +1,183 @@ +package client + +const ( + DEFAULT_NETWORK_TYPE = "defaultNetwork" +) + +type DefaultNetwork struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + DefaultPolicyAction string `json:"defaultPolicyAction,omitempty" yaml:"default_policy_action,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` + + HostPorts bool `json:"hostPorts,omitempty" yaml:"host_ports,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Policy []NetworkPolicyRule `json:"policy,omitempty" yaml:"policy,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Subnets []Subnet `json:"subnets,omitempty" yaml:"subnets,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type DefaultNetworkCollection struct { + Collection + Data []DefaultNetwork `json:"data,omitempty"` + client *DefaultNetworkClient +} + +type DefaultNetworkClient struct { + rancherClient *RancherClient +} + +type DefaultNetworkOperations interface { + List(opts *ListOpts) (*DefaultNetworkCollection, error) + Create(opts *DefaultNetwork) (*DefaultNetwork, error) + Update(existing *DefaultNetwork, updates interface{}) (*DefaultNetwork, error) + ById(id string) (*DefaultNetwork, error) + Delete(container *DefaultNetwork) error + + ActionActivate(*DefaultNetwork) (*Network, error) + + ActionCreate(*DefaultNetwork) (*Network, error) + + ActionDeactivate(*DefaultNetwork) (*Network, error) + + ActionPurge(*DefaultNetwork) (*Network, error) + + ActionRemove(*DefaultNetwork) (*Network, error) + + ActionUpdate(*DefaultNetwork) (*Network, error) +} + +func newDefaultNetworkClient(rancherClient *RancherClient) *DefaultNetworkClient { + return &DefaultNetworkClient{ + rancherClient: rancherClient, + } +} + +func (c *DefaultNetworkClient) Create(container *DefaultNetwork) (*DefaultNetwork, error) { + resp := &DefaultNetwork{} + err := c.rancherClient.doCreate(DEFAULT_NETWORK_TYPE, container, resp) + return resp, err +} + +func (c *DefaultNetworkClient) Update(existing *DefaultNetwork, updates interface{}) (*DefaultNetwork, error) { + resp := &DefaultNetwork{} + err := c.rancherClient.doUpdate(DEFAULT_NETWORK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *DefaultNetworkClient) List(opts *ListOpts) (*DefaultNetworkCollection, error) { + resp := &DefaultNetworkCollection{} + err := c.rancherClient.doList(DEFAULT_NETWORK_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *DefaultNetworkCollection) Next() (*DefaultNetworkCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &DefaultNetworkCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *DefaultNetworkClient) ById(id string) (*DefaultNetwork, error) { + resp := &DefaultNetwork{} + err := c.rancherClient.doById(DEFAULT_NETWORK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *DefaultNetworkClient) Delete(container *DefaultNetwork) error { + return c.rancherClient.doResourceDelete(DEFAULT_NETWORK_TYPE, &container.Resource) +} + +func (c *DefaultNetworkClient) ActionActivate(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DefaultNetworkClient) ActionCreate(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DefaultNetworkClient) ActionDeactivate(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DefaultNetworkClient) ActionPurge(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DefaultNetworkClient) ActionRemove(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *DefaultNetworkClient) ActionUpdate(resource *DefaultNetwork) (*Network, error) { + + resp := &Network{} + + err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_digitalocean_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go similarity index 97% rename from vendor/github.com/rancher/go-rancher/client/generated_digitalocean_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go index 64597575e..b03c8a058 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_digitalocean_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go @@ -23,6 +23,8 @@ type DigitaloceanConfig struct { SshKeyFingerprint string `json:"sshKeyFingerprint,omitempty" yaml:"ssh_key_fingerprint,omitempty"` + SshKeyPath string `json:"sshKeyPath,omitempty" yaml:"ssh_key_path,omitempty"` + SshPort string `json:"sshPort,omitempty" yaml:"ssh_port,omitempty"` SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/client/generated_dns_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go similarity index 93% rename from vendor/github.com/rancher/go-rancher/client/generated_dns_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go index a8398b3dd..d554562aa 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_dns_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go @@ -17,18 +17,20 @@ type DnsService struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,omitempty"` - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` @@ -41,10 +43,14 @@ type DnsService struct { SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` State string `json:"state,omitempty" yaml:"state,omitempty"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -77,10 +83,10 @@ type DnsServiceOperations interface { ActionAddservicelink(*DnsService, *AddRemoveServiceLinkInput) (*Service, error) - ActionCancelrollback(*DnsService) (*Service, error) - ActionCancelupgrade(*DnsService) (*Service, error) + ActionContinueupgrade(*DnsService) (*Service, error) + ActionCreate(*DnsService) (*Service, error) ActionDeactivate(*DnsService) (*Service, error) @@ -170,15 +176,6 @@ func (c *DnsServiceClient) ActionAddservicelink(resource *DnsService, input *Add return resp, err } -func (c *DnsServiceClient) ActionCancelrollback(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *DnsServiceClient) ActionCancelupgrade(resource *DnsService) (*Service, error) { resp := &Service{} @@ -188,6 +185,15 @@ func (c *DnsServiceClient) ActionCancelupgrade(resource *DnsService) (*Service, return resp, err } +func (c *DnsServiceClient) ActionContinueupgrade(resource *DnsService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + func (c *DnsServiceClient) ActionCreate(resource *DnsService) (*Service, error) { resp := &Service{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_docker_build.go b/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_docker_build.go rename to vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_extension_implementation.go b/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_extension_implementation.go rename to vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_extension_point.go b/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go similarity index 95% rename from vendor/github.com/rancher/go-rancher/client/generated_extension_point.go rename to vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go index ab0730080..e3c0b87ab 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_extension_point.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go @@ -9,7 +9,7 @@ type ExtensionPoint struct { ExcludeSetting string `json:"excludeSetting,omitempty" yaml:"exclude_setting,omitempty"` - Implementations []interface{} `json:"implementations,omitempty" yaml:"implementations,omitempty"` + Implementations []ExtensionImplementation `json:"implementations,omitempty" yaml:"implementations,omitempty"` IncludeSetting string `json:"includeSetting,omitempty" yaml:"include_setting,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_dns_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_external_dns_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_external_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_event.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_handler.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_external_handler.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go index ae7dcda65..d0162922d 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_handler.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go @@ -19,7 +19,7 @@ type ExternalHandler struct { Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - ProcessConfigs []interface{} `json:"processConfigs,omitempty" yaml:"process_configs,omitempty"` + ProcessConfigs []ExternalHandlerProcessConfig `json:"processConfigs,omitempty" yaml:"process_configs,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -67,8 +67,6 @@ type ExternalHandlerOperations interface { ActionRemove(*ExternalHandler) (*ExternalHandler, error) - ActionRestore(*ExternalHandler) (*ExternalHandler, error) - ActionUpdate(*ExternalHandler) (*ExternalHandler, error) } @@ -167,15 +165,6 @@ func (c *ExternalHandlerClient) ActionRemove(resource *ExternalHandler) (*Extern return resp, err } -func (c *ExternalHandlerClient) ActionRestore(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ExternalHandlerClient) ActionUpdate(resource *ExternalHandler) (*ExternalHandler, error) { resp := &ExternalHandler{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_handler_external_handler_process_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go similarity index 93% rename from vendor/github.com/rancher/go-rancher/client/generated_external_handler_external_handler_process_map.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go index 37f321821..b111264a2 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_handler_external_handler_process_map.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go @@ -13,6 +13,8 @@ type ExternalHandlerExternalHandlerProcessMap struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` + EventName string `json:"eventName,omitempty" yaml:"event_name,omitempty"` + ExternalHandlerId string `json:"externalHandlerId,omitempty" yaml:"external_handler_id,omitempty"` ExternalHandlerProcessId string `json:"externalHandlerProcessId,omitempty" yaml:"external_handler_process_id,omitempty"` @@ -65,8 +67,6 @@ type ExternalHandlerExternalHandlerProcessMapOperations interface { ActionRemove(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - ActionRestore(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - ActionUpdate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) } @@ -165,15 +165,6 @@ func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionRemove(resource * return resp, err } -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionRestore(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionUpdate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { resp := &ExternalHandlerExternalHandlerProcessMap{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_handler_process.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go similarity index 94% rename from vendor/github.com/rancher/go-rancher/client/generated_external_handler_process.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go index 81a1b8a9a..c9aedf82d 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_handler_process.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go @@ -59,8 +59,6 @@ type ExternalHandlerProcessOperations interface { ActionRemove(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - ActionRestore(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - ActionUpdate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) } @@ -159,15 +157,6 @@ func (c *ExternalHandlerProcessClient) ActionRemove(resource *ExternalHandlerPro return resp, err } -func (c *ExternalHandlerProcessClient) ActionRestore(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ExternalHandlerProcessClient) ActionUpdate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { resp := &ExternalHandlerProcess{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_handler_process_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_external_handler_process_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_host_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_external_host_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_external_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_service.go index 44f044797..cc9cf4f31 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_external_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go @@ -15,8 +15,6 @@ type ExternalService struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,omitempty"` - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` ExternalIpAddresses []string `json:"externalIpAddresses,omitempty" yaml:"external_ip_addresses,omitempty"` @@ -29,10 +27,14 @@ type ExternalService struct { Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` @@ -41,10 +43,14 @@ type ExternalService struct { Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` State string `json:"state,omitempty" yaml:"state,omitempty"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -75,10 +81,10 @@ type ExternalServiceOperations interface { ActionActivate(*ExternalService) (*Service, error) - ActionCancelrollback(*ExternalService) (*Service, error) - ActionCancelupgrade(*ExternalService) (*Service, error) + ActionContinueupgrade(*ExternalService) (*Service, error) + ActionCreate(*ExternalService) (*Service, error) ActionDeactivate(*ExternalService) (*Service, error) @@ -155,15 +161,6 @@ func (c *ExternalServiceClient) ActionActivate(resource *ExternalService) (*Serv return resp, err } -func (c *ExternalServiceClient) ActionCancelrollback(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ExternalServiceClient) ActionCancelupgrade(resource *ExternalService) (*Service, error) { resp := &Service{} @@ -173,6 +170,15 @@ func (c *ExternalServiceClient) ActionCancelupgrade(resource *ExternalService) ( return resp, err } +func (c *ExternalServiceClient) ActionContinueupgrade(resource *ExternalService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + func (c *ExternalServiceClient) ActionCreate(resource *ExternalService) (*Service, error) { resp := &Service{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_service_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_external_service_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_storage_pool_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_external_storage_pool_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_external_volume_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_external_volume_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_field_documentation.go b/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_field_documentation.go rename to vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go b/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go new file mode 100644 index 000000000..4cfd367b3 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go @@ -0,0 +1,129 @@ +package client + +const ( + GENERIC_OBJECT_TYPE = "genericObject" +) + +type GenericObject struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Key string `json:"key,omitempty" yaml:"key,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + ResourceData map[string]interface{} `json:"resourceData,omitempty" yaml:"resource_data,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type GenericObjectCollection struct { + Collection + Data []GenericObject `json:"data,omitempty"` + client *GenericObjectClient +} + +type GenericObjectClient struct { + rancherClient *RancherClient +} + +type GenericObjectOperations interface { + List(opts *ListOpts) (*GenericObjectCollection, error) + Create(opts *GenericObject) (*GenericObject, error) + Update(existing *GenericObject, updates interface{}) (*GenericObject, error) + ById(id string) (*GenericObject, error) + Delete(container *GenericObject) error + + ActionCreate(*GenericObject) (*GenericObject, error) + + ActionRemove(*GenericObject) (*GenericObject, error) +} + +func newGenericObjectClient(rancherClient *RancherClient) *GenericObjectClient { + return &GenericObjectClient{ + rancherClient: rancherClient, + } +} + +func (c *GenericObjectClient) Create(container *GenericObject) (*GenericObject, error) { + resp := &GenericObject{} + err := c.rancherClient.doCreate(GENERIC_OBJECT_TYPE, container, resp) + return resp, err +} + +func (c *GenericObjectClient) Update(existing *GenericObject, updates interface{}) (*GenericObject, error) { + resp := &GenericObject{} + err := c.rancherClient.doUpdate(GENERIC_OBJECT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *GenericObjectClient) List(opts *ListOpts) (*GenericObjectCollection, error) { + resp := &GenericObjectCollection{} + err := c.rancherClient.doList(GENERIC_OBJECT_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *GenericObjectCollection) Next() (*GenericObjectCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &GenericObjectCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *GenericObjectClient) ById(id string) (*GenericObject, error) { + resp := &GenericObject{} + err := c.rancherClient.doById(GENERIC_OBJECT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *GenericObjectClient) Delete(container *GenericObject) error { + return c.rancherClient.doResourceDelete(GENERIC_OBJECT_TYPE, &container.Resource) +} + +func (c *GenericObjectClient) ActionCreate(resource *GenericObject) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(GENERIC_OBJECT_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *GenericObjectClient) ActionRemove(resource *GenericObject) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(GENERIC_OBJECT_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_ha_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_ha_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_ha_config_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_ha_config_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_healthcheck_instance_host_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_healthcheck_instance_host_map.go rename to vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_host.go b/vendor/github.com/rancher/go-rancher/v2/generated_host.go similarity index 64% rename from vendor/github.com/rancher/go-rancher/client/generated_host.go rename to vendor/github.com/rancher/go-rancher/v2/generated_host.go index 114c05519..801b330b9 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_host.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_host.go @@ -11,10 +11,20 @@ type Host struct { AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` + AgentIpAddress string `json:"agentIpAddress,omitempty" yaml:"agent_ip_address,omitempty"` + AgentState string `json:"agentState,omitempty" yaml:"agent_state,omitempty"` + Amazonec2Config *Amazonec2Config `json:"amazonec2Config,omitempty" yaml:"amazonec2config,omitempty"` + ApiProxy string `json:"apiProxy,omitempty" yaml:"api_proxy,omitempty"` + AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty" yaml:"auth_certificate_authority,omitempty"` + + AuthKey string `json:"authKey,omitempty" yaml:"auth_key,omitempty"` + + AzureConfig *AzureConfig `json:"azureConfig,omitempty" yaml:"azure_config,omitempty"` + ComputeTotal int64 `json:"computeTotal,omitempty" yaml:"compute_total,omitempty"` Created string `json:"created,omitempty" yaml:"created,omitempty"` @@ -23,24 +33,58 @@ type Host struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` + DigitaloceanConfig *DigitaloceanConfig `json:"digitaloceanConfig,omitempty" yaml:"digitalocean_config,omitempty"` + + DockerVersion string `json:"dockerVersion,omitempty" yaml:"docker_version,omitempty"` + + Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` + + EngineEnv map[string]interface{} `json:"engineEnv,omitempty" yaml:"engine_env,omitempty"` + + EngineInsecureRegistry []string `json:"engineInsecureRegistry,omitempty" yaml:"engine_insecure_registry,omitempty"` + + EngineInstallUrl string `json:"engineInstallUrl,omitempty" yaml:"engine_install_url,omitempty"` + + EngineLabel map[string]interface{} `json:"engineLabel,omitempty" yaml:"engine_label,omitempty"` + + EngineOpt map[string]interface{} `json:"engineOpt,omitempty" yaml:"engine_opt,omitempty"` + + EngineRegistryMirror []string `json:"engineRegistryMirror,omitempty" yaml:"engine_registry_mirror,omitempty"` + + EngineStorageDriver string `json:"engineStorageDriver,omitempty" yaml:"engine_storage_driver,omitempty"` + + HostTemplateId string `json:"hostTemplateId,omitempty" yaml:"host_template_id,omitempty"` + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` Info interface{} `json:"info,omitempty" yaml:"info,omitempty"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + LocalStorageMb int64 `json:"localStorageMb,omitempty" yaml:"local_storage_mb,omitempty"` + + Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` + + MilliCpu int64 `json:"milliCpu,omitempty" yaml:"milli_cpu,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + PacketConfig *PacketConfig `json:"packetConfig,omitempty" yaml:"packet_config,omitempty"` + PhysicalHostId string `json:"physicalHostId,omitempty" yaml:"physical_host_id,omitempty"` - PublicEndpoints []interface{} `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` @@ -77,12 +121,16 @@ type HostOperations interface { ActionDockersocket(*Host) (*HostAccess, error) + ActionError(*Host) (*Host, error) + + ActionEvacuate(*Host) (*Host, error) + + ActionProvision(*Host) (*Host, error) + ActionPurge(*Host) (*Host, error) ActionRemove(*Host) (*Host, error) - ActionRestore(*Host) (*Host, error) - ActionUpdate(*Host) (*Host, error) } @@ -172,6 +220,33 @@ func (c *HostClient) ActionDockersocket(resource *Host) (*HostAccess, error) { return resp, err } +func (c *HostClient) ActionError(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HostClient) ActionEvacuate(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "evacuate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HostClient) ActionProvision(resource *Host) (*Host, error) { + + resp := &Host{} + + err := c.rancherClient.doAction(HOST_TYPE, "provision", &resource.Resource, nil, resp) + + return resp, err +} + func (c *HostClient) ActionPurge(resource *Host) (*Host, error) { resp := &Host{} @@ -190,15 +265,6 @@ func (c *HostClient) ActionRemove(resource *Host) (*Host, error) { return resp, err } -func (c *HostClient) ActionRestore(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *HostClient) ActionUpdate(resource *Host) (*Host, error) { resp := &Host{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_host_access.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_host_access.go rename to vendor/github.com/rancher/go-rancher/v2/generated_host_access.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_host_api_proxy_token.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_host_api_proxy_token.go rename to vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_template.go new file mode 100644 index 000000000..42ec654ee --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_host_template.go @@ -0,0 +1,133 @@ +package client + +const ( + HOST_TEMPLATE_TYPE = "hostTemplate" +) + +type HostTemplate struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` + + FlavorPrefix string `json:"flavorPrefix,omitempty" yaml:"flavor_prefix,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PublicValues map[string]interface{} `json:"publicValues,omitempty" yaml:"public_values,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + SecretValues map[string]interface{} `json:"secretValues,omitempty" yaml:"secret_values,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type HostTemplateCollection struct { + Collection + Data []HostTemplate `json:"data,omitempty"` + client *HostTemplateClient +} + +type HostTemplateClient struct { + rancherClient *RancherClient +} + +type HostTemplateOperations interface { + List(opts *ListOpts) (*HostTemplateCollection, error) + Create(opts *HostTemplate) (*HostTemplate, error) + Update(existing *HostTemplate, updates interface{}) (*HostTemplate, error) + ById(id string) (*HostTemplate, error) + Delete(container *HostTemplate) error + + ActionCreate(*HostTemplate) (*HostTemplate, error) + + ActionRemove(*HostTemplate) (*HostTemplate, error) +} + +func newHostTemplateClient(rancherClient *RancherClient) *HostTemplateClient { + return &HostTemplateClient{ + rancherClient: rancherClient, + } +} + +func (c *HostTemplateClient) Create(container *HostTemplate) (*HostTemplate, error) { + resp := &HostTemplate{} + err := c.rancherClient.doCreate(HOST_TEMPLATE_TYPE, container, resp) + return resp, err +} + +func (c *HostTemplateClient) Update(existing *HostTemplate, updates interface{}) (*HostTemplate, error) { + resp := &HostTemplate{} + err := c.rancherClient.doUpdate(HOST_TEMPLATE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *HostTemplateClient) List(opts *ListOpts) (*HostTemplateCollection, error) { + resp := &HostTemplateCollection{} + err := c.rancherClient.doList(HOST_TEMPLATE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *HostTemplateCollection) Next() (*HostTemplateCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &HostTemplateCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *HostTemplateClient) ById(id string) (*HostTemplate, error) { + resp := &HostTemplate{} + err := c.rancherClient.doById(HOST_TEMPLATE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *HostTemplateClient) Delete(container *HostTemplate) error { + return c.rancherClient.doResourceDelete(HOST_TEMPLATE_TYPE, &container.Resource) +} + +func (c *HostTemplateClient) ActionCreate(resource *HostTemplate) (*HostTemplate, error) { + + resp := &HostTemplate{} + + err := c.rancherClient.doAction(HOST_TEMPLATE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *HostTemplateClient) ActionRemove(resource *HostTemplate) (*HostTemplate, error) { + + resp := &HostTemplate{} + + err := c.rancherClient.doAction(HOST_TEMPLATE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_identity.go b/vendor/github.com/rancher/go-rancher/v2/generated_identity.go similarity index 97% rename from vendor/github.com/rancher/go-rancher/client/generated_identity.go rename to vendor/github.com/rancher/go-rancher/v2/generated_identity.go index 1d92de6a1..1e5d1d302 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_identity.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_identity.go @@ -24,6 +24,8 @@ type Identity struct { ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"` Role string `json:"role,omitempty" yaml:"role,omitempty"` + + User bool `json:"user,omitempty" yaml:"user,omitempty"` } type IdentityCollection struct { diff --git a/vendor/github.com/rancher/go-rancher/client/generated_image.go b/vendor/github.com/rancher/go-rancher/v2/generated_image.go similarity index 94% rename from vendor/github.com/rancher/go-rancher/client/generated_image.go rename to vendor/github.com/rancher/go-rancher/v2/generated_image.go index b14103b33..2e0c02df1 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_image.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_image.go @@ -61,8 +61,6 @@ type ImageOperations interface { ActionRemove(*Image) (*Image, error) - ActionRestore(*Image) (*Image, error) - ActionUpdate(*Image) (*Image, error) } @@ -161,15 +159,6 @@ func (c *ImageClient) ActionRemove(resource *Image) (*Image, error) { return resp, err } -func (c *ImageClient) ActionRestore(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ImageClient) ActionUpdate(resource *Image) (*Image, error) { resp := &Image{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_in_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go similarity index 91% rename from vendor/github.com/rancher/go-rancher/client/generated_in_service_upgrade_strategy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go index 0dc616868..3e93a776b 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_in_service_upgrade_strategy.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go @@ -15,9 +15,9 @@ type InServiceUpgradeStrategy struct { PreviousLaunchConfig *LaunchConfig `json:"previousLaunchConfig,omitempty" yaml:"previous_launch_config,omitempty"` - PreviousSecondaryLaunchConfigs []interface{} `json:"previousSecondaryLaunchConfigs,omitempty" yaml:"previous_secondary_launch_configs,omitempty"` + PreviousSecondaryLaunchConfigs []SecondaryLaunchConfig `json:"previousSecondaryLaunchConfigs,omitempty" yaml:"previous_secondary_launch_configs,omitempty"` - SecondaryLaunchConfigs []interface{} `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` + SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` StartFirst bool `json:"startFirst,omitempty" yaml:"start_first,omitempty"` } diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance.go similarity index 96% rename from vendor/github.com/rancher/go-rancher/client/generated_instance.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance.go index c552f3def..cee9a2ea4 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_instance.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance.go @@ -73,8 +73,6 @@ type InstanceOperations interface { ActionRestart(*Instance) (*Instance, error) - ActionRestore(*Instance) (*Instance, error) - ActionStart(*Instance) (*Instance, error) ActionStop(*Instance, *InstanceStop) (*Instance, error) @@ -219,15 +217,6 @@ func (c *InstanceClient) ActionRestart(resource *Instance) (*Instance, error) { return resp, err } -func (c *InstanceClient) ActionRestore(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *InstanceClient) ActionStart(resource *Instance) (*Instance, error) { resp := &Instance{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance_console.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_instance_console.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance_console_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_instance_console_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance_health_check.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_instance_health_check.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance_link.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go similarity index 94% rename from vendor/github.com/rancher/go-rancher/client/generated_instance_link.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go index 598d5e52f..4aa86e3b3 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_instance_link.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go @@ -69,8 +69,6 @@ type InstanceLinkOperations interface { ActionRemove(*InstanceLink) (*InstanceLink, error) - ActionRestore(*InstanceLink) (*InstanceLink, error) - ActionUpdate(*InstanceLink) (*InstanceLink, error) } @@ -169,15 +167,6 @@ func (c *InstanceLinkClient) ActionRemove(resource *InstanceLink) (*InstanceLink return resp, err } -func (c *InstanceLinkClient) ActionRestore(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *InstanceLinkClient) ActionUpdate(resource *InstanceLink) (*InstanceLink, error) { resp := &InstanceLink{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_instance_stop.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_instance_stop.go rename to vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_ip_address.go b/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go similarity index 95% rename from vendor/github.com/rancher/go-rancher/client/generated_ip_address.go rename to vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go index 60932494e..a41d2c757 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_ip_address.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go @@ -57,6 +57,8 @@ type IpAddressOperations interface { ActionActivate(*IpAddress) (*IpAddress, error) + ActionAssociate(*IpAddress) (*IpAddress, error) + ActionCreate(*IpAddress) (*IpAddress, error) ActionDeactivate(*IpAddress) (*IpAddress, error) @@ -67,8 +69,6 @@ type IpAddressOperations interface { ActionRemove(*IpAddress) (*IpAddress, error) - ActionRestore(*IpAddress) (*IpAddress, error) - ActionUpdate(*IpAddress) (*IpAddress, error) } @@ -131,6 +131,15 @@ func (c *IpAddressClient) ActionActivate(resource *IpAddress) (*IpAddress, error return resp, err } +func (c *IpAddressClient) ActionAssociate(resource *IpAddress) (*IpAddress, error) { + + resp := &IpAddress{} + + err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "associate", &resource.Resource, nil, resp) + + return resp, err +} + func (c *IpAddressClient) ActionCreate(resource *IpAddress) (*IpAddress, error) { resp := &IpAddress{} @@ -176,15 +185,6 @@ func (c *IpAddressClient) ActionRemove(resource *IpAddress) (*IpAddress, error) return resp, err } -func (c *IpAddressClient) ActionRestore(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *IpAddressClient) ActionUpdate(resource *IpAddress) (*IpAddress, error) { resp := &IpAddress{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_kubernetes_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go similarity index 93% rename from vendor/github.com/rancher/go-rancher/client/generated_kubernetes_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go index 34ac4360a..15fa37804 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_kubernetes_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go @@ -15,14 +15,16 @@ type KubernetesService struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,omitempty"` - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -31,8 +33,12 @@ type KubernetesService struct { SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Template interface{} `json:"template,omitempty" yaml:"template,omitempty"` Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` @@ -67,10 +73,10 @@ type KubernetesServiceOperations interface { ActionAddservicelink(*KubernetesService, *AddRemoveServiceLinkInput) (*Service, error) - ActionCancelrollback(*KubernetesService) (*Service, error) - ActionCancelupgrade(*KubernetesService) (*Service, error) + ActionContinueupgrade(*KubernetesService) (*Service, error) + ActionCreate(*KubernetesService) (*Service, error) ActionDeactivate(*KubernetesService) (*Service, error) @@ -160,15 +166,6 @@ func (c *KubernetesServiceClient) ActionAddservicelink(resource *KubernetesServi return resp, err } -func (c *KubernetesServiceClient) ActionCancelrollback(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *KubernetesServiceClient) ActionCancelupgrade(resource *KubernetesService) (*Service, error) { resp := &Service{} @@ -178,6 +175,15 @@ func (c *KubernetesServiceClient) ActionCancelupgrade(resource *KubernetesServic return resp, err } +func (c *KubernetesServiceClient) ActionContinueupgrade(resource *KubernetesService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + func (c *KubernetesServiceClient) ActionCreate(resource *KubernetesService) (*Service, error) { resp := &Service{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_kubernetes_stack.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go similarity index 84% rename from vendor/github.com/rancher/go-rancher/client/generated_kubernetes_stack.go rename to vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go index 136466faa..ef8eaa3bb 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_kubernetes_stack.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go @@ -9,6 +9,10 @@ type KubernetesStack struct { AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` + + Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` + Created string `json:"created,omitempty" yaml:"created,omitempty"` Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` @@ -19,6 +23,8 @@ type KubernetesStack struct { ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + Group string `json:"group,omitempty" yaml:"group,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` @@ -35,8 +41,12 @@ type KubernetesStack struct { Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` @@ -65,19 +75,17 @@ type KubernetesStackOperations interface { ById(id string) (*KubernetesStack, error) Delete(container *KubernetesStack) error - ActionCancelrollback(*KubernetesStack) (*Environment, error) + ActionCancelupgrade(*KubernetesStack) (*Stack, error) - ActionCancelupgrade(*KubernetesStack) (*Environment, error) + ActionCreate(*KubernetesStack) (*Stack, error) - ActionCreate(*KubernetesStack) (*Environment, error) + ActionError(*KubernetesStack) (*Stack, error) - ActionError(*KubernetesStack) (*Environment, error) + ActionFinishupgrade(*KubernetesStack) (*Stack, error) - ActionFinishupgrade(*KubernetesStack) (*Environment, error) + ActionRemove(*KubernetesStack) (*Stack, error) - ActionRemove(*KubernetesStack) (*Environment, error) - - ActionRollback(*KubernetesStack) (*Environment, error) + ActionRollback(*KubernetesStack) (*Stack, error) ActionUpgrade(*KubernetesStack, *KubernetesStackUpgrade) (*KubernetesStack, error) } @@ -132,63 +140,54 @@ func (c *KubernetesStackClient) Delete(container *KubernetesStack) error { return c.rancherClient.doResourceDelete(KUBERNETES_STACK_TYPE, &container.Resource) } -func (c *KubernetesStackClient) ActionCancelrollback(resource *KubernetesStack) (*Environment, error) { +func (c *KubernetesStackClient) ActionCancelupgrade(resource *KubernetesStack) (*Stack, error) { - resp := &Environment{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionCancelupgrade(resource *KubernetesStack) (*Environment, error) { - - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "cancelupgrade", &resource.Resource, nil, resp) return resp, err } -func (c *KubernetesStackClient) ActionCreate(resource *KubernetesStack) (*Environment, error) { +func (c *KubernetesStackClient) ActionCreate(resource *KubernetesStack) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "create", &resource.Resource, nil, resp) return resp, err } -func (c *KubernetesStackClient) ActionError(resource *KubernetesStack) (*Environment, error) { +func (c *KubernetesStackClient) ActionError(resource *KubernetesStack) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "error", &resource.Resource, nil, resp) return resp, err } -func (c *KubernetesStackClient) ActionFinishupgrade(resource *KubernetesStack) (*Environment, error) { +func (c *KubernetesStackClient) ActionFinishupgrade(resource *KubernetesStack) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "finishupgrade", &resource.Resource, nil, resp) return resp, err } -func (c *KubernetesStackClient) ActionRemove(resource *KubernetesStack) (*Environment, error) { +func (c *KubernetesStackClient) ActionRemove(resource *KubernetesStack) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "remove", &resource.Resource, nil, resp) return resp, err } -func (c *KubernetesStackClient) ActionRollback(resource *KubernetesStack) (*Environment, error) { +func (c *KubernetesStackClient) ActionRollback(resource *KubernetesStack) (*Stack, error) { - resp := &Environment{} + resp := &Stack{} err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "rollback", &resource.Resource, nil, resp) diff --git a/vendor/github.com/rancher/go-rancher/client/generated_kubernetes_stack_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go similarity index 97% rename from vendor/github.com/rancher/go-rancher/client/generated_kubernetes_stack_upgrade.go rename to vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go index 58c6c5ca8..793b10ede 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_kubernetes_stack_upgrade.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go @@ -7,6 +7,8 @@ const ( type KubernetesStackUpgrade struct { Resource + Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` + Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/client/generated_label.go b/vendor/github.com/rancher/go-rancher/v2/generated_label.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_label.go rename to vendor/github.com/rancher/go-rancher/v2/generated_label.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_launch_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go similarity index 76% rename from vendor/github.com/rancher/go-rancher/client/generated_launch_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go index 11b43558a..adbb6b1b5 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_launch_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go @@ -15,18 +15,36 @@ type LaunchConfig struct { BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` + Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` + CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` + Command []string `json:"command,omitempty" yaml:"command,omitempty"` Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` + + CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` + + CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` + + CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` + + CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` + + CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` @@ -49,14 +67,20 @@ type LaunchConfig struct { Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` - Disks []interface{} `json:"disks,omitempty" yaml:"disks,omitempty"` + DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` + + Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` + DrainTimeoutMs int64 `json:"drainTimeoutMs,omitempty" yaml:"drain_timeout_ms,omitempty"` + EntryPoint []string `json:"entryPoint,omitempty" yaml:"entry_point,omitempty"` Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` @@ -69,10 +93,20 @@ type LaunchConfig struct { FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` + + HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` + + HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` @@ -81,6 +115,22 @@ type LaunchConfig struct { InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` + + IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` + + IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` + + Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` + + Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` + + IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` + + Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` + + KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` @@ -93,10 +143,20 @@ type LaunchConfig struct { MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` + MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` + + MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` + + Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` + NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` + NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` @@ -105,12 +165,20 @@ type LaunchConfig struct { NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` + OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` + + OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` + PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` + PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` + Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` @@ -127,8 +195,20 @@ type LaunchConfig struct { RequestedIpAddress string `json:"requestedIpAddress,omitempty" yaml:"requested_ip_address,omitempty"` + RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` + + Secrets []SecretReference `json:"secrets,omitempty" yaml:"secrets,omitempty"` + SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + + ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` @@ -137,7 +217,17 @@ type LaunchConfig struct { StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - SystemContainer string `json:"systemContainer,omitempty" yaml:"system_container,omitempty"` + StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` + + StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` + + StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` + + Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,omitempty"` + + Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` Token string `json:"token,omitempty" yaml:"token,omitempty"` @@ -149,10 +239,18 @@ type LaunchConfig struct { Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` + Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` + User string `json:"user,omitempty" yaml:"user,omitempty"` + UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` + Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` + UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` + + Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` @@ -203,10 +301,6 @@ type LaunchConfigOperations interface { ActionRestart(*LaunchConfig) (*Instance, error) - ActionRestore(*LaunchConfig) (*Instance, error) - - ActionSetlabels(*LaunchConfig, *SetLabelsInput) (*Container, error) - ActionStart(*LaunchConfig) (*Instance, error) ActionStop(*LaunchConfig, *InstanceStop) (*Instance, error) @@ -369,24 +463,6 @@ func (c *LaunchConfigClient) ActionRestart(resource *LaunchConfig) (*Instance, e return resp, err } -func (c *LaunchConfigClient) ActionRestore(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionSetlabels(resource *LaunchConfig, input *SetLabelsInput) (*Container, error) { - - resp := &Container{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "setlabels", &resource.Resource, input, resp) - - return resp, err -} - func (c *LaunchConfigClient) ActionStart(resource *LaunchConfig) (*Instance, error) { resp := &Instance{} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go new file mode 100644 index 000000000..80edbdf78 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go @@ -0,0 +1,87 @@ +package client + +const ( + LB_CONFIG_TYPE = "lbConfig" +) + +type LbConfig struct { + Resource + + CertificateIds []string `json:"certificateIds,omitempty" yaml:"certificate_ids,omitempty"` + + Config string `json:"config,omitempty" yaml:"config,omitempty"` + + DefaultCertificateId string `json:"defaultCertificateId,omitempty" yaml:"default_certificate_id,omitempty"` + + PortRules []PortRule `json:"portRules,omitempty" yaml:"port_rules,omitempty"` + + StickinessPolicy *LoadBalancerCookieStickinessPolicy `json:"stickinessPolicy,omitempty" yaml:"stickiness_policy,omitempty"` +} + +type LbConfigCollection struct { + Collection + Data []LbConfig `json:"data,omitempty"` + client *LbConfigClient +} + +type LbConfigClient struct { + rancherClient *RancherClient +} + +type LbConfigOperations interface { + List(opts *ListOpts) (*LbConfigCollection, error) + Create(opts *LbConfig) (*LbConfig, error) + Update(existing *LbConfig, updates interface{}) (*LbConfig, error) + ById(id string) (*LbConfig, error) + Delete(container *LbConfig) error +} + +func newLbConfigClient(rancherClient *RancherClient) *LbConfigClient { + return &LbConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *LbConfigClient) Create(container *LbConfig) (*LbConfig, error) { + resp := &LbConfig{} + err := c.rancherClient.doCreate(LB_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *LbConfigClient) Update(existing *LbConfig, updates interface{}) (*LbConfig, error) { + resp := &LbConfig{} + err := c.rancherClient.doUpdate(LB_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LbConfigClient) List(opts *ListOpts) (*LbConfigCollection, error) { + resp := &LbConfigCollection{} + err := c.rancherClient.doList(LB_CONFIG_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *LbConfigCollection) Next() (*LbConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &LbConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *LbConfigClient) ById(id string) (*LbConfig, error) { + resp := &LbConfig{} + err := c.rancherClient.doById(LB_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LbConfigClient) Delete(container *LbConfig) error { + return c.rancherClient.doResourceDelete(LB_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go new file mode 100644 index 000000000..93088a6f4 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go @@ -0,0 +1,79 @@ +package client + +const ( + LB_TARGET_CONFIG_TYPE = "lbTargetConfig" +) + +type LbTargetConfig struct { + Resource + + PortRules []TargetPortRule `json:"portRules,omitempty" yaml:"port_rules,omitempty"` +} + +type LbTargetConfigCollection struct { + Collection + Data []LbTargetConfig `json:"data,omitempty"` + client *LbTargetConfigClient +} + +type LbTargetConfigClient struct { + rancherClient *RancherClient +} + +type LbTargetConfigOperations interface { + List(opts *ListOpts) (*LbTargetConfigCollection, error) + Create(opts *LbTargetConfig) (*LbTargetConfig, error) + Update(existing *LbTargetConfig, updates interface{}) (*LbTargetConfig, error) + ById(id string) (*LbTargetConfig, error) + Delete(container *LbTargetConfig) error +} + +func newLbTargetConfigClient(rancherClient *RancherClient) *LbTargetConfigClient { + return &LbTargetConfigClient{ + rancherClient: rancherClient, + } +} + +func (c *LbTargetConfigClient) Create(container *LbTargetConfig) (*LbTargetConfig, error) { + resp := &LbTargetConfig{} + err := c.rancherClient.doCreate(LB_TARGET_CONFIG_TYPE, container, resp) + return resp, err +} + +func (c *LbTargetConfigClient) Update(existing *LbTargetConfig, updates interface{}) (*LbTargetConfig, error) { + resp := &LbTargetConfig{} + err := c.rancherClient.doUpdate(LB_TARGET_CONFIG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *LbTargetConfigClient) List(opts *ListOpts) (*LbTargetConfigCollection, error) { + resp := &LbTargetConfigCollection{} + err := c.rancherClient.doList(LB_TARGET_CONFIG_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *LbTargetConfigCollection) Next() (*LbTargetConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &LbTargetConfigCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *LbTargetConfigClient) ById(id string) (*LbTargetConfig, error) { + resp := &LbTargetConfig{} + err := c.rancherClient.doById(LB_TARGET_CONFIG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *LbTargetConfigClient) Delete(container *LbTargetConfig) error { + return c.rancherClient.doResourceDelete(LB_TARGET_CONFIG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_cookie_stickiness_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_load_balancer_cookie_stickiness_policy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go similarity index 86% rename from vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go index 5aec49576..941ccb087 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_load_balancer_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go @@ -11,37 +11,35 @@ type LoadBalancerService struct { AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` - CertificateIds []string `json:"certificateIds,omitempty" yaml:"certificate_ids,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - DefaultCertificateId string `json:"defaultCertificateId,omitempty" yaml:"default_certificate_id,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,omitempty"` - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - LoadBalancerConfig *LoadBalancerConfig `json:"loadBalancerConfig,omitempty" yaml:"load_balancer_config,omitempty"` + LbConfig *LbConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` + + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` - PublicEndpoints []interface{} `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -55,10 +53,14 @@ type LoadBalancerService struct { SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` State string `json:"state,omitempty" yaml:"state,omitempty"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -91,12 +93,12 @@ type LoadBalancerServiceOperations interface { ActionActivate(*LoadBalancerService) (*Service, error) - ActionAddservicelink(*LoadBalancerService, *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) - - ActionCancelrollback(*LoadBalancerService) (*Service, error) + ActionAddservicelink(*LoadBalancerService, *AddRemoveServiceLinkInput) (*Service, error) ActionCancelupgrade(*LoadBalancerService) (*Service, error) + ActionContinueupgrade(*LoadBalancerService) (*Service, error) + ActionCreate(*LoadBalancerService) (*Service, error) ActionDeactivate(*LoadBalancerService) (*Service, error) @@ -105,13 +107,13 @@ type LoadBalancerServiceOperations interface { ActionRemove(*LoadBalancerService) (*Service, error) - ActionRemoveservicelink(*LoadBalancerService, *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) + ActionRemoveservicelink(*LoadBalancerService, *AddRemoveServiceLinkInput) (*Service, error) ActionRestart(*LoadBalancerService, *ServiceRestart) (*Service, error) ActionRollback(*LoadBalancerService) (*Service, error) - ActionSetservicelinks(*LoadBalancerService, *SetLoadBalancerServiceLinksInput) (*Service, error) + ActionSetservicelinks(*LoadBalancerService, *SetServiceLinksInput) (*Service, error) ActionUpdate(*LoadBalancerService) (*Service, error) @@ -177,7 +179,7 @@ func (c *LoadBalancerServiceClient) ActionActivate(resource *LoadBalancerService return resp, err } -func (c *LoadBalancerServiceClient) ActionAddservicelink(resource *LoadBalancerService, input *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) { +func (c *LoadBalancerServiceClient) ActionAddservicelink(resource *LoadBalancerService, input *AddRemoveServiceLinkInput) (*Service, error) { resp := &Service{} @@ -186,15 +188,6 @@ func (c *LoadBalancerServiceClient) ActionAddservicelink(resource *LoadBalancerS return resp, err } -func (c *LoadBalancerServiceClient) ActionCancelrollback(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *LoadBalancerServiceClient) ActionCancelupgrade(resource *LoadBalancerService) (*Service, error) { resp := &Service{} @@ -204,6 +197,15 @@ func (c *LoadBalancerServiceClient) ActionCancelupgrade(resource *LoadBalancerSe return resp, err } +func (c *LoadBalancerServiceClient) ActionContinueupgrade(resource *LoadBalancerService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + func (c *LoadBalancerServiceClient) ActionCreate(resource *LoadBalancerService) (*Service, error) { resp := &Service{} @@ -240,7 +242,7 @@ func (c *LoadBalancerServiceClient) ActionRemove(resource *LoadBalancerService) return resp, err } -func (c *LoadBalancerServiceClient) ActionRemoveservicelink(resource *LoadBalancerService, input *AddRemoveLoadBalancerServiceLinkInput) (*Service, error) { +func (c *LoadBalancerServiceClient) ActionRemoveservicelink(resource *LoadBalancerService, input *AddRemoveServiceLinkInput) (*Service, error) { resp := &Service{} @@ -267,7 +269,7 @@ func (c *LoadBalancerServiceClient) ActionRollback(resource *LoadBalancerService return resp, err } -func (c *LoadBalancerServiceClient) ActionSetservicelinks(resource *LoadBalancerService, input *SetLoadBalancerServiceLinksInput) (*Service, error) { +func (c *LoadBalancerServiceClient) ActionSetservicelinks(resource *LoadBalancerService, input *SetServiceLinksInput) (*Service, error) { resp := &Service{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_local_auth_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_local_auth_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_log_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_log_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_log_config.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_machine.go b/vendor/github.com/rancher/go-rancher/v2/generated_machine.go similarity index 98% rename from vendor/github.com/rancher/go-rancher/client/generated_machine.go rename to vendor/github.com/rancher/go-rancher/v2/generated_machine.go index be7be96b0..5931b982e 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_machine.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_machine.go @@ -45,7 +45,7 @@ type Machine struct { ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - ExtractedConfig string `json:"extractedConfig,omitempty" yaml:"extracted_config,omitempty"` + HostTemplateId string `json:"hostTemplateId,omitempty" yaml:"host_template_id,omitempty"` Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/client/generated_machine_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go similarity index 94% rename from vendor/github.com/rancher/go-rancher/client/generated_machine_driver.go rename to vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go index d7bb94b20..a0b70653c 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_machine_driver.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go @@ -65,6 +65,8 @@ type MachineDriverOperations interface { ActionActivate(*MachineDriver) (*MachineDriver, error) + ActionCreate(*MachineDriver) (*MachineDriver, error) + ActionDeactivate(*MachineDriver) (*MachineDriver, error) ActionError(*MachineDriver) (*MachineDriver, error) @@ -135,6 +137,15 @@ func (c *MachineDriverClient) ActionActivate(resource *MachineDriver) (*MachineD return resp, err } +func (c *MachineDriverClient) ActionCreate(resource *MachineDriver) (*MachineDriver, error) { + + resp := &MachineDriver{} + + err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + func (c *MachineDriverClient) ActionDeactivate(resource *MachineDriver) (*MachineDriver, error) { resp := &MachineDriver{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_mount.go b/vendor/github.com/rancher/go-rancher/v2/generated_mount.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_mount.go rename to vendor/github.com/rancher/go-rancher/v2/generated_mount.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go b/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go new file mode 100644 index 000000000..62d4f4fa1 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go @@ -0,0 +1,87 @@ +package client + +const ( + MOUNT_ENTRY_TYPE = "mountEntry" +) + +type MountEntry struct { + Resource + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + InstanceName string `json:"instanceName,omitempty" yaml:"instance_name,omitempty"` + + Path string `json:"path,omitempty" yaml:"path,omitempty"` + + VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` + + VolumeName string `json:"volumeName,omitempty" yaml:"volume_name,omitempty"` +} + +type MountEntryCollection struct { + Collection + Data []MountEntry `json:"data,omitempty"` + client *MountEntryClient +} + +type MountEntryClient struct { + rancherClient *RancherClient +} + +type MountEntryOperations interface { + List(opts *ListOpts) (*MountEntryCollection, error) + Create(opts *MountEntry) (*MountEntry, error) + Update(existing *MountEntry, updates interface{}) (*MountEntry, error) + ById(id string) (*MountEntry, error) + Delete(container *MountEntry) error +} + +func newMountEntryClient(rancherClient *RancherClient) *MountEntryClient { + return &MountEntryClient{ + rancherClient: rancherClient, + } +} + +func (c *MountEntryClient) Create(container *MountEntry) (*MountEntry, error) { + resp := &MountEntry{} + err := c.rancherClient.doCreate(MOUNT_ENTRY_TYPE, container, resp) + return resp, err +} + +func (c *MountEntryClient) Update(existing *MountEntry, updates interface{}) (*MountEntry, error) { + resp := &MountEntry{} + err := c.rancherClient.doUpdate(MOUNT_ENTRY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *MountEntryClient) List(opts *ListOpts) (*MountEntryCollection, error) { + resp := &MountEntryCollection{} + err := c.rancherClient.doList(MOUNT_ENTRY_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *MountEntryCollection) Next() (*MountEntryCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &MountEntryCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *MountEntryClient) ById(id string) (*MountEntry, error) { + resp := &MountEntry{} + err := c.rancherClient.doById(MOUNT_ENTRY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *MountEntryClient) Delete(container *MountEntry) error { + return c.rancherClient.doResourceDelete(MOUNT_ENTRY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_network.go b/vendor/github.com/rancher/go-rancher/v2/generated_network.go similarity index 87% rename from vendor/github.com/rancher/go-rancher/client/generated_network.go rename to vendor/github.com/rancher/go-rancher/v2/generated_network.go index 3147d9f43..ce77246dc 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_network.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_network.go @@ -13,18 +13,34 @@ type Network struct { Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + DefaultPolicyAction string `json:"defaultPolicyAction,omitempty" yaml:"default_policy_action,omitempty"` + Description string `json:"description,omitempty" yaml:"description,omitempty"` + Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` + + HostPorts bool `json:"hostPorts,omitempty" yaml:"host_ports,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + NetworkDriverId string `json:"networkDriverId,omitempty" yaml:"network_driver_id,omitempty"` + + Policy []NetworkPolicyRule `json:"policy,omitempty" yaml:"policy,omitempty"` + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` State string `json:"state,omitempty" yaml:"state,omitempty"` + Subnets []Subnet `json:"subnets,omitempty" yaml:"subnets,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -61,8 +77,6 @@ type NetworkOperations interface { ActionRemove(*Network) (*Network, error) - ActionRestore(*Network) (*Network, error) - ActionUpdate(*Network) (*Network, error) } @@ -161,15 +175,6 @@ func (c *NetworkClient) ActionRemove(resource *Network) (*Network, error) { return resp, err } -func (c *NetworkClient) ActionRestore(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *NetworkClient) ActionUpdate(resource *Network) (*Network, error) { resp := &Network{} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go new file mode 100644 index 000000000..ea35cfebb --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go @@ -0,0 +1,166 @@ +package client + +const ( + NETWORK_DRIVER_TYPE = "networkDriver" +) + +type NetworkDriver struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + CniConfig map[string]interface{} `json:"cniConfig,omitempty" yaml:"cni_config,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + DefaultNetwork DefaultNetwork `json:"defaultNetwork,omitempty" yaml:"default_network,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + NetworkMetadata map[string]interface{} `json:"networkMetadata,omitempty" yaml:"network_metadata,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type NetworkDriverCollection struct { + Collection + Data []NetworkDriver `json:"data,omitempty"` + client *NetworkDriverClient +} + +type NetworkDriverClient struct { + rancherClient *RancherClient +} + +type NetworkDriverOperations interface { + List(opts *ListOpts) (*NetworkDriverCollection, error) + Create(opts *NetworkDriver) (*NetworkDriver, error) + Update(existing *NetworkDriver, updates interface{}) (*NetworkDriver, error) + ById(id string) (*NetworkDriver, error) + Delete(container *NetworkDriver) error + + ActionActivate(*NetworkDriver) (*NetworkDriver, error) + + ActionCreate(*NetworkDriver) (*NetworkDriver, error) + + ActionDeactivate(*NetworkDriver) (*NetworkDriver, error) + + ActionRemove(*NetworkDriver) (*NetworkDriver, error) + + ActionUpdate(*NetworkDriver) (*NetworkDriver, error) +} + +func newNetworkDriverClient(rancherClient *RancherClient) *NetworkDriverClient { + return &NetworkDriverClient{ + rancherClient: rancherClient, + } +} + +func (c *NetworkDriverClient) Create(container *NetworkDriver) (*NetworkDriver, error) { + resp := &NetworkDriver{} + err := c.rancherClient.doCreate(NETWORK_DRIVER_TYPE, container, resp) + return resp, err +} + +func (c *NetworkDriverClient) Update(existing *NetworkDriver, updates interface{}) (*NetworkDriver, error) { + resp := &NetworkDriver{} + err := c.rancherClient.doUpdate(NETWORK_DRIVER_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *NetworkDriverClient) List(opts *ListOpts) (*NetworkDriverCollection, error) { + resp := &NetworkDriverCollection{} + err := c.rancherClient.doList(NETWORK_DRIVER_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *NetworkDriverCollection) Next() (*NetworkDriverCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &NetworkDriverCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *NetworkDriverClient) ById(id string) (*NetworkDriver, error) { + resp := &NetworkDriver{} + err := c.rancherClient.doById(NETWORK_DRIVER_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *NetworkDriverClient) Delete(container *NetworkDriver) error { + return c.rancherClient.doResourceDelete(NETWORK_DRIVER_TYPE, &container.Resource) +} + +func (c *NetworkDriverClient) ActionActivate(resource *NetworkDriver) (*NetworkDriver, error) { + + resp := &NetworkDriver{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverClient) ActionCreate(resource *NetworkDriver) (*NetworkDriver, error) { + + resp := &NetworkDriver{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverClient) ActionDeactivate(resource *NetworkDriver) (*NetworkDriver, error) { + + resp := &NetworkDriver{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverClient) ActionRemove(resource *NetworkDriver) (*NetworkDriver, error) { + + resp := &NetworkDriver{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverClient) ActionUpdate(resource *NetworkDriver) (*NetworkDriver, error) { + + resp := &NetworkDriver{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go new file mode 100644 index 000000000..9317af3f4 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go @@ -0,0 +1,305 @@ +package client + +const ( + NETWORK_DRIVER_SERVICE_TYPE = "networkDriverService" +) + +type NetworkDriverService struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` + + CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + + LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` + + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + NetworkDriver NetworkDriver `json:"networkDriver,omitempty" yaml:"network_driver,omitempty"` + + PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` + + Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` + + ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` + + SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` + + SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` + + SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` +} + +type NetworkDriverServiceCollection struct { + Collection + Data []NetworkDriverService `json:"data,omitempty"` + client *NetworkDriverServiceClient +} + +type NetworkDriverServiceClient struct { + rancherClient *RancherClient +} + +type NetworkDriverServiceOperations interface { + List(opts *ListOpts) (*NetworkDriverServiceCollection, error) + Create(opts *NetworkDriverService) (*NetworkDriverService, error) + Update(existing *NetworkDriverService, updates interface{}) (*NetworkDriverService, error) + ById(id string) (*NetworkDriverService, error) + Delete(container *NetworkDriverService) error + + ActionActivate(*NetworkDriverService) (*Service, error) + + ActionAddservicelink(*NetworkDriverService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionCancelupgrade(*NetworkDriverService) (*Service, error) + + ActionContinueupgrade(*NetworkDriverService) (*Service, error) + + ActionCreate(*NetworkDriverService) (*Service, error) + + ActionDeactivate(*NetworkDriverService) (*Service, error) + + ActionFinishupgrade(*NetworkDriverService) (*Service, error) + + ActionRemove(*NetworkDriverService) (*Service, error) + + ActionRemoveservicelink(*NetworkDriverService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionRestart(*NetworkDriverService, *ServiceRestart) (*Service, error) + + ActionRollback(*NetworkDriverService) (*Service, error) + + ActionSetservicelinks(*NetworkDriverService, *SetServiceLinksInput) (*Service, error) + + ActionUpdate(*NetworkDriverService) (*Service, error) + + ActionUpgrade(*NetworkDriverService, *ServiceUpgrade) (*Service, error) +} + +func newNetworkDriverServiceClient(rancherClient *RancherClient) *NetworkDriverServiceClient { + return &NetworkDriverServiceClient{ + rancherClient: rancherClient, + } +} + +func (c *NetworkDriverServiceClient) Create(container *NetworkDriverService) (*NetworkDriverService, error) { + resp := &NetworkDriverService{} + err := c.rancherClient.doCreate(NETWORK_DRIVER_SERVICE_TYPE, container, resp) + return resp, err +} + +func (c *NetworkDriverServiceClient) Update(existing *NetworkDriverService, updates interface{}) (*NetworkDriverService, error) { + resp := &NetworkDriverService{} + err := c.rancherClient.doUpdate(NETWORK_DRIVER_SERVICE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *NetworkDriverServiceClient) List(opts *ListOpts) (*NetworkDriverServiceCollection, error) { + resp := &NetworkDriverServiceCollection{} + err := c.rancherClient.doList(NETWORK_DRIVER_SERVICE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *NetworkDriverServiceCollection) Next() (*NetworkDriverServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &NetworkDriverServiceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *NetworkDriverServiceClient) ById(id string) (*NetworkDriverService, error) { + resp := &NetworkDriverService{} + err := c.rancherClient.doById(NETWORK_DRIVER_SERVICE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *NetworkDriverServiceClient) Delete(container *NetworkDriverService) error { + return c.rancherClient.doResourceDelete(NETWORK_DRIVER_SERVICE_TYPE, &container.Resource) +} + +func (c *NetworkDriverServiceClient) ActionActivate(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionAddservicelink(resource *NetworkDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionCancelupgrade(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionContinueupgrade(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionCreate(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionDeactivate(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionFinishupgrade(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionRemove(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionRemoveservicelink(resource *NetworkDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionRestart(resource *NetworkDriverService, input *ServiceRestart) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "restart", &resource.Resource, input, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionRollback(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionSetservicelinks(resource *NetworkDriverService, input *SetServiceLinksInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionUpdate(resource *NetworkDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *NetworkDriverServiceClient) ActionUpgrade(resource *NetworkDriverService, input *ServiceUpgrade) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule.go new file mode 100644 index 000000000..6f62f2815 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule.go @@ -0,0 +1,89 @@ +package client + +const ( + NETWORK_POLICY_RULE_TYPE = "networkPolicyRule" +) + +type NetworkPolicyRule struct { + Resource + + Action string `json:"action,omitempty" yaml:"action,omitempty"` + + Between NetworkPolicyRuleBetween `json:"between,omitempty" yaml:"between,omitempty"` + + From NetworkPolicyRuleMember `json:"from,omitempty" yaml:"from,omitempty"` + + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` + + To NetworkPolicyRuleMember `json:"to,omitempty" yaml:"to,omitempty"` + + Within string `json:"within,omitempty" yaml:"within,omitempty"` +} + +type NetworkPolicyRuleCollection struct { + Collection + Data []NetworkPolicyRule `json:"data,omitempty"` + client *NetworkPolicyRuleClient +} + +type NetworkPolicyRuleClient struct { + rancherClient *RancherClient +} + +type NetworkPolicyRuleOperations interface { + List(opts *ListOpts) (*NetworkPolicyRuleCollection, error) + Create(opts *NetworkPolicyRule) (*NetworkPolicyRule, error) + Update(existing *NetworkPolicyRule, updates interface{}) (*NetworkPolicyRule, error) + ById(id string) (*NetworkPolicyRule, error) + Delete(container *NetworkPolicyRule) error +} + +func newNetworkPolicyRuleClient(rancherClient *RancherClient) *NetworkPolicyRuleClient { + return &NetworkPolicyRuleClient{ + rancherClient: rancherClient, + } +} + +func (c *NetworkPolicyRuleClient) Create(container *NetworkPolicyRule) (*NetworkPolicyRule, error) { + resp := &NetworkPolicyRule{} + err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_TYPE, container, resp) + return resp, err +} + +func (c *NetworkPolicyRuleClient) Update(existing *NetworkPolicyRule, updates interface{}) (*NetworkPolicyRule, error) { + resp := &NetworkPolicyRule{} + err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *NetworkPolicyRuleClient) List(opts *ListOpts) (*NetworkPolicyRuleCollection, error) { + resp := &NetworkPolicyRuleCollection{} + err := c.rancherClient.doList(NETWORK_POLICY_RULE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *NetworkPolicyRuleCollection) Next() (*NetworkPolicyRuleCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &NetworkPolicyRuleCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *NetworkPolicyRuleClient) ById(id string) (*NetworkPolicyRule, error) { + resp := &NetworkPolicyRule{} + err := c.rancherClient.doById(NETWORK_POLICY_RULE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *NetworkPolicyRuleClient) Delete(container *NetworkPolicyRule) error { + return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_between.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_between.go new file mode 100644 index 000000000..77e17662b --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_between.go @@ -0,0 +1,81 @@ +package client + +const ( + NETWORK_POLICY_RULE_BETWEEN_TYPE = "networkPolicyRuleBetween" +) + +type NetworkPolicyRuleBetween struct { + Resource + + GroupBy string `json:"groupBy,omitempty" yaml:"group_by,omitempty"` + + Selector string `json:"selector,omitempty" yaml:"selector,omitempty"` +} + +type NetworkPolicyRuleBetweenCollection struct { + Collection + Data []NetworkPolicyRuleBetween `json:"data,omitempty"` + client *NetworkPolicyRuleBetweenClient +} + +type NetworkPolicyRuleBetweenClient struct { + rancherClient *RancherClient +} + +type NetworkPolicyRuleBetweenOperations interface { + List(opts *ListOpts) (*NetworkPolicyRuleBetweenCollection, error) + Create(opts *NetworkPolicyRuleBetween) (*NetworkPolicyRuleBetween, error) + Update(existing *NetworkPolicyRuleBetween, updates interface{}) (*NetworkPolicyRuleBetween, error) + ById(id string) (*NetworkPolicyRuleBetween, error) + Delete(container *NetworkPolicyRuleBetween) error +} + +func newNetworkPolicyRuleBetweenClient(rancherClient *RancherClient) *NetworkPolicyRuleBetweenClient { + return &NetworkPolicyRuleBetweenClient{ + rancherClient: rancherClient, + } +} + +func (c *NetworkPolicyRuleBetweenClient) Create(container *NetworkPolicyRuleBetween) (*NetworkPolicyRuleBetween, error) { + resp := &NetworkPolicyRuleBetween{} + err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_BETWEEN_TYPE, container, resp) + return resp, err +} + +func (c *NetworkPolicyRuleBetweenClient) Update(existing *NetworkPolicyRuleBetween, updates interface{}) (*NetworkPolicyRuleBetween, error) { + resp := &NetworkPolicyRuleBetween{} + err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_BETWEEN_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *NetworkPolicyRuleBetweenClient) List(opts *ListOpts) (*NetworkPolicyRuleBetweenCollection, error) { + resp := &NetworkPolicyRuleBetweenCollection{} + err := c.rancherClient.doList(NETWORK_POLICY_RULE_BETWEEN_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *NetworkPolicyRuleBetweenCollection) Next() (*NetworkPolicyRuleBetweenCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &NetworkPolicyRuleBetweenCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *NetworkPolicyRuleBetweenClient) ById(id string) (*NetworkPolicyRuleBetween, error) { + resp := &NetworkPolicyRuleBetween{} + err := c.rancherClient.doById(NETWORK_POLICY_RULE_BETWEEN_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *NetworkPolicyRuleBetweenClient) Delete(container *NetworkPolicyRuleBetween) error { + return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_BETWEEN_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_member.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_member.go new file mode 100644 index 000000000..e8e34e108 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_member.go @@ -0,0 +1,79 @@ +package client + +const ( + NETWORK_POLICY_RULE_MEMBER_TYPE = "networkPolicyRuleMember" +) + +type NetworkPolicyRuleMember struct { + Resource + + Selector string `json:"selector,omitempty" yaml:"selector,omitempty"` +} + +type NetworkPolicyRuleMemberCollection struct { + Collection + Data []NetworkPolicyRuleMember `json:"data,omitempty"` + client *NetworkPolicyRuleMemberClient +} + +type NetworkPolicyRuleMemberClient struct { + rancherClient *RancherClient +} + +type NetworkPolicyRuleMemberOperations interface { + List(opts *ListOpts) (*NetworkPolicyRuleMemberCollection, error) + Create(opts *NetworkPolicyRuleMember) (*NetworkPolicyRuleMember, error) + Update(existing *NetworkPolicyRuleMember, updates interface{}) (*NetworkPolicyRuleMember, error) + ById(id string) (*NetworkPolicyRuleMember, error) + Delete(container *NetworkPolicyRuleMember) error +} + +func newNetworkPolicyRuleMemberClient(rancherClient *RancherClient) *NetworkPolicyRuleMemberClient { + return &NetworkPolicyRuleMemberClient{ + rancherClient: rancherClient, + } +} + +func (c *NetworkPolicyRuleMemberClient) Create(container *NetworkPolicyRuleMember) (*NetworkPolicyRuleMember, error) { + resp := &NetworkPolicyRuleMember{} + err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_MEMBER_TYPE, container, resp) + return resp, err +} + +func (c *NetworkPolicyRuleMemberClient) Update(existing *NetworkPolicyRuleMember, updates interface{}) (*NetworkPolicyRuleMember, error) { + resp := &NetworkPolicyRuleMember{} + err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_MEMBER_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *NetworkPolicyRuleMemberClient) List(opts *ListOpts) (*NetworkPolicyRuleMemberCollection, error) { + resp := &NetworkPolicyRuleMemberCollection{} + err := c.rancherClient.doList(NETWORK_POLICY_RULE_MEMBER_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *NetworkPolicyRuleMemberCollection) Next() (*NetworkPolicyRuleMemberCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &NetworkPolicyRuleMemberCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *NetworkPolicyRuleMemberClient) ById(id string) (*NetworkPolicyRuleMember, error) { + resp := &NetworkPolicyRuleMember{} + err := c.rancherClient.doById(NETWORK_POLICY_RULE_MEMBER_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *NetworkPolicyRuleMemberClient) Delete(container *NetworkPolicyRuleMember) error { + return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_MEMBER_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go new file mode 100644 index 000000000..0472ee678 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go @@ -0,0 +1,77 @@ +package client + +const ( + NETWORK_POLICY_RULE_WITHIN_TYPE = "networkPolicyRuleWithin" +) + +type NetworkPolicyRuleWithin struct { + Resource +} + +type NetworkPolicyRuleWithinCollection struct { + Collection + Data []NetworkPolicyRuleWithin `json:"data,omitempty"` + client *NetworkPolicyRuleWithinClient +} + +type NetworkPolicyRuleWithinClient struct { + rancherClient *RancherClient +} + +type NetworkPolicyRuleWithinOperations interface { + List(opts *ListOpts) (*NetworkPolicyRuleWithinCollection, error) + Create(opts *NetworkPolicyRuleWithin) (*NetworkPolicyRuleWithin, error) + Update(existing *NetworkPolicyRuleWithin, updates interface{}) (*NetworkPolicyRuleWithin, error) + ById(id string) (*NetworkPolicyRuleWithin, error) + Delete(container *NetworkPolicyRuleWithin) error +} + +func newNetworkPolicyRuleWithinClient(rancherClient *RancherClient) *NetworkPolicyRuleWithinClient { + return &NetworkPolicyRuleWithinClient{ + rancherClient: rancherClient, + } +} + +func (c *NetworkPolicyRuleWithinClient) Create(container *NetworkPolicyRuleWithin) (*NetworkPolicyRuleWithin, error) { + resp := &NetworkPolicyRuleWithin{} + err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_WITHIN_TYPE, container, resp) + return resp, err +} + +func (c *NetworkPolicyRuleWithinClient) Update(existing *NetworkPolicyRuleWithin, updates interface{}) (*NetworkPolicyRuleWithin, error) { + resp := &NetworkPolicyRuleWithin{} + err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_WITHIN_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *NetworkPolicyRuleWithinClient) List(opts *ListOpts) (*NetworkPolicyRuleWithinCollection, error) { + resp := &NetworkPolicyRuleWithinCollection{} + err := c.rancherClient.doList(NETWORK_POLICY_RULE_WITHIN_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *NetworkPolicyRuleWithinCollection) Next() (*NetworkPolicyRuleWithinCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &NetworkPolicyRuleWithinCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *NetworkPolicyRuleWithinClient) ById(id string) (*NetworkPolicyRuleWithin, error) { + resp := &NetworkPolicyRuleWithin{} + err := c.rancherClient.doById(NETWORK_POLICY_RULE_WITHIN_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *NetworkPolicyRuleWithinClient) Delete(container *NetworkPolicyRuleWithin) error { + return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_WITHIN_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_nfs_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_nfs_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_openldapconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go similarity index 91% rename from vendor/github.com/rancher/go-rancher/client/generated_openldapconfig.go rename to vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go index 0f69016f4..baf672aed 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_openldapconfig.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go @@ -9,18 +9,26 @@ type Openldapconfig struct { AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` + AllowedIdentities []Identity `json:"allowedIdentities,omitempty" yaml:"allowed_identities,omitempty"` + ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connection_timeout,omitempty"` Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` + GroupDNField string `json:"groupDNField,omitempty" yaml:"group_dnfield,omitempty"` + GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"group_member_mapping_attribute,omitempty"` + GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" yaml:"group_member_user_attribute,omitempty"` + GroupNameField string `json:"groupNameField,omitempty" yaml:"group_name_field,omitempty"` GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"group_object_class,omitempty"` + GroupSearchDomain string `json:"groupSearchDomain,omitempty" yaml:"group_search_domain,omitempty"` + GroupSearchField string `json:"groupSearchField,omitempty" yaml:"group_search_field,omitempty"` LoginDomain string `json:"loginDomain,omitempty" yaml:"login_domain,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/client/generated_packet_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_packet_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_password.go b/vendor/github.com/rancher/go-rancher/v2/generated_password.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_password.go rename to vendor/github.com/rancher/go-rancher/v2/generated_password.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_physical_host.go b/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_physical_host.go rename to vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_port.go b/vendor/github.com/rancher/go-rancher/v2/generated_port.go similarity index 95% rename from vendor/github.com/rancher/go-rancher/client/generated_port.go rename to vendor/github.com/rancher/go-rancher/v2/generated_port.go index 04261f770..1d7a1a977 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_port.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_port.go @@ -75,8 +75,6 @@ type PortOperations interface { ActionRemove(*Port) (*Port, error) - ActionRestore(*Port) (*Port, error) - ActionUpdate(*Port) (*Port, error) } @@ -175,15 +173,6 @@ func (c *PortClient) ActionRemove(resource *Port) (*Port, error) { return resp, err } -func (c *PortClient) ActionRestore(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *PortClient) ActionUpdate(resource *Port) (*Port, error) { resp := &Port{} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go b/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go new file mode 100644 index 000000000..0e03656da --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go @@ -0,0 +1,95 @@ +package client + +const ( + PORT_RULE_TYPE = "portRule" +) + +type PortRule struct { + Resource + + BackendName string `json:"backendName,omitempty" yaml:"backend_name,omitempty"` + + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + + Path string `json:"path,omitempty" yaml:"path,omitempty"` + + Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` + + Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` + + Selector string `json:"selector,omitempty" yaml:"selector,omitempty"` + + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + SourcePort int64 `json:"sourcePort,omitempty" yaml:"source_port,omitempty"` + + TargetPort int64 `json:"targetPort,omitempty" yaml:"target_port,omitempty"` +} + +type PortRuleCollection struct { + Collection + Data []PortRule `json:"data,omitempty"` + client *PortRuleClient +} + +type PortRuleClient struct { + rancherClient *RancherClient +} + +type PortRuleOperations interface { + List(opts *ListOpts) (*PortRuleCollection, error) + Create(opts *PortRule) (*PortRule, error) + Update(existing *PortRule, updates interface{}) (*PortRule, error) + ById(id string) (*PortRule, error) + Delete(container *PortRule) error +} + +func newPortRuleClient(rancherClient *RancherClient) *PortRuleClient { + return &PortRuleClient{ + rancherClient: rancherClient, + } +} + +func (c *PortRuleClient) Create(container *PortRule) (*PortRule, error) { + resp := &PortRule{} + err := c.rancherClient.doCreate(PORT_RULE_TYPE, container, resp) + return resp, err +} + +func (c *PortRuleClient) Update(existing *PortRule, updates interface{}) (*PortRule, error) { + resp := &PortRule{} + err := c.rancherClient.doUpdate(PORT_RULE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *PortRuleClient) List(opts *ListOpts) (*PortRuleCollection, error) { + resp := &PortRuleCollection{} + err := c.rancherClient.doList(PORT_RULE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *PortRuleCollection) Next() (*PortRuleCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &PortRuleCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *PortRuleClient) ById(id string) (*PortRule, error) { + resp := &PortRule{} + err := c.rancherClient.doById(PORT_RULE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *PortRuleClient) Delete(container *PortRule) error { + return c.rancherClient.doResourceDelete(PORT_RULE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_process_definition.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go similarity index 96% rename from vendor/github.com/rancher/go-rancher/client/generated_process_definition.go rename to vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go index b6c9d94a3..9da63d81f 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_process_definition.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go @@ -19,7 +19,7 @@ type ProcessDefinition struct { ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` - StateTransitions []interface{} `json:"stateTransitions,omitempty" yaml:"state_transitions,omitempty"` + StateTransitions []StateTransition `json:"stateTransitions,omitempty" yaml:"state_transitions,omitempty"` } type ProcessDefinitionCollection struct { diff --git a/vendor/github.com/rancher/go-rancher/client/generated_process_execution.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_process_execution.go rename to vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_process_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go similarity index 85% rename from vendor/github.com/rancher/go-rancher/client/generated_process_instance.go rename to vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go index 7dc874a79..deae1af97 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_process_instance.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go @@ -7,10 +7,14 @@ const ( type ProcessInstance struct { Resource + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` + ExecutionCount int64 `json:"executionCount,omitempty" yaml:"execution_count,omitempty"` + ExitReason string `json:"exitReason,omitempty" yaml:"exit_reason,omitempty"` Phase string `json:"phase,omitempty" yaml:"phase,omitempty"` @@ -25,6 +29,8 @@ type ProcessInstance struct { Result string `json:"result,omitempty" yaml:"result,omitempty"` + RunAfter string `json:"runAfter,omitempty" yaml:"run_after,omitempty"` + RunningProcessServerId string `json:"runningProcessServerId,omitempty" yaml:"running_process_server_id,omitempty"` StartProcessServerId string `json:"startProcessServerId,omitempty" yaml:"start_process_server_id,omitempty"` @@ -48,6 +54,8 @@ type ProcessInstanceOperations interface { Update(existing *ProcessInstance, updates interface{}) (*ProcessInstance, error) ById(id string) (*ProcessInstance, error) Delete(container *ProcessInstance) error + + ActionReplay(*ProcessInstance) (*ProcessInstance, error) } func newProcessInstanceClient(rancherClient *RancherClient) *ProcessInstanceClient { @@ -99,3 +107,12 @@ func (c *ProcessInstanceClient) ById(id string) (*ProcessInstance, error) { func (c *ProcessInstanceClient) Delete(container *ProcessInstance) error { return c.rancherClient.doResourceDelete(PROCESS_INSTANCE_TYPE, &container.Resource) } + +func (c *ProcessInstanceClient) ActionReplay(resource *ProcessInstance) (*ProcessInstance, error) { + + resp := &ProcessInstance{} + + err := c.rancherClient.doAction(PROCESS_INSTANCE_TYPE, "replay", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_pool.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_pool.go new file mode 100644 index 000000000..1fbff0b0f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_process_pool.go @@ -0,0 +1,95 @@ +package client + +const ( + PROCESS_POOL_TYPE = "processPool" +) + +type ProcessPool struct { + Resource + + ActiveTasks int64 `json:"activeTasks,omitempty" yaml:"active_tasks,omitempty"` + + CompletedTasks int64 `json:"completedTasks,omitempty" yaml:"completed_tasks,omitempty"` + + MaxPoolSize int64 `json:"maxPoolSize,omitempty" yaml:"max_pool_size,omitempty"` + + MinPoolSize int64 `json:"minPoolSize,omitempty" yaml:"min_pool_size,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PoolSize int64 `json:"poolSize,omitempty" yaml:"pool_size,omitempty"` + + QueueRemainingCapacity int64 `json:"queueRemainingCapacity,omitempty" yaml:"queue_remaining_capacity,omitempty"` + + QueueSize int64 `json:"queueSize,omitempty" yaml:"queue_size,omitempty"` + + RejectedTasks int64 `json:"rejectedTasks,omitempty" yaml:"rejected_tasks,omitempty"` +} + +type ProcessPoolCollection struct { + Collection + Data []ProcessPool `json:"data,omitempty"` + client *ProcessPoolClient +} + +type ProcessPoolClient struct { + rancherClient *RancherClient +} + +type ProcessPoolOperations interface { + List(opts *ListOpts) (*ProcessPoolCollection, error) + Create(opts *ProcessPool) (*ProcessPool, error) + Update(existing *ProcessPool, updates interface{}) (*ProcessPool, error) + ById(id string) (*ProcessPool, error) + Delete(container *ProcessPool) error +} + +func newProcessPoolClient(rancherClient *RancherClient) *ProcessPoolClient { + return &ProcessPoolClient{ + rancherClient: rancherClient, + } +} + +func (c *ProcessPoolClient) Create(container *ProcessPool) (*ProcessPool, error) { + resp := &ProcessPool{} + err := c.rancherClient.doCreate(PROCESS_POOL_TYPE, container, resp) + return resp, err +} + +func (c *ProcessPoolClient) Update(existing *ProcessPool, updates interface{}) (*ProcessPool, error) { + resp := &ProcessPool{} + err := c.rancherClient.doUpdate(PROCESS_POOL_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ProcessPoolClient) List(opts *ListOpts) (*ProcessPoolCollection, error) { + resp := &ProcessPoolCollection{} + err := c.rancherClient.doList(PROCESS_POOL_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *ProcessPoolCollection) Next() (*ProcessPoolCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ProcessPoolCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *ProcessPoolClient) ById(id string) (*ProcessPool, error) { + resp := &ProcessPool{} + err := c.rancherClient.doById(PROCESS_POOL_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ProcessPoolClient) Delete(container *ProcessPool) error { + return c.rancherClient.doResourceDelete(PROCESS_POOL_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go new file mode 100644 index 000000000..aed14d743 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go @@ -0,0 +1,85 @@ +package client + +const ( + PROCESS_SUMMARY_TYPE = "processSummary" +) + +type ProcessSummary struct { + Resource + + Delay int64 `json:"delay,omitempty" yaml:"delay,omitempty"` + + ProcessName string `json:"processName,omitempty" yaml:"process_name,omitempty"` + + Ready int64 `json:"ready,omitempty" yaml:"ready,omitempty"` + + Running int64 `json:"running,omitempty" yaml:"running,omitempty"` +} + +type ProcessSummaryCollection struct { + Collection + Data []ProcessSummary `json:"data,omitempty"` + client *ProcessSummaryClient +} + +type ProcessSummaryClient struct { + rancherClient *RancherClient +} + +type ProcessSummaryOperations interface { + List(opts *ListOpts) (*ProcessSummaryCollection, error) + Create(opts *ProcessSummary) (*ProcessSummary, error) + Update(existing *ProcessSummary, updates interface{}) (*ProcessSummary, error) + ById(id string) (*ProcessSummary, error) + Delete(container *ProcessSummary) error +} + +func newProcessSummaryClient(rancherClient *RancherClient) *ProcessSummaryClient { + return &ProcessSummaryClient{ + rancherClient: rancherClient, + } +} + +func (c *ProcessSummaryClient) Create(container *ProcessSummary) (*ProcessSummary, error) { + resp := &ProcessSummary{} + err := c.rancherClient.doCreate(PROCESS_SUMMARY_TYPE, container, resp) + return resp, err +} + +func (c *ProcessSummaryClient) Update(existing *ProcessSummary, updates interface{}) (*ProcessSummary, error) { + resp := &ProcessSummary{} + err := c.rancherClient.doUpdate(PROCESS_SUMMARY_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ProcessSummaryClient) List(opts *ListOpts) (*ProcessSummaryCollection, error) { + resp := &ProcessSummaryCollection{} + err := c.rancherClient.doList(PROCESS_SUMMARY_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *ProcessSummaryCollection) Next() (*ProcessSummaryCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ProcessSummaryCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *ProcessSummaryClient) ById(id string) (*ProcessSummary, error) { + resp := &ProcessSummary{} + err := c.rancherClient.doById(PROCESS_SUMMARY_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ProcessSummaryClient) Delete(container *ProcessSummary) error { + return c.rancherClient.doResourceDelete(PROCESS_SUMMARY_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_project.go b/vendor/github.com/rancher/go-rancher/v2/generated_project.go similarity index 85% rename from vendor/github.com/rancher/go-rancher/client/generated_project.go rename to vendor/github.com/rancher/go-rancher/v2/generated_project.go index b8986a701..8abc198e6 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_project.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_project.go @@ -13,19 +13,25 @@ type Project struct { Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + DefaultNetworkId string `json:"defaultNetworkId,omitempty" yaml:"default_network_id,omitempty"` + Description string `json:"description,omitempty" yaml:"description,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + HostRemoveDelaySeconds int64 `json:"hostRemoveDelaySeconds,omitempty" yaml:"host_remove_delay_seconds,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - Kubernetes bool `json:"kubernetes,omitempty" yaml:"kubernetes,omitempty"` - - Members []interface{} `json:"members,omitempty" yaml:"members,omitempty"` - - Mesos bool `json:"mesos,omitempty" yaml:"mesos,omitempty"` + Members []ProjectMember `json:"members,omitempty" yaml:"members,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` - PublicDns bool `json:"publicDns,omitempty" yaml:"public_dns,omitempty"` + Orchestration string `json:"orchestration,omitempty" yaml:"orchestration,omitempty"` + + ProjectLinks []string `json:"projectLinks,omitempty" yaml:"project_links,omitempty"` + + ProjectTemplateId string `json:"projectTemplateId,omitempty" yaml:"project_template_id,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -35,8 +41,6 @@ type Project struct { State string `json:"state,omitempty" yaml:"state,omitempty"` - Swarm bool `json:"swarm,omitempty" yaml:"swarm,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -45,6 +49,8 @@ type Project struct { Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + Version string `json:"version,omitempty" yaml:"version,omitempty"` + VirtualMachine bool `json:"virtualMachine,omitempty" yaml:"virtual_machine,omitempty"` } @@ -75,11 +81,11 @@ type ProjectOperations interface { ActionRemove(*Project) (*Account, error) - ActionRestore(*Project) (*Account, error) - ActionSetmembers(*Project, *SetProjectMembersInput) (*SetProjectMembersInput, error) ActionUpdate(*Project) (*Account, error) + + ActionUpgrade(*Project) (*Account, error) } func newProjectClient(rancherClient *RancherClient) *ProjectClient { @@ -177,15 +183,6 @@ func (c *ProjectClient) ActionRemove(resource *Project) (*Account, error) { return resp, err } -func (c *ProjectClient) ActionRestore(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ProjectClient) ActionSetmembers(resource *Project, input *SetProjectMembersInput) (*SetProjectMembersInput, error) { resp := &SetProjectMembersInput{} @@ -203,3 +200,12 @@ func (c *ProjectClient) ActionUpdate(resource *Project) (*Account, error) { return resp, err } + +func (c *ProjectClient) ActionUpgrade(resource *Project) (*Account, error) { + + resp := &Account{} + + err := c.rancherClient.doAction(PROJECT_TYPE, "upgrade", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_project_member.go b/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go similarity index 94% rename from vendor/github.com/rancher/go-rancher/client/generated_project_member.go rename to vendor/github.com/rancher/go-rancher/v2/generated_project_member.go index 96c6a7715..569c5a2ed 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_project_member.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go @@ -67,8 +67,6 @@ type ProjectMemberOperations interface { ActionRemove(*ProjectMember) (*ProjectMember, error) - ActionRestore(*ProjectMember) (*ProjectMember, error) - ActionUpdate(*ProjectMember) (*ProjectMember, error) } @@ -167,15 +165,6 @@ func (c *ProjectMemberClient) ActionRemove(resource *ProjectMember) (*ProjectMem return resp, err } -func (c *ProjectMemberClient) ActionRestore(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ProjectMemberClient) ActionUpdate(resource *ProjectMember) (*ProjectMember, error) { resp := &ProjectMember{} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go new file mode 100644 index 000000000..9c2088300 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go @@ -0,0 +1,131 @@ +package client + +const ( + PROJECT_TEMPLATE_TYPE = "projectTemplate" +) + +type ProjectTemplate struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + IsPublic bool `json:"isPublic,omitempty" yaml:"is_public,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + Stacks []CatalogTemplate `json:"stacks,omitempty" yaml:"stacks,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ProjectTemplateCollection struct { + Collection + Data []ProjectTemplate `json:"data,omitempty"` + client *ProjectTemplateClient +} + +type ProjectTemplateClient struct { + rancherClient *RancherClient +} + +type ProjectTemplateOperations interface { + List(opts *ListOpts) (*ProjectTemplateCollection, error) + Create(opts *ProjectTemplate) (*ProjectTemplate, error) + Update(existing *ProjectTemplate, updates interface{}) (*ProjectTemplate, error) + ById(id string) (*ProjectTemplate, error) + Delete(container *ProjectTemplate) error + + ActionCreate(*ProjectTemplate) (*ProjectTemplate, error) + + ActionRemove(*ProjectTemplate) (*ProjectTemplate, error) +} + +func newProjectTemplateClient(rancherClient *RancherClient) *ProjectTemplateClient { + return &ProjectTemplateClient{ + rancherClient: rancherClient, + } +} + +func (c *ProjectTemplateClient) Create(container *ProjectTemplate) (*ProjectTemplate, error) { + resp := &ProjectTemplate{} + err := c.rancherClient.doCreate(PROJECT_TEMPLATE_TYPE, container, resp) + return resp, err +} + +func (c *ProjectTemplateClient) Update(existing *ProjectTemplate, updates interface{}) (*ProjectTemplate, error) { + resp := &ProjectTemplate{} + err := c.rancherClient.doUpdate(PROJECT_TEMPLATE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ProjectTemplateClient) List(opts *ListOpts) (*ProjectTemplateCollection, error) { + resp := &ProjectTemplateCollection{} + err := c.rancherClient.doList(PROJECT_TEMPLATE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *ProjectTemplateCollection) Next() (*ProjectTemplateCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ProjectTemplateCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *ProjectTemplateClient) ById(id string) (*ProjectTemplate, error) { + resp := &ProjectTemplate{} + err := c.rancherClient.doById(PROJECT_TEMPLATE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ProjectTemplateClient) Delete(container *ProjectTemplate) error { + return c.rancherClient.doResourceDelete(PROJECT_TEMPLATE_TYPE, &container.Resource) +} + +func (c *ProjectTemplateClient) ActionCreate(resource *ProjectTemplate) (*ProjectTemplate, error) { + + resp := &ProjectTemplate{} + + err := c.rancherClient.doAction(PROJECT_TEMPLATE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ProjectTemplateClient) ActionRemove(resource *ProjectTemplate) (*ProjectTemplate, error) { + + resp := &ProjectTemplate{} + + err := c.rancherClient.doAction(PROJECT_TEMPLATE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_public_endpoint.go b/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_public_endpoint.go rename to vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_publish.go b/vendor/github.com/rancher/go-rancher/v2/generated_publish.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_publish.go rename to vendor/github.com/rancher/go-rancher/v2/generated_publish.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_pull_task.go b/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go similarity index 85% rename from vendor/github.com/rancher/go-rancher/client/generated_pull_task.go rename to vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go index d7fd58140..3958091c5 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_pull_task.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go @@ -58,6 +58,10 @@ type PullTaskOperations interface { Update(existing *PullTask, updates interface{}) (*PullTask, error) ById(id string) (*PullTask, error) Delete(container *PullTask) error + + ActionCreate(*PullTask) (*GenericObject, error) + + ActionRemove(*PullTask) (*GenericObject, error) } func newPullTaskClient(rancherClient *RancherClient) *PullTaskClient { @@ -109,3 +113,21 @@ func (c *PullTaskClient) ById(id string) (*PullTask, error) { func (c *PullTaskClient) Delete(container *PullTask) error { return c.rancherClient.doResourceDelete(PULL_TASK_TYPE, &container.Resource) } + +func (c *PullTaskClient) ActionCreate(resource *PullTask) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(PULL_TASK_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *PullTaskClient) ActionRemove(resource *PullTask) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(PULL_TASK_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_recreate_on_quorum_strategy_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_recreate_on_quorum_strategy_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_register.go b/vendor/github.com/rancher/go-rancher/v2/generated_register.go similarity index 84% rename from vendor/github.com/rancher/go-rancher/client/generated_register.go rename to vendor/github.com/rancher/go-rancher/v2/generated_register.go index 3e180b8ee..abbdd80af 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_register.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_register.go @@ -27,6 +27,8 @@ type Register struct { Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + ResourceData map[string]interface{} `json:"resourceData,omitempty" yaml:"resource_data,omitempty"` + SecretKey string `json:"secretKey,omitempty" yaml:"secret_key,omitempty"` State string `json:"state,omitempty" yaml:"state,omitempty"` @@ -57,6 +59,10 @@ type RegisterOperations interface { ById(id string) (*Register, error) Delete(container *Register) error + ActionCreate(*Register) (*GenericObject, error) + + ActionRemove(*Register) (*GenericObject, error) + ActionStop(*Register, *InstanceStop) (*Instance, error) } @@ -110,6 +116,24 @@ func (c *RegisterClient) Delete(container *Register) error { return c.rancherClient.doResourceDelete(REGISTER_TYPE, &container.Resource) } +func (c *RegisterClient) ActionCreate(resource *Register) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(REGISTER_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *RegisterClient) ActionRemove(resource *Register) (*GenericObject, error) { + + resp := &GenericObject{} + + err := c.rancherClient.doAction(REGISTER_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + func (c *RegisterClient) ActionStop(resource *Register, input *InstanceStop) (*Instance, error) { resp := &Instance{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_registration_token.go b/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_registration_token.go rename to vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_registry.go b/vendor/github.com/rancher/go-rancher/v2/generated_registry.go similarity index 95% rename from vendor/github.com/rancher/go-rancher/client/generated_registry.go rename to vendor/github.com/rancher/go-rancher/v2/generated_registry.go index e5dae9857..240478914 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_registry.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_registry.go @@ -73,8 +73,6 @@ type RegistryOperations interface { ActionRemove(*Registry) (*StoragePool, error) - ActionRestore(*Registry) (*StoragePool, error) - ActionUpdate(*Registry) (*StoragePool, error) } @@ -173,15 +171,6 @@ func (c *RegistryClient) ActionRemove(resource *Registry) (*StoragePool, error) return resp, err } -func (c *RegistryClient) ActionRestore(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *RegistryClient) ActionUpdate(resource *Registry) (*StoragePool, error) { resp := &StoragePool{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_registry_credential.go b/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go similarity index 98% rename from vendor/github.com/rancher/go-rancher/client/generated_registry_credential.go rename to vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go index 59bd5f823..381fcd729 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_registry_credential.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go @@ -15,8 +15,6 @@ type RegistryCredential struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - Email string `json:"email,omitempty" yaml:"email,omitempty"` - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` diff --git a/vendor/github.com/rancher/go-rancher/client/generated_resource_definition.go b/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_resource_definition.go rename to vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_restart_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_restart_policy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_restore_from_backup_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_restore_from_backup_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_revert_to_snapshot_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_revert_to_snapshot_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_rolling_restart_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_rolling_restart_strategy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_scale_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_scale_policy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_scheduled_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_scheduled_upgrade.go new file mode 100644 index 000000000..bfe0dfdd9 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_scheduled_upgrade.go @@ -0,0 +1,136 @@ +package client + +const ( + SCHEDULED_UPGRADE_TYPE = "scheduledUpgrade" +) + +type ScheduledUpgrade struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + + Started string `json:"started,omitempty" yaml:"started,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type ScheduledUpgradeCollection struct { + Collection + Data []ScheduledUpgrade `json:"data,omitempty"` + client *ScheduledUpgradeClient +} + +type ScheduledUpgradeClient struct { + rancherClient *RancherClient +} + +type ScheduledUpgradeOperations interface { + List(opts *ListOpts) (*ScheduledUpgradeCollection, error) + Create(opts *ScheduledUpgrade) (*ScheduledUpgrade, error) + Update(existing *ScheduledUpgrade, updates interface{}) (*ScheduledUpgrade, error) + ById(id string) (*ScheduledUpgrade, error) + Delete(container *ScheduledUpgrade) error + + ActionCreate(*ScheduledUpgrade) (*ScheduledUpgrade, error) + + ActionRemove(*ScheduledUpgrade) (*ScheduledUpgrade, error) + + ActionStart(*ScheduledUpgrade) (*ScheduledUpgrade, error) +} + +func newScheduledUpgradeClient(rancherClient *RancherClient) *ScheduledUpgradeClient { + return &ScheduledUpgradeClient{ + rancherClient: rancherClient, + } +} + +func (c *ScheduledUpgradeClient) Create(container *ScheduledUpgrade) (*ScheduledUpgrade, error) { + resp := &ScheduledUpgrade{} + err := c.rancherClient.doCreate(SCHEDULED_UPGRADE_TYPE, container, resp) + return resp, err +} + +func (c *ScheduledUpgradeClient) Update(existing *ScheduledUpgrade, updates interface{}) (*ScheduledUpgrade, error) { + resp := &ScheduledUpgrade{} + err := c.rancherClient.doUpdate(SCHEDULED_UPGRADE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ScheduledUpgradeClient) List(opts *ListOpts) (*ScheduledUpgradeCollection, error) { + resp := &ScheduledUpgradeCollection{} + err := c.rancherClient.doList(SCHEDULED_UPGRADE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *ScheduledUpgradeCollection) Next() (*ScheduledUpgradeCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ScheduledUpgradeCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *ScheduledUpgradeClient) ById(id string) (*ScheduledUpgrade, error) { + resp := &ScheduledUpgrade{} + err := c.rancherClient.doById(SCHEDULED_UPGRADE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ScheduledUpgradeClient) Delete(container *ScheduledUpgrade) error { + return c.rancherClient.doResourceDelete(SCHEDULED_UPGRADE_TYPE, &container.Resource) +} + +func (c *ScheduledUpgradeClient) ActionCreate(resource *ScheduledUpgrade) (*ScheduledUpgrade, error) { + + resp := &ScheduledUpgrade{} + + err := c.rancherClient.doAction(SCHEDULED_UPGRADE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ScheduledUpgradeClient) ActionRemove(resource *ScheduledUpgrade) (*ScheduledUpgrade, error) { + + resp := &ScheduledUpgrade{} + + err := c.rancherClient.doAction(SCHEDULED_UPGRADE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *ScheduledUpgradeClient) ActionStart(resource *ScheduledUpgrade) (*ScheduledUpgrade, error) { + + resp := &ScheduledUpgrade{} + + err := c.rancherClient.doAction(SCHEDULED_UPGRADE_TYPE, "start", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_secondary_launch_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go similarity index 77% rename from vendor/github.com/rancher/go-rancher/client/generated_secondary_launch_config.go rename to vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go index 5561fad81..b5653fa61 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_secondary_launch_config.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go @@ -15,18 +15,36 @@ type SecondaryLaunchConfig struct { BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` + Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` + CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` + Command []string `json:"command,omitempty" yaml:"command,omitempty"` Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` + + CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` + + CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` + + CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` + + CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` + + CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` @@ -49,14 +67,20 @@ type SecondaryLaunchConfig struct { Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` - Disks []interface{} `json:"disks,omitempty" yaml:"disks,omitempty"` + DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` + + Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` + DrainTimeoutMs int64 `json:"drainTimeoutMs,omitempty" yaml:"drain_timeout_ms,omitempty"` + EntryPoint []string `json:"entryPoint,omitempty" yaml:"entry_point,omitempty"` Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` @@ -69,10 +93,20 @@ type SecondaryLaunchConfig struct { FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` + + HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` + + HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` @@ -81,6 +115,22 @@ type SecondaryLaunchConfig struct { InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` + + IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` + + IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` + + Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` + + Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` + + IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` + + Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` + + KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` @@ -93,12 +143,22 @@ type SecondaryLaunchConfig struct { MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` + MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` + + MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` + + Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` + NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` @@ -107,12 +167,20 @@ type SecondaryLaunchConfig struct { NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` + OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` + + OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` + PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` + PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` + Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` @@ -129,8 +197,20 @@ type SecondaryLaunchConfig struct { RequestedIpAddress string `json:"requestedIpAddress,omitempty" yaml:"requested_ip_address,omitempty"` + RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` + + Secrets []SecretReference `json:"secrets,omitempty" yaml:"secrets,omitempty"` + SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + + ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` @@ -139,7 +219,17 @@ type SecondaryLaunchConfig struct { StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - SystemContainer string `json:"systemContainer,omitempty" yaml:"system_container,omitempty"` + StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` + + StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` + + StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` + + Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,omitempty"` + + Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` Token string `json:"token,omitempty" yaml:"token,omitempty"` @@ -151,10 +241,18 @@ type SecondaryLaunchConfig struct { Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` + Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` + User string `json:"user,omitempty" yaml:"user,omitempty"` + UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` + Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` + UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` + + Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` @@ -205,10 +303,6 @@ type SecondaryLaunchConfigOperations interface { ActionRestart(*SecondaryLaunchConfig) (*Instance, error) - ActionRestore(*SecondaryLaunchConfig) (*Instance, error) - - ActionSetlabels(*SecondaryLaunchConfig, *SetLabelsInput) (*Container, error) - ActionStart(*SecondaryLaunchConfig) (*Instance, error) ActionStop(*SecondaryLaunchConfig, *InstanceStop) (*Instance, error) @@ -371,24 +465,6 @@ func (c *SecondaryLaunchConfigClient) ActionRestart(resource *SecondaryLaunchCon return resp, err } -func (c *SecondaryLaunchConfigClient) ActionRestore(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionSetlabels(resource *SecondaryLaunchConfig, input *SetLabelsInput) (*Container, error) { - - resp := &Container{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "setlabels", &resource.Resource, input, resp) - - return resp, err -} - func (c *SecondaryLaunchConfigClient) ActionStart(resource *SecondaryLaunchConfig) (*Instance, error) { resp := &Instance{} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_secret.go b/vendor/github.com/rancher/go-rancher/v2/generated_secret.go new file mode 100644 index 000000000..0ae5737d8 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_secret.go @@ -0,0 +1,127 @@ +package client + +const ( + SECRET_TYPE = "secret" +) + +type Secret struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Value string `json:"value,omitempty" yaml:"value,omitempty"` +} + +type SecretCollection struct { + Collection + Data []Secret `json:"data,omitempty"` + client *SecretClient +} + +type SecretClient struct { + rancherClient *RancherClient +} + +type SecretOperations interface { + List(opts *ListOpts) (*SecretCollection, error) + Create(opts *Secret) (*Secret, error) + Update(existing *Secret, updates interface{}) (*Secret, error) + ById(id string) (*Secret, error) + Delete(container *Secret) error + + ActionCreate(*Secret) (*Secret, error) + + ActionRemove(*Secret) (*Secret, error) +} + +func newSecretClient(rancherClient *RancherClient) *SecretClient { + return &SecretClient{ + rancherClient: rancherClient, + } +} + +func (c *SecretClient) Create(container *Secret) (*Secret, error) { + resp := &Secret{} + err := c.rancherClient.doCreate(SECRET_TYPE, container, resp) + return resp, err +} + +func (c *SecretClient) Update(existing *Secret, updates interface{}) (*Secret, error) { + resp := &Secret{} + err := c.rancherClient.doUpdate(SECRET_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SecretClient) List(opts *ListOpts) (*SecretCollection, error) { + resp := &SecretCollection{} + err := c.rancherClient.doList(SECRET_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *SecretCollection) Next() (*SecretCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SecretCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *SecretClient) ById(id string) (*Secret, error) { + resp := &Secret{} + err := c.rancherClient.doById(SECRET_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SecretClient) Delete(container *Secret) error { + return c.rancherClient.doResourceDelete(SECRET_TYPE, &container.Resource) +} + +func (c *SecretClient) ActionCreate(resource *Secret) (*Secret, error) { + + resp := &Secret{} + + err := c.rancherClient.doAction(SECRET_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SecretClient) ActionRemove(resource *Secret) (*Secret, error) { + + resp := &Secret{} + + err := c.rancherClient.doAction(SECRET_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go b/vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go new file mode 100644 index 000000000..fb6915f2e --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go @@ -0,0 +1,87 @@ +package client + +const ( + SECRET_REFERENCE_TYPE = "secretReference" +) + +type SecretReference struct { + Resource + + Gid string `json:"gid,omitempty" yaml:"gid,omitempty"` + + Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + SecretId string `json:"secretId,omitempty" yaml:"secret_id,omitempty"` + + Uid string `json:"uid,omitempty" yaml:"uid,omitempty"` +} + +type SecretReferenceCollection struct { + Collection + Data []SecretReference `json:"data,omitempty"` + client *SecretReferenceClient +} + +type SecretReferenceClient struct { + rancherClient *RancherClient +} + +type SecretReferenceOperations interface { + List(opts *ListOpts) (*SecretReferenceCollection, error) + Create(opts *SecretReference) (*SecretReference, error) + Update(existing *SecretReference, updates interface{}) (*SecretReference, error) + ById(id string) (*SecretReference, error) + Delete(container *SecretReference) error +} + +func newSecretReferenceClient(rancherClient *RancherClient) *SecretReferenceClient { + return &SecretReferenceClient{ + rancherClient: rancherClient, + } +} + +func (c *SecretReferenceClient) Create(container *SecretReference) (*SecretReference, error) { + resp := &SecretReference{} + err := c.rancherClient.doCreate(SECRET_REFERENCE_TYPE, container, resp) + return resp, err +} + +func (c *SecretReferenceClient) Update(existing *SecretReference, updates interface{}) (*SecretReference, error) { + resp := &SecretReference{} + err := c.rancherClient.doUpdate(SECRET_REFERENCE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SecretReferenceClient) List(opts *ListOpts) (*SecretReferenceCollection, error) { + resp := &SecretReferenceCollection{} + err := c.rancherClient.doList(SECRET_REFERENCE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *SecretReferenceCollection) Next() (*SecretReferenceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SecretReferenceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *SecretReferenceClient) ById(id string) (*SecretReference, error) { + resp := &SecretReference{} + err := c.rancherClient.doById(SECRET_REFERENCE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SecretReferenceClient) Delete(container *SecretReference) error { + return c.rancherClient.doResourceDelete(SECRET_REFERENCE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_service.go similarity index 90% rename from vendor/github.com/rancher/go-rancher/client/generated_service.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service.go index 0fd19891c..4cfb48076 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_service.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service.go @@ -21,23 +21,27 @@ type Service struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnvironmentId string `json:"environmentId,omitempty" yaml:"environment_id,omitempty"` - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` + + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` - PublicEndpoints []interface{} `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -49,16 +53,20 @@ type Service struct { ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - SecondaryLaunchConfigs []interface{} `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` + SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` State string `json:"state,omitempty" yaml:"state,omitempty"` + System bool `json:"system,omitempty" yaml:"system,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -93,10 +101,10 @@ type ServiceOperations interface { ActionAddservicelink(*Service, *AddRemoveServiceLinkInput) (*Service, error) - ActionCancelrollback(*Service) (*Service, error) - ActionCancelupgrade(*Service) (*Service, error) + ActionContinueupgrade(*Service) (*Service, error) + ActionCreate(*Service) (*Service, error) ActionDeactivate(*Service) (*Service, error) @@ -186,15 +194,6 @@ func (c *ServiceClient) ActionAddservicelink(resource *Service, input *AddRemove return resp, err } -func (c *ServiceClient) ActionCancelrollback(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "cancelrollback", &resource.Resource, nil, resp) - - return resp, err -} - func (c *ServiceClient) ActionCancelupgrade(resource *Service) (*Service, error) { resp := &Service{} @@ -204,6 +203,15 @@ func (c *ServiceClient) ActionCancelupgrade(resource *Service) (*Service, error) return resp, err } +func (c *ServiceClient) ActionContinueupgrade(resource *Service) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + func (c *ServiceClient) ActionCreate(resource *Service) (*Service, error) { resp := &Service{} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go new file mode 100644 index 000000000..362691742 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go @@ -0,0 +1,81 @@ +package client + +const ( + SERVICE_BINDING_TYPE = "serviceBinding" +) + +type ServiceBinding struct { + Resource + + Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` + + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` +} + +type ServiceBindingCollection struct { + Collection + Data []ServiceBinding `json:"data,omitempty"` + client *ServiceBindingClient +} + +type ServiceBindingClient struct { + rancherClient *RancherClient +} + +type ServiceBindingOperations interface { + List(opts *ListOpts) (*ServiceBindingCollection, error) + Create(opts *ServiceBinding) (*ServiceBinding, error) + Update(existing *ServiceBinding, updates interface{}) (*ServiceBinding, error) + ById(id string) (*ServiceBinding, error) + Delete(container *ServiceBinding) error +} + +func newServiceBindingClient(rancherClient *RancherClient) *ServiceBindingClient { + return &ServiceBindingClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceBindingClient) Create(container *ServiceBinding) (*ServiceBinding, error) { + resp := &ServiceBinding{} + err := c.rancherClient.doCreate(SERVICE_BINDING_TYPE, container, resp) + return resp, err +} + +func (c *ServiceBindingClient) Update(existing *ServiceBinding, updates interface{}) (*ServiceBinding, error) { + resp := &ServiceBinding{} + err := c.rancherClient.doUpdate(SERVICE_BINDING_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceBindingClient) List(opts *ListOpts) (*ServiceBindingCollection, error) { + resp := &ServiceBindingCollection{} + err := c.rancherClient.doList(SERVICE_BINDING_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *ServiceBindingCollection) Next() (*ServiceBindingCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceBindingCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *ServiceBindingClient) ById(id string) (*ServiceBinding, error) { + resp := &ServiceBinding{} + err := c.rancherClient.doById(SERVICE_BINDING_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceBindingClient) Delete(container *ServiceBinding) error { + return c.rancherClient.doResourceDelete(SERVICE_BINDING_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_consume_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_service_consume_map.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_service_event.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_event.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_expose_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_service_expose_map.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_link.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_service_link.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_link.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go new file mode 100644 index 000000000..81c2236e7 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go @@ -0,0 +1,101 @@ +package client + +const ( + SERVICE_LOG_TYPE = "serviceLog" +) + +type ServiceLog struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` + + EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` + + InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Level string `json:"level,omitempty" yaml:"level,omitempty"` + + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + SubLog bool `json:"subLog,omitempty" yaml:"sub_log,omitempty"` + + TransactionId string `json:"transactionId,omitempty" yaml:"transaction_id,omitempty"` +} + +type ServiceLogCollection struct { + Collection + Data []ServiceLog `json:"data,omitempty"` + client *ServiceLogClient +} + +type ServiceLogClient struct { + rancherClient *RancherClient +} + +type ServiceLogOperations interface { + List(opts *ListOpts) (*ServiceLogCollection, error) + Create(opts *ServiceLog) (*ServiceLog, error) + Update(existing *ServiceLog, updates interface{}) (*ServiceLog, error) + ById(id string) (*ServiceLog, error) + Delete(container *ServiceLog) error +} + +func newServiceLogClient(rancherClient *RancherClient) *ServiceLogClient { + return &ServiceLogClient{ + rancherClient: rancherClient, + } +} + +func (c *ServiceLogClient) Create(container *ServiceLog) (*ServiceLog, error) { + resp := &ServiceLog{} + err := c.rancherClient.doCreate(SERVICE_LOG_TYPE, container, resp) + return resp, err +} + +func (c *ServiceLogClient) Update(existing *ServiceLog, updates interface{}) (*ServiceLog, error) { + resp := &ServiceLog{} + err := c.rancherClient.doUpdate(SERVICE_LOG_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ServiceLogClient) List(opts *ListOpts) (*ServiceLogCollection, error) { + resp := &ServiceLogCollection{} + err := c.rancherClient.doList(SERVICE_LOG_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *ServiceLogCollection) Next() (*ServiceLogCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ServiceLogCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *ServiceLogClient) ById(id string) (*ServiceLog, error) { + resp := &ServiceLog{} + err := c.rancherClient.doById(SERVICE_LOG_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *ServiceLogClient) Delete(container *ServiceLog) error { + return c.rancherClient.doResourceDelete(SERVICE_LOG_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_proxy.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_service_proxy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_restart.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_service_restart.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_service_upgrade.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_service_upgrade_strategy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_services_port_range.go b/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_services_port_range.go rename to vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_set_project_members_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go similarity index 97% rename from vendor/github.com/rancher/go-rancher/client/generated_set_project_members_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go index 29cbc786d..6d09c9c3b 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_set_project_members_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go @@ -7,7 +7,7 @@ const ( type SetProjectMembersInput struct { Resource - Members []interface{} `json:"members,omitempty" yaml:"members,omitempty"` + Members []ProjectMember `json:"members,omitempty" yaml:"members,omitempty"` } type SetProjectMembersInputCollection struct { diff --git a/vendor/github.com/rancher/go-rancher/client/generated_set_service_links_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go similarity index 97% rename from vendor/github.com/rancher/go-rancher/client/generated_set_service_links_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go index 9ee69531f..a67d8c4de 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_set_service_links_input.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go @@ -7,7 +7,7 @@ const ( type SetServiceLinksInput struct { Resource - ServiceLinks []interface{} `json:"serviceLinks,omitempty" yaml:"service_links,omitempty"` + ServiceLinks []ServiceLink `json:"serviceLinks,omitempty" yaml:"service_links,omitempty"` } type SetServiceLinksInputCollection struct { diff --git a/vendor/github.com/rancher/go-rancher/client/generated_setting.go b/vendor/github.com/rancher/go-rancher/v2/generated_setting.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_setting.go rename to vendor/github.com/rancher/go-rancher/v2/generated_setting.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_snapshot.go b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_snapshot.go rename to vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_snapshot_backup_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_snapshot_backup_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_stack.go b/vendor/github.com/rancher/go-rancher/v2/generated_stack.go new file mode 100644 index 000000000..f661218b9 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_stack.go @@ -0,0 +1,265 @@ +package client + +const ( + STACK_TYPE = "stack" +) + +type Stack struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` + + Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` + + Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Group string `json:"group,omitempty" yaml:"group,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Outputs map[string]interface{} `json:"outputs,omitempty" yaml:"outputs,omitempty"` + + PreviousEnvironment map[string]interface{} `json:"previousEnvironment,omitempty" yaml:"previous_environment,omitempty"` + + PreviousExternalId string `json:"previousExternalId,omitempty" yaml:"previous_external_id,omitempty"` + + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,omitempty"` + + Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type StackCollection struct { + Collection + Data []Stack `json:"data,omitempty"` + client *StackClient +} + +type StackClient struct { + rancherClient *RancherClient +} + +type StackOperations interface { + List(opts *ListOpts) (*StackCollection, error) + Create(opts *Stack) (*Stack, error) + Update(existing *Stack, updates interface{}) (*Stack, error) + ById(id string) (*Stack, error) + Delete(container *Stack) error + + ActionActivateservices(*Stack) (*Stack, error) + + ActionAddoutputs(*Stack, *AddOutputsInput) (*Stack, error) + + ActionCancelupgrade(*Stack) (*Stack, error) + + ActionCreate(*Stack) (*Stack, error) + + ActionDeactivateservices(*Stack) (*Stack, error) + + ActionError(*Stack) (*Stack, error) + + ActionExportconfig(*Stack, *ComposeConfigInput) (*ComposeConfig, error) + + ActionFinishupgrade(*Stack) (*Stack, error) + + ActionRemove(*Stack) (*Stack, error) + + ActionRollback(*Stack) (*Stack, error) + + ActionUpdate(*Stack) (*Stack, error) + + ActionUpgrade(*Stack, *StackUpgrade) (*Stack, error) +} + +func newStackClient(rancherClient *RancherClient) *StackClient { + return &StackClient{ + rancherClient: rancherClient, + } +} + +func (c *StackClient) Create(container *Stack) (*Stack, error) { + resp := &Stack{} + err := c.rancherClient.doCreate(STACK_TYPE, container, resp) + return resp, err +} + +func (c *StackClient) Update(existing *Stack, updates interface{}) (*Stack, error) { + resp := &Stack{} + err := c.rancherClient.doUpdate(STACK_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *StackClient) List(opts *ListOpts) (*StackCollection, error) { + resp := &StackCollection{} + err := c.rancherClient.doList(STACK_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *StackCollection) Next() (*StackCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &StackCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *StackClient) ById(id string) (*Stack, error) { + resp := &Stack{} + err := c.rancherClient.doById(STACK_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *StackClient) Delete(container *Stack) error { + return c.rancherClient.doResourceDelete(STACK_TYPE, &container.Resource) +} + +func (c *StackClient) ActionActivateservices(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "activateservices", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionAddoutputs(resource *Stack, input *AddOutputsInput) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "addoutputs", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StackClient) ActionCancelupgrade(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionCreate(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionDeactivateservices(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "deactivateservices", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionError(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "error", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionExportconfig(resource *Stack, input *ComposeConfigInput) (*ComposeConfig, error) { + + resp := &ComposeConfig{} + + err := c.rancherClient.doAction(STACK_TYPE, "exportconfig", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StackClient) ActionFinishupgrade(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionRemove(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionRollback(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionUpdate(resource *Stack) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StackClient) ActionUpgrade(resource *Stack, input *StackUpgrade) (*Stack, error) { + + resp := &Stack{} + + err := c.rancherClient.doAction(STACK_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go new file mode 100644 index 000000000..f4f78185f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go @@ -0,0 +1,89 @@ +package client + +const ( + STACK_UPGRADE_TYPE = "stackUpgrade" +) + +type StackUpgrade struct { + Resource + + Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` + + DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` + + Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` + + Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` +} + +type StackUpgradeCollection struct { + Collection + Data []StackUpgrade `json:"data,omitempty"` + client *StackUpgradeClient +} + +type StackUpgradeClient struct { + rancherClient *RancherClient +} + +type StackUpgradeOperations interface { + List(opts *ListOpts) (*StackUpgradeCollection, error) + Create(opts *StackUpgrade) (*StackUpgrade, error) + Update(existing *StackUpgrade, updates interface{}) (*StackUpgrade, error) + ById(id string) (*StackUpgrade, error) + Delete(container *StackUpgrade) error +} + +func newStackUpgradeClient(rancherClient *RancherClient) *StackUpgradeClient { + return &StackUpgradeClient{ + rancherClient: rancherClient, + } +} + +func (c *StackUpgradeClient) Create(container *StackUpgrade) (*StackUpgrade, error) { + resp := &StackUpgrade{} + err := c.rancherClient.doCreate(STACK_UPGRADE_TYPE, container, resp) + return resp, err +} + +func (c *StackUpgradeClient) Update(existing *StackUpgrade, updates interface{}) (*StackUpgrade, error) { + resp := &StackUpgrade{} + err := c.rancherClient.doUpdate(STACK_UPGRADE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *StackUpgradeClient) List(opts *ListOpts) (*StackUpgradeCollection, error) { + resp := &StackUpgradeCollection{} + err := c.rancherClient.doList(STACK_UPGRADE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *StackUpgradeCollection) Next() (*StackUpgradeCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &StackUpgradeCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *StackUpgradeClient) ById(id string) (*StackUpgrade, error) { + resp := &StackUpgrade{} + err := c.rancherClient.doById(STACK_UPGRADE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *StackUpgradeClient) Delete(container *StackUpgrade) error { + return c.rancherClient.doResourceDelete(STACK_UPGRADE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_state_transition.go b/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_state_transition.go rename to vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_stats_access.go b/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_stats_access.go rename to vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go new file mode 100644 index 000000000..bf54aa4f3 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go @@ -0,0 +1,168 @@ +package client + +const ( + STORAGE_DRIVER_TYPE = "storageDriver" +) + +type StorageDriver struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + BlockDevicePath string `json:"blockDevicePath,omitempty" yaml:"block_device_path,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + Scope string `json:"scope,omitempty" yaml:"scope,omitempty"` + + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` + + VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` +} + +type StorageDriverCollection struct { + Collection + Data []StorageDriver `json:"data,omitempty"` + client *StorageDriverClient +} + +type StorageDriverClient struct { + rancherClient *RancherClient +} + +type StorageDriverOperations interface { + List(opts *ListOpts) (*StorageDriverCollection, error) + Create(opts *StorageDriver) (*StorageDriver, error) + Update(existing *StorageDriver, updates interface{}) (*StorageDriver, error) + ById(id string) (*StorageDriver, error) + Delete(container *StorageDriver) error + + ActionActivate(*StorageDriver) (*StorageDriver, error) + + ActionCreate(*StorageDriver) (*StorageDriver, error) + + ActionDeactivate(*StorageDriver) (*StorageDriver, error) + + ActionRemove(*StorageDriver) (*StorageDriver, error) + + ActionUpdate(*StorageDriver) (*StorageDriver, error) +} + +func newStorageDriverClient(rancherClient *RancherClient) *StorageDriverClient { + return &StorageDriverClient{ + rancherClient: rancherClient, + } +} + +func (c *StorageDriverClient) Create(container *StorageDriver) (*StorageDriver, error) { + resp := &StorageDriver{} + err := c.rancherClient.doCreate(STORAGE_DRIVER_TYPE, container, resp) + return resp, err +} + +func (c *StorageDriverClient) Update(existing *StorageDriver, updates interface{}) (*StorageDriver, error) { + resp := &StorageDriver{} + err := c.rancherClient.doUpdate(STORAGE_DRIVER_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *StorageDriverClient) List(opts *ListOpts) (*StorageDriverCollection, error) { + resp := &StorageDriverCollection{} + err := c.rancherClient.doList(STORAGE_DRIVER_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *StorageDriverCollection) Next() (*StorageDriverCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &StorageDriverCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *StorageDriverClient) ById(id string) (*StorageDriver, error) { + resp := &StorageDriver{} + err := c.rancherClient.doById(STORAGE_DRIVER_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *StorageDriverClient) Delete(container *StorageDriver) error { + return c.rancherClient.doResourceDelete(STORAGE_DRIVER_TYPE, &container.Resource) +} + +func (c *StorageDriverClient) ActionActivate(resource *StorageDriver) (*StorageDriver, error) { + + resp := &StorageDriver{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverClient) ActionCreate(resource *StorageDriver) (*StorageDriver, error) { + + resp := &StorageDriver{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverClient) ActionDeactivate(resource *StorageDriver) (*StorageDriver, error) { + + resp := &StorageDriver{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverClient) ActionRemove(resource *StorageDriver) (*StorageDriver, error) { + + resp := &StorageDriver{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverClient) ActionUpdate(resource *StorageDriver) (*StorageDriver, error) { + + resp := &StorageDriver{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go new file mode 100644 index 000000000..9fbc365ea --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go @@ -0,0 +1,305 @@ +package client + +const ( + STORAGE_DRIVER_SERVICE_TYPE = "storageDriverService" +) + +type StorageDriverService struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` + + CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + + Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` + + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + + InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` + + LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` + + LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` + + Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` + + Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` + + ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` + + SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` + + SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` + + SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + + StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + StorageDriver StorageDriver `json:"storageDriver,omitempty" yaml:"storage_driver,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` +} + +type StorageDriverServiceCollection struct { + Collection + Data []StorageDriverService `json:"data,omitempty"` + client *StorageDriverServiceClient +} + +type StorageDriverServiceClient struct { + rancherClient *RancherClient +} + +type StorageDriverServiceOperations interface { + List(opts *ListOpts) (*StorageDriverServiceCollection, error) + Create(opts *StorageDriverService) (*StorageDriverService, error) + Update(existing *StorageDriverService, updates interface{}) (*StorageDriverService, error) + ById(id string) (*StorageDriverService, error) + Delete(container *StorageDriverService) error + + ActionActivate(*StorageDriverService) (*Service, error) + + ActionAddservicelink(*StorageDriverService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionCancelupgrade(*StorageDriverService) (*Service, error) + + ActionContinueupgrade(*StorageDriverService) (*Service, error) + + ActionCreate(*StorageDriverService) (*Service, error) + + ActionDeactivate(*StorageDriverService) (*Service, error) + + ActionFinishupgrade(*StorageDriverService) (*Service, error) + + ActionRemove(*StorageDriverService) (*Service, error) + + ActionRemoveservicelink(*StorageDriverService, *AddRemoveServiceLinkInput) (*Service, error) + + ActionRestart(*StorageDriverService, *ServiceRestart) (*Service, error) + + ActionRollback(*StorageDriverService) (*Service, error) + + ActionSetservicelinks(*StorageDriverService, *SetServiceLinksInput) (*Service, error) + + ActionUpdate(*StorageDriverService) (*Service, error) + + ActionUpgrade(*StorageDriverService, *ServiceUpgrade) (*Service, error) +} + +func newStorageDriverServiceClient(rancherClient *RancherClient) *StorageDriverServiceClient { + return &StorageDriverServiceClient{ + rancherClient: rancherClient, + } +} + +func (c *StorageDriverServiceClient) Create(container *StorageDriverService) (*StorageDriverService, error) { + resp := &StorageDriverService{} + err := c.rancherClient.doCreate(STORAGE_DRIVER_SERVICE_TYPE, container, resp) + return resp, err +} + +func (c *StorageDriverServiceClient) Update(existing *StorageDriverService, updates interface{}) (*StorageDriverService, error) { + resp := &StorageDriverService{} + err := c.rancherClient.doUpdate(STORAGE_DRIVER_SERVICE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *StorageDriverServiceClient) List(opts *ListOpts) (*StorageDriverServiceCollection, error) { + resp := &StorageDriverServiceCollection{} + err := c.rancherClient.doList(STORAGE_DRIVER_SERVICE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *StorageDriverServiceCollection) Next() (*StorageDriverServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &StorageDriverServiceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *StorageDriverServiceClient) ById(id string) (*StorageDriverService, error) { + resp := &StorageDriverService{} + err := c.rancherClient.doById(STORAGE_DRIVER_SERVICE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *StorageDriverServiceClient) Delete(container *StorageDriverService) error { + return c.rancherClient.doResourceDelete(STORAGE_DRIVER_SERVICE_TYPE, &container.Resource) +} + +func (c *StorageDriverServiceClient) ActionActivate(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionAddservicelink(resource *StorageDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionCancelupgrade(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionContinueupgrade(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionCreate(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionDeactivate(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionFinishupgrade(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionRemove(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionRemoveservicelink(resource *StorageDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionRestart(resource *StorageDriverService, input *ServiceRestart) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "restart", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionRollback(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionSetservicelinks(resource *StorageDriverService, input *SetServiceLinksInput) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionUpdate(resource *StorageDriverService) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *StorageDriverServiceClient) ActionUpgrade(resource *StorageDriverService, input *ServiceUpgrade) (*Service, error) { + + resp := &Service{} + + err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_storage_pool.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go similarity index 94% rename from vendor/github.com/rancher/go-rancher/client/generated_storage_pool.go rename to vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go index 92448dedf..e77c38211 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_storage_pool.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go @@ -21,6 +21,8 @@ type StoragePool struct { ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + HostIds []string `json:"hostIds,omitempty" yaml:"host_ids,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` @@ -31,6 +33,8 @@ type StoragePool struct { State string `json:"state,omitempty" yaml:"state,omitempty"` + StorageDriverId string `json:"storageDriverId,omitempty" yaml:"storage_driver_id,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -42,6 +46,8 @@ type StoragePool struct { VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` + + VolumeIds []string `json:"volumeIds,omitempty" yaml:"volume_ids,omitempty"` } type StoragePoolCollection struct { @@ -71,8 +77,6 @@ type StoragePoolOperations interface { ActionRemove(*StoragePool) (*StoragePool, error) - ActionRestore(*StoragePool) (*StoragePool, error) - ActionUpdate(*StoragePool) (*StoragePool, error) } @@ -171,15 +175,6 @@ func (c *StoragePoolClient) ActionRemove(resource *StoragePool) (*StoragePool, e return resp, err } -func (c *StoragePoolClient) ActionRestore(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *StoragePoolClient) ActionUpdate(resource *StoragePool) (*StoragePool, error) { resp := &StoragePool{} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go b/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go new file mode 100644 index 000000000..f1a729700 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go @@ -0,0 +1,181 @@ +package client + +const ( + SUBNET_TYPE = "subnet" +) + +type Subnet struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + CidrSize int64 `json:"cidrSize,omitempty" yaml:"cidr_size,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + EndAddress string `json:"endAddress,omitempty" yaml:"end_address,omitempty"` + + Gateway string `json:"gateway,omitempty" yaml:"gateway,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + NetworkAddress string `json:"networkAddress,omitempty" yaml:"network_address,omitempty"` + + NetworkId string `json:"networkId,omitempty" yaml:"network_id,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + StartAddress string `json:"startAddress,omitempty" yaml:"start_address,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type SubnetCollection struct { + Collection + Data []Subnet `json:"data,omitempty"` + client *SubnetClient +} + +type SubnetClient struct { + rancherClient *RancherClient +} + +type SubnetOperations interface { + List(opts *ListOpts) (*SubnetCollection, error) + Create(opts *Subnet) (*Subnet, error) + Update(existing *Subnet, updates interface{}) (*Subnet, error) + ById(id string) (*Subnet, error) + Delete(container *Subnet) error + + ActionActivate(*Subnet) (*Subnet, error) + + ActionCreate(*Subnet) (*Subnet, error) + + ActionDeactivate(*Subnet) (*Subnet, error) + + ActionPurge(*Subnet) (*Subnet, error) + + ActionRemove(*Subnet) (*Subnet, error) + + ActionUpdate(*Subnet) (*Subnet, error) +} + +func newSubnetClient(rancherClient *RancherClient) *SubnetClient { + return &SubnetClient{ + rancherClient: rancherClient, + } +} + +func (c *SubnetClient) Create(container *Subnet) (*Subnet, error) { + resp := &Subnet{} + err := c.rancherClient.doCreate(SUBNET_TYPE, container, resp) + return resp, err +} + +func (c *SubnetClient) Update(existing *Subnet, updates interface{}) (*Subnet, error) { + resp := &Subnet{} + err := c.rancherClient.doUpdate(SUBNET_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SubnetClient) List(opts *ListOpts) (*SubnetCollection, error) { + resp := &SubnetCollection{} + err := c.rancherClient.doList(SUBNET_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *SubnetCollection) Next() (*SubnetCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SubnetCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *SubnetClient) ById(id string) (*Subnet, error) { + resp := &Subnet{} + err := c.rancherClient.doById(SUBNET_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *SubnetClient) Delete(container *Subnet) error { + return c.rancherClient.doResourceDelete(SUBNET_TYPE, &container.Resource) +} + +func (c *SubnetClient) ActionActivate(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SubnetClient) ActionCreate(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SubnetClient) ActionDeactivate(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SubnetClient) ActionPurge(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SubnetClient) ActionRemove(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *SubnetClient) ActionUpdate(resource *Subnet) (*Subnet, error) { + + resp := &Subnet{} + + err := c.rancherClient.doAction(SUBNET_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go b/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go new file mode 100644 index 000000000..2acc18066 --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go @@ -0,0 +1,85 @@ +package client + +const ( + TARGET_PORT_RULE_TYPE = "targetPortRule" +) + +type TargetPortRule struct { + Resource + + BackendName string `json:"backendName,omitempty" yaml:"backend_name,omitempty"` + + Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` + + Path string `json:"path,omitempty" yaml:"path,omitempty"` + + TargetPort int64 `json:"targetPort,omitempty" yaml:"target_port,omitempty"` +} + +type TargetPortRuleCollection struct { + Collection + Data []TargetPortRule `json:"data,omitempty"` + client *TargetPortRuleClient +} + +type TargetPortRuleClient struct { + rancherClient *RancherClient +} + +type TargetPortRuleOperations interface { + List(opts *ListOpts) (*TargetPortRuleCollection, error) + Create(opts *TargetPortRule) (*TargetPortRule, error) + Update(existing *TargetPortRule, updates interface{}) (*TargetPortRule, error) + ById(id string) (*TargetPortRule, error) + Delete(container *TargetPortRule) error +} + +func newTargetPortRuleClient(rancherClient *RancherClient) *TargetPortRuleClient { + return &TargetPortRuleClient{ + rancherClient: rancherClient, + } +} + +func (c *TargetPortRuleClient) Create(container *TargetPortRule) (*TargetPortRule, error) { + resp := &TargetPortRule{} + err := c.rancherClient.doCreate(TARGET_PORT_RULE_TYPE, container, resp) + return resp, err +} + +func (c *TargetPortRuleClient) Update(existing *TargetPortRule, updates interface{}) (*TargetPortRule, error) { + resp := &TargetPortRule{} + err := c.rancherClient.doUpdate(TARGET_PORT_RULE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *TargetPortRuleClient) List(opts *ListOpts) (*TargetPortRuleCollection, error) { + resp := &TargetPortRuleCollection{} + err := c.rancherClient.doList(TARGET_PORT_RULE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *TargetPortRuleCollection) Next() (*TargetPortRuleCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &TargetPortRuleCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *TargetPortRuleClient) ById(id string) (*TargetPortRule, error) { + resp := &TargetPortRule{} + err := c.rancherClient.doById(TARGET_PORT_RULE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *TargetPortRuleClient) Delete(container *TargetPortRule) error { + return c.rancherClient.doResourceDelete(TARGET_PORT_RULE_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_task.go b/vendor/github.com/rancher/go-rancher/v2/generated_task.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_task.go rename to vendor/github.com/rancher/go-rancher/v2/generated_task.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_task_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_task_instance.go rename to vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_to_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_to_service_upgrade_strategy.go rename to vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_type_documentation.go b/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_type_documentation.go rename to vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go b/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go new file mode 100644 index 000000000..7449c263b --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go @@ -0,0 +1,83 @@ +package client + +const ( + ULIMIT_TYPE = "ulimit" +) + +type Ulimit struct { + Resource + + Hard int64 `json:"hard,omitempty" yaml:"hard,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + Soft int64 `json:"soft,omitempty" yaml:"soft,omitempty"` +} + +type UlimitCollection struct { + Collection + Data []Ulimit `json:"data,omitempty"` + client *UlimitClient +} + +type UlimitClient struct { + rancherClient *RancherClient +} + +type UlimitOperations interface { + List(opts *ListOpts) (*UlimitCollection, error) + Create(opts *Ulimit) (*Ulimit, error) + Update(existing *Ulimit, updates interface{}) (*Ulimit, error) + ById(id string) (*Ulimit, error) + Delete(container *Ulimit) error +} + +func newUlimitClient(rancherClient *RancherClient) *UlimitClient { + return &UlimitClient{ + rancherClient: rancherClient, + } +} + +func (c *UlimitClient) Create(container *Ulimit) (*Ulimit, error) { + resp := &Ulimit{} + err := c.rancherClient.doCreate(ULIMIT_TYPE, container, resp) + return resp, err +} + +func (c *UlimitClient) Update(existing *Ulimit, updates interface{}) (*Ulimit, error) { + resp := &Ulimit{} + err := c.rancherClient.doUpdate(ULIMIT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *UlimitClient) List(opts *ListOpts) (*UlimitCollection, error) { + resp := &UlimitCollection{} + err := c.rancherClient.doList(ULIMIT_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *UlimitCollection) Next() (*UlimitCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &UlimitCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *UlimitClient) ById(id string) (*Ulimit, error) { + resp := &Ulimit{} + err := c.rancherClient.doById(ULIMIT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *UlimitClient) Delete(container *Ulimit) error { + return c.rancherClient.doResourceDelete(ULIMIT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_user_preference.go b/vendor/github.com/rancher/go-rancher/v2/generated_user_preference.go new file mode 100644 index 000000000..815b87ddf --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_user_preference.go @@ -0,0 +1,173 @@ +package client + +const ( + USER_PREFERENCE_TYPE = "userPreference" +) + +type UserPreference struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + All bool `json:"all,omitempty" yaml:"all,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + Value string `json:"value,omitempty" yaml:"value,omitempty"` +} + +type UserPreferenceCollection struct { + Collection + Data []UserPreference `json:"data,omitempty"` + client *UserPreferenceClient +} + +type UserPreferenceClient struct { + rancherClient *RancherClient +} + +type UserPreferenceOperations interface { + List(opts *ListOpts) (*UserPreferenceCollection, error) + Create(opts *UserPreference) (*UserPreference, error) + Update(existing *UserPreference, updates interface{}) (*UserPreference, error) + ById(id string) (*UserPreference, error) + Delete(container *UserPreference) error + + ActionActivate(*UserPreference) (*UserPreference, error) + + ActionCreate(*UserPreference) (*UserPreference, error) + + ActionDeactivate(*UserPreference) (*UserPreference, error) + + ActionPurge(*UserPreference) (*UserPreference, error) + + ActionRemove(*UserPreference) (*UserPreference, error) + + ActionUpdate(*UserPreference) (*UserPreference, error) +} + +func newUserPreferenceClient(rancherClient *RancherClient) *UserPreferenceClient { + return &UserPreferenceClient{ + rancherClient: rancherClient, + } +} + +func (c *UserPreferenceClient) Create(container *UserPreference) (*UserPreference, error) { + resp := &UserPreference{} + err := c.rancherClient.doCreate(USER_PREFERENCE_TYPE, container, resp) + return resp, err +} + +func (c *UserPreferenceClient) Update(existing *UserPreference, updates interface{}) (*UserPreference, error) { + resp := &UserPreference{} + err := c.rancherClient.doUpdate(USER_PREFERENCE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *UserPreferenceClient) List(opts *ListOpts) (*UserPreferenceCollection, error) { + resp := &UserPreferenceCollection{} + err := c.rancherClient.doList(USER_PREFERENCE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *UserPreferenceCollection) Next() (*UserPreferenceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &UserPreferenceCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *UserPreferenceClient) ById(id string) (*UserPreference, error) { + resp := &UserPreference{} + err := c.rancherClient.doById(USER_PREFERENCE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *UserPreferenceClient) Delete(container *UserPreference) error { + return c.rancherClient.doResourceDelete(USER_PREFERENCE_TYPE, &container.Resource) +} + +func (c *UserPreferenceClient) ActionActivate(resource *UserPreference) (*UserPreference, error) { + + resp := &UserPreference{} + + err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *UserPreferenceClient) ActionCreate(resource *UserPreference) (*UserPreference, error) { + + resp := &UserPreference{} + + err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *UserPreferenceClient) ActionDeactivate(resource *UserPreference) (*UserPreference, error) { + + resp := &UserPreference{} + + err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *UserPreferenceClient) ActionPurge(resource *UserPreference) (*UserPreference, error) { + + resp := &UserPreference{} + + err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *UserPreferenceClient) ActionRemove(resource *UserPreference) (*UserPreference, error) { + + resp := &UserPreference{} + + err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *UserPreferenceClient) ActionUpdate(resource *UserPreference) (*UserPreference, error) { + + resp := &UserPreference{} + + err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_virtual_machine.go b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go similarity index 75% rename from vendor/github.com/rancher/go-rancher/client/generated_virtual_machine.go rename to vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go index a41f3b5a6..69327b2f1 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_virtual_machine.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go @@ -15,12 +15,30 @@ type VirtualMachine struct { BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` + BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` + + CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` + Command []string `json:"command,omitempty" yaml:"command,omitempty"` Count int64 `json:"count,omitempty" yaml:"count,omitempty"` + CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` + + CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` + + CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` + + CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` + + CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` + + CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` + CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` + CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` + CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` @@ -33,10 +51,14 @@ type VirtualMachine struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` - Disks []interface{} `json:"disks,omitempty" yaml:"disks,omitempty"` + DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` + + Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` + DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` + DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` @@ -49,10 +71,20 @@ type VirtualMachine struct { FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` + GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` + HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` + HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` + + HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` + + HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` + HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` + HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` @@ -61,6 +93,22 @@ type VirtualMachine struct { InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` + InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` + + IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` + + IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` + + Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` + + Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` + + IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` + + Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` + + KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` @@ -71,20 +119,38 @@ type VirtualMachine struct { MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` + MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` + MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` + MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` + + MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` + + Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` + NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` + NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` + OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` + + OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` + + PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` + Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` + PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` + RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` @@ -95,15 +161,35 @@ type VirtualMachine struct { RestartPolicy *RestartPolicy `json:"restartPolicy,omitempty" yaml:"restart_policy,omitempty"` + RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` + SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` + ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` + + ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` + + ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` State string `json:"state,omitempty" yaml:"state,omitempty"` - SystemContainer string `json:"systemContainer,omitempty" yaml:"system_container,omitempty"` + StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` + + StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` + + StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` + + Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` + + System bool `json:"system,omitempty" yaml:"system,omitempty"` + + Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` Token string `json:"token,omitempty" yaml:"token,omitempty"` @@ -113,8 +199,16 @@ type VirtualMachine struct { TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` + + UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` + Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` + UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` + + Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` @@ -165,10 +259,6 @@ type VirtualMachineOperations interface { ActionRestart(*VirtualMachine) (*Instance, error) - ActionRestore(*VirtualMachine) (*Instance, error) - - ActionSetlabels(*VirtualMachine, *SetLabelsInput) (*Container, error) - ActionStart(*VirtualMachine) (*Instance, error) ActionStop(*VirtualMachine, *InstanceStop) (*Instance, error) @@ -340,24 +430,6 @@ func (c *VirtualMachineClient) ActionRestart(resource *VirtualMachine) (*Instanc return resp, err } -func (c *VirtualMachineClient) ActionRestore(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionSetlabels(resource *VirtualMachine, input *SetLabelsInput) (*Container, error) { - - resp := &Container{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "setlabels", &resource.Resource, input, resp) - - return resp, err -} - func (c *VirtualMachineClient) ActionStart(resource *VirtualMachine) (*Instance, error) { resp := &Instance{} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_virtual_machine_disk.go b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_virtual_machine_disk.go rename to vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go diff --git a/vendor/github.com/rancher/go-rancher/client/generated_volume.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume.go similarity index 92% rename from vendor/github.com/rancher/go-rancher/client/generated_volume.go rename to vendor/github.com/rancher/go-rancher/v2/generated_volume.go index 02ea2e518..00b4e5dd4 100644 --- a/vendor/github.com/rancher/go-rancher/client/generated_volume.go +++ b/vendor/github.com/rancher/go-rancher/v2/generated_volume.go @@ -23,6 +23,8 @@ type Volume struct { ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` + ImageId string `json:"imageId,omitempty" yaml:"image_id,omitempty"` InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` @@ -31,14 +33,22 @@ type Volume struct { Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + SizeMb int64 `json:"sizeMb,omitempty" yaml:"size_mb,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + StorageDriverId string `json:"storageDriverId,omitempty" yaml:"storage_driver_id,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` @@ -48,6 +58,8 @@ type Volume struct { Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + + VolumeTemplateId string `json:"volumeTemplateId,omitempty" yaml:"volume_template_id,omitempty"` } type VolumeCollection struct { @@ -67,8 +79,6 @@ type VolumeOperations interface { ById(id string) (*Volume, error) Delete(container *Volume) error - ActionActivate(*Volume) (*Volume, error) - ActionAllocate(*Volume) (*Volume, error) ActionCreate(*Volume) (*Volume, error) @@ -79,8 +89,6 @@ type VolumeOperations interface { ActionRemove(*Volume) (*Volume, error) - ActionRestore(*Volume) (*Volume, error) - ActionRestorefrombackup(*Volume, *RestoreFromBackupInput) (*Volume, error) ActionReverttosnapshot(*Volume, *RevertToSnapshotInput) (*Volume, error) @@ -140,15 +148,6 @@ func (c *VolumeClient) Delete(container *Volume) error { return c.rancherClient.doResourceDelete(VOLUME_TYPE, &container.Resource) } -func (c *VolumeClient) ActionActivate(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - func (c *VolumeClient) ActionAllocate(resource *Volume) (*Volume, error) { resp := &Volume{} @@ -194,15 +193,6 @@ func (c *VolumeClient) ActionRemove(resource *Volume) (*Volume, error) { return resp, err } -func (c *VolumeClient) ActionRestore(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "restore", &resource.Resource, nil, resp) - - return resp, err -} - func (c *VolumeClient) ActionRestorefrombackup(resource *Volume, input *RestoreFromBackupInput) (*Volume, error) { resp := &Volume{} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go new file mode 100644 index 000000000..be4269a6e --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go @@ -0,0 +1,79 @@ +package client + +const ( + VOLUME_ACTIVATE_INPUT_TYPE = "volumeActivateInput" +) + +type VolumeActivateInput struct { + Resource + + HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` +} + +type VolumeActivateInputCollection struct { + Collection + Data []VolumeActivateInput `json:"data,omitempty"` + client *VolumeActivateInputClient +} + +type VolumeActivateInputClient struct { + rancherClient *RancherClient +} + +type VolumeActivateInputOperations interface { + List(opts *ListOpts) (*VolumeActivateInputCollection, error) + Create(opts *VolumeActivateInput) (*VolumeActivateInput, error) + Update(existing *VolumeActivateInput, updates interface{}) (*VolumeActivateInput, error) + ById(id string) (*VolumeActivateInput, error) + Delete(container *VolumeActivateInput) error +} + +func newVolumeActivateInputClient(rancherClient *RancherClient) *VolumeActivateInputClient { + return &VolumeActivateInputClient{ + rancherClient: rancherClient, + } +} + +func (c *VolumeActivateInputClient) Create(container *VolumeActivateInput) (*VolumeActivateInput, error) { + resp := &VolumeActivateInput{} + err := c.rancherClient.doCreate(VOLUME_ACTIVATE_INPUT_TYPE, container, resp) + return resp, err +} + +func (c *VolumeActivateInputClient) Update(existing *VolumeActivateInput, updates interface{}) (*VolumeActivateInput, error) { + resp := &VolumeActivateInput{} + err := c.rancherClient.doUpdate(VOLUME_ACTIVATE_INPUT_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *VolumeActivateInputClient) List(opts *ListOpts) (*VolumeActivateInputCollection, error) { + resp := &VolumeActivateInputCollection{} + err := c.rancherClient.doList(VOLUME_ACTIVATE_INPUT_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *VolumeActivateInputCollection) Next() (*VolumeActivateInputCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &VolumeActivateInputCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *VolumeActivateInputClient) ById(id string) (*VolumeActivateInput, error) { + resp := &VolumeActivateInput{} + err := c.rancherClient.doById(VOLUME_ACTIVATE_INPUT_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *VolumeActivateInputClient) Delete(container *VolumeActivateInput) error { + return c.rancherClient.doResourceDelete(VOLUME_ACTIVATE_INPUT_TYPE, &container.Resource) +} diff --git a/vendor/github.com/rancher/go-rancher/client/generated_volume_snapshot_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/generated_volume_snapshot_input.go rename to vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go new file mode 100644 index 000000000..a7479127f --- /dev/null +++ b/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go @@ -0,0 +1,179 @@ +package client + +const ( + VOLUME_TEMPLATE_TYPE = "volumeTemplate" +) + +type VolumeTemplate struct { + Resource + + AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` + + Created string `json:"created,omitempty" yaml:"created,omitempty"` + + Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` + + Description string `json:"description,omitempty" yaml:"description,omitempty"` + + Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` + + DriverOpts map[string]interface{} `json:"driverOpts,omitempty" yaml:"driver_opts,omitempty"` + + External bool `json:"external,omitempty" yaml:"external,omitempty"` + + Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` + + Name string `json:"name,omitempty" yaml:"name,omitempty"` + + PerContainer bool `json:"perContainer,omitempty" yaml:"per_container,omitempty"` + + RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` + + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + + StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` + + State string `json:"state,omitempty" yaml:"state,omitempty"` + + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` + + TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` + + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type VolumeTemplateCollection struct { + Collection + Data []VolumeTemplate `json:"data,omitempty"` + client *VolumeTemplateClient +} + +type VolumeTemplateClient struct { + rancherClient *RancherClient +} + +type VolumeTemplateOperations interface { + List(opts *ListOpts) (*VolumeTemplateCollection, error) + Create(opts *VolumeTemplate) (*VolumeTemplate, error) + Update(existing *VolumeTemplate, updates interface{}) (*VolumeTemplate, error) + ById(id string) (*VolumeTemplate, error) + Delete(container *VolumeTemplate) error + + ActionActivate(*VolumeTemplate) (*VolumeTemplate, error) + + ActionCreate(*VolumeTemplate) (*VolumeTemplate, error) + + ActionDeactivate(*VolumeTemplate) (*VolumeTemplate, error) + + ActionPurge(*VolumeTemplate) (*VolumeTemplate, error) + + ActionRemove(*VolumeTemplate) (*VolumeTemplate, error) + + ActionUpdate(*VolumeTemplate) (*VolumeTemplate, error) +} + +func newVolumeTemplateClient(rancherClient *RancherClient) *VolumeTemplateClient { + return &VolumeTemplateClient{ + rancherClient: rancherClient, + } +} + +func (c *VolumeTemplateClient) Create(container *VolumeTemplate) (*VolumeTemplate, error) { + resp := &VolumeTemplate{} + err := c.rancherClient.doCreate(VOLUME_TEMPLATE_TYPE, container, resp) + return resp, err +} + +func (c *VolumeTemplateClient) Update(existing *VolumeTemplate, updates interface{}) (*VolumeTemplate, error) { + resp := &VolumeTemplate{} + err := c.rancherClient.doUpdate(VOLUME_TEMPLATE_TYPE, &existing.Resource, updates, resp) + return resp, err +} + +func (c *VolumeTemplateClient) List(opts *ListOpts) (*VolumeTemplateCollection, error) { + resp := &VolumeTemplateCollection{} + err := c.rancherClient.doList(VOLUME_TEMPLATE_TYPE, opts, resp) + resp.client = c + return resp, err +} + +func (cc *VolumeTemplateCollection) Next() (*VolumeTemplateCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &VolumeTemplateCollection{} + err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *VolumeTemplateClient) ById(id string) (*VolumeTemplate, error) { + resp := &VolumeTemplate{} + err := c.rancherClient.doById(VOLUME_TEMPLATE_TYPE, id, resp) + if apiError, ok := err.(*ApiError); ok { + if apiError.StatusCode == 404 { + return nil, nil + } + } + return resp, err +} + +func (c *VolumeTemplateClient) Delete(container *VolumeTemplate) error { + return c.rancherClient.doResourceDelete(VOLUME_TEMPLATE_TYPE, &container.Resource) +} + +func (c *VolumeTemplateClient) ActionActivate(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "activate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeTemplateClient) ActionCreate(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "create", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeTemplateClient) ActionDeactivate(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "deactivate", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeTemplateClient) ActionPurge(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "purge", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeTemplateClient) ActionRemove(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "remove", &resource.Resource, nil, resp) + + return resp, err +} + +func (c *VolumeTemplateClient) ActionUpdate(resource *VolumeTemplate) (*VolumeTemplate, error) { + + resp := &VolumeTemplate{} + + err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "update", &resource.Resource, nil, resp) + + return resp, err +} diff --git a/vendor/github.com/rancher/go-rancher/client/schemas.go b/vendor/github.com/rancher/go-rancher/v2/schemas.go similarity index 95% rename from vendor/github.com/rancher/go-rancher/client/schemas.go rename to vendor/github.com/rancher/go-rancher/v2/schemas.go index 3896e6a54..bcb6a7ec5 100644 --- a/vendor/github.com/rancher/go-rancher/client/schemas.go +++ b/vendor/github.com/rancher/go-rancher/v2/schemas.go @@ -28,7 +28,7 @@ func (s *Schema) Field(name string) Field { func (s *Schemas) CheckSchema(name string) (Schema, bool) { for i := range s.Data { - if strings.ToLower(s.Data[i].Id) == strings.ToLower(name) { + if s.Data[i].Id == name { return s.Data[i], true } } @@ -56,6 +56,8 @@ func typeToFields(t reflect.Type) map[string]Field { continue } else if typeField.Anonymous { continue + } else if privateFieldRegex.FindStringIndex(typeField.Name) != nil { + continue } fieldString := strings.ToLower(typeField.Type.Kind().String()) @@ -75,9 +77,6 @@ func typeToFields(t reflect.Type) map[string]Field { case fieldString == "slice": // HACK schemaField.Type = "array[string]" - case fieldString == "struct": - schemaField.Type = typeField.Type.String() - } name := strings.Split(typeField.Tag.Get("json"), ",")[0] diff --git a/vendor/github.com/rancher/go-rancher/client/types.go b/vendor/github.com/rancher/go-rancher/v2/types.go similarity index 100% rename from vendor/github.com/rancher/go-rancher/client/types.go rename to vendor/github.com/rancher/go-rancher/v2/types.go