CrunchDAO submission API

The submission API from CrunchDAO — 8 operation(s) for submission.

OpenAPI Specification

crunchdao-submission-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Tournament activity submission API
  description: CrunchDAO Tournament Platform API Endpoints
  version: v2
servers:
- url: http://api.hub.crunchdao.com
  description: Generated server url
security: []
tags:
- name: submission
paths:
  /v4/competitions/{competitionIdentifier}/projects/{userLogin}/{projectIdentifier}/submissions:
    x-service-id: competition-service
    get:
      tags:
      - submission
      summary: List submissions.
      operationId: listSubmissionsV4
      parameters:
      - name: competitionIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: userLogin
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: projectIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: message
        in: query
        description: Filter on the message. Allow for a pattern (%).
        required: false
        style: form
        explode: true
        schema:
          type: string
          description: Filter on the message. Allow for a pattern (%).
      - name: type
        in: query
        description: Filter for submission with a specific type. `NOTEBOOK` are converted to `CODE`, so will return nothing.
        required: false
        style: form
        explode: true
        schema:
          type: string
          description: Filter for submission with a specific type. `NOTEBOOK` are converted to `CODE`, so will return nothing.
          enum:
          - CODE
          - NOTEBOOK
          - PREDICTION
      - name: valid
        in: query
        description: Filter for valid submissions. Pending submissions are ignored.
        required: false
        style: form
        explode: true
        schema:
          type: boolean
          description: Filter for valid submissions. Pending submissions are ignored.
      - name: gpuRequirement
        in: query
        description: Filter for gpu requirement.
        required: false
        style: form
        explode: true
        schema:
          type: string
          description: Filter for gpu requirement.
          enum:
          - OPTIONAL
          - RECOMMENDED
          - REQUIRED
      - name: hasModel
        in: query
        description: Filter for submissions with a model.
        required: false
        style: form
        explode: true
        schema:
          type: boolean
          description: Filter for submissions with a model.
      - name: page
        in: query
        description: Zero-based page index (0..N)
        required: false
        style: form
        explode: true
        schema:
          type: integer
          default: 0
          minimum: 0
      - name: size
        in: query
        description: The size of the page to be returned
        required: false
        style: form
        explode: true
        schema:
          type: integer
          default: 20
          minimum: 1
      - name: sort
        in: query
        description: 'Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.'
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageSubmission'
      security:
      - accessToken: []
      - apiKey: []
    post:
      tags:
      - submission
      summary: Create a submission.
      operationId: createSubmissionV4
      parameters:
      - name: competitionIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: userLogin
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: projectIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmissionCreateForm'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Submission'
      security:
      - accessToken: []
      - apiKey: []
  /v4/competitions/{competitionIdentifier}/projects/{userLogin}/{projectIdentifier}/submissions/next-encryption-id:
    x-service-id: competition-service
    get:
      tags:
      - submission
      summary: Get the next encrypted submission id.
      operationId: getNextSubmissionEncryptionId
      parameters:
      - name: competitionIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: userLogin
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: projectIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: pushToken
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
      security:
      - accessToken: []
      - apiKey: []
  /v3/competitions/{competitionIdentifier}/projects/{userLogin}/{projectIdentifier}/submissions:
    x-service-id: competition-service
    get:
      tags:
      - submission
      summary: List submissions.
      operationId: listSubmissions
      parameters:
      - name: competitionIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: userLogin
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: projectIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Submission'
      security:
      - accessToken: []
      - apiKey: []
  /v3/competitions/{competitionIdentifier}/projects/{userLogin}/{projectIdentifier}/submissions/{submissionNumber}:
    x-service-id: competition-service
    get:
      tags:
      - submission
      summary: Show a submission.
      operationId: getSubmission
      parameters:
      - name: competitionIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: userLogin
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: projectIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: submissionNumber
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: integer
          format: int64
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Submission'
      security:
      - accessToken: []
      - apiKey: []
  ? /v3/competitions/{competitionIdentifier}/projects/{userLogin}/{projectIdentifier}/submissions/{submissionNumber}/runtime-options
  : x-service-id: competition-service
    get:
      tags:
      - submission
      summary: List runtime options for a submission.
      operationId: getRuntimeOptions
      parameters:
      - name: competitionIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: userLogin
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: projectIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: submissionNumber
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: integer
          format: int64
      - name: page
        in: query
        description: Zero-based page index (0..N)
        required: false
        style: form
        explode: true
        schema:
          type: integer
          default: 0
          minimum: 0
      - name: size
        in: query
        description: The size of the page to be returned
        required: false
        style: form
        explode: true
        schema:
          type: integer
          default: 20
          minimum: 1
      - name: sort
        in: query
        description: 'Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.'
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageRuntimeOption'
      security:
      - accessToken: []
      - apiKey: []
  /v3/competitions/{competitionIdentifier}/projects/{userLogin}/{projectIdentifier}/submissions/{submissionNumber}/files:
    x-service-id: competition-service
    get:
      tags:
      - submission
      summary: List a submission's files.
      operationId: listSubmissionFiles
      parameters:
      - name: competitionIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: userLogin
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: projectIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: submissionNumber
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: integer
          format: int64
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubmissionFile'
      security:
      - apiKey: []
  ? /v3/competitions/{competitionIdentifier}/projects/{userLogin}/{projectIdentifier}/submissions/{submissionNumber}/files/render
  : x-service-id: competition-service
    get:
      tags:
      - submission
      summary: Render a submission's file.
      operationId: renderSubmissionFile
      parameters:
      - name: competitionIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: userLogin
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: projectIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: submissionNumber
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: integer
          format: int64
      - name: fileName
        in: query
        required: true
        style: form
        explode: true
        schema:
          type: string
      - name: light
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      responses:
        '200':
          description: OK
          content:
            text/html:
              schema:
                type: string
            application/json:
              schema:
                type: string
      security:
      - apiKey: []
  ? /v3/competitions/{competitionIdentifier}/projects/{userLogin}/{projectIdentifier}/submissions/{submissionNumber}/files/download
  : x-service-id: competition-service
    get:
      tags:
      - submission
      summary: Download a submission's file.
      operationId: downloadSubmissionFile
      parameters:
      - name: competitionIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: userLogin
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: projectIdentifier
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: submissionNumber
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: integer
          format: int64
      - name: fileName
        in: query
        required: true
        style: form
        explode: true
        schema:
          type: string
      - name: inline
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
                format: binary
      security:
      - apiKey: []
components:
  schemas:
    SubmissionFile:
      type: object
      properties:
        name:
          type: string
        size:
          type: integer
          format: int64
        encrypted:
          type: boolean
        mimeType:
          type: string
        foundHardcodedString:
          type: boolean
          deprecated: true
    RuntimeDefinitionSpecificationSize:
      type: object
      properties:
        size:
          type: integer
          format: int32
          description: Size in gigabytes.
    Submission:
      type: object
      properties:
        id:
          type: integer
          format: int64
        project:
          $ref: '#/components/schemas/Project'
        number:
          type: integer
          format: int64
        type:
          $ref: '#/components/schemas/SubmissionType'
        message:
          type: string
        valid:
          type: boolean
        mainFilePath:
          type: string
        modelDirectoryPath:
          type: string
        gpuRequirement:
          $ref: '#/components/schemas/GpuRequirement'
        model:
          $ref: '#/components/schemas/Model'
        totalSize:
          type: integer
          format: int64
        librariesVerified:
          type: boolean
        encrypted:
          type: boolean
        encryptionId:
          type: string
        createdAt:
          type: string
          format: date-time
        files:
          type: array
          items:
            $ref: '#/components/schemas/SubmissionFile'
    PageSubmission:
      type: object
      properties:
        pageNumber:
          type: integer
          format: int64
        pageSize:
          type: integer
          format: int64
        totalElements:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int64
        content:
          type: array
          items:
            $ref: '#/components/schemas/Submission'
    User:
      type: object
      properties:
        id:
          type: integer
          format: int64
        login:
          type: string
    RuntimeOptionStatus:
      type: string
      enum:
      - AVAILABLE
      - REQUESTABLE
      - REQUESTED
      - BLOCKED
    RuntimeDefinition:
      type: object
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
          description: Slug-like name.
        type:
          $ref: '#/components/schemas/RuntimeType'
          description: Runtime type.
        status:
          $ref: '#/components/schemas/RuntimeDefinitionStatus'
          description: Runtime status.
        recommendable:
          type: boolean
          description: Can the recommended badge be possible?
        accessRequestRequired:
          type: boolean
          description: Does this runtime requires an approval to be used?
        displayName:
          type: string
          description: Display name for cards.
        description:
          type: string
          description: Description for cards.
        poweredBy:
          $ref: '#/components/schemas/RuntimeDefinitionPoweredBy'
          description: Provider informations.
        specification:
          $ref: '#/components/schemas/RuntimeDefinitionSpecification'
          description: Environment specification.
        quotaConsumptionRate:
          type: number
          format: double
          description: How fast the quota is consumed for this runtime. `1` is normal speed, `<1` slower (more quota), `>1` faster (less quota).
        order:
          type: integer
          format: int64
          description: Lower values are shown first.
    RuntimeDefinitionSpecificationSoftware:
      type: object
      properties:
        python:
          type: string
    RuntimeDefinitionSpecificationNetwork:
      type: object
      properties:
        access:
          $ref: '#/components/schemas/RuntimeDefinitionSpecificationNetworkAccess'
    Project:
      type: object
      properties:
        id:
          type: integer
          format: int64
        competitionId:
          type: integer
          format: int64
        user:
          $ref: '#/components/schemas/User'
        name:
          type: string
        selected:
          type: boolean
        submitted:
          type: boolean
        note:
          type: string
        writeupUrl:
          type: string
        writeupArchived:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        userId:
          type: integer
          format: int64
          deprecated: true
    RuntimeType:
      type: string
      enum:
      - CPU
      - GPU
      - COPY
    RuntimeOption:
      type: object
      properties:
        definition:
          $ref: '#/components/schemas/RuntimeDefinition'
        quota:
          anyOf:
          - $comment: Seconds
            example: '60'
          - format: duration
            $anchor: https://en.wikipedia.org/wiki/ISO_week_date
            $comment: ISO 8601 Duration
            example: PT1M
          description: Remaining quota, with the quota factor applied.
        recommended:
          type: boolean
          description: If this runtime option is recommended for the submission.
        status:
          $ref: '#/components/schemas/RuntimeOptionStatus'
          description: Usability status of this runtime option.
    SubmissionCreateForm:
      type: object
      properties:
        message:
          type: string
          maxLength: 1024
          minLength: 0
        mainFilePath:
          type: string
          maxLength: 200
          minLength: 0
        modelDirectoryPath:
          type: string
          maxLength: 200
          minLength: 0
        pushToken:
          type: string
        type:
          type: string
          enum:
          - CODE
          - NOTEBOOK
          - PREDICTION
        modelName:
          type: string
          maxLength: 200
          minLength: 0
        codeFiles:
          type: object
          additionalProperties:
            type: string
            format: uuid
        modelFiles:
          type: object
          additionalProperties:
            type: string
            format: uuid
      required:
      - codeFiles
      - mainFilePath
      - message
      - modelDirectoryPath
      - pushToken
      - type
    PageRuntimeOption:
      type: object
      properties:
        pageNumber:
          type: integer
          format: int64
        pageSize:
          type: integer
          format: int64
        totalElements:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int64
        content:
          type: array
          items:
            $ref: '#/components/schemas/RuntimeOption'
    RuntimeDefinitionSpecificationCpu:
      type: object
      properties:
        coreCount:
          type: integer
          format: int32
    Model:
      type: object
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        project:
          $ref: '#/components/schemas/Project'
        totalSize:
          type: integer
          format: int64
        encrypted:
          type: boolean
        encryptionId:
          type: string
        createdAt:
          type: string
          format: date-time
    RuntimeDefinitionSpecificationGpu:
      type: object
      properties:
        count:
          type: integer
          format: int32
        model:
          type: string
        driver:
          type: string
    RuntimeDefinitionSpecification:
      type: object
      properties:
        memory:
          $ref: '#/components/schemas/RuntimeDefinitionSpecificationSize'
        sharedMemory:
          $ref: '#/components/schemas/RuntimeDefinitionSpecificationSize'
        storage:
          $ref: '#/components/schemas/RuntimeDefinitionSpecificationSize'
        cpu:
          $ref: '#/components/schemas/RuntimeDefinitionSpecificationCpu'
        gpu:
          $ref: '#/components/schemas/RuntimeDefinitionSpecificationGpu'
        network:
          $ref: '#/components/schemas/RuntimeDefinitionSpecificationNetwork'
        software:
          $ref: '#/components/schemas/RuntimeDefinitionSpecificationSoftware'
    SubmissionType:
      type: string
      enum:
      - CODE
      - NOTEBOOK
      - PREDICTION
    RuntimeDefinitionSpecificationNetworkAccess:
      type: string
      enum:
      - OPEN
      - FORBIDDEN
      - LOCAL_ONLY
    GpuRequirement:
      type: string
      enum:
      - OPTIONAL
      - RECOMMENDED
      - REQUIRED
    RuntimeDefinitionPoweredBy:
      type: object
      properties:
        text:
          type: string
        url:
          type: string
    RuntimeDefinitionStatus:
      type: string
      enum:
      - ACTIVE
      - RESTRICTED
      - DISABLED
  securitySchemes:
    apiKey:
      type: apiKey
      name: apiKey
      in: query
      scheme: token
    accessToken:
      type: http
      in: header
      scheme: Bearer
externalDocs:
  description: docs.crunchdao.com
  url: https://docs.crunchdao.com