Red5 Pro Simulated Cloud REST API

Stream Manager supports a special set of REST APIs for working with the Simulated Cloud environment. Since we cannot create a VM for a new Red5 Pro instance in a simulated cloud environment, we perform basic CRUD operations using instances that are already running. Using the REST api we can add / remove / list node provisions on the Simulated Cloud.

SIMULATED CLOUD PROVISIONING API

Add Provisions

Description

Provision one or more active Red5 Pro instances to simulated cloud. The instances must be active and running before they are added.

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provisions?accessToken=<accessToken>
  • Method: POST
  • Data:
[
  {
    "location": "<availability-zone>",
    "host": "<instance-host-address>",
    "instanceType": "<instance-type>"
  }
]

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}
  • Success: HTTP CODE 200
  • Data:
[
  {
    "nodeId": "<provision-id>",
    "location": "<availability-zone>",
    "host": "<instance-host-address>",
    "instanceType": "<instance-type>",
    "state": "<provision-state>",
    "meta": "<metadata>"
  }
]

Example

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision?accessToken=<accessToken>
  • Method: POST
  • Data:
[
  {
    "location": "us-test1-a",
    "host": "192.168.1.50",
    "instanceType": "standard"
  },
  {
    "location": "us-test1-a",
    "host": "192.168.1.31",
    "instanceType": "standard"
  }
]

RESPONSE

  • Success: HTTP CODE 200
  • Data:
[
  {
    "nodeId": "provision-9a3aaad7-2706-4e17-8634-eacbf869ce52",
    "location": "us-test1-a",
    "host": "192.168.1.50",
    "instanceType": "standard",
    "state": "RUNNING",
    "meta": ""
  },
  {
    "nodeId": "provision-36962be9-efc4-4d31-9445-9855be023c90",
    "location": "us-test1-a",
    "host": "192.168.1.31",
    "instanceType": "standard",
    "state": "RUNNING",
    "meta": ""
  }
]

Read Provisions

Description

Reads all the instance provisions from the simulated cloud platform.

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision?accessToken=<accessToken>
  • Method: GET

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}
  • Success: HTTP CODE 200
  • Data:
[
  {
    "nodeId": "<provision-id>",
    "location": "<availability-zone>",
    "host": "<instance-host-address>",
    "instanceType": "<instance-type>",
    "state": "<provision-state>",
    "meta": "<metadata>"
  }
]

Example

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision?accessToken=<accessToken>
  • Method: GET

RESPONSE

  • Success: HTTP CODE 200
  • Data:
[
  {
    "nodeId": "provision-9a3aaad7-2706-4e17-8634-eacbf869ce52",
    "location": "us-test1-a",
    "host": "192.168.1.50",
    "instanceType": "standard",
    "state": "RUNNING",
    "meta": ""
  },
  {
    "nodeId": "provision-36962be9-efc4-4d31-9445-9855be023c90",
    "location": "us-test1-a",
    "host": "192.168.1.31",
    "instanceType": "standard",
    "state": "RUNNING",
    "meta": ""
  }
]

Remove Provision

Description

Removes a single instance provision from the simulated cloud platform.

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision/<provision-host>?accessToken=<accessToken>
  • Method: DELETE

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}
  • Success: HTTP CODE 200
  • Data:
[
  {
    "nodeId": "<provision-id>",
    "location": "<availability-zone>",
    "host": "<instance-host-address>",
    "instanceType": "<instance-type>",
    "state": "<provision-state>",
    "meta": "<metadata>"
  }
]

Example

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision/192.168.1.31?accessToken=<accessToken>
  • Method: DELETE

RESPONSE

  • Success: HTTP CODE 200
  • Data:
{
  "nodeId": "provision-36962be9-efc4-4d31-9445-9855be023c90",
  "location": "us-test1-a",
  "host": "192.168.1.31",
  "instanceType": "standard",
  "state": "RUNNING",
  "meta": ""
}

Read Availabile Provisions

Description

Reads instance provisions from the simulated cloud platform that are actively available for use. This will exclude instances that have been terminated (not re-provisioned for reuse) and instances that are in use.

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision/available?accessToken=<accessToken>
  • Method: GET

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}
  • Success: HTTP CODE 200
  • Data:
[
  {
    "nodeId": "<provision-id>",
    "location": "<availability-zone>",
    "host": "<instance-host-address>",
    "instanceType": "<instance-type>",
    "state": "<provision-state>",
    "meta": "<metadata>"
  }
]

Example

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision/available?accessToken=<accessToken>
  • Method: GET

RESPONSE

  • Success: HTTP CODE 200
  • Data:
[
  {
    "nodeId": "provision-9a3aaad7-2706-4e17-8634-eacbf869ce52",
    "location": "us-test1-a",
    "host": "192.168.1.50",
    "instanceType": "standard",
    "state": "RUNNING",
    "meta": ""
  }
]

Read Unavailabile Provisions

Description

Reads instance provisions from the simulated cloud platform that are actively available for use. This will include only those instances that have been terminated (not re-provisioned for reuse) or currently in-use.

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision/unavailable?accessToken=<accessToken>
  • Method: GET

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}
  • Success: HTTP CODE 200
  • Data:
[
  {
    "nodeId": "<provision-id>",
    "location": "<availability-zone>",
    "host": "<instance-host-address>",
    "instanceType": "<instance-type>",
    "state": "<provision-state>",
    "meta": "<metadata>"
  }
]

Example

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision/unavailable?accessToken=<accessToken>
  • Method: GET

RESPONSE

  • Success: HTTP CODE 200
  • Data:
[
  {
    "nodeId": "provision-9a3aaad7-2706-4e17-8634-eacbf869ce52",
    "location": "us-test1-a",
    "host": "192.168.1.27",
    "instanceType": "standard",
    "state": "TERMINATED",
    "meta": ""
  },
  {
    "nodeId": "provision-9a3aaad7-2796-4e17-8734-eactfy69ce52",
    "location": "us-test1-a",
    "host": "192.168.1.19",
    "instanceType": "standard",
    "state": "RUNNING",
    "meta": ""
  }
]

Clear Provisions

Description

Removes all instance provisions from the simulated cloud platform.

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision?accessToken=<accessToken>
  • Method: DELETE

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}
  • Success: HTTP CODE 200
  • Data: NA

Example

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision?accessToken=<accessToken>
  • Method: DELETE

RESPONSE

  • Success: HTTP CODE 200
  • Data: NA

Reset Provision

Description

Resets a instance provision (Reprovisioning a used up isntance) on the simulated cloud platform. This process reprovisions a used (Terminated) instance for reuse within the simulated cloud platform.

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision/<provision-host>?accessToken=<accessToken>
  • Method: POST

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}
  • Success: HTTP CODE 200
  • Data:
[
  {
    "nodeId": "<provision-id>",
    "location": "<availability-zone>",
    "host": "<instance-host-address>",
    "instanceType": "<instance-type>",
    "state": "<provision-state>",
    "meta": "<metadata>"
  }
]

Example

REQUEST

  • URI:
http://{host}:{port}/streammanager/api/2.0/admin/controller/provision/192.168.1.21?accessToken=<accessToken>
  • Method: POST

RESPONSE

  • Success: HTTP CODE 200
  • Data:
{
  "nodeId": "provision-36962be9-efc4-4d31-9445-9855be023c90",
  "location": "us-test1-a",
  "host": "192.168.1.21",
  "instanceType": "standard",
  "state": "RUNNING",
  "meta": ""
}