systemlink-cli 1.26.2__tar.gz → 1.27.0__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.
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/PKG-INFO +1 -1
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/pyproject.toml +1 -1
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/_version.py +1 -1
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/alarm_click.py +3 -1
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/asset_click.py +10 -16
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/cli_utils.py +16 -15
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/example_click.py +30 -8
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/example_loader.py +1 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/example_provisioner.py +407 -48
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/README.md +6 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/_schema/schema-v1.0.json +3 -2
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/demo-data-3/config.yaml +2 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/exercise-7-1-test-plans/README.md +2 -2
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/exercise-7-1-test-plans/config.yaml +3 -4
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/spec_click.py +8 -1
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/system_click.py +7 -1
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/tag_click.py +4 -1
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/testmonitor_click.py +4 -1
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/utils.py +5 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_click.py +4 -1
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/workitem_click.py +7 -1
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/LICENSE +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/dff-editor/editor.js +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/dff-editor/index.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/__init__.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/__main__.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/cli_formatters.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/comment_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/completion_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/config.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/config_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/dataframe_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/dff_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/dff_decorators.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/demo-data-1/README.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/demo-data-1/config.yaml +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/demo-data-2/README.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/demo-data-2/config.yaml +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/demo-data-3/leakage-current-results.json +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/demo-data-3/overvoltage-results.json +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/demo-data-3/product-xyz-compliance-report.json +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/demo-data-3/product-xyz-specification.csv +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/demo-data-3/thermal-response-results.json +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/exercise-5-1-parametric-insights/README.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/exercise-5-1-parametric-insights/config.yaml +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/spec-compliance-notebooks/README.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/spec-compliance-notebooks/config.yaml +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/spec-compliance-notebooks/notebooks/SpecAnalysis_ComplianceCalculation.ipynb +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/spec-compliance-notebooks/notebooks/SpecComplianceCalculation.ipynb +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/spec-compliance-notebooks/notebooks/SpecfileExtractionAndIngestion.ipynb +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/examples/spec-compliance-notebooks/spec_template.xlsx +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/feed_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/file_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/function_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/function_templates.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/main.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/mcp_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/mcp_reachability.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/mcp_server.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/notebook_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/pkce.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/platform.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/policy_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/policy_utils.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/profiles.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/response_handlers.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/rich_output.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/routine_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skill_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/SKILL.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/analysis-recipes.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/commands.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/datasheet-workflow.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/example-authoring.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/filtering.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/import-specs.min.json +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/job-debugging/overview.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/nipkg/overview.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/notebook/interfaces.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/notebook/notebook-patterns.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/notebook/overview.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/python-test/overview.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/routine-examples.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/troubleshooting.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/webapp/angular-ui-packages.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/webapp/deployment.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/webapp/layout-patterns.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/webapp/nimble-angular.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/webapp/overview.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/webapp/systemlink-services.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/references/webapp/troubleshooting.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/skills/slcli/scripts/spec_import_helper.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/ssl_trust.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/state_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/system_query_utils.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/systemlink-logo.svg +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/table_utils.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/templates_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/universal_handlers.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/user_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/web_editor.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_bootstrap.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/.gitignore +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/README.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/angular.json +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/package.json +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/scripts/filter-sbom.js +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/app-routing.module.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/app.component.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/app.component.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/app.component.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/app.module.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/core/state/app-view-state.service.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/systemlink-context.service.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/theme-sync.service.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/webapp-home-data.service.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/app/shared/states/view-state.model.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/assets/README.md +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/index.html +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/main.ts +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/src/styles.scss +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/tsconfig.app.json +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/webapp_templates/angular/blank/tsconfig.json +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/workflow_preview.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/workflows_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/workspace_click.py +0 -0
- {systemlink_cli-1.26.2 → systemlink_cli-1.27.0}/slcli/workspace_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "systemlink-cli"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.27.0"
|
|
4
4
|
description = "SystemLink Integrator CLI - cross-platform CLI for SystemLink workflows and templates."
|
|
5
5
|
authors = ["Fred Visser <fred.visser@emerson.com>"]
|
|
6
6
|
packages = [{ include = "slcli" }]
|
|
@@ -11,7 +11,7 @@ from urllib.parse import quote
|
|
|
11
11
|
import click
|
|
12
12
|
import questionary
|
|
13
13
|
|
|
14
|
-
from .cli_utils import confirm_bulk_operation, validate_output_format
|
|
14
|
+
from .cli_utils import confirm_bulk_operation, is_interactive_environment, validate_output_format
|
|
15
15
|
from .rich_output import render_table
|
|
16
16
|
from .universal_handlers import FilteredResponse, UniversalResponseHandler
|
|
17
17
|
from .utils import (
|
|
@@ -501,6 +501,8 @@ def _run_list_alarms(
|
|
|
501
501
|
)
|
|
502
502
|
if not continuation_token:
|
|
503
503
|
break
|
|
504
|
+
if not is_interactive_environment():
|
|
505
|
+
break
|
|
504
506
|
if not questionary.confirm("Show next set of alarms?", default=True).ask():
|
|
505
507
|
break
|
|
506
508
|
|
|
@@ -12,11 +12,12 @@ from typing import Any, Dict, List, Optional, Tuple
|
|
|
12
12
|
import click
|
|
13
13
|
import questionary
|
|
14
14
|
|
|
15
|
-
from .cli_utils import validate_output_format
|
|
15
|
+
from .cli_utils import is_interactive_environment, validate_output_format
|
|
16
16
|
from .universal_handlers import FilteredResponse, UniversalResponseHandler
|
|
17
17
|
from .utils import (
|
|
18
18
|
ExitCodes,
|
|
19
19
|
check_readonly_mode,
|
|
20
|
+
escape_filter_value,
|
|
20
21
|
format_success,
|
|
21
22
|
get_base_url,
|
|
22
23
|
get_workspace_map,
|
|
@@ -29,24 +30,14 @@ from .workspace_utils import (
|
|
|
29
30
|
resolve_workspace_filter,
|
|
30
31
|
)
|
|
31
32
|
|
|
33
|
+
_escape_filter_value = escape_filter_value
|
|
34
|
+
|
|
32
35
|
|
|
33
36
|
def _get_asset_base_url() -> str:
|
|
34
37
|
"""Get the base URL for the Asset Management API."""
|
|
35
38
|
return f"{get_base_url()}/niapm/v1"
|
|
36
39
|
|
|
37
40
|
|
|
38
|
-
def _escape_filter_value(value: str) -> str:
|
|
39
|
-
"""Escape double quotes in filter values to prevent injection.
|
|
40
|
-
|
|
41
|
-
Args:
|
|
42
|
-
value: Raw filter value from user input.
|
|
43
|
-
|
|
44
|
-
Returns:
|
|
45
|
-
Escaped value safe for embedding in filter expressions.
|
|
46
|
-
"""
|
|
47
|
-
return value.replace('"', '\\"')
|
|
48
|
-
|
|
49
|
-
|
|
50
41
|
def _parse_properties(properties: Tuple[str, ...]) -> Dict[str, str]:
|
|
51
42
|
"""Parse key=value property strings into a dictionary.
|
|
52
43
|
|
|
@@ -100,10 +91,10 @@ def _build_asset_filter(
|
|
|
100
91
|
parts: List[str] = []
|
|
101
92
|
|
|
102
93
|
if model:
|
|
103
|
-
escaped =
|
|
94
|
+
escaped = escape_filter_value(model)
|
|
104
95
|
parts.append(f'ModelName.Contains("{escaped}")')
|
|
105
96
|
if serial_number:
|
|
106
|
-
escaped =
|
|
97
|
+
escaped = escape_filter_value(serial_number)
|
|
107
98
|
parts.append(f'SerialNumber = "{escaped}"')
|
|
108
99
|
if bus_type:
|
|
109
100
|
parts.append(f'BusType = "{bus_type}"')
|
|
@@ -117,7 +108,7 @@ def _build_asset_filter(
|
|
|
117
108
|
' and Location.AssetState.AssetPresence = "PRESENT"'
|
|
118
109
|
)
|
|
119
110
|
if workspace_id:
|
|
120
|
-
escaped =
|
|
111
|
+
escaped = escape_filter_value(workspace_id)
|
|
121
112
|
parts.append(f'Workspace = "{escaped}"')
|
|
122
113
|
if custom_filter:
|
|
123
114
|
parts.append(custom_filter)
|
|
@@ -302,6 +293,9 @@ def _handle_asset_interactive_pagination(
|
|
|
302
293
|
if shown_count >= total_count:
|
|
303
294
|
break
|
|
304
295
|
|
|
296
|
+
if not is_interactive_environment():
|
|
297
|
+
break
|
|
298
|
+
|
|
305
299
|
if not questionary.confirm("Show next set of results?", default=True).ask():
|
|
306
300
|
break
|
|
307
301
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Common utility functions for all CLI commands."""
|
|
2
2
|
|
|
3
|
+
import os
|
|
3
4
|
import sys
|
|
4
5
|
from typing import Any, Callable, Dict, List, Optional
|
|
5
6
|
|
|
@@ -11,6 +12,19 @@ from .rich_output import print_json, render_table
|
|
|
11
12
|
from .utils import ExitCodes, handle_api_error
|
|
12
13
|
|
|
13
14
|
|
|
15
|
+
def is_interactive_environment() -> bool:
|
|
16
|
+
"""Return whether interactive prompts should be displayed.
|
|
17
|
+
|
|
18
|
+
In-process pytest callers remain interactive so prompt behavior can be tested with mocks.
|
|
19
|
+
Captured E2E subprocesses set ``SLCLI_NON_INTERACTIVE`` explicitly.
|
|
20
|
+
"""
|
|
21
|
+
if os.getenv("SLCLI_NON_INTERACTIVE", "").lower() == "true":
|
|
22
|
+
return False
|
|
23
|
+
if os.getenv("PYTEST_CURRENT_TEST") is not None:
|
|
24
|
+
return True
|
|
25
|
+
return sys.stdin.isatty() and sys.stdout.isatty() and os.getenv("CI", "").lower() != "true"
|
|
26
|
+
|
|
27
|
+
|
|
14
28
|
def resolve_resource_by_name_or_id(
|
|
15
29
|
session: requests.Session,
|
|
16
30
|
base_url: str,
|
|
@@ -408,26 +422,13 @@ def paginate_list_output(
|
|
|
408
422
|
f"{remaining} more available."
|
|
409
423
|
)
|
|
410
424
|
|
|
411
|
-
|
|
412
|
-
# If stdin is not a TTY or we're in a test environment, disable interactive pagination
|
|
413
|
-
import os
|
|
414
|
-
import sys
|
|
415
|
-
|
|
416
|
-
is_non_interactive = (
|
|
417
|
-
not sys.stdin.isatty() # Piped input
|
|
418
|
-
or not sys.stdout.isatty() # Piped output
|
|
419
|
-
or os.getenv("CI") == "true" # CI environment
|
|
420
|
-
or os.getenv("PYTEST_CURRENT_TEST") is not None # pytest
|
|
421
|
-
or os.getenv("SLCLI_NON_INTERACTIVE") == "true" # Explicit override
|
|
422
|
-
)
|
|
423
|
-
|
|
424
|
-
if is_non_interactive:
|
|
425
|
+
if not is_interactive_environment():
|
|
425
426
|
click.echo("Non-interactive environment detected. Showing all remaining results...")
|
|
426
427
|
# Continue to show all remaining pages without prompting
|
|
427
428
|
current_page += 1
|
|
428
429
|
continue
|
|
429
430
|
|
|
430
|
-
if not questionary.confirm("Show next
|
|
431
|
+
if not questionary.confirm(f"Show next {page_size} results?", default=True).ask():
|
|
431
432
|
break
|
|
432
433
|
|
|
433
434
|
click.echo() # Add blank line between pages
|
|
@@ -408,7 +408,13 @@ def register_example_commands(cli: Any) -> None:
|
|
|
408
408
|
handle_api_error(exc)
|
|
409
409
|
|
|
410
410
|
@example.command(name="delete")
|
|
411
|
-
@click.argument("example_name")
|
|
411
|
+
@click.argument("example_name", required=False)
|
|
412
|
+
@click.option(
|
|
413
|
+
"--file",
|
|
414
|
+
"config_file",
|
|
415
|
+
type=click.Path(exists=True, dir_okay=False, readable=True, resolve_path=True),
|
|
416
|
+
help="Path to an example config.yaml; referenced files are relative to its directory.",
|
|
417
|
+
)
|
|
412
418
|
@click.option("--workspace", "-w", required=True, help="Workspace name or ID for resources")
|
|
413
419
|
@click.option(
|
|
414
420
|
"--format",
|
|
@@ -429,7 +435,8 @@ def register_example_commands(cli: Any) -> None:
|
|
|
429
435
|
help="Path to write deletion results as JSON for auditing.",
|
|
430
436
|
)
|
|
431
437
|
def delete_example(
|
|
432
|
-
example_name: str,
|
|
438
|
+
example_name: Optional[str],
|
|
439
|
+
config_file: Optional[str],
|
|
433
440
|
workspace: Optional[str],
|
|
434
441
|
format: str,
|
|
435
442
|
dry_run: bool,
|
|
@@ -442,14 +449,29 @@ def register_example_commands(cli: Any) -> None:
|
|
|
442
449
|
|
|
443
450
|
try:
|
|
444
451
|
loader = ExampleLoader()
|
|
445
|
-
|
|
452
|
+
example_dir: Optional[Path] = None
|
|
453
|
+
if config_file and example_name:
|
|
454
|
+
raise ValueError("Specify either EXAMPLE_NAME or --file, not both.")
|
|
455
|
+
if not config_file and not example_name:
|
|
456
|
+
raise ValueError("Provide an EXAMPLE_NAME or --file path to config.yaml.")
|
|
457
|
+
|
|
458
|
+
if config_file:
|
|
459
|
+
config_path = Path(config_file)
|
|
460
|
+
config = loader.load_config_file(config_path)
|
|
461
|
+
example_name = str(config["name"])
|
|
462
|
+
example_dir = config_path.parent
|
|
463
|
+
else:
|
|
464
|
+
config = loader.load_config(example_name or "")
|
|
446
465
|
|
|
447
466
|
workspace_id = _resolve_workspace_id(get_effective_workspace(workspace))
|
|
448
|
-
|
|
449
|
-
workspace_id
|
|
450
|
-
example_name
|
|
451
|
-
dry_run
|
|
452
|
-
|
|
467
|
+
provisioner_options: Dict[str, Any] = {
|
|
468
|
+
"workspace_id": workspace_id,
|
|
469
|
+
"example_name": example_name,
|
|
470
|
+
"dry_run": dry_run,
|
|
471
|
+
}
|
|
472
|
+
if example_dir is not None:
|
|
473
|
+
provisioner_options["example_dir"] = example_dir
|
|
474
|
+
provisioner = ExampleProvisioner(**provisioner_options)
|
|
453
475
|
|
|
454
476
|
results, err = provisioner.delete(config)
|
|
455
477
|
if err:
|