Azure Media Encoder允许您配置Web界面上保留单元的数量和大小(基本/标准/高级)。
是否有以编程方式管理此操作的API?
答案 0 :(得分:1)
最近发布的AMS .NET SDK v 3.1.0.0公开了更改保留单元的功能。 以下是如何更新保留单位的代码示例:
var encodingBasicReservedUnit = _dataContext.EncodingReservedUnits.FirstOrDefault();
var initialReservedUnitCount = encodingBasicReservedUnit.CurrentReservedUnits;
encodingBasicReservedUnit.CurrentReservedUnits = encodingBasicReservedUnit.MaxReservableUnits;
encodingBasicReservedUnit.Update();
encodingBasicReservedUnit = _dataContext.EncodingReservedUnits.FirstOrDefault();
Assert.AreEqual(encodingBasicReservedUnit.CurrentReservedUnits, encodingBasicReservedUnit.MaxReservableUnits,
"Expecting Encoding ReservedUnit to have increased to Max");
encodingBasicReservedUnit.CurrentReservedUnits = initialReservedUnitCount;
encodingBasicReservedUnit.Update();
encodingBasicReservedUnit = _dataContext.EncodingReservedUnits.FirstOrDefault();
Assert.AreEqual(encodingBasicReservedUnit.CurrentReservedUnits, initialReservedUnitCount,
"Expecting Encoding ReservedUnit to have decreased again to initialCount from Max");
中找到更多情景测试