Add to documentation: new subsection to "Making changes to IRR objects" #741
dhutchin-ctl
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Below are some notes that might be added as a sub-section to “Making changes to IRR objects” in the documentation. There are two places where I added a double ‘?’ as a point that needs more input. And of particular note is how continuation lines disable some of the processing.
Notes on change submission are processed
There are three ways of submitting objects to IRR:
Each submission is validated. The rules for validation are extensive:
Internally (in the database) the IRR object data is kept in two different formats, one is “object_text” which is the straight text form (same as returned by whois queries,etc), the other is as parsed data stored in a JSON string in “parsed_data”.
When creating or modifying an object by submitting the new data via email or via http to /v1/submit specifying “object_text”, the submitted data is stored as-is in the “object_text” column of the object database with the following exceptions:
Example:
Submitted via http:///v1/submit
Or, submitted via email
The object_text column becomes:
and the parsed_data column as JSON is:
{"descr": ["abcde, 1234", "1a2b3c, a1b2, c3"], "mnt-by": ["DIP-MNT"], "source": "LEVEL3", "tech-c": ["SAMSMITH-LEVEL3"], "admin-c": ["SAMSMITH-LEVEL3"], "changed": ["[email protected] 20220524", "[email protected] 20220525"], members": ["1.2.3.0/24", "1.2.4.0/24", "1.2.5.0/24", "1.2.6.0/24", "1.2.7.0/24", "1.2.8.0/24", "1.2.9.0/24"], "remarks": ["first of line1, 2nd of line1", "first of line2, 2nd of line2", "line3 first part, line3 2nd part"], "route-set": "RS-ABC1", "mp-members": ["dead:beaf::/124", "beaf:dead::/124", "deef:beaf::/124"]}
Notice the extra spaces stored in the object_text for mp-members because there is a continuation line and that those spaces are removed in the parsed_data. For consistency’s sake, it might be a good idea to never use continuations lines.
When creating or modifying an object via http to /v1/submit with attributes, each attribute’s value can be either a string or an array of strings. The “value” of each attribute/value pair is used to create a new line in the object_text column’s string and either a new attribute/value pair in the parsed_data JSON’s hash (for attributes that take a single value), or a new array element for attributes that take multiple values. The new line, or the new array element is the value of the submitted attribute/value pair if the value is a string, and the concatenation of the all elements with a comma if the value is an array.
Example:
Submitted via http:///v1/submit
Produces a parsed_data column of:
{"descr": ["abcde, 1234", "1a2b3c, a1b2, c3", "3, element, array, merged"], "mnt-by": ["DIP-MNT"], "source": "LEVEL3", "tech-c": ["SAMSMITH-LEVEL3"], "admin-c": ["SAMSMITH-LEVEL3"], "changed": ["[email protected] 20220524", "[email protected] 20220525"] members": ["1.2.3.0/24", "1.2.4.0/24", "1.2.5.0/24", "1.2.6.0/24", "1.2.7.0/24", "1.2.8.0/24", "1.2.9.0/24"], "remarks": ["first of line1, 2nd of line1", "first of line2, 2nd of line2", "line3 first part, line3 2nd part"], "route-set": "RS-ABC2", "mp-members": ["dead:beaf::/124", "beaf:dead::/124", "deef:beaf::/124"]}
Notice how the third “descr” attribute has the specified array of three element merged into a single string.
Beta Was this translation helpful? Give feedback.
All reactions