From c833e41eb4edb96e6c106f7844a6861fb328bc18 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Sat, 23 Dec 2017 22:23:50 -0700 Subject: [PATCH] Update generated code --- client/project/v3/zz_generated_client.go | 6 +- client/project/v3/zz_generated_endpoint.go | 2 + .../v3/zz_generated_http_ingress_path.go | 16 +++ .../zz_generated_http_ingress_rule_value.go | 10 ++ client/project/v3/zz_generated_ingress.go | 109 ++++++++++++++++++ .../v3/zz_generated_ingress_backend.go | 14 +++ .../project/v3/zz_generated_ingress_rule.go | 12 ++ .../project/v3/zz_generated_ingress_spec.go | 14 +++ .../project/v3/zz_generated_ingress_status.go | 10 ++ client/project/v3/zz_generated_ingress_tls.go | 12 ++ client/project/v3/zz_generated_target.go | 16 +-- 11 files changed, 212 insertions(+), 9 deletions(-) create mode 100644 client/project/v3/zz_generated_http_ingress_path.go create mode 100644 client/project/v3/zz_generated_http_ingress_rule_value.go create mode 100644 client/project/v3/zz_generated_ingress.go create mode 100644 client/project/v3/zz_generated_ingress_backend.go create mode 100644 client/project/v3/zz_generated_ingress_rule.go create mode 100644 client/project/v3/zz_generated_ingress_spec.go create mode 100644 client/project/v3/zz_generated_ingress_status.go create mode 100644 client/project/v3/zz_generated_ingress_tls.go diff --git a/client/project/v3/zz_generated_client.go b/client/project/v3/zz_generated_client.go index 9d05c167..8c1fc4d4 100644 --- a/client/project/v3/zz_generated_client.go +++ b/client/project/v3/zz_generated_client.go @@ -7,6 +7,8 @@ import ( type Client struct { clientbase.APIBaseClient + Namespace NamespaceOperations + Ingress IngressOperations Secret SecretOperations ServiceAccountToken ServiceAccountTokenOperations DockerCredential DockerCredentialOperations @@ -15,7 +17,6 @@ type Client struct { SSHAuth SSHAuthOperations Service ServiceOperations Endpoint EndpointOperations - Namespace NamespaceOperations Pod PodOperations Deployment DeploymentOperations PersistentVolumeClaim PersistentVolumeClaimOperations @@ -36,6 +37,8 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { APIBaseClient: baseClient, } + client.Namespace = newNamespaceClient(client) + client.Ingress = newIngressClient(client) client.Secret = newSecretClient(client) client.ServiceAccountToken = newServiceAccountTokenClient(client) client.DockerCredential = newDockerCredentialClient(client) @@ -44,7 +47,6 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.SSHAuth = newSSHAuthClient(client) client.Service = newServiceClient(client) client.Endpoint = newEndpointClient(client) - client.Namespace = newNamespaceClient(client) client.Pod = newPodClient(client) client.Deployment = newDeploymentClient(client) client.PersistentVolumeClaim = newPersistentVolumeClaimClient(client) diff --git a/client/project/v3/zz_generated_endpoint.go b/client/project/v3/zz_generated_endpoint.go index 154ce285..58ca308f 100644 --- a/client/project/v3/zz_generated_endpoint.go +++ b/client/project/v3/zz_generated_endpoint.go @@ -13,6 +13,7 @@ const ( EndpointFieldName = "name" EndpointFieldNamespaceId = "namespaceId" EndpointFieldOwnerReferences = "ownerReferences" + EndpointFieldPodIDs = "podIds" EndpointFieldProjectID = "projectId" EndpointFieldRemoved = "removed" EndpointFieldTargets = "targets" @@ -28,6 +29,7 @@ type Endpoint struct { Name string `json:"name,omitempty"` NamespaceId string `json:"namespaceId,omitempty"` OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"` + PodIDs []string `json:"podIds,omitempty"` ProjectID string `json:"projectId,omitempty"` Removed string `json:"removed,omitempty"` Targets []Target `json:"targets,omitempty"` diff --git a/client/project/v3/zz_generated_http_ingress_path.go b/client/project/v3/zz_generated_http_ingress_path.go new file mode 100644 index 00000000..b46d6c41 --- /dev/null +++ b/client/project/v3/zz_generated_http_ingress_path.go @@ -0,0 +1,16 @@ +package client + +const ( + HTTPIngressPathType = "httpIngressPath" + HTTPIngressPathFieldPath = "path" + HTTPIngressPathFieldServiceId = "serviceId" + HTTPIngressPathFieldServicePort = "servicePort" + HTTPIngressPathFieldWorkloadIDs = "workloadIds" +) + +type HTTPIngressPath struct { + Path string `json:"path,omitempty"` + ServiceId string `json:"serviceId,omitempty"` + ServicePort string `json:"servicePort,omitempty"` + WorkloadIDs []string `json:"workloadIds,omitempty"` +} diff --git a/client/project/v3/zz_generated_http_ingress_rule_value.go b/client/project/v3/zz_generated_http_ingress_rule_value.go new file mode 100644 index 00000000..13e14576 --- /dev/null +++ b/client/project/v3/zz_generated_http_ingress_rule_value.go @@ -0,0 +1,10 @@ +package client + +const ( + HTTPIngressRuleValueType = "httpIngressRuleValue" + HTTPIngressRuleValueFieldPaths = "paths" +) + +type HTTPIngressRuleValue struct { + Paths []HTTPIngressPath `json:"paths,omitempty"` +} diff --git a/client/project/v3/zz_generated_ingress.go b/client/project/v3/zz_generated_ingress.go new file mode 100644 index 00000000..ce0ef2fc --- /dev/null +++ b/client/project/v3/zz_generated_ingress.go @@ -0,0 +1,109 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + IngressType = "ingress" + IngressFieldAnnotations = "annotations" + IngressFieldCreated = "created" + IngressFieldDefaultBackend = "defaultBackend" + IngressFieldFinalizers = "finalizers" + IngressFieldLabels = "labels" + IngressFieldName = "name" + IngressFieldNamespaceId = "namespaceId" + IngressFieldOwnerReferences = "ownerReferences" + IngressFieldProjectID = "projectId" + IngressFieldRemoved = "removed" + IngressFieldRules = "rules" + IngressFieldState = "state" + IngressFieldStatus = "status" + IngressFieldTLS = "tls" + IngressFieldTransitioning = "transitioning" + IngressFieldTransitioningMessage = "transitioningMessage" + IngressFieldUuid = "uuid" +) + +type Ingress struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty"` + Created string `json:"created,omitempty"` + DefaultBackend *IngressBackend `json:"defaultBackend,omitempty"` + Finalizers []string `json:"finalizers,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"` + Removed string `json:"removed,omitempty"` + Rules []IngressRule `json:"rules,omitempty"` + State string `json:"state,omitempty"` + Status *IngressStatus `json:"status,omitempty"` + TLS []IngressTLS `json:"tls,omitempty"` + Transitioning string `json:"transitioning,omitempty"` + TransitioningMessage string `json:"transitioningMessage,omitempty"` + Uuid string `json:"uuid,omitempty"` +} +type IngressCollection struct { + types.Collection + Data []Ingress `json:"data,omitempty"` + client *IngressClient +} + +type IngressClient struct { + apiClient *Client +} + +type IngressOperations interface { + List(opts *types.ListOpts) (*IngressCollection, error) + Create(opts *Ingress) (*Ingress, error) + Update(existing *Ingress, updates interface{}) (*Ingress, error) + ByID(id string) (*Ingress, error) + Delete(container *Ingress) error +} + +func newIngressClient(apiClient *Client) *IngressClient { + return &IngressClient{ + apiClient: apiClient, + } +} + +func (c *IngressClient) Create(container *Ingress) (*Ingress, error) { + resp := &Ingress{} + err := c.apiClient.Ops.DoCreate(IngressType, container, resp) + return resp, err +} + +func (c *IngressClient) Update(existing *Ingress, updates interface{}) (*Ingress, error) { + resp := &Ingress{} + err := c.apiClient.Ops.DoUpdate(IngressType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *IngressClient) List(opts *types.ListOpts) (*IngressCollection, error) { + resp := &IngressCollection{} + err := c.apiClient.Ops.DoList(IngressType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *IngressCollection) Next() (*IngressCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &IngressCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *IngressClient) ByID(id string) (*Ingress, error) { + resp := &Ingress{} + err := c.apiClient.Ops.DoByID(IngressType, id, resp) + return resp, err +} + +func (c *IngressClient) Delete(container *Ingress) error { + return c.apiClient.Ops.DoResourceDelete(IngressType, &container.Resource) +} diff --git a/client/project/v3/zz_generated_ingress_backend.go b/client/project/v3/zz_generated_ingress_backend.go new file mode 100644 index 00000000..6382c0e4 --- /dev/null +++ b/client/project/v3/zz_generated_ingress_backend.go @@ -0,0 +1,14 @@ +package client + +const ( + IngressBackendType = "ingressBackend" + IngressBackendFieldServiceId = "serviceId" + IngressBackendFieldServicePort = "servicePort" + IngressBackendFieldWorkloadIDs = "workloadIds" +) + +type IngressBackend struct { + ServiceId string `json:"serviceId,omitempty"` + ServicePort string `json:"servicePort,omitempty"` + WorkloadIDs []string `json:"workloadIds,omitempty"` +} diff --git a/client/project/v3/zz_generated_ingress_rule.go b/client/project/v3/zz_generated_ingress_rule.go new file mode 100644 index 00000000..574bd17c --- /dev/null +++ b/client/project/v3/zz_generated_ingress_rule.go @@ -0,0 +1,12 @@ +package client + +const ( + IngressRuleType = "ingressRule" + IngressRuleFieldHTTP = "http" + IngressRuleFieldHost = "host" +) + +type IngressRule struct { + HTTP *HTTPIngressRuleValue `json:"http,omitempty"` + Host string `json:"host,omitempty"` +} diff --git a/client/project/v3/zz_generated_ingress_spec.go b/client/project/v3/zz_generated_ingress_spec.go new file mode 100644 index 00000000..72e29279 --- /dev/null +++ b/client/project/v3/zz_generated_ingress_spec.go @@ -0,0 +1,14 @@ +package client + +const ( + IngressSpecType = "ingressSpec" + IngressSpecFieldBackend = "backend" + IngressSpecFieldRules = "rules" + IngressSpecFieldTLS = "tls" +) + +type IngressSpec struct { + Backend *IngressBackend `json:"backend,omitempty"` + Rules []IngressRule `json:"rules,omitempty"` + TLS []IngressTLS `json:"tls,omitempty"` +} diff --git a/client/project/v3/zz_generated_ingress_status.go b/client/project/v3/zz_generated_ingress_status.go new file mode 100644 index 00000000..d4600706 --- /dev/null +++ b/client/project/v3/zz_generated_ingress_status.go @@ -0,0 +1,10 @@ +package client + +const ( + IngressStatusType = "ingressStatus" + IngressStatusFieldLoadBalancer = "loadBalancer" +) + +type IngressStatus struct { + LoadBalancer *LoadBalancerStatus `json:"loadBalancer,omitempty"` +} diff --git a/client/project/v3/zz_generated_ingress_tls.go b/client/project/v3/zz_generated_ingress_tls.go new file mode 100644 index 00000000..9899140f --- /dev/null +++ b/client/project/v3/zz_generated_ingress_tls.go @@ -0,0 +1,12 @@ +package client + +const ( + IngressTLSType = "ingressTLS" + IngressTLSFieldCertificateId = "certificateId" + IngressTLSFieldHosts = "hosts" +) + +type IngressTLS struct { + CertificateId string `json:"certificateId,omitempty"` + Hosts []string `json:"hosts,omitempty"` +} diff --git a/client/project/v3/zz_generated_target.go b/client/project/v3/zz_generated_target.go index 53adcfae..aae11087 100644 --- a/client/project/v3/zz_generated_target.go +++ b/client/project/v3/zz_generated_target.go @@ -1,14 +1,16 @@ package client const ( - TargetType = "target" - TargetFieldAddresses = "addresses" - TargetFieldPort = "port" - TargetFieldProtocol = "protocol" + TargetType = "target" + TargetFieldAddresses = "addresses" + TargetFieldNotReadyAddresses = "notReadyAddresses" + TargetFieldPort = "port" + TargetFieldProtocol = "protocol" ) type Target struct { - Addresses []string `json:"addresses,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol string `json:"protocol,omitempty"` + Addresses []string `json:"addresses,omitempty"` + NotReadyAddresses []string `json:"notReadyAddresses,omitempty"` + Port *int64 `json:"port,omitempty"` + Protocol string `json:"protocol,omitempty"` }