openapi: 3.0.0
info:
  license:
    name: MIT
    url: https://github.com/aziontech/azionapi-openapi/blob/main/LICENSE.md
  title: Domain API
  version: 2.0.0
servers:
- description: Production
  url: https://api.azionapi.net
security:
- tokenAuth: []
paths:
  /domains:
    get:
      description: It returns the list of domains of an account.
      operationId: getDomains
      parameters:
      - explode: true
        in: query
        name: page
        required: false
        schema:
          format: int64
          type: integer
        style: form
      - explode: true
        in: query
        name: page_size
        required: false
        schema:
          format: int64
          type: integer
        style: form
      - explode: true
        in: query
        name: sort
        required: false
        schema:
          type: string
        style: form
      - explode: true
        in: query
        name: order_by
        required: false
        schema:
          type: string
        style: form
      - example: application/json; version=3
        explode: false
        in: header
        name: Accept
        required: false
        schema:
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json; version=3:
              schema:
                $ref: '#/components/schemas/DomainResponseWithResults'
          description: Successful response
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "422":
          description: Unprocessable Entity
        "500":
          description: Internal Server Error
      summary: /domains
      tags:
      - Domains
    post:
      description: It enables you to include a new domain into an account.
      operationId: createDomain
      parameters:
      - example: application/json; version=3
        explode: false
        in: header
        name: Accept
        required: false
        schema:
          type: string
        style: simple
      - example: application/json
        explode: false
        in: header
        name: Content-Type
        required: false
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json; version=3:
            schema:
              $ref: '#/components/schemas/CreateDomainRequest'
      responses:
        "200":
          content:
            application/json; version=3:
              schema:
                $ref: '#/components/schemas/DomainResponseWithResult'
          description: Successful response
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "409":
          description: Conflict
        "422":
          description: Unprocessable Entity
        "500":
          description: Internal Server Error
      summary: /domains
      tags:
      - Domains
  /domains/{id}:
    delete:
      description: It enables you to delete a domain.
      operationId: delDomain
      parameters:
      - example: application/json; version=3
        explode: false
        in: header
        name: Accept
        required: false
        schema:
          type: string
        style: simple
      - description: "The id of the domain to be deleted.\t"
        explode: false
        in: path
        name: id
        required: true
        schema:
          type: string
        style: simple
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "422":
          description: Unprocessable Entity
        "500":
          description: Internal Server Error
      summary: /domains/:id
      tags:
      - Domains
    get:
      description: It returns details of a domain.
      operationId: getDomain
      parameters:
      - example: application/json; version=3
        explode: false
        in: header
        name: Accept
        required: false
        schema:
          type: string
        style: simple
      - description: "The id of the domain to be consulted.\t"
        explode: false
        in: path
        name: id
        required: true
        schema:
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json; version=3:
              schema:
                $ref: '#/components/schemas/DomainResponseWithResult'
          description: Successful response
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "422":
          description: Unprocessable Entity
        "500":
          description: Internal Server Error
      summary: /domains/:id
      tags:
      - Domains
    patch:
      description: "It updates one or more fields in a Domain, preserving the value\
        \ of the fields not informed."
      operationId: updateDomain
      parameters:
      - example: application/json; version=3
        explode: false
        in: header
        name: Accept
        required: false
        schema:
          type: string
        style: simple
      - example: application/json
        explode: false
        in: header
        name: Content-Type
        required: false
        schema:
          type: string
        style: simple
      - explode: false
        in: path
        name: id
        required: true
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json; version=3:
            schema:
              $ref: '#/components/schemas/UpdateDomainRequest'
      responses:
        "200":
          content:
            application/json; version=3:
              schema:
                $ref: '#/components/schemas/DomainResponseWithResult'
          description: Successful response
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "405":
          description: Method Not Allowed
        "422":
          description: Unprocessable Entity
        "500":
          description: Internal Server Error
      summary: /domains/:id
      tags:
      - Domains
    put:
      description: |-
        It overwrites all fields of a domain, while preserving the id. Optional fields not filled in will be replaced by the default values.

        To update only some fields in a domain, consider using the PATCH method instead of PUT.
      operationId: putDomain
      parameters:
      - example: application/json; version=3
        explode: false
        in: header
        name: Accept
        required: false
        schema:
          type: string
        style: simple
      - example: application/json
        explode: false
        in: header
        name: Content-Type
        required: false
        schema:
          type: string
        style: simple
      - explode: false
        in: path
        name: id
        required: true
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json; version=3:
            schema:
              $ref: '#/components/schemas/PutDomainRequest'
      responses:
        "200":
          content:
            application/json; version=3:
              schema:
                $ref: '#/components/schemas/DomainResponseWithResult'
          description: Successful response
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "405":
          description: Method Not Allowed
        "422":
          description: Unprocessable Entity
        "500":
          description: Internal Server Error
      summary: /domains:/:id
      tags:
      - Domains
components:
  schemas:
    DomainData:
      properties:
        name:
          maxLength: 100
          minLength: 1
          pattern: "[a-zA-Z0-9$%^&*()-+=\\[\\]{};:?><,|/]+"
          type: string
        cnames:
          items:
            type: string
          type: array
        cname_access_only:
          type: boolean
        is_active:
          type: boolean
        edge_application_id:
          format: int64
          maximum: 10000000000000000000
          minimum: 1
          type: integer
        digital_certificate_id:
          maxLength: 100
          minLength: 1
          pattern: "[a-zA-Z0-9$%^&*()-+=\\[\\]{};:?><,|/]+"
          type: string
        environment:
          enum:
          - production
          - preview
          type: string
        is_mtls_enabled:
          type: boolean
        mtls_trusted_ca_certificate_id:
          format: int64
          nullable: true
          type: integer
        edge_firewall_id:
          format: int64
          nullable: true
          type: integer
        mtls_verification:
          enum:
          - enforce
          - permissive
          type: string
        crl_list:
          items:
            format: int64
            type: integer
          nullable: true
          type: array
      type: object
    DomainDataResponse:
      properties:
        name:
          maxLength: 100
          minLength: 1
          pattern: "[a-zA-Z0-9$%^&*()-+=\\[\\]{};:?><,|/]+"
          type: string
        cnames:
          items:
            type: string
          type: array
        cname_access_only:
          type: boolean
        is_active:
          type: boolean
        edge_application_id:
          format: int64
          maximum: 10000000000000000000
          minimum: 1
          type: integer
        digital_certificate_id:
          format: int64
          maximum: 10000000000000000000
          minimum: 1
          type: integer
        environment:
          enum:
          - production
          - preview
          type: string
        is_mtls_enabled:
          type: boolean
        mtls_trusted_ca_certificate_id:
          format: int64
          nullable: true
          type: integer
        edge_firewall_id:
          format: int64
          nullable: true
          type: integer
        mtls_verification:
          enum:
          - enforce
          - permissive
          type: string
        crl_list:
          items:
            format: int64
            type: integer
          nullable: true
          type: array
      type: object
    DomainEntity:
      allOf:
      - properties:
          id:
            format: int64
            type: integer
          domain_name:
            type: string
        type: object
      - $ref: '#/components/schemas/DomainData'
    DomainEntityResponse:
      allOf:
      - properties:
          id:
            format: int64
            type: integer
          domain_name:
            type: string
        type: object
      - $ref: '#/components/schemas/DomainDataResponse'
      example:
        edge_application_id: 5637376656633328640
        edge_firewall_id: 9
        is_active: true
        cnames:
        - cnames
        - cnames
        mtls_verification: enforce
        domain_name: domain_name
        environment: production
        mtls_trusted_ca_certificate_id: 7
        digital_certificate_id: 2302135886934765312
        crl_list:
        - 3
        - 3
        cname_access_only: true
        name: name
        is_mtls_enabled: true
        id: 5
    CreateDomainRequest:
      additionalProperties: false
      allOf:
      - $ref: '#/components/schemas/DomainData'
      example:
        edge_application_id: 800828190461011456
        environment: production
        mtls_trusted_ca_certificate_id: 6
        edge_firewall_id: 1
        is_active: true
        digital_certificate_id: digital_certificate_id
        crl_list:
        - 5
        - 5
        cname_access_only: true
        name: name
        is_mtls_enabled: true
        cnames:
        - cnames
        - cnames
        mtls_verification: enforce
      required:
      - cnames
      - edge_application_id
      - name
    UpdateDomainRequest:
      allOf:
      - $ref: '#/components/schemas/DomainData'
      example:
        edge_application_id: 800828190461011456
        environment: production
        mtls_trusted_ca_certificate_id: 6
        edge_firewall_id: 1
        is_active: true
        digital_certificate_id: digital_certificate_id
        crl_list:
        - 5
        - 5
        cname_access_only: true
        name: name
        is_mtls_enabled: true
        cnames:
        - cnames
        - cnames
        mtls_verification: enforce
    PutDomainRequest:
      additionalProperties: false
      allOf:
      - $ref: '#/components/schemas/DomainData'
      example:
        edge_application_id: 800828190461011456
        environment: production
        mtls_trusted_ca_certificate_id: 6
        edge_firewall_id: 1
        is_active: true
        digital_certificate_id: digital_certificate_id
        crl_list:
        - 5
        - 5
        cname_access_only: true
        name: name
        is_mtls_enabled: true
        cnames:
        - cnames
        - cnames
        mtls_verification: enforce
      required:
      - cnames
      - edge_application_id
      - name
    DomainLinks:
      additionalProperties: false
      example:
        next: next
        previous: previous
      properties:
        previous:
          nullable: true
          type: string
        next:
          nullable: true
          type: string
      required:
      - next
      - previous
      type: object
    DomainResponseWithResults:
      additionalProperties: false
      example:
        schema_version: 1
        count: 0
        links:
          next: next
          previous: previous
        total_pages: 6
        results:
        - edge_application_id: 5637376656633328640
          edge_firewall_id: 9
          is_active: true
          cnames:
          - cnames
          - cnames
          mtls_verification: enforce
          domain_name: domain_name
          environment: production
          mtls_trusted_ca_certificate_id: 7
          digital_certificate_id: 2302135886934765312
          crl_list:
          - 3
          - 3
          cname_access_only: true
          name: name
          is_mtls_enabled: true
          id: 5
        - edge_application_id: 5637376656633328640
          edge_firewall_id: 9
          is_active: true
          cnames:
          - cnames
          - cnames
          mtls_verification: enforce
          domain_name: domain_name
          environment: production
          mtls_trusted_ca_certificate_id: 7
          digital_certificate_id: 2302135886934765312
          crl_list:
          - 3
          - 3
          cname_access_only: true
          name: name
          is_mtls_enabled: true
          id: 5
      properties:
        count:
          format: int64
          type: integer
        total_pages:
          format: int64
          type: integer
        schema_version:
          format: int64
          type: integer
        links:
          $ref: '#/components/schemas/DomainLinks'
        results:
          items:
            $ref: '#/components/schemas/DomainEntityResponse'
          type: array
      required:
      - count
      - links
      - results
      - schema_version
      - total_pages
      type: object
    DomainResponseWithResult:
      additionalProperties: false
      example:
        schema_version: 1
        count: 0
        links:
          next: next
          previous: previous
        total_pages: 6
        results:
          edge_application_id: 5637376656633328640
          edge_firewall_id: 9
          is_active: true
          cnames:
          - cnames
          - cnames
          mtls_verification: enforce
          domain_name: domain_name
          environment: production
          mtls_trusted_ca_certificate_id: 7
          digital_certificate_id: 2302135886934765312
          crl_list:
          - 3
          - 3
          cname_access_only: true
          name: name
          is_mtls_enabled: true
          id: 5
      properties:
        count:
          format: int64
          type: integer
        links:
          $ref: '#/components/schemas/DomainLinks'
        results:
          $ref: '#/components/schemas/DomainEntityResponse'
        total_pages:
          format: int64
          type: integer
        schema_version:
          format: int64
          type: integer
      required:
      - results
      - schema_version
      type: object
  securitySchemes:
    tokenAuth:
      description: |
        You must inform a token to auth.
        Usage format: `Token <TOKEN>`
      in: header
      name: Authorization
      type: apiKey
