Module dzs

DZS OLT config module

  • License: Inmanta EULA

  • Version: 2.0.0

Typedefs

typedef dzs::access_type_t
  • Base type string

  • Type constraint (self in ['PPPoE', 'DHCP'])

typedef dzs::cli_word_t
  • Base type string

  • Type constraint std::validate_type('pydantic.constr',self,{'regex': '^[!-~]+$', 'strict': True})

typedef dzs::encapsulation_t
  • Base type string

  • Type constraint (self in ['tagged', 'stagged'])

typedef dzs::hex_string
  • Base type string

  • Type constraint std::validate_type('pydantic.constr',self,{'regex': '^[0-9A-F]{8}$'})

typedef dzs::olt_port_t
  • Base type string

  • Type constraint std::validate_type('pydantic.constr',self,{'regex': '^\\d+/\\d+$'})

typedef dzs::rule_id_t
  • Base type string

  • Type constraint std::validate_type('pydantic.constr',self,{'regex': '^\\d+/\\d+$'})

typedef dzs::rule_name_t
  • Base type string

  • Type constraint std::validate_type('pydantic.constr',self,{'regex': '^[!-~]*$', 'strict': True})

Entities

entity dzs::BaseDiscovery

Parents: std::DiscoveryResource

Base entity for all the discovery resources of this module. A discovery runs on the agent of its device, sharing its ssh session with the other resources of the device.

The values reported for a discovered resource are the attributes of its managed counterpart which the handler of that resource can read from the device. The resources are reported with the id their managed counterpart would have, except for the resources which refer to an onu registered with a regid: they are reported with the serial number of the onu, as the regid is not exposed by the olt inventory.

attribute string name

Name of the discovery

attribute string? target_agent_name=null

The agent the discovered resources are reported on, the agent of their managed counterparts. When null, the agent of the discovery (the name of its device).

relation dzs::Device device [1]

The following implements statements select implementations for this entity:

entity dzs::BaseResource

Parents: std::PurgeableResource, std::ManagedResource

Base entity for all the managed resources of this module. A resource is managed by the agent of its device, and identified by its device and its own id.

attribute bool send_event=true

Whether this resource should send an event to the resources depending on it, once it has been deployed.

relation dzs::Device device [1]

The following implements statements select implementations for this entity:

  • constraint true

entity dzs::Device

Parents: std::Entity

A dzs device, identified in the model by its name, which is also the name of the agent managing the resources of this module on it. Several devices can reach the same olt (same host and port) to split its resources over several agents.

attribute string name

Identifies the device in the model, and is the name of the agent managing its resources. The ids of the resources are scoped to this name.

attribute string? host=null

hostname or ip address of the device. When null, the name is used as hostname.

attribute std::port port=22

the ssh port of the device

attribute string username

the user name to authenticate with

attribute string password

the user password to authenticate with

attribute bool strict_key=false

only connect when the host key of the device is in the known hosts of the agent user (~/.ssh/known_hosts). When false, any host key is accepted, on every connection: a host impersonating the device gets its credentials and its commands. The agent logs a warning each time it opens such a session.

The following implements statements select implementations for this entity:

entity dzs::Onu

Parents: dzs::BaseResource

Entity representing an Onu on the device

attribute string name

Name that identifies the onu within the olt, set by the model as a reference. It resolves to -1 when the onu has been deleted or is not found on its olt port.

attribute int slot

Slot number on the olt

attribute int olt

Olt port number

attribute int id

The unique identifier of than onu within the olt port, set by the model as a reference. It resolves to -1 when the onu has been deleted or is not found on its olt port.

attribute dzs::cli_word_t? regid=null

Register Id

attribute std::ascii_word me_profile
attribute dzs::hex_string? serial_number=null

Serial number of the onu device

attribute bool skip_if_not_found=false

Flag to make the resource skip if - in case of regid: the resource is set but not found in the inventory - in case of serial: the serno is not found in the device

relation dzs::OnuPorts ports [0:1]

other end: dzs::OnuPorts.onu [1]

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity dzs::OnuDiscovery

Parents: dzs::BaseDiscovery

A resource that will discover all the onus which are known by the device, either already registered on an olt port, or waiting to be registered.

On top of the attributes of the managed dzs::Onu resource, each discovered onu carries the model of the onu device, as reported by the olt (e.g. 5302). It is not the me profile the managed resource is configured with (e.g. zhone-5302), but it is the only information about the onu hardware the olt exposes.

The following implements statements select implementations for this entity:

  • constraint true

entity dzs::OnuPortBridge

Parents: dzs::BaseResource

The bridge used to configure the uplink of a onu, for a specific port. The bridge is identified in the model by the serial/regid of the onu, and the port we want to setup connectivity for, and in the handler, we use the resolved onu_id of the attached onu resource. This allows us to find the bridge in use by a device even if it has been created for a different vlan/slan pair, or different rules, members, etc.

It is the bridge for the traffic which is not tagged with a vlan on the port of the onu (no uni vlan, or priority tagged), a port has a single one. The bridges a port can have on top of it for tagged traffic, one for each uni vlan, are not managed by this entity and are left alone. The handler fails when the port has several bridges for untagged traffic.

attribute string name
attribute int vlan

Vlan to use for the bridge

attribute int slan

Slan to use for the bridge

attribute int eth_port

Ethernet port for the bridge

attribute int gtp

GTP number

attribute dzs::encapsulation_t encapsulation

Encapsulation mode “tagged” or “stagged”

attribute bool rg_bridged

If the bridge needs to be rg bridged

attribute bool uni_vlan_priority_tagged

If the bridge needs to use prority tagged uni vlan

relation dzs::Onu onu [1]
relation dzs::Rule ingress_packet_rule [1]
relation dzs::Rule egress_packet_rule [1]

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity dzs::OnuPortBridgeDiscovery

Parents: dzs::BaseDiscovery

A resource that will discover the bridges dzs::OnuPortBridge can manage: for each port of the onus registered on the device, its bridge for the traffic which is not tagged with a vlan on the port. The bridges for tagged traffic are not reported, and a port with several bridges for untagged traffic is skipped.

The following implements statements select implementations for this entity:

  • constraint true

entity dzs::OnuPorts

Parents: dzs::BaseResource

Entity representing all the physical ports of an onu

attribute int[] enabled_ports

List of the port that needs to be up, all the other will be down

attribute int attempts=4

The number of time the handler should try to show the port status before skipping/failing. An exponential backoff (base of 2 seconds) is implemented to space the attempts.

attribute bool skip_if_not_found=true

When true, and the handler can not verify the status of the onu ports (because the onu is down), skip the resource instead of failing.

attribute bool suppress_read_error=false

When true, and the handler can not verify the status of the onu ports (because the onu is down), finish the resource execution with success. It goes before the skip_if_not_found

relation dzs::Onu onu [1]

other end: dzs::Onu.ports [0:1]

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity dzs::OnuPortsDiscovery

Parents: dzs::BaseDiscovery

A resource that will discover the state of the physical ports of all the onus registered on the device.

The following implements statements select implementations for this entity:

  • constraint true

entity dzs::OnuSearch

Parents: std::Resource

Search for an onu (registered with its serial number) which is not on its expected olt port. The search runs its discoveries, all together, and waits for them to finish. When the onu is not found by any of them, it does the same with its neighbor discoveries. When one of them found the onu, the search succeeds, its logs say where the onu was found. Otherwise it fails or skips, listing where it looked.

A discovery which succeeded less than max_discovery_age seconds ago is not run again, the search uses its last results, so that the searches of several onus at once (e.g. after an olt reboot) share the runs of their discoveries. A discovery which is already running is not run again either, the search waits for the run in progress. A discovery which doesn’t exist, fails or doesn’t finish in time is reported as not searched.

The onu requires its search, unless it is purged: a failed search blocks the onu, and a successful one sends it an event.

Requires an orchestrator with the deploy_filtered api (iso9+).

attribute string agent_name

The agent running the search. It waits for the discoveries, so it can not be the agent of any of them.

attribute string[] discoveries

The resource ids of the dzs::OnuDiscovery resources to search with first, e.g. the one of the olt of the onu.

attribute string[] neighbor_discoveries=List()

The resource ids of the dzs::OnuDiscovery resources to search with when the onu is not found by the first ones, e.g. the ones of the neighboring olts.

attribute bool skip_if_not_found=false

When the onu is not found, skip the search instead of failing it.

attribute int discovery_timeout=600

How long, in seconds, to wait for the discoveries of each stage of the search to finish.

attribute int max_discovery_age=300

How old, in seconds, the last successful run of a discovery can be for the search to use its results instead of running it again. 0 always runs the discoveries. :rel onu: The onu to search for.

relation dzs::Onu onu [1]

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity dzs::Rule

Parents: dzs::BaseResource

Entity representing a Rule on the device

attribute int group_index

group identifier of the rule

attribute int member_index

member identifier of the rule

attribute dzs::access_type_t? access_type=null

Authentication type to use for this rule “PPPoE” or “DHCP”

attribute string? access_type_code

Authentication code to use, set by the model

attribute dzs::rule_name_t? name=null

Name of the rule

attribute dzs::cli_word_t? filter='FFL/$SystemName/$Shelf/$Slot/$Port:$Vlan'

Filter of the rule

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity dzs::RuleDiscovery

Parents: dzs::BaseDiscovery

A resource that will discover all the rules of the device which this module can manage, i.e. the rules whose access type is one of the access types supported by the dzs::Rule entity.

The following implements statements select implementations for this entity:

  • constraint true

Implementations

implementation dzs::assert_values
implementation dzs::bridge_references
implementation dzs::facts
implementation dzs::get_access_type_code
implementation dzs::phys_port_basic_config

Plugins

dzs.create_fact_reference(resource: typing.Annotated[inmanta.execute.proxy.DynamicProxy, ModelType(model_type='std::Resource')], fact_name: <class 'str'>) → <class 'inmanta_plugins.dzs.FactReference'>

Create a fact reference :param resource: The resource that contains the fact :param fact_name: The name of the fact :return: A reference to what can be resolved to a string

if context.refs exists it means that some facts might be mocked, so we pass them to the FactReference

Resources

class dzs.resource.Onu
class dzs.discovery.OnuDiscovery
class dzs.resource.OnuPortBridge
class dzs.discovery.OnuPortBridgeDiscovery
class dzs.resource.OnuPorts
class dzs.discovery.OnuPortsDiscovery
class dzs.search.OnuSearch
class dzs.resource.Rule
class dzs.discovery.RuleDiscovery

Handlers

class dzs.resource.OnuHandler
class dzs.resource.RuleHandler
class dzs.resource.OnuPortBridgeHandler
class dzs.resource.OnuPortsHandler
class dzs.discovery.OnuDiscoveryHandler
class dzs.discovery.RuleDiscoveryHandler
class dzs.discovery.OnuPortBridgeDiscoveryHandler
class dzs.discovery.OnuPortsDiscoveryHandler
class dzs.search.OnuSearchHandler