Skip to content

Commit 3d36026

Browse files
Merge pull request #38 from SWR-MoIP/35-follow-up-complete-configurable-versioning-from-pr-33
Follow-up: Complete Configurable Versioning (from PR #33)
2 parents af7a07f + 54cd645 commit 3d36026

24 files changed

Lines changed: 18340 additions & 2614 deletions

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ VIPAT_VIDEOIPATH_USERNAME=user_with_api_access
44
VIPAT_VIDEOIPATH_PASSWORD=veryStrongPassword
55
VIPAT_USE_HTTPS=true
66
VIPAT_VERIFY_SSL_CERT=false
7-
VIPAT_LOG_LEVEL=INFO
7+
VIPAT_LOG_LEVEL=INFO
8+
VIPAT_ADVANCED_DRIVER_SCHEMA_CHECK=true

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"args": [
2121
"run",
2222
"python",
23-
"${workspaceFolder}/src/scripts/generate_overloads.py"
23+
"${workspaceFolder}/src/vipat_cli_scripts/generate_overloads.py"
2424
],
2525
"hide": true
2626
},
@@ -42,7 +42,7 @@
4242
"args": [
4343
"run",
4444
"python",
45-
"${workspaceFolder}/src/scripts/generate_driver_models.py",
45+
"${workspaceFolder}/src/vipat_cli_scripts/generate_driver_models.py",
4646
"${input:driversSchemaFile}",
4747
"${input:driverModelFile}"
4848
],

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ The package is available via the [Python Package Index (PyPI)](https://pypi.org/
4343
pip install videoipath-automation-tool
4444
```
4545

46+
**Note:** By default, the latest Long-Term Support (LTS) version (currently **2024.4.12**) is used for schema validation and IntelliSense.
47+
48+
To switch to a specific version, see the [Driver Versioning Guide](https://github.com/SWR-MoIP/VideoIPath-Automation-Tool/blob/main/docs/driver-versioning.md)
49+
4650
### A Simple Example: Adding a Device to the Inventory
4751

4852
```python
@@ -76,7 +80,7 @@ except Exception as e:
7680

7781
- [Getting Started Guide](https://github.com/SWR-MoIP/VideoIPath-Automation-Tool/blob/main/docs/getting-started-guide/README.md)
7882
- [Python Module Architecture](https://github.com/SWR-MoIP/VideoIPath-Automation-Tool/blob/main/docs/python-module-architecture.md)
79-
- [Driver Compatibility](https://github.com/SWR-MoIP/VideoIPath-Automation-Tool/blob/main/docs/driver-compatibility.md)
83+
- [Driver Versioning](https://github.com/SWR-MoIP/VideoIPath-Automation-Tool/blob/main/docs/driver-versioning.md)
8084
- [Development and Release](https://github.com/SWR-MoIP/VideoIPath-Automation-Tool/blob/main/docs/development-and-release.md)
8185

8286
## Feedback & Contributions

docs/driver-compatibility.md

Lines changed: 0 additions & 155 deletions
This file was deleted.

docs/driver-versioning.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
# Driver Versioning
3+
4+
Driver schemas are auto-generated from the VideoIPath API's JSON schema, enabling IntelliSense support during development and runtime validation of custom settings.
5+
6+
By default, the system uses the latest Long-Term Support (LTS) version, currently **2024.4.12**.
7+
8+
To switch to a different version after installation, run:
9+
10+
```bash
11+
set-videoipath-version <version>
12+
```
13+
14+
For example:
15+
16+
```bash
17+
set-videoipath-version 2024.3.3
18+
```
19+
20+
If no version is specified, the latest available LTS version is automatically used.
21+
22+
To view the currently active version, use:
23+
24+
```bash
25+
get-videoipath-version
26+
```
27+
28+
To list all available versions, run:
29+
30+
```bash
31+
list-videoipath-versions
32+
```

docs/getting-started-guide/01_Setup_and_connect_to_Server.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ The `VideoIPathApp` class provides all necessary methods to interact with the Vi
1010

1111
Before establishing a connection to the VideoIPath Server, ensure that the following requirements are met:
1212

13-
- **User Authorization**: The user account must be authorized using the `VideoIPath` authentication method.
14-
- **Permissions**: For a straightforward setup, enable both `API` and `Administrator` options for the user account (User Info). This ensures that the user has all necessary permissions to interact with the VideoIPath Server.
13+
### User Account Settings (User Info)
14+
15+
- **User Authorization**:<br>The user account must be authorized using the `VideoIPath` authentication method.
16+
- **Permissions**:<br>For a straightforward setup, enable both `API` and `Administrator` options for the user account (User Info). This ensures that the user has all necessary permissions to interact with the VideoIPath Server.
17+
18+
### Driver Versioning
19+
20+
To ensure IntelliSense support and runtime validation of custom settings, the VideoIPath Server should be running a compatible version of the driver schema. By default, the package uses the latest Long-Term Support (LTS) version, which is currently **2024.4.12**. If you need to use a different version, refer to the [Driver Versioning Guide](../driver-versioning.md).
1521

1622
## Example 1: Establishing a Connection to the VideoIPath Server via Environment Variables
1723

@@ -27,6 +33,7 @@ VIPAT_VIDEOIPATH_PASSWORD=veryStrongPassword
2733
VIPAT_USE_HTTPS=true
2834
VIPAT_VERIFY_SSL_CERT=false
2935
VIPAT_LOG_LEVEL=INFO
36+
VIPAT_ADVANCED_DRIVER_SCHEMA_CHECK=true
3037
```
3138

3239
### Step 2: Code Example
@@ -70,6 +77,7 @@ print(app.get_server_version())
7077
- `verify_ssl_cert`: Set to `True` if the SSL certificate should be verified.
7178
- `log_level`: The log level for the logging module, possible values are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL`. If not set as a parameter or environment variable, it falls back to the root logger's level (default is set to `WARNING`).
7279
- `environment`: The environment of the VideoIPath Server, possible values are `DEV`, `TEST`, and `PROD` (for future use)
80+
- `advanced_driver_schema_check`: If set to `True`, the local driver schema is checked against the server's driver schema (custom settings fields).
7381

7482
### Environment Variables
7583

@@ -82,6 +90,7 @@ print(app.get_server_version())
8290
| `VIPAT_USE_HTTPS` | `true`, `false` | Optional: Use HTTPS for the connection. Defaults to `true`. |
8391
| `VIPAT_VERIFY_SSL_CERT` | `true`, `false` | Optional: Verify the SSL certificate. Defaults to `true`. |
8492
| `VIPAT_LOG_LEVEL` | `debug`, `info`, `warning`, `error`, `critical` | Optional: Set the log level. |
93+
| `VIPAT_ADVANCED_DRIVER_SCHEMA_CHECK` | `true`, `false` | Optional: Enable advanced driver schema checks. Defaults to `true`. |
8594

8695
## Log Levels
8796

poetry.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ Documentation = "https://github.com/SWR-MoIP/VideoIPath-Automation-Tool#document
3636

3737

3838
[tool.poetry]
39-
packages = [{ include = "videoipath_automation_tool", from = "src" }]
39+
packages = [{ include = "videoipath_automation_tool", from = "src" },
40+
{ include = "vipat_cli_scripts", from = "src" },]
4041

4142
[tool.poetry.group.dev.dependencies]
4243
ruff = "^0.11.11"
@@ -57,7 +58,9 @@ env_files = ["tests/.env.test"]
5758
in-project = true
5859

5960
[project.scripts]
60-
set-videoipath-version = "videoipath_automation_tool.scripts.generate_all:main"
61+
set-videoipath-version = "vipat_cli_scripts.generate_all:main"
62+
get-videoipath-version = "vipat_cli_scripts.version_utils:get_videoipath_version"
63+
list-videoipath-versions = "vipat_cli_scripts.version_utils:list_videoipath_versions"
6164

6265
[tool.ruff]
6366
include = ["pyproject.toml", "src/**/*.py", "tests/**/*.py"]

src/videoipath_automation_tool/apps/inventory/app/create_device.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ def create_device(
114114
self, driver: Literal["com.nevion.aws_media-0.1.0"]
115115
) -> InventoryDevice[CustomSettings_com_nevion_aws_media_0_1_0]: ...
116116

117+
@overload
118+
def create_device(
119+
self, driver: Literal["com.nevion.blade_runner-0.1.0"]
120+
) -> InventoryDevice[CustomSettings_com_nevion_blade_runner_0_1_0]: ...
121+
117122
@overload
118123
def create_device(
119124
self, driver: Literal["com.nevion.cisco_7600_series-0.1.0"]
@@ -134,6 +139,11 @@ def create_device(
134139
self, driver: Literal["com.nevion.cisco_me-0.1.0"]
135140
) -> InventoryDevice[CustomSettings_com_nevion_cisco_me_0_1_0]: ...
136141

142+
@overload
143+
def create_device(
144+
self, driver: Literal["com.nevion.cisco_ncs540-0.1.0"]
145+
) -> InventoryDevice[CustomSettings_com_nevion_cisco_ncs540_0_1_0]: ...
146+
137147
@overload
138148
def create_device(
139149
self, driver: Literal["com.nevion.cisco_nexus-0.1.0"]
@@ -144,6 +154,11 @@ def create_device(
144154
self, driver: Literal["com.nevion.cisco_nexus_nbm-0.1.0"]
145155
) -> InventoryDevice[CustomSettings_com_nevion_cisco_nexus_nbm_0_1_0]: ...
146156

157+
@overload
158+
def create_device(
159+
self, driver: Literal["com.nevion.comprimato-0.1.0"]
160+
) -> InventoryDevice[CustomSettings_com_nevion_comprimato_0_1_0]: ...
161+
147162
@overload
148163
def create_device(
149164
self, driver: Literal["com.nevion.cp330-0.1.0"]
@@ -394,6 +409,11 @@ def create_device(
394409
self, driver: Literal["com.nevion.liebert_nx-0.1.0"]
395410
) -> InventoryDevice[CustomSettings_com_nevion_liebert_nx_0_1_0]: ...
396411

412+
@overload
413+
def create_device(
414+
self, driver: Literal["com.nevion.lvb440-1.0.0"]
415+
) -> InventoryDevice[CustomSettings_com_nevion_lvb440_1_0_0]: ...
416+
397417
@overload
398418
def create_device(
399419
self, driver: Literal["com.nevion.maxiva-0.1.0"]
@@ -429,6 +449,11 @@ def create_device(
429449
self, driver: Literal["com.nevion.mock-0.1.0"]
430450
) -> InventoryDevice[CustomSettings_com_nevion_mock_0_1_0]: ...
431451

452+
@overload
453+
def create_device(
454+
self, driver: Literal["com.nevion.mock_cloud-0.1.0"]
455+
) -> InventoryDevice[CustomSettings_com_nevion_mock_cloud_0_1_0]: ...
456+
432457
@overload
433458
def create_device(
434459
self, driver: Literal["com.nevion.montone42-0.1.0"]
@@ -444,6 +469,11 @@ def create_device(
444469
self, driver: Literal["com.nevion.mwedge-0.1.0"]
445470
) -> InventoryDevice[CustomSettings_com_nevion_mwedge_0_1_0]: ...
446471

472+
@overload
473+
def create_device(
474+
self, driver: Literal["com.nevion.ndi-0.1.0"]
475+
) -> InventoryDevice[CustomSettings_com_nevion_ndi_0_1_0]: ...
476+
447477
@overload
448478
def create_device(
449479
self, driver: Literal["com.nevion.nec_dtl_30-0.1.0"]
@@ -489,6 +519,11 @@ def create_device(
489519
self, driver: Literal["com.nevion.nx4600-0.1.0"]
490520
) -> InventoryDevice[CustomSettings_com_nevion_nx4600_0_1_0]: ...
491521

522+
@overload
523+
def create_device(
524+
self, driver: Literal["com.nevion.nxl_me80-1.0.0"]
525+
) -> InventoryDevice[CustomSettings_com_nevion_nxl_me80_1_0_0]: ...
526+
492527
@overload
493528
def create_device(
494529
self, driver: Literal["com.nevion.openflow-0.0.1"]
@@ -504,6 +539,11 @@ def create_device(
504539
self, driver: Literal["com.nevion.prismon-1.0.0"]
505540
) -> InventoryDevice[CustomSettings_com_nevion_prismon_1_0_0]: ...
506541

542+
@overload
543+
def create_device(
544+
self, driver: Literal["com.nevion.probel_sw_p_08-0.1.0"]
545+
) -> InventoryDevice[CustomSettings_com_nevion_probel_sw_p_08_0_1_0]: ...
546+
507547
@overload
508548
def create_device(
509549
self, driver: Literal["com.nevion.r3lay-0.1.0"]
@@ -534,6 +574,11 @@ def create_device(
534574
self, driver: Literal["com.nevion.sony_nxlk-ip51y-0.1.0"]
535575
) -> InventoryDevice[CustomSettings_com_nevion_sony_nxlk_ip51y_0_1_0]: ...
536576

577+
@overload
578+
def create_device(
579+
self, driver: Literal["com.nevion.spg9000-0.1.0"]
580+
) -> InventoryDevice[CustomSettings_com_nevion_spg9000_0_1_0]: ...
581+
537582
@overload
538583
def create_device(
539584
self, driver: Literal["com.nevion.starfish_splicer-0.1.0"]
@@ -549,11 +594,21 @@ def create_device(
549594
self, driver: Literal["com.nevion.tag_mcm9000-0.1.0"]
550595
) -> InventoryDevice[CustomSettings_com_nevion_tag_mcm9000_0_1_0]: ...
551596

597+
@overload
598+
def create_device(
599+
self, driver: Literal["com.nevion.tag_mcs-0.1.0"]
600+
) -> InventoryDevice[CustomSettings_com_nevion_tag_mcs_0_1_0]: ...
601+
552602
@overload
553603
def create_device(
554604
self, driver: Literal["com.nevion.tally-0.1.0"]
555605
) -> InventoryDevice[CustomSettings_com_nevion_tally_0_1_0]: ...
556606

607+
@overload
608+
def create_device(
609+
self, driver: Literal["com.nevion.telestream_surveyor-0.1.0"]
610+
) -> InventoryDevice[CustomSettings_com_nevion_telestream_surveyor_0_1_0]: ...
611+
557612
@overload
558613
def create_device(
559614
self, driver: Literal["com.nevion.thomson_mxs-0.1.0"]
@@ -624,6 +679,16 @@ def create_device(
624679
self, driver: Literal["com.nevion.tx9-0.1.0"]
625680
) -> InventoryDevice[CustomSettings_com_nevion_tx9_0_1_0]: ...
626681

682+
@overload
683+
def create_device(
684+
self, driver: Literal["com.nevion.txdarwin_dynamic-0.1.0"]
685+
) -> InventoryDevice[CustomSettings_com_nevion_txdarwin_dynamic_0_1_0]: ...
686+
687+
@overload
688+
def create_device(
689+
self, driver: Literal["com.nevion.txdarwin_static-0.1.0"]
690+
) -> InventoryDevice[CustomSettings_com_nevion_txdarwin_static_0_1_0]: ...
691+
627692
@overload
628693
def create_device(
629694
self, driver: Literal["com.nevion.txedge-0.1.0"]
@@ -689,6 +754,11 @@ def create_device(
689754
self, driver: Literal["com.sony.SC1-1.0"]
690755
) -> InventoryDevice[CustomSettings_com_sony_SC1_1_0]: ...
691756

757+
@overload
758+
def create_device(
759+
self, driver: Literal["com.sony.XVS-G1-1.0"]
760+
) -> InventoryDevice[CustomSettings_com_sony_XVS_G1_1_0]: ...
761+
692762
@overload
693763
def create_device(
694764
self, driver: Literal["com.sony.cna2-0.1.0"]

0 commit comments

Comments
 (0)