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
91
vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go
generated
vendored
Normal file
91
vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go
generated
vendored
Normal file
|
@ -0,0 +1,91 @@
|
|||
package client
|
||||
|
||||
const (
|
||||
PROCESS_DEFINITION_TYPE = "processDefinition"
|
||||
)
|
||||
|
||||
type ProcessDefinition struct {
|
||||
Resource
|
||||
|
||||
ExtensionBased bool `json:"extensionBased,omitempty" yaml:"extension_based,omitempty"`
|
||||
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
|
||||
PostProcessListeners interface{} `json:"postProcessListeners,omitempty" yaml:"post_process_listeners,omitempty"`
|
||||
|
||||
PreProcessListeners interface{} `json:"preProcessListeners,omitempty" yaml:"pre_process_listeners,omitempty"`
|
||||
|
||||
ProcessHandlers interface{} `json:"processHandlers,omitempty" yaml:"process_handlers,omitempty"`
|
||||
|
||||
ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"`
|
||||
|
||||
StateTransitions []StateTransition `json:"stateTransitions,omitempty" yaml:"state_transitions,omitempty"`
|
||||
}
|
||||
|
||||
type ProcessDefinitionCollection struct {
|
||||
Collection
|
||||
Data []ProcessDefinition `json:"data,omitempty"`
|
||||
client *ProcessDefinitionClient
|
||||
}
|
||||
|
||||
type ProcessDefinitionClient struct {
|
||||
rancherClient *RancherClient
|
||||
}
|
||||
|
||||
type ProcessDefinitionOperations interface {
|
||||
List(opts *ListOpts) (*ProcessDefinitionCollection, error)
|
||||
Create(opts *ProcessDefinition) (*ProcessDefinition, error)
|
||||
Update(existing *ProcessDefinition, updates interface{}) (*ProcessDefinition, error)
|
||||
ById(id string) (*ProcessDefinition, error)
|
||||
Delete(container *ProcessDefinition) error
|
||||
}
|
||||
|
||||
func newProcessDefinitionClient(rancherClient *RancherClient) *ProcessDefinitionClient {
|
||||
return &ProcessDefinitionClient{
|
||||
rancherClient: rancherClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ProcessDefinitionClient) Create(container *ProcessDefinition) (*ProcessDefinition, error) {
|
||||
resp := &ProcessDefinition{}
|
||||
err := c.rancherClient.doCreate(PROCESS_DEFINITION_TYPE, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProcessDefinitionClient) Update(existing *ProcessDefinition, updates interface{}) (*ProcessDefinition, error) {
|
||||
resp := &ProcessDefinition{}
|
||||
err := c.rancherClient.doUpdate(PROCESS_DEFINITION_TYPE, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProcessDefinitionClient) List(opts *ListOpts) (*ProcessDefinitionCollection, error) {
|
||||
resp := &ProcessDefinitionCollection{}
|
||||
err := c.rancherClient.doList(PROCESS_DEFINITION_TYPE, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *ProcessDefinitionCollection) Next() (*ProcessDefinitionCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &ProcessDefinitionCollection{}
|
||||
err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *ProcessDefinitionClient) ById(id string) (*ProcessDefinition, error) {
|
||||
resp := &ProcessDefinition{}
|
||||
err := c.rancherClient.doById(PROCESS_DEFINITION_TYPE, id, resp)
|
||||
if apiError, ok := err.(*ApiError); ok {
|
||||
if apiError.StatusCode == 404 {
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProcessDefinitionClient) Delete(container *ProcessDefinition) error {
|
||||
return c.rancherClient.doResourceDelete(PROCESS_DEFINITION_TYPE, &container.Resource)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue