Site
The Cursion CLI has 4 commands to work with the Site
object:
Command | Description |
---|---|
add-site | create a site |
crawl-site | crawl a site |
get-sites | get one or more sites |
delete-site | delete a site |
Tips
For information about the Site
object, please see Site Overview.
Create a Site
add-site
This command will add a new Site
to your Cursion Account. Once created, a "crawl" will be initiated, as well as the creation of any crawled Pages
and initial Scans
of those Pages
.
The full command to create a Site
is the following:
cursion add-site https://example.com
View Full Output
✔ Success
{
'id': '25a65a51-85cf-43e5-8add-3be45a47246f',
'user': 'jane@example.com',
'site_url': 'https://example.com',
'time_created': '2024-02-28T17:24:16.923694Z',
'info':{
'latest_scan': {'id': None, 'time_created': None, 'time_completed': None},
'latest_test': {'id': None, 'time_created': None, 'time_completed': None, 'score': None},
'status': {'health': None, 'badge': 'neutral', 'score': None}
},
'tags': None,
'account': 'a2eeccc6-e6ae-4db8-8c75-3304a80d63be',
'time_crawl_started': None,
'time_crawl_completed': None
}
Crawl a Site
crawl-site
This command will initate a new "crawl" of the Site
, as well as the creation of any crawled Pages
and initial Scans
of those Pages
.
The full command to crawl a Site
is the following:
cursion crawl-site <site-id>
View Full Output
✔ Success
{
'id': '135d2f34-9edf-439a-bfc5-5b47b625f2c8',
'user': 'jane@example.com',
'site_url': 'https://example.com',
'time_created': '2024-02-20T23:51:23.672907Z',
'info':{
'status': {'badge': 'warning', 'score': 67.5, 'health': 'Okay'},
'latest_scan': {'id': 'd0ea03ae-64f4-4a90-8922-0f953a13c94a', 'time_created': '2024-02-28 00:28:04.931270+00:00', 'time_completed': 'None'},
'latest_test':{
'id': '0c62ca69-08dd-4619-8fde-28c31be6cee8',
'score': 99.17,
'time_created': '2024-02-26 22:39:59.084650+00:00',
'time_completed': '2024-02-26 22:40:00.203184'
}
},
'tags': None,
'account': 'a2eeccc6-e6ae-4db8-8c75-3304a80d63be',
'time_crawl_started': '2024-02-20T23:51:23.741118Z',
'time_crawl_completed': None
}
Retrieve Sites
get-sites
This command will retrieve one or more Sites
from your account.
The full command to retrieve a Site
is the following:
cursion get-sites --site-id=<site-id>
View Full Output
✔ Success
{
'id': '5ec5041a-bf5f-440c-a95b-1ae43c91da7d',
'user': 'jane@example.com',
'site_url': 'https://example.com',
'time_created': '2024-02-26T19:46:51.083412Z',
'info':{
'status': {'badge': 'warning', 'score': 68.0, 'health': 'Okay'},
'latest_scan':{
'id': 'b4bfdeb9-b5fc-4a0d-98ba-3d9dda88bf45',
'time_created': '2024-02-28 17:07:55.944054+00:00',
'time_completed': 'None'
},
'latest_test':{
'id': '8128e39f-77a7-48f6-a906-8b75c2e80fae',
'score': 99.98,
'time_created': '2024-02-28 01:05:59.173988+00:00',
'time_completed': '2024-02-28 01:06:02.575476'
}
},
'tags': None,
'account': 'a2eeccc6-e6ae-4db8-8c75-3304a80d63be',
'time_crawl_started': '2024-02-28T17:07:30.382674Z',
'time_crawl_completed': '2024-02-28T17:07:56.008109Z'
}
Delete a Site
delete-site
This command will delete a Site
and any associated Pages
, Scans
, Tests
, Scahedules
, Automations
, and Testcases
.
The full command to delete a Site
is the following:
Caution
Please use caution with this command as it is irreversible.
cursion delete-site <site-id>
View Full Output
✔ Success
{'message': 'Site has been deleted'}