a method to export all the records in collection to another platform
            
        :param storage_client: class object with storage client methods
        :return: string with exit message
14795
def export(self, storage_client, overwrite=True):
        
        '''
            
        '''
        
        title = '%s.export' % self.__class__.__name__
        
    # validate storage client
        method_list = [ 'save', 'load', 'list', 'export', 'delete', 'remove', '_import', 'collection_name' ]
        for method in method_list:
            if not getattr(storage_client, method, None):
                from labpack.parsing.grammar import join_words
                raise ValueError('%s(storage_client=...) must be a client object with %s methods.' % (title, join_words(method_list)))
            
    # walk collection folder to find files
        import os
        count = 0
        skipped = 0
        for file_path, file_id in self._walk():
            path_segments = file_path.split(os.sep)
            record_key = os.path.join(*path_segments)
            record_key = record_key.replace('\\','/')
            
    # retrieve data and metadata
            try:
                record_data = self.drive.get_media(fileId=file_id).execute()
            except:
                raise DriveConnectionError(title)
            try:
                file = self.drive.get(fileId=file_id, fields='modifiedTime').execute()
                client_modified = file.get('modifiedTime', '')
            except:
                raise DriveConnectionError(title)
            
    # import record into storage client
            last_modified = 0.0
            if client_modified:
                from labpack.records.time import labDT
                last_modified = labDT.fromISO(client_modified).epoch()
            outcome = storage_client._import(record_key, record_data, overwrite=overwrite, last_modified=last_modified)
            if outcome:
                count += 1
            else:
                skipped += 1
            
    # report outcome
        plural = ''
        skip_insert = ''
        new_folder = storage_client.collection_name
        if count != 1:
            plural = 's'
        if skipped > 0:
            skip_plural = ''
            if skipped > 1:
                skip_plural = 's'
            skip_insert = ' %s record%s skipped to avoid overwrite.' % (str(skipped), skip_plural)
        exit_msg = '%s record%s exported to %s.%s' % (str(count), plural, new_folder, skip_insert)
        return exit_msg
738483
def export_aggregate_by_csv(ekey, dstore):
    
    token, what = ekey[0].split('/', 1)
    aw = extract(dstore, 'aggregate/' + what)
    fnames = []
    writer = writers.CsvWriter(fmt=writers.FIVEDIGITS)
    path = '%s.%s' % (sanitize(ekey[0]), ekey[1])
    fname = dstore.export_path(path)
    writer.save(aw.to_table(), fname)
    fnames.append(fname)
    return fnames
961531
def to_export(export):
        
        from sevenbridges.models.storage_export import Export
        if not export:
            raise SbgError('Export is required!')
        elif isinstance(export, Export):
            return export.id
        elif isinstance(export, six.string_types):
            return export
        else:
            raise SbgError('Invalid export parameter!')
846036
function exportArchiveToFilesystem (opts, cb) {
  return maybe(cb, async function () {
    assert(opts && typeof opts === 'object', 'opts object is required')

    // core arguments, dstPath and srcArchive
    var srcArchive = opts.srcArchive
    var dstPath = opts.dstPath
    assert(srcArchive && typeof srcArchive === 'object', 'srcArchive is required')
    assert(dstPath && typeof dstPath === 'string', 'dstPath is required')

    // options
    var srcPath = typeof opts.srcPath === 'string' ? opts.srcPath : '/'
    var overwriteExisting = opts.overwriteExisting === true
    var skipUndownloadedFiles = opts.skipUndownloadedFiles === true
    var ignore = Array.isArray(opts.ignore) ? opts.ignore : DEFAULT_IGNORE

    // abort if nonempty and not overwriting existing
    if (!overwriteExisting) {
      let files
      try {
        files = await fse.readdir(dstPath)
      } catch (e) {
        // target probably doesnt exist, continue and let ensureDirectory handle it
      }
      if (files && files.length > 0) {
        throw new DestDirectoryNotEmpty()
      }
    }

    const statThenExport = async function (srcPath, dstPath) {
      // apply ignore filter
      if (ignore && match(ignore, srcPath)) {
        return
      }

      // export by type
      var srcStat = await stat(srcArchive, srcPath)
      if (srcStat.isFile()) {
        await exportFile(srcPath, srcStat, dstPath)
      } else if (srcStat.isDirectory()) {
        await exportDirectory(srcPath, dstPath)
      }
    }

    const exportFile = async function (srcPath, srcStat, dstPath) {
      // skip undownloaded files
      if (skipUndownloadedFiles && srcStat.downloaded < srcStat.blocks) {
        return
      }

      // fetch dest stats
      var dstFileStats = null
      try {
        dstFileStats = await fse.stat(dstPath)
      } catch (e) {}

      // track the stats
      stats.fileCount++
      stats.totalSize += srcStat.size || 0
      if (dstFileStats) {
        if (dstFileStats.isDirectory()) {
          // delete the directory-tree
          await fse.remove(dstPath)
          stats.addedFiles.push(dstPath)
        } else {
          stats.updatedFiles.push(dstPath)
        }
      } else {
        stats.addedFiles.push(dstPath)
      }

      // write the file
      return new Promise((resolve, reject) => {
        pump(
          srcArchive.createReadStream(srcPath),
          fse.createWriteStream(dstPath),
          err => {
            if (err) reject(err)
            else resolve()
          }
        )
      })
    }

    const exportDirectory = async function (srcPath, dstPath) {
      // make sure the destination folder exists
      await fse.ensureDir(dstPath)

      // list the directory
      var fileNames = await readdir(srcArchive, srcPath)

      // recurse into each
      var promises = fileNames.map(name => {
        return statThenExport(path.join(srcPath, name), path.join(dstPath, name))
      })
      await Promise.all(promises)
    }

    // recursively export
    var stats = { addedFiles: [], updatedFiles: [], skipCount: 0, fileCount: 0, totalSize: 0 }
    await statThenExport(srcPath, dstPath)
    return stats
  })
}
937588
def _add_to_transfer_queue(self, src_ase, dst_ase):
        # type: (SyncCopy, blobxfer.models.azure.StorageEntity,
        #        blobxfer.models.azure.StorageEntity) -> None
        
        # prepare remote file for download
        # if remote file is a block blob, need to retrieve block list
        if (src_ase.mode == dst_ase.mode ==
                blobxfer.models.azure.StorageModes.Block):
            bl = blobxfer.operations.azure.blob.block.get_committed_block_list(
                src_ase)
        else:
            bl = None
        # TODO future optimization for page blob synccopies: query
        # page ranges and omit cleared pages from being transferred
        sd = blobxfer.models.synccopy.Descriptor(
            src_ase, dst_ase, bl, self._spec.options, self._resume)
        # add download descriptor to queue
        self._transfer_queue.put(sd)
        if self._synccopy_start_time is None:
            with self._transfer_lock:
                if self._synccopy_start_time is None:
                    self._synccopy_start_time = blobxfer.util.datetime_now()
676032
def write_client(captures, options):
    
    with open("{}/_client.py".format(options.output_dir), "w") as f:
        f.write(HEADER)
        f.write("from juju.client._definitions import *\n\n")
        clients = ", ".join("_client{}".format(v) for v in captures)
        f.write("from juju.client import " + clients + "\n\n")
        f.write(CLIENT_TABLE.format(clients=",\n    ".join(
            ['"{}": _client{}'.format(v, v) for v in captures])))
        f.write(LOOKUP_FACADE)
        f.write(TYPE_FACTORY)
        for key in sorted([k for k in factories.keys() if "Facade" in k]):
            print(factories[key], file=f)
974490
def bulk_submit(cls, exports, copy_only=False, api=None):
        
        if not exports:
            raise SbgError('Exports are required')

        api = api or cls._API

        items = []
        for export in exports:
            file_ = Transform.to_file(export.get('file'))
            volume = Transform.to_volume(export.get('volume'))
            location = Transform.to_location(export.get('location'))
            properties = export.get('properties', {})
            overwrite = export.get('overwrite', False)

            item = {
                'source': {
                    'file': file_
                },
                'destination': {
                    'volume': volume,
                    'location': location
                },
                'properties': properties,
                'overwrite': overwrite
            }

            items.append(item)

        data = {'items': items}
        params = {'copy_only': copy_only}

        response = api.post(
            url=cls._URL['bulk_create'], params=params, data=data
        )
        return ExportBulkRecord.parse_records(response=response, api=api)
613771
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return ExportInstance(self._version, payload, resource_type=self._solution['resource_type'], )
1272233
public static base_responses export(nitro_service client, sslfipskey resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			sslfipskey exportresources[] = new sslfipskey[resources.length];
			for (int i=0;i<resources.length;i++){
				exportresources[i] = new sslfipskey();
				exportresources[i].fipskeyname = resources[i].fipskeyname;
				exportresources[i].key = resources[i].key;
			}
			result = perform_operation_bulk_request(client, exportresources,"export");
		}
		return result;
	}
394395
def _export_service(self, svc, ed):
        # type: (Any, EndpointDescription) -> None
        
        self._add_export(ed.get_id(), (svc, ed))
896698
public static base_response export(nitro_service client, application resource) throws Exception {
		application exportresource = new application();
		exportresource.appname = resource.appname;
		exportresource.apptemplatefilename = resource.apptemplatefilename;
		exportresource.deploymentfilename = resource.deploymentfilename;
		return exportresource.perform_operation(client,"export");
	}
1085363
public void exportDataSetCSV(final DataSetLookup request,
                                 final DataSetExportReadyCallback listener) throws Exception {

        if (dataSetLookupServices != null) {
            // Look always into the client data set manager.
            if (clientDataSetManager.getDataSet(request.getDataSetUUID()) != null) {
                DataSet dataSet = clientDataSetManager.lookupDataSet(request);
                dataSetExportServices.call(
                        new RemoteCallback<Path>() {
                            public void callback(Path csvFilePath) {
                                listener.exportReady(csvFilePath);
                            }
                        }
                        ,
                        new ErrorCallback<Message>() {
                            public boolean error(Message message,
                                                 Throwable throwable) {
                                listener.onError(new ClientRuntimeError(throwable));
                                return true;
                            }
                        }).exportDataSetCSV(dataSet);
            }
            // Data set not found on client.
            else {
                // If the data set is not in client, then look up remotely (only if the remote access is available).
                try {
                    dataSetExportServices.call(
                            new RemoteCallback<Path>() {
                                public void callback(Path csvFilePath) {
                                    listener.exportReady(csvFilePath);
                                }
                            }
                            ,
                            new ErrorCallback<Message>() {
                                public boolean error(Message message,
                                                     Throwable throwable) {
                                    listener.onError(new ClientRuntimeError(throwable));
                                    return true;
                                }
                            }).exportDataSetCSV(request);
                } catch (Exception e) {
                    listener.onError(new ClientRuntimeError(e));
                }
            }
        } else {
            listener.onError(new ClientRuntimeError(CommonConstants.INSTANCE.exc_no_client_side_data_export()));
        }
    }
1048357
public void export() {
        logger.info("----------------------------"); //$NON-NLS-1$
        logger.info(Messages.i18n.format("StorageExporter.StartingExport")); //$NON-NLS-1$
        try {
            storage.beginTx();
            try {
                exportMetadata();
                exportUsers();
                exportGateways();
                exportPlugins();
                exportRoles();
                exportPolicyDefs();

                exportOrgs();
            } finally {
                storage.rollbackTx();
                try { writer.close(); } catch (Exception e) { }
            }
            logger.info(Messages.i18n.format("StorageExporter.ExportComplete")); //$NON-NLS-1$
            logger.info("------------------------------------------"); //$NON-NLS-1$
        } catch (StorageException e) {
            throw new RuntimeException(e);
        }
    }
251392
def list_blobs(storage_conn=None, **kwargs):
    '''
    
    '''
    if not storage_conn:
        storage_conn = get_storage_conn(opts=kwargs)

    if 'container' not in kwargs:
        raise SaltSystemExit(
            code=42,
            msg='An storage container name must be specified as "container"'
        )

    data = storage_conn.list_blobs(
        container_name=kwargs['container'],
        prefix=kwargs.get('prefix', None),
        marker=kwargs.get('marker', None),
        maxresults=kwargs.get('maxresults', None),
        include=kwargs.get('include', None),
        delimiter=kwargs.get('delimiter', None),
    )

    ret = {}
    for item in data.blobs:
        ret[item.name] = object_to_dict(item)
    return ret
139316
public static base_response export(nitro_service client, sslfipskey resource) throws Exception {
		sslfipskey exportresource = new sslfipskey();
		exportresource.fipskeyname = resource.fipskeyname;
		exportresource.key = resource.key;
		return exportresource.perform_operation(client,"export");
	}
29312
def list_storage(kwargs=None, conn=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_storage function must be called with -f or --function.'
        )

    if not conn:
        conn = get_conn()

    data = conn.list_storage_accounts()
    pprint.pprint(dir(data))
    ret = {}
    for item in data.storage_services:
        ret[item.service_name] = object_to_dict(item)
    return ret
299135
def _create_clients(self, timeout, proxy):
        # type: (StorageAccount, blobxfer.models.options.Timeout,
        #        blobxfer.models.options.HttpProxy) -> None
        
        self._append_blob_client = \
            blobxfer.operations.azure.blob.append.create_client(
                self, timeout, proxy)
        self._block_blob_client = \
            blobxfer.operations.azure.blob.block.create_client(
                self, timeout, proxy)
        self._file_client = blobxfer.operations.azure.file.create_client(
            self, timeout, proxy)
        self._page_blob_client = \
            blobxfer.operations.azure.blob.page.create_client(
                self, timeout, proxy)