Using Postman to Execute a Project Data Import in FlexNet Code Insight

Using Postman to Execute a Project Data Import in FlexNet Code Insight

The following instructions describe how to use Postman to import FlexNet Code Insight project data into another Code Insight project.

These instructions apply to imports that are run in FlexNet Code Insight 2020 R2 and later.

Before Importing the Data

You must provide the following artifacts and information to run the project data import process.

Import Data File

The input for the import is a JSON file (archived as a .zip file) containing project data. This file is referred to as the import data file. For information about how to create the import data file, see “Input Used in the Import Process” in the FlexNet Code Insight User Guide.

JSON Web Token

The import process requires a valid JSON Web Token (JWT) for the owner of the project to which data is to be imported. For instructions on obtaining this token so that you can copy it to the Postman UI, see the “Managing Authorization Tokens” in the FlexNet Code Insight User Guide.

Project ID

The import process requires the ID of the project to which you are importing data. You can obtain this ID through the FlexNet Code Insight Web UI or REST interface. See “Project ID” in the FlexNet Code Insight User Guide for more information.

Import Settings

The following shows the syntax of all settings available for the import process. The list of settings you provide must be in JSON format as shown, and the entire list must be enclosed in curly brackets. For a detailed description of these settings, refer to the “Available Import Options to Configure Import Behavior” section in the FlexNet Code Insight User Guide.

{

    “createEmptyInventory” : true/false,
    “overwriteInventoryNotes” :  true/false,
    “addFilesToInventory” :  true/false,
   “inventoryFileMatchingCriteria” :  “MD5 | FILENAME | COMPLETE_FILEPATH | PARTIAL_FILEPATH |
    MD5_AND_COMPLETE_FILEPATH | MD5_AND_PARTIAL_FILEPATH | MD5_AND_FILENAME”,
    “inventoryDirectoryDepth” : 1-20,
    “markFilesAsReviewed” : true/false,
    “reviewFileMatchingCriteria” :  “MD5 | FILENAME | COMPLETE_FILEPATH | PARTIAL_FILEPATH |
     MD5_AND_COMPLETE_FILEPATH | MD5_AND_PARTIAL_FILEPATH | MD5_AND_FILENAME”,
    “reviewDirectoryDepth” : 1-20

}

This is an example of the settings you might provide in the Postman UI. Best practice is to create this text ahead of time and simply copy and paste it in the Postman UI.

{

    "createEmptyInventory": false,
    "overwriteInventoryNotes": true,
    “addFilesToInventory” :  true
    "inventoryFileMatchingCriteria": "COMPLETE_FILEPATH",
    "markFilesAsReviewed": true,
    "reviewFileMatchingCriteria": "FILENAME",
}

Executing the Import

Do the following to execute the import:

  1. Open Postman.
  2. Provide the path for the FlexNetCode Insight import REST API:

    http://{hostname}:{port}/codeinsight/api/projects/{projectId}/import

    The path must include the following information specific to your FlexNet Code Insight environment:

    hostname:port—The machine name (or IP address) and port for the machine where FlexNet Code Insight is running. The following example uses "localhost:8888".
    projectID—The ID of the  Code Insight project to which you are importing data.

  3. Select the POST method for API.
     
     


    kledoux_0-1589213765392.png

  4. Navigate to the Headers section.
  5. For Authorization, provide your JSON Web Token (JWT) in the Value field. Include the term “Bearer” at the beginning of the token value.

    kledoux_1-1589213765397.png

  6. Navigate to the Body | form-data section.
  7. For importFile, select File; and then in the Value field, select the import data file containing the project data to import.

    kledoux_2-1589213765406.png

  8. For projectImportModel, select Text; and for the model CONTENT TYPE, select application/json.

    kledoux_3-1589213765416.png

  9. In the Value field for projectImportModel, copy and paste the import settings you previously defined, as described in the "Import Data File" section above.

    kledoux_4-1589213765426.png

  10. Click Send to execute the import.
Was this article helpful? Yes No
No ratings
Version history
Revision #:
13 of 13
Last update:
‎Jul 14, 2020 05:48 PM
Updated by:
 
Contributors