To further improve our CDN Mesh Delivery for Enterprise product, we released a new feature that will help customers to better handle the traffic inside their corporate networks, and avoid inter-site data transfers.
The Streamroot Subnets API allows you to create, read, update and delete sites. Sites are groups of users forming a mesh network that only exchange video data within itself. With well-defined sites, no video data will be transferred from one site to another ensuring that each sites upload bandwidth is not used, and that download bandwidth is only used to get content from the CDN for a small fraction of users.
A site is composed of:
- a name which must be unique and matching the following regexp: ^[a-zA-Z0-9_ \\(\\)-]{1,64}$
- a list of public IPs (IPv4 or IPv6)
- a list of subnets (IPv4 or IPv6)
All endpoints are only accessible via HTTPS and take/return JSON payloads.
Enabling Subnets
A new property has been added for CDN Mesh Delivery for Enterprise customers: Subnet matching. This will need to be toggled ON to add subnets to Streamroot. Properties are a way to fine-tune various parameters across all your CDN Mesh Delivery integrations and can be accessed under the “Properties” section in the dashboard. See our documentation for more information on them.
Changes made to a property take up to 2 minutes to be effective.
Types
Name | Type | Format | Examples |
Name | string | ^[a-zA-Z0-9_ \\(\\)-]{1,64}$ |
foobar foo_bar foobar (dummy-42) |
CIDR | string | See this wikipedia page |
192.168.0.0/16 192.169.1.24 (which is the equivalent of 192.169.1.24/32) 2001:db8::/32 |
Site | Object |
|
|
Authentication
Authentication is required before using our APIs. Please refer to this article to learn how to authenticate.
End Points
Create Sites - The given sites will be added to your existing ones.
Replace Sites - Your existing sites will be deleted and replaced by the given ones.
List Sites - Show a list of all active Sites.
Update Sites - The given Sites will be updated to display the new values.
Delete Sites - The site will be deleted permanently.
Create Sites
The API provides two endpoints to create sites, with different behaviors:
- Append: the given sites will be added to your existing ones.
- Replace: your existing sites will be deleted and replaced by the given ones.
Append
The given sites will be added to your existing ones.
POST https://apiv2.streamroot.io/subnetMatcher/customerSiteId
Headers
Key | Value |
Content-Type | application/json |
Authorization | Bearer <accessToken> (refer to our docs on how to Authenticate) |
Request
A list of Site: [Site]
Format | Example |
|
|
Response
Success
A JSON object of the following form:
Format | Example |
|
|
Errors
Our API returns success or error status codes. For errors, we include information encoded in the JSON response about what went wrong. The various errors that can be returned are listed below.
Error Message | Description | Error Format | Error Message Example | Status |
"site '<name>': already exists " |
A Site with the same name already exists. |
|
|
400 Bad Request |
"site '<name1>': in conflict with site '<name2>'" |
The Site is in conflict with another site. |
|
|
400 Bad Request |
"site '<name>': publicIPs is empty" |
The given list is empty. |
|
|
400 Bad Request |
"malformatted JSON" |
The given payload is not in JSON format. |
|
|
400 Bad Request |
Replace
Your existing sites will be deleted and replaced by the given ones.
PUT https://apiv2.streamroot.io/subnetMatcher/customerSiteId
Headers
Key | Value |
Content-Type | application/json |
Authorization | Bearer <accessToken> (refer to our docs on how to Authenticate) |
Request
A list of Site: [Site]
Format | Example |
|
|
Response
Success
Our API returns success status codes.
Status | Message | Description | Format | Example |
200 OK | No Message | The Site was successfully updated | empty (no payload) |
empty |
Errors
For errors, we include information encoded in the JSON response about what went wrong. The various statuses that can be returned are listed below.
Message | Description | Format | Example | Status |
"site '<name>': already exists " |
A Site with the same name already exists. |
|
|
400 Bad Request |
"site '<name1>': in conflict with site '<name2>'" |
The Site is in conflict with another site. |
|
|
400 Bad Request |
"site '<name>': publicIPs is empty" |
The given list is empty. |
|
|
400 Bad Request |
"malformatted JSON" |
The given payload is not in JSON format. |
|
|
400 Bad Request |
List Sites
Shows a list of all Sites active in Streamroot.
GET https://apiv2.streamroot.io/subnetMatcher/customerSiteId
Response
A JSON object of the following form:
Format | Example |
|
|
Update Sites
The given sites will be updated to display the new values. Only one site can be updated at a time.
PUT https://apiv2.streamroot.io/subnetMatcher/customerSiteId/{ID}
Headers
Key | Value |
Content-Type | application/json |
Authorization | Bearer <accessToken> (refer to our docs on how to Authenticate) |
Request
A list of Site: [Site]
Format | Example |
|
|
Response
Success
A JSON object of the following form:
Format | Example |
|
|
Errors
Our API returns success or error status codes. For errors, we include information encoded in the JSON response about what went wrong. The various errors that can be returned are listed below.
Error Message | Description | Error Format | Error Message Example | Status |
"already exists " |
A Site with the same name already exists |
|
|
200 OK |
"<publicIPs/Subnets> is empty" |
The given list is empty |
|
|
400 Bad Request |
"invalid CIDR address: /32" |
The CIDR entered is not in the correct format |
|
|
400 Bad Request |
"malformatted JSON" |
The given payload is not in JSON format |
|
|
400 Bad Request |
"not found" |
The ID in the URL can't be found |
|
|
404 Not found |
"conflict with <Name>" |
This response happens when there is at least one conflict in the provided list of sites |
|
|
409 Conflict |
Delete Sites
The site will be deleted permanently.
DELETE https://apiv2.streamroot.io/subnetMatcher/customerSiteId/{ID}
Headers
Key | Value |
Authorization | Bearer <accessToken> (refer to our docs on how to Authenticate) |
Response
Success
Our API returns success or error status codes.
Status | Message | Description | Format | Example |
204 No Content |
No message | The site was successfully deleted | empty (no payload) |
empty |
Errors
For errors, we include information encoded in the JSON response about what went wrong. The various statuses that can be returned are listed below.
Error Message | Description | Format | Example | Status |
"not found" |
The ID in the URL can't be found |
|
|
404 Not found |