Skip to content
Open
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
10 changes: 10 additions & 0 deletions plugins/module_utils/models/interfaces/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ class AccessVpcHostPolicyTypeEnum(str, Enum):
ACCESS_VPC_HOST = "accessVpcHost"


class TrunkVpcHostPolicyTypeEnum(str, Enum):
"""
# Summary

Policy type for vPC trunk host interfaces (`int_vpc_trunk_host` template).
"""

TRUNK_VPC_HOST = "trunkVpcHost"


class BpduFilterEnum(str, Enum):
"""
# Summary
Expand Down
601 changes: 601 additions & 0 deletions plugins/module_utils/models/interfaces/vpc_trunk_host_interface.py

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions plugins/module_utils/orchestrators/vpc_trunk_host_interface.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright: (c) 2026, Allen Robel (@allenrobel)

# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)

"""
vPC trunkVpcHost interface orchestrator for Nexus Dashboard.

This module provides `TrunkVpcHostInterfaceOrchestrator`, which manages CRUD operations for vPC
`trunkVpcHost` interfaces. It inherits all shared vPC logic from `VpcBaseOrchestrator` and only
defines the model class and managed policy types.
"""

from __future__ import annotations

from typing import ClassVar, Type

from ansible_collections.cisco.nd.plugins.module_utils.models.base import NDBaseModel
from ansible_collections.cisco.nd.plugins.module_utils.models.interfaces.enums import TrunkVpcHostPolicyTypeEnum
from ansible_collections.cisco.nd.plugins.module_utils.models.interfaces.vpc_trunk_host_interface import (
TrunkVpcHostInterfaceModel,
)
from ansible_collections.cisco.nd.plugins.module_utils.orchestrators.vpc_base import VpcBaseOrchestrator


class TrunkVpcHostInterfaceOrchestrator(VpcBaseOrchestrator):
"""
# Summary

Orchestrator for vPC `trunkVpcHost` interface CRUD operations on Nexus Dashboard.

Inherits all shared vPC logic from `VpcBaseOrchestrator`. Defines `model_class` as
`TrunkVpcHostInterfaceModel` and manages the `trunkVpcHost` policy type.

## Raises

### RuntimeError

- Via inherited methods. See `VpcBaseOrchestrator` for full details.
"""

model_class: ClassVar[Type[NDBaseModel]] = TrunkVpcHostInterfaceModel

def _managed_policy_types(self) -> set[str]:
"""
# Summary

Return the set of API-side policy type values managed by this orchestrator.

## Raises

None
"""
return {e.value for e in TrunkVpcHostPolicyTypeEnum}
Loading