swagger: '2.0'
info:
  description: Configuration for SSL certificate on NetScaler resource.
  version: 'v2'
  title: ns_ssl_certkey
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: ns_ssl_certkey
    description: SSL certificate on NetScaler
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 ssl cert-keys entries. For download operation "id" must be provided in the format <adc_ip_address>_<certkeypair_name>.tgz
   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/ns_ssl_certkey:
    get:
      tags:
        - ns_ssl_certkey
      summary: GET all ns_ssl_certkey
      operationId: getall_ns_ssl_certkey
      description: Use this operation to get certificates on NetScaler Instance(s)
      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 ns_ssl_certkey 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 ns_ssl_certkey 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 ns_ssl_certkey resources.
          enum:
            - yes
      responses:
        200:
          description:  for ns_ssl_certkey
          schema: 
              $ref: '#/definitions/getns_ssl_certkeysResponse'
        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:
        - ns_ssl_certkey
      summary: POST operation for ns_ssl_certkey
      operationId: post_ns_ssl_certkey
      description: POST operation for ns_ssl_certkey
      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: ns_ssl_certkey
          description: ns_ssl_certkey object
          schema:
              $ref: '#/definitions/addns_ssl_certkeyRequest'
      responses:
        200:
          description: add for ns_ssl_certkey
          schema: 
              $ref: '#/definitions/addns_ssl_certkeyResponse'
        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/ns_ssl_certkey/{id}:
    get:
      tags:
        - ns_ssl_certkey
      summary: GET by key for ns_ssl_certkey
      operationId: getbykey_ns_ssl_certkey
      description: Use this operation to get certificates on NetScaler Instance(s)
      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 ns_ssl_certkey
          schema: 
              $ref: '#/definitions/getns_ssl_certkeyResponse'
        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:
        - ns_ssl_certkey
      summary: POST operation with actions for ns_ssl_certkey
      operationId: post_ns_ssl_certkey_actions
      description: POST operation with actions for ns_ssl_certkey
      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: query
          name: action
          type: string
          required: true
          enum: [inventory,list_entity_cert,bind_cert,gen_csr]
          description: >
            actions:
              * `inventory` - Use this operation to do inventory
              * `list_entity_cert` - Use this operation to get certificates bound to vservers, service groups and services
              * `bind_cert` - Use this operation to bind a certificate to a SSL vserver.Required properties certkeypair_arr,display_name,entity_name
              * `gen_csr` - Use this operation to generate CSR for the certificate

        - in: body
          name: ns_ssl_certkey
          description: ns_ssl_certkey object
          schema:
              $ref: '#/definitions/addns_ssl_certkeyRequest'
      responses:
        200:
          description: gen_csr for ns_ssl_certkey
          schema: 
              $ref: '#/definitions/addns_ssl_certkeyResponse'
        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:
        - ns_ssl_certkey
      summary: PUT for ns_ssl_certkey
      operationId: putbykey_ns_ssl_certkey
      description: Use this operation to modify certificates on NetScaler Instance(s)
      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: ns_ssl_certkey
          description: ns_ssl_certkey object
          schema:
              $ref: '#/definitions/modifyns_ssl_certkeyRequest'
      responses:
        200:
          description: gen_csr for ns_ssl_certkey
          schema: 
              $ref: '#/definitions/modifyns_ssl_certkeyResponse'
        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:
        - ns_ssl_certkey
      summary: Delete for ns_ssl_certkey
      operationId: deletebykey_ns_ssl_certkey
      description: Use this operation to delete certificates on NetScaler Instance(s)
      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: gen_csr for ns_ssl_certkey
        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/download/ns_ssl_certkey/{<ns_ip_address>_<certkeypair_name>.tgz}:
    get:
      tags:
        - ns_ssl_certkey
      summary: Download operation for ns_ssl_certkey
      operationId: download_ns_ssl_certkey
      description: Use this operation to download certificates
      consumes:
        - application/json
      produces:
        - attachment
      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: path
          name: <ns_ip_address>_<certkeypair_name>.tgz
          type: string
          required: true
          description: Id is system generated key for all ssl cert-keys entries. For download operation "id" must be provided in the format <adc_ip_address>_<certkeypair_name>.tgz
      responses:
        200:
          description: Successful download for ns_ssl_certkey
          schema: 
              type: file
              format: binary
        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:
  addns_ssl_certkeyRequest:
    type: object
    required:
      - ns_ssl_certkey
    properties:
      ns_ssl_certkey:
        $ref: '#/definitions/ns_ssl_certkey_readwrite'
    title: addns_ssl_certkeyRequest
    example:
      ns_ssl_certkey:
        no_domain_check: "false"
        ns_ip_address: "1.1.1.1"
        certkeypair_name: "ns-server-certificate"
        certificate_dn: "\\VED\\Policy\\TLS\\TLS Certificates\\NetScaler Console\\VenafiTestCert2"
        linkcertkeyname: "serverCertificate"
        ssl_key: "ns-server.key"
        key_data: "string_value"
        managed_by: "Venafi"
        ssl_certificate: "ns-server.cert"
        certificate_data: "string_value"
        file_location_path: "C:\\myfiles"
        cert_format: "PEM"
        certchainbinding: ["string_value1","string_value2"]
        certkeychain: [{        valid_to: "string_value"
,        linked_to: "string_value"
,        valid_from: "string_value"
,        issuer: "string_value"
,        cert_name: "string_value"
}]
        certchain_data: [{        file_name: "string_value"
,        file_data: "string_value"
,        id: "string_value"
,        referenced_ic_cert_count: "integer_value"
}]
        app_name: "sharepoint_app"
        password: "password"
        source_certificate: "Csform-origin.citrix.com_2021"
        file_name: "sample_certfile.crt"
        certkeypair_arr: "ARRAY(0x2ca4de4)"
        source_ipaddress: "1.1.1.1"
        save_config: "true"
        ns_ip_address_arr: "ARRAY(0x2c488c4)"
        entity_binding_arr: [{        ns_ip_address: "string_value"
,        certkeypair_name: "string_value"
,        id: "string_value"
}]
        entity_name: "test_ssl_svcgrp"
        snicert: "false"

  addns_ssl_certkeyResponse:
    type: object
    required:
      - ns_ssl_certkey
    properties:
      ns_ssl_certkey:
        $ref: '#/definitions/ns_ssl_certkey'
    title: addns_ssl_certkeyResponse
    example:
      ns_ssl_certkey:
        serial_number: "01"
        signature_algorithm: "sha256WithRSAEncryption"
        valid_from: "Jan 17 07:15:37 2020 GMT"
        status: "Valid"
        hostname: "NS105"
        issuer: "C=US,ST=California,L=San Jose,O=Citrix ANG,OU=NS Internal,CN=default UZEKYL"
        no_domain_check: "false"
        ns_ip_address: "1.1.1.1"
        certkeypair_name: "ns-server-certificate"
        certificate_dn: "\\VED\\Policy\\TLS\\TLS Certificates\\NetScaler Console\\VenafiTestCert2"
        public_key_size: "2048"
        device_name: "NS105 (1.1.1.1)"
        linkcertkeyname: "serverCertificate"
        ssl_key: "ns-server.key"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        key_data: "string_value"
        valid_to: "Nov 28 21:50:17 2035 GMT"
        subject: "C=US,ST=California,L=San Jose,O=Citrix ANG,OU=NS Internal,CN=default UZEKYL"
        version: "3"
        managed_by: "Venafi"
        public_key_algorithm: "rsaEncryption"
        days_to_expiry: "5777"
        poll_time: "1580714461"
        key_name: "MSP_SERVER_DB_KEY"
        display_name: "1.1.1.1"
        no_of_bound_entities: "5"
        ssl_certificate: "ns-server.cert"
        certificate_data: "string_value"
        file_location_path: "C:\\myfiles"
        partition_name: "p1"
        subjaltname: "DNS:sample.co.uk, IP:1.1.1.1, DNS:sample.co.in"
        cert_format: "PEM"
        certchainbinding: ["string_value1","string_value2"]
        certkeychain: [{        valid_to: "string_value"
,        linked_to: "string_value"
,        valid_from: "string_value"
,        issuer: "string_value"
,        cert_name: "string_value"
}]
        certchain_data: [{        certkeypair_name: "string_value"
,        file_name: "string_value"
,        file_data: "string_value"
,        fingerprint: "string_value"
,        id: "string_value"
,        referenced_ic_cert_count: "integer_value"
,        is_installed: "boolean_value"
}]
        cert_store_id: "514a26b8-afb5-4245-b180-77589f1f1e54"
        app_name: "sharepoint_app"
        password: "password"
        source_certificate: "Csform-origin.citrix.com_2021"
        domain: "SFTrust default DGEFSS"
        file_name: "sample_certfile.crt"
        certkeypair_arr: "ARRAY(0x2ca4de4)"
        source_ipaddress: "1.1.1.1"
        save_config: "true"
        datacenter_id: "514a26b8-afb5-4245-b180-77589f1f1e54"
        activity_id: "fce5b825-9217-4e58-b80c-48cfe8f0c6b3"
        ns_ip_address_arr: "ARRAY(0x2c488c4)"
        entity_binding_arr: [{        hostname: "string_value"
,        poll_time: "integer_value"
,        display_name: "string_value"
,        ns_ip_address: "string_value"
,        certkeypair_name: "string_value"
,        entity_name: "string_value"
,        partition_name: "string_value"
,        entity_type: "string_value"
,        id: "string_value"
}]
        entity_name: "test_ssl_svcgrp"
        snicert: "false"
        csr: "string_value"

  getns_ssl_certkeyResponse:
    type: object
    required:
      - ns_ssl_certkey
    properties:
      ns_ssl_certkey:
        $ref: '#/definitions/ns_ssl_certkey'
    title: getns_ssl_certkeyResponse
    example:
      ns_ssl_certkey:
        serial_number: "01"
        signature_algorithm: "sha256WithRSAEncryption"
        valid_from: "Jan 17 07:15:37 2020 GMT"
        status: "Valid"
        hostname: "NS105"
        issuer: "C=US,ST=California,L=San Jose,O=Citrix ANG,OU=NS Internal,CN=default UZEKYL"
        no_domain_check: "false"
        ns_ip_address: "1.1.1.1"
        certkeypair_name: "ns-server-certificate"
        certificate_dn: "\\VED\\Policy\\TLS\\TLS Certificates\\NetScaler Console\\VenafiTestCert2"
        public_key_size: "2048"
        device_name: "NS105 (1.1.1.1)"
        linkcertkeyname: "serverCertificate"
        ssl_key: "ns-server.key"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        key_data: "string_value"
        valid_to: "Nov 28 21:50:17 2035 GMT"
        subject: "C=US,ST=California,L=San Jose,O=Citrix ANG,OU=NS Internal,CN=default UZEKYL"
        version: "3"
        managed_by: "Venafi"
        public_key_algorithm: "rsaEncryption"
        days_to_expiry: "5777"
        poll_time: "1580714461"
        key_name: "MSP_SERVER_DB_KEY"
        display_name: "1.1.1.1"
        no_of_bound_entities: "5"
        ssl_certificate: "ns-server.cert"
        certificate_data: "string_value"
        file_location_path: "C:\\myfiles"
        partition_name: "p1"
        subjaltname: "DNS:sample.co.uk, IP:1.1.1.1, DNS:sample.co.in"
        cert_format: "PEM"
        certchainbinding: ["string_value1","string_value2"]
        certkeychain: [{        valid_to: "string_value"
,        linked_to: "string_value"
,        valid_from: "string_value"
,        issuer: "string_value"
,        cert_name: "string_value"
}]
        certchain_data: [{        certkeypair_name: "string_value"
,        file_name: "string_value"
,        file_data: "string_value"
,        fingerprint: "string_value"
,        id: "string_value"
,        referenced_ic_cert_count: "integer_value"
,        is_installed: "boolean_value"
}]
        cert_store_id: "514a26b8-afb5-4245-b180-77589f1f1e54"
        app_name: "sharepoint_app"
        password: "password"
        source_certificate: "Csform-origin.citrix.com_2021"
        domain: "SFTrust default DGEFSS"
        file_name: "sample_certfile.crt"
        certkeypair_arr: "ARRAY(0x2ca4de4)"
        source_ipaddress: "1.1.1.1"
        save_config: "true"
        datacenter_id: "514a26b8-afb5-4245-b180-77589f1f1e54"
        activity_id: "fce5b825-9217-4e58-b80c-48cfe8f0c6b3"
        ns_ip_address_arr: "ARRAY(0x2c488c4)"
        entity_binding_arr: [{        hostname: "string_value"
,        poll_time: "integer_value"
,        display_name: "string_value"
,        ns_ip_address: "string_value"
,        certkeypair_name: "string_value"
,        entity_name: "string_value"
,        partition_name: "string_value"
,        entity_type: "string_value"
,        id: "string_value"
}]
        entity_name: "test_ssl_svcgrp"
        snicert: "false"
        csr: "string_value"

  getns_ssl_certkeysResponse:
    type: object
    required:
      - ns_ssl_certkey
    properties:
      ns_ssl_certkey:
        type: array
        items:
          $ref: '#/definitions/ns_ssl_certkey'
    title: getns_ssl_certkeysResponse
    example:
      ns_ssl_certkey:
        serial_number: "01"
        signature_algorithm: "sha256WithRSAEncryption"
        valid_from: "Jan 17 07:15:37 2020 GMT"
        status: "Valid"
        hostname: "NS105"
        issuer: "C=US,ST=California,L=San Jose,O=Citrix ANG,OU=NS Internal,CN=default UZEKYL"
        no_domain_check: "false"
        ns_ip_address: "1.1.1.1"
        certkeypair_name: "ns-server-certificate"
        certificate_dn: "\\VED\\Policy\\TLS\\TLS Certificates\\NetScaler Console\\VenafiTestCert2"
        public_key_size: "2048"
        device_name: "NS105 (1.1.1.1)"
        linkcertkeyname: "serverCertificate"
        ssl_key: "ns-server.key"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        key_data: "string_value"
        valid_to: "Nov 28 21:50:17 2035 GMT"
        subject: "C=US,ST=California,L=San Jose,O=Citrix ANG,OU=NS Internal,CN=default UZEKYL"
        version: "3"
        managed_by: "Venafi"
        public_key_algorithm: "rsaEncryption"
        days_to_expiry: "5777"
        poll_time: "1580714461"
        key_name: "MSP_SERVER_DB_KEY"
        display_name: "1.1.1.1"
        no_of_bound_entities: "5"
        ssl_certificate: "ns-server.cert"
        certificate_data: "string_value"
        file_location_path: "C:\\myfiles"
        partition_name: "p1"
        subjaltname: "DNS:sample.co.uk, IP:1.1.1.1, DNS:sample.co.in"
        cert_format: "PEM"
        certchainbinding: ["string_value1","string_value2"]
        certkeychain: [{        valid_to: "string_value"
,        linked_to: "string_value"
,        valid_from: "string_value"
,        issuer: "string_value"
,        cert_name: "string_value"
}]
        certchain_data: [{        certkeypair_name: "string_value"
,        file_name: "string_value"
,        file_data: "string_value"
,        fingerprint: "string_value"
,        id: "string_value"
,        referenced_ic_cert_count: "integer_value"
,        is_installed: "boolean_value"
}]
        cert_store_id: "514a26b8-afb5-4245-b180-77589f1f1e54"
        app_name: "sharepoint_app"
        password: "password"
        source_certificate: "Csform-origin.citrix.com_2021"
        domain: "SFTrust default DGEFSS"
        file_name: "sample_certfile.crt"
        certkeypair_arr: "ARRAY(0x2ca4de4)"
        source_ipaddress: "1.1.1.1"
        save_config: "true"
        datacenter_id: "514a26b8-afb5-4245-b180-77589f1f1e54"
        activity_id: "fce5b825-9217-4e58-b80c-48cfe8f0c6b3"
        ns_ip_address_arr: "ARRAY(0x2c488c4)"
        entity_binding_arr: [{        hostname: "string_value"
,        poll_time: "integer_value"
,        display_name: "string_value"
,        ns_ip_address: "string_value"
,        certkeypair_name: "string_value"
,        entity_name: "string_value"
,        partition_name: "string_value"
,        entity_type: "string_value"
,        id: "string_value"
}]
        entity_name: "test_ssl_svcgrp"
        snicert: "false"
        csr: "string_value"

  modifyns_ssl_certkeyRequest:
    type: object
    required:
      - ns_ssl_certkey
    properties:
      ns_ssl_certkey:
        $ref: '#/definitions/ns_ssl_certkey_readwrite'
    title: modifyns_ssl_certkeyRequest
    example:
      ns_ssl_certkey:
        no_domain_check: "false"
        ns_ip_address: "1.1.1.1"
        certkeypair_name: "ns-server-certificate"
        certificate_dn: "\\VED\\Policy\\TLS\\TLS Certificates\\NetScaler Console\\VenafiTestCert2"
        linkcertkeyname: "serverCertificate"
        ssl_key: "ns-server.key"
        key_data: "string_value"
        managed_by: "Venafi"
        ssl_certificate: "ns-server.cert"
        certificate_data: "string_value"
        file_location_path: "C:\\myfiles"
        cert_format: "PEM"
        certchainbinding: ["string_value1","string_value2"]
        certkeychain: [{        valid_to: "string_value"
,        linked_to: "string_value"
,        valid_from: "string_value"
,        issuer: "string_value"
,        cert_name: "string_value"
}]
        certchain_data: [{        file_name: "string_value"
,        file_data: "string_value"
,        id: "string_value"
,        referenced_ic_cert_count: "integer_value"
}]
        app_name: "sharepoint_app"
        password: "password"
        source_certificate: "Csform-origin.citrix.com_2021"
        file_name: "sample_certfile.crt"
        certkeypair_arr: "ARRAY(0x2ca4de4)"
        source_ipaddress: "1.1.1.1"
        save_config: "true"
        ns_ip_address_arr: "ARRAY(0x2c488c4)"
        entity_binding_arr: [{        ns_ip_address: "string_value"
,        certkeypair_name: "string_value"
,        id: "string_value"
}]
        entity_name: "test_ssl_svcgrp"
        snicert: "false"

  modifyns_ssl_certkeyResponse:
    type: object
    required:
      - ns_ssl_certkey
    properties:
      ns_ssl_certkey:
        $ref: '#/definitions/ns_ssl_certkey'
    title: modifyns_ssl_certkeyResponse
    example:
      ns_ssl_certkey:
        serial_number: "01"
        signature_algorithm: "sha256WithRSAEncryption"
        valid_from: "Jan 17 07:15:37 2020 GMT"
        status: "Valid"
        hostname: "NS105"
        issuer: "C=US,ST=California,L=San Jose,O=Citrix ANG,OU=NS Internal,CN=default UZEKYL"
        no_domain_check: "false"
        ns_ip_address: "1.1.1.1"
        certkeypair_name: "ns-server-certificate"
        certificate_dn: "\\VED\\Policy\\TLS\\TLS Certificates\\NetScaler Console\\VenafiTestCert2"
        public_key_size: "2048"
        device_name: "NS105 (1.1.1.1)"
        linkcertkeyname: "serverCertificate"
        ssl_key: "ns-server.key"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        key_data: "string_value"
        valid_to: "Nov 28 21:50:17 2035 GMT"
        subject: "C=US,ST=California,L=San Jose,O=Citrix ANG,OU=NS Internal,CN=default UZEKYL"
        version: "3"
        managed_by: "Venafi"
        public_key_algorithm: "rsaEncryption"
        days_to_expiry: "5777"
        poll_time: "1580714461"
        key_name: "MSP_SERVER_DB_KEY"
        display_name: "1.1.1.1"
        no_of_bound_entities: "5"
        ssl_certificate: "ns-server.cert"
        certificate_data: "string_value"
        file_location_path: "C:\\myfiles"
        partition_name: "p1"
        subjaltname: "DNS:sample.co.uk, IP:1.1.1.1, DNS:sample.co.in"
        cert_format: "PEM"
        certchainbinding: ["string_value1","string_value2"]
        certkeychain: [{        valid_to: "string_value"
,        linked_to: "string_value"
,        valid_from: "string_value"
,        issuer: "string_value"
,        cert_name: "string_value"
}]
        certchain_data: [{        certkeypair_name: "string_value"
,        file_name: "string_value"
,        file_data: "string_value"
,        fingerprint: "string_value"
,        id: "string_value"
,        referenced_ic_cert_count: "integer_value"
,        is_installed: "boolean_value"
}]
        cert_store_id: "514a26b8-afb5-4245-b180-77589f1f1e54"
        app_name: "sharepoint_app"
        password: "password"
        source_certificate: "Csform-origin.citrix.com_2021"
        domain: "SFTrust default DGEFSS"
        file_name: "sample_certfile.crt"
        certkeypair_arr: "ARRAY(0x2ca4de4)"
        source_ipaddress: "1.1.1.1"
        save_config: "true"
        datacenter_id: "514a26b8-afb5-4245-b180-77589f1f1e54"
        activity_id: "fce5b825-9217-4e58-b80c-48cfe8f0c6b3"
        ns_ip_address_arr: "ARRAY(0x2c488c4)"
        entity_binding_arr: [{        hostname: "string_value"
,        poll_time: "integer_value"
,        display_name: "string_value"
,        ns_ip_address: "string_value"
,        certkeypair_name: "string_value"
,        entity_name: "string_value"
,        partition_name: "string_value"
,        entity_type: "string_value"
,        id: "string_value"
}]
        entity_name: "test_ssl_svcgrp"
        snicert: "false"
        csr: "string_value"

  ns_ssl_certkey_readwrite:
    type: object
    properties:
      no_domain_check:
        description: "Specify this option to override the check for matching domain names during certificate update operation"
        type: boolean
        format: boolean
      ns_ip_address:
        description: "List of NetScaler IP Address"
        type: string
        format: IP Address
        minLength: 1
        maxLength: 64
      certkeypair_name:
        description: "Cert Key Pair Name"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      certificate_dn:
        description: "For certificates created by Venafi,this property indicates the certificate distinguished name."
        type: string
        format: string
      linkcertkeyname:
        description: "For certificates having an intermediate certificate, it will provide the linked certificate key pair name"
        type: string
        format: string
      ssl_key:
        description: "Key"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      key_data:
        description: "Key Data"
        type: string
        format: password
        maxLength: 16384
      managed_by:
        description: "Indicates if the certificate is managed by a third party certificate management provider."
        type: string
        format: string
      ssl_certificate:
        description: "Certificate"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      certificate_data:
        description: "Certificate Data"
        type: string
        format: password
        maxLength: 50000
      file_location_path:
        description: "File Location on Client for download"
        type: string
        format: string
        minLength: 1
      cert_format:
        description: "Certificate Format"
        type: string
        format: string
        maxLength: 64
      certchainbinding:
        description: "Certificate Chain binding."
        type: array
        items:
          type: string
          format: string
      certkeychain:
        type: array
        items:
          $ref: '#/definitions/certkey_chain_link_readwrite'
      certchain_data:
        type: array
        items:
          $ref: '#/definitions/cert_store_data_readwrite'
      app_name:
        description: "Application name.Used for tracking task logs created for a specific application"
        type: string
        format: string
      password:
        description: "The pass-phrase that was used to encrypt the private-key."
        type: string
        format: password
        maxLength: 128
      source_certificate:
        description: "CertKeyPair Name of the certificate that needs to installed in another instance"
        type: string
        format: string
      file_name:
        description: "File Name"
        type: string
        format: string
        minLength: 1
        maxLength: 256
      certkeypair_arr:
        description: "List of certkeypair_name.Used in cert binding operation."
        type: array
        items:
          type: string
          format: string
      source_ipaddress:
        description: "NetScaler IP of the certificate that needs to installed in another instance"
        type: string
        format: ipaddress
      save_config:
        description: "true, if save config is required"
        type: boolean
        format: boolean
      ns_ip_address_arr:
        description: "List of NetScaler IP Address"
        type: array
        items:
          type: string
          format: IP Address
        minLength: 1
        maxLength: 64
      entity_binding_arr:
        type: array
        items:
          $ref: '#/definitions/ns_sslcertkey_binding_readwrite'
      entity_name:
        description: "entity name"
        type: string
        format: string
      snicert:
        description: "Indicates server certificate for SNI. Used in cert binding operation."
        type: boolean
        format: boolean

  ns_ssl_certkey:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all ssl cert-keys entries. For download operation "id" must be provided in the format <adc_ip_address>_<certkeypair_name>.tgz
            type: string
            format: uuid
          serial_number:
             description: "Serial Number"
             type: string
             format: string
          signature_algorithm:
             description: "Signature Algorithm"
             type: string
             format: string
          valid_from:
             description: "Valid From"
             type: string
             format: string
          status:
             description: "Tells whether the certificate is still valid or not"
             type: string
             format: string
          hostname:
             description: "Host Name of the device"
             type: string
             format: string
             minLength: 1
             maxLength: 128
          issuer:
             description: "Issuer"
             type: string
             format: string
          public_key_size:
             description: "Public Key Size"
             type: integer
             format: int32
          device_name:
             description: "Name of the device"
             type: string
             format: string
             minLength: 1
             maxLength: 128
          valid_to:
             description: "Valid To"
             type: string
             format: string
          subject:
             description: "Subject"
             type: string
             format: string
          version:
             description: "Version"
             type: integer
             format: int32
          public_key_algorithm:
             description: "Public Key Algorithm"
             type: string
             format: string
          days_to_expiry:
             description: "Days before SSL certificate expires"
             type: integer
             format: int32
          poll_time:
             description: "Last Polling Time"
             type: integer
             format: int32
          display_name:
             description: "Display Name of the device"
             type: string
             format: string
             minLength: 1
             maxLength: 128
          no_of_bound_entities:
             description: "no_of_bound_entities"
             type: integer
             format: int32
          partition_name:
             description: "Name of Admin Partition. Blank means Default Partition"
             type: string
             format: string
          subjaltname:
             description: "Comma separated Subject Alternative Names"
             type: string
             format: string
          cert_store_id:
             description: "Cert Store Id "
             type: string
             format: uuid
          domain:
             description: "Domain name for certificate issuer"
             type: string
             format: string
          datacenter_id:
             description: "Datacenter Id "
             type: string
             format: uuid
          activity_id:
             description: "Activity Id used to track the progress of certificate operations."
             type: string
             format: uuid
          csr:
             description: "Certificate Signing Request"
             type: string
             format: string
      - $ref: '#/definitions/ns_ssl_certkey_readwrite'

  cert_store_data_readwrite:
    type: object
    properties:
      file_name:
        description: "Certificate file name."
        type: string
        format: string
        minLength: 1
        maxLength: 128
      file_data:
        description: "Base64 encoded certificate file contents."
        type: string
        format: string
        maxLength: 50000
      referenced_ic_cert_count:
        description: "Number of certificates(cert_store) referring this intermediate certificate across instances"
        type: integer
        format: int32

  cert_store_data:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all certificate store data entries. 
            type: string
            format: uuid
          certkeypair_name:
             description: "Cert Key Pair Name"
             type: string
             format: string
             minLength: 1
             maxLength: 128
          fingerprint:
             description: "Fingerprint of certificate file"
             type: string
             format: string
          is_installed:
             description: "Indicates if a cert is installed in an ADC,when display_name and action parameter are set in filter query"
             type: boolean
             format: boolean
      - $ref: '#/definitions/cert_store_data_readwrite'

  certkey_chain_link_readwrite:
    type: object
    properties:
      valid_to:
        description: "Valid To"
        type: string
        format: string
        minLength: 1
      linked_to:
        description: "Name of certificate to which the certificate is linked"
        type: string
        format: string
        minLength: 1
      valid_from:
        description: "Valid From"
        type: string
        format: string
        minLength: 1
      issuer:
        description: "Issuer"
        type: string
        format: string
        minLength: 1
      cert_name:
        description: "Certificate name"
        type: string
        format: string
        minLength: 1
        maxLength: 128

  certkey_chain_link:
    allOf:
      - $ref: '#/definitions/certkey_chain_link_readwrite'

  ns_sslcertkey_binding_readwrite:
    type: object
    properties:
      ns_ip_address:
        description: "NetScaler IP Address"
        type: string
        format: IP Address
        minLength: 1
        maxLength: 64
      certkeypair_name:
        description: "Cert Key Pair Name"
        type: string
        format: string
        minLength: 1
        maxLength: 128

  ns_sslcertkey_binding:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all ssl cert-keys entries. 
            type: string
            format: uuid
          hostname:
             description: "Host Name of the device"
             type: string
             format: string
             minLength: 1
             maxLength: 128
          poll_time:
             description: "Last Polling Time"
             type: integer
             format: int32
          display_name:
             description: "Display Name of the device"
             type: string
             format: string
             minLength: 1
             maxLength: 128
          entity_name:
             description: "Name of the SSL LB Vserver or Service or Service Group to which the certificate is bound"
             type: string
             format: string
             minLength: 1
             maxLength: 128
          partition_name:
             description: "Name of Admin Partition. Blank means Default Partition"
             type: string
             format: string
          entity_type:
             description: "Entity type.Indicates sslvserver,service"
             type: string
             format: string
             minLength: 1
             maxLength: 128
      - $ref: '#/definitions/ns_sslcertkey_binding_readwrite'

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