Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jaypipes@udb42383a8e5155:~/go/src/github.com/jaypipes/aws-api-tools$ go run cmd/aws-api-tool/main.go schema appmesh > /tmp/appmesh.yaml
- jaypipes@udb42383a8e5155:~/go/src/github.com/jaypipes/aws-api-tools$ head -n20 /tmp/appmesh.yaml
- components:
- schemas:
- AccessLog:
- properties:
- file:
- $ref: '#/components/schemas/FileAccessLog'
- type: object
- AccountId:
- maxLength: 12
- minLength: 12
- type: string
- Arn:
- type: string
- AwsCloudMapInstanceAttribute:
- properties:
- key:
- maxLength: 255
- minLength: 1
- pattern: ^[a-zA-Z0-9!-~]+$
- type: string
- jaypipes@udb42383a8e5155:~/go/src/github.com/aws/aws-service-operator-k8s$ go run cmd/ack-generate/main.go types < /tmp/appmesh.yaml
- // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License"). You may
- // not use this file except in compliance with the License. A copy of the
- // License is located at
- //
- // http://aws.amazon.com/apache2.0/
- //
- // or in the "license" file accompanying this file. This file is distributed
- // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- // express or implied. See the License for the specific language governing
- // permissions and limitations under the License.
- package v1alpha1
- import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- )
- type Duration struct {
- Unit string `json:"unit,omitempty"`
- Value int64 `json:"value,omitempty"`
- }
- type MeshRef struct {
- Arn string `json:"arn,omitempty"`
- MeshName string `json:"meshName,omitempty"`
- MeshOwner string `json:"meshOwner,omitempty"`
- ResourceOwner string `json:"resourceOwner,omitempty"`
- }
- type RouteRef struct {
- Arn string `json:"arn,omitempty"`
- MeshName string `json:"meshName,omitempty"`
- MeshOwner string `json:"meshOwner,omitempty"`
- ResourceOwner string `json:"resourceOwner,omitempty"`
- RouteName string `json:"routeName,omitempty"`
- VirtualRouterName string `json:"virtualRouterName,omitempty"`
- }
- type MeshData struct {
- MeshName string `json:"meshName,omitempty"`
- Metadata *Metadata `json:"metadata,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Status *Status `json:"status,omitempty"`
- }
- type VirtualServiceRef struct {
- Arn string `json:"arn,omitempty"`
- MeshName string `json:"meshName,omitempty"`
- MeshOwner string `json:"meshOwner,omitempty"`
- ResourceOwner string `json:"resourceOwner,omitempty"`
- VirtualServiceName string `json:"virtualServiceName,omitempty"`
- }
- type ListenerTls struct {
- Certificate *Certificate `json:"certificate,omitempty"`
- Mode string `json:"mode,omitempty"`
- }
- type VirtualNodeSpec struct {
- BackendDefaults *BackendDefaults `json:"backendDefaults,omitempty"`
- Backends []*Backends `json:"backends,omitempty"`
- Listeners []*Listeners `json:"listeners,omitempty"`
- Logging *Logging `json:"logging,omitempty"`
- ServiceDiscovery *ServiceDiscovery `json:"serviceDiscovery,omitempty"`
- }
- type VirtualServiceData struct {
- MeshName string `json:"meshName,omitempty"`
- Metadata *Metadata `json:"metadata,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Status *Status `json:"status,omitempty"`
- VirtualServiceName string `json:"virtualServiceName,omitempty"`
- }
- type GrpcRouteMatch struct {
- Metadata []*Metadata `json:"metadata,omitempty"`
- MethodName string `json:"methodName,omitempty"`
- ServiceName string `json:"serviceName,omitempty"`
- }
- type RouteStatus struct {
- Status string `json:"status,omitempty"`
- }
- type TcpRoute struct {
- Action *Action `json:"action,omitempty"`
- }
- type FileAccessLog struct {
- Path string `json:"path,omitempty"`
- }
- type VirtualNodeData struct {
- MeshName string `json:"meshName,omitempty"`
- Metadata *Metadata `json:"metadata,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Status *Status `json:"status,omitempty"`
- VirtualNodeName string `json:"virtualNodeName,omitempty"`
- }
- type VirtualRouterSpec struct {
- Listeners []*Listeners `json:"listeners,omitempty"`
- }
- type WeightedTarget struct {
- VirtualNode string `json:"virtualNode,omitempty"`
- Weight int64 `json:"weight,omitempty"`
- }
- type Logging struct {
- AccessLog *AccessLog `json:"accessLog,omitempty"`
- }
- type VirtualNodeRef struct {
- Arn string `json:"arn,omitempty"`
- MeshName string `json:"meshName,omitempty"`
- MeshOwner string `json:"meshOwner,omitempty"`
- ResourceOwner string `json:"resourceOwner,omitempty"`
- VirtualNodeName string `json:"virtualNodeName,omitempty"`
- }
- type HttpRouteAction struct {
- WeightedTargets []*WeightedTargets `json:"weightedTargets,omitempty"`
- }
- type TagRef struct {
- Key string `json:"key,omitempty"`
- Value string `json:"value,omitempty"`
- }
- type DnsServiceDiscovery struct {
- Hostname string `json:"hostname,omitempty"`
- }
- type EgressFilter struct {
- Type string `json:"type,omitempty"`
- }
- type AwsCloudMapInstanceAttribute struct {
- Key string `json:"key,omitempty"`
- Value string `json:"value,omitempty"`
- }
- type TlsValidationContextAcmTrust struct {
- CertificateAuthorityArns []string `json:"certificateAuthorityArns,omitempty"`
- }
- type ListenerTlsCertificate struct {
- Acm *Acm `json:"acm,omitempty"`
- File *File `json:"file,omitempty"`
- }
- type VirtualNodeServiceProvider struct {
- VirtualNodeName string `json:"virtualNodeName,omitempty"`
- }
- type VirtualRouterRef struct {
- Arn string `json:"arn,omitempty"`
- MeshName string `json:"meshName,omitempty"`
- MeshOwner string `json:"meshOwner,omitempty"`
- ResourceOwner string `json:"resourceOwner,omitempty"`
- VirtualRouterName string `json:"virtualRouterName,omitempty"`
- }
- type VirtualServiceProvider struct {
- VirtualNode *VirtualNode `json:"virtualNode,omitempty"`
- VirtualRouter *VirtualRouter `json:"virtualRouter,omitempty"`
- }
- type TcpRouteAction struct {
- WeightedTargets []*WeightedTargets `json:"weightedTargets,omitempty"`
- }
- type TlsValidationContext struct {
- Trust *Trust `json:"trust,omitempty"`
- }
- type VirtualRouterStatus struct {
- Status string `json:"status,omitempty"`
- }
- type HeaderMatchMethod struct {
- Exact string `json:"exact,omitempty"`
- Prefix string `json:"prefix,omitempty"`
- Range *Range `json:"range,omitempty"`
- Regex string `json:"regex,omitempty"`
- Suffix string `json:"suffix,omitempty"`
- }
- type VirtualServiceBackend struct {
- ClientPolicy *ClientPolicy `json:"clientPolicy,omitempty"`
- VirtualServiceName string `json:"virtualServiceName,omitempty"`
- }
- type MeshStatus struct {
- Status string `json:"status,omitempty"`
- }
- type VirtualServiceStatus struct {
- Status string `json:"status,omitempty"`
- }
- type Backend struct {
- VirtualService *VirtualService `json:"virtualService,omitempty"`
- }
- type GrpcRetryPolicy struct {
- GrpcRetryEvents []string `json:"grpcRetryEvents,omitempty"`
- HttpRetryEvents []string `json:"httpRetryEvents,omitempty"`
- MaxRetries int64 `json:"maxRetries,omitempty"`
- PerRetryTimeout *PerRetryTimeout `json:"perRetryTimeout,omitempty"`
- TcpRetryEvents []string `json:"tcpRetryEvents,omitempty"`
- }
- type HttpRoute struct {
- Action *Action `json:"action,omitempty"`
- Match *Match `json:"match,omitempty"`
- RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"`
- }
- type HttpRouteHeader struct {
- Invert bool `json:"invert,omitempty"`
- Match *Match `json:"match,omitempty"`
- Name string `json:"name,omitempty"`
- }
- type AccessLog struct {
- File *File `json:"file,omitempty"`
- }
- type BackendDefaults struct {
- ClientPolicy *ClientPolicy `json:"clientPolicy,omitempty"`
- }
- type ServiceDiscovery struct {
- AwsCloudMap *AwsCloudMap `json:"awsCloudMap,omitempty"`
- Dns *Dns `json:"dns,omitempty"`
- }
- type TlsValidationContextFileTrust struct {
- CertificateChain string `json:"certificateChain,omitempty"`
- }
- type ResourceMetadata struct {
- Arn string `json:"arn,omitempty"`
- CreatedAt string `json:"createdAt,omitempty"`
- LastUpdatedAt string `json:"lastUpdatedAt,omitempty"`
- MeshOwner string `json:"meshOwner,omitempty"`
- ResourceOwner string `json:"resourceOwner,omitempty"`
- Uid string `json:"uid,omitempty"`
- Version int64 `json:"version,omitempty"`
- }
- type RouteData struct {
- MeshName string `json:"meshName,omitempty"`
- Metadata *Metadata `json:"metadata,omitempty"`
- RouteName string `json:"routeName,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Status *Status `json:"status,omitempty"`
- VirtualRouterName string `json:"virtualRouterName,omitempty"`
- }
- type TlsValidationContextTrust struct {
- Acm *Acm `json:"acm,omitempty"`
- File *File `json:"file,omitempty"`
- }
- type VirtualRouterData struct {
- MeshName string `json:"meshName,omitempty"`
- Metadata *Metadata `json:"metadata,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Status *Status `json:"status,omitempty"`
- VirtualRouterName string `json:"virtualRouterName,omitempty"`
- }
- type RouteSpec struct {
- GrpcRoute *GrpcRoute `json:"grpcRoute,omitempty"`
- Http2Route *Http2Route `json:"http2Route,omitempty"`
- HttpRoute *HttpRoute `json:"httpRoute,omitempty"`
- Priority int64 `json:"priority,omitempty"`
- TcpRoute *TcpRoute `json:"tcpRoute,omitempty"`
- }
- type MeshSpec struct {
- EgressFilter *EgressFilter `json:"egressFilter,omitempty"`
- }
- type ListenerTlsFileCertificate struct {
- CertificateChain string `json:"certificateChain,omitempty"`
- PrivateKey string `json:"privateKey,omitempty"`
- }
- type MatchRange struct {
- End int64 `json:"end,omitempty"`
- Start int64 `json:"start,omitempty"`
- }
- type ClientPolicy struct {
- Tls *Tls `json:"tls,omitempty"`
- }
- type GrpcRouteMetadata struct {
- Invert bool `json:"invert,omitempty"`
- Match *Match `json:"match,omitempty"`
- Name string `json:"name,omitempty"`
- }
- type VirtualServiceSpec struct {
- Provider *Provider `json:"provider,omitempty"`
- }
- type VirtualNodeStatus struct {
- Status string `json:"status,omitempty"`
- }
- type VirtualRouterServiceProvider struct {
- VirtualRouterName string `json:"virtualRouterName,omitempty"`
- }
- type HttpRouteMatch struct {
- Headers []*Headers `json:"headers,omitempty"`
- Method string `json:"method,omitempty"`
- Prefix string `json:"prefix,omitempty"`
- Scheme string `json:"scheme,omitempty"`
- }
- type PortMapping struct {
- Port int64 `json:"port,omitempty"`
- Protocol string `json:"protocol,omitempty"`
- }
- type AwsCloudMapServiceDiscovery struct {
- Attributes []*Attributes `json:"attributes,omitempty"`
- NamespaceName string `json:"namespaceName,omitempty"`
- ServiceName string `json:"serviceName,omitempty"`
- }
- type GrpcRoute struct {
- Action *Action `json:"action,omitempty"`
- Match *Match `json:"match,omitempty"`
- RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"`
- }
- type HealthCheckPolicy struct {
- HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
- IntervalMillis int64 `json:"intervalMillis,omitempty"`
- Path string `json:"path,omitempty"`
- Port int64 `json:"port,omitempty"`
- Protocol string `json:"protocol,omitempty"`
- TimeoutMillis int64 `json:"timeoutMillis,omitempty"`
- UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
- }
- type HttpRetryPolicy struct {
- HttpRetryEvents []string `json:"httpRetryEvents,omitempty"`
- MaxRetries int64 `json:"maxRetries,omitempty"`
- PerRetryTimeout *PerRetryTimeout `json:"perRetryTimeout,omitempty"`
- TcpRetryEvents []string `json:"tcpRetryEvents,omitempty"`
- }
- type Listener struct {
- HealthCheck *HealthCheck `json:"healthCheck,omitempty"`
- PortMapping *PortMapping `json:"portMapping,omitempty"`
- Tls *Tls `json:"tls,omitempty"`
- }
- type GrpcRouteMetadataMatchMethod struct {
- Exact string `json:"exact,omitempty"`
- Prefix string `json:"prefix,omitempty"`
- Range *Range `json:"range,omitempty"`
- Regex string `json:"regex,omitempty"`
- Suffix string `json:"suffix,omitempty"`
- }
- type VirtualRouterListener struct {
- PortMapping *PortMapping `json:"portMapping,omitempty"`
- }
- type ClientPolicyTls struct {
- Enforce bool `json:"enforce,omitempty"`
- Ports []int64 `json:"ports,omitempty"`
- Validation *Validation `json:"validation,omitempty"`
- }
- type GrpcRouteAction struct {
- WeightedTargets []*WeightedTargets `json:"weightedTargets,omitempty"`
- }
- type ListenerTlsAcmCertificate struct {
- CertificateArn string `json:"certificateArn,omitempty"`
- }
- // RouteSpec defines the desired state of Route
- type RouteSpec struct {
- // The Arn attr is on all AWS service API CRs. It represents the Amazon
- // Resource Name for the object. CRs of this Kind that are created without
- // an Arn attr will be created by the controller. CRs of this Kind that
- // are created with a non-nil Arn attr are considered by the controller to
- // already exist in the backend AWS service API.
- Arn string `json:"arn,omitempty"`
- ClientToken string `json:"clientToken,omitempty"`
- MeshName string `json:"meshName,omitempty"`
- MeshOwner string `json:"meshOwner,omitempty"`
- RouteName string `json:"routeName,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Tags []*Tags `json:"tags,omitempty"`
- VirtualRouterName string `json:"virtualRouterName,omitempty"`
- }
- // RouteStatus defines the observed state of Route
- type RouteStatus struct {
- MeshName string `json:"meshName,omitempty"`
- Metadata *Metadata `json:"metadata,omitempty"`
- RouteName string `json:"routeName,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Status *Status `json:"status,omitempty"`
- VirtualRouterName string `json:"virtualRouterName,omitempty"`
- }
- // Route is the Schema for the Routes API
- type Route struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
- Spec RouteSpec `json:"spec,omitempty"`
- Status RouteStatus `json:"status,omitempty"`
- }
- // RouteList contains a list of Route
- type RouteList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
- Items []Route `json:"items"`
- }
- // VirtualNodeSpec defines the desired state of VirtualNode
- type VirtualNodeSpec struct {
- // The Arn attr is on all AWS service API CRs. It represents the Amazon
- // Resource Name for the object. CRs of this Kind that are created without
- // an Arn attr will be created by the controller. CRs of this Kind that
- // are created with a non-nil Arn attr are considered by the controller to
- // already exist in the backend AWS service API.
- Arn string `json:"arn,omitempty"`
- ClientToken string `json:"clientToken,omitempty"`
- MeshName string `json:"meshName,omitempty"`
- MeshOwner string `json:"meshOwner,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Tags []*Tags `json:"tags,omitempty"`
- VirtualNodeName string `json:"virtualNodeName,omitempty"`
- }
- // VirtualNodeStatus defines the observed state of VirtualNode
- type VirtualNodeStatus struct {
- MeshName string `json:"meshName,omitempty"`
- Metadata *Metadata `json:"metadata,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Status *Status `json:"status,omitempty"`
- VirtualNodeName string `json:"virtualNodeName,omitempty"`
- }
- // VirtualNode is the Schema for the VirtualNodes API
- type VirtualNode struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
- Spec VirtualNodeSpec `json:"spec,omitempty"`
- Status VirtualNodeStatus `json:"status,omitempty"`
- }
- // VirtualNodeList contains a list of VirtualNode
- type VirtualNodeList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
- Items []VirtualNode `json:"items"`
- }
- // VirtualRouterSpec defines the desired state of VirtualRouter
- type VirtualRouterSpec struct {
- // The Arn attr is on all AWS service API CRs. It represents the Amazon
- // Resource Name for the object. CRs of this Kind that are created without
- // an Arn attr will be created by the controller. CRs of this Kind that
- // are created with a non-nil Arn attr are considered by the controller to
- // already exist in the backend AWS service API.
- Arn string `json:"arn,omitempty"`
- ClientToken string `json:"clientToken,omitempty"`
- MeshName string `json:"meshName,omitempty"`
- MeshOwner string `json:"meshOwner,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Tags []*Tags `json:"tags,omitempty"`
- VirtualRouterName string `json:"virtualRouterName,omitempty"`
- }
- // VirtualRouterStatus defines the observed state of VirtualRouter
- type VirtualRouterStatus struct {
- MeshName string `json:"meshName,omitempty"`
- Metadata *Metadata `json:"metadata,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Status *Status `json:"status,omitempty"`
- VirtualRouterName string `json:"virtualRouterName,omitempty"`
- }
- // VirtualRouter is the Schema for the VirtualRouters API
- type VirtualRouter struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
- Spec VirtualRouterSpec `json:"spec,omitempty"`
- Status VirtualRouterStatus `json:"status,omitempty"`
- }
- // VirtualRouterList contains a list of VirtualRouter
- type VirtualRouterList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
- Items []VirtualRouter `json:"items"`
- }
- // VirtualServiceSpec defines the desired state of VirtualService
- type VirtualServiceSpec struct {
- // The Arn attr is on all AWS service API CRs. It represents the Amazon
- // Resource Name for the object. CRs of this Kind that are created without
- // an Arn attr will be created by the controller. CRs of this Kind that
- // are created with a non-nil Arn attr are considered by the controller to
- // already exist in the backend AWS service API.
- Arn string `json:"arn,omitempty"`
- ClientToken string `json:"clientToken,omitempty"`
- MeshName string `json:"meshName,omitempty"`
- MeshOwner string `json:"meshOwner,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Tags []*Tags `json:"tags,omitempty"`
- VirtualServiceName string `json:"virtualServiceName,omitempty"`
- }
- // VirtualServiceStatus defines the observed state of VirtualService
- type VirtualServiceStatus struct {
- MeshName string `json:"meshName,omitempty"`
- Metadata *Metadata `json:"metadata,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Status *Status `json:"status,omitempty"`
- VirtualServiceName string `json:"virtualServiceName,omitempty"`
- }
- // VirtualService is the Schema for the VirtualServices API
- type VirtualService struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
- Spec VirtualServiceSpec `json:"spec,omitempty"`
- Status VirtualServiceStatus `json:"status,omitempty"`
- }
- // VirtualServiceList contains a list of VirtualService
- type VirtualServiceList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
- Items []VirtualService `json:"items"`
- }
- // MeshSpec defines the desired state of Mesh
- type MeshSpec struct {
- // The Arn attr is on all AWS service API CRs. It represents the Amazon
- // Resource Name for the object. CRs of this Kind that are created without
- // an Arn attr will be created by the controller. CRs of this Kind that
- // are created with a non-nil Arn attr are considered by the controller to
- // already exist in the backend AWS service API.
- Arn string `json:"arn,omitempty"`
- ClientToken string `json:"clientToken,omitempty"`
- MeshName string `json:"meshName,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Tags []*Tags `json:"tags,omitempty"`
- }
- // MeshStatus defines the observed state of Mesh
- type MeshStatus struct {
- MeshName string `json:"meshName,omitempty"`
- Metadata *Metadata `json:"metadata,omitempty"`
- Spec *Spec `json:"spec,omitempty"`
- Status *Status `json:"status,omitempty"`
- }
- // Mesh is the Schema for the Meshes API
- type Mesh struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
- Spec MeshSpec `json:"spec,omitempty"`
- Status MeshStatus `json:"status,omitempty"`
- }
- // MeshList contains a list of Mesh
- type MeshList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
- Items []Mesh `json:"items"`
- }
- func init() {
- SchemeBuilder.Register(&Route{}, &RouteList{})
- SchemeBuilder.Register(&VirtualNode{}, &VirtualNodeList{})
- SchemeBuilder.Register(&VirtualRouter{}, &VirtualRouterList{})
- SchemeBuilder.Register(&VirtualService{}, &VirtualServiceList{})
- SchemeBuilder.Register(&Mesh{}, &MeshList{})
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement