def list_exists_assets()

in gettingstarted/resourceManager.py [0:0]


    def list_exists_assets(self):
        nextTokenValue = ""
        while True:
            if not nextTokenValue:
                response = iotsitewise.list_assets(maxResults=100, assetModelId=self.sitewise_asset_model_id_hub)
            else:
                response = iotsitewise.list_asset_models(maxResults=100, nextToken=nextTokenValue, assetModelId=self.sitewise_asset_model_id_hub)
            for hubAsset in response.get("assetSummaries"):
                self.existsHubAssets.append(hubAsset.get('name'))
            nextTokenValue = response.get("nextToken")
            if not nextTokenValue:
                break

        while True:
            if not nextTokenValue:
                response = iotsitewise.list_assets(maxResults=100, assetModelId=self.sitewise_asset_model_id_camera)
            else:
                response = iotsitewise.list_asset_models(maxResults=100, nextToken=nextTokenValue, assetModelId=self.sitewise_asset_model_id_camera)
            for cameraAsset in response.get("assetSummaries"):
                self.existsCameraAssets.append(cameraAsset.get('name'))
                self.existingCameraAssetNameAndIdMap[cameraAsset.get('name')] = cameraAsset.get('id')
            nextTokenValue = response.get("nextToken")
            if not nextTokenValue:
                break