Create an environment
Цей контент ще не доступний вашою мовою.
createEnvironment adds a new virtual environment, the same as Add New under System Management → Environments. Only the root customer of the root environment can call it. To bring the new environment up, start it with queueEnvironmentAction.
The method supports trusted mode with i_customer, the ID of the root customer.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Environment Name. Must be unique |
https_cname |
string | yes | Web Address: the hostname of the environment’s panel and API |
assigned_ips |
string | yes | Environment IPs: comma-separated IP addresses, for example 192.0.2.20,192.0.2.21. Only addresses with status AVAILABLE in listSwitchIPs can be assigned. None (nil) leaves the environment unassigned |
description |
string | no | Description |
max_cps |
int | no | Max CPS: calls per second. None means unlimited |
max_sessions |
int | no | Max Sessions: simultaneous calls. None means unlimited |
sip_ports |
string | no | Comma-separated SIP ports of the environment |
installed_modules |
string | no | Modules: comma-separated modules enabled in the environment. The modules of the root environment are the ones available. None means none |
enable_sysinfo |
boolean | no | Show System Information in the environment’s panel |
enable_netband |
boolean | no | Show Network Bandwidth |
enable_cpuutil |
boolean | no | Show CPU Utilization |
enable_diskload |
boolean | no | Show Disk Load |
expiration_date |
string | no | Expiration Date in UTC, in the format %H:%M:%S.000 GMT %a %b %d %Y, for example 09:57:29.000 GMT Wed Nov 18 2026. None means never |
notify_on_expiration |
boolean | no | Notify On Expiration: send an email when the environment expires |
notify_addresses |
string | no | Notify Addresses: comma-separated emails for the expiration notice, or one of the special values |
https_certificate |
string | no | Base64-encoded TLS certificate in PEM format. Without https_certificate and https_key the switch generates a self-signed certificate |
https_key |
string | no | Base64-encoded RSA private key in PEM format, the pair of https_certificate |
httpd_servers |
int | no | Start # Servers: number of web server processes of the environment. 0 means Auto |
siplog_index_enabled |
boolean | no | SIP Log Indexing |
record_sdp |
boolean | no | Record SDP: keep SDP bodies in the SIP log |
company_name, salutation, first_name, mid_init, last_name |
string | no | Contact: Company Name, Mr./Ms…, First Name, M.I., Last Name |
street_addr, city, state, postal_code, country |
string | no | Address: Address, City, State, Postal Code, Country/Region |
contact, alt_contact, phone, alt_phone, fax |
string | no | Contact, Alt. Contact, Phone, Alt. Phone, Fax |
email, cc, bcc |
string | no | E-Mail, CC, BCC of the environment owner |
None is sent as <nil/>; the call() helper of the overview allows it.
Notification addresses
Section titled “Notification addresses”| Value | Sends the expiration notice to |
|---|---|
< E-Mail, CC, BCC > |
email, cc and bcc of the contact. The panel uses this by default |
< E-Mail > |
email of the contact |
< CC > |
cc of the contact |
< BCC > |
bcc of the contact |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
i_environment |
int | ID of the new environment |
Example
Section titled “Example”call("createEnvironment", { "name": "partner-a", "https_cname": "partner-a.example.com", "assigned_ips": "192.0.2.20", "description": "Partner A wholesale", "max_cps": 20, "max_sessions": 200, "expiration_date": None, "notify_addresses": "< E-Mail, CC, BCC >", "company_name": "Partner A Ltd", "email": "noc@partner-a.example.com",}){"result": "OK", "i_environment": 4}Related
Section titled “Related”- Virtual environments: the Environments screen and what each environment holds
- List IP addresses of the switch
- Start, stop and delete environments
- Update an environment
- Get environment information