Skip to content
Snippets Groups Projects
Commit 9283fcb0 authored by Sebastien Merle's avatar Sebastien Merle
Browse files

Update TE service configuration format

parent 84aa2f54
No related branches found
No related tags found
2 merge requests!142Release TeraFlowSDN 2.1,!133Integration of TE component
...@@ -281,18 +281,23 @@ device_status(#{device_operational_status := 'DEVICEOPERATIONALSTATUS_ENABLED'}) ...@@ -281,18 +281,23 @@ device_status(#{device_operational_status := 'DEVICEOPERATIONALSTATUS_ENABLED'})
enabled. enabled.
device_mpls_label(Device) -> device_mpls_label(Device) ->
try device_config_value(<<"/te_data/mpls_label">>, Device) try device_config_value(<<"/te_data">>, Device) of
Map when is_map(Map) -> maps:get(<<"mpls_label">>, Map, undefined);
_ -> undefined
catch error:badarg -> undefined catch error:badarg -> undefined
end. end.
device_pcc_address(Device) -> device_pcc_address(Device) ->
try device_config_value(<<"/te_data/pcc_address">>, Device) of try device_config_value(<<"/te_data">>, Device) of
undefined -> undefined; Map when is_map(Map) ->
AddressBin -> case maps:get(<<"pcc_address">>, Map, undefined) of
case inet_parse:address(binary_to_list(AddressBin)) of AddressBin ->
{ok, Address} -> Address; case inet_parse:address(binary_to_list(AddressBin)) of
{error,einval} -> undefined {ok, Address} -> Address;
end {error,einval} -> undefined
end
end;
_ -> undefined
catch catch
error:badarg -> undefined error:badarg -> undefined
end. end.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{tfte, [ {tfte, [
{context, <<"admin">>}, {context, <<"admin">>},
{topology, <<"tetestbed">>}, {topology, <<"admin">>},
{services, [ {services, [
{te, [ {te, [
{http, {env, "TESERVICE_SERVICE_HOST"}, {env, "TESERVICE_SERVICE_PORT_GRPC"}, []} {http, {env, "TESERVICE_SERVICE_HOST"}, {env, "TESERVICE_SERVICE_PORT_GRPC"}, []}
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
], ],
"topologies": [ "topologies": [
{ {
"topology_id": {"topology_uuid": {"uuid": "tetestbed"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}},
"device_ids": [ "device_ids": [
{"device_uuid": {"uuid": "SW1"}}, {"device_uuid": {"uuid": "SW1"}},
{"device_uuid": {"uuid": "RT1"}}, {"device_uuid": {"uuid": "RT1"}},
...@@ -54,8 +54,7 @@ ...@@ -54,8 +54,7 @@
{"sample_types": [], "type": "copper", "uuid": "eth-src"}, {"sample_types": [], "type": "copper", "uuid": "eth-src"},
{"sample_types": [], "type": "copper", "uuid": "eth-sw1"} {"sample_types": [], "type": "copper", "uuid": "eth-sw1"}
]}}}, ]}}},
{"action": 1, "custom": {"resource_key": "/te_data/mpls_label", "resource_value": "16010"}}, {"action": 1, "custom": {"resource_key": "/te_data", "resource_value": {"mpls_label": 16010, "pcc_address": "1.1.1.1"}}}
{"action": 1, "custom": {"resource_key": "/te_data/pcc_address", "resource_value": "1.1.1.1"}}
]} ]}
}, },
{ {
...@@ -69,8 +68,7 @@ ...@@ -69,8 +68,7 @@
{"sample_types": [], "type": "copper", "uuid": "eth-rt4-1"}, {"sample_types": [], "type": "copper", "uuid": "eth-rt4-1"},
{"sample_types": [], "type": "copper", "uuid": "eth-rt4-2"} {"sample_types": [], "type": "copper", "uuid": "eth-rt4-2"}
]}}}, ]}}},
{"action": 1, "custom": {"resource_key": "/te_data/mpls_label", "resource_value": "16020"}}, {"action": 1, "custom": {"resource_key": "/te_data", "resource_value": {"mpls_label": 16020, "pcc_address": "2.2.2.2"}}}
{"action": 1, "custom": {"resource_key": "/te_data/pcc_address", "resource_value": "2.2.2.2"}}
]} ]}
}, },
{ {
...@@ -84,8 +82,7 @@ ...@@ -84,8 +82,7 @@
{"sample_types": [], "type": "copper", "uuid": "eth-rt5-1"}, {"sample_types": [], "type": "copper", "uuid": "eth-rt5-1"},
{"sample_types": [], "type": "copper", "uuid": "eth-rt5-2"} {"sample_types": [], "type": "copper", "uuid": "eth-rt5-2"}
]}}}, ]}}},
{"action": 1, "custom": {"resource_key": "/te_data/mpls_label", "resource_value": "16030"}}, {"action": 1, "custom": {"resource_key": "/te_data", "resource_value": {"mpls_label": 16030, "pcc_address": "3.3.3.3"}}}
{"action": 1, "custom": {"resource_key": "/te_data/pcc_address", "resource_value": "3.3.3.3"}}
]} ]}
}, },
{ {
...@@ -100,8 +97,7 @@ ...@@ -100,8 +97,7 @@
{"sample_types": [], "type": "copper", "uuid": "eth-rt5"}, {"sample_types": [], "type": "copper", "uuid": "eth-rt5"},
{"sample_types": [], "type": "copper", "uuid": "eth-rt6"} {"sample_types": [], "type": "copper", "uuid": "eth-rt6"}
]}}}, ]}}},
{"action": 1, "custom": {"resource_key": "/te_data/mpls_label", "resource_value": "16040"}}, {"action": 1, "custom": {"resource_key": "/te_data", "resource_value": {"mpls_label": 16040, "pcc_address": "4.4.4.4"}}}
{"action": 1, "custom": {"resource_key": "/te_data/pcc_address", "resource_value": "4.4.4.4"}}
]} ]}
}, },
{ {
...@@ -116,8 +112,7 @@ ...@@ -116,8 +112,7 @@
{"sample_types": [], "type": "copper", "uuid": "eth-rt4"}, {"sample_types": [], "type": "copper", "uuid": "eth-rt4"},
{"sample_types": [], "type": "copper", "uuid": "eth-rt6"} {"sample_types": [], "type": "copper", "uuid": "eth-rt6"}
]}}}, ]}}},
{"action": 1, "custom": {"resource_key": "/te_data/mpls_label", "resource_value": "16050"}}, {"action": 1, "custom": {"resource_key": "/te_data", "resource_value": {"mpls_label": 16050, "pcc_address": "5.5.5.5"}}}
{"action": 1, "custom": {"resource_key": "/te_data/pcc_address", "resource_value": "5.5.5.5"}}
]} ]}
}, },
{ {
...@@ -131,8 +126,7 @@ ...@@ -131,8 +126,7 @@
{"sample_types": [], "type": "copper", "uuid": "eth-rt5"}, {"sample_types": [], "type": "copper", "uuid": "eth-rt5"},
{"sample_types": [], "type": "copper", "uuid": "eth-dst"} {"sample_types": [], "type": "copper", "uuid": "eth-dst"}
]}}}, ]}}},
{"action": 1, "custom": {"resource_key": "/te_data/mpls_label", "resource_value": "16060"}}, {"action": 1, "custom": {"resource_key": "/te_data", "resource_value": {"mpls_label": 16060, "pcc_address": "6.6.6.6"}}}
{"action": 1, "custom": {"resource_key": "/te_data/pcc_address", "resource_value": "6.6.6.6"}}
]} ]}
} }
], ],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment