Python용 Azure CDN 라이브러리Azure CDN libraries for python

개요Overview

CDN(Azure Content Delivery Network)을 사용하면 전 세계에서 고대역폭 가용성을 보장하기 위해 웹 콘텐츠 캐시를 제공할 수 있습니다.Azure Content Delivery Network (CDN) allows you to provide web content caches to ensure high-bandwidth availability across the globe.

Azure CDN을 시작하려면 Azure CDN 시작을 참조하세요.To get started with Azure CDN, see Getting started with Azure CDN.

관리 APIManagement APIs

관리 API를 사용하여 Azure CDN을 생성, 쿼리 및 관리합니다.Create, query, and manage Azure CDNs with the management API.

pip를 통해 관리 패키지를 설치합니다.Install the management package via pip.

pip install azure-mgmt-cdn

Example

정의된 단일 엔드포인트가 있는 CDN 프로필 만들기:Creating a CDN profile with a single defined endpoint:

from azure.mgmt.cdn import CdnManagementClient

cdn_client = CdnManagementClient(credentials, 'your-subscription-id')
profile_poller = cdn_client.profiles.create('my-resource-group',
                                            'cdn-name',
                                            {
                                                "location": "some_region", 
                                                "sku": {
                                                    "name": "sku_tier"
                                                } 
                                            })
profile = profile_poller.result()

endpoint_poller = cdn_client.endpoints.create('my-resource-group',
                                          'cdn-name',
                                          'unique-endpoint-name', 
                                          { 
                                              "location": "any_region", 
                                              "origins": [
                                                  {
                                                      "name": "origin_name", 
                                                      "host_name": "url"
                                                  }]
                                          })
endpoint = endpoint_poller.result()