42Crunch Jobs API

Manage API conformance scan jobs on Kubernetes

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

42crunch-jobs-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: 42Crunch API Conformance Scan Manager Health Jobs API
  description: API Conformance Scan Jobs Manager provides a convenient way to run 42Crunch API Conformance Scan on-premises as a Kubernetes Job in your Kubernetes cluster. It manages scan job lifecycle including creation, status monitoring, log retrieval, and deletion.
  version: 1.0.0
  x-generated-from: documentation
  contact:
    name: 42Crunch Support
    url: https://support.42crunch.com/hc/en-us
servers:
- description: Local server
  url: http://localhost:8090/
tags:
- name: Jobs
  description: Manage API conformance scan jobs on Kubernetes
paths:
  /api/job:
    get:
      summary: 42Crunch List All Scan Jobs
      description: Get status of all conformance scan jobs currently managed by the scan manager.
      operationId: listJobs
      tags:
      - Jobs
      responses:
        '200':
          description: OK - List of all jobs returned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Jobs'
              examples:
                ListJobs200Example:
                  summary: Default listJobs 200 response
                  x-microcks-default: true
                  value:
                    jobs:
                    - name: scand-48340c78-a76c-475f-aa4a-36fc834b3c02
                      status: active
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                ListJobs400Example:
                  summary: Default listJobs 400 response
                  x-microcks-default: true
                  value:
                    error: Invalid request parameters
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      summary: 42Crunch Create Scan Job
      description: Create a new API conformance scan job on Kubernetes using the provided scan token and configuration.
      operationId: createJob
      tags:
      - Jobs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobSpec'
            examples:
              CreateJobRequestExample:
                summary: Default createJob request
                x-microcks-default: true
                value:
                  token: 00000000-0000-0000-0000-000000000000
                  name: scand-foo
                  expirationTime: 777
                  platformService: protection.42crunch.com:8001
                  scandImage: 42crunch/scand-agent:latest
                  env:
                    HTTPS_PROXY: http://proxy.example.com:8080
                    SECURITY_FOO: bar
      responses:
        '200':
          description: OK - Job created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobStatus'
              examples:
                CreateJob200Example:
                  summary: Default createJob 200 response
                  x-microcks-default: true
                  value:
                    name: scand-48340c78-a76c-475f-aa4a-36fc834b3c02
                    status: started
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                CreateJob400Example:
                  summary: Default createJob 400 response
                  x-microcks-default: true
                  value:
                    error: Missing required field token
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/job/{name}:
    get:
      summary: 42Crunch Get Scan Job Status
      description: Read the current status of a specific conformance scan job by name.
      operationId: getJob
      tags:
      - Jobs
      parameters:
      - in: path
        required: true
        name: name
        description: The name of the scan job (e.g., scand-48340c78-a76c-475f-aa4a-36fc834b3c02)
        schema:
          $ref: '#/components/schemas/JobName'
        example: scand-48340c78-a76c-475f-aa4a-36fc834b3c02
      responses:
        '200':
          description: OK - Job status returned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobStatus'
              examples:
                GetJob200Example:
                  summary: Default getJob 200 response
                  x-microcks-default: true
                  value:
                    name: scand-48340c78-a76c-475f-aa4a-36fc834b3c02
                    status: active
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                GetJob400Example:
                  summary: Default getJob 400 response
                  x-microcks-default: true
                  value:
                    error: Job not found
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: 42Crunch Delete Scan Job
      description: Delete a conformance scan job by name. Removes the Kubernetes Job resource.
      operationId: deleteJob
      tags:
      - Jobs
      parameters:
      - in: path
        required: true
        name: name
        description: The name of the scan job to delete
        schema:
          $ref: '#/components/schemas/JobName'
        example: scand-48340c78-a76c-475f-aa4a-36fc834b3c02
      responses:
        '200':
          description: OK - Job deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobStatus'
              examples:
                DeleteJob200Example:
                  summary: Default deleteJob 200 response
                  x-microcks-default: true
                  value:
                    name: scand-48340c78-a76c-475f-aa4a-36fc834b3c02
                    status: deleted
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                DeleteJob400Example:
                  summary: Default deleteJob 400 response
                  x-microcks-default: true
                  value:
                    error: Job not found
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    JobSpec:
      type: object
      description: Specification for creating a new conformance scan job
      properties:
        token:
          description: On-premises scan token issued by the 42Crunch Platform
          type: string
          pattern: ^(scan_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          maxLength: 41
          minLength: 36
          example: 00000000-0000-0000-0000-000000000000
        name:
          $ref: '#/components/schemas/JobName'
        expirationTime:
          description: Expiration time for the job in seconds (max 7 days)
          type: integer
          maximum: 604800
          minimum: 1
          format: int32
          example: 3600
        platformService:
          description: Hostname and port for connecting to the 42Crunch Platform
          type: string
          pattern: ^[^:]+:[0-9]{3,5}$
          maxLength: 128
          minLength: 3
          example: protection.42crunch.com:8001
        scandImage:
          description: Docker image for the scand-agent container
          type: string
          pattern: ^\P{Cc}{1,128}$
          maxLength: 128
          minLength: 1
          example: 42crunch/scand-agent:latest
        env:
          description: Environment variables for scand-agent. Must start with SECURITY_, SCAN42C_, HTTP_PROXY, HTTPS_PROXY, HTTP_PROXY_API, HTTPS_PROXY_API, NO_PROXY, or NO_PROXY_API.
          type: object
          additionalProperties:
            type: string
            pattern: ^\P{Cc}+$
            minLength: 0
            maxLength: 512
          example:
            HTTPS_PROXY: http://proxy.example.com:8080
            HTTPS_PROXY_API: http://proxy-api.example.com:8080
            SECURITY_FOO: bar
            SCAN42C_FEATURE_FLAG: enabled
      additionalProperties: false
      required:
      - token
    Jobs:
      type: object
      description: Collection of all scan jobs
      properties:
        jobs:
          type: array
          description: List of all scan job statuses
          items:
            $ref: '#/components/schemas/JobStatus'
          maxItems: 1024
          example:
          - name: scand-48340c78-a76c-475f-aa4a-36fc834b3c02
            status: active
      additionalProperties: false
    JobName:
      type: string
      description: Unique name identifier for a scan job, prefixed with 'scand-'
      pattern: ^scand-[0-9a-zA-Z-]{1,36}$
      maxLength: 42
      minLength: 7
      example: scand-48340c78-a76c-475f-aa4a-36fc834b3c02
    JobStatus:
      type: object
      description: Current status of a conformance scan job
      properties:
        name:
          $ref: '#/components/schemas/JobName'
        status:
          type: string
          description: Current lifecycle status of the job
          enum:
          - started
          - active
          - succeeded
          - failed
          - unknown
          - deleted
          example: active
      additionalProperties: false
      required:
      - name
      - status
    Error:
      type: object
      description: Error response from the API
      properties:
        error:
          type: string
          description: Human-readable error message
          maxLength: 1024
          minLength: 1
          pattern: ^\P{Cc}+$
          example: Job not found
      additionalProperties: false
      required:
      - error
x-42c-no-authentication: true