Skip to content

VersBinarii/spike

Repository files navigation

WORK IN PROGRESS

Spike API

Number blocks

Number blocks and DDIs are going to be treated interchangeably. Bloc are allowed only in powers of 10 (1, 10, 100) etc. If 3 number are requested then 3 blocks of 1 are created, for 32 numbers 3 blocks of 10 and 2 blocks of 1 are created etc…

Design

MNA (Designation)

The assignement of numbers will be constrained by the designation assigned to the number. The designation is a set of information describing the validation rules that should be applied to number.

API

Assumptions

Each API endpoint will support pagination (where applicable).

Authentication

In order to authenticate a `POST` request needs to be made to the `/login` endpoint.

curl -XPOST -H 'Content-Type: application/json' -d'{"username": "admin", "password":"admin"}' 'http://localhost:9080/login'

The response will contain an authentication token that needs to be included into every ubsequent call. I.e.:

curl -XGET -H 'token: 4984f8116c364679aebb952a60f092e5' 'http://localhost:8080/mna'

Number

GET numbers - list all

curl -XGET -H 'token: 4984f8116c364679aebb952a60f092e5' 'http://localhost:9080/numbers'

GET numbers/:id - info on number id

curl -XGET -H 'token: 4984f8116c364679aebb952a60f092e5' 'http://localhost:9080/numbers/1'

POST numbers - Create new number

curl -XPOST -H 'Content-Type: application/json' -H 'token: 4984f8116c364679aebb952a60f092e5' 'http://localhost:9080/numbers' \ 
-d'{"number": "4567890", "number_type": "NonGeo", "number_status": "Available", "mna_id": 1, "wlr": false, "is_main_number": false, "ecas":false}'

PUT numbers/:id - Update number with the specfied ID

curl -XPUT -H 'Content-Type: application/json' -H 'token: 4984f8116c364679aebb952a60f092e5' 'http://localhost:9080/numbers' \ 
-d'{"number": "4567890", "number_type": "Geo", "number_status":"Assigned", "mna_id": 1, "wlr": false, "is_main_number": true, "ecas":true}'

Unimplemented:

DELETE numbers/:id GET numbers/new - find new available number GET numbers/:id/status - show the status of the number GET numbers/search - lookup numbers

MNA

GET mna - list all MNAs GET mna/:id - retrive single MNA POST mna - create new MNA PUT mna/:id - update MNA

Unimplemented:

GET mna/:id/numbers - list all numbers for this MNA DELETE mna/:id - delete MNA

RSP

GET rsp - list all RSPs

Subscriber

Address

Porting