Updated on 2024-04-30 GMT+08:00
Selecting an OBS Hosting Mode for Media Assets (Not Available Soon)

Selecting an OBS Hosting Mode for Media Assets (Not Available Soon)

Function

Synchronizes audio/video files stored in OBS buckets to VOD through inventory hosting

OBS provides incremental hosting and inventory hosting. Incremental hosting can be configured only on the VOD console. After the configuration, if new audio and video files are added to OBS, they will be automatically synchronized to VOD. For details, see Incremental Hosting in VOD User Guide. To use incremental hosting and inventory hosting, you need to authorize VOD to access the corresponding OBS bucket. For details, see Bucket Authorization in VOD User Guide.

URI

POST /v1.0/{project_id}/asset/obs/host/stock/task

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token. This parameter is mandatory when token authentication is used.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token.

Authorization

No

String

Authentication information. This parameter is mandatory for AK/SK authentication.

X-Sdk-Date

No

String

Time when the request is sent. This parameter is mandatory for AK/SK authentication.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

bucket

Yes

String

Source bucket name

object

Yes

String

Source directory name or source file name

suffix

No

Array of strings

File name extension list for batch hosting. If this parameter is not specified or is left empty, all audio/video files are hosted and file name extensions are not filtered out.

template_group_name

No

String

Name of a transcoding template group

If this parameter is specified, the specified transcoding template is used to transcode the uploaded audio/video. You can configure a transcoding template on the VOD console. For details, see Transcoding Settings.

NOTE:

If both template_group_name and workflow_name are specified, template_group_name takes effect.

workflow_name

No

String

Workflow name

If this parameter is specified, the specified workflow is used to transcode the uploaded audio/video. You can configure a workflow on the VOD console. For details, see Transcoding Settings in VOD User Guide.

host_type

No

Integer

Type of the location where media files generated after audio/video processing are stored

Possible values are:

  • 0: Files are stored in a VOD bucket.

  • 1: Files are stored in a tenant bucket.

  • 2: Files are stored in a tenant bucket and the storage path is the same as that of the source file.

output_bucket

No

String

Output bucket name. This parameter is mandatory when host_type is set to 1.

output_path

No

String

Output path name. This parameter is mandatory when host_type is set to 1.

Response Parameters

Status code: 202

Table 4 Response body parameters

Parameter

Type

Description

task_id

String

Task ID

Status code: 403

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error description

Example Requests

Creates a media file and uses the inventory hosting mode to synchronize media files in OBS buckets to VOD.

POST https://{endpoint}/v1.0/{project_id}/asset/obs/host/stock/task

{
  "bucket" : "obs-gg",
  "object" : "1/Shoushu_FLV.flv",
  "suffix" : [ ],
  "template_group_name" : "original_template_group",
  "host_type" : 1,
  "output_bucket" : "obs-gg",
  "output_path" : "ouput/"
}

Example Responses

Status code: 202

The information is returned when the request succeeds.

{
  "task_id" : "456"
}

Status code: 403

The information is returned when the request fails.

{
  "error_code" : "VOD.10053",
  "error_msg" : "The request parameter is illegal, illegal field: {xx}."
}

Status Codes

Status Code

Description

202

The information is returned when the request succeeds.

403

The information is returned when the request fails.

Error Codes

See Error Codes.