dexter has uploaded this change for review.

View Change

esipa_rest_utils: re-align to SGP.32 Section 2.11.2

Section 2.11.2: rename EuiccPackageResultDataSigned.configureAutoEnableResult to EuiccPackageResultDataSigned.configureImmediateEnableResult

Change-Id: Ib4e6a4b4cb4d26a391346169b9047515496dd308
Related: SYS#8100
---
M contrib/rest_api_resource_schema.json
M contrib/rest_api_response_schema.json
R contrib/tryme_configureImmediateEnable.sh
M src/esipa_rest_utils.erl
4 files changed, 44 insertions(+), 39 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/78/42878/1
diff --git a/contrib/rest_api_resource_schema.json b/contrib/rest_api_resource_schema.json
index 5f18d75..27726ff 100644
--- a/contrib/rest_api_resource_schema.json
+++ b/contrib/rest_api_resource_schema.json
@@ -136,24 +136,24 @@
}
},
{
- "configureAutoEnable": {
- "description": "order the execution of a configureAutoEnable PSMO, see also GSMA SGP.32, section 5.13.6",
+ "configureImmediateEnable": {
+ "description": "order the execution of a configureImmediateEnable PSMO, see also GSMA SGP.32, section 5.13.6",
"type": "object",
"properties": {
- "autoEnableFlag": {
+ "immediateEnableFlag": {
"description": "enable/disable automatic profile enabeling",
"type": "boolean"
},
- "objid": {
+ "defaultSmdpOid": {
"description": "object ID of the default SMDP+",
"type": "string"
},
- "smdpAddress": {
+ "defaultSmdpAddress": {
"description": "FQDN of the default SMDP+",
"type": "string"
},
"required": [
- "autoEnableFlag"
+ "immediateEnableFlag"
]
}
}
diff --git a/contrib/rest_api_response_schema.json b/contrib/rest_api_response_schema.json
index bf0c843..5b00450 100644
--- a/contrib/rest_api_response_schema.json
+++ b/contrib/rest_api_response_schema.json
@@ -195,8 +195,8 @@
}
},
{
- "configureAutoEnableResult": {
- "description": "configureAutoEnableResult (automatic profile enabeling) PSMO result, see also SGP32Definitions.asn1",
+ "configureImmediateEnableResult": {
+ "description": "configureImmediateEnableResult (automatic profile enabeling) PSMO result, see also SGP32Definitions.asn1",
"type": "string",
"enum": [
"ok",
diff --git a/contrib/tryme_configureAutoEnable.sh b/contrib/tryme_configureImmediateEnable.sh
similarity index 74%
rename from contrib/tryme_configureAutoEnable.sh
rename to contrib/tryme_configureImmediateEnable.sh
index 89c08dd..9cf4fde 100755
--- a/contrib/tryme_configureAutoEnable.sh
+++ b/contrib/tryme_configureImmediateEnable.sh
@@ -1,7 +1,7 @@
#!/bin/bash
. ./tryme.cfg

-JSON='{ "eidValue" : "'$EID'", "order" : { "psmo": [ { "configureAutoEnable" : { "autoEnableFlag" : true, "smdpAddress" : "rsp.truphone.com" } } ] } }'
+JSON='{ "eidValue" : "'$EID'", "order" : { "psmo": [ { "configureImmediateEnable" : { "immediateEnableFlag" : true, "defaultSmdpAddress" : "testsmdpplus1.example.com" } } ] } }'
RC=`./restop.py -c -f psmo -j "$JSON"`
echo $RC

diff --git a/src/esipa_rest_utils.erl b/src/esipa_rest_utils.erl
index efbf985..2d2c7fe 100644
--- a/src/esipa_rest_utils.erl
+++ b/src/esipa_rest_utils.erl
@@ -100,34 +100,39 @@
error
end.

-psmo_to_asn_configureAutoEnable(Psmo) ->
+psmo_to_asn_configureImmediateEnable(Psmo) ->
case Psmo of
- {[{<<"autoEnableFlag">>, true}, {<<"smdpOid">>, SmdpOid}, {<<"smdpAddress">>, SmdpAddress}]} ->
- {configureAutoEnable, #{
- autoEnableFlag => null,
- smdpOid => binary_to_list(SmdpOid),
- smdpAddress => SmdpAddress
- }};
- {[{<<"autoEnableFlag">>, true}, {<<"smdpOid">>, SmdpOid}]} ->
- {configureAutoEnable, #{autoEnableFlag => null, smdpOid => binary_to_list(SmdpOid)}};
- {[{<<"autoEnableFlag">>, true}, {<<"smdpAddress">>, SmdpAddress}]} ->
- {configureAutoEnable, #{autoEnableFlag => null, smdpAddress => SmdpAddress}};
- {[{<<"autoEnableFlag">>, true}]} ->
- {configureAutoEnable, #{autoEnableFlag => null}};
- {[
- {<<"autoEnableFlag">>, false},
- {<<"smdpOid">>, SmdpOid},
- {<<"smdpAddress">>, SmdpAddress}
- ]} ->
- {configureAutoEnable, #{mdpOid => binary_to_list(SmdpOid), smdpAddress => SmdpAddress}};
- {[{<<"autoEnableFlag">>, false}, {<<"smdpOid">>, SmdpOid}]} ->
- {configureAutoEnable, #{smdpOid => binary_to_list(SmdpOid)}};
- {[{<<"autoEnableFlag">>, false}, {<<"smdpAddress">>, SmdpAddress}]} ->
- {configureAutoEnable, #{smdpAddress => SmdpAddress}};
- {[{<<"autoEnableFlag">>, false}]} ->
- {configureAutoEnable, #{}};
+ {[{<<"immediateEnableFlag">>, true},
+ {<<"defaultSmdpOid">>, DefaultSmdpOid},
+ {<<"defaultSmdpAddress">>, DefaultSmdpAddress}]} ->
+ {configureImmediateEnable, #{immediateEnableFlag => null,
+ defaultSmdpOid => binary_to_list(DefaultSmdpOid),
+ defaultSmdpAddress => DefaultSmdpAddress}};
+ {[{<<"immediateEnableFlag">>, true},
+ {<<"defaultSmdpOid">>, DefaultSmdpOid}]} ->
+ {configureImmediateEnable, #{immediateEnableFlag => null,
+ defaultSmdpOid => binary_to_list(DefaultSmdpOid)}};
+ {[{<<"immediateEnableFlag">>, true},
+ {<<"defaultSmdpAddress">>, DefaultSmdpAddress}]} ->
+ {configureImmediateEnable, #{immediateEnableFlag => null,
+ defaultSmdpAddress => DefaultSmdpAddress}};
+ {[{<<"immediateEnableFlag">>, true}]} ->
+ {configureImmediateEnable, #{immediateEnableFlag => null}};
+ {[{<<"immediateEnableFlag">>, false},
+ {<<"defaultSmdpOid">>, DefaultSmdpOid},
+ {<<"defaultSmdpAddress">>, DefaultSmdpAddress}]} ->
+ {configureImmediateEnable, #{defaultSmdpOid => binary_to_list(DefaultSmdpOid),
+ defaultSmdpAddress => DefaultSmdpAddress}};
+ {[{<<"immediateEnableFlag">>, false},
+ {<<"defaultSmdpOid">>, DefaultSmdpOid}]} ->
+ {configureImmediateEnable, #{defaultSmdpOid => binary_to_list(DefaultSmdpOid)}};
+ {[{<<"immediateEnableFlag">>, false},
+ {<<"defaultSmdpAddress">>, DefaultSmdpAddress}]} ->
+ {configureImmediateEnable, #{defaultSmdpAddress => DefaultSmdpAddress}};
+ {[{<<"immediateEnableFlag">>, false}]} ->
+ {configureImmediateEnable, #{}};
_ ->
- logger:error("REST: order with bad configureAutoEnable PSMO: ~p~n", [Psmo]),
+ logger:error("REST: order with bad configureImmediateEnable PSMO: ~p~n", [Psmo]),
error
end.

@@ -162,8 +167,8 @@
psmo_to_asn_listProfileInfo(Psmo);
{[{<<"getRAT">>, Psmo}]} ->
psmo_to_asn_getRAT(Psmo);
- {[{<<"configureAutoEnable">>, Psmo}]} ->
- psmo_to_asn_configureAutoEnable(Psmo);
+ {[{<<"configureImmediateEnable">>, Psmo}]} ->
+ psmo_to_asn_configureImmediateEnable(Psmo);
_ ->
logger:error("REST: order with unknown/unsupported PSMO: ~p~n", [PsmoOrder]),
error
@@ -389,8 +394,8 @@
result_to_json_listProfileInfoResult(ListProfileInfoResult);
{getRATResult, GetRATResult} ->
result_to_json_getRATResult(GetRATResult);
- {configureAutoEnableResult, ConfigureAutoEnableResult} ->
- {[{configureAutoEnableResult, ConfigureAutoEnableResult}]};
+ {configureImmediateEnableResult, ConfigureImmediateEnableResult} ->
+ {[{configureImmediateEnableResult, ConfigureImmediateEnableResult}]};
{addEimResult, AddEimResult} ->
result_to_json_addEimResult(AddEimResult);
{deleteEimResult, DeleteEimResult} ->

To view, visit change 42878. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: Ib4e6a4b4cb4d26a391346169b9047515496dd308
Gerrit-Change-Number: 42878
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier@sysmocom.de>