Running a bulk import job - Amazon IoT SiteWise
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Running a bulk import job

Bulk import is the action of moving metadata into an Amazon IoT SiteWise workspace. For example, bulk import can move metadata from a local file, or a file in an Amazon S3 bucket, to an Amazon IoT SiteWise workspace.

Step 1: Prepare the file to import

Download the Amazon IoT SiteWise native format file to import assets and the asset models. See Amazon IoT SiteWise metadata transfer job schema for more details.

Step 2: Upload the prepared file to Amazon S3

Upload the file to Amazon S3. See Uploading a file to Amazon S3 in the Amazon Simple Storage Service User Guide for details.

Import metadata (console)

You can use the Amazon IoT SiteWise console to bulk import metadata. Follow Step 1: Prepare the file to import and Step 2: Upload the prepared file to Amazon S3 to prepare a file that is ready to be imported.

Import data from Amazon S3 to Amazon IoT SiteWise console
  1. Navigate to the Amazon IoT SiteWise console.

  2. Choose Bulk operations New from the navigation pane.

  3. Choose New import to start the import process.

  4. On the Import metadata page:

    • Choose Browse Amazon S3 to view the Amazon S3 bucket and files.

    • Navigate to the Amazon S3 bucket that contains the prepared import file.

    • Select the file to import.

    • Review the selected file, and choose Import.

  5. The Bulk operations on SiteWise metadata page of the Amazon IoT SiteWise console displays the newly created import job in the Jobs progress table.

Import metadata (Amazon CLI)

To perform an import action, use the following procedure:

Import data from Amazon S3 to Amazon CLI
  1. Create a metadata file that specifies the resources you want to import, following the Amazon IoT SiteWise metadata transfer job schema. Store this file in your Amazon S3 bucket.

    For examples of metadata files to import, see Import metadata examples.

  2. Now create a JSON file with the request body. The request body specifies the source and destination for the transfer job. This file is separate from the file from the previous step. Make sure to specify your Amazon S3 bucket as a source and iotsitewise as the destination.

    The following example shows the request body:

    { "metadataTransferJobId": "your-transfer-job-Id", "sources": [{ "type": "s3", "s3Configuration": { "location": "arn:aws-cn:s3:::your-S3-bucket-name/your_import_metadata.json" } }], "destination": { "type": "iotsitewise" } }
  3. Invoke the CreateMetadataTransferJob by running the following Amazon CLI command. In this example, the request body file from the previous step is named createMetadataTransferJobExport.json.

    aws iottwinmaker create-metadata-transfer-job --region us-east-1 \ --cli-input-json file://createMetadataTransferJobImport.json

    This will create a metadata transfer job, and begin the process of the transferring your selected resources.