From 77abee97dbd02258ec4805accf05e4f4eb6fb87a Mon Sep 17 00:00:00 2001 From: DanB Date: Sat, 20 Jul 2013 14:29:44 +0200 Subject: [PATCH] Adding TPAccountActions API documentation --- docs/api_tpaccountactions.rst | 198 ++++++++++++++++++++++++++++++++++ docs/apicalls.rst | 28 ++--- 2 files changed, 214 insertions(+), 12 deletions(-) create mode 100644 docs/api_tpaccountactions.rst diff --git a/docs/api_tpaccountactions.rst b/docs/api_tpaccountactions.rst new file mode 100644 index 000000000..dd529bebc --- /dev/null +++ b/docs/api_tpaccountactions.rst @@ -0,0 +1,198 @@ +Apier.SetTPAccountActions ++++++++++++++++++++++++++ + +Creates a new AccountActions profile within a tariff plan. + +**Request**: + + Data: + :: + + type ApiTPAccountActions struct { + TPid string // Tariff plan id + AccountActionsId string // AccountActions id + Tenant string // Tenant's Id + Account string // Account name + Direction string // Traffic direction + ActionTimingsId string // Id of ActionTimings profile to use + ActionTriggersId string // Id of ActionTriggers profile to use + } + + Mandatory parameters: ``[]string{"TPid", "AccountActionsId","Tenant","Account","Direction","ActionTimingsId","ActionTriggersId"}`` + + *JSON sample*: + :: + + { + "id": 2, + "method": "Apier.SetTPAccountActions", + "params": [ + { + "Account": "ACNT1", + "AccountActionsId": "AA_SAMPLE_2", + "ActionTimingsId": "SAMPLE_AT_1", + "ActionTriggersId": "SAMPLE_ATRS_1", + "Direction": "OUT", + "TPid": "SAMPLE_TP_1", + "Tenant": "TENANT1" + } + ] + } + +**Reply**: + + Data: + :: + + string + + Possible answers: + ``OK`` - Success. + + *JSON sample*: + :: + + { + "error": null, + "id": 2, + "result": "OK" + } + +**Errors**: + + ``MANDATORY_IE_MISSING`` - Mandatory parameter missing from request. + + ``SERVER_ERROR`` - Server error occurred. + + ``DUPLICATE`` - The specified combination of TPid/AccountActionsId already present in StorDb. + + +Apier.GetTPAccountActions ++++++++++++++++++++++++++ + +Queries specific AccountActions profile on tariff plan. + +**Request**: + + Data: + :: + + type AttrGetTPAccountActions struct { + TPid string // Tariff plan id + AccountActionsId string // AccountActions id + } + + Mandatory parameters: ``[]string{"TPid", "AccountActionsId"}`` + + *JSON sample*: + :: + + { + "id": 3, + "method": "Apier.GetTPAccountActions", + "params": [ + { + "AccountActionsId": "AA_SAMPLE_2", + "TPid": "SAMPLE_TP_1" + } + ] + } + +**Reply**: + + Data: + :: + + type ApiTPAccountActions struct { + TPid string // Tariff plan id + AccountActionsId string // AccountActions id + Tenant string // Tenant's Id + Account string // Account name + Direction string // Traffic direction + ActionTimingsId string // Id of ActionTimings profile to use + ActionTriggersId string // Id of ActionTriggers profile to use + } + + *JSON sample*: + :: + + { + "error": null, + "id": 3, + "result": { + "Account": "ACNT1", + "AccountActionsId": "AA_SAMPLE_2", + "ActionTimingsId": "SAMPLE_AT_1", + "ActionTriggersId": "SAMPLE_ATRS_1", + "Direction": "OUT", + "TPid": "SAMPLE_TP_1", + "Tenant": "TENANT1" + } + } + +**Errors**: + + ``MANDATORY_IE_MISSING`` - Mandatory parameter missing from request. + + ``SERVER_ERROR`` - Server error occurred. + + ``NOT_FOUND`` - Requested AccountActions profile not found. + + +Apier.GetTPAccountActionIds ++++++++++++++++++++++++++++ + +Queries AccountActions identities on specific tariff plan. + +**Request**: + + Data: + :: + + type AttrGetTPAccountActionIds struct { + TPid string // Tariff plan id + } + + Mandatory parameters: ``[]string{"TPid"}`` + + *JSON sample*: + :: + + { + "id": 4, + "method": "Apier.GetTPAccountActionIds", + "params": [ + { + "TPid": "SAMPLE_TP_1" + } + ] + } + +**Reply**: + + Data: + :: + + []string + + *JSON sample*: + :: + + { + "error": null, + "id": 4, + "result": [ + "AA_SAMPLE_1", + "AA_SAMPLE_2" + ] + } + +**Errors**: + + ``MANDATORY_IE_MISSING`` - Mandatory parameter missing from request. + + ``SERVER_ERROR`` - Server error occurred. + + ``NOT_FOUND`` - There are no AccountAction profiles defined on the selected TPid. + + diff --git a/docs/apicalls.rst b/docs/apicalls.rst index 7fa865bf8..25cbbec70 100644 --- a/docs/apicalls.rst +++ b/docs/apicalls.rst @@ -116,10 +116,10 @@ FlushCache Cleans all internal cached (Destinations, RatingProfiles) -6.1.4. Importing API --------------------- +6.1.4. Tariff plan importer APIs +-------------------------------- -These operate on a tpid +These operate on a tpid and are used to import the tariff plan content into storDb. TariffPlan ~~~~~~~~~~ @@ -129,7 +129,6 @@ TariffPlan api_tp - Timings ~~~~~~~ @@ -138,7 +137,6 @@ Timings api_tptimings - Destinations ~~~~~~~~~~~~ @@ -147,7 +145,6 @@ Destinations api_tpdestinations - Rates ~~~~~ @@ -156,7 +153,6 @@ Rates api_tprates - DestinationRates ~~~~~~~~~~~~~~~~ @@ -165,7 +161,6 @@ DestinationRates api_tpdestinationrates - DestinationRateTimings ~~~~~~~~~~~~~~~~~~~~~~ @@ -174,7 +169,6 @@ DestinationRateTimings api_tpdestratetimings - RateProfiles ~~~~~~~~~~~~ @@ -184,7 +178,7 @@ RateProfiles api_tprateprofiles Actions -~~~~~~~~~~~~ +~~~~~~~ .. toctree:: :maxdepth: 2 @@ -192,7 +186,8 @@ Actions api_tpactions ActionTimings -~~~~~~~~~~~~ +~~~~~~~~~~~~~ + .. toctree:: :maxdepth: 2 @@ -200,13 +195,22 @@ ActionTimings api_tpactiontimings ActionTriggers -~~~~~~~~~~~~ +~~~~~~~~~~~~~~ + .. toctree:: :maxdepth: 2 api_tpactiontriggers +AccountActions +~~~~~~~~~~~~~~ + +.. toctree:: + :maxdepth: 2 + + api_tpaccountactions + 6.1.5. Management API ---------------------