diff --git a/client/project/v3/zz_generated_client.go b/client/project/v3/zz_generated_client.go index f6a2a78c..f4dacbbe 100644 --- a/client/project/v3/zz_generated_client.go +++ b/client/project/v3/zz_generated_client.go @@ -49,6 +49,7 @@ type Client struct { HorizontalPodAutoscaler HorizontalPodAutoscalerOperations VirtualService VirtualServiceOperations DestinationRule DestinationRuleOperations + Gateway GatewayOperations } func NewClient(opts *clientbase.ClientOpts) (*Client, error) { @@ -103,6 +104,7 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.HorizontalPodAutoscaler = newHorizontalPodAutoscalerClient(client) client.VirtualService = newVirtualServiceClient(client) client.DestinationRule = newDestinationRuleClient(client) + client.Gateway = newGatewayClient(client) return client, nil } diff --git a/client/project/v3/zz_generated_gateway.go b/client/project/v3/zz_generated_gateway.go new file mode 100644 index 00000000..716fa9b6 --- /dev/null +++ b/client/project/v3/zz_generated_gateway.go @@ -0,0 +1,115 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + GatewayType = "gateway" + GatewayFieldAnnotations = "annotations" + GatewayFieldCreated = "created" + GatewayFieldCreatorID = "creatorId" + GatewayFieldLabels = "labels" + GatewayFieldName = "name" + GatewayFieldNamespaceId = "namespaceId" + GatewayFieldOwnerReferences = "ownerReferences" + GatewayFieldProjectID = "projectId" + GatewayFieldRemoved = "removed" + GatewayFieldSelector = "selector" + GatewayFieldServers = "servers" + GatewayFieldState = "state" + GatewayFieldStatus = "status" + GatewayFieldTransitioning = "transitioning" + GatewayFieldTransitioningMessage = "transitioningMessage" + GatewayFieldUUID = "uuid" +) + +type Gateway struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + Created string `json:"created,omitempty" yaml:"created,omitempty"` + CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` + OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` + ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + Selector map[string]string `json:"selector,omitempty" yaml:"selector,omitempty"` + Servers []Server `json:"servers,omitempty" yaml:"servers,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + Status interface{} `json:"status,omitempty" yaml:"status,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` + UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type GatewayCollection struct { + types.Collection + Data []Gateway `json:"data,omitempty"` + client *GatewayClient +} + +type GatewayClient struct { + apiClient *Client +} + +type GatewayOperations interface { + List(opts *types.ListOpts) (*GatewayCollection, error) + Create(opts *Gateway) (*Gateway, error) + Update(existing *Gateway, updates interface{}) (*Gateway, error) + Replace(existing *Gateway) (*Gateway, error) + ByID(id string) (*Gateway, error) + Delete(container *Gateway) error +} + +func newGatewayClient(apiClient *Client) *GatewayClient { + return &GatewayClient{ + apiClient: apiClient, + } +} + +func (c *GatewayClient) Create(container *Gateway) (*Gateway, error) { + resp := &Gateway{} + err := c.apiClient.Ops.DoCreate(GatewayType, container, resp) + return resp, err +} + +func (c *GatewayClient) Update(existing *Gateway, updates interface{}) (*Gateway, error) { + resp := &Gateway{} + err := c.apiClient.Ops.DoUpdate(GatewayType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *GatewayClient) Replace(obj *Gateway) (*Gateway, error) { + resp := &Gateway{} + err := c.apiClient.Ops.DoReplace(GatewayType, &obj.Resource, obj, resp) + return resp, err +} + +func (c *GatewayClient) List(opts *types.ListOpts) (*GatewayCollection, error) { + resp := &GatewayCollection{} + err := c.apiClient.Ops.DoList(GatewayType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *GatewayCollection) Next() (*GatewayCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &GatewayCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *GatewayClient) ByID(id string) (*Gateway, error) { + resp := &Gateway{} + err := c.apiClient.Ops.DoByID(GatewayType, id, resp) + return resp, err +} + +func (c *GatewayClient) Delete(container *Gateway) error { + return c.apiClient.Ops.DoResourceDelete(GatewayType, &container.Resource) +} diff --git a/client/project/v3/zz_generated_gateway_spec.go b/client/project/v3/zz_generated_gateway_spec.go new file mode 100644 index 00000000..c76f1fdb --- /dev/null +++ b/client/project/v3/zz_generated_gateway_spec.go @@ -0,0 +1,12 @@ +package client + +const ( + GatewaySpecType = "gatewaySpec" + GatewaySpecFieldSelector = "selector" + GatewaySpecFieldServers = "servers" +) + +type GatewaySpec struct { + Selector map[string]string `json:"selector,omitempty" yaml:"selector,omitempty"` + Servers []Server `json:"servers,omitempty" yaml:"servers,omitempty"` +} diff --git a/client/project/v3/zz_generated_port.go b/client/project/v3/zz_generated_port.go new file mode 100644 index 00000000..dcad98de --- /dev/null +++ b/client/project/v3/zz_generated_port.go @@ -0,0 +1,14 @@ +package client + +const ( + PortType = "port" + PortFieldName = "name" + PortFieldNumber = "number" + PortFieldProtocol = "protocol" +) + +type Port struct { + Name string `json:"name,omitempty" yaml:"name,omitempty"` + Number int64 `json:"number,omitempty" yaml:"number,omitempty"` + Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` +} diff --git a/client/project/v3/zz_generated_server.go b/client/project/v3/zz_generated_server.go new file mode 100644 index 00000000..2b2e8ea1 --- /dev/null +++ b/client/project/v3/zz_generated_server.go @@ -0,0 +1,14 @@ +package client + +const ( + ServerType = "server" + ServerFieldHosts = "hosts" + ServerFieldPort = "port" + ServerFieldTLS = "tls" +) + +type Server struct { + Hosts []string `json:"hosts,omitempty" yaml:"hosts,omitempty"` + Port *Port `json:"port,omitempty" yaml:"port,omitempty"` + TLS *TLSOptions `json:"tls,omitempty" yaml:"tls,omitempty"` +} diff --git a/client/project/v3/zz_generated_tls_options.go b/client/project/v3/zz_generated_tls_options.go new file mode 100644 index 00000000..da9e15b3 --- /dev/null +++ b/client/project/v3/zz_generated_tls_options.go @@ -0,0 +1,22 @@ +package client + +const ( + TLSOptionsType = "tlsOptions" + TLSOptionsFieldCaCertificates = "caCertificates" + TLSOptionsFieldCredentialName = "credentialName" + TLSOptionsFieldHTTPSRedirect = "httpsRedirect" + TLSOptionsFieldMode = "mode" + TLSOptionsFieldPrivateKey = "privateKey" + TLSOptionsFieldServerCertificate = "serverCertificate" + TLSOptionsFieldSubjectAltNames = "subjectAltNames" +) + +type TLSOptions struct { + CaCertificates string `json:"caCertificates,omitempty" yaml:"caCertificates,omitempty"` + CredentialName string `json:"credentialName,omitempty" yaml:"credentialName,omitempty"` + HTTPSRedirect bool `json:"httpsRedirect,omitempty" yaml:"httpsRedirect,omitempty"` + Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` + PrivateKey string `json:"privateKey,omitempty" yaml:"privateKey,omitempty"` + ServerCertificate string `json:"serverCertificate,omitempty" yaml:"serverCertificate,omitempty"` + SubjectAltNames []string `json:"subjectAltNames,omitempty" yaml:"subjectAltNames,omitempty"` +} diff --git a/compose/zz_generated_compose.go b/compose/zz_generated_compose.go index 30a456bd..098c65a3 100644 --- a/compose/zz_generated_compose.go +++ b/compose/zz_generated_compose.go @@ -117,4 +117,5 @@ type Config struct { HorizontalPodAutoscalers map[string]projectClient.HorizontalPodAutoscaler `json:"horizontalPodAutoscalers,omitempty" yaml:"horizontalPodAutoscalers,omitempty"` VirtualServices map[string]projectClient.VirtualService `json:"virtualServices,omitempty" yaml:"virtualServices,omitempty"` DestinationRules map[string]projectClient.DestinationRule `json:"destinationRules,omitempty" yaml:"destinationRules,omitempty"` + Gateways map[string]projectClient.Gateway `json:"gateways,omitempty" yaml:"gateways,omitempty"` }