- URL:
- https://<root>/services/serviceName/addLayer
- Methods:
POST- Version Introduced:
- 12.0
Description
The add operation adds additional layers to an existing video service. The add operation is performed on a video service resource. Video services can be created manually via the portal Sharing REST API as seen in the Portal Sharing REST API documentation. Note that the created service must be set to the video output type and must have a value specified for the service property. For example:
{"serviceName":"sampleServiceName"}Request parameters
| Parameter | Details |
|---|---|
| A JSON object specifying the properties of the newly created service. See the Properties for Create Parameters section below for more information. |
(Required) | The response format. The default format is Values: |
| Users interacting programmatically with this endpoint must generate a token that must be included as a request parameter. A token can be obtained using the Generate Token operation. |
Properties for Create Parameters
| Parameter | Details |
|---|---|
(Required) | The type of layer being added. The type specified by this property must match the parent service's type otherwise the request will be rejected. Values: |
(Required) | The name for the new layer. The minimum requirement for the |
(Required for | The type of livestream being added as a layer. This property is only applicable to Values: |
(Required for | The URI for the livestream being added as a layer. The format of this URI must match the format expected of the selected |
(Required) | A JSON objects that contains information about the layer's data source. The JSON object supports the following properties, the use of which depends on the layer type:
|
(Optional) | The id of a layer. If not specified, it will default based upon the number of layers in the service. |
(Optional) | A buffer time can be chosen to force a buffer period between the start time of the livestream and the real-time position of the video. For example, there can be a thirty second buffer period at the beginning of the video. This parameter expects an integer equating to the buffer time in seconds. |
(Optional for | Defines the start mechanism for the livestream feed. This can be Values: |
(Optional for | Defines the stop mechanism for the livestream feed. This can be Values: |
(Optional) | Specifies any copyright text, which will be included as part of the layer's metadata. |
(Optional) | A string that defines the layer's contents. |
(Optional) | The
For more information on the values above, see the Update Camera endpoint documentation. |
(Optional) | The desired video resolution for the layer being created. Multiple resolution options can be specified. For Values: |
(Optional) | If enabled, records the livestream as it plays, allowing for the (Convert to On-Demand)[/process] operation to take place when the stream ends. Values: |
Importing an existing feature layer from portal
ArcGIS Video Server has the ability to import the data from an existing feature layer located on a portal. This allows users to utilize data from feature layers which may already be involved in workflows on the portal, while simultaneously utilizing the benefits of a video service.
Create parameter properties for importing a feature layer
| Parameter | Details |
|---|---|
(Required) | This is the primary property required for importing a feature layer. It will need to be nested inside of an |
(Required) | The item ID of the feature service. This can be found in the item's Item Details page in the portal, or by viewing the item in the Portal Directory API. |
(Required) | This is the layer ID of the specific layer within the related feature service being imported. |
(Required) | A comma delimited list of object IDs within the imported feature service. |
(Required) | The |
(Required) | The For example, if we want to have a field titled "name" and we need it to be based off of a |
Example add Layer JSON
The following are sample create JSON objects that can be included in a request to the add operation. Because the provided properties vary based on the type of layer, the following samples cover the two types.
Publishing on-demand layers can be done using files uploaded locally via the Uploads endpoint or a cloud store registered with the Video Server. The first example uses an uploaded file ID, while the second uses the file ID of a video stored on a registered cloud store.
{
"type" : "ondemand",
"name" : "on_demand_sample",
"requestedResolutions" : "sd, hd, fhd",
"inputs" : {
"fileIds" : "i96f7ddf8-5b1a-420d-991e-83d50a65e23a",
}
}{
"name": "sample_data_store_layer",
"type": "ondemand",
"inputs" : {
"stores" : [
{
"datastoreId" : "03938eda57c44b0aa859e4cb9a29e5d3",
"paths" : [
"filename.ts"
]
}
]
}
}Note that the stores property uses a JSON array that specifies the appropriate cloud stores. TheDescribe endpoint can be used to view the directories and find the values for the datastore and paths properties.
Example usage
The following is a sample POST request for the add operation:
POST /rest/services/sampleService/VideoServer/addLayer HTTP/1.1
Host: organization.example.com:21443
Content-Type: application/x-www-form-urlencoded
Content-Length: [ ]
createParameters={
"name": "TestODLayer_01",
"type": "ondemand",
"inputs": {
"fileIds": "i9bc97626-b628-4bcc-9fe3-6314bb50c760",
"cameraInfo": {
"height": 45,
"position": {"x":39.0256459,"y":-76.4362445},
"heading": 17,
"tilt": 50,
"fov": 90,
"farDistance": 45
}
}
}&f=pjson&token=<token>JSON Response syntax
{
"jobId": "<jobId>",
"success": <true | false>
"error": { //only if success is false
"code": <code>,
"description": <description>
}
}JSON Response example
{
"jobId": "<jobId>",
"success": <true>
}