Arduino devices_v2_certs API

Provides a set of endpoints to manage the certs of a device

OpenAPI Specification

arduino-devices-v2-certs-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  description: Provides a set of endpoints to manage Devices, Things, Properties and Timeseries
  title: Arduino IoT Cloud binaries_v2 devices_v2_certs API
  version: '2.0'
tags:
- description: Provides a set of endpoints to manage the certs of a device
  name: devices_v2_certs
paths:
  /iot/v2/devices/{id}/cert_check:
    post:
      description: Check if the certificate is the one generated during the provisioning process of the given device
      operationId: devices_v2_certs#check
      parameters:
      - description: The id of the device
        in: path
        name: id
        required: true
        schema:
          type: string
      - in: header
        name: X-Organization
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckDevicesV2CertsPayload'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CheckDevicesV2CertsPayload'
        description: A PEM certificate
        required: true
        x-originalParamName: payload
      responses:
        '200':
          description: OK
        '400':
          content:
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
            text/plain:
              schema:
                $ref: '#/components/schemas/error'
          description: Bad Request
        '401':
          content:
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
            text/plain:
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          content:
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
            text/plain:
              schema:
                $ref: '#/components/schemas/error'
          description: Internal Server Error
      security:
      - oauth2: []
      summary: check devices_v2_certs
      tags:
      - devices_v2_certs
  /iot/v2/devices/{id}/certs:
    get:
      description: Returns the list of certs associated to the device
      operationId: devices_v2_certs#list
      parameters:
      - description: The id of the device
        in: path
        name: id
        required: true
        schema:
          type: string
      - in: header
        name: X-Organization
        schema:
          type: string
      responses:
        '200':
          content:
            application/vnd.arduino.devicev2.cert+json; type=collection:
              schema:
                $ref: '#/components/schemas/ArduinoDevicev2CertCollection'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/ArduinoDevicev2CertCollection'
          description: OK
        '401':
          content:
            application/vnd.arduino.devicev2.cert+json; type=collection:
              schema:
                $ref: '#/components/schemas/error'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          content:
            application/vnd.arduino.devicev2.cert+json; type=collection:
              schema:
                $ref: '#/components/schemas/error'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
          description: Internal Server Error
      security:
      - oauth2: []
      summary: list devices_v2_certs
      tags:
      - devices_v2_certs
    put:
      description: Creates a new cert associated to a device. The csr is signed and saved in database. The CommonName will be replaced with the device id.
      operationId: devices_v2_certs#create
      parameters:
      - description: The id of the device
        in: path
        name: id
        required: true
        schema:
          type: string
      - in: header
        name: X-Organization
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDevicesV2CertsPayload'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateDevicesV2CertsPayload'
        required: true
        x-originalParamName: payload
      responses:
        '201':
          content:
            application/vnd.arduino.devicev2.cert+json:
              schema:
                $ref: '#/components/schemas/ArduinoDevicev2Cert'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/ArduinoDevicev2Cert'
          description: Created
        '400':
          content:
            application/vnd.arduino.devicev2.cert+json:
              schema:
                $ref: '#/components/schemas/error'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
          description: Bad Request
        '401':
          content:
            application/vnd.arduino.devicev2.cert+json:
              schema:
                $ref: '#/components/schemas/error'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          content:
            application/vnd.arduino.devicev2.cert+json:
              schema:
                $ref: '#/components/schemas/error'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
          description: Internal Server Error
      security:
      - oauth2: []
      summary: create devices_v2_certs
      tags:
      - devices_v2_certs
  /iot/v2/devices/{id}/certs/{cid}:
    delete:
      description: Removes a cert associated to a device
      operationId: devices_v2_certs#delete
      parameters:
      - description: The id of the cert
        in: path
        name: cid
        required: true
        schema:
          type: string
      - description: The id of the device
        in: path
        name: id
        required: true
        schema:
          type: string
      - in: header
        name: X-Organization
        schema:
          type: string
      responses:
        '200':
          description: OK
        '401':
          content:
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
            text/plain:
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          content:
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
            text/plain:
              schema:
                $ref: '#/components/schemas/error'
          description: Internal Server Error
      security:
      - oauth2: []
      summary: delete devices_v2_certs
      tags:
      - devices_v2_certs
    get:
      description: Returns the cert requested by the user
      operationId: devices_v2_certs#show
      parameters:
      - description: The id of the cert
        in: path
        name: cid
        required: true
        schema:
          type: string
      - description: The id of the device
        in: path
        name: id
        required: true
        schema:
          type: string
      - in: header
        name: X-Organization
        schema:
          type: string
      responses:
        '200':
          content:
            application/vnd.arduino.devicev2.cert+json:
              schema:
                $ref: '#/components/schemas/ArduinoDevicev2Cert'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/ArduinoDevicev2Cert'
          description: OK
        '401':
          content:
            application/vnd.arduino.devicev2.cert+json:
              schema:
                $ref: '#/components/schemas/error'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          content:
            application/vnd.arduino.devicev2.cert+json:
              schema:
                $ref: '#/components/schemas/error'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
          description: Internal Server Error
      security:
      - oauth2: []
      summary: show devices_v2_certs
      tags:
      - devices_v2_certs
    post:
      description: Updates a cert associated to a device. The csr is signed and saved in database. The CommonName will be replaced with the device id.
      operationId: devices_v2_certs#update
      parameters:
      - description: The id of the cert
        in: path
        name: cid
        required: true
        schema:
          type: string
      - description: The id of the device
        in: path
        name: id
        required: true
        schema:
          type: string
      - in: header
        name: X-Organization
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/devicev2.cert'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/devicev2.cert'
        required: true
        x-originalParamName: payload
      responses:
        '200':
          content:
            application/vnd.arduino.devicev2.cert+json:
              schema:
                $ref: '#/components/schemas/ArduinoDevicev2Cert'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/ArduinoDevicev2Cert'
          description: OK
        '400':
          content:
            application/vnd.arduino.devicev2.cert+json:
              schema:
                $ref: '#/components/schemas/error'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
          description: Bad Request
        '401':
          content:
            application/vnd.arduino.devicev2.cert+json:
              schema:
                $ref: '#/components/schemas/error'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          content:
            application/vnd.arduino.devicev2.cert+json:
              schema:
                $ref: '#/components/schemas/error'
            application/vnd.goa.error+json:
              schema:
                $ref: '#/components/schemas/error'
          description: Internal Server Error
      security:
      - oauth2: []
      summary: update devices_v2_certs
      tags:
      - devices_v2_certs
components:
  schemas:
    ArduinoDevicev2Cert:
      description: DeviceCertV2 describes a certificate associated to the device (default view)
      properties:
        ca:
          description: The Certification Authority used to sign the certificate
          type: string
        compressed:
          $ref: '#/components/schemas/ArduinoCompressedv2'
        der:
          description: The certificate in DER format
          type: string
        device_id:
          description: The unique identifier of the device
          format: uuid
          type: string
        enabled:
          default: true
          description: Whether the certificate is enabled
          type: boolean
        href:
          description: The api reference of this cert
          type: string
        id:
          description: The unique identifier of the key
          format: uuid
          type: string
        pem:
          description: The certificate in pem format
          example: "-----BEGIN CERTIFICATE-----\n\t\t\tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAryQICCl6NZ5gDKrnSztO\n\t\t\t3Hy8PEUcuyvg/ikC+VcIo2SFFSf18a3IMYldIugqqqZCs4/4uVW3sbdLs/6PfgdX\n\t\t\t7O9D22ZiFWHPYA2k2N744MNiCD1UE+tJyllUhSblK48bn+v1oZHCM0nYQ2NqUkvS\n\t\t\tj+hwUU3RiWl7x3D2s9wSdNt7XUtW05a/FXehsPSiJfKvHJJnGOX0BgTvkLnkAOTd\n\t\t\tOrUZ/wK69Dzu4IvrN4vs9Nes8vbwPa/ddZEzGR0cQMt0JBkhk9kU/qwqUseP1QRJ\n\t\t\t5I1jR4g8aYPL/ke9K35PxZWuDp3U0UPAZ3PjFAh+5T+fc7gzCs9dPzSHloruU+gl\n\t\t\tFQIDAQAB\n\t\t\t-----END CERTIFICATE-----"
          maxLength: 512
          type: string
      required:
      - id
      - device_id
      - enabled
      - pem
      - der
      - compressed
      - href
      title: 'Mediatype identifier: application/vnd.arduino.devicev2.cert+json; view=default'
      type: object
    CreateDevicesV2CertsPayload:
      properties:
        ca:
          description: The Certification Authority you want to use
          type: string
        csr:
          description: The certificate request in pem format
          example: "-----BEGIN CERTIFICATE-----\n\t\t\tMIIBeDCCAR4CAQAwgY0xCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRl\n\t\t\tMQ8wDQYDVQQHEwZNeUNpdHkxFDASBgNVBAoTC0NvbXBhbnkgTHRkMQswCQYDVQQL\n\t\t\tEwJJVDEUMBIGA1UEAxMLZXhhbXBsZS5jb20xHzAdBgkqhkiG9w0BCQEMEHRlc3RA\n\t\t\tZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATf6J9Gk79XGJ2I\n\t\t\t+v6p/r0UmPufUcUwtlx7gx87+DaI8Vpj9R5KN71HsHYw5uq+Lm0cr0CZIdtZU4cP\n\t\t\tupd6jDQToC4wLAYJKoZIhvcNAQkOMR8wHTAbBgNVHREEFDASgRB0ZXN0QGV4YW1w\n\t\t\tbGUuY29tMAoGCCqGSM49BAMCA0gAMEUCIGQqtlGzYdjPwYZYJ41albMBcdrKI7+8\n\t\t\toiNSNWyDxJSGAiEAqQPPxMdr6vaXCCjr5s1J01WLKHzGoPFCR40rqAPs8eQ=\n\t\t\t-----END CERTIFICATE-----\n\t\t\t"
          maxLength: 1024
          type: string
        enabled:
          description: Whether the certificate is enabled
          type: boolean
      required:
      - enabled
      - csr
      title: CreateDevicesV2CertsPayload
      type: object
    devicev2.cert:
      properties:
        ca:
          description: The Certification Authority you want to use
          type: string
        csr:
          description: The certificate request in pem format
          example: "-----BEGIN CERTIFICATE-----\n\t\t\tMIIBeDCCAR4CAQAwgY0xCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRl\n\t\t\tMQ8wDQYDVQQHEwZNeUNpdHkxFDASBgNVBAoTC0NvbXBhbnkgTHRkMQswCQYDVQQL\n\t\t\tEwJJVDEUMBIGA1UEAxMLZXhhbXBsZS5jb20xHzAdBgkqhkiG9w0BCQEMEHRlc3RA\n\t\t\tZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATf6J9Gk79XGJ2I\n\t\t\t+v6p/r0UmPufUcUwtlx7gx87+DaI8Vpj9R5KN71HsHYw5uq+Lm0cr0CZIdtZU4cP\n\t\t\tupd6jDQToC4wLAYJKoZIhvcNAQkOMR8wHTAbBgNVHREEFDASgRB0ZXN0QGV4YW1w\n\t\t\tbGUuY29tMAoGCCqGSM49BAMCA0gAMEUCIGQqtlGzYdjPwYZYJ41albMBcdrKI7+8\n\t\t\toiNSNWyDxJSGAiEAqQPPxMdr6vaXCCjr5s1J01WLKHzGoPFCR40rqAPs8eQ=\n\t\t\t-----END CERTIFICATE-----\n\t\t\t"
          maxLength: 1024
          type: string
        enabled:
          description: Whether the certificate is enabled
          type: boolean
      title: devicev2.cert
      type: object
    ArduinoCompressedv2:
      description: compressed contains the info from which to generate the certificate (default view)
      properties:
        authority_key_identifier:
          description: The Authority Key Identifier of the certificate
          type: string
        not_after:
          description: The ending date of the certificate
          format: date-time
          type: string
        not_before:
          description: The starting date of the certificate
          format: date-time
          type: string
        serial:
          description: The serial number of the certificate
          type: string
        signature:
          description: The signature of the certificate
          type: string
        signature_asn1_x:
          description: The ASN1 X component of certificate signature
          type: string
        signature_asn1_y:
          description: The ASN1 Y component of certificate signature
          type: string
      required:
      - serial
      - not_before
      - not_after
      - signature
      - signature_asn1_x
      - signature_asn1_y
      title: 'Mediatype identifier: application/vnd.arduino.compressedv2; view=default'
      type: object
    CheckDevicesV2CertsPayload:
      description: A PEM certificate
      properties:
        pem:
          description: The certificate in pem format
          example: "-----BEGIN CERTIFICATE-----\n\t\t\tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAryQICCl6NZ5gDKrnSztO\n\t\t\t3Hy8PEUcuyvg/ikC+VcIo2SFFSf18a3IMYldIugqqqZCs4/4uVW3sbdLs/6PfgdX\n\t\t\t7O9D22ZiFWHPYA2k2N744MNiCD1UE+tJyllUhSblK48bn+v1oZHCM0nYQ2NqUkvS\n\t\t\tj+hwUU3RiWl7x3D2s9wSdNt7XUtW05a/FXehsPSiJfKvHJJnGOX0BgTvkLnkAOTd\n\t\t\tOrUZ/wK69Dzu4IvrN4vs9Nes8vbwPa/ddZEzGR0cQMt0JBkhk9kU/qwqUseP1QRJ\n\t\t\t5I1jR4g8aYPL/ke9K35PxZWuDp3U0UPAZ3PjFAh+5T+fc7gzCs9dPzSHloruU+gl\n\t\t\tFQIDAQAB\n\t\t\t-----END CERTIFICATE-----"
          maxLength: 512
          type: string
      required:
      - pem
      title: CheckDevicesV2CertsPayload
      type: object
    ArduinoDevicev2CertCollection:
      description: ArduinoDevicev2CertCollection is the media type for an array of ArduinoDevicev2Cert (default view)
      items:
        $ref: '#/components/schemas/ArduinoDevicev2Cert'
      title: 'Mediatype identifier: application/vnd.arduino.devicev2.cert+json; type=collection; view=default'
      type: array
    error:
      description: Error response media type (default view)
      properties:
        code:
          description: an application-specific error code, expressed as a string value.
          example: invalid_value
          type: string
        detail:
          description: a human-readable explanation specific to this occurrence of the problem.
          example: Value of ID must be an integer
          type: string
        id:
          description: a unique identifier for this particular occurrence of the problem.
          example: 3F1FKVRR
          type: string
        meta:
          additionalProperties: true
          description: a meta object containing non-standard meta-information about the error.
          example:
            timestamp: 1458609066
          type: object
        status:
          description: the HTTP status code applicable to this problem, expressed as a string value.
          example: '400'
          type: string
      title: 'Mediatype identifier: application/vnd.goa.error+json; view=default'
      type: object
externalDocs:
  description: See docs on Confluence
  url: https://arduino.atlassian.net/wiki/spaces/FTWEB/pages/91160610/Arduino+IoT+Cloud