openapi: 3.0.1
info:
  title: Documentation Norce [Storm] Connect Job Service
  description: >-
    The Job Service has Entities and Operations concerned with jobs created in
    Norce [Storm].
  version: '4.0'
servers:
  - url: https://connect.lab.storm.io/4.0/api
paths:
  /Job/Get:
    get:
      tags:
        - Job
      summary: Get Job
      description: >-
        Get job information by it's id.<br/>Read more about the method <a
        href='/jobintegration/#jobget'>here</a>.
      operationId: Get
      parameters:
        - name: id
          in: query
          description: Job id
          required: true
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobDto'
            application/xml:
              schema:
                $ref: '#/components/schemas/JobDto'
        '400':
          description: Bad Request
          content: {}
        '500':
          description: Internal Server Error
          content: {}
  /Job/GetLog:
    get:
      tags:
        - Job
      summary: Get Job log
      description: >-
        Get log for given job by it's id. <br/>Read more about the method <a
        href='/jobintegration/#joblogget'>here</a>.
      operationId: GetLog
      parameters:
        - name: id
          in: query
          description: Job id
          required: true
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobLogDto'
            application/xml:
              schema:
                $ref: '#/components/schemas/JobLogDto'
        '400':
          description: Bad Request
          content: {}
        '404':
          description: Job not found
          content: {}
        '500':
          description: Internal Server Error
          content: {}
  /Job/List:
    get:
      tags:
        - Job
      summary: List Job
      description: >-
        Lists all Jobs in the logs.<br/>Read more about the method <a
        href='/jobintegration/#joblist'>here</a>.
      operationId: List
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JobDto'
            application/xml:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JobDto'
        '400':
          description: Bad Request
          content: {}
        '500':
          description: Internal Server Error
          content: {}
  /Job/Ping:
    get:
      tags:
        - Healthcheck
      summary: Ping
      description: >-
        Check if Norce Commerce Connect is answering.<br/>Read more about the
        method <a href='/jobintegration/#ping'>here</a>.
      operationId: Ping
      responses:
        '200':
          description: Success
          content: {}
        '400':
          description: Bad Request
          content: {}
        '500':
          description: Internal Server Error
          content: {}
  /Job/Restart:
    post:
      tags:
        - Job
      summary: Restart Job
      description: >-
        Restarts a given Job. The job must have finished (i.e. have status 2 or
        3) before it may be restarted. A job can be restarted for two weeks,
        after that the initial payload is discarded.<br/>Read more about the
        method <a href='/jobintegration/#restartjob'>here</a>.
      operationId: Restart
      parameters:
        - name: id
          in: query
          description: Job id
          required: true
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
            application/xml:
              schema:
                $ref: '#/components/schemas/JobResponse'
        '400':
          description: Bad Request
          content: {}
        '500':
          description: Internal Server Error
          content: {}
components:
  schemas:
    JobDto:
      type: object
      properties:
        Fail:
          type: integer
          description: Number of items which failed to be imported.
          format: int32
        Insert:
          type: integer
          description: Number of inserts in all database tables triggered by import.
          format: int32
        IsFinished:
          type: boolean
          description: Shows if job is finished.
        JobId:
          type: integer
          description: Job identifier.
          format: int32
        LastUpdated:
          type: string
          description: Timestamp when job information was last updated.
          format: DateTime
        RunTime:
          type: string
          description: Job duration.
          format: TimeSpan
        Start:
          type: string
          description: Job start time.
          format: DateTime
        StatusId:
          type: integer
          description: >-
            Job status:<br>1 = Initialized<br>2 = Succeeded<br>3 = Failed<br>4 =
            Validation failed
          format: int32
        Stop:
          type: string
          description: Job stop time.
          format: DateTime
        StorageName:
          type: string
          description: Relative path to stored import file.
          format: uri
        Totals:
          type: integer
          description: Total number of import items.
          format: int32
        Updates:
          type: integer
          description: Number of updates in all database tables triggered by import.
          format: int32
      format: JobDto
    JobLogDto:
      type: object
      properties:
        SeverityId:
          type: integer
          description: Severity of log. 1 = Information, 2 = Warning, 3 = Error
          format: int32
        Message:
          type: string
          description: Log message
        TimeStamp:
          type: string
          description: Log timestamp
          format: DateTime
        ImportedRow:
          type: string
          description: Affected row from import
      description: Log record for a specific job
      format: JobLogDto
    JobResponse:
      type: object
      properties:
        StatusCode:
          type: string
          description: Status of the job
        Description:
          type: string
          description: Short message describing the job
        JobId:
          type: string
          description: >-
            Norce Commerce interal id created for this job. Refer to this for
            future requests.
          format: int32
        ValidationSummary:
          $ref: '#/components/schemas/ValidationSummary'
      description: General response for async Connect jobs
    ValidationSummary:
      type: object
      properties:
        NrOfItemsInTotal:
          type: integer
          description: Total number of items in payload.
          format: int32
        NrOfValidationFailures:
          type: integer
          description: Number of items that failed initial validation.
          format: int32
        Messages:
          type: array
          description: Messages concerning the validation.
          items:
            type: string
      description: Validation data for accepted payload
x-original-swagger-version: '2.0'
