function acquia_contenthub_drush_command in Acquia Content Hub 8
Implements hook_drush_command().
File
- ./
acquia_contenthub.drush.inc, line 17 - ContentHub Drush Commands.
Code
function acquia_contenthub_drush_command() {
$items['acquia-contenthub-local'] = [
'description' => 'Prints the CDF from a local source (drupal site)',
'arguments' => [
'entity-type' => 'Entity type',
'entity-id' => 'Entity identifier or entity\'s UUID',
],
'outputformat' => [
'default' => 'json',
'pipe-format' => 'config',
'variable-name' => 'variables',
'table-metadata' => [
'format' => 'var_export',
],
'require-engine-capability' => [
'format-list',
],
],
'required-arguments' => 2,
'aliases' => [
'ach-lo',
],
];
$items['acquia-contenthub-remote'] = [
'description' => 'Prints the CDF from a remote source (Content Hub)',
'arguments' => [
'uuid' => 'Entity\'s UUID',
],
'required-arguments' => 1,
'outputformat' => [
'default' => 'json',
'pipe-format' => 'config',
'variable-name' => 'variables',
'table-metadata' => [
'format' => 'var_export',
],
'require-engine-capability' => [
'format-list',
],
],
'aliases' => [
'ach-re',
],
];
$items['acquia-contenthub-compare'] = [
'description' => 'Loads the CDF from a local and remote source, compares them and prints the differences.',
'arguments' => [
'entity-type' => 'Entity type',
'uuid' => 'Entity\'s UUID',
],
'required-arguments' => 2,
'aliases' => [
'ach-comp',
],
];
$items['acquia-contenthub-list'] = [
'description' => 'List entities from the Content Hub using the listEntities() method.',
'options' => [
'limit' => [
'description' => 'The number of entities to be listed',
'example_value' => '5',
],
'start' => [
'description' => 'The offset to start listing the entities (Useful for pagination).',
'example_value' => '5',
],
'origin' => [
'description' => 'The Client\'s Origin UUID.',
'example_value' => '00000000-0000-0000-0000-000000000000',
],
'language' => [
'description' => 'The Language that will be used to filter field values.',
'example_value' => 'en',
],
'attributes' => [
'description' => 'The attributes to display for all listed entities',
'example_value' => 'status,title',
],
'type' => [
'description' => 'The entity type',
'example-value' => 'node',
],
'filters' => [
'description' => 'Filters entities according to a set of of conditions as a key=value pair separated by commas. You could use regex too.',
'example_value' => 'title=New*,status=1',
],
],
'outputformat' => [
'default' => 'json',
'pipe-format' => 'config',
'variable-name' => 'variables',
'table-metadata' => [
'format' => 'var_export',
],
'require-engine-capability' => [
'format-list',
],
],
'aliases' => [
'ach-list',
],
];
$items['acquia-contenthub-delete'] = [
'description' => 'Deletes a single entity from the Content Hub',
'arguments' => [
'uuid' => 'Entity\'s UUID',
],
'required-arguments' => 1,
'aliases' => [
'ach-del',
],
];
$items['acquia-contenthub-purge'] = [
'description' => 'Purges all entities from Acquia Content Hub. WARNING! Be VERY careful when using this command. This destructive command requires elevated keys. Every subsequent execution of this command will override the backup created by the previous call.',
'aliases' => [
'ach-purge',
],
'arguments' => [
'api' => 'API Key',
'secret' => 'Secret Key',
],
];
$items['acquia-contenthub-restore'] = [
'description' => 'Restores the backup taken by a previous execution of the "purge" command. WARNING! Be VERY careful when using this command. This destructive command requires elevated keys. By restoring a backup you will delete all the existing entities in your subscription.',
'aliases' => [
'ach-restore',
],
'arguments' => [
'api' => 'API Key',
'secret' => 'Secret Key',
],
];
$items['acquia-contenthub-reindex'] = [
'description' => 'Reindexes all entities in Content Hub',
'aliases' => [
'ach-reindex',
],
'arguments' => [
'api' => 'API Key',
'secret' => 'Secret Key',
],
];
$items['acquia-contenthub-mapping'] = [
'description' => 'Shows Elastic Search field mappings from Content Hub',
'aliases' => [
'ach-mapping',
],
'outputformat' => [
'default' => 'json',
'pipe-format' => 'config',
'variable-name' => 'variables',
'table-metadata' => [
'format' => 'var_export',
],
'require-engine-capability' => [
'format-list',
],
],
];
$items['acquia-contenthub-regenerate-secret'] = [
'description' => 'Regenerates the Shared Secret used for Webhook Verification',
'aliases' => [
'ach-regsec',
],
];
$items['acquia-contenthub-update-secret'] = [
'description' => dt('Updates the Shared Secret used for Webhook Verification'),
'aliases' => [
'ach-upsec',
],
];
$items['acquia-contenthub-connect-site'] = [
'description' => "Connects a site with contenthub.",
'aliases' => [
'ach-connect',
],
'bootstrap' => DRUSH_BOOTSTRAP_MAX,
];
$items['acquia-contenthub-disconnect-site'] = [
'description' => 'Disconnects a site with contenthub.',
'aliases' => [
'ach-disconnect',
],
'bootstrap' => DRUSH_BOOTSTRAP_MAX,
];
$items['acquia-contenthub-webhooks'] = [
'description' => dt("Perform a webhook management operation."),
'aliases' => [
'ach-wh',
],
'bootstrap' => DRUSH_BOOTSTRAP_MAX,
'required-arguments' => 1,
'arguments' => [
'op' => dt('The operation to use. Options are: register, unregister, list.'),
],
'options' => [
'webhook_url' => dt('The webhook URL to register or unregister.'),
],
];
$items['acquia-contenthub-reset-entities'] = [
'description' => dt("Deletes all entities of a particular type from Content Hub, reindex subscription and exports all deleted entities again to allow for Elasticsearch to map correct field types."),
'aliases' => [
'ach-reset',
],
'bootstrap' => DRUSH_BOOTSTRAP_MAX,
'required-arguments' => 1,
'arguments' => [
'entity_type' => dt('The entity type.'),
'api' => 'API Key',
'secret' => 'Secret Key',
],
'options' => [
'bundle' => dt('The entity bundle to reset (optional). All bundles of this entity type will be reset if not specified.'),
],
];
$items['acquia-contenthub-audit-publisher'] = [
'description' => dt('Checks published entities and compares them with what currently exist in Content Hub to assure consistency.'),
'arguments' => [
'entity-type' => dt('Entity type'),
],
'options' => [
'publish' => dt('Republish inconsistent entities to Content Hub.'),
'status' => dt('The export status of the entities to audit, defaults to EXPORTED if not given. Possible values: EXPORTED, INITIATED, REINDEX, QUEUED.'),
],
'required-arguments' => 0,
'aliases' => [
'ach-audit-publisher',
'ach-ap',
],
];
$items['acquia-contenthub-watchdog-queue-sizes'] = [
'description' => dt("Log the size of the export and import queues to Drupal watchdog."),
'bootstrap' => DRUSH_BOOTSTRAP_MAX,
];
return $items;
}