swagger: '2.0'
info:
  description: ADM Kubernetes Infra Adapter
  version: "1.0"
  title: "[Citrix ADM] Kubernetes Infra Adapter"

# tags are used for organizing operations
tags:
- name: K8s Adapter
  description: REST API's for k8s Adapter
# host: netscaler-mas-server
#basePath: /k8sadapter/nitro/v1/config
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
parameters:
  id:
    name: id
    in: path
    type: string
    description: Resource ID
    required: True
  namespace:
    name: namespace
    in: query
    type: string
    description: Namespace
    required: True
  cluster:
    name: cluster
    in: query
    type: string
    description : Cluster Name
    required: True
  cluster_alias:
    name: cluster_alias
    in: path
    type: string
    description: Resource name
    required: True
  service_name:
    name: service_name
    in: path
    type: string
    description: Resource name
    required: True
  namespace_name:
    name: namespace_name
    in: path
    type: string
    description: Resource name
    required: True
  ingress_name:
    name: ingress_name
    in: path
    type: string
    description: Resource name
    required: True
  ingress_namespace:
    name: ingress_namespace
    in: path
    type: string
    description: Resource name
    required: True
  secret_name:
    name: secret_name
    in: path
    type: string
    description: Resource name
    required: True
paths:
  /services:
    get:
      tags:
      - K8S SERVICES
      operationId: Getk8sServices
      description: Retrieves all Kubernetes services across all configured custers for all namespaces.
      produces:
      - application/json
      parameters: [
               {
                  name: cluster,
                  in: query,
                  description: The cluster from which to access all services,
                  required: false,
                  type: string
               },
               {
                  name: namespace,
                  in: query,
                  description: The namespace from which to fetch all services,
                  required: false,
                  type: string
               }
               ]
      responses:
        200:
          description: Successful retrieval of services across all clusters
          schema:
            $ref: '#/definitions/GetAllServicesResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  '/services/{service_name}':
    get:
      tags:
      - K8S SERVICES
      description: Get kubernetes Service by Name
      operationId: Getk8sServiceByName
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/service_name'
      responses:
        200:
          description: Successful retrieval of a particular service across all clusters
          schema:
            $ref: '#/definitions/GetAllServicesResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /pods:
    get:
      tags:
      - K8s Pods
      operationId: GetAllk8sPods
      description: Retrieves all Kubernetes Pods across all clusters.
      produces:
      - application/json
      parameters: [
               {
                  name: cluster,
                  in: query,
                  description: The cluster from which to access all pods,
                  required: false,
                  type: string
               },
               {
                  name: namespace,
                  in: query,
                  description: The namespace from which to fetch all pods,
                  required: false,
                  type: string
               }
               ]
      responses:
        200:
          description: Successful retrieval of pods
          schema:
            $ref: '#/definitions/GetAllPodsResponseBody'
        400:
          description: Bad input parameter
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  '/pods/{id}':
    get:
      tags:
      - K8s Pod By ID
      description: Get Kubernetes Pod by ID
      operationId: Getk8sPodByID
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/id'
      responses:
        200:
          description: Successful retrieval of pod by ID
          schema:
            $ref: '#/definitions/GetPodByIDResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /clusters:
    get:
      tags:
      - K8S CLUSTERS
      operationId: GetAllk8sClusters
      description: Retrieves all the clusters.
      produces:
      - application/json
      responses:
        200:
          description: Successfully retrieves all the clusters
          schema:
            $ref: '#/definitions/GetAllClustersResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
    post:
      tags:
        - K8S CLUSTERS
      operationId: Postk8sCluster
      description: Add a k8s cluster with all information required.
      produces:
      - application/json
      parameters:
        - name: Body
          in: body
          required: true
          x-is-map: false
          schema:
            $ref: '#/definitions/PostClusterSpecRequestBody'
      responses:
        201:
          description: Successful addition of cluster
          schema:
            $ref: '#/definitions/PostClusterSpecResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /clusters_health/{cluster_alias}:
    get:
      tags:
      - K8S CLUSTERS HEALTH
      operationId: GetHealthOfk8sClustersByAlias
      description: Retrieves health of the cluster.
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/cluster_alias'
      responses:
        200:
          description: Successfully retrieves the cluster health
          schema:
            $ref: '#/definitions/GetClusterHealthByAliasResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /clusters/{cluster_alias}/actions/reset:
    post:
      tags:
      - K8S CLUSTER ACTIONS RESET
      operationId: ResetClusterByAlias
      description: Restarts all the watches on all events for the cluster.
      produces:
      - application/json
      parameters:
        - name: Body
          in: body
          required: false
          schema:
            $ref: '#/definitions/PutClusterSpecRequestBody'
        - $ref: '#/parameters/cluster_alias'
      responses:
        201:
          description: Successfully reset the cluster
          schema:
            $ref: '#/definitions/RestClusterResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /clusters/{cluster_alias}:
    get:
      tags:
      - K8S CLUSTERS
      operationId: GetAllk8sClustersByAlias
      description: Retrieves all the clusters.
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/cluster_alias'
      responses:
        200:
          description: Successfully retrieves all the clusters
          schema:
            $ref: '#/definitions/GetAllClustersByAliasResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
    put:
      tags:
      - K8S CLUSTERS
      operationId: Putk8sCluster
      description: Modify informations for a particular clusters.
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/cluster_alias'
        - name: Body
          in: body
          required: true
          x-is-map: false
          schema:
            $ref: '#/definitions/PutClusterSpecRequestBody'
      responses:
        200:
          description: Successfully retrieves all the clusters
          schema:
            $ref: '#/definitions/PutClusterResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
    delete:
      tags:
      - K8S CLUSTERS
      operationId: Deletek8sCluster
      description: Delete a particular cluster
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/cluster_alias'
      responses:
        204:
          description: Successful deletion of cluster
          schema:
            $ref: '#/definitions/DeleteClusterResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /ingresses:
    get:
      tags:
      - K8S INGRESSES
      operationId: GetAllk8sIngresses
      description: Retrieves all Kubernetes Ingresses across all clusters.
      produces:
      - application/json
      parameters: [
               {
                  name: cluster,
                  in: query,
                  description: The cluster from which to access all pods,
                  required: false,
                  type: string
               },
               {
                  name: namespace,
                  in: query,
                  description: The namespace from which to fetch all pods,
                  required: false,
                  type: string
               }
               ]
      responses:
        200:
          description: Successful retrieval of Ingresses.
          schema:
            $ref: '#/definitions/GetAllIngressesResponseBody'
        400:
          description: Bad input parameter
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /ingresses/actions/export:
    post:
      tags:
        - K8S INGRESSES
      description: Export a new Kubernetes Ingress Spec
      operationId: ExportNewIngressSpec
      produces:
        - application/json
      parameters:
        - name: Body
          in: body
          x-is-map: false
          schema:
            $ref: '#/definitions/ExportNewIngressSpecRequestBody'
      responses:
        201:
          description: Successful export of a Kuberenetes Ingress Spec
          schema:
            $ref: '#/definitions/ExportNewIngressSpecResponseBody'
        400:
          description: Bad Request. Please make sure to add a correct Ingress Confing Spec.
          schema:
            $ref: '#/definitions/ErrorResponseBody'
        409:
          description: Resource Conflict.
          schema:
            $ref: '#/definitions/ErrorResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /ingresses/actions/deploy:
    post:
      tags:
        - K8S INGRESSES
      description: Deploy a new Kubernetes Ingress Spec
      operationId: DeployNewIngressSpec
      produces:
        - application/json
      parameters:
        - name: Body
          in: body
          required: true
          x-is-map: false
          schema:
            $ref: '#/definitions/DeployIngressSpecRequestBody'
      responses:
        201:
          description: Successful Deployment of a Kuberenetes Ingress Spec
          schema:
            $ref: '#/definitions/DeployNewIngressSpecResponseBody'
        400:
          description: Bad Request. Please make sure to add a correct Ingress Confing Spec.
          schema:
            $ref: '#/definitions/ErrorResponseBody'
        409:
          description: Resource Conflict.
          schema:
            $ref: '#/definitions/ErrorResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
    put:
      tags:
        - K8S INGRESSES
      description: Update an existing Kubernetes Ingress Spec
      operationId: UpdateExistingIngressSpec
      produces:
        - application/json
      parameters:
        - name: Body
          in: body
          required: true
          x-is-map: false
          schema:
            $ref: '#/definitions/DeployIngressSpecRequestBody'
      responses:
        200:
          description: Successful Deployment of a Kuberenetes Ingress Spec
          schema:
            $ref: '#/definitions/UpdateIngressSpecResponseBody'
        400:
          description: Bad Request. Please make sure to add a correct Ingress Confing Spec.
          schema:
            $ref: '#/definitions/ErrorResponseBody'
        409:
          description: Resource Conflict.
          schema:
            $ref: '#/definitions/ErrorResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  '/ingresses/{ingress_name}/{ingress_namespace}/{cluster_alias}':
    delete:
      tags:
        - K8S INGRESSES
      description: Delete a Kubernetes Ingress Spec
      operationId: DeleteIngressSpec
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/ingress_name'
        - $ref: '#/parameters/ingress_namespace'
        - $ref: '#/parameters/cluster_alias'
      responses:
        204:
          description: Successful Deletion of a Kuberenetes Ingress Spec
          schema:
            $ref: '#/definitions/DeleteIngressSpecResponseBody'
        400:
          description: Bad Request. Please make sure to provide a correct Ingress parameters.
          schema:
            $ref: '#/definitions/ErrorResponseBody'
        409:
          description: Resource Conflict.
          schema:
            $ref: '#/definitions/ErrorResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'

  '/ingresses/{id}':
    get:
      tags:
      - K8s Ingress By ID
      description: Get Kubernetes Ingress by ID
      operationId: Getk8sIngressByID
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/id'
      responses:
        200:
          description: Successful retrieval of Ingress by ID.
          schema:
            $ref: '#/definitions/GetIngressByIDResponseBody'
        400:
          description: Bad input parameter. Please make sure to add a correct Ingress Confing Spec.
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /namespaces:
    get:
      tags:
      - K8S NAMESPACES
      operationId: GetAllNamespaces
      description: Retrieves all Kubernetes Namespaces across all clusters.
      produces:
      - application/json
      parameters: [
               {
                  name: cluster,
                  in: query,
                  description: The cluster from which to access all pods,
                  required: false,
                  type: string
               }
               ]
      responses:
        200:
          description: Successful retrieval of namespaces
          schema:
            $ref: '#/definitions/GetAllNamespacesResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  '/namespaces/{namespace_name}':
    get:
      tags:
      - K8S NAMESPACES
      description: Get Kubernetes namespace by Name
      operationId: Getk8sNamespacesByName
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/namespace_name'
      responses:
        200:
          description: Successful retrieval of namespace by a particular Namespace name
          schema:
            $ref: '#/definitions/GetAllNamespacesResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /nodes:
    get:
      tags:
      - K8s Nodes
      operationId: GetAllNodes
      description: Retrieves all Kubernetes Nodes across all clusters.
      produces:
      - application/json
      parameters: [
               {
                  name: cluster,
                  in: query,
                  description: The cluster from which to access all pods,
                  required: false,
                  type: string
               },
               {
                  name: namespace,
                  in: query,
                  description: The namespace from which to fetch all pods,
                  required: false,
                  type: string
               }
               ]
      responses:
        200:
          description: Successful retrieval of Nodes
          schema:
            $ref: '#/definitions/GetAllNodesResponseBody'
        400:
          description: Bad input parameter
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  '/nodes/{id}':
    get:
      tags:
      - K8s Node By ID
      description: Get Kubernetes Node by ID
      operationId: Getk8sNodesByID
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/id'
      responses:
        200:
          description: Successful retrieval of Node by ID
          schema:
            $ref: '#/definitions/GetNodeByIDResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /deployments:
    get:
      tags:
      - K8s Deployments
      operationId: GetAllDeployments
      description: Retrieves all Kubernetes Deployments across all clusters.
      produces:
      - application/json
      parameters: [
               {
                  name: cluster,
                  in: query,
                  description: The cluster from which to access all pods,
                  required: false,
                  type: string
               },
               {
                  name: namespace,
                  in: query,
                  description: The namespace from which to fetch all pods,
                  required: false,
                  type: string
               }
               ]
      responses:
        200:
          description: Successful retrieval of Deployments
          schema:
            $ref: '#/definitions/GetAllDeploymentsResponseBody'
        400:
          description: Bad input parameter
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  '/deployments/{id}':
    get:
      tags:
      - K8s Deployment By ID
      description: Get Kubernetes deployment by ID
      operationId: Getk8sdeploymentsByID
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/id'
      responses:
        200:
          description: Successful retrieval of Deployment by ID
          schema:
            $ref: '#/definitions/GetDeploymentByIDResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /daemonsets:
    get:
      tags:
      - K8s DaemonSets
      operationId: GetAllDaemonSets
      description: Retrieves all Kubernetes DaemonSets across all clusters.
      produces:
      - application/json
      parameters: [
               {
                  name: cluster,
                  in: query,
                  description: The cluster from which to access all pods,
                  required: false,
                  type: string
               },
               {
                  name: namespace,
                  in: query,
                  description: The namespace from which to fetch all pods,
                  required: false,
                  type: string
               }
               ]
      responses:
        200:
          description: Successful retrieval of DaemonSets
          schema:
            $ref: '#/definitions/GetAllDaemonSetsResponseBody'
        400:
          description: Bad input parameter
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  '/daemonsets/{id}':
    get:
      tags:
      - K8s DaemonSets By ID
      description: Get Kubernetes DaemonSets by ID
      operationId: Getk8sdaemonsetsByID
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/id'
      responses:
        200:
          description: Successful retrieval of DaemonSets by ID
          schema:
            $ref: '#/definitions/GetDaemonSetByIDResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  /endpoints:
    get:
      tags:
      - K8s Endpoints
      operationId: GetAllEndpoints
      description: Retrieves all Kubernetes Endpoints across all clusters.
      produces:
      - application/json
      responses:
        200:
          description: Successful retrieval of Endpoints
          schema:
            $ref: '#/definitions/GetAllEndpointsResponseBody'
        400:
          description: Bad input parameter
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  '/endpoints/{id}':
    get:
      tags:
      - K8s Endpoints By ID
      description: Get Kubernetes Endpoints by ID
      operationId: Getk8sEndpointsByID
      produces:
      - application/json
      parameters:
        - $ref: '#/parameters/id'
      responses:
        200:
          description: Successful retrieval of endpoints by ID
          schema:
            $ref: '#/definitions/GetEndpointByIDResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  '/secrets/{cluster}/{namespace}/':
    get:
      tags:
      - K8S SECRETS
      description: Get kubernetes Secrets
      operationId: Getk8sSecrets
      produces:
      - application/json
      parameters:
        - name: cluster
          type: string
          in: path
          description: Clustername in which secret is defined
          required: True
        - name: namespace
          type: string
          in: path
          description: Namespace in which secret is defined
          required: True
      responses:
        200:
          description: Successful retrieval of all secret across the given cluster and namespace.
          schema:
            $ref: '#/definitions/GetAllSecretsResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
  '/secrets/{cluster}/{namespace}/{secret_name}':
    get:
      tags:
      - K8S SECRETS
      description: Get kubernetes Secret by Name
      operationId: Getk8sSecretByName
      produces:
      - application/json
      parameters:
        - name: cluster
          type: string
          in: path
          description: Clustername in which secret is defined
          required: True
        - name: namespace
          type: string
          in: path
          description: Namespace in which secret is defined
          required: True
        - $ref: '#/parameters/secret_name'
      responses:
        200:
          description: Successful retrieval of a particular secret across the given cluster and namespace.
          schema:
            $ref: '#/definitions/GetAllSecretsResponseBody'
        400:
          description: Bad input parameter
          schema:
            $ref: '#/definitions/BadRequestResponseBody'
        403:
          description: Permission Denied error
          schema:
            $ref: '#/definitions/PermissionDeniedResponseBody'
        500:
          description: Service Error
          schema:
            $ref: '#/definitions/ErrorResponseBody'
definitions:
  ResourceBaseRequest:
    properties:
      name:
        type: string
        example: resource-name
      namespace:
        type: string
        example: default
  ResourceBaseResponse:
    properties:
      name:
        type: string
      id:
        type: string
        example: 93baa109-73f2-11e8-b98b-062403209000
      cluster:
        type: string
        example: Staging
  ResourceResponse:
    allOf:
      - $ref: '#/definitions/ResourceBaseResponse'
    properties:
      namespace:
        type: string
        example: default
  IngressClusterInfoDescription:
    type: object
    properties:
      cluster-name:
        type: string
      virtual-ip:
        type: string
      public-virtual-ip:
        type: string
      auto_assign_vip:
        type: string
        example: False
  IngressDefaultRouteDescription:
    type: object
    properties:
      service-name:
        type: string
      service-port:
        type: string
      lbmethod:
        type: string
        example: SRCIPDESTIPHASH
      persistence_type:
        type: string
        example: SOURCEIP
  IngressRouteDescription:
    allOf:
      - $ref: '#/definitions/IngressDefaultRouteDescription'
    properties:
      url:
        type: string
  IngressRuleDescription:
    type: object
    properties:
      host:
        type: string
        example: example.com
      paths:
        type: array
        items:
          $ref: '#/definitions/IngressRouteDescription'
  IngressGSLBConfigDescription:
    type: object
    properties:
      domain-name:
        type: string
      algorithm:
        type: string
        enum:
          - STATICPROXIMITY
          - ROUNDROBIN
          - LEASTCONNECTIONS
      ttl:
        type: string
        example: 30
  GetServiceSummaryDescription:
    allOf:
      - $ref: '#/definitions/ResourceResponse'
      - properties:
          name:
            example: webservice
          type:
            type: string
            enum:
              - ClusterIP
              - NodePort
              - LoadBalancer
          cluster_ip:
            example: 10.20.4.1
            type: string
          external_ip:
            description: Only filled when of type LB
            type: string
            example: ""
          ports:
            type: array
            items:
              properties:
                name:
                  type: string
                  example: None
                node_port:
                  type: string
                  example: 30439
                port:
                  type: string
                  example: 80
                protocol:
                  type: string
                  example: TCP
                target_port:
                  type: string
                  example: 80
  GetPodSummaryDescription:
    allOf:
      - $ref: '#/definitions/ResourceResponse'
      - properties:
          name:
            example: WebPodv1
          ip:
            type: string
            example: 10.20.4.3
          ports:
            type: array
            items:
              properties:
                name:
                  type: string
                  example: none
                container_port:
                  type: string
                  example: 80
          running_status:
            type: string
            example: True
  ClusterAliasDescription:
    title: ClusterAliasDescription
    properties:
      alias:
        type: string
        example: aws-cluster
  ClusterInfoBaseDescription:
    title: ClusterInfoBaseDescription
    properties:
      gslb_public_ip:
        type: string
        example: 54.218.175.136
      gslb_site_ip:
        type: string
        example: 172.20.96.45
      agent_id:
        type: string
        example: 2d30c68c-460c-4603-b3b4-a3ee1e83eb92
      id:
        type: string
        example: 8c97b9d3-e8e4-4486-9a94-a51fca2e6048
      token:
        type: string
        example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImRlZmF1bHQtdG9rZW4tdDVsdDUiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGVmYXVsdCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6ImUzZmQ5OTgxLTY0NDgtMTFlOC05MmY3LTA2Nzg2M2RhMDVkYyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmRlZmF1bHQifQ.E0rRqgBEl1SbevJLQMGJKN5jPilp_oqRSffHGe-j88k3OyGN5KNyZdevUlwdgcBoQkxcUxfYaF5H-7nUXykkx-gHQLUnDR6LIXFBXeIkvE2j1Ou2d3B1wqFtTJZN6-GXNEvFgbQo-1fd63sGwLUkpffKhn8Lg7J3SWyAdhNdF3w-sKd5xN-GLC_04hoek12DpPy2RzOAS6wvQXN9njmCuBtCXzqP4BksPfzfmMS8qFN-cQBH_4k4L_noSz4dyQMScKY9m3k4Uwr0UY8GVr7sS3EGweCoLgT-64feXUTynj6CFWhB3-b-xYBHfm2XmINLdIft3qDj9NmOh8oI1xOKKA
  ClusterInfoFullurlDescription:
    title: ClusterInfoFullurlDescription
    properties:
      url:
        type: string
        example: https://api-honeycomb-k8s-local-n8uumm-1359586146.us-west-2.elb.amazonaws.com:443
  ClusterInfoUrlpartsDescription:
    title: ClusterInfoUrlpartsDescription
    properties:
      k8s_server:
        type: string
        example: api-honeycomb-k8s-local-n8uumm-1359586146.us-west-2.elb.amazonaws.com
      port:
        type: string
        example: 443
      protocol:
        type: string
        example: https
  ClusterInfoDescription:
    title: ClusterInfoDescription
    allOf:
      - $ref: '#/definitions/ClusterAliasDescription'
      - $ref: '#/definitions/ClusterInfoBaseDescription'
      - $ref: '#/definitions/ClusterInfoUrlpartsDescription'
      - properties:
          authtype:
            type: string
            example: token
          health:
            type: string
            example: UP
  GetAllClustersResponseBody:
      type: object
      properties:
        clusters:
          type: array
          items:
            $ref: '#/definitions/ClusterInfoDescription'
  GetAllClustersByAliasResponseBody:
      type: object
      properties:
        clusters:
          type: array
          items:
            $ref: '#/definitions/ClusterInfoDescription'
  GetClusterHealthByAliasResponseBody:
      type: object
      properties:
        health:
          type: string
          example: "DOWN"
        reason:
          type: string
          example: "Token is invalid"
  GetIngressSummaryDescription:
    allOf:
      - $ref: '#/definitions/ResourceResponse'
      - properties:
          name:
            example: Citrix Ingress
          address:
            type: string
            example: 10.2.3.45
  PostClusterSpecBaseRequestBody:
    title: PostClusterSpecBaseRequestBody
    allOf:
      - $ref: '#/definitions/ClusterAliasDescription'
      - $ref: '#/definitions/ClusterInfoBaseDescription'
      - $ref: '#/definitions/ClusterInfoFullurlDescription'
  PostClusterSpecRequestBody:
    title: PostClusterSpecRequestBody
    type: object
    properties:
      cluster:
        $ref: '#/definitions/PostClusterSpecBaseRequestBody'
  PutClusterSpecRequestBody:
    title: PutClusterSpecRequestBody
    properties:
      cluster:
        allOf:
          - $ref: '#/definitions/ClusterInfoBaseDescription'
          - $ref: '#/definitions/ClusterInfoFullurlDescription'
  PutClusterResponseBody:
    title: PutClusterResponseBody
    properties:
      put_status:
        type: string
        example: "Cluster Modified"
  DeleteClusterResponseBody:
    title: DeleteClusterResponseBody
    properties:
      delete_status:
        type: string
        example: "Cluster Deleted"
  PostClusterSpecResponseBody:
    title: PostClusterSpecResponseBody
    type: object
    properties:
      status:
        type: string
        example: "Cluster Added"
  RestClusterResponseBody:
    title: PostClusterSpecResponseBody
    type: object
    properties:
      status:
        type: string
        example: "Cluster reset"
  ExportNewIngressSpecDescription:
    allOf:
      - $ref: '#/definitions/ResourceBaseRequest'
      - required:
        - clusters
        - rules
      - properties:
          citrix-adm-ingress-id:
            type: string
            example: "12345-acbdse"
          description:
            type: string
          clusters:
            type: array
            items:
              $ref: '#/definitions/IngressClusterInfoDescription'
          default_path:
            $ref: '#/definitions/IngressDefaultRouteDescription'
          ingress_protocol:
            type: string
            example: HTTPS
          ingress_port:
            type: string
            example: 443
          gslb_config:
            $ref: '#/definitions/IngressGSLBConfigDescription'
          rules:
            type: array
            items:
              $ref: '#/definitions/IngressRuleDescription'
          secretName:
            type: string
            example: staging-tls-secret
  DeployIngressSpecRequestBody:
    title: DeployIngressSpecRequestBody
    type: object
    properties:
      ingress:
        type: string
        example: "apiversion: extensions/v1beta1\nkind: Ingress\nmetadata:\n  annotations:\n    citrix.kubernetes.ingress.global-lb/algorithm: STATICPROXIMITY\n    citrix.kubernetes.ingress.global-lb/domain-name: piggy.nsdevrocks.net\n    citrix.kubernetes.ingress.global-lb/ttl: '30'\n    citrix.kubernetes.ingress/citrix-adm-ingress-id: f074899e-a650-11e8-98d0-529269fb1459\n    citrix.kubernetes.ingress/clusters: aws-cluster,azure-cluster\n    citrix.kubernetes.ingress/description: Basic Ingress Config for Piggy Metrics\n      App\n  name: piggy-global-ingress-test\n  namespace: piggy\nspec:\n  backend:\n    serviceName: gateway\n    servicePort: 4000\n  rules:\n  - http:\n      paths:\n      - backend:\n          serviceName: account-service\n          servicePort: 6000\n        path: /account\n      - backend:\n          serviceName: auth-service\n          servicePort: 5000\n        path: /uaa\n"
  GetNamespaceSummaryDescription:
    title: GetNamespaceSummaryDescription
    allOf:
      - $ref: '#/definitions/ResourceBaseResponse'
    properties:
      status:
        type: string
        example: Active
  GetNodeSummaryDescription:
    allOf:
      - $ref: '#/definitions/ResourceBaseResponse'
      - properties:
          name:
            example: k8s-node-1
          role:
            type: string
            example: master
          ip:
            type: string
            example: 10.221.42.109
          running_status:
            type: string
            example: True
  GetDeploymentSummaryDescription:
    allOf:
      - $ref: '#/definitions/ResourceResponse'
      - properties:
          desired_replicas:
            type: integer
            example: 2
          available_replicas:
            type: integer
            example: 2
          total_replicas:
            type: integer
            example: 2
          unavailable_replicas:
            type: integer
            example: 0
  GetEndpointSummaryDescription:
    allOf:
      - $ref: '#/definitions/ResourceResponse'
      - properties:
          addresses:
            type: array
            items:
              properties:
                ip:
                  type: string
                  example: 10.44.0.6
                kind:
                  type: string
                  example: Pod
                name:
                  type: string
                  example: nginx-2wstt
          labels:
            type: string
          ports:
            type: array
            items:
              properties:
                name:
                  type: string
                  example: null
                port:
                  type: string
                  example: 80
                protocol:
                  type: string
                  example: TCP
  GetDaemonSetSummaryDescription:
    allOf:
      - $ref: '#/definitions/ResourceResponse'
      - properties:
          desired_number_scheduled:
            type: integer
            example: 3
          current_number_scheduled:
            type: integer
            example: 3
          number_ready:
            type: integer
            example: 3
          number_unavailable:
            type: integer
            example: 0
  SecretsInfoDescription:
    title: SecretsInfoDescription
    allOf:
      - properties:
          cert-contents:
            type: string
            example: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURFVENDQWZtZ0F3SUJBZ0lKQUtTQUlZMWtKY21JTUEwR0NTcUdTSWIzRFFFQkN3VUFNQjh4SFRBYkJnTlYKQkFNTUZIQnBaMmQ1TG01elpHVjJjbTlqYTNNdWJtVjBNQjRYRFRFNU1ESXlOVEl6TVRReE4xb1hEVEl3TURJeQpOVEl6TVRReE4xb3dIekVkTUJzR0ExVUVBd3dVY0dsbloza3Vibk5rWlhaeWIyTnJjeTV1WlhRd2dnRWlNQTBHCkNTcUdTSWIzRFFFQkFRVUFBNElCRHdBd2dnRUtBb0lCQVFEYjRieXYrbmo3TmorcVIwNDAvS0lkbi9Ic1J5YUcKVkFHcWFGVnhRQ001L1Z3c1dXa1NiTHJ6cEhES1ZJZjRiUGQ5c1dTdll2Ukk4U2RZTy9uL3orTGpsMVBVci9XMwovREVSQnF0QWtxZzNXQUZ5UjZQMHZJY3hMd1hKYnVtbndKZ1dIVjFSZ2d5YXVOUE4xZm96ZVVuZm1BYVpPakhGCnJzeFlLeWUzU2pTd0VSRCtHMWllQW4yRlpQNFZjdXB3S25ZWkltSW5FMFkyYU92UU80WVhJcVd3VTA4RUludVEKMldIQkZydHduS2FwQmFQckd2bFV6bVMrQ01DQ3l1bWZla01LRGxLVjJvYzJ5S3F0TFVWeWZYSmh4bHoz
          cert-file:
            type: string
            example: tls.crt
          key-contents:
            type: string
            example: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb3dJQkFBS0NBUUVBMitHOHIvcDQrelkvcWtkT05QeWlIWi94N0VjbWhsUUJxbWhWY1VBak9mMWNMRmxwCkVteTY4NlJ3eWxTSCtHejNmYkZrcjJMMFNQRW5XRHY1LzgvaTQ1ZFQxSy8xdC93eEVRYXJRSktvTjFnQmNrZWoKOUx5SE1TOEZ5VzdwcDhDWUZoMWRVWUlNbXJqVHpkWDZNM2xKMzVnR21Ub3h4YTdNV0NzbnQwbzBzQkVRL2h0WQpuZ0o5aFdUK0ZYTHFjQ3AyR1NKaUp4TkdObWpyMER1R0Z5S2xzRk5QQkNKN2tObGh3UmE3Y0p5bXFRV2o2eHI1ClZNNWt2Z2pBZ3NycG4zcERDZzVTbGRxSE5zaXFyUzFGY24xeVljWmM5M1RyNlRwZVNsakRWdGI5VXBrYm5kSWUKQnZOcjJESFh1ell5ajJDNWNNR3Q0b29vZHByazlyTGpKYWNVdXdJREFRQUJBb0lCQVFDREw5cUE4Q0xRVnR5RApQb25WcVVrYi9icThLdk04UDlEQ2wvOHFVNGJ3NlUzZUUvWlJqTmU1MThtSG5nbUYyWldMdzVQNzVFRTFaOVArCm04SWJzeTkrZEdJS3luVURNWThneG1iVVh1dklJVlN6bHpTbUp2bE9DZTBjOG5TcnBvZlc0ZXcwWGpBZys5YzYKdnNqSmZ6cnBFVzRXYTVjWWg2TFprOTNkU0lQSTZ6cVVXYVFpdG4yK3ZLamNMSDlrVG1GM3J3MFJSTlN6VVpCUQo3WUJBdyt5ZGhtSDZXaGtWZWduNXJJL2xvbmpZdzZEVHBWQjNoQTdrdWhoMVJCbXkxVEdlcFZqMm1rS3A2NmdmCncwS2tITTM3UlVlUUtPTHNzL0loK1VkeW5IbC9iMlNUaVNleVlFS1BQMmY5WkxyY3EvWWJVclZUR0FmM0NtRVQKTkd4U2E1e
          key-file:
            type: string
            example: tls.key
          name:
            type: string
            example: bidyut-secret
  GetAllServicesResponseBody:
    title: GetAllServicesResponse
    type: object
    properties:
      services:
        type: array
        items:
          $ref: '#/definitions/GetServiceSummaryDescription'
  GetServiceByIDResponseBody:
    title: GetServiceReponseById
    type: object
    properties:
      service:
        $ref: '#/definitions/GetServiceSummaryDescription'
  GetAllPodsResponseBody:
    title: GetAllPodsResponse
    type: object
    properties:
      pods:
        type: array
        items:
          $ref: '#/definitions/GetPodSummaryDescription'
  GetPodByIDResponseBody:
    title: GetPodByIDResponse
    type: object
    properties:
      pod:
        $ref: '#/definitions/GetPodSummaryDescription'
  GetAllIngressesResponseBody:
    title: GetAllIngressesResponse
    type: object
    properties:
      ingresses:
        type: array
        items:
          $ref: '#/definitions/ExportNewIngressSpecDescription'
  GetIngressByIDResponseBody:
    title: GetIngressByIDResponse
    type: object
    properties:
      ingress:
        $ref: '#/definitions/ExportNewIngressSpecDescription'
  ExportNewIngressSpecResponseBody:
    title: ExportNewIngressSpecResponseBody
    type: object
    properties:
      ingress_yaml:
        type: string
        example: "apiversion: extensions/v1beta\nkind: Ingress\nmetadata:\n  annotations:\n    citrix.kubernetes.ingress.global-lb/algorithm: STATICPROXIMITY\n    citrix.kubernetes.ingress.global-lb/domain-name: piggy.nsdevrocks.net\n    citrix.kubernetes.ingress.global-lb/ttl: '30'\n    citrix.kubernetes.ingress/citrix-adm-ingress-id: f074899e-a650-11e8-98d0-529269fb1459\n  citrix.kubernetes.ingress/clusters: K8s-AZURE-US-East, K8s-AWS-US-West-2\n    citrix.kubernetes.ingress/description: Basic Ingress Config for Piggy Metrics\n      App\n  name: piggy-global-ingress-test\n  namespace: piggy\nspec:\n  backend:\n    serviceName: gateway\n    servicePort: 4000\n  rules:\n  - http:\n      paths:\n      - backend:\n          serviceName: account-service\n          servicePort: 6000\n        path: /account\n      - backend:\n          serviceName: auth-service\n         servicePort: 5000\n        path: /uaa\n"
  ExportNewIngressSpecRequestBody:
    title: CreateIngressRequestBody
    type: object
    properties:
      ingress:
        $ref: '#/definitions/ExportNewIngressSpecDescription'
  DeployIngressSpecResponseStatusBody:
    title: DeployIngressSpecResponseStatusBody
    type: object
    properties:
      status:
        type: string
        example: success
  DeployNewIngressSpecResponseBody:
    title: DeployNewIngressSpecResponseBody
    type: object
    properties:
      deploy_status:
        type: array
        items:
          $ref: '#/definitions/DeployIngressSpecResponseStatusBody'
  UpdateIngressSpecResponseBody:
    title: UpdateIngressSpecResponseBody
    type: object
    properties:
      modify_status:
        type: array
        items:
          $ref: '#/definitions/DeployIngressSpecResponseStatusBody'
  DeleteIngressSpecResponseBody:
    title: DeleteIngressSpecResponseBody
    type: object
    properties:
      delete_status:
        type: array
        items:
          $ref: '#/definitions/DeployIngressSpecResponseStatusBody'
  GetAllNamespacesResponseBody:
    title: GetAllNamespacesResponse
    type: object
    properties:
      namespaces:
        type: array
        items:
          $ref: '#/definitions/GetNamespaceSummaryDescription'
  GetNamespaceByIDResponseBody:
    title: GetNamespaceByIDResponse
    type: object
    properties:
      namespace:
        $ref: '#/definitions/GetNamespaceSummaryDescription'
  GetAllNodesResponseBody:
    title: GetAllNodesResponse
    type: object
    properties:
      nodes:
        type: array
        items:
          $ref: '#/definitions/GetNodeSummaryDescription'
  GetNodeByIDResponseBody:
    title: GetNodeByIDResponse
    type: object
    properties:
      nodes:
        $ref: '#/definitions/GetNodeSummaryDescription'
  GetAllDeploymentsResponseBody:
    title: GetAllDeploymentsResponse
    type: object
    properties:
      deployments:
        type: array
        items:
          $ref: '#/definitions/GetDeploymentSummaryDescription'
  GetDeploymentByIDResponseBody:
    title: GetDeploymentByIDResponse
    type: object
    properties:
      deployments:
        $ref: '#/definitions/GetDeploymentSummaryDescription'
  GetAllEndpointsResponseBody:
    title: GetAllEndpointsResponse
    type: object
    properties:
      endpoints:
        type: array
        items:
          $ref: '#/definitions/GetEndpointSummaryDescription'
  GetEndpointByIDResponseBody:
    title: GetEndpointByIDResponse
    type: object
    properties:
      endpoints:
        $ref: '#/definitions/GetEndpointSummaryDescription'
  GetAllDaemonSetsResponseBody:
    title: GetAllDaemonSetsResponse
    type: object
    properties:
      daemonsets:
        type: array
        items:
          $ref: '#/definitions/GetDaemonSetSummaryDescription'
  GetDaemonSetByIDResponseBody:
    title: GetDaemonSetByIDResponse
    type: object
    properties:
      daemonsets:
        $ref: '#/definitions/GetDaemonSetSummaryDescription'
  GetAllSecretsResponseBody:
    title: GetAllSecretsResponse
    type: object
    properties:
      secrets:
        type: array
        items:
          $ref: '#/definitions/SecretsInfoDescription'
  BadRequestResponseBody:
    properties:
      errorcode:
        type: integer
        example: 44572
      message:
        type: string
        example: Requested parameters are invalid.
  PermissionDeniedResponseBody:
    allOf:
      - $ref: '#/definitions/BadRequestResponseBody'
    properties:
      errorcode:
        type: integer
        example: 45629
      message:
        type: string
        example: Permission denied to access cluster details.
  ErrorResponseBody:
    properties:
      errorcode:
        type: integer
        example: 45633
      message:
        type: string
        example: Error connecting to Kubernetes Cluster
# Added by API Auto Mocking Plugin
# Added by API Auto Mocking Plugin
host: 'adm.cloud.com'
# basePath: /ctxs/k8sadapter/1.0.0
# Added by API Auto Mocking Plugin
basePath: /kad/nitro/v1/config
