Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
AS Path model
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishal Chavan committed Apr 19, 2024
1 parent 2c49ba8 commit 4c38a7e
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 Cisco Systems, Inc. and its affiliates

from typing import List, Literal

from pydantic import AliasPath, BaseModel, ConfigDict, Field

from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase


class AsPathEntry(BaseModel):
model_config = ConfigDict(populate_by_name=True)
as_path: Global[str] = Field(validation_alias="asPath", serialization_alias="asPath")


class AsPath(_ParcelBase):
type_: Literal["as-path"] = Field(default="as-path", exclude=True)
as_path_list_num: Global[int] = Field(validation_alias=AliasPath("data", "asPathListNum"))
entries: List[AsPathEntry] = Field(validation_alias=AliasPath("data", "entries"))

0 comments on commit 4c38a7e

Please sign in to comment.