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
81
vendor/github.com/rancher/go-rancher/v2/generated_host_access.go
generated
vendored
Normal file
81
vendor/github.com/rancher/go-rancher/v2/generated_host_access.go
generated
vendored
Normal file
|
@ -0,0 +1,81 @@
|
|||
package client
|
||||
|
||||
const (
|
||||
HOST_ACCESS_TYPE = "hostAccess"
|
||||
)
|
||||
|
||||
type HostAccess struct {
|
||||
Resource
|
||||
|
||||
Token string `json:"token,omitempty" yaml:"token,omitempty"`
|
||||
|
||||
Url string `json:"url,omitempty" yaml:"url,omitempty"`
|
||||
}
|
||||
|
||||
type HostAccessCollection struct {
|
||||
Collection
|
||||
Data []HostAccess `json:"data,omitempty"`
|
||||
client *HostAccessClient
|
||||
}
|
||||
|
||||
type HostAccessClient struct {
|
||||
rancherClient *RancherClient
|
||||
}
|
||||
|
||||
type HostAccessOperations interface {
|
||||
List(opts *ListOpts) (*HostAccessCollection, error)
|
||||
Create(opts *HostAccess) (*HostAccess, error)
|
||||
Update(existing *HostAccess, updates interface{}) (*HostAccess, error)
|
||||
ById(id string) (*HostAccess, error)
|
||||
Delete(container *HostAccess) error
|
||||
}
|
||||
|
||||
func newHostAccessClient(rancherClient *RancherClient) *HostAccessClient {
|
||||
return &HostAccessClient{
|
||||
rancherClient: rancherClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *HostAccessClient) Create(container *HostAccess) (*HostAccess, error) {
|
||||
resp := &HostAccess{}
|
||||
err := c.rancherClient.doCreate(HOST_ACCESS_TYPE, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *HostAccessClient) Update(existing *HostAccess, updates interface{}) (*HostAccess, error) {
|
||||
resp := &HostAccess{}
|
||||
err := c.rancherClient.doUpdate(HOST_ACCESS_TYPE, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *HostAccessClient) List(opts *ListOpts) (*HostAccessCollection, error) {
|
||||
resp := &HostAccessCollection{}
|
||||
err := c.rancherClient.doList(HOST_ACCESS_TYPE, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *HostAccessCollection) Next() (*HostAccessCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &HostAccessCollection{}
|
||||
err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *HostAccessClient) ById(id string) (*HostAccess, error) {
|
||||
resp := &HostAccess{}
|
||||
err := c.rancherClient.doById(HOST_ACCESS_TYPE, id, resp)
|
||||
if apiError, ok := err.(*ApiError); ok {
|
||||
if apiError.StatusCode == 404 {
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *HostAccessClient) Delete(container *HostAccess) error {
|
||||
return c.rancherClient.doResourceDelete(HOST_ACCESS_TYPE, &container.Resource)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue