Service Packs¶
Create service packs¶
-
POST
/api/v1/tenants/
(string: tenant_id)/service_packs/
¶ Assigns new service packs at tenant level with their limits if specified, using existing service packs defined in APIO settings.
Duplicates in service packs list specified in request parameters will be ignored if all parameters are the same for each request for the same service pack.
Trying to add an already added service pack will not cause any problem unless quantity mismatches will be detected. This means that specifying only service pack names in request parameters will not trigger any error if the service pack has already been added.
On errors, a rollback is performed in order not to allow incomplete service packs list addition.
Example request:
POST /api/v1/tenants/foo/service_packs/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "servicePacksFromConfig": [ { "name": "Service_Pack_Name", "quantity": { "unlimited": true } } ], "auto_auth_services": false }
- Request JSON Object:
servicePacksFromConfig (array) – A list of service packs to be assigned to the given tenant. See Services Pack Attributes.
auto_auth_services (boolean) – If set to true, if some of the services present in the services pack(s) are not uet auhtorized they are automatically authorized in unlimited way at Tenant and Groups levels. Default is false.
Example response:
HTTP/1.1 201 OK Content-Type: "application/json" { "servicePacks": [ { "name": "Service_Pack_Name", "description": "Service_Pack_Name", "maximumAllowed": { "unlimited": true }, "allocated": { "unlimited": true }, "currentlyAllocated": 0, "services": [ "Zone Calling Restrictions" ] } ] }
- Response JSON Object:
servicePacks (array) – Details of assigned service packs.
- Status Codes:
201 Created – no error, service packs successfully assigned
unable to add service pack, with possible sub-error codes:
2: INVALID_PARAMETERS, “Nothing to do - all service packs to be added already exist.”
3: JSON_SCHEMA_VALIDATION_ERROR, “Received data do not respect the schema”
11: ALREADY_EXISTS, “Duplicated service pack(s) in list with different parameters.”: inconsistency in duplicated service packs in list
11: ALREADY_EXISTS, “Existing service pack(s) in list with different parameters.”: inconsistency between already added service pack and service packs in list
23: SERVICE_NOT_ASSIGNED, “The needed Service is not authorized”
403 Forbidden – forbidden for given user level
Note
The flag unlimited is set to true for unlimited use or set to false along with attribute value giving the available service packs number for this tenant.
The services associated to each service pack to be assigned need to be authorized for the given tenant, except if using the parameter auto_auth_services.
List available service packs¶
-
GET
/api/v1/tenants/
(string: tenant_id)/service_packs/
¶ List available service packs at tenant level with their limits if specified.
Example request:
GET /api/v1/tenants/foo/service_packs/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "includeDetails": true }
- Request JSON Object:
includeDetails (boolean) – (Optional) If true, will give limits details for all service packs. Set to false or not specified just returns service packs list.
Example response without details:
HTTP/1.1 200 OK Content-Type: "application/json" { "names": [ "All_Services", "Another One", "CFA_bis", "Tenant SP", "Test SP" ] }
- Response JSON Object:
names (array) – A list of available service packs at tenant level.
- Status Codes:
200 OK – no error
Example response with details:
HTTP/1.1 200 OK Content-Type: "application/json" { "servicePacks": [ { "name": "All_Services", "description": "", "maximumAllowed": { "unlimited": false, "maximum": 2 }, "allocated": { "unlimited": false, "maximum": 2 }, "currentlyAllocated": 0 }, { "name": "CFA_bis", "description": "CBU has changed this CFA", "maximumAllowed": { "unlimited": true }, "allocated": { "unlimited": false, "maximum": 260 }, "currentlyAllocated": 200 } ] }
- Response JSON Object:
name (string) – Service pack name.
descxription (string) – Service pack description.
maximumAllowed (object) – Maximum quantity available of this service pack.
allocated (object) – Quantity allocated to this service pack.
currentlyAllocated (integer) – Quantity currently allocated to Groups of this service pack.
- Status Codes:
200 OK – no error
Note
The flag unlimited is set to true for unlimited use or set to false along with attribute value giving the available service packs number for this tenant.
Delete service packs¶
-
DELETE
/api/v1/tenants/
(string: tenant_id)/service_packs/
¶ Delete specified available service packs at tenant level.
Example request:
DELETE /api/v1/tenants/foo/service_packs/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "servicePacks": [ { "name": "All_Services" }, { "name": "Another One" }, { "name": "CFA_bis" }, { "name": "Tenant SP" }, { "name": "Test SP" } ] }
- Request JSON Object:
servicePacks (array) – A list of service packs to be deleted. See Services Pack Attributes.
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" {}
- Status Codes:
200 OK – request was processed without error
unable to delete some package, with possible sub-error codes:
3: JSON_SCHEMA_VALIDATION_ERROR, “Received data do not respect the schema”
30: STILL_IN_USE, “Service Pack can not be deleted as still authorized to groups.”
403 Forbidden – forbidden for given user level
Note
Not found packages will be silently skipped and not reported as error.
Service pack details¶
-
GET
/api/v1/tenants/
(string: tenant_id)/service_packs/
(string: service_pack_name)/
¶ Gives details on a specific service pack. Details include service pack limits and included user services.
Example request:
GET /api/v1/tenants/foo/service_packs/sp_name/ HTTP/1.1 Host: example.com Content-Type: "application/json"
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "name": "All_Services", "description": "", "maximumAllowed": { "unlimited": false, "maximum": 2 }, "allocated": { "unlimited": false, "maximum": 2 }, "currentlyAllocated": 0, "services": [ "Call Forwarding Always", "Alternate Numbers", "Advice Of Charge" ] }
- Response JSON Object:
name (string) – Service pack name.
descxription (string) – Service pack description.
maximumAllowed (object) – Maximum quantity available of this service pack.
allocated (object) – Quantity allocated to this service pack.
currentlyAllocated (integer) – Quantity currently allocated to Groups of this service pack.
services (array) – List of user services included in this service pack.
- Status Codes:
200 OK – no error
404 Not Found – service pack was not found
Note
The flag unlimited is set to true for unlimited use or set to false along with attribute value giving the available service packs number for this tenant.
Update available service pack¶
-
PUT
/api/v1/tenants/
(string: tenant_id)/service_packs/
(string: service_pack_name)/
¶ Update available service packs at tenant level.
Example request:
PUT /api/v1/tenants/foo/service_packs/sp_current_name/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "name": "sp_new_name", "description": "Modified Tenant Service Pack", "allocated": { "unlimited": false, "maximum": 200 } }
- Request JSON Object:
name (object) – (Optional) New name for this service pack
description (object) – (Optional) New description for this service pack
allocated (object) – (Optional) New maximum quantity allocated to this service pack
Example response:
HTTP/1.1 200 OK Content-Type: "application/json"
- Status Codes:
200 OK – request was processed without error
400 Bad Request – request data did not respect the schema
404 Not Found – service pack was not found
Delete available service pack¶
-
DELETE
/api/v1/tenants/
(string: tenant_id)/service_packs/
(string: service_pack_name)/
¶ Delete service packs at tenant level.
Example request:
DELETE /api/v1/tenants/foo/service_packs/sp_current_name/ HTTP/1.1 Host: example.com Content-Type: "application/json" {}
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" {}
- Status Codes:
200 OK – request was processed without error
404 Not Found – service pack was not found
Local objects definition¶
Services Pack Attributes¶
Name |
Type |
Method |
Description |
|
---|---|---|---|---|
POST |
DELETE |
|||
name |
String |
R |
R |
Service Pack name. |
description |
String |
O |
F |
Service Pack description. |
quantity |
Object |
O |
F |
Service pack quantity. See Services Pack Quantity Attributes. |
Services Pack Quantity Attributes¶
Name |
Type |
Method |
Description |
---|---|---|---|
POST |
|||
unlimited |
Boolean |
R |
Unlimited quantity. |