openapi: 3.0.3
info:
  description: REST API OpenAPI documentation for the Object Storage
  license:
    name: MIT
    url: https://github.com/aziontech/azionapi-openapi/blob/main/LICENSE.md
  title: Object Storage
  version: 1.0.0 (v1)
servers:
- description: Production
  url: https://api.azion.com
paths:
  /v4/edge_storage/buckets:
    get:
      description: ""
      operationId: storage_api_buckets_list
      parameters:
      - description: A page number within the paginated result set.
        explode: true
        in: query
        name: page
        required: false
        schema:
          type: integer
        style: form
      - description: Number of results to return per page.
        explode: true
        in: query
        name: page_size
        required: false
        schema:
          type: integer
        style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedBucketList'
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
      - tokenAuth: []
      summary: List buckets
      tags:
      - storage
    post:
      description: ""
      operationId: storage_api_buckets_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BucketCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BucketCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BucketCreate'
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBucket'
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "202":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBucket'
          description: ""
      security:
      - tokenAuth: []
      summary: Create a new bucket
      tags:
      - storage
  /v4/edge_storage/buckets/{bucket_name}/objects:
    get:
      description: ""
      operationId: storage_api_buckets_objects_list
      parameters:
      - explode: false
        in: path
        name: bucket_name
        required: true
        schema:
          type: string
        style: simple
      - description: Token for next page.
        explode: true
        in: query
        name: continuation_token
        required: false
        schema:
          type: string
        style: form
      - description: Number of results to return per page.
        explode: true
        in: query
        name: max_object_count
        required: false
        schema:
          type: integer
        style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedBucketObjectList'
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
      - tokenAuth: []
      summary: List buckets objects
      tags:
      - storage
  /v4/edge_storage/buckets/{bucket_name}/objects/{object_key}:
    delete:
      description: Delete an object key from bucket
      operationId: storage_api_buckets_objects_destroy
      parameters:
      - explode: false
        in: path
        name: bucket_name
        required: true
        schema:
          type: string
        style: simple
      - explode: false
        in: path
        name: object_key
        required: true
        schema:
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessObjectOperation'
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
      - tokenAuth: []
      summary: Delete object key
      tags:
      - storage
    get:
      description: Download the object key from bucket.
      operationId: storage_api_buckets_objects_retrieve
      parameters:
      - explode: false
        in: path
        name: bucket_name
        required: true
        schema:
          type: string
        style: simple
      - explode: false
        in: path
        name: object_key
        required: true
        schema:
          type: string
        style: simple
      responses:
        "200":
          content:
            text/html: {}
            application/json: {}
            application/xml: {}
            text/plain: {}
            image/jpeg: {}
            image/png: {}
            image/gif: {}
            video/mp4: {}
            audio/mpeg: {}
            application/pdf: {}
            application/javascript: {}
            text/css: {}
            application/octet-stream: {}
            multipart/form-data: {}
            application/x-www-form-urlencoded: {}
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
      - tokenAuth: []
      summary: Download object
      tags:
      - storage
    post:
      description: Create a new object key in the bucket.
      operationId: storage_api_buckets_objects_create
      parameters:
      - description: "The content type of the file (Example: text/plain)."
        explode: false
        in: header
        name: Content-Type
        required: false
        schema:
          type: string
        style: simple
      - explode: false
        in: path
        name: bucket_name
        required: true
        schema:
          type: string
        style: simple
      - explode: false
        in: path
        name: object_key
        required: true
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/octet-stream:
            schema:
              format: binary
              type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessObjectOperation'
          description: ""
        "201":
          description: Created
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
      - tokenAuth: []
      summary: Create new object key
      tags:
      - storage
    put:
      description: Update the object key from bucket.
      operationId: storage_api_buckets_objects_update
      parameters:
      - description: "The content type of the file (Example: text/plain)."
        explode: false
        in: header
        name: Content-Type
        required: false
        schema:
          type: string
        style: simple
      - explode: false
        in: path
        name: bucket_name
        required: true
        schema:
          type: string
        style: simple
      - explode: false
        in: path
        name: object_key
        required: true
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/octet-stream:
            schema:
              format: binary
              type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessObjectOperation'
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
      - tokenAuth: []
      summary: Update the object key
      tags:
      - storage
  /v4/edge_storage/buckets/{name}:
    delete:
      description: ""
      operationId: storage_api_buckets_destroy
      parameters:
      - explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessBucketOperation'
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
      - tokenAuth: []
      summary: Delete a bucket
      tags:
      - storage
    patch:
      description: ""
      operationId: storage_api_buckets_partial_update
      parameters:
      - explode: false
        in: path
        name: name
        required: true
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BucketUpdate'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBucket'
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "202":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBucket'
          description: ""
      security:
      - tokenAuth: []
      summary: Update bucket info
      tags:
      - storage
  /v4/edge_storage/s3-credentials:
    get:
      description: ""
      operationId: storage_api_s3_credentials_list
      parameters:
      - description: Object key. Used to identify the object for requests. Sent in
          POST requests as a path variable.
        explode: true
        in: query
        name: key
        required: false
        schema:
          type: string
        style: form
      - description: Timestamp of the last modification to the object.
        explode: true
        in: query
        name: last_modified
        required: false
        schema:
          type: string
        style: form
      - description: Size of file in bytes.
        explode: true
        in: query
        name: size
        required: false
        schema:
          type: integer
        style: form
      - description: Hash that can be added to the continuation_token query to skip
          list to the next page.
        explode: true
        in: query
        name: continuation_token
        required: false
        schema:
          type: string
        style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedS3CredentialList'
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
      - tokenAuth: []
      summary: List s3 credentials
      tags:
      - storage
    post:
      description: ""
      operationId: storage_api_s3_credentials_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/S3CredentialCreate'
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseS3Credential'
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
      - tokenAuth: []
      summary: create s3 credentials
      tags:
      - storage
  /v4/edge_storage/s3-credentials/{s3_credential_access_key}:
    delete:
      description: ""
      operationId: storage_api_s3_credentials_delete
      parameters:
      - explode: false
        in: path
        name: s3_credential_access_key
        required: true
        schema:
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseS3Credential'
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
      - tokenAuth: []
      summary: delete by s3 credentials
      tags:
      - storage
    get:
      description: ""
      operationId: storage_api_s3_credentials_by_access_key
      parameters:
      - explode: false
        in: path
        name: s3_credential_access_key
        required: true
        schema:
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseS3Credential'
          description: ""
        "400":
          description: Bad Request
        "404":
          description: Not Found
        "406":
          description: Not Acceptable
        "429":
          description: Too Many Requests
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
      - tokenAuth: []
      summary: get by s3 credentials by access key
      tags:
      - storage
components:
  schemas:
    Bucket:
      example:
        edge_access: read_only
        name: name
      properties:
        name:
          maxLength: 63
          minLength: 6
          readOnly: true
          type: string
        edge_access:
          $ref: '#/components/schemas/EdgeAccessEnum'
      required:
      - edge_access
      - name
      type: object
    BucketCreate:
      example:
        edge_access: read_only
        name: name
      properties:
        name:
          maxLength: 63
          minLength: 6
          type: string
        edge_access:
          $ref: '#/components/schemas/EdgeAccessEnum'
      required:
      - edge_access
      - name
      type: object
    BucketUpdate:
      example:
        edge_access: read_only
      properties:
        edge_access:
          $ref: '#/components/schemas/EdgeAccessEnum'
      required:
      - edge_access
      type: object
    BucketObject:
      example:
        size: 0
        etag: etag
        last_modified: 2000-01-23T04:56:07.000+00:00
        key: key
      properties:
        key:
          readOnly: true
          type: string
        last_modified:
          format: date-time
          readOnly: true
          type: string
        size:
          readOnly: true
          type: integer
        etag:
          readOnly: true
          type: string
      required:
      - key
      - last_modified
      - size
      type: object
    S3Credential:
      example:
        bucket: s3-credentials-bucket
        secret_key: s3_credential_secret_key
        capabilities:
        - listAllBucketNames
        - listBuckets
        - listFiles
        - readFiles
        - writeFiles
        - deleteFiles
        access_key: s3_credential_access_key
        name: my-s3-credential-all-permissions
        created_at: 2024-03-04T16:54:14.782211Z
        expiration_date: 2025-01-31T10:57:00Z
      properties:
        name:
          example: my-s3-credential-all-permissions
          maxLength: 200
          minLength: 1
          pattern: .*
          type: string
        access_key:
          example: s3_credential_access_key
          maxLength: 200
          minLength: 1
          pattern: .*
          type: string
        secret_key:
          example: s3_credential_secret_key
          maxLength: 200
          minLength: 1
          pattern: .*
          type: string
        capabilities:
          example:
          - listAllBucketNames
          - listBuckets
          - listFiles
          - readFiles
          - writeFiles
          - deleteFiles
          items:
            type: string
          type: array
        bucket:
          example: s3-credentials-bucket
          maxLength: 200
          minLength: 1
          pattern: .*
          type: string
        expiration_date:
          example: 2025-01-31T10:57:00Z
          format: date-time
          maxLength: 30
          minLength: 10
          pattern: .*
          type: string
        created_at:
          example: 2024-03-04T16:54:14.782211Z
          format: date-time
          maxLength: 30
          minLength: 10
          pattern: .*
          type: string
      type: object
    S3CredentialCreate:
      example:
        bucket: s3-credentials-bucket
        capabilities:
        - listAllBucketNames
        - listBuckets
        - listFiles
        - readFiles
        - writeFiles
        - deleteFiles
        name: my-s3-credential-all-permissions
        expiration_date: 2025-01-31T10:57:00Z
      properties:
        name:
          example: my-s3-credential-all-permissions
          maxLength: 200
          minLength: 1
          pattern: .*
          type: string
        capabilities:
          example:
          - listAllBucketNames
          - listBuckets
          - listFiles
          - readFiles
          - writeFiles
          - deleteFiles
          items:
            type: string
          type: array
        bucket:
          example: s3-credentials-bucket
          maxLength: 200
          minLength: 1
          pattern: .*
          type: string
        expiration_date:
          example: 2025-01-31T10:57:00Z
          format: date-time
          maxLength: 30
          minLength: 10
          pattern: .*
          type: string
      type: object
    EdgeAccessEnum:
      enum:
      - read_only
      - read_write
      - restricted
      type: string
    ObjectResponseData:
      example:
        object_key: object_key
      properties:
        object_key:
          type: string
      required:
      - object_key
      type: object
    PaginatedBucketList:
      example:
        next: http://api.example.org/accounts/?page=4
        previous: http://api.example.org/accounts/?page=2
        count: 123
        results:
        - edge_access: read_only
          name: name
        - edge_access: read_only
          name: name
      properties:
        count:
          example: 123
          type: integer
        next:
          example: http://api.example.org/accounts/?page=4
          format: uri
          nullable: true
          type: string
        previous:
          example: http://api.example.org/accounts/?page=2
          format: uri
          nullable: true
          type: string
        results:
          items:
            $ref: '#/components/schemas/Bucket'
          type: array
      type: object
    PaginatedBucketObjectList:
      example:
        next: http://api.example.org/accounts/?page=4
        continuation_token: continuation_token
        previous: http://api.example.org/accounts/?page=2
        count: 123
        results:
        - size: 0
          etag: etag
          last_modified: 2000-01-23T04:56:07.000+00:00
          key: key
        - size: 0
          etag: etag
          last_modified: 2000-01-23T04:56:07.000+00:00
          key: key
      properties:
        count:
          example: 123
          type: integer
        next:
          example: http://api.example.org/accounts/?page=4
          format: uri
          nullable: true
          type: string
        previous:
          example: http://api.example.org/accounts/?page=2
          format: uri
          nullable: true
          type: string
        continuation_token:
          maxLength: 200
          minLength: 10
          nullable: true
          pattern: .*
          type: string
        results:
          items:
            $ref: '#/components/schemas/BucketObject'
          type: array
      type: object
    PaginatedS3CredentialList:
      example:
        next: http://api.example.org/accounts/?page=4
        previous: http://api.example.org/accounts/?page=2
        count: 123
        results:
        - bucket: s3-credentials-bucket
          secret_key: s3_credential_secret_key
          capabilities:
          - listAllBucketNames
          - listBuckets
          - listFiles
          - readFiles
          - writeFiles
          - deleteFiles
          access_key: s3_credential_access_key
          name: my-s3-credential-all-permissions
          created_at: 2024-03-04T16:54:14.782211Z
          expiration_date: 2025-01-31T10:57:00Z
        - bucket: s3-credentials-bucket
          secret_key: s3_credential_secret_key
          capabilities:
          - listAllBucketNames
          - listBuckets
          - listFiles
          - readFiles
          - writeFiles
          - deleteFiles
          access_key: s3_credential_access_key
          name: my-s3-credential-all-permissions
          created_at: 2024-03-04T16:54:14.782211Z
          expiration_date: 2025-01-31T10:57:00Z
      properties:
        count:
          example: 123
          maximum: 1000
          minimum: 0
          type: integer
        next:
          example: http://api.example.org/accounts/?page=4
          format: uri
          nullable: true
          type: string
        previous:
          example: http://api.example.org/accounts/?page=2
          format: uri
          nullable: true
          type: string
        results:
          items:
            $ref: '#/components/schemas/S3Credential'
          type: array
      type: object
    ResponseS3Credential:
      example:
        data:
          bucket: s3-credentials-bucket
          secret_key: s3_credential_secret_key
          capabilities:
          - listAllBucketNames
          - listBuckets
          - listFiles
          - readFiles
          - writeFiles
          - deleteFiles
          access_key: s3_credential_access_key
          name: my-s3-credential-all-permissions
          created_at: 2024-03-04T16:54:14.782211Z
          expiration_date: 2025-01-31T10:57:00Z
        state: executed
      properties:
        state:
          example: executed
          maxLength: 30
          minLength: 1
          pattern: .*
          type: string
        data:
          $ref: '#/components/schemas/S3Credential'
      type: object
    ResponseBucket:
      example:
        data:
          edge_access: read_only
          name: name
        state: pending
      properties:
        state:
          $ref: '#/components/schemas/StateEnum'
        data:
          $ref: '#/components/schemas/Bucket'
      required:
      - data
      - state
      type: object
    StateEnum:
      enum:
      - pending
      - executed
      type: string
    SuccessBucketOperation:
      example:
        data:
          edge_access: read_only
          name: name
        state: ""
      properties:
        state:
          allOf:
          - $ref: '#/components/schemas/StateEnum'
          title: BucketStateEnum
        data:
          $ref: '#/components/schemas/Bucket'
      required:
      - data
      - state
      type: object
    SuccessObjectOperation:
      example:
        data:
          object_key: object_key
        state: ""
      properties:
        state:
          allOf:
          - $ref: '#/components/schemas/StateEnum'
          title: ObjectStateEnum
        data:
          $ref: '#/components/schemas/ObjectResponseData'
      required:
      - data
      - state
      type: object
  securitySchemes:
    tokenAuth:
      description: Token-based authentication with required prefix "Token"
      in: header
      name: Authorization
      type: apiKey
