swagger: '2.0'
info:
  description: Configuration for Config Data for Global Service Graph resource.
  version: 'v2'
  title: global_service_graph_config_mapping
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: global_service_graph_config_mapping
    description: Config Data for Global Service Graph
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: id
   in: path
   type: string
   description: Id is system generated key
   required: true
  authParam:
      in: header
      name: Authorization
      type: string
      required: true
      description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
  cloudParam:
      in: header
      name: isCloud
      type: string
      required: true
      description: set the value to true in case of Cloud services, false for on-prem deployment
paths:
  /massvc/{customerid}/nitro/v2/config/global_service_graph_config_mapping:
    get:
      tags:
        - global_service_graph_config_mapping
      summary: GET all global_service_graph_config_mapping
      operationId: getall_global_service_graph_config_mapping
      description: K8 cluster service details
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
        - in: query
          name: filter
          type: string
          required: false
          description: "Use this query-parameter to get the filtered set of vm_device resources configured on the system. You can set a filter on any property of the resource.Example:  property-name1:property-value1 "
        - in: query
          name: pagesize
          type: integer
          required: false
          description: Use this query-parameter to get the global_service_graph_config_mapping resources in chunks.To be used along with pageno query parameter.
        - in: query
          name: pageno
          type: integer
          required: false
          description: Use this query-parameter to get the global_service_graph_config_mapping resources in chunks.To be used along with pagesize query parameter.
        - in: query
          name: count
          type: string
          required: false
          description: Use this query-parameter to get the count of global_service_graph_config_mapping resources.
          enum:
            - yes
      responses:
        200:
          description:  for global_service_graph_config_mapping
          schema: 
              $ref: '#/definitions/getglobal_service_graph_config_mappingsResponse'
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

  /massvc/{customerid}/nitro/v2/config/global_service_graph_config_mapping/{id}:
    get:
      tags:
        - global_service_graph_config_mapping
      summary: GET by key for global_service_graph_config_mapping
      operationId: getbykey_global_service_graph_config_mapping
      description: K8 cluster service details
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/idParam'
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
      responses:
        200:
          description:  for global_service_graph_config_mapping
          schema: 
              $ref: '#/definitions/getglobal_service_graph_config_mappingResponse'
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

definitions:
  getglobal_service_graph_config_mappingResponse:
    type: object
    required:
      - global_service_graph_config_mapping
    properties:
      global_service_graph_config_mapping:
        $ref: '#/definitions/global_service_graph_config_mapping'
    title: getglobal_service_graph_config_mappingResponse
    example:
      global_service_graph_config_mapping:
        k8s_pod_ip: "string_value"
        ns_ip_address: "1.1.1.1"
        rec_type: "1.1.1.1_v1"
        gslbvserver_name: "string_value"
        lbvserver_name: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        csvserver_name: "string_value"
        k8s_labels: "string_value"
        k8s_cluster_name: "string_value"
        gslb_adc_display_name: "string_value"
        rpt_sample_time: "1580922196"
        display_name: "NA"
        k8s_namespace: "string_value"
        gslb_adc_ip: "string_value"
        servername: "string_value"
        svc_name: "string_value"
        k8s_pod_name: "string_value"
        k8s_pod_state: "string_value"
        k8s_service_name: "string_value"

  getglobal_service_graph_config_mappingsResponse:
    type: object
    required:
      - global_service_graph_config_mapping
    properties:
      global_service_graph_config_mapping:
        type: array
        items:
          $ref: '#/definitions/global_service_graph_config_mapping'
    title: getglobal_service_graph_config_mappingsResponse
    example:
      global_service_graph_config_mapping:
        k8s_pod_ip: "string_value"
        ns_ip_address: "1.1.1.1"
        rec_type: "1.1.1.1_v1"
        gslbvserver_name: "string_value"
        lbvserver_name: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        csvserver_name: "string_value"
        k8s_labels: "string_value"
        k8s_cluster_name: "string_value"
        gslb_adc_display_name: "string_value"
        rpt_sample_time: "1580922196"
        display_name: "NA"
        k8s_namespace: "string_value"
        gslb_adc_ip: "string_value"
        servername: "string_value"
        svc_name: "string_value"
        k8s_pod_name: "string_value"
        k8s_pod_state: "string_value"
        k8s_service_name: "string_value"

  global_service_graph_config_mapping_readwrite:
    type: object
    properties:
      k8s_pod_ip:
        description: "POD Ip"
        type: string
        format: string
      ns_ip_address:
        description: "Device IP Address"
        type: string
        format: string
      rec_type:
        description: "Record Identifier"
        type: string
        format: string
      gslbvserver_name:
        description: "GSLB VServer Name"
        type: string
        format: string
      lbvserver_name:
        description: "LB VServer Name"
        type: string
        format: string
      csvserver_name:
        description: "CS VServer Name"
        type: string
        format: string
      k8s_labels:
        description: "Labels in Kubernetes"
        type: string
        format: string
      k8s_cluster_name:
        description: "Kubernetes cluster name"
        type: string
        format: string
        maxLength: 255
      gslb_adc_display_name:
        description: "GSLB Device IP Address"
        type: string
        format: string
      rpt_sample_time:
        description: "Report Sample time."
        type: number
        format: int64
      display_name:
        description: "Device IP Address"
        type: string
        format: string
      k8s_namespace:
        description: "Namespace of service in Kubernetes"
        type: string
        format: string
        maxLength: 255
      gslb_adc_ip:
        description: "GSLB NetScaler IP"
        type: string
        format: string
      servername:
        description: "Server Name"
        type: string
        format: string
      svc_name:
        description: "Service Name"
        type: string
        format: string
      k8s_pod_name:
        description: "Pod Name in Kubernetes"
        type: string
        format: string
      k8s_pod_state:
        description: "Pod State in Kubernetes"
        type: string
        format: string
      k8s_service_name:
        description: "Service Name in Kubernetes"
        type: string
        format: string
        maxLength: 255

  global_service_graph_config_mapping:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key
            type: string
            format: string
      - $ref: '#/definitions/global_service_graph_config_mapping_readwrite'

  Error:
    properties:
      errorcode:
        type: number
        format: int32
        example: 1001
      errormessage:
        type: string
        format: string
        example: "id cannot be found"
