-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
149 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
if __package__ is None or __package__ == "": | ||
from generated import infra_pb2, infra_pb2_grpc | ||
else: | ||
from .generated import infra_pb2, infra_pb2_grpc | ||
|
||
class InfraService(): | ||
@staticmethod | ||
def Validate(request: infra_pb2.ValidationRequest): | ||
"""Validate every connection in Device and Infrastructure. | ||
Every Device in Infrastructure.inventory.devices has connections which | ||
must have a valid number of pieces separated by a ".". | ||
The names in the following connection breakdown must be present in the | ||
Device components and links. | ||
The format of a Device connection is the following: | ||
"component_name.component_index.link_name.component_name.component_index" | ||
""" | ||
validation_response = infra_pb2.ValidationResponse() | ||
for name, device in request.infrastructure.inventory.devices.items(): | ||
if name != device.name: | ||
validation_response.inva | ||
for connection in device.connections: | ||
return validation_response |