swagger: '2.0'
info:
  description: Configuration for MPS Datacenter resource.
  version: 'v2'
  title: mps_datacenter
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: mps_datacenter
    description: MPS Datacenter
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 for all the system users
   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/mps_datacenter:
    get:
      tags:
        - mps_datacenter
      summary: GET all mps_datacenter
      operationId: getall_mps_datacenter
      description: Use this operation to get Agent information
      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 mps_datacenter 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 mps_datacenter 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 mps_datacenter resources.
          enum:
            - yes
      responses:
        200:
          description:  for mps_datacenter
          schema: 
              $ref: '#/definitions/getmps_datacentersResponse'
        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'

    post:
      tags:
        - mps_datacenter
      summary: POST operation for mps_datacenter
      operationId: post_mps_datacenter
      description: POST operation for mps_datacenter
      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: onerror
          description: Use this parameter to set the onerror status for nitro request. Applicable only for bulk requests.
          required: false
          type: string
          default: CONTINUE
          enum:
            - EXIT
            - CONTINUE
        - in: body
          name: mps_datacenter
          description: mps_datacenter object
          schema:
              $ref: '#/definitions/addmps_datacenterRequest'
      responses:
        200:
          description: add for mps_datacenter
          schema: 
              $ref: '#/definitions/addmps_datacenterResponse'
        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/mps_datacenter/{id}:
    get:
      tags:
        - mps_datacenter
      summary: GET by key for mps_datacenter
      operationId: getbykey_mps_datacenter
      description: Use this operation to get Agent information
      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: add for mps_datacenter
          schema: 
              $ref: '#/definitions/getmps_datacenterResponse'
        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'

    put:
      tags:
        - mps_datacenter
      summary: PUT for mps_datacenter
      operationId: putbykey_mps_datacenter
      description: Use this operation to modify Agent information
      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
        - in: body
          name: mps_datacenter
          description: mps_datacenter object
          schema:
              $ref: '#/definitions/modifymps_datacenterRequest'
      responses:
        200:
          description: add for mps_datacenter
          schema: 
              $ref: '#/definitions/modifymps_datacenterResponse'
        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'

    delete:
      tags:
        - mps_datacenter
      summary: Delete for mps_datacenter
      operationId: deletebykey_mps_datacenter
      description: Use this operation to delete Agent information
      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:
        204:
          description: add for mps_datacenter
        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:
  addmps_datacenterRequest:
    type: object
    required:
      - mps_datacenter
    properties:
      mps_datacenter:
        $ref: '#/definitions/mps_datacenter_readwrite'
    title: addmps_datacenterRequest
    example:
      mps_datacenter:
        itm_radar_url: "https://fqdn/url/r20.gif"
        cloud_vpc: "us-west-vpc"
        itm_radar_instance_id: "false"
        city: "Bangalore"
        tenant_id: "2b38ae44-a824-4f51-a155-23abc28d81fc"
        cloud_provider: "Private"
        latitude: "8.896610"
        country: "INDIA"
        itm_radar_rum: "0"
        longitude: "77.407043"
        location: "Bangalore"
        name: "BLR-Site"
        region: "KARNATAKA"
        zipcode: "560042"
        itm_radar_region: "us-east-1"
        cloud_region: "AWS-US-WEST"
        type: "1"
        count_map: [{        value: "string_value"
,        key: "string_value"
}]
        application_name: "outlook-app"
        device_ip: "1.1.1.1"

  addmps_datacenterResponse:
    type: object
    required:
      - mps_datacenter
    properties:
      mps_datacenter:
        $ref: '#/definitions/mps_datacenter'
    title: addmps_datacenterResponse
    example:
      mps_datacenter:
        itm_radar_url: "https://fqdn/url/r20.gif"
        cloud_vpc: "us-west-vpc"
        itm_radar_instance_id: "false"
        city: "Bangalore"
        tenant_id: "2b38ae44-a824-4f51-a155-23abc28d81fc"
        cloud_provider: "Private"
        latitude: "8.896610"
        id: "24d93836-5398-4b2d-9334-b421ce2a17a7"
        country: "INDIA"
        itm_radar_rum: "0"
        is_default: "false"
        longitude: "77.407043"
        location: "Bangalore"
        name: "BLR-Site"
        region: "KARNATAKA"
        zipcode: "560042"
        itm_radar_region: "us-east-1"
        cloud_region: "AWS-US-WEST"
        type: "1"
        customer_name: "admTenant"
        count_map: [{        value: "string_value"
,        key: "string_value"
}]
        total_critical_events: "4"
        total_number_of_devices: "5"
        application_name: "outlook-app"
        total_major_events: "6"
        total_events: "15"
        total_number_of_agents: "5"
        device_ip: "1.1.1.1"

  getmps_datacenterResponse:
    type: object
    required:
      - mps_datacenter
    properties:
      mps_datacenter:
        $ref: '#/definitions/mps_datacenter'
    title: getmps_datacenterResponse
    example:
      mps_datacenter:
        itm_radar_url: "https://fqdn/url/r20.gif"
        cloud_vpc: "us-west-vpc"
        itm_radar_instance_id: "false"
        city: "Bangalore"
        tenant_id: "2b38ae44-a824-4f51-a155-23abc28d81fc"
        cloud_provider: "Private"
        latitude: "8.896610"
        id: "24d93836-5398-4b2d-9334-b421ce2a17a7"
        country: "INDIA"
        itm_radar_rum: "0"
        is_default: "false"
        longitude: "77.407043"
        location: "Bangalore"
        name: "BLR-Site"
        region: "KARNATAKA"
        zipcode: "560042"
        itm_radar_region: "us-east-1"
        cloud_region: "AWS-US-WEST"
        type: "1"
        customer_name: "admTenant"
        count_map: [{        value: "string_value"
,        key: "string_value"
}]
        total_critical_events: "4"
        total_number_of_devices: "5"
        application_name: "outlook-app"
        total_major_events: "6"
        total_events: "15"
        total_number_of_agents: "5"
        device_ip: "1.1.1.1"

  getmps_datacentersResponse:
    type: object
    required:
      - mps_datacenter
    properties:
      mps_datacenter:
        type: array
        items:
          $ref: '#/definitions/mps_datacenter'
    title: getmps_datacentersResponse
    example:
      mps_datacenter:
        itm_radar_url: "https://fqdn/url/r20.gif"
        cloud_vpc: "us-west-vpc"
        itm_radar_instance_id: "false"
        city: "Bangalore"
        tenant_id: "2b38ae44-a824-4f51-a155-23abc28d81fc"
        cloud_provider: "Private"
        latitude: "8.896610"
        id: "24d93836-5398-4b2d-9334-b421ce2a17a7"
        country: "INDIA"
        itm_radar_rum: "0"
        is_default: "false"
        longitude: "77.407043"
        location: "Bangalore"
        name: "BLR-Site"
        region: "KARNATAKA"
        zipcode: "560042"
        itm_radar_region: "us-east-1"
        cloud_region: "AWS-US-WEST"
        type: "1"
        customer_name: "admTenant"
        count_map: [{        value: "string_value"
,        key: "string_value"
}]
        total_critical_events: "4"
        total_number_of_devices: "5"
        application_name: "outlook-app"
        total_major_events: "6"
        total_events: "15"
        total_number_of_agents: "5"
        device_ip: "1.1.1.1"

  modifymps_datacenterRequest:
    type: object
    required:
      - mps_datacenter
    properties:
      mps_datacenter:
        $ref: '#/definitions/mps_datacenter_readwrite'
    title: modifymps_datacenterRequest
    example:
      mps_datacenter:
        itm_radar_url: "https://fqdn/url/r20.gif"
        cloud_vpc: "us-west-vpc"
        itm_radar_instance_id: "false"
        city: "Bangalore"
        tenant_id: "2b38ae44-a824-4f51-a155-23abc28d81fc"
        cloud_provider: "Private"
        latitude: "8.896610"
        country: "INDIA"
        itm_radar_rum: "0"
        longitude: "77.407043"
        location: "Bangalore"
        name: "BLR-Site"
        region: "KARNATAKA"
        zipcode: "560042"
        itm_radar_region: "us-east-1"
        cloud_region: "AWS-US-WEST"
        type: "1"
        count_map: [{        value: "string_value"
,        key: "string_value"
}]
        application_name: "outlook-app"
        device_ip: "1.1.1.1"

  modifymps_datacenterResponse:
    type: object
    required:
      - mps_datacenter
    properties:
      mps_datacenter:
        $ref: '#/definitions/mps_datacenter'
    title: modifymps_datacenterResponse
    example:
      mps_datacenter:
        itm_radar_url: "https://fqdn/url/r20.gif"
        cloud_vpc: "us-west-vpc"
        itm_radar_instance_id: "false"
        city: "Bangalore"
        tenant_id: "2b38ae44-a824-4f51-a155-23abc28d81fc"
        cloud_provider: "Private"
        latitude: "8.896610"
        id: "24d93836-5398-4b2d-9334-b421ce2a17a7"
        country: "INDIA"
        itm_radar_rum: "0"
        is_default: "false"
        longitude: "77.407043"
        location: "Bangalore"
        name: "BLR-Site"
        region: "KARNATAKA"
        zipcode: "560042"
        itm_radar_region: "us-east-1"
        cloud_region: "AWS-US-WEST"
        type: "1"
        customer_name: "admTenant"
        count_map: [{        value: "string_value"
,        key: "string_value"
}]
        total_critical_events: "4"
        total_number_of_devices: "5"
        application_name: "outlook-app"
        total_major_events: "6"
        total_events: "15"
        total_number_of_agents: "5"
        device_ip: "1.1.1.1"

  mps_datacenter_readwrite:
    type: object
    properties:
      itm_radar_url:
        description: "ITM Radar endpoint for an ADM site"
        type: string
        format: string
      cloud_vpc:
        description: "cloud_vpc"
        type: string
        format: string
        maxLength: 64
      itm_radar_instance_id:
        description: "The Instance id of the target Netscaler in which the radar object will be deployed"
        type: string
        format: string
        maxLength: 64
      city:
        description: "Name of the city"
        type: string
        format: string
        maxLength: 64
      tenant_id:
        description: "Tenant ID"
        type: string
        format: uuid
      cloud_provider:
        description: "Cloud Provide"
        type: string
        format: string
      latitude:
        description: "latitude of the city"
        type: number
        format: double
      country:
        description: "Name of the country"
        type: string
        format: string
        maxLength: 32
      itm_radar_rum:
        description: "ITM Radar RUM enumeration to enable or not"
        type: string
        format: string
        maxLength: 32
      longitude:
        description: "longitude of the city"
        type: number
        format: double
      location:
        description: "Location Name"
        type: string
        format: string
      name:
        description: "Datacentre Name"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      region:
        description: "Name of the region"
        type: string
        format: string
        maxLength: 64
      zipcode:
        description: "Zipcode of location"
        type: string
        format: string
        maxLength: 32
      itm_radar_region:
        description: "The public cloud region value for ITM Radat"
        type: string
        format: string
        maxLength: 64
      cloud_region:
        description: "cloud_region"
        type: string
        format: string
        maxLength: 64
      type:
        description: "Datacenter type: Site/Datacenter"
        type: integer
        format: int32
      count_map:
        type: array
        items:
          $ref: '#/definitions/entity_map_readwrite'
      application_name:
        description: "Application Name"
        type: string
        format: string
      device_ip:
        description: "Device Ip"
        type: string
        format: string

  mps_datacenter:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the system users
            type: string
            format: uuid
          total_critical_events:
             description: "Total Critical events city wise."
             type: integer
             format: int32
          total_number_of_devices:
             description: "Total number of devices deployed city wise.."
             type: integer
             format: int32
          total_major_events:
             description: "Total major events."
             type: integer
             format: int32
          total_events:
             description: "Total events city wise."
             type: integer
             format: int32
          total_number_of_agents:
             description: "Total number of agents deployed city wise."
             type: integer
             format: int32
      - $ref: '#/definitions/mps_datacenter_readwrite'

  entity_map_readwrite:
    type: object
    properties:
      value:
        description: "value"
        type: string
        format: string
        minLength: 1
        maxLength: 1024
      key:
        description: "key"
        type: string
        format: string
        minLength: 1
        maxLength: 1024

  entity_map:
    allOf:
      - $ref: '#/definitions/entity_map_readwrite'

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