@@ -596,6 +596,99 @@ cumulus@switch:~$ curl -u 'cumulus:cumulus' --insecure https://127.0.0.1:8765/n
596596...
597597```
598598
599+ ### Reserved Characters in cURL
600+
601+ If you use a reserved character from the following table in the cURL URI, you need to encode it with a percent.
602+
603+ {{<img src = " /images/cumulus-linux/curl-reserved.png " >}}
604+
605+ {{%notice note%}}
606+ Percent encoding for the space character is %20.
607+ {{%/notice%}}
608+
609+ You can run the following python line of code that percent encodes the reserved character instead of manually encoding it.
610+
611+ In the following example, the python line of code percent encodes the colons (:) in the URI.
612+
613+ ```
614+ cumulus@switch:~$ PREFIX=$(python3 -c 'import urllib.parse; print(urllib.parse.quote("[144.2.1.2:6]:[5]:[0]:[2050:1:1:1::122/128]", safe=":"))')
615+ ```
616+
617+ ```
618+ cumulus@switch:~$ curl -k -u 'cumulus:NvidiaR0cks!' -X GET "https://localhost:8765//nvue_v1/vrf/default/router/bgp
619+ /address-family/l2vpn-evpn/route/${PREFIX}"
620+ {
621+ "advertised-to": {
622+ "swp1": {
623+ "hostname": "spine-1"
624+ },
625+ "swp2": {
626+ "hostname": "spine-2"
627+ },
628+ "swp3": {
629+ "hostname": "bordertor-11"
630+ },
631+ "swp4": {
632+ "hostname": "bordertor-12"
633+ }
634+ },
635+ "ethernet-tag": 0,
636+ "evpn-prefix-str": "[5]:[0]:[128]:[2050:1:1:1::122]",
637+ "ip": "2050:1:1:1::122",
638+ "path": {
639+ "1": {
640+ "aspath": {
641+ "650000": {}
642+ },
643+ "bestpath": {
644+ "from-as": 650000,
645+ "overall": "yes",
646+ "selection-reason": "First path received"
647+ },
648+ "ext-community": {
649+ "RT:60176:104001 ET:8 Rmac:00:01:00:00:02:08": {}
650+ },
651+ "flags": {
652+ "bestpath": {},
653+ "valid": {}
654+ },
655+ "flags-string": "*v",
656+ "last-update-time": 5265,
657+ "metric": 0,
658+ "nexthop": {
659+ "1": {
660+ "accessible": "on",
661+ "afi": "ipv4",
662+ "ip": "6.0.0.2",
663+ "metric": 0,
664+ "used": "on"
665+ }
666+ },
667+ "nexthop-count": 1,
668+ "origin": "IGP",
669+ "path-from": "external",
670+ "peer": {
671+ "hostname": "bordertor-12",
672+ "id": "fe80::202:ff:fe00:8",
673+ "interface": "swp4",
674+ "router-id": "6.0.0.2",
675+ "type": "external"
676+ },
677+ "valid": "on",
678+ "vni": {
679+ "104001": {}
680+ }
681+ }
682+ },
683+ "path-count": 1,
684+ "prefix": "2050:1:1:1::122/128",
685+ "rd": "144.2.1.2:6",
686+ "route-type": "5"
687+ }
688+ ```
689+
690+ To percent encode more than one reserved character with the python line of code, use a comma separated list.
691+
599692## API Use Cases
600693
601694The following examples show the primary API uses cases.
0 commit comments