swagger: '2.0'
info:
  description: Configuration for SSL certificate Threshold configuration resource.
  version: 'v2'
  title: ssl_cert_threshold
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: ssl_cert_threshold
    description: SSL certificate Threshold configuration
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 Thresholds configuration 
   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/ssl_cert_threshold:
    get:
      tags:
        - ssl_cert_threshold
      summary: GET all ssl_cert_threshold
      operationId: getall_ssl_cert_threshold
      description: Use this operation to get ssl certificate policy
      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 ssl_cert_threshold 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 ssl_cert_threshold 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 ssl_cert_threshold resources.
          enum:
            - yes
      responses:
        200:
          description:  for ssl_cert_threshold
          schema: 
              $ref: '#/definitions/getssl_cert_thresholdsResponse'
        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/ssl_cert_threshold/{id}:
    get:
      tags:
        - ssl_cert_threshold
      summary: GET by key for ssl_cert_threshold
      operationId: getbykey_ssl_cert_threshold
      description: Use this operation to get ssl certificate policy
      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 ssl_cert_threshold
          schema: 
              $ref: '#/definitions/getssl_cert_thresholdResponse'
        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:
        - ssl_cert_threshold
      summary: PUT for ssl_cert_threshold
      operationId: putbykey_ssl_cert_threshold
      description: Use this operation to modify ssl certificate policy
      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: ssl_cert_threshold
          description: ssl_cert_threshold object
          schema:
              $ref: '#/definitions/modifyssl_cert_thresholdRequest'
      responses:
        200:
          description:  for ssl_cert_threshold
          schema: 
              $ref: '#/definitions/modifyssl_cert_thresholdResponse'
        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:
  getssl_cert_thresholdResponse:
    type: object
    required:
      - ssl_cert_threshold
    properties:
      ssl_cert_threshold:
        $ref: '#/definitions/ssl_cert_threshold'
    title: getssl_cert_thresholdResponse
    example:
      ssl_cert_threshold:
        name: "threshold_config"
        rule: "order_by_metrics_value_20 > 10"
        stylebook_flag: "true"
        feature: "Analytics"
        hide_default_certs: "false"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        pagerduty_profile: "pagerduty_profile"
        servicenow_profile: "pagerduty_profile"
        city: "Santa Clara"
        key_strength_list: "string_value"
        tenant_name: "Owner"
        region: "LA"
        country: "USA"
        issuers_list: "string_value"
        sms_profile: "sms_profile_name"
        signature_algo_list: "string_value"
        slack_profile: "slack_profile_name"
        ctnsappname: "app_name"
        resource_type: "app_unit"
        mail_profile: "mail_profile_name"
        is_enabled: "true"
        duration: "l3"
        days_to_expiry: "30"
        ip_address: "1.1.1.1"
        ssl_protocol_list: "TLS1.0,TLS1.1,TLS1.2,TLS1.3"
        group_name: "WEB"
        reference_key: "attribute"
        exporter_id: "174483313"
        approved_ssl_protocol_list: "TLS1.3"
        approved_key_strength_list: "4096"
        approved_issuers_list: "Baltimore,Comodo"
        approved_signature_algo_list: "MD2-RSA,MD5-RSA"

  getssl_cert_thresholdsResponse:
    type: object
    required:
      - ssl_cert_threshold
    properties:
      ssl_cert_threshold:
        type: array
        items:
          $ref: '#/definitions/ssl_cert_threshold'
    title: getssl_cert_thresholdsResponse
    example:
      ssl_cert_threshold:
        name: "threshold_config"
        rule: "order_by_metrics_value_20 > 10"
        stylebook_flag: "true"
        feature: "Analytics"
        hide_default_certs: "false"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        pagerduty_profile: "pagerduty_profile"
        servicenow_profile: "pagerduty_profile"
        city: "Santa Clara"
        key_strength_list: "string_value"
        tenant_name: "Owner"
        region: "LA"
        country: "USA"
        issuers_list: "string_value"
        sms_profile: "sms_profile_name"
        signature_algo_list: "string_value"
        slack_profile: "slack_profile_name"
        ctnsappname: "app_name"
        resource_type: "app_unit"
        mail_profile: "mail_profile_name"
        is_enabled: "true"
        duration: "l3"
        days_to_expiry: "30"
        ip_address: "1.1.1.1"
        ssl_protocol_list: "TLS1.0,TLS1.1,TLS1.2,TLS1.3"
        group_name: "WEB"
        reference_key: "attribute"
        exporter_id: "174483313"
        approved_ssl_protocol_list: "TLS1.3"
        approved_key_strength_list: "4096"
        approved_issuers_list: "Baltimore,Comodo"
        approved_signature_algo_list: "MD2-RSA,MD5-RSA"

  modifyssl_cert_thresholdRequest:
    type: object
    required:
      - ssl_cert_threshold
    properties:
      ssl_cert_threshold:
        $ref: '#/definitions/ssl_cert_threshold_readwrite'
    title: modifyssl_cert_thresholdRequest
    example:
      ssl_cert_threshold:
        name: "threshold_config"
        rule: "order_by_metrics_value_20 > 10"
        stylebook_flag: "true"
        feature: "Analytics"
        hide_default_certs: "false"
        pagerduty_profile: "pagerduty_profile"
        servicenow_profile: "pagerduty_profile"
        city: "Santa Clara"
        region: "LA"
        country: "USA"
        sms_profile: "sms_profile_name"
        slack_profile: "slack_profile_name"
        ctnsappname: "app_name"
        resource_type: "app_unit"
        mail_profile: "mail_profile_name"
        is_enabled: "true"
        duration: "l3"
        days_to_expiry: "30"
        ip_address: "1.1.1.1"
        group_name: "WEB"
        reference_key: "attribute"
        exporter_id: "174483313"
        approved_ssl_protocol_list: "TLS1.3"
        approved_key_strength_list: "4096"
        approved_issuers_list: "Baltimore,Comodo"
        approved_signature_algo_list: "MD2-RSA,MD5-RSA"

  modifyssl_cert_thresholdResponse:
    type: object
    required:
      - ssl_cert_threshold
    properties:
      ssl_cert_threshold:
        $ref: '#/definitions/ssl_cert_threshold'
    title: modifyssl_cert_thresholdResponse
    example:
      ssl_cert_threshold:
        name: "threshold_config"
        rule: "order_by_metrics_value_20 > 10"
        stylebook_flag: "true"
        feature: "Analytics"
        hide_default_certs: "false"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        pagerduty_profile: "pagerduty_profile"
        servicenow_profile: "pagerduty_profile"
        city: "Santa Clara"
        key_strength_list: "string_value"
        tenant_name: "Owner"
        region: "LA"
        country: "USA"
        issuers_list: "string_value"
        sms_profile: "sms_profile_name"
        signature_algo_list: "string_value"
        slack_profile: "slack_profile_name"
        ctnsappname: "app_name"
        resource_type: "app_unit"
        mail_profile: "mail_profile_name"
        is_enabled: "true"
        duration: "l3"
        days_to_expiry: "30"
        ip_address: "1.1.1.1"
        ssl_protocol_list: "TLS1.0,TLS1.1,TLS1.2,TLS1.3"
        group_name: "WEB"
        reference_key: "attribute"
        exporter_id: "174483313"
        approved_ssl_protocol_list: "TLS1.3"
        approved_key_strength_list: "4096"
        approved_issuers_list: "Baltimore,Comodo"
        approved_signature_algo_list: "MD2-RSA,MD5-RSA"

  ssl_cert_threshold_readwrite:
    type: object
    properties:
      name:
        description: "name"
        type: string
        format: string
      rule:
        description: "Rule"
        type: string
        format: string
      stylebook_flag:
        description: "Stylebook threshold configuration true or false"
        type: boolean
        format: boolean
      feature:
        description: "feature"
        type: string
        format: string
      hide_default_certs:
        description: "Set the value to true if default certs in device need not be managed"
        type: boolean
        format: boolean
      pagerduty_profile:
        description: "PagerDuty Profile"
        type: string
        format: string
      servicenow_profile:
        description: "Servicenow Profile"
        type: string
        format: string
      city:
        description: "City"
        type: string
        format: string
        maxLength: 256
      region:
        description: "Region Code"
        type: string
        format: string
        maxLength: 256
      country:
        description: "Country Code"
        type: string
        format: string
        maxLength: 256
      sms_profile:
        description: "SMS Profile"
        type: string
        format: string
      slack_profile:
        description: "Slack Profile"
        type: string
        format: string
      ctnsappname:
        description: "AppName"
        type: string
        format: string
      resource_type:
        description: "Resource Type"
        type: string
        format: string
      mail_profile:
        description: "Mail Profile"
        type: string
        format: string
      is_enabled:
        description: "true or false"
        type: string
        format: string
      duration:
        description: "duration of metric to be checked against threshold"
        type: string
        format: string
      days_to_expiry:
        description: "Days remaining for expiry"
        type: integer
        format: int32
      ip_address:
        description: "Field to store the ip address as it is along with any extension"
        type: string
        format: string
        maxLength: 512
      group_name:
        description: "Group Name"
        type: string
        format: string
      reference_key:
        description: "Reference Key"
        type: string
        format: string
      exporter_id:
        description: "Exporter Id"
        type: number
        format: int64
      approved_ssl_protocol_list:
        description: "SSL Protocols List"
        type: array
        items:
          type: string
          format: string
      approved_key_strength_list:
        description: "Key Strength List"
        type: array
        items:
          type: string
          format: string
      approved_issuers_list:
        description: "Issuers List"
        type: array
        items:
          type: string
          format: string
      approved_signature_algo_list:
        description: "Signature Algorithm List"
        type: array
        items:
          type: string
          format: string

  ssl_cert_threshold:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the Thresholds configuration 
            type: string
            format: string
          tenant_name:
             description: "Tenant Name"
             type: string
             format: string
      - $ref: '#/definitions/ssl_cert_threshold_readwrite'

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