REST Api中的Azure媒体服务AssetDeliveryPolicies - 它们消失了吗?

时间:2015-07-15 20:34:42

标签: rest azure azure-media-services

我正在编写应用程序,其中我上传视频,对其进行编码,然后我需要公开链接到编码视频。其中一个步骤是创建AssetDeliveryPolicies并将其链接到Asset,我试图这样做,但令我惊讶的是我在该端点上看不到AssetDeliveryPolicies这样的实体:

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

有人试图做那样的事吗?我不确定我是做错了什么还是已经弃用并以其他方式处理。

1 个答案:

答案 0 :(得分:1)

创建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编码值。

Source