BGP Extended Community Data Type
A bgp_ext_community data type tests data for being an instance of
python's built-in class str and if it represents a BGP extended standard community (6 bytes).
Features/Limitations
- Validate BGP Extended Community format
- Supports BGP Extended Community format conversion
- Validate BGP Extended Community specific attributes
- Validate against allowed and not allowed BGP Extended Communities
- Supports Referencing Feature
BGP Extended Community Definition Syntax
Table
| Key/Option | Type | Default Value | Restrictions | Description |
|---|---|---|---|---|
| type | str |
'bgp_ext_community' | ||
| description | str |
Data type description | ||
| default_value | Must match data type's type(s) | Value used to set as default value | ||
| allowed_ranges | list[dict] |
min length: 1 | Value must be within defined ranges | |
| - start | str |
required | ||
| end | str |
required | ||
| not_allowed_ranges | list[dict] |
Value mustn't be within defined ranges | ||
| - start | str |
required | ||
| end | str |
required | ||
| allowed_values | list |
Data must match one of these values | ||
| - < value > | str |
Must match data type's type(s) | ||
| not_allowed_values | list |
Data mustn't match all of these values | ||
| - < value > | str |
Must match data type's type(s) | ||
| format | enum |
allowed_values: - asn - ip-address |
- asn example: 65500:33 - ip-address example: 1.1.1.1:33 |
|
| convert_to_format | enum |
allowed_values: - asn - ip-address |
||
| template | str |
must be definded in schema | Merge options from this template | |
| template_merge_options | dict |
Define schema-global template merge instructions | ||
| recursive | bool |
True |
Merge data type definition options in template options recursively. If false, data type defintion options overwrites template options. |
|
| list_merge | str |
append_rp | Allowed values: - append - append_rp - prepend - prepend_rp - replace |
How lists within options data should be merged. |
| reference | dict|str |
|||
| option 1 | str |
Reference keys (implies unique global mode) | ||
| option 2 | dict |
|||
| key | str |
required | ||
| mode | str |
Allowed values: - unique - producer - consumer |
||
| unique_scope | str |
Allowed values: - global - namespace |
||
| producer_scope | str |
Allowed values: - global - namespace |
||
| consumer_scope | str |
Allowed values: - global - namespace |
||
| allow_orphan_producer | bool |
True |
||
| credit | int |
1 (if mode consumer) | min: 0 | |
| references | list[dict|str] |
|||
| - |
dict|str |
|||
| option 1 | str |
Reference keys (implies unique global mode) | ||
| option 2 | dict |
|||
| key | str |
required | ||
| mode | str |
Allowed values: - unique - producer - consumer |
||
| unique_scope | str |
Allowed values: - global - namespace |
||
| producer_scope | str |
Allowed values: - global - namespace |
||
| consumer_scope | str |
Allowed values: - global - namespace |
||
| allow_orphan_producer | bool |
True |
||
| credit | int |
1 (if mode consumer) | min: 0 | |
| doc_value_name | str |
Set value name for documentation |
YAML
type: bgp_ext_community
description: <str>
default_value: <default_value>
allowed_ranges:
- start: <str>
end: <str>
not_allowed_ranges:
- start: <str>
end: <str>
allowed_values:
- <str>
not_allowed_values:
- <str>
format: <asn|ip-address>
convert_to_format: <asn|ip-address>
template: <str>
template_merge_options:
recursive: <true|false>
list_merge: <append|append_rp|prepend|prepend_rp|replace>
reference: <reference_definition>
# Multitype!!!
<str>
# or:
key: <str>
mode: <unique|producer|consumer>
unique_scope: <global|namespace>
producer_scope: <global|namespace>
consumer_scope: <global|namespace>
allow_orphan_producer: <true|false>
credits: <int>
references:
- <reference_definition>
# Multitype!!!
<str>
# or
key: <str>
mode: <unique|producer|consumer>
unique_scope: <global|namespace>
producer_scope: <global|namespace>
consumer_scope: <global|namespace>
allow_orphan_producer: <true|false>
credits: <int>
doc_value_name: <str>
Example
type: bgp_ext_community
description: "Example bgp_ext_community definition"
default_value: 10.0.0.1:33
format: ip-address
convert_to_format: asn
not_allowed_values:
- 10.0.0.0:1
not_allowed_ranges:
- start: 11.0.0.0:0
end: 11.255.255.255:65535
reference: ref_key