Zone Create
Allows you to create a new zone.
Method | Link |
POST |
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
user_key | string | Yes | API User Token |
user_secret | string | Yes | API User Secret Token |
label | string | Yes | Zone Description |
origin_url | string | Small, Large or Aksela Type | Origin URL |
ftp_password | string | Only Large Type | FTP Password only large account or VoD. |
zone_url | string | Only Aksela Type | Zone URL |
name | string | Yes | Zone Name |
type | string | Yes | small, large, large-origin-pull, aksela, live-push, live-pull, vod |
origin_pull_domain | string | Only live-pull Type | Origin pull domain only live-pull type. |
auth_username | string | Only live-push Type | Authentication username only live-push type. |
auth_password | string | Only live-push Type | Authentication password only live-push type. |
Return Values
Variable | Type |
---|---|
status | bool |
data | object |
Example PHP Code
<?php
$curl_post_data = array(
'user_key' => 'Your User Key',
'user_secret' =>'Your User Secret',
'label' => 'Zone Label',
'origin_url' =>'Origin Url',
'name' =>'Zone Name',
'type' => 'Zone Type' );
$request_body = json_encode($curl_post_data);
$service_url = 'https://api.medianova.com/v1/zone/create';
$ch = curl_init($service_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $request_body);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($request_body))
);
$response = curl_exec($ch);$decoded = json_decode($response);var_dump($decoded);
?>
Example Output
{
"status": true,
"data": {
"alias": [],
"origin_authentication": false,
"browser_cache": "no",
"cdn_url": "zone.mncdn.com",
"create_at": "2016-11-01 11:00:00",
"sni": false,
"edge_cache": "8#d",
"gzip": true,
"http2": true,
"image_compress": true,
"image_optimization": false,
"label": "zone",
"name": "zone",
"origin_url": "http://www.medianova.com",
"purge_username": "purgename-26aDMwAHQOb4",
"query_string": false,
"custom_query_string": false,
"custom_query_string_args": [],
"custom_headers": [],
"robots": "disable",
"secure_token": false,
"shared_ssl": true,
"status": true,
"zone_id": 1
}
}