Python용 Azure CDN 라이브러리

개요

CDN(Azure Content Delivery Network)을 사용하면 전 세계에서 고대역폭 가용성을 보장하기 위해 웹 콘텐츠 캐시를 제공할 수 있습니다.

Azure CDN을 시작하려면 Azure CDN 시작을 참조하세요.

관리 API

관리 API를 사용하여 Azure CDN을 생성, 쿼리 및 관리합니다.

pip를 통해 관리 패키지를 설치합니다.

pip install azure-mgmt-cdn

예제

정의된 단일 엔드포인트가 있는 CDN 프로필 만들기:

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()