Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ VIPAT_VIDEOIPATH_USERNAME=user_with_api_access
VIPAT_VIDEOIPATH_PASSWORD=veryStrongPassword
VIPAT_USE_HTTPS=true
VIPAT_VERIFY_SSL_CERT=false
VIPAT_LOG_LEVEL=INFO
VIPAT_LOG_LEVEL=INFO
VIPAT_ADVANCED_DRIVER_SCHEMA_CHECK=true
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"args": [
"run",
"python",
"${workspaceFolder}/src/scripts/generate_overloads.py"
"${workspaceFolder}/src/vipat_cli_scripts/generate_overloads.py"
],
"hide": true
},
Expand All @@ -42,7 +42,7 @@
"args": [
"run",
"python",
"${workspaceFolder}/src/scripts/generate_driver_models.py",
"${workspaceFolder}/src/vipat_cli_scripts/generate_driver_models.py",
"${input:driversSchemaFile}",
"${input:driverModelFile}"
],
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ The package is available via the [Python Package Index (PyPI)](https://pypi.org/
pip install videoipath-automation-tool
```

**Note:** By default, the latest Long-Term Support (LTS) version (currently **2024.4.12**) is used for schema validation and IntelliSense.

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)

### A Simple Example: Adding a Device to the Inventory

```python
Expand Down Expand Up @@ -76,7 +80,7 @@ except Exception as e:

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

## Feedback & Contributions
Expand Down
155 changes: 0 additions & 155 deletions docs/driver-compatibility.md

This file was deleted.

32 changes: 32 additions & 0 deletions docs/driver-versioning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

# Driver Versioning

Driver schemas are auto-generated from the VideoIPath API's JSON schema, enabling IntelliSense support during development and runtime validation of custom settings.

By default, the system uses the latest Long-Term Support (LTS) version, currently **2024.4.12**.

To switch to a different version after installation, run:

```bash
set-videoipath-version <version>
```

For example:

```bash
set-videoipath-version 2024.3.3
```

If no version is specified, the latest available LTS version is automatically used.

To view the currently active version, use:

```bash
get-videoipath-version
```

To list all available versions, run:

```bash
list-videoipath-versions
```
13 changes: 11 additions & 2 deletions docs/getting-started-guide/01_Setup_and_connect_to_Server.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ The `VideoIPathApp` class provides all necessary methods to interact with the Vi

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

- **User Authorization**: The user account must be authorized using the `VideoIPath` authentication method.
- **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.
### User Account Settings (User Info)

- **User Authorization**:<br>The user account must be authorized using the `VideoIPath` authentication method.
- **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.

### Driver Versioning

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).

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

Expand All @@ -27,6 +33,7 @@ VIPAT_VIDEOIPATH_PASSWORD=veryStrongPassword
VIPAT_USE_HTTPS=true
VIPAT_VERIFY_SSL_CERT=false
VIPAT_LOG_LEVEL=INFO
VIPAT_ADVANCED_DRIVER_SCHEMA_CHECK=true
```

### Step 2: Code Example
Expand Down Expand Up @@ -70,6 +77,7 @@ print(app.get_server_version())
- `verify_ssl_cert`: Set to `True` if the SSL certificate should be verified.
- `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`).
- `environment`: The environment of the VideoIPath Server, possible values are `DEV`, `TEST`, and `PROD` (for future use)
- `advanced_driver_schema_check`: If set to `True`, the local driver schema is checked against the server's driver schema (custom settings fields).

### Environment Variables

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

## Log Levels

Expand Down
16 changes: 8 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Documentation = "https://github.com/SWR-MoIP/VideoIPath-Automation-Tool#document


[tool.poetry]
packages = [{ include = "videoipath_automation_tool", from = "src" }]
packages = [{ include = "videoipath_automation_tool", from = "src" },
{ include = "vipat_cli_scripts", from = "src" },]

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

[project.scripts]
set-videoipath-version = "videoipath_automation_tool.scripts.generate_all:main"
set-videoipath-version = "vipat_cli_scripts.generate_all:main"
get-videoipath-version = "vipat_cli_scripts.version_utils:get_videoipath_version"
list-videoipath-versions = "vipat_cli_scripts.version_utils:list_videoipath_versions"

[tool.ruff]
include = ["pyproject.toml", "src/**/*.py", "tests/**/*.py"]
Expand Down
70 changes: 70 additions & 0 deletions src/videoipath_automation_tool/apps/inventory/app/create_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ def create_device(
self, driver: Literal["com.nevion.aws_media-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_aws_media_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.blade_runner-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_blade_runner_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.cisco_7600_series-0.1.0"]
Expand All @@ -134,6 +139,11 @@ def create_device(
self, driver: Literal["com.nevion.cisco_me-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_cisco_me_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.cisco_ncs540-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_cisco_ncs540_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.cisco_nexus-0.1.0"]
Expand All @@ -144,6 +154,11 @@ def create_device(
self, driver: Literal["com.nevion.cisco_nexus_nbm-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_cisco_nexus_nbm_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.comprimato-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_comprimato_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.cp330-0.1.0"]
Expand Down Expand Up @@ -394,6 +409,11 @@ def create_device(
self, driver: Literal["com.nevion.liebert_nx-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_liebert_nx_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.lvb440-1.0.0"]
) -> InventoryDevice[CustomSettings_com_nevion_lvb440_1_0_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.maxiva-0.1.0"]
Expand Down Expand Up @@ -429,6 +449,11 @@ def create_device(
self, driver: Literal["com.nevion.mock-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_mock_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.mock_cloud-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_mock_cloud_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.montone42-0.1.0"]
Expand All @@ -444,6 +469,11 @@ def create_device(
self, driver: Literal["com.nevion.mwedge-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_mwedge_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.ndi-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_ndi_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.nec_dtl_30-0.1.0"]
Expand Down Expand Up @@ -489,6 +519,11 @@ def create_device(
self, driver: Literal["com.nevion.nx4600-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_nx4600_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.nxl_me80-1.0.0"]
) -> InventoryDevice[CustomSettings_com_nevion_nxl_me80_1_0_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.openflow-0.0.1"]
Expand All @@ -504,6 +539,11 @@ def create_device(
self, driver: Literal["com.nevion.prismon-1.0.0"]
) -> InventoryDevice[CustomSettings_com_nevion_prismon_1_0_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.probel_sw_p_08-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_probel_sw_p_08_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.r3lay-0.1.0"]
Expand Down Expand Up @@ -534,6 +574,11 @@ def create_device(
self, driver: Literal["com.nevion.sony_nxlk-ip51y-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_sony_nxlk_ip51y_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.spg9000-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_spg9000_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.starfish_splicer-0.1.0"]
Expand All @@ -549,11 +594,21 @@ def create_device(
self, driver: Literal["com.nevion.tag_mcm9000-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_tag_mcm9000_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.tag_mcs-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_tag_mcs_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.tally-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_tally_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.telestream_surveyor-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_telestream_surveyor_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.thomson_mxs-0.1.0"]
Expand Down Expand Up @@ -624,6 +679,16 @@ def create_device(
self, driver: Literal["com.nevion.tx9-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_tx9_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.txdarwin_dynamic-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_txdarwin_dynamic_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.txdarwin_static-0.1.0"]
) -> InventoryDevice[CustomSettings_com_nevion_txdarwin_static_0_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.nevion.txedge-0.1.0"]
Expand Down Expand Up @@ -689,6 +754,11 @@ def create_device(
self, driver: Literal["com.sony.SC1-1.0"]
) -> InventoryDevice[CustomSettings_com_sony_SC1_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.sony.XVS-G1-1.0"]
) -> InventoryDevice[CustomSettings_com_sony_XVS_G1_1_0]: ...

@overload
def create_device(
self, driver: Literal["com.sony.cna2-0.1.0"]
Expand Down
Loading