Class MigrationController

java.lang.Object
gov.niem.tools.api.migrate.MigrationController

@RestController @RequestMapping("/migration") public class MigrationController extends Object
REST controller for migrations.
  • Constructor Details

    • MigrationController

      public MigrationController()
  • Method Details

    • migrateCmf

      @PostMapping(value="cmf", consumes="multipart/form-data") @ResponseStatus(code=OK) public org.springframework.http.ResponseEntity<byte[]> migrateCmf(@RequestParam(required=true) String from, @RequestParam(required=true) String to, @RequestPart(required=true) org.springframework.web.multipart.MultipartFile file, @RequestParam(required=false) String stewardKey, @RequestParam(required=false) String modelKey) throws Exception
      Migrate a version of a supported model in a CMF file to a newer version.

      Note: Only models stored via the NIEM API and that have migration rules are supported.

      Parameters:
      from - [REQUEST BODY PARAMETER] The version of the data model represented in the CMF file.
      to - [REQUEST BODY PARAMETER] A more recent version of the data model to which the CMF file should be migrated.
      file - A CMF file containing properties and types to be migrated.
      stewardKey - [REQUEST BODY PARAMETER] A steward identifier. Defaults to the NIEM steward identifier to migrate a NIEM subset.
      modelKey - [REQUEST BODY PARAMETER] A model identifier for the CMF file. Defaults to the NIEM data model to migrate a NIEM subset.
      Returns:
      Zip file with updated CMF file and a JSON file with issues encountered during the migration.
      Throws:
      Exception