1
0
mirror of https://github.com/rancher/types.git synced 2025-09-25 04:12:02 +00:00

Update generated code

This commit is contained in:
Darren Shepherd
2018-01-12 12:08:43 -07:00
parent fd99a3deec
commit ba910f717a
17 changed files with 1058 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ type Client struct {
Token TokenOperations
User UserOperations
DynamicSchema DynamicSchemaOperations
Stack StackOperations
}
func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
@@ -65,6 +66,7 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
client.Token = newTokenClient(client)
client.User = newUserClient(client)
client.DynamicSchema = newDynamicSchemaClient(client)
client.Stack = newStackClient(client)
return client, nil
}

View File

@@ -0,0 +1,18 @@
package client
const (
ReleaseInfoType = "releaseInfo"
ReleaseInfoFieldCreateTimestamp = "createTimestamp"
ReleaseInfoFieldModifiedAt = "modifiedAt"
ReleaseInfoFieldName = "name"
ReleaseInfoFieldTemplateVersionID = "templateVersionId"
ReleaseInfoFieldVersion = "version"
)
type ReleaseInfo struct {
CreateTimestamp string `json:"createTimestamp,omitempty"`
ModifiedAt string `json:"modifiedAt,omitempty"`
Name string `json:"name,omitempty"`
TemplateVersionID string `json:"templateVersionId,omitempty"`
Version string `json:"version,omitempty"`
}

View File

@@ -0,0 +1,121 @@
package client
import (
"github.com/rancher/norman/types"
)
const (
StackType = "stack"
StackFieldAnnotations = "annotations"
StackFieldAnswers = "answers"
StackFieldCreated = "created"
StackFieldCreatorID = "creatorId"
StackFieldDescription = "description"
StackFieldExternalID = "externalId"
StackFieldGroups = "groups"
StackFieldInstallNamespace = "installNamespace"
StackFieldLabels = "labels"
StackFieldName = "name"
StackFieldNamespaceId = "namespaceId"
StackFieldOwnerReferences = "ownerReferences"
StackFieldProjectId = "projectId"
StackFieldPrune = "prune"
StackFieldRemoved = "removed"
StackFieldState = "state"
StackFieldStatus = "status"
StackFieldTag = "tag"
StackFieldTemplates = "templates"
StackFieldTransitioning = "transitioning"
StackFieldTransitioningMessage = "transitioningMessage"
StackFieldUser = "user"
StackFieldUuid = "uuid"
)
type Stack struct {
types.Resource
Annotations map[string]string `json:"annotations,omitempty"`
Answers map[string]string `json:"answers,omitempty"`
Created string `json:"created,omitempty"`
CreatorID string `json:"creatorId,omitempty"`
Description string `json:"description,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Groups []string `json:"groups,omitempty"`
InstallNamespace string `json:"installNamespace,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Name string `json:"name,omitempty"`
NamespaceId string `json:"namespaceId,omitempty"`
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
ProjectId string `json:"projectId,omitempty"`
Prune *bool `json:"prune,omitempty"`
Removed string `json:"removed,omitempty"`
State string `json:"state,omitempty"`
Status *StackStatus `json:"status,omitempty"`
Tag map[string]string `json:"tag,omitempty"`
Templates map[string]string `json:"templates,omitempty"`
Transitioning string `json:"transitioning,omitempty"`
TransitioningMessage string `json:"transitioningMessage,omitempty"`
User string `json:"user,omitempty"`
Uuid string `json:"uuid,omitempty"`
}
type StackCollection struct {
types.Collection
Data []Stack `json:"data,omitempty"`
client *StackClient
}
type StackClient struct {
apiClient *Client
}
type StackOperations interface {
List(opts *types.ListOpts) (*StackCollection, error)
Create(opts *Stack) (*Stack, error)
Update(existing *Stack, updates interface{}) (*Stack, error)
ByID(id string) (*Stack, error)
Delete(container *Stack) error
}
func newStackClient(apiClient *Client) *StackClient {
return &StackClient{
apiClient: apiClient,
}
}
func (c *StackClient) Create(container *Stack) (*Stack, error) {
resp := &Stack{}
err := c.apiClient.Ops.DoCreate(StackType, container, resp)
return resp, err
}
func (c *StackClient) Update(existing *Stack, updates interface{}) (*Stack, error) {
resp := &Stack{}
err := c.apiClient.Ops.DoUpdate(StackType, &existing.Resource, updates, resp)
return resp, err
}
func (c *StackClient) List(opts *types.ListOpts) (*StackCollection, error) {
resp := &StackCollection{}
err := c.apiClient.Ops.DoList(StackType, 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.apiClient.Ops.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.apiClient.Ops.DoByID(StackType, id, resp)
return resp, err
}
func (c *StackClient) Delete(container *Stack) error {
return c.apiClient.Ops.DoResourceDelete(StackType, &container.Resource)
}

View File

@@ -0,0 +1,28 @@
package client
const (
StackSpecType = "stackSpec"
StackSpecFieldAnswers = "answers"
StackSpecFieldDescription = "description"
StackSpecFieldExternalID = "externalId"
StackSpecFieldGroups = "groups"
StackSpecFieldInstallNamespace = "installNamespace"
StackSpecFieldProjectId = "projectId"
StackSpecFieldPrune = "prune"
StackSpecFieldTag = "tag"
StackSpecFieldTemplates = "templates"
StackSpecFieldUser = "user"
)
type StackSpec struct {
Answers map[string]string `json:"answers,omitempty"`
Description string `json:"description,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Groups []string `json:"groups,omitempty"`
InstallNamespace string `json:"installNamespace,omitempty"`
ProjectId string `json:"projectId,omitempty"`
Prune *bool `json:"prune,omitempty"`
Tag map[string]string `json:"tag,omitempty"`
Templates map[string]string `json:"templates,omitempty"`
User string `json:"user,omitempty"`
}

View File

@@ -0,0 +1,10 @@
package client
const (
StackStatusType = "stackStatus"
StackStatusFieldReleases = "releases"
)
type StackStatus struct {
Releases []ReleaseInfo `json:"releases,omitempty"`
}

View File

@@ -31,6 +31,7 @@ type Client struct {
ReplicationController ReplicationControllerOperations
DaemonSet DaemonSetOperations
Workload WorkloadOperations
ConfigMap ConfigMapOperations
}
func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
@@ -67,6 +68,7 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
client.ReplicationController = newReplicationControllerClient(client)
client.DaemonSet = newDaemonSetClient(client)
client.Workload = newWorkloadClient(client)
client.ConfigMap = newConfigMapClient(client)
return client, nil
}

View File

@@ -0,0 +1,93 @@
package client
import (
"github.com/rancher/norman/types"
)
const (
ConfigMapType = "configMap"
ConfigMapFieldAnnotations = "annotations"
ConfigMapFieldCreated = "created"
ConfigMapFieldCreatorID = "creatorId"
ConfigMapFieldData = "data"
ConfigMapFieldLabels = "labels"
ConfigMapFieldName = "name"
ConfigMapFieldOwnerReferences = "ownerReferences"
ConfigMapFieldRemoved = "removed"
ConfigMapFieldUuid = "uuid"
)
type ConfigMap struct {
types.Resource
Annotations map[string]string `json:"annotations,omitempty"`
Created string `json:"created,omitempty"`
CreatorID string `json:"creatorId,omitempty"`
Data map[string]string `json:"data,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Name string `json:"name,omitempty"`
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
Removed string `json:"removed,omitempty"`
Uuid string `json:"uuid,omitempty"`
}
type ConfigMapCollection struct {
types.Collection
Data []ConfigMap `json:"data,omitempty"`
client *ConfigMapClient
}
type ConfigMapClient struct {
apiClient *Client
}
type ConfigMapOperations interface {
List(opts *types.ListOpts) (*ConfigMapCollection, error)
Create(opts *ConfigMap) (*ConfigMap, error)
Update(existing *ConfigMap, updates interface{}) (*ConfigMap, error)
ByID(id string) (*ConfigMap, error)
Delete(container *ConfigMap) error
}
func newConfigMapClient(apiClient *Client) *ConfigMapClient {
return &ConfigMapClient{
apiClient: apiClient,
}
}
func (c *ConfigMapClient) Create(container *ConfigMap) (*ConfigMap, error) {
resp := &ConfigMap{}
err := c.apiClient.Ops.DoCreate(ConfigMapType, container, resp)
return resp, err
}
func (c *ConfigMapClient) Update(existing *ConfigMap, updates interface{}) (*ConfigMap, error) {
resp := &ConfigMap{}
err := c.apiClient.Ops.DoUpdate(ConfigMapType, &existing.Resource, updates, resp)
return resp, err
}
func (c *ConfigMapClient) List(opts *types.ListOpts) (*ConfigMapCollection, error) {
resp := &ConfigMapCollection{}
err := c.apiClient.Ops.DoList(ConfigMapType, opts, resp)
resp.client = c
return resp, err
}
func (cc *ConfigMapCollection) Next() (*ConfigMapCollection, error) {
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
resp := &ConfigMapCollection{}
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
resp.client = cc.client
return resp, err
}
return nil, nil
}
func (c *ConfigMapClient) ByID(id string) (*ConfigMap, error) {
resp := &ConfigMap{}
err := c.apiClient.Ops.DoByID(ConfigMapType, id, resp)
return resp, err
}
func (c *ConfigMapClient) Delete(container *ConfigMap) error {
return c.apiClient.Ops.DoResourceDelete(ConfigMapType, &container.Resource)
}