# Copyright (c)  WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License 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.

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: apis.wso2.com
spec:
  group: wso2.com
  names:
    kind: API
    listKind: APIList
    plural: apis
    singular: api
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    name: v1alpha2
    schema:
      openAPIV3Schema:
        description: API is the Schema for the apis API
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: APISpec defines the desired state of API
            properties:
              apiEndPoint:
                type: string
              certsValues:
                description: Config map name of the certs values of the API project
                  Default value "<empty>".
                type: string
              environmentVariables:
                description: Environment variables to be added to the API deployment.
                  Default value "<empty>".
                items:
                  type: string
                type: array
              image:
                description: Docker image of the API to be deployed. If specified,
                  ignores the values of `UpdateTimeStamp`, `Override`. Uses the given
                  image for the deployment. Default value "<empty>".
                type: string
              ingressHostname:
                description: Ingress Hostname that the API is being exposed. Default
                  value "<empty>".
                type: string
              mode:
                description: Mode of the API. The mode from the swagger definition
                  will be overridden by this value. Supports "privateJet", "sidecar",
                  "<empty>". Default value "<empty>".
                type: string
              override:
                description: Override the exiting API docker image. Default value
                  "false".
                type: boolean
              paramsValues:
                description: Config map name of the param values of the API project
                  Default value "<empty>".
                type: string
              replicas:
                description: Replica count of the API. Default value "<empty>".
                type: integer
              swaggerConfigMapName:
                description: Config map name of which the project zip or swagger file
                  is included
                type: string
              updateTimeStamp:
                description: Update API definition creating a new docker image. Make
                  a rolling update to the existing API. with prefixing the timestamp
                  value. Default value "<empty>".
                type: string
              version:
                description: Version of the API. The version from the swagger definition
                  will be overridden by this value. Default value "<empty>".
                type: string
            required:
            - swaggerConfigMapName
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
