pingera-cli 0.1.6__tar.gz → 0.1.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pingera_cli-0.1.6/pingera_cli.egg-info → pingera_cli-0.1.7}/PKG-INFO +1 -1
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/docs/example-synthetic-screenshot.json +12 -7
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/__init__.py +1 -1
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/checks.py +18 -17
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/on_demand_checks.py +10 -9
- {pingera_cli-0.1.6 → pingera_cli-0.1.7/pingera_cli.egg-info}/PKG-INFO +1 -1
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli.egg-info/SOURCES.txt +0 -1
- pingera_cli-0.1.6/docs/example-check.json +0 -23
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/.gitignore +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/.replit +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/LICENSE +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/README.md +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/assert +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/docs/cli-commands.md +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/docs/example-check.yaml +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/__main__.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/__init__.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/auth.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/base.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/check_groups.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/check_secrets.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/secrets.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/__init__.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/base_formatter.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/generic_formatter.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/multistep_formatter.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/registry.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/ssl_formatter.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/synthetic_formatter.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/web_formatter.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/main.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/utils/__init__.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/utils/config.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/utils/console.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli.egg-info/dependency_links.txt +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli.egg-info/entry_points.txt +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli.egg-info/requires.txt +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli.egg-info/top_level.txt +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pyproject.toml +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/replit.md +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/run_tests.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/setup.cfg +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/setup.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/__init__.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/conftest.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/requirements.txt +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/test_auth.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/test_checks.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/test_config.py +0 -0
- {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/test_on_demand_checks.py +0 -0
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
|
|
2
1
|
{
|
|
3
2
|
"name": "Website Screenshot Monitor",
|
|
4
|
-
"type": "synthetic",
|
|
3
|
+
"type": "synthetic",
|
|
5
4
|
"interval": 1800,
|
|
6
5
|
"timeout": 30,
|
|
7
6
|
"parameters": {
|
|
8
|
-
"regions": [
|
|
9
|
-
|
|
7
|
+
"regions": [
|
|
8
|
+
"RU, Moscow"
|
|
9
|
+
],
|
|
10
|
+
"pw_script": "const { test, expect } = require('@playwright/test');\n\ntest('website screenshot test', async ({ page }) => {\n // Navigate to the website\n await page.goto('https://pingera.ru');\n \n // Wait for the page to fully load\n await page.waitForLoadState('load');\n \n // Additional wait to ensure all dynamic content is loaded\n await page.waitForTimeout(2000);\n \n // Take a full page screenshot\n await page.screenshot({ \n path: 'website-screenshot.png', \n fullPage: true \n });\n \n // Verify the page loaded successfully\n await expect(page).toHaveTitle(/Pingera - платформа мониторинга/);\n \n // Check for key elements on the page\n await expect(page.locator('h1')).toBeVisible();\n \n console.log('Screenshot captured and page verified successfully');\n});"
|
|
10
11
|
},
|
|
11
12
|
"marketplace": {
|
|
12
|
-
"tags": [
|
|
13
|
+
"tags": [
|
|
14
|
+
"screenshot",
|
|
15
|
+
"visual-monitoring",
|
|
16
|
+
"website-monitoring"
|
|
17
|
+
],
|
|
13
18
|
"name": "Website Screenshot Monitor",
|
|
14
|
-
"description": "Captures full-page screenshots of websites and verifies page loading"
|
|
19
|
+
"description": "Captures full-page screenshots of websites and verifies page loading"
|
|
15
20
|
}
|
|
16
|
-
}
|
|
21
|
+
}
|
|
@@ -455,11 +455,9 @@ class ChecksCommand(BaseCommand):
|
|
|
455
455
|
"timeout": filtered_file_data.get("timeout", timeout)
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
# Override with command line values if provided
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
if check_type != "web": # Only override if type was explicitly provided
|
|
462
|
-
check_data["type"] = check_type
|
|
458
|
+
# Override with command line values if provided (but only if they were explicitly changed from defaults)
|
|
459
|
+
# We need to be more careful about when to override file values
|
|
460
|
+
# For now, just use file values and let user override with explicit CLI options
|
|
463
461
|
if interval != 300: # Only override if interval was explicitly provided
|
|
464
462
|
check_data["interval"] = interval
|
|
465
463
|
if timeout != 30: # Only override if timeout was explicitly provided
|
|
@@ -557,28 +555,31 @@ class ChecksCommand(BaseCommand):
|
|
|
557
555
|
if params_dict:
|
|
558
556
|
check_data["parameters"] = params_dict
|
|
559
557
|
|
|
560
|
-
# Validation based on check type
|
|
561
|
-
|
|
562
|
-
|
|
558
|
+
# Validation based on check type - use the actual type from check_data
|
|
559
|
+
actual_check_type = check_data.get("type", check_type)
|
|
560
|
+
if actual_check_type in ['web', 'api'] and not url:
|
|
561
|
+
self.display_error(f"URL is required for {actual_check_type} checks")
|
|
563
562
|
raise typer.Exit(1)
|
|
564
563
|
|
|
565
|
-
if
|
|
566
|
-
self.display_error(f"Host is required for {
|
|
564
|
+
if actual_check_type in ['tcp'] and not host:
|
|
565
|
+
self.display_error(f"Host is required for {actual_check_type} checks")
|
|
567
566
|
raise typer.Exit(1)
|
|
568
567
|
|
|
569
|
-
if
|
|
570
|
-
self.display_error(f"Either URL or host is required for {
|
|
568
|
+
if actual_check_type in ['ssl'] and not (url or host):
|
|
569
|
+
self.display_error(f"Either URL or host is required for {actual_check_type} checks")
|
|
571
570
|
raise typer.Exit(1)
|
|
572
571
|
|
|
573
|
-
if
|
|
574
|
-
self.display_error(f"Playwright script is required for {
|
|
572
|
+
if actual_check_type in ['synthetic', 'multistep'] and not params_dict.get('pw_script'):
|
|
573
|
+
self.display_error(f"Playwright script is required for {actual_check_type} checks. Use --pw-script-file or --parameters with pw_script")
|
|
575
574
|
raise typer.Exit(1)
|
|
576
575
|
|
|
577
576
|
# Use the actual SDK method
|
|
578
577
|
check = checks_api.v1_checks_post(monitor_check=check_data)
|
|
579
578
|
|
|
580
|
-
# Build success message
|
|
581
|
-
|
|
579
|
+
# Build success message - use the actual name from check_data, not the parameter
|
|
580
|
+
actual_name = check_data.get("name", name)
|
|
581
|
+
actual_type = check_data.get("type", check_type)
|
|
582
|
+
success_details = [f"ID: {check.id}", f"Type: {actual_type}"]
|
|
582
583
|
if url:
|
|
583
584
|
success_details.append(f"URL: {url}")
|
|
584
585
|
if host:
|
|
@@ -589,7 +590,7 @@ class ChecksCommand(BaseCommand):
|
|
|
589
590
|
success_details.append(f"Script: loaded from {pw_script_file}")
|
|
590
591
|
|
|
591
592
|
self.display_success(
|
|
592
|
-
f"Check '{
|
|
593
|
+
f"Check '{actual_name}' created successfully!\n" + "\n".join(success_details),
|
|
593
594
|
"✅ Check Created"
|
|
594
595
|
)
|
|
595
596
|
|
|
@@ -215,21 +215,22 @@ class OnDemandChecksCommand(BaseCommand):
|
|
|
215
215
|
if params_dict:
|
|
216
216
|
check_data["parameters"] = params_dict
|
|
217
217
|
|
|
218
|
-
# Validation based on check type
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
# Validation based on check type - use the actual type from check_data
|
|
219
|
+
actual_check_type = check_data.get("type", check_type)
|
|
220
|
+
if actual_check_type in ['web', 'api'] and not url:
|
|
221
|
+
self.display_error(f"URL is required for {actual_check_type} checks")
|
|
221
222
|
raise typer.Exit(1)
|
|
222
223
|
|
|
223
|
-
if
|
|
224
|
-
self.display_error(f"Host is required for {
|
|
224
|
+
if actual_check_type in ['tcp'] and not host:
|
|
225
|
+
self.display_error(f"Host is required for {actual_check_type} checks")
|
|
225
226
|
raise typer.Exit(1)
|
|
226
227
|
|
|
227
|
-
if
|
|
228
|
-
self.display_error(f"Either URL or host is required for {
|
|
228
|
+
if actual_check_type in ['ssl'] and not (url or host):
|
|
229
|
+
self.display_error(f"Either URL or host is required for {actual_check_type} checks")
|
|
229
230
|
raise typer.Exit(1)
|
|
230
231
|
|
|
231
|
-
if
|
|
232
|
-
self.display_error(f"Playwright script is required for {
|
|
232
|
+
if actual_check_type in ['synthetic', 'multistep'] and not params_dict.get('pw_script'):
|
|
233
|
+
self.display_error(f"Playwright script is required for {actual_check_type} checks. Use --pw-script-file or --parameters with pw_script")
|
|
233
234
|
raise typer.Exit(1)
|
|
234
235
|
|
|
235
236
|
# Create the request
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
{
|
|
3
|
-
"name": "Example Web Check",
|
|
4
|
-
"type": "web",
|
|
5
|
-
"url": "https://example.com",
|
|
6
|
-
"interval": 300,
|
|
7
|
-
"timeout": 30,
|
|
8
|
-
"parameters": {
|
|
9
|
-
"regions": ["RU, Moscow", "EU, West"],
|
|
10
|
-
"search_text": "Welcome",
|
|
11
|
-
"http_request": {
|
|
12
|
-
"method": "GET",
|
|
13
|
-
"headers": {
|
|
14
|
-
"User-Agent": "PingeraCLI/1.0"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"marketplace": {
|
|
19
|
-
"tags": ["web", "basic"],
|
|
20
|
-
"name": "Simple website check with string search",
|
|
21
|
-
"description": "Queries website URL and searches for a string in the response",
|
|
22
|
-
}
|
|
23
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|