mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-13 11:06:25 +05:00
Refactoring TPDestination Api documentation
This commit is contained in:
193
docs/api_tpdestinations.go
Normal file
193
docs/api_tpdestinations.go
Normal file
@@ -0,0 +1,193 @@
|
||||
Apier.SetTPDestination
|
||||
++++++++++++++++++++++
|
||||
|
||||
Creates a new destination within a tariff plan id.
|
||||
|
||||
**Request**:
|
||||
|
||||
Data:
|
||||
::
|
||||
|
||||
type ApierTPDestination struct {
|
||||
TPid string // Tariff plan id
|
||||
DestinationId string // Destination id
|
||||
Prefixes []string // Prefixes attached to this destination
|
||||
}
|
||||
|
||||
Required parameters: ``[]string{"TPid", "DestinationId", "Prefixes"}``
|
||||
|
||||
*JSON sample*:
|
||||
::
|
||||
|
||||
{
|
||||
"id": 2,
|
||||
"method": "Apier.SetTPDestination",
|
||||
"params": [
|
||||
{
|
||||
"DestinationId": "FIST_DST2",
|
||||
"Prefixes": [
|
||||
"123",
|
||||
"345"
|
||||
],
|
||||
"TPid": "FIST_TP"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
**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/DestinationId already exists in StorDb.
|
||||
|
||||
|
||||
Apier.GetTPDestination
|
||||
++++++++++++++++++++++
|
||||
|
||||
Queries a specific destination.
|
||||
|
||||
**Request**:
|
||||
|
||||
Data:
|
||||
::
|
||||
|
||||
type AttrGetTPDestination struct {
|
||||
TPid string // Tariff plan id
|
||||
DestinationId string // Destination id
|
||||
}
|
||||
|
||||
Required parameters: ``[]string{"TPid", "DestinationId"}``
|
||||
|
||||
*JSON sample*:
|
||||
::
|
||||
|
||||
{
|
||||
"id": 0,
|
||||
"method": "Apier.GetTPDestination",
|
||||
"params": [
|
||||
{
|
||||
"DestinationId": "FIRST_DST2",
|
||||
"TPid": "FIRST_TP"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
**Reply**:
|
||||
|
||||
Data:
|
||||
::
|
||||
|
||||
type ApierTPDestination struct {
|
||||
TPid string // Tariff plan id
|
||||
DestinationId string // Destination id
|
||||
Prefixes []string // Prefixes attached to this destination
|
||||
}
|
||||
|
||||
*JSON sample*:
|
||||
::
|
||||
|
||||
{
|
||||
"error": null,
|
||||
"id": 0,
|
||||
"result": {
|
||||
"TPid":"FIST_TP",
|
||||
"DestinationId": "FIST_DST2",
|
||||
"Prefixes": [
|
||||
"123",
|
||||
"345"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
**Errors**:
|
||||
|
||||
``MANDATORY_IE_MISSING`` - Mandatory parameter missing from request.
|
||||
|
||||
``SERVER_ERROR`` - Server error occurred.
|
||||
|
||||
``NOT_FOUND`` - Requested destination id not found.
|
||||
|
||||
|
||||
Apier.GetTPDestinationIds
|
||||
+++++++++++++++++++++++++
|
||||
|
||||
Queries destination identities on specific tariff plan.
|
||||
|
||||
**Request**:
|
||||
|
||||
Data:
|
||||
::
|
||||
|
||||
type AttrGetTPDestinationIds struct {
|
||||
TPid string // Tariff plan id
|
||||
}
|
||||
|
||||
Required parameters: ``[]string{"TPid"}``
|
||||
|
||||
*JSON sample*:
|
||||
::
|
||||
|
||||
{
|
||||
"id": 1,
|
||||
"method": "Apier.GetTPDestinationIds",
|
||||
"params": [
|
||||
{
|
||||
"TPid": "FIST_TP"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
**Reply**:
|
||||
|
||||
Data:
|
||||
::
|
||||
|
||||
[]string
|
||||
|
||||
*JSON sample*:
|
||||
::
|
||||
|
||||
{
|
||||
"error": null,
|
||||
"id": 1,
|
||||
"result": [
|
||||
"FIST_DST",
|
||||
"FIST_DST1",
|
||||
"FIST_DST2",
|
||||
"FIST_DST3",
|
||||
"FIST_DST4"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
**Errors**:
|
||||
|
||||
``MANDATORY_IE_MISSING`` - Mandatory parameter missing from request.
|
||||
|
||||
``SERVER_ERROR`` - Server error occurred.
|
||||
|
||||
``NOT_FOUND`` - Requested tariff plan not found.
|
||||
|
||||
@@ -124,199 +124,11 @@ These operate on a tpid
|
||||
Destinations
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
Apier.SetTPDestination
|
||||
++++++++++++++++++++++
|
||||
api_tpdestinations
|
||||
|
||||
Creates a new destination within a tariff plan id.
|
||||
|
||||
**Request**:
|
||||
|
||||
Data:
|
||||
::
|
||||
|
||||
type ApierTPDestination struct {
|
||||
TPid string // Tariff plan id
|
||||
DestinationId string // Destination id
|
||||
Prefixes []string // Prefixes attached to this destination
|
||||
}
|
||||
|
||||
Required parameters: ``[]string{"TPid", "DestinationId", "Prefixes"}``
|
||||
|
||||
*JSON sample*:
|
||||
::
|
||||
|
||||
{
|
||||
"id": 2,
|
||||
"method": "Apier.SetTPDestination",
|
||||
"params": [
|
||||
{
|
||||
"DestinationId": "FIST_DST2",
|
||||
"Prefixes": [
|
||||
"123",
|
||||
"345"
|
||||
],
|
||||
"TPid": "FIST_TP"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
**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/DestinationId already exists in StorDb.
|
||||
|
||||
|
||||
Apier.GetTPDestination
|
||||
++++++++++++++++++++++
|
||||
|
||||
Queries a specific destination.
|
||||
|
||||
**Request**:
|
||||
|
||||
Data:
|
||||
::
|
||||
|
||||
type AttrGetTPDestination struct {
|
||||
TPid string // Tariff plan id
|
||||
DestinationId string // Destination id
|
||||
}
|
||||
|
||||
Required parameters: ``[]string{"TPid", "DestinationId"}``
|
||||
|
||||
*JSON sample*:
|
||||
::
|
||||
|
||||
{
|
||||
"id": 0,
|
||||
"method": "Apier.GetTPDestination",
|
||||
"params": [
|
||||
{
|
||||
"DestinationId": "FIRST_DST2",
|
||||
"TPid": "FIRST_TP"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
**Reply**:
|
||||
|
||||
Data:
|
||||
::
|
||||
|
||||
type ApierTPDestination struct {
|
||||
TPid string // Tariff plan id
|
||||
DestinationId string // Destination id
|
||||
Prefixes []string // Prefixes attached to this destination
|
||||
}
|
||||
|
||||
*JSON sample*:
|
||||
::
|
||||
|
||||
{
|
||||
"error": null,
|
||||
"id": 0,
|
||||
"result": {
|
||||
"TPid":"FIST_TP",
|
||||
"DestinationId": "FIST_DST2",
|
||||
"Prefixes": [
|
||||
"123",
|
||||
"345"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
**Errors**:
|
||||
|
||||
``MANDATORY_IE_MISSING`` - Mandatory parameter missing from request.
|
||||
|
||||
``SERVER_ERROR`` - Server error occurred.
|
||||
|
||||
``NOT_FOUND`` - Requested destination id not found.
|
||||
|
||||
|
||||
Apier.GetTPDestinationIds
|
||||
+++++++++++++++++++++++++
|
||||
|
||||
Queries destination identities on specific tariff plan.
|
||||
|
||||
**Request**:
|
||||
|
||||
Data:
|
||||
::
|
||||
|
||||
type AttrGetTPDestinationIds struct {
|
||||
TPid string // Tariff plan id
|
||||
}
|
||||
|
||||
Required parameters: ``[]string{"TPid"}``
|
||||
|
||||
*JSON sample*:
|
||||
::
|
||||
|
||||
{
|
||||
"id": 1,
|
||||
"method": "Apier.GetTPDestinationIds",
|
||||
"params": [
|
||||
{
|
||||
"TPid": "FIST_TP"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
**Reply**:
|
||||
|
||||
Data:
|
||||
::
|
||||
|
||||
[]string
|
||||
|
||||
*JSON sample*:
|
||||
::
|
||||
|
||||
{
|
||||
"error": null,
|
||||
"id": 1,
|
||||
"result": [
|
||||
"FIST_DST",
|
||||
"FIST_DST1",
|
||||
"FIST_DST2",
|
||||
"FIST_DST3",
|
||||
"FIST_DST4"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
**Errors**:
|
||||
|
||||
``MANDATORY_IE_MISSING`` - Mandatory parameter missing from request.
|
||||
|
||||
``SERVER_ERROR`` - Server error occurred.
|
||||
|
||||
``NOT_FOUND`` - Requested tariff plan not found.
|
||||
|
||||
|
||||
Timings
|
||||
|
||||
Reference in New Issue
Block a user