The following are examples of other operations that you can perform with Acquia CLI:
Creating a new application with Acquia CLI
To create a new Drupal application with the acli new command:
Open Terminal on your local machine.
Run the acli new command.
The system prompts you to choose a project template.
See the following example:
$ acli new
Acquia recommends most customers use acquia/drupal-recommended-project,
which includes useful utilities such as Acquia Connector.
acquia/drupal-minimal-project is the most minimal application that will
run on Cloud Platform.
Which starting project would you like to use?
[0] acquia/drupal-recommended-project
[1] acquia/drupal-minimal-project
> 1
Creating project. This may take a few minutes
Creating a "acquia/drupal-minimal-project" project at "./drupal"
...
New 💧Drupal project created in /tmp/drupal. 🎉
Hooking into Acquia CLI commands
To define a script that runs before, or after any Acquia CLI command, add the script to the root composer.json file. Ensure that you follow the naming pattern (pre|post)-acli-(command name with dashes). For example, pre-acli-push-db or post-acli-pull-files. The script does not run if you name it incorrectly. See the following examples:
$ curl -o xxxx.backup.sql.gz "$(acli api:environments:database-backup-download environmentId databaseName backupId | jq -r .url)"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 675k 100 675k 0 0 1442k 0 --:--:-- --:--:-- --:--:-- 1459k
The command uses jq to parse the JSON format. For more information about jq, visit Acquia CLI examples.
To download the latest database, run the following:
Deleting Custom Solr 7 Config Sets with Acquia CLI
You cannot delete config sets through the Cloud Platform interface. However, you can delete them through the Cloud API. Run the following Acquia CLI commands:
$ acli api:applications:search:configuration-set-delete -help
Description:
Removes and deletes a specific search configuration set from an application.
Usage:
api:applications:search:configuration-set-delete <applicationUuid> <configurationSetId>
api:applications:search:configuration-set-delete da1c0a8e-ff69-45db-88fc-acd6d2affbb7 ABCDE-1234.12345ab6c7e8f90g12i1jk234l56mn78
api:applications:search:configuration-set-delete myapp ABCDE-1234.12345ab6c7e8f90g12i1jk234l56mn78
Arguments:
applicationUuid The entity's universally unique identifier. You may also use an application alias or omit the argument if you run the command in a linked directory.
configurationSetId An ID that uniquely identifies a configuration set.
Options:
-h, --help Display help for the given command. When no command is given display help for the list command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
To obtain the ID of the config set that you want to delete, run the following:
If you do not have the UUID of your application, you can use the docroot of the application name or you can find the UUID with the following command:
acli api:applications:list
Checking the DNS for domains hosted on Cloud Platform using Acquia CLI
Use Acquia CLI to check where your DNS points for domains hosted on Cloud Platform. Run the following script to list each domain in your Cloud Platform environment, and then run a dig command against each domain.
1. Update Acquia CLI to the latest stable version:
acli self:update
2. Copy and paste the following script after you replace ___site___ and ___env___ with the site name and the environment for your application, for example, docroot and env.
for domain in $(acli api:environments:domain-list ___site___.___env___ | grep hostname | cut -d '"' -f 4); do
echo $domain:;
dig $domain +short
echo ""
done
Other examples
Other examples
The following are examples of other operations that you can perform with Acquia CLI:
Creating a new application with Acquia CLI
To create a new Drupal application with the acli new command:
Open Terminal on your local machine.
Run the acli new command.
The system prompts you to choose a project template.
See the following example:
$ acli new
Acquia recommends most customers use acquia/drupal-recommended-project,
which includes useful utilities such as Acquia Connector.
acquia/drupal-minimal-project is the most minimal application that will
run on Cloud Platform.
Which starting project would you like to use?
[0] acquia/drupal-recommended-project
[1] acquia/drupal-minimal-project
> 1
Creating project. This may take a few minutes
Creating a "acquia/drupal-minimal-project" project at "./drupal"
...
New 💧Drupal project created in /tmp/drupal. 🎉
Hooking into Acquia CLI commands
To define a script that runs before, or after any Acquia CLI command, add the script to the root composer.json file. Ensure that you follow the naming pattern (pre|post)-acli-(command name with dashes). For example, pre-acli-push-db or post-acli-pull-files. The script does not run if you name it incorrectly. See the following examples:
$ curl -o xxxx.backup.sql.gz "$(acli api:environments:database-backup-download environmentId databaseName backupId | jq -r .url)"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 675k 100 675k 0 0 1442k 0 --:--:-- --:--:-- --:--:-- 1459k
The command uses jq to parse the JSON format. For more information about jq, visit Acquia CLI examples.
To download the latest database, run the following:
Deleting Custom Solr 7 Config Sets with Acquia CLI
You cannot delete config sets through the Cloud Platform interface. However, you can delete them through the Cloud API. Run the following Acquia CLI commands:
$ acli api:applications:search:configuration-set-delete -help
Description:
Removes and deletes a specific search configuration set from an application.
Usage:
api:applications:search:configuration-set-delete <applicationUuid> <configurationSetId>
api:applications:search:configuration-set-delete da1c0a8e-ff69-45db-88fc-acd6d2affbb7 ABCDE-1234.12345ab6c7e8f90g12i1jk234l56mn78
api:applications:search:configuration-set-delete myapp ABCDE-1234.12345ab6c7e8f90g12i1jk234l56mn78
Arguments:
applicationUuid The entity's universally unique identifier. You may also use an application alias or omit the argument if you run the command in a linked directory.
configurationSetId An ID that uniquely identifies a configuration set.
Options:
-h, --help Display help for the given command. When no command is given display help for the list command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
To obtain the ID of the config set that you want to delete, run the following:
If you do not have the UUID of your application, you can use the docroot of the application name or you can find the UUID with the following command:
acli api:applications:list
Checking the DNS for domains hosted on Cloud Platform using Acquia CLI
Use Acquia CLI to check where your DNS points for domains hosted on Cloud Platform. Run the following script to list each domain in your Cloud Platform environment, and then run a dig command against each domain.
1. Update Acquia CLI to the latest stable version:
acli self:update
2. Copy and paste the following script after you replace ___site___ and ___env___ with the site name and the environment for your application, for example, docroot and env.
for domain in $(acli api:environments:domain-list ___site___.___env___ | grep hostname | cut -d '"' -f 4); do
echo $domain:;
dig $domain +short
echo ""
done
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.