Creating a Video Source
Function
This API is used to create a video source.
URI
POST /v2/{project_id}/source
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID and Name. Maximum: 64 |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. For details about how to obtain a user token, see Authentication. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
video_source_name |
Yes |
String |
Video source name. The value can contain only letters, digits, spaces, and the following special characters: .-_(). It cannot start or end with a space. Minimum: 1 Maximum: 100 |
access_type |
Yes |
String |
Access type, which can be cloud or edge. |
type |
Yes |
String |
Type: obs, vcn, url, restful, and camera |
latitude |
No |
String |
Latitude of the video source. The value ranges from -90.00000 to 90.00000. |
longitude |
No |
String |
Longitude of the video source. The value ranges from -180.00000 to 180.00000. |
video_group_ids |
No |
Array of strings |
IDs of all video source groups. An ID is a string of 4 to 36 characters consisting of only lowercase letters, digits, hyphens (-), and underscores (_). |
type_config |
Yes |
String |
XML file of video source configuration information URL format: <type>URL</type> <config> <URL_ADDRESS></URL_ADDRESS> </config> VCN format: <type>VCN</type> <config> <DATA_SOURCE_ID></DATA_SOURCE_ID> <STREAM_TYPE></STREAM_TYPE> <IP></IP> <PORT></PORT> <USER_NAME></USER_NAME> <PASSWORD></PASSWORD> </config> RESTful format: <type>RESTFUL</type> <config> <HTTP_CHECK></HTTP_CHECK> <URL></URL> <RTSP_URL></RTSP_URL> </config> Camera format: <type>CAMERA</type> <config> <EDGE_CAMERA_ID></EDGE_CAMERA_ID> </config> Maximum: 1024 |
tag |
No |
Array of strings |
Video source tag. A maximum of four tags can be selected. Only letters, digits, hyphens (-), and underscores (_) are allowed. Minimum length: 1 character Maximum length: 10 characters |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
video_source_id |
String |
Video source ID |
Example Requests
Request body for creating a video source
/v2/{project_id}/source/sources/{video_source_id} { "video_source_name" : "url_test", "access_type" : "cloud", "type" : "url", "longitude" : "", "latitude" : "", "tag" : [ ], "video_group_ids" : [ ], "type_config" : "<type_config> <url_address>rtsp://12.12.12.12:333</url_address> </type_config>" }
Example Responses
Status code: 200
Video source information
{ "video_source_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" }
Status Codes
Status Code |
Description |
---|---|
200 |
Video source information |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot