|
| 1 | +aci2dot converts JSON formatted Cisco ACI policy files or snippets to a DOT graph format. |
| 2 | + |
| 3 | +``` |
| 4 | +./aci2dot.py --help |
| 5 | +usage: aci2dot.py [-h] [--nr] [--na] [--write] |
| 6 | + [--stdout | --dot {svg,png,pdf}] |
| 7 | + policy_file |
| 8 | +
|
| 9 | +Create DOT formatted Graph from JSON formatted ACI policy export. |
| 10 | +
|
| 11 | +positional arguments: |
| 12 | + policy_file JSON ACI Policy Filename |
| 13 | +
|
| 14 | +optional arguments: |
| 15 | + -h, --help show this help message and exit |
| 16 | + --nr Suppress redundant children |
| 17 | + --na Don't show attributes |
| 18 | + --write Write config template to .aci2dot and exit |
| 19 | + --stdout Write to STDOUT instead of to file |
| 20 | + --dot {svg,png,pdf} Also write SVG/PNG/PDF. 'dot' needs to be installed. |
| 21 | +``` |
| 22 | + |
| 23 | +For example: |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +was rendered from: |
| 28 | + |
| 29 | +```json |
| 30 | +{ |
| 31 | + "polUni": { |
| 32 | + "attributes": { |
| 33 | + "status": "created,modified" |
| 34 | + }, |
| 35 | + "children": [{ |
| 36 | + "fabricInst": { |
| 37 | + "attributes": { |
| 38 | + "status": "created,modified" |
| 39 | + }, |
| 40 | + "children": [{ |
| 41 | + "bgpInstPol": { |
| 42 | + "attributes": { |
| 43 | + "status": "created,modified", |
| 44 | + "ownerKey": "", |
| 45 | + "name": "default", |
| 46 | + "descr": "Default BGP Policy", |
| 47 | + "nameAlias": "", |
| 48 | + "ownerTag": "", |
| 49 | + "annotation": "" |
| 50 | + }, |
| 51 | + "children": [{ |
| 52 | + "bgpAsP": { |
| 53 | + "attributes": { |
| 54 | + "status": "created,modified", |
| 55 | + "name": "", |
| 56 | + "descr": "", |
| 57 | + "asn": "100", |
| 58 | + "nameAlias": "", |
| 59 | + "annotation": "" |
| 60 | + } |
| 61 | + } |
| 62 | + }, { |
| 63 | + "bgpExtRRP": { |
| 64 | + "attributes": { |
| 65 | + "status": "created,modified", |
| 66 | + "annotation": "", |
| 67 | + "name": "", |
| 68 | + "descr": "", |
| 69 | + "nameAlias": "" |
| 70 | + } |
| 71 | + } |
| 72 | + }, { |
| 73 | + "bgpRRP": { |
| 74 | + "attributes": { |
| 75 | + "status": "created,modified", |
| 76 | + "annotation": "", |
| 77 | + "name": "", |
| 78 | + "descr": "", |
| 79 | + "nameAlias": "" |
| 80 | + }, |
| 81 | + "children": [{ |
| 82 | + "bgpRRNodePEp": { |
| 83 | + "attributes": { |
| 84 | + "status": "created,modified", |
| 85 | + "descr": "", |
| 86 | + "podId": "1", |
| 87 | + "annotation": "", |
| 88 | + "nameAlias": "", |
| 89 | + "id": "1101" |
| 90 | + } |
| 91 | + } |
| 92 | + }, { |
| 93 | + "bgpRRNodePEp": { |
| 94 | + "attributes": { |
| 95 | + "status": "created,modified", |
| 96 | + "descr": "", |
| 97 | + "podId": "1", |
| 98 | + "annotation": "", |
| 99 | + "nameAlias": "", |
| 100 | + "id": "1102" |
| 101 | + } |
| 102 | + } |
| 103 | + }] |
| 104 | + } |
| 105 | + }] |
| 106 | + } |
| 107 | + }] |
| 108 | + } |
| 109 | + }, { |
| 110 | + "infraInfra": { |
| 111 | + "attributes": { |
| 112 | + "status": "created,modified" |
| 113 | + } |
| 114 | + } |
| 115 | + }] |
| 116 | + } |
| 117 | +} |
| 118 | +``` |
0 commit comments