swagger: '2.0'
info:
  description: Configuration for Syslog Parameters resource.
  version: 'v2'
  title: syslog_params
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: syslog_params
    description: Syslog Parameters
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/syslog_params:
    get:
      tags:
        - syslog_params
      summary: GET all syslog_params
      operationId: getall_syslog_params
      description: Use this operation to get the syslog parameters
      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 syslog_params 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 syslog_params 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 syslog_params resources.
          enum:
            - yes
      responses:
        200:
          description:  for syslog_params
          schema: 
              $ref: '#/definitions/getsyslog_paramssResponse'
        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/syslog_params/{id}:
    get:
      tags:
        - syslog_params
      summary: GET by key for syslog_params
      operationId: getbykey_syslog_params
      description: Use this operation to get the syslog parameters
      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 syslog_params
          schema: 
              $ref: '#/definitions/getsyslog_paramsResponse'
        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:
        - syslog_params
      summary: PUT for syslog_params
      operationId: putbykey_syslog_params
      description: Use this operation to modify the syslog parameters
      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: syslog_params
          description: syslog_params object
          schema:
              $ref: '#/definitions/modifysyslog_paramsRequest'
      responses:
        200:
          description:  for syslog_params
          schema: 
              $ref: '#/definitions/modifysyslog_paramsResponse'
        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:
  getsyslog_paramsResponse:
    type: object
    required:
      - syslog_params
    properties:
      syslog_params:
        $ref: '#/definitions/syslog_params'
    title: getsyslog_paramsResponse
    example:
      syslog_params:
        date_format: "string_value"
        timezone: "string_value"
        id: "a36127db-23a5-4ad1-b329-0a067cd0f431"

  getsyslog_paramssResponse:
    type: object
    required:
      - syslog_params
    properties:
      syslog_params:
        type: array
        items:
          $ref: '#/definitions/syslog_params'
    title: getsyslog_paramssResponse
    example:
      syslog_params:
        date_format: "string_value"
        timezone: "string_value"
        id: "a36127db-23a5-4ad1-b329-0a067cd0f431"

  modifysyslog_paramsRequest:
    type: object
    required:
      - syslog_params
    properties:
      syslog_params:
        $ref: '#/definitions/syslog_params_readwrite'
    title: modifysyslog_paramsRequest
    example:
      syslog_params:
        date_format: "string_value"
        timezone: "string_value"

  modifysyslog_paramsResponse:
    type: object
    required:
      - syslog_params
    properties:
      syslog_params:
        $ref: '#/definitions/syslog_params'
    title: modifysyslog_paramsResponse
    example:
      syslog_params:
        date_format: "string_value"
        timezone: "string_value"
        id: "a36127db-23a5-4ad1-b329-0a067cd0f431"

  syslog_params_readwrite:
    type: object
    properties:
      date_format:
        description: "Format of date to be added in the syslog message"
        type: string
        format: string
      timezone:
        description: "Timezone to be used in the syslog message"
        type: string
        format: string

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

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