swagger: '2.0'
info:
  description: Configuration for SMS profile resource.
  version: 'v2'
  title: sms_profile
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: sms_profile
    description: SMS profile
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 sms profile.
   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/sms_profile:
    get:
      tags:
        - sms_profile
      summary: GET all sms_profile
      operationId: getall_sms_profile
      description: Use this operation to get sms profile.
      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 sms_profile 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 sms_profile 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 sms_profile resources.
          enum:
            - yes
      responses:
        200:
          description:  for sms_profile
          schema: 
              $ref: '#/definitions/getsms_profilesResponse'
        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:
        - sms_profile
      summary: POST operation for sms_profile
      operationId: post_sms_profile
      description: POST operation for sms_profile
      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: sms_profile
          description: sms_profile object
          schema:
              $ref: '#/definitions/addsms_profileRequest'
      responses:
        200:
          description: add for sms_profile
          schema: 
              $ref: '#/definitions/addsms_profileResponse'
        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/sms_profile/{id}:
    get:
      tags:
        - sms_profile
      summary: GET by key for sms_profile
      operationId: getbykey_sms_profile
      description: Use this operation to get sms profile.
      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 sms_profile
          schema: 
              $ref: '#/definitions/getsms_profileResponse'
        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:
        - sms_profile
      summary: PUT for sms_profile
      operationId: putbykey_sms_profile
      description: Use this operation to modify sms profile.
      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: sms_profile
          description: sms_profile object
          schema:
              $ref: '#/definitions/modifysms_profileRequest'
      responses:
        200:
          description: add for sms_profile
          schema: 
              $ref: '#/definitions/modifysms_profileResponse'
        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:
        - sms_profile
      summary: Delete for sms_profile
      operationId: deletebykey_sms_profile
      description: Use this operation to delete sms profile.
      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 sms_profile
        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:
  addsms_profileRequest:
    type: object
    required:
      - sms_profile
    properties:
      sms_profile:
        $ref: '#/definitions/sms_profile_readwrite'
    title: addsms_profileRequest
    example:
      sms_profile:
        to_list: "1111111111,1111111112"
        server_name: "test_sms"
        profile_name: "sms_test"

  addsms_profileResponse:
    type: object
    required:
      - sms_profile
    properties:
      sms_profile:
        $ref: '#/definitions/sms_profile'
    title: addsms_profileResponse
    example:
      sms_profile:
        tenant_id: "c86b7da4-1f69-4218-aa01-a6960ffd8141"
        to_list: "1111111111,1111111112"
        id: "689b7cfc-7bda-41e5-9c2e-9c51b3611d8a"
        server_name: "test_sms"
        profile_name: "sms_test"

  getsms_profileResponse:
    type: object
    required:
      - sms_profile
    properties:
      sms_profile:
        $ref: '#/definitions/sms_profile'
    title: getsms_profileResponse
    example:
      sms_profile:
        tenant_id: "c86b7da4-1f69-4218-aa01-a6960ffd8141"
        to_list: "1111111111,1111111112"
        id: "689b7cfc-7bda-41e5-9c2e-9c51b3611d8a"
        server_name: "test_sms"
        profile_name: "sms_test"

  getsms_profilesResponse:
    type: object
    required:
      - sms_profile
    properties:
      sms_profile:
        type: array
        items:
          $ref: '#/definitions/sms_profile'
    title: getsms_profilesResponse
    example:
      sms_profile:
        tenant_id: "c86b7da4-1f69-4218-aa01-a6960ffd8141"
        to_list: "1111111111,1111111112"
        id: "689b7cfc-7bda-41e5-9c2e-9c51b3611d8a"
        server_name: "test_sms"
        profile_name: "sms_test"

  modifysms_profileRequest:
    type: object
    required:
      - sms_profile
    properties:
      sms_profile:
        $ref: '#/definitions/sms_profile_readwrite'
    title: modifysms_profileRequest
    example:
      sms_profile:
        to_list: "1111111111,1111111112"
        server_name: "test_sms"
        profile_name: "sms_test"

  modifysms_profileResponse:
    type: object
    required:
      - sms_profile
    properties:
      sms_profile:
        $ref: '#/definitions/sms_profile'
    title: modifysms_profileResponse
    example:
      sms_profile:
        tenant_id: "c86b7da4-1f69-4218-aa01-a6960ffd8141"
        to_list: "1111111111,1111111112"
        id: "689b7cfc-7bda-41e5-9c2e-9c51b3611d8a"
        server_name: "test_sms"
        profile_name: "sms_test"

  sms_profile_readwrite:
    type: object
    properties:
      to_list:
        description: "To list."
        type: string
        format: string
        minLength: 1
      server_name:
        description: "SMS server name"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      profile_name:
        description: "Profile name for the sms setting."
        type: string
        format: string
        minLength: 1
        maxLength: 128

  sms_profile:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the sms profile.
            type: string
            format: uuid
          tenant_id:
             description: "Tenant Id of the Config Jobs"
             type: string
             format: uuid
      - $ref: '#/definitions/sms_profile_readwrite'

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