Azure媒体服务在REST Api中的资产交付策略——它们消失了吗?



我正在编写应用程序,我上传视频,编码它,然后我需要暴露一个链接到编码的视频。其中一个步骤是创建AssetDeliveryPolicies并将其链接到资产,我试图这样做,但令我惊讶的是,我没有在该端点上看到AssetDeliveryPolicies这样的实体:

 https://wamsamsclus001rest-hs.cloudapp.net/api/AssetDeliveryPolicies

有人试过那样做吗?我不确定我是否做错了什么,或者它已经被弃用并以其他方式处理。

创建AccessDeliveryPolicy

POST https://media.windows.net/api/AssetDeliveryPolicies HTTP/1.1
Content-Type: application/json
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Accept: application/json
Accept-Charset: UTF-8
Authorization: Bearer [token here]
x-ms-version: 2.11
x-ms-client-request-id: [guid here]
Host: media.windows.net
{"Name":"Clear Policy",
"AssetDeliveryProtocol":7,
"AssetDeliveryPolicyType":2,
"AssetDeliveryConfiguration":null}

链接一个AssetDeliveryPolicy到一个资产

POST https://media.windows.net/api/Assets('nb%3Acid%3AUUID%3A86933344-9539-4d0c-be7d-f842458693e0')/$links/DeliveryPolicies HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Accept: application/json
Accept-Charset: UTF-8
Content-Type: application/json
Authorization: Bearer [token here]
x-ms-version: 2.11
x-ms-client-request-id: [new guid here]
Host: media.windows.net
{"uri":"https://media.windows.net/api/AssetDeliveryPolicies('nb%3Aadpid%3AUUID%3A92b0f6ba-3c9f-49b6-a5fa-2a8703b04ecd')"}

其中nb%3Acid%3AUUID%3A86933344-9539-4d0c-be7d-f842458693e0为AssetId的URL编码值,nb%3Aadpid%3AUUID%3A92b0f6ba-3c9f-49b6-a5fa-2a8703b04ecd为AccessDeliveryPolicy Id的URL编码值。

最新更新