Update Rancher API integration to go-rancher client v2.
This commit is contained in:
parent
d89b234cad
commit
07c6e33598
188 changed files with 5349 additions and 1969 deletions
83
vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go
generated
vendored
Normal file
83
vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go
generated
vendored
Normal file
|
@ -0,0 +1,83 @@
|
|||
package client
|
||||
|
||||
const (
|
||||
INSTANCE_CONSOLE_TYPE = "instanceConsole"
|
||||
)
|
||||
|
||||
type InstanceConsole struct {
|
||||
Resource
|
||||
|
||||
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
|
||||
|
||||
Password string `json:"password,omitempty" yaml:"password,omitempty"`
|
||||
|
||||
Url string `json:"url,omitempty" yaml:"url,omitempty"`
|
||||
}
|
||||
|
||||
type InstanceConsoleCollection struct {
|
||||
Collection
|
||||
Data []InstanceConsole `json:"data,omitempty"`
|
||||
client *InstanceConsoleClient
|
||||
}
|
||||
|
||||
type InstanceConsoleClient struct {
|
||||
rancherClient *RancherClient
|
||||
}
|
||||
|
||||
type InstanceConsoleOperations interface {
|
||||
List(opts *ListOpts) (*InstanceConsoleCollection, error)
|
||||
Create(opts *InstanceConsole) (*InstanceConsole, error)
|
||||
Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error)
|
||||
ById(id string) (*InstanceConsole, error)
|
||||
Delete(container *InstanceConsole) error
|
||||
}
|
||||
|
||||
func newInstanceConsoleClient(rancherClient *RancherClient) *InstanceConsoleClient {
|
||||
return &InstanceConsoleClient{
|
||||
rancherClient: rancherClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *InstanceConsoleClient) Create(container *InstanceConsole) (*InstanceConsole, error) {
|
||||
resp := &InstanceConsole{}
|
||||
err := c.rancherClient.doCreate(INSTANCE_CONSOLE_TYPE, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *InstanceConsoleClient) Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error) {
|
||||
resp := &InstanceConsole{}
|
||||
err := c.rancherClient.doUpdate(INSTANCE_CONSOLE_TYPE, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *InstanceConsoleClient) List(opts *ListOpts) (*InstanceConsoleCollection, error) {
|
||||
resp := &InstanceConsoleCollection{}
|
||||
err := c.rancherClient.doList(INSTANCE_CONSOLE_TYPE, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *InstanceConsoleCollection) Next() (*InstanceConsoleCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &InstanceConsoleCollection{}
|
||||
err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *InstanceConsoleClient) ById(id string) (*InstanceConsole, error) {
|
||||
resp := &InstanceConsole{}
|
||||
err := c.rancherClient.doById(INSTANCE_CONSOLE_TYPE, id, resp)
|
||||
if apiError, ok := err.(*ApiError); ok {
|
||||
if apiError.StatusCode == 404 {
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *InstanceConsoleClient) Delete(container *InstanceConsole) error {
|
||||
return c.rancherClient.doResourceDelete(INSTANCE_CONSOLE_TYPE, &container.Resource)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue