BGP AS Number Data Type

A bgp_as data type tests data for being an instance of python's built-in class str or int and if it represents a BGP AS number.

Features/Limitations

  • Validate BGP AS format
  • Supports BGP AS format conversion
  • Validate BGP AS specific attributes
  • Validate against allowed and not allowed BGP AS numbers
  • Supports Referencing Feature

BGP AS Number Definition Syntax

Table

Key/Option Type Default Value Restrictions Description
type str 'bgp_as'
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 int|str required
    end int|str required
not_allowed_ranges list[dict] Value mustn't be within defined ranges
  - start int|str required
    end int|str required
allowed_values list Data must match one of these values
  - < value > int|str Must match data type's type(s)
not_allowed_values list Data mustn't match all of these values
  - < value > int|str Must match data type's type(s)
format enum allowed_values:
  - asplain
  - asdot
  - string
- asplain example: 100100
- asdot example: 100.100
- string example: '100100'
public bool BGP AS must be a public (true) or private (false) number
convert_to_format enum allowed_values:
  - asplain
  - asdot
  - string
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_as
description: <str>
default_value: <default_value>

allowed_ranges:
 - start: <int|str>
   end: <int|str>
not_allowed_ranges:
 - start: <int|str>
   end: <int|str>
allowed_values:
  - <int|str>
not_allowed_values:
  - <int|str>
format: <asplain|asdot|string>
public: <true|false>
convert_to_format: <asplain|asdot|string>

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_as
description: "Example bgp_as definition"
default_value: 100111

format: asplain
public: false
4_byte: true
convert_to_format: asdot

not_allowed_values:
  - 100222

not_allowed_ranges:
  - start: 123000
    end: 125000

reference: ref_key