Skip to content

Commit

Permalink
FR-144 Support UniConfig 6.0.X release (#88)
Browse files Browse the repository at this point in the history
* FR-144 Updated generated UniConfig models

- bumped version of the datamodel-codegen because of the bug:
koxudaxi/datamodel-code-generator#1648

* FR-144 Bumped datamodel-codegen and regenerated JSON schema models

* FR-144 Bumped version of packages

- json-schema >> 0.0.2
- uniconfig >> 1.1.0

* FR-144 Fix/ignore codespell issues

* FR-144 Fixed codespell issues

* FR-144 Removed unuseed entry from .codespellignore

* FR-144 Ignore ruff errors in generated createsubscription.py file
  • Loading branch information
jaro0149 authored Apr 8, 2024
1 parent 589f1b8 commit 6078550
Show file tree
Hide file tree
Showing 30 changed files with 1,132 additions and 1,597 deletions.
8 changes: 7 additions & 1 deletion json-schema/python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# 0.0.1
- Introduced generating of pydantic classes out of JSON schemas.

# 0.1.0
- Added JSON schema and generated pydantic class for performance-monitoring service.
- Added JSON schema and generated pydantic class for performance-monitoring service.

# 0.1.1
- Updated generated pydantic classes with bunmped version
of datamodel-code-generator (0.25.5).

594 changes: 59 additions & 535 deletions json-schema/python/poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions json-schema/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ pydantic = "^2"
[tool.poetry.group.dev.dependencies]
ruff = "^0.0.263"
pyright = "^1.1.317"
datamodel-code-generator = {extras = ["http"], version = "^0.21.3"}
datamodel-code-generator = {extras = ["http"], version = "^0.25.5"}
mypy = "1.3.0"

[tool.poetry]
packages = [{ include = "frinx_api" }]
name = "frinx-json-schemas"
description = "JSON schemas to pydantic basemodel converter"
authors = ["Jakub Bogusciak <[email protected]>"]
version = "0.1.0"
version = "0.1.1"
readme = ["README.md", "CHANGELOG.md", "RELEASE.md"]
keywords = ["json-schema"]
license = "Apache 2.0"
Expand Down
11 changes: 11 additions & 0 deletions uniconfig/python/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,14 @@
# 0.1.1
- Float/Int mismatch fix
- Uniconfig 5.1.16

# 1.0.0
- FM 6.0.0.

# 1.1.0
- Compatibility with UniConfig 6.0.X.
- Added missing gNMI installation parameters.
- Added missing SNMP installation parameters.
- Fixed generation of arrays with null type
(added --strict-nullable attribute).
- Bumped version of datamodel-code-generator to 0.25.5.
8 changes: 8 additions & 0 deletions uniconfig/python/frinx_api/uniconfig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from .device.discovery import discover
from .dryrun.manager import dryruncommit
from .gnmi.logging import setmessagetypes
from .gnmi.yang.storage import uploadyangmodel
from .journal import clearjournal
from .journal import readjournal
from .logging import disabledefaultdevicelogging
Expand Down Expand Up @@ -320,6 +321,13 @@ class OperationsDryrunCommitPostResponse(BaseModel):
output: Optional[dryruncommit.Output] = None


class OperationsUploadYangModelPostRequest(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
input: Optional[uploadyangmodel.Input] = None


class OperationsReadJournalPostResponse(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class NodeResultItem(BaseModel):
populate_by_name=True,
)
node_id: Optional[str] = Field(None, alias='node-id')
topology_id: Optional[str] = Field(None, alias='topology-id')
uniconfig_layer: Optional[bool] = Field(None, alias='uniconfig-layer')
"""
Indicates whether node is installed in UniConfig layer.
"""
topology_id: Optional[str] = Field(None, alias='topology-id')


class NodeResults(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ class Input(BaseModel):
"""
node_id: str = Field(..., alias='node-id')
"""
Node identifier of CLI/NETCONF/GNMI/SUBSCRIPTION node.
Node identifier of CLI/NETCONF/GNMI node.
"""
stream_name: Optional[str] = Field(None, alias='stream-name')
"""
Name of a stream.
"""
max_connection_attempts: Optional[int] = Field(
None, alias='max-connection-attempts', ge=0, le=4294967295
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from __future__ import annotations

from typing import Optional

from pydantic import BaseModel
from pydantic import ConfigDict
from pydantic import Field
Expand All @@ -13,5 +15,9 @@ class Input(BaseModel):
)
node_id: str = Field(..., alias='node-id')
"""
Node identifier of CLI/NETCONF/GNMI/SUBSCRIPTION node.
Node identifier of CLI/NETCONF/GNMI node.
"""
stream_name: Optional[str] = Field(None, alias='stream-name')
"""
Name of a stream.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ class NodeResultItem(BaseModel):
populate_by_name=True,
)
node_id: Optional[str] = Field(None, alias='node-id')
topology_id: Optional[str] = Field(None, alias='topology-id')
uniconfig_layer: Optional[bool] = Field(None, alias='uniconfig-layer')
"""
Indicates whether node is installed in UniConfig layer.
"""
topology_id: Optional[str] = Field(None, alias='topology-id')


class NodeResults(BaseModel):
Expand Down
Loading

0 comments on commit 6078550

Please sign in to comment.