Configs Management

Get the Config Manager

The config manager links to the following resources:

Query

GET /provd/cfg_mgr HTTP/1.1

Example request

GET /provd/cfg_mgr HTTP/1.1
Host: xivoserver
Accept: application/vnd.proformatique.provd+json

Example response

HTTP/1.1 200 OK
Content-Type: application/vnd.proformatique.provd+json


{
    "links": [
        {
            "href": "/provd/cfg_mgr/configs",
            "rel": "cfg.configs"
        },
        {
            "href": "/provd/cfg_mgr/autocreate",
            "rel": "cfg.autocreate"
        }
    ]
}

List Configs

Query

GET /provd/cfg_mgr/configs HTTP/1.1

Query Parameters

These are the same parameters as for the list devices action.

Example request

GET /provd/cfg_mgr/configs HTTP/1.1
Host: xivoserver
Accept: application/vnd.proformatique.provd+json

Example response

HTTP/1.1 200 OK
Content-Type: application/vnd.proformatique.provd+json

{
    "configs": [
        {
            "configdevice": "defaultconfigdevice",
            "deletable": true,
            "id": "38e5e08ffe804b468f5aa53b9536bb25",
            "parent_ids": [
                "base",
                "defaultconfigdevice"
            ],
            "raw_config": {
                "X_key": "",
                "exten_dnd": "*25",
                "exten_fwd_busy": "*23",
                "exten_fwd_disable_all": "*20",
                "exten_fwd_no_answer": "*22",
                "exten_fwd_unconditional": "*21",
                "exten_park": null,
                "exten_pickup_call": "*8",
                "exten_pickup_group": null,
                "exten_voicemail": "*98",
                "funckeys": {
                    "1": {
                        "label": "",
                        "line": 1,
                        "type": "speeddial",
                        "value": "1005"
                    }
                },
                "protocol": "SIP",
                "sip_dtmf_mode": "SIP-INFO",
                "sip_lines": {
                    "1": {
                        "auth_username": "je5qtq",
                        "display_name": "El\u00e8s 01",
                        "number": "1001",
                        "password": "T2S7C0",
                        "proxy_ip": "10.34.1.11",
                        "registrar_ip": "10.34.1.11",
                        "username": "je5qtq"
                    }
                }
            }
        }
    ]
}

Create a Config

Query

POST /provd/cfg_mgr/configs HTTP/1.1

Example request

POST /provd/cfg_mgr/configs HTTP/1.1
Host: xivoserver
Content-Type: application/vnd.proformatique.provd+json

{
    "config": {
        "parent_ids": [
            "base"
        ],
        "raw_config": {
            "sip": {
                "lines": {
                    "1": {
                        "auth_username": "100",
                        "display_name": "Foo",
                        "password": "100",
                        "username": "100"
                    }
                }
            }
        }
    }
}

Example response

HTTP/1.1 201 Created
Content-Type: application/vnd.proformatique.provd+json
Location: /provd/cfg_mgr/configs/77839d0f05c84662864b0ae5c27b33e4

{"id": "77839d0f05c84662864b0ae5c27b33e4"}

If the id field is not given, then an ID id automatically generated by the server.

Get a Config

Query

GET /provd/cfg_mgr/configs/<config_id> HTTP/1.1

Example request

GET /provd/cfg_mgr/configs/77839d0f05c84662864b0ae5c27b33e4 HTTP/1.1
Host: xivoserver
Accept: application/vnd.proformatique.provd+json

Example response

HTTP/1.1 200 OK
Content-Type: application/vnd.proformatique.provd+json

{
    "config": {
        "id": "77839d0f05c84662864b0ae5c27b33e4",
        "parent_ids": [
            "base"
        ],
        "raw_config": {
            "sip": {
                "lines": {
                    "1": {
                        "auth_username": "100",
                        "display_name": "Foo",
                        "password": "100",
                        "username": "100"
                    }
                }
            }
        }
    }
}

Get a Raw Config

Query

GET /provd/cfg_mgr/configs/<config_id>/raw HTTP/1.1

Example request

GET /provd/cfg_mgr/configs/77839d0f05c84662864b0ae5c27b33e4/raw HTTP/1.1
Host: xivoserver
Accept: application/vnd.proformatique.provd+json

Example response

HTTP/1.1 200 OK
Content-Type: application/vnd.proformatique.provd+json

{
    "raw_config": {
        "X_xivo_phonebook_ip": "10.34.1.11",
        "http_port": 8667,
        "ip": "10.34.1.11",
        "ntp_enabled": true,
        "ntp_ip": "10.34.1.11",
        "sip": {
            "lines": {
                "1": {
                    "auth_username": "100",
                    "display_name": "John",
                    "password": "100",
                    "username": "100"
                }
            }
        },
        "tftp_port": 69
    }
}

Update a Config

Query

PUT /provd/cfg_mgr/configs/<config_id> HTTP/1.1

Example request

PUT /provd/cfg_mgr/configs/77839d0f05c84662864b0ae5c27b33e4 HTTP/1.1
Host: xivoserver
Content-Type: application/vnd.proformatique.provd+json

{
    "config": {
        "id": "77839d0f05c84662864b0ae5c27b33e4",
        "parent_ids": [
            "base"
        ],
        "raw_config": {
            "sip": {
                "lines": {
                    "1": {
                        "auth_username": "100",
                        "display_name": "John",
                        "password": "100",
                        "username": "100"
                    }
                }
            }
        }
    }
}

Example response

HTTP/1.1 204 No Content

Delete a Config

Query

DELETE /provd/cfg_mgr/configs/<config_id> HTTP/1.1

Example request

DELETE /provd/cfg_mgr/configs/77839d0f05c84662864b0ae5c27b33e4 HTTP/1.1
Host: xivoserver

Example response

HTTP/1.1 204 No Content

Autocreate a Config

This service is used to create a new config from the config that has the autocreate role.

Query

POST /provd/cfg_mgr/autocreate HTTP/1.1

Example request

POST /provd/cfg_mgr/autocreate HTTP/1.1
Host: xivoserver
Content-Type: application/vnd.proformatique.provd+json

{}

Example response

HTTP/1.1 201 Created
Content-Type: application/vnd.proformatique.provd+json
Location: /provd/cfg_mgr/configs/autoprov1411400365

{"id":"autoprov1411400365"}