Fungsi REST API
Fungsi berikut mendukung entitas Microsoft Azure Media Services dengan melakukan berbagai tugas seperti membatalkan pekerjaan, mengambil kunci perlindungan, dan sebagainya.
CancelJob
. Mengambil parameter berikut: jobid jenis Edm.String
.
GetProtectionKeyId
. Mengambil parameter berikut: contentKeyType jenis Edm.Int32
. Menampilkan Edm.String
.
GetProtectionKey
. Mengambil parameter berikut: protectionKeyId jenis Edm.String
. Menampilkan Edm.String
.
CreateFileInfos
. Mengambil parameter berikut: assetid jenis Edm.String
.
RebindContentKey
. Mengambil parameter berikut: id jenis Edm.String
, x509Certificate jenis Edm.String
. Menampilkan Edm.String
.
Publish
. Mengambil parameter berikut: assetid jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.Asset
.
GetKeyDeliveryUrl
. Mengambil parameter berikut: contentKey jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.ContentKey
, keyDeliveryType jenis Edm.String
. Menampilkan Edm.Int32
.
Start
. Mengambil parameter berikut: streamingEndpoint jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.StreamingEndpoint
.
Start
. Mengambil parameter berikut: saluran jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.Channel
.
Start
. Mengambil parameter berikut: program jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.Program
.
Stop
. Mengambil parameter berikut: streamingEndpoint jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.StreamingEndpoint
.
Stop
. Mengambil parameter berikut: saluran jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.Channel
.
Stop
. Mengambil parameter berikut: program jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.Program
.
Scale
. Mengambil parameter berikut: streamingEndpoint jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.StreamingEndpoint
, scaleUnits jenis Edm.String
.
ShowSlate
. Mengambil parameter berikut: saluran jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.Channel
, durasi jenis Edm.Time
, assetId jenis Edm.String
.
StartAdvertisement
. Mengambil parameter berikut: saluran jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.Channel
, durasiEdm.Time
jenis, cueId jenis Edm.Int32
, showSlate jenis Edm.Boolean
.
HideSlate
. Mengambil parameter berikut: saluran jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.Channel
.
EndAdvertisement
. Mengambil parameter berikut: saluran jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.Channel
, cueId jenis Edm.Int32
.
Reset
. Mengambil parameter berikut: saluran jenis Microsoft.Cloud.Media.Vod.Rest.Data.Models.Channel
.
Penting
Saat mengakses entitas di Media Services, Anda harus menetapkan bidang dan nilai header tertentu dalam permintaan HTTP Anda.
Untuk informasi selengkapnya, lihat Penyiapan untuk Pengembangan REST API Media Services dan Menyambungkan ke Media Services dengan MEDIA Services REST API.
Topik lainnya menunjukkan beberapa contoh cara memanggil fungsi menggunakan REST.
CancelJob
Menjalankan Pekerjaan dapat dibatalkan dengan memanggil CancelJob dan meneruskan Id Pekerjaan dari Pekerjaan yang sedang berjalan.
Metode | Meminta URI | Versi HTTP |
---|---|---|
GET | <https:// accountname.restv2>.<location.media.azure.net/api/CancelJob?jobid>='URL-encodedvalue' | HTTP/1.1 |
Permintaan Sampel
Untuk mendapatkan yang terbaru x-ms-version:
, lihat Media Services REST.
GET https://<accountname>.restv2.<location>.media.azure.net/api/CancelJob?jobid='nb%3ajid%3aUUID%3a9e9533ba-2b9b-fa4c-a33d-73eebd49039b' HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.19
Authorization: Bearer <token value>
Host: media.windows.net
CreateFileInfos
Entitas File dibuat menggunakan fungsi CreateFileInfos dan meneruskan Id Aset yang terkait dengan file media yang Anda unggah ke penyimpanan blob. Untuk informasi selengkapnya, lihat Mengunggah file ke penyimpanan blob.
Metode | Meminta URI | Versi HTTP |
---|---|---|
GET | <https:// accountname.restv2>.<location.media.azure.net/api/CreateFileInfos?assetid>='URL-encodedvalue' | HTTP/1.1 |
Permintaan Sampel
Untuk mendapatkan yang terbaru x-ms-version:
, lihat Media Services REST.
GET https://<accountname>.restv2.<location>.media.azure.net/api/CreateFileInfos?assetid='nb%3Acid%3AUUID%3Ac80d312d-7cb1-44aa-bb23-2c35d10c44bd' HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.19
Authorization: Bearer <token value>
Host: media.windows.net
Content-Length: 0
GetProtectionKeyId
Fungsi GetProtectionKeyId mengambil thumbprint sertifikat X.509 yang digunakan untuk memastikan bahwa Anda memiliki sertifikat yang benar yang diinstal pada komputer Anda saat mengenkripsi kunci konten yang ditentukan pengguna. Daftar nilai yang mungkin untuk peta parameter contentKeyType ke nilai enumerasi ContentKeyType pada entitas ContentKey. Untuk informasi selengkapnya, lihat Properti Entitas ContentKey.
Metode | Meminta URI | Versi HTTP |
---|---|---|
GET | <https:// accountname.restv2>.<location.media.azure.net/api/GetProtectionKeyId?contentKeyType>=value | HTTP/1.1 |
Permintaan Sampel
Untuk mendapatkan yang terbaru x-ms-version:
, lihat Media Services REST.
GET https://<accountname>.restv2.<location>.media.azure.net/api/GetProtectionKeyId?contentKeyType=1 HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.19
Authorization: Bearer <token value>
Host: media.windows.net
GetProtectionKey
GetProtectionKey mengambil sertifikat X.509 tertentu yang harus digunakan untuk mengenkripsi kunci konten yang ditentukan pengguna Anda.
Metode | Meminta URI | Versi HTTP |
---|---|---|
GET | <https:// accountname.restv2>.<location.media.azure.net/api/GetProtectionKey?ProtectionKeyId>='value' | HTTP/1.1 |
Permintaan Sampel
Untuk mendapatkan yang terbaru x-ms-version:
, lihat Media Services REST.
GET https://<accountname>.restv2.<location>.media.azure.net/api/GetProtectionKey?ProtectionKeyId='B2FE17BEF56FFCB9A3FC4267D0F2AFE25CD2DE22' HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.19
Authorization: Bearer <token value>
Host: media.windows.net
RebindContentKey
Jika Anda ingin mengambil kunci konten terenkripsi Anda kembali dari Media Services, panggil RebindContentKey dan teruskan Id ContentKey Anda dan sertifikat X.509 (hanya dengan kunci umum) yang digunakan untuk mengenkripsi enkripsi penyimpanan yang jelas/kunci konten perlindungan umum. Jika Anda memanggil RebindContentKey dan meneruskan string kosong ke parameter x509Certificate, kunci konten Anda dikodekan base64 dan dikembalikan dengan jelas.
Metode | Meminta URI | Versi HTTP |
---|---|---|
GET | <https:// accountname.restv2>.<location.media.azure.net/api/RebindContentKey?id>='contentkeyid'&x509Certificate='URL-encodedvalue' | HTTP/1.1 |
Permintaan Sampel
Untuk mendapatkan yang terbaru x-ms-version:
, lihat Media Services REST.
GET https://<accountname>.restv2.<location>.media.azure.net/api/RebindContentKey?id='nb%3akid%3aUUID%3a2eeba14e-613e-4af7-a926-413372cca8d5'&x509Certificate='' HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.19
Authorization: Bearer <token value>
Host: media.windows.net