With Copilot
Acquia Copilot is a conversational AI connected into our product documentation and knowledge base. Ask Copilot about product features, technical details, troubleshooting and how to get started with Acquia products.
Sign in to use Acquia Copilot
When you execute Acquia CLI commands invoking a Cloud Platform API endpoint, the endpoint returns a machine-readable JSON response.
Acquia recommends you to use the following open source tools to navigate the JSON response:
Use the limit filter in jq to return a subset of the results:
$ acli api:applications:notification-list myapp | jq '[limit(3;.[] | {event, completed_at})]'
[
{
"event": "DatabaseBackupDownloaded",
"completed_at": "2021-02-24T16:13:37+00:00"
},
{
"event": "RemoteIdeCreatedEvent",
"completed_at": "2021-02-24T13:22:03+00:00"
},
{
"event": "DatabaseBackupDownloaded",
"completed_at": "2021-02-23T18:23:29+00:00"
}
]Pass the following select query to search for a partial match in the JSON output:
$ acli api:applications:list | jq '.[] | select(.hosting.id | contains ("thomas"))'The query returns the following output, where <version> refers to the version of your Drupal application:
{
"id": 111241,
"uuid": "da76k877-fc7f-bcf4-2523-c801f469b9dc",
"name": "thomas",
"hosting": {
"type": "ace",
"id": "prod:thomas"
},
"subscription": {
"uuid": "1054c7fc-8954-4e52-b132-a4f5bc3a7d16",
"name": "Thomas - Sandbox"
},
"organization": {
"uuid": "d29ej812-7c03-11e4-b588-22000b04072f",
"name": "My Drupal <version> Application"
},
"flags": {
"remote_admin": false
},
"status": "normal",
"type": "drupal",
"platform": null,
"_links": {
"self": {
"href": "https://cloud.acquia.com/api/applications/da76k877-fc7f-bcf4-2523-c801f469b9dc"
},
"parent": {
"href": "https://cloud.acquia.com/api/applications"
}
},
"_embedded": {
"tags": []
}
}Use jq to filter out the JSON response:
$ acli api:applications:environment-list myapp | jq '.[].name'
"dev"
"prod"
"test"
"ra"
"ama"Use jid to scan through the JSON response until you find the desired result:
Drilling the JSON response
Use the following jtbl to improve the readability of the JSON response. If your output is not complex, pipe it to jtbl to view a formatted table:
$ acli api:distributions:list | jq -c '.[] | {title,version}' | jtblThe command returns the following output, where <major-version> refers to the current major version of your Drupal application, and <specific-version> refers to the specific version of your Drupal application.
title version
--------------------------------- ----------
Drupal <major-version> <specific-version>
Acquia Connector 8.x-1.9
Apigee Developer Portal Kickstart 8.x-1.7
Commerce Kickstart 7.x-2.62
DKAN 7.x-1.15.4
govCMS 7.x-3.6
Open Atrium 7.x-2.69
OpenPublic 7.x-1.9
Thunder 8.x-2.9
Web Experience Toolkit 7.x-4.9After you initiate the process of creating a database backup through Acquia CLI, the system takes some time to complete the process. You cannot deploy your code or perform other tasks until the process is completed. To wait until the system creates the backup, use the app:task-wait command:
acli app:task-wait "$(acli api:environments:database-backup-create myapp.dev my_db)"If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.