Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change SDX-LC swagger spec to comply with topology spec 2.0.0 #158

Merged
merged 4 commits into from
Jul 29, 2024
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
32 changes: 16 additions & 16 deletions sdx_lc/models/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(
availability=None,
status=None,
state=None,
private_attributes=None,
private=None,
timestamp=None,
measurement_period=None,
): # noqa: E501
Expand Down Expand Up @@ -60,8 +60,8 @@ def __init__(
:type status: str
:param state: The state of this Link. # noqa: E501
:type state: str
:param private_attributes: The private_attributes of this Link. # noqa: E501
:type private_attributes: List[str]
:param private: The private attributes of this Link. # noqa: E501
:type private: List[str]
:param timestamp: The timestamp of this Link. # noqa: E501
:type timestamp: datetime
:param measurement_period: The measurement_period of this Link. # noqa: E501
Expand All @@ -79,7 +79,7 @@ def __init__(
"availability": float,
"status": str,
"state": str,
"private_attributes": List[str],
"private": List[str],
"timestamp": datetime,
"measurement_period": LinkMeasurementPeriod,
}
Expand All @@ -96,7 +96,7 @@ def __init__(
"availability": "availability",
"status": "status",
"state": "state",
"private_attributes": "private_attributes",
"private": "private",
"timestamp": "timestamp",
"measurement_period": "measurement_period",
}
Expand All @@ -111,7 +111,7 @@ def __init__(
self._availability = availability
self._status = status
self._state = state
self._private_attributes = private_attributes
self._private = private
self._timestamp = timestamp
self._measurement_period = measurement_period

Expand Down Expand Up @@ -368,25 +368,25 @@ def state(self, state):
self._state = state

@property
def private_attributes(self):
"""Gets the private_attributes of this Link.
def private(self):
"""Gets the private attributes of this Link.


:return: The private_attributes of this Link.
:return: The private attributes of this Link.
:rtype: List[str]
"""
return self._private_attributes
return self._private

@private_attributes.setter
def private_attributes(self, private_attributes):
"""Sets the private_attributes of this Link.
@private.setter
def private(self, private):
"""Sets the private attributes of this Link.


:param private_attributes: The private_attributes of this Link.
:type private_attributes: List[str]
:param private: The private attributes of this Link.
:type private: List[str]
"""

self._private_attributes = private_attributes
self._private = private

@property
def timestamp(self):
Expand Down
27 changes: 0 additions & 27 deletions sdx_lc/models/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def __init__(
short_name=None,
location=None,
ports=None,
private_attributes=None,
): # noqa: E501
"""Node - a model defined in Swagger

Expand All @@ -38,16 +37,13 @@ def __init__(
:type location: Location
:param ports: The ports of this Node. # noqa: E501
:type ports: List[Port]
:param private_attributes: The private_attributes of this Node. # noqa: E501
:type private_attributes: List[str]
"""
self.swagger_types = {
"id": str,
"name": str,
"short_name": str,
"location": Location,
"ports": List[Port],
"private_attributes": List[str],
}

self.attribute_map = {
Expand All @@ -56,14 +52,12 @@ def __init__(
"short_name": "short_name",
"location": "location",
"ports": "ports",
"private_attributes": "private_attributes",
}
self._id = id
self._name = name
self._short_name = short_name
self._location = location
self._ports = ports
self._private_attributes = private_attributes

@classmethod
def from_dict(cls, dikt):
Expand Down Expand Up @@ -194,24 +188,3 @@ def ports(self, ports):
) # noqa: E501

self._ports = ports

@property
def private_attributes(self):
"""Gets the private_attributes of this Node.


:return: The private_attributes of this Node.
:rtype: List[str]
"""
return self._private_attributes

@private_attributes.setter
def private_attributes(self, private_attributes):
"""Sets the private_attributes of this Node.


:param private_attributes: The private_attributes of this Node.
:type private_attributes: List[str]
"""

self._private_attributes = private_attributes
86 changes: 70 additions & 16 deletions sdx_lc/models/port.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ def __init__(
status=None,
state=None,
nni=None,
type=None,
mtu=None,
services=None,
private_attributes=None,
private=None,
): # noqa: E501
"""Port - a model defined in Swagger

Expand All @@ -47,10 +49,14 @@ def __init__(
:type state: str
:param nni: The nni of this Port. # noqa: E501
:type nni: str
:param type: Technology and bandwidth of this physical Port. # noqa: E501
:type type: str
:param mtu: The Maximum Transmission Unit of this Port. # noqa: E501
:type mtu: int
:param services: The services of this Port. # noqa: E501
:type services: Service
:param private_attributes: The private_attributes of this Port. # noqa: E501
:type private_attributes: List[str]
:param private: The private attributes of this Port. # noqa: E501
:type private: List[str]
"""
self.swagger_types = {
"id": str,
Expand All @@ -61,8 +67,10 @@ def __init__(
"status": str,
"state": str,
"nni": str,
"type": str,
"mtu": int,
"services": Service,
"private_attributes": List[str],
"private": List[str],
}

self.attribute_map = {
Expand All @@ -74,8 +82,10 @@ def __init__(
"status": "status",
"state": "state",
"nni": "nni",
"type": "type",
"mtu": "mtu",
"services": "services",
"private_attributes": "private_attributes",
"private": "private",
}
self._id = id
self._name = name
Expand All @@ -85,8 +95,10 @@ def __init__(
self._status = status
self._state = state
self._nni = nni
self._type = type
self._mtu = mtu
self._services = services
self._private_attributes = private_attributes
self._private = private

@classmethod
def from_dict(cls, dikt):
Expand Down Expand Up @@ -281,6 +293,48 @@ def nni(self, nni):

self._nni = nni

@property
def type(self):
"""Gets the type of this Port.


:return: The type of this Port.
:type: str
"""
return self._type

@type.setter
def type(self, type):
"""Sets the type of this Port.


:param type: The type of this Port.
:type type: str
"""

self._type = type

@property
def mtu(self):
"""Gets the mtu of this Port.


:return: The mtu of this Port.
:type: int
"""
return self._mtu

@mtu.setter
def mtu(self, mtu):
"""Sets the mtu of this Port.


:param mtu: The mtu of this Port.
:type mtu: int
"""

self._mtu = mtu

@property
def services(self):
"""Gets the services of this Port.
Expand All @@ -303,22 +357,22 @@ def services(self, services):
self._services = services

@property
def private_attributes(self):
"""Gets the private_attributes of this Port.
def private(self):
"""Gets the private of this Port.


:return: The private_attributes of this Port.
:return: The private of this Port.
:rtype: List[str]
"""
return self._private_attributes
return self._private

@private_attributes.setter
def private_attributes(self, private_attributes):
"""Sets the private_attributes of this Port.
@private.setter
def private(self, private):
"""Sets the private of this Port.


:param private_attributes: The private_attributes of this Port.
:type private_attributes: List[str]
:param private: The private of this Port.
:type private: List[str]
"""

self._private_attributes = private_attributes
self._private = private
Loading