Difference between revisions of "ONE/Restconf Lisp Guide"

From fd.io
< ONE
Jump to: navigation, search
(Restconf Lisp Guide)
(Lisp -> Pitr Cfg)
 
(29 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
=== Restconf Calls ===
 
=== Restconf Calls ===
  
=== Lisp ===
+
==== Lisp ====
<b>Vpp alternative - </b> vpp# lisp enable/disable
+
===== Write =====
 
+
 
This call will enable/disable Lisp feature.
 
This call will enable/disable Lisp feature.
  
Line 21: Line 20:
 
</pre>
 
</pre>
  
To read data written by this call
+
===== Read - Config =====
 
+
<b>Honeycomb</b>
+
 
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp</pre>
 
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp</pre>
  
<b>Vpp</b>
+
===== Read - Operational =====
<pre>GET http://localhost:8181/restconf/operational/lisp:lisp-state</pre>
+
<pre>GET - http://localhost:8181/restconf/operational/lisp:lisp-state</pre>
  
==== Map Resolver ====
+
===== Delete =====
 +
<pre>DELETE- http://localhost:8181/restconf/config/lisp:lisp</pre>
 +
 
 +
----
 +
 
 +
==== Lisp -> Map Resolver ====
 +
===== Write =====
 +
 
 +
<pre>PUT - http://localhost:8181/restconf/config/lisp:lisp/map-resolvers/map-resolver/192.168.2.1</pre>
 +
<pre>
 +
{
 +
  "map-resolver":{
 +
      "ip-address":"192.168.2.1"
 +
  }
 +
}
 +
</pre>
 +
 
 +
===== Read - Config =====
 +
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp/map-resolvers/map-resolver/192.168.2.1</pre>
 +
 
 +
===== Read - Operational=====
 +
<pre>GET - http://localhost:8181/restconf/operational/lisp:lisp-state/map-resolvers/map-resolver/192.168.2.1</pre>
 +
 
 +
===== Delete =====
 +
<pre>DELETE - http://localhost:8181/restconf/config/lisp:lisp/map-resolvers/map-resolver/192.168.2.1</pre>
 +
 
 +
----
 +
 
 +
==== Lisp -> Locator Set ====
 +
===== Write =====
 +
<pre>PUT - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1</pre>
 +
<pre>
 +
{
 +
    "locator-set":{
 +
        "name":"loc_1"
 +
    }
 +
}
 +
</pre>
 +
 
 +
===== Read - Config =====
 +
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1</pre>
 +
 
 +
===== Read - Operational =====
 +
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp-state/locator-sets/locator-set/loc_1</pre>
 +
 
 +
===== Delete =====
 +
<pre>DELETE - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1</pre>
 +
 
 +
----
 +
 
 +
==== Lisp -> Locator Set -> Locator ====
 +
===== Write =====
 +
<pre>PUT - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1/interface/interface/local0</pre>
 +
<pre>
 +
{
 +
    "interface":{
 +
        "interface-ref":"local0",
 +
        "priority":"2",
 +
        "weight":"1"
 +
    }
 +
}
 +
</pre>
 +
 
 +
===== Read - Config =====
 +
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1/interface/interface/local0</pre>
 +
 
 +
===== Read - Operational =====
 +
<pre>GET - http://localhost:8181/restconf/operational/lisp:lisp-state/locator-sets/locator-set/loc_1/interface/interface/local0</pre>
 +
 
 +
===== Delete =====
 +
<pre>DELETE - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1/interface/interface/local0</pre>
 +
 
 +
----
 +
 
 +
==== Lisp -> Eid Table -> Vni Table ====
 +
 
 +
===== Write =====
 +
<pre>PUT - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12</pre>
 +
<pre>
 +
{
 +
    "vni-table":{
 +
        "virtual-network-identifier":"12",
 +
        "table-id":"10"
 +
    }
 +
}
 +
</pre>
 +
 
 +
===== Read - Config =====
 +
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12</pre>
 +
 
 +
===== Read - Operational =====
 +
<pre>GET - http://localhost:8181/restconf/operational/lisp:lisp-state/eid-table/vni-table/12</pre>
 +
 
 +
===== Delete =====
 +
<pre>DELETE - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12</pre>
 +
 
 +
----
 +
 
 +
==== Lisp -> Eid Table -> Vni Table -> Local Mapping ====
 +
===== Write =====
 +
To be able to write such data, the refferenced locator-set must exist.
 +
For eid's, only ipv4/ipv6/mac are currently supported,more variants will be implemented in future.
 +
<pre>PUT - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/local-mappings/local-mapping/loc_map_1</pre>
 +
<pre>
 +
{
 +
    "local-mapping":{
 +
        "id":"loc_map_1",
 +
        "eid":{
 +
            "address-type":"ietf-lisp-address-types:ipv4-afi",
 +
            "virtual-network-id":"12",
 +
            "ipv4":"192.168.2.1"
 +
        },
 +
        "locator-set":"loc_1"
 +
    }
 +
}
 +
</pre>
 +
 
 +
===== Read - Config =====
 +
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/local-mappings/local-mapping/loc_map_1</pre>
 +
 
 +
===== Read - Operational =====
 +
<pre>GET - http://localhost:8181/restconf/operational/lisp:lisp-state/eid-table/vni-table/12/local-mappings/local-mapping/loc_map_1</pre>
 +
 
 +
===== Delete =====
 +
<pre>DELETE - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/local-mappings/local-mapping/loc_map_1</pre>
 +
----
 +
 
 +
==== Lisp -> Eid Table -> Vni Table -> Remote Mapping - > Negative Mapping ====
 +
===== Write =====
 +
<pre>PUT - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_1</pre>
 +
<pre>
 +
{
 +
    "remote-mapping":{
 +
        "id":"remote_map_1",
 +
        "eid":{
 +
            "address-type":"ietf-lisp-address-types:ipv4-afi",
 +
            "virtual-network-id":"12",
 +
            "ipv4":"192.168.2.2"
 +
        },
 +
        "map-reply-action":"no-action"
 +
    }
 +
}
 +
</pre>
 +
 
 +
===== Read - Config =====
 +
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_1</pre>
 +
 
 +
===== Read - Operational =====
 +
<pre>GET - http://localhost:8181/restconf/operational/lisp:lisp-state/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_1</pre>
 +
 
 +
===== Delete =====
 +
<pre>DELETE - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_1</pre>
 +
 
 +
----
 +
 
 +
==== Lisp -> Eid Table -> Vni Table -> Remote Mapping - > Positive Mapping ====
 +
===== Write =====
 +
<pre>PUT - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_2</pre>
 +
<pre>
 +
{
 +
    "remote-mapping":{
 +
        "id":"remote_map_2",
 +
        "eid":{
 +
            "address-type":"ietf-lisp-address-types:ipv4-afi",
 +
            "virtual-network-id":"12",
 +
            "ipv4":"192.168.2.3"
 +
        },
 +
   
 +
        "rlocs":{
 +
            "locator":{
 +
                "address":"192.168.2.4",
 +
                "priority":1,
 +
                "weight":1
 +
            }
 +
        }
 +
       
 +
    }
 +
}
 +
</pre>
 +
 
 +
===== Read - Config =====
 +
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_2</pre>
 +
 
 +
===== Read - Operational =====
 +
<pre>GET - http://localhost:8181/restconf/operational/lisp:lisp-state/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_2</pre>
 +
 
 +
===== Delete =====
 +
<pre>DELETE - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_2</pre>
 +
 
 +
----
 +
 
 +
==== Lisp -> Eid Table -> Vni Table -> Adjacencies ====
 +
 
 +
To be able to write such data, both local and remote eids must have mappings existing to them
 +
 
 +
===== Write =====
 +
<pre>PUT - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/adjacencies/adjacency/1</pre>
 +
<pre>
 +
{
 +
    "adjacency":{
 +
        "id":"1",
 +
        "local-eid":{
 +
            "address-type":"ietf-lisp-address-types:ipv4-afi",
 +
            "virtual-network-id":"12",
 +
            "ipv4":"192.168.2.1"
 +
        },
 +
        "remote-eid":{
 +
            "address-type":"ietf-lisp-address-types:ipv4-afi",
 +
            "virtual-network-id":"14",
 +
            "ipv4":"192.168.2.2"
 +
        }
 +
    }
 +
}
 +
</pre>
 +
 
 +
===== Read - Config =====
 +
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/adjacencies/adjacency/1</pre>
 +
 
 +
===== Read - Operational =====
 +
<pre>GET - http://localhost:8181/restconf/operational/lisp:lisp-state/eid-table/vni-table/12/adjacencies/adjacency/1</pre>
 +
 
 +
===== Delete =====
 +
<pre>DELETE - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/adjacencies/adjacency/1</pre>
 +
 
 +
 
 +
----
 +
 
 +
==== Lisp -> Pitr Cfg ====
 +
 
 +
To write such data, referenced locator set must be existing
 +
 
 +
===== Write =====
 +
<pre>PUT - http://localhost:8181/restconf/config/lisp:lisp/pitr-cfg</pre>
 +
<pre>
 +
{
 +
    "pitr-cfg":{
 +
        "locator-set":"loc_1"
 +
    }
 +
}
 +
</pre>
  
==== Locator Set ====
+
===== Read - Config =====
 +
<pre>GET - http://localhost:8181/restconf/config/lisp:lisp/pitr-cfg</pre>
  
==== Eid Table ====
+
===== Read - Operational =====
 +
<pre>GET - http://localhost:8181/restconf/operational/lisp:lisp-state/pitr-cfg</pre>
  
==== Pitr Cfg ====
+
===== Delete =====
 +
<pre>DELETE http://localhost:8181/restconf/config/lisp:lisp/pitr-cfg</pre>

Latest revision as of 08:14, 19 August 2016

Restconf Lisp Guide

This guide is showing how to use Lisp with Honeycomb/Vpp.

Restconf Calls

Lisp

Write

This call will enable/disable Lisp feature.

PUT - http://localhost:8181/restconf/config/lisp:lisp
{
    "lisp":{
        "enable":"true"
    }    
}
Read - Config
GET - http://localhost:8181/restconf/config/lisp:lisp
Read - Operational
GET - http://localhost:8181/restconf/operational/lisp:lisp-state
Delete
DELETE- http://localhost:8181/restconf/config/lisp:lisp

Lisp -> Map Resolver

Write
PUT - http://localhost:8181/restconf/config/lisp:lisp/map-resolvers/map-resolver/192.168.2.1
{
   "map-resolver":{
       "ip-address":"192.168.2.1"
   }
}
Read - Config
GET - http://localhost:8181/restconf/config/lisp:lisp/map-resolvers/map-resolver/192.168.2.1
Read - Operational
GET - http://localhost:8181/restconf/operational/lisp:lisp-state/map-resolvers/map-resolver/192.168.2.1
Delete
DELETE - http://localhost:8181/restconf/config/lisp:lisp/map-resolvers/map-resolver/192.168.2.1

Lisp -> Locator Set

Write
PUT - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1
{
    "locator-set":{
        "name":"loc_1"
    }
}
Read - Config
GET - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1
Read - Operational
GET - http://localhost:8181/restconf/config/lisp:lisp-state/locator-sets/locator-set/loc_1
Delete
DELETE - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1

Lisp -> Locator Set -> Locator

Write
PUT - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1/interface/interface/local0
{
     "interface":{
         "interface-ref":"local0",
         "priority":"2",
         "weight":"1"
     }
}
Read - Config
GET - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1/interface/interface/local0
Read - Operational
GET - http://localhost:8181/restconf/operational/lisp:lisp-state/locator-sets/locator-set/loc_1/interface/interface/local0
Delete
DELETE - http://localhost:8181/restconf/config/lisp:lisp/locator-sets/locator-set/loc_1/interface/interface/local0

Lisp -> Eid Table -> Vni Table

Write
PUT - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12
{
    "vni-table":{
        "virtual-network-identifier":"12",
        "table-id":"10"
    }
}
Read - Config
GET - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12
Read - Operational
GET - http://localhost:8181/restconf/operational/lisp:lisp-state/eid-table/vni-table/12
Delete
DELETE - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12

Lisp -> Eid Table -> Vni Table -> Local Mapping

Write

To be able to write such data, the refferenced locator-set must exist. For eid's, only ipv4/ipv6/mac are currently supported,more variants will be implemented in future.

PUT - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/local-mappings/local-mapping/loc_map_1
{
    "local-mapping":{
        "id":"loc_map_1",
        "eid":{
            "address-type":"ietf-lisp-address-types:ipv4-afi",
            "virtual-network-id":"12",
            "ipv4":"192.168.2.1"
        },
        "locator-set":"loc_1"
    }
}
Read - Config
GET - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/local-mappings/local-mapping/loc_map_1
Read - Operational
GET - http://localhost:8181/restconf/operational/lisp:lisp-state/eid-table/vni-table/12/local-mappings/local-mapping/loc_map_1
Delete
DELETE - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/local-mappings/local-mapping/loc_map_1

Lisp -> Eid Table -> Vni Table -> Remote Mapping - > Negative Mapping

Write
PUT - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_1
{
    "remote-mapping":{
        "id":"remote_map_1",
        "eid":{
            "address-type":"ietf-lisp-address-types:ipv4-afi",
            "virtual-network-id":"12",
            "ipv4":"192.168.2.2"
        },
        "map-reply-action":"no-action"
    }
}
Read - Config
GET - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_1
Read - Operational
GET - http://localhost:8181/restconf/operational/lisp:lisp-state/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_1
Delete
DELETE - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_1

Lisp -> Eid Table -> Vni Table -> Remote Mapping - > Positive Mapping

Write
PUT - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_2
{
    "remote-mapping":{
        "id":"remote_map_2",
        "eid":{
            "address-type":"ietf-lisp-address-types:ipv4-afi",
            "virtual-network-id":"12",
            "ipv4":"192.168.2.3"
        },
    
        "rlocs":{
            "locator":{
                "address":"192.168.2.4",
                "priority":1,
                "weight":1
            }
        }
        
    }
}
Read - Config
GET - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_2
Read - Operational
GET - http://localhost:8181/restconf/operational/lisp:lisp-state/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_2
Delete
DELETE - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/remote-mappings/remote-mapping/remote_map_2

Lisp -> Eid Table -> Vni Table -> Adjacencies

To be able to write such data, both local and remote eids must have mappings existing to them

Write
PUT - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/adjacencies/adjacency/1
{
    "adjacency":{
        "id":"1",
        "local-eid":{
            "address-type":"ietf-lisp-address-types:ipv4-afi",
            "virtual-network-id":"12",
            "ipv4":"192.168.2.1"
        },
        "remote-eid":{
            "address-type":"ietf-lisp-address-types:ipv4-afi",
            "virtual-network-id":"14",
            "ipv4":"192.168.2.2"
        }
    }
}
Read - Config
GET - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/adjacencies/adjacency/1
Read - Operational
GET - http://localhost:8181/restconf/operational/lisp:lisp-state/eid-table/vni-table/12/adjacencies/adjacency/1
Delete
DELETE - http://localhost:8181/restconf/config/lisp:lisp/eid-table/vni-table/12/adjacencies/adjacency/1



Lisp -> Pitr Cfg

To write such data, referenced locator set must be existing

Write
PUT - http://localhost:8181/restconf/config/lisp:lisp/pitr-cfg
{
    "pitr-cfg":{
        "locator-set":"loc_1"
     }
}
Read - Config
GET - http://localhost:8181/restconf/config/lisp:lisp/pitr-cfg
Read - Operational
GET - http://localhost:8181/restconf/operational/lisp:lisp-state/pitr-cfg
Delete
DELETE http://localhost:8181/restconf/config/lisp:lisp/pitr-cfg