openapi: 3.0.3
x-stoplight:
  id: czd6jzf5th87g
info:
  title: Visual Investigator Transport
  contact:
    name: SAS Developers
    url: https://developer.sas.com
    email: devex@sas.com
  description: The Transport API imports and exports SAS Visual Investigator configuration data. This configuration data is transferred in a ZIP formatted file.
  version: "1"
tags:
  - name: Root
    description: Top-level navigation links.
  - name: Export
    description: Contains the operations related to exporting a ZIP representation of a SAS Visual Investigator configuration.
  - name: Import
    description: Contains the operations related to importing a ZIP representation of a SAS Visual Investigator configuration.
paths:
  /v1/solution/importAll:
    post:
      x-sas-internal: false
      tags:
        - Import
      summary: Import all configuration data from ZIP file
      description: >
        Accepts a ZIP file and performs complete import of all contents in a single step. 
      operationId: importAllFromZip
      requestBody:
        content:
          application/vnd.sas.zip:
            schema:
              type: string
              format: binary
          application/zip:
            schema:
              type: string
              format: binary
        description: >
          The ZIP data containing a SAS Visual Investigator configuration. All contents will be imported automatically.
        required: true
      responses:
        "200":
          description: The import was successful.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/snapshotResponseRep"
              examples:
                snapshotResponseRep:
                  $ref: "#/components/examples/snapshotResponseRep"
            application/vnd.sas.fcs.config.reps.snapshotresponserep+json:
              schema:
                $ref: "#/components/schemas/snapshotResponseRep"
              examples:
                snapshotResponseRep:
                  $ref: "#/components/examples/snapshotResponseRep"
        "202":
          description: The request has been accepted for processing, but the processing has not been completed.
          headers:
            Location:
              description: Location of the job status resource.
              schema:
                type: string
        "400":
          description: The request was invalid.
        "500":
          description: The request could not be fulfilled because of an unexpected server error.
  /v1/solution/exportAll:
    post:
      x-sas-internal: false
      tags:
        - Export
      summary: Export all configuration data as ZIP file
      description: >
        Exports all solutions and configurations as a ZIP file containing the complete configuration without requiring configuration selection.
      operationId: exportAll
      responses:
        "200":
          description: The export was successful.
          content:
            application/vnd.sas.zip:
              schema:
                type: string
                format: binary
            application/zip:
              schema:
                type: string
                format: binary
        "500":
          description: The request could not be fulfilled because of an unexpected server error.
servers:
  - url: https://example.com/svi-transport
    description: An example URL including the base path for this API.
components:
  requestBodies:
    updateConfigurationZipdata:
      content:
        application/vnd.sas.zip:
          schema:
            type: string
            format: binary
      description: >
        The ZIP data containing a SAS Visual Investigator configuration. In most cases the ZIP data was created by a previous configuration export.
      required: true
  schemas:
    api:
      description: The list of links to top-level resources and operations available. from the root of the API.
      type: object
      properties:
        links:
          description: The API's top-level links.
          items:
            $ref: "#/components/schemas/link"
          type: array
        version:
          description: The version number of the API representation. This is version 1.
          minimum: 1
          type: integer
    solutionConfiguration:
      title: Solution Configuration
      type: object
      description: Configuration details for a solution.
      properties:
        includeAll:
          type: boolean
          description: Flag indicating whether to include all items.
        items:
          type: array
          description: List of solution configuration selection items.
          items:
            type: object
            description: Solution configuration selection item.
        properties:
          type: object
          description: Properties used for creating the presentation tree.
          additionalProperties:
            type: string
        zipData:
          type: string
          format: byte
          description: Byte array containing ZIP data.
        generalWarnings:
          type: array
          description: Set of general warnings likely resolvable by the user.
          items:
            type: string
        warnings:
          type: array
          description: List of warnings more likely to be understood by someone who edits configuration ZIP files.
          items:
            type: string
    link:
      description: Link to a related operation or resource.
      type: object
      properties:
        href:
          description: The URL for the link.
          type: string
        itemType:
          description: If this is a link to a container, `itemType` is the media type or link type for the items in the container.
          type: string
        method:
          description: The HTTP method for the link.
          type: string
        rel:
          description: The relationship of the link to the resource.
          type: string
        responseItemType:
          description: The media type or link type of the items in the response body for a `PUT`, `POST`, or `PATCH` operation.
          type: string
        responseType:
          description: The media type or link type of the response body for a `PUT`, `POST`, or `PATCH` operation.
          type: string
        title:
          description: The title for the link.
          type: string
        type:
          description: The media type or link type for the link.
          type: string
        uri:
          description: The relative URI for the link.
          type: string
    importResults:
      title: Import Results
      description: >
        Response containing the import results and messages.
      type: object
      properties:
        componentServiceResponses:
          type: object
          description: >
            A map of the import messages returned from the SAS Visual Investigator configuration providers.
        numberComponentServicesInvoked:
          type: integer
          format: int32
          description: >
            The number of SAS Visual Investigator configuration providers invoked for the import.
        numberComponentServicesSuccessful:
          type: integer
          format: int32
          description: >
            The number of SAS Visual Investigator configuration providers that successfully imported configuration data.
        translatedMessages:
          type: array
          description: >
            Messages from the transport service about any errors encountered during the import.
          items:
            type: string
        version:
          type: integer
          format: int32
          description: >
            This media type's schema version number. This representation is version 1.
        warnings:
          type: array
          description: >
            A list of warning messages generated by the import.
          items:
            type: string
    snapshotResponseRep:
      title: Snapshot Response
      type: object
      description: A response containing the import results and messages.
      properties:
        componentServiceResponses:
          type: object
          description: A map of the import messages returned from the SAS Visual Investigator configuration providers.
        numberComponentServicesInvoked:
          type: integer
          format: int32
          description: The number of SAS Visual Investigator configuration providers invoked for the import.
        numberComponentServicesSuccessful:
          type: integer
          format: int32
          description: The number of SAS Visual Investigator configuration providers that successfully imported configuration data.
        translatedMessages:
          type: array
          description: Messages from the transport service about any errors encountered during the import.
          items:
            type: string
        version:
          type: integer
          format: int32
          description: This media type's schema version number. This representation is version 1.
        warnings:
          type: array
          description: A list of warning messages generated by the import.
          items:
            type: string
  examples:
    api:
      description: An example of the response from /svi-transport listing the top-level links.
      value:
        version: 1
        links:
          - method: GET
            rel: /solution/configuration
            href: /solution/configuration
            uri: /solution/configuration
            type: application/vnd.sas.fcs.solution.configuration
            title: Solution Configuration
          - method: POST
            rel: /solution/export
            href: /solution/export
            uri: /solution/export
            type: application/vnd.sas.fcs.solution.configuration
            responseType: application/zip
            title: Solution Configuration with ZIP File
          - method: POST
            rel: /solution/configuration
            href: /solution/configuration
            uri: /solution/configuration
            type: application/zip
            responseType: application/vnd.sas.fcs.solution.configuration
            title: Solution Configuration ZIP File
          - method: POST
            rel: /solution/import
            href: /solution/import
            uri: /solution/import
            type: application/zip
            responseType: application/vnd.sas.fcs.config.response
            title: Import ZIP File
          - method: POST
            rel: /solution/import
            href: /solution/import
            uri: /solution/import
            type: application/vnd.sas.fcs.solution.configuration
            responseType: application/vnd.sas.fcs.config.response
            title: Import Configuration with Included ZIP File
          - method: POST
            rel: /solution/importAll
            href: /solution/importAll
            uri: /solution/importAll
            type: application/zip
            responseType: application/vnd.sas.fcs.config.response
            title: Import All Configuration from ZIP File in One Step
          - method: POST
            rel: /solution/exportAll
            href: /solution/exportAll
            uri: /solution/exportAll
            responseType: application/zip
            title: Export All Configuration as ZIP File in One Step
          - method: POST
            rel: /snapshot/import
            href: /snapshot/import
            uri: /snapshot/import
            type: application/zip
            responseType: application/vnd.sas.fcs.config.response
            title: Import ZIP File
    snapshotResponseRep:
      description: Example feedback when the import was successful.
      value:
        version: 1
        componentConfigServiceResponses: {}
        translatedMessages: []
        httpStatus: 202
    solutionConfiguration:
      description: An example of a solution configuration.
      value:
        allZipConfigProviders:
          - svi-feature
          - svi-datahub
          - svi-vsd-service
          - svi-sand
          - svi-indexer
          - svi-scorecard
          - SASVisualInvestigator
          - svi-alert
        generalWarnings: []
        includeAll: true
        items: []
        properties: {}
        selectedItemBranchList: []
        warnings: []
