Drush commands =============== dkan:dataset-info ----------------- View information about a dataset. **Arguments** - **uuid** The uuid of a dataset. ~~~~~~ dkan:datastore:reverse-dataset-lookup ------------------------------------- Takes an argument of the table name and returns the dataset uuid. **Arguments** - **table_name** The datastore table name in the database. **Usage** ``drush dkan:datastore:reverse-dataset-lookup datastore_abcdefghijklmnop`` ~~~~~~ dkan:datastore:drop ------------------- Drop a datastore. **Arguments** - **identifier** The uuid of a dataset. **Options** - **--keep-local** Do not remove localized resource, only drop the datastore table. ~~~~~~ dkan:datastore:drop-all ----------------------- Drop a ALL datastore tables. ~~~~~~ dkan:datastore:import --------------------- You can manually import file data into the datastore with the identifier of the distribution. There are two main ways to get the distribution uuid: 1. Use the `API `_ to get the identifier of the file you want to import. The identifier will be at ``distribution.0.data.%Ref:downloadURL.0.data.identifier`` 2. Use ``dkan:dataset-info`` **Arguments** - **identifier** The resource identifier; usually an MD5 hash of the resource URI. **Options** - **--deferred** Whether or not the process should be deferred to a queue. ~~~~~~ dkan:datastore:localize ----------------------- You can manually 'localize' the source files for a distribution, by fetching a copy to the local file system. There are two main ways to get the distribution uuid: 1. Use the `API `_ to get the identifier of the file you want to import. The identifier will be at ``distribution.0.data.%Ref:downloadURL.0.data.identifier`` 2. Use ``dkan:dataset-info`` **Arguments** - **identifier** The resource identifier; usually an MD5 hash of the resource URI. **Options** - **--deferred** Whether or not the process should be deferred to a queue. ~~~~~~ dkan:datastore:list -------------------- List information about all datastores. **Options** - **format** The format of the data. (default: **table**) - **status** Show imports of the given status. - **uuid-only** Only the list of uuids. ~~~~~~ dkan:datastore:prepare-localized -------------------------------- Prepare the local perspective for a resource. Will do the following: - Prepare the directory in the file system. - Add the local_url perspective to the resource mapper. Note this is missing the file checksum. - Display the info necessary to perform an external file fetch. **Arguments** - **identifier** Datastore resource identifier, e.g., "b210fb966b5f68be0421b928631e5d51". ~~~~~~ dkan:datastore:reimport -------------------------------- Re-import data into the datastore for every distribution in a dataset. **Arguments** - **uuid** The uuid of a dataset. ~~~~~~ dkan:datastore:degraded-mode ---------------------------- Turn degraded service mode on or off for the datastore. Blocks requests to the datastore API that contain conditions, joins, groupings, sorts, and offsets. **Arguments** - **state** The state of the degraded mode (1 to turn on, 0 to turn off, leave blank to see current state). ~~~~~~ dkan:harvest:archive --------------------- Archives (unpublish) harvested entities. **Arguments** - **harvestId** The id of the harvest source. ~~~~~~ dkan:harvest:deregister ----------------------- Deregister a harvest plan. This action removes the harvest plan from the system, but will leave the datasets in place. This is good if you are using harvest to migrate content and you do not plan on using the harvest feature to update the datasets. If you want to remove the harvest plan AND the datasets associated with it, use the --revert option. **Arguments** - **harvestId** The harvest id - **revert** Perform a revert before deregistering. **Usage** ``drush dkan:harvest:deregister --revert myHarvestId`` ~~~~~~ dkan:harvest:info ----------------- Give information about a previous harvest run. **Arguments** - **harvestId** The harvest id. - **runId** The run's id. ~~~~~~ dkan:harvest:list ----------------- List available harvests. ~~~~~~ dkan:harvest:publish -------------------- Publishes harvested entities. **Arguments** - **harvestId**. The id of the harvest source. ~~~~~~ dkan:harvest:register --------------------- Register a new harvest. **Arguments** - Harvest plan configuration as a JSON string. Wrap in single quotes, do not add spaces between elements. **Options** - **identifier** The harvest id. - **extract-type** Extract type. - **extract-uri** Extract URI. - **transform** A transform class to apply. You may pass multiple transforms. - **load-type** Load class. **Usage** ``dkan-harvest:register '{"identifier":"myHarvestId","extract":{"type":"\\Drupal\\dkan_harvest\\ETL\\Extract\\DataJson","uri":"http://example.com/data.json"},"transforms":[],"load":{"type":"\\Drupal\\dkan_harvest\\Load\\Dataset"}}'`` Or ``dkan:harvest:register --identifier=myHarvestId --extract-uri=http://example.com/data.json`` ~~~~~~ dkan:harvest:revert -------------------- Revert a harvest. Removes harvested entities and unpublishes orphaned keywords, themes, and distributions. The harvest plan will remain and can be run again to generate the datasets after any issues have been resolved. **Arguments** - **harvestId** The source to revert. **Usage** ``drush dkan:harvest:revert myHarvestId`` ~~~~~~ dkan:harvest:run-all -------------------- Run all harvests. Optionally, only run harvests which haven't been run before. **Options** - **new** Only run harvests which have not been run before. **Usage** ``drush dkan:harvest:run-all --new`` ~~~~~~ dkan:harvest:run ---------------- Run a harvest. **Arguments** - **harvestId** The harvest id. ~~~~~~ dkan:harvest:status ------------------- Show status of of a particular harvest run. **Arguments** - **harvestId** The id of the harvest source. - **runId** The run's id. Optional. Show the status for the latest run if not provided. **Usage** ``drush dkan:harvest:status myHarvestId 1599157120`` ~~~~~~ dkan:metadata-form:sync ----------------------- Synchronize the module with the React app. ~~~~~~ dkan:metastore-search:rebuild-tracker ------------------------------------- Rebuild the search api tracker for the dkan index. ~~~~~~ dkan:metastore:publish ---------------------- Publish the latest version of a dataset. **Arguments** - **uuid** Dataset identifier. ~~~~~~ dkan:sample-content:create -------------------------- Create sample content.