예제 #1
0
        public async Task UpdateOriginGroups()
        {
            #region Snippet:Managing_OriginGroups_UpdateAnOriginGroup
            // First we need to get the cdn origin group collection from the specific endpoint
            Profile profile = await resourceGroup.GetProfiles().GetAsync("myProfile");

            CdnEndpoint endpoint = await profile.GetCdnEndpoints().GetAsync("myEndpoint");

            CdnOriginGroupCollection originGroupCollection = endpoint.GetCdnOriginGroups();
            // Now we can get the origin group with GetAsync()
            CdnOriginGroup originGroup = await originGroupCollection.GetAsync("myOriginGroup");

            // With UpdateAsync(), we can update the origin group
            OriginGroupUpdateOptions input = new OriginGroupUpdateOptions()
            {
                HealthProbeSettings = new HealthProbeParameters
                {
                    ProbePath              = "/healthz",
                    ProbeRequestType       = HealthProbeRequestType.Head,
                    ProbeProtocol          = ProbeProtocol.Https,
                    ProbeIntervalInSeconds = 60
                }
            };
            CdnOriginGroupUpdateOperation lro = await originGroup.UpdateAsync(input);

            originGroup = lro.Value;
            #endregion Snippet:Managing_OriginGroups_UpdateAnOriginGroup
        }
예제 #2
0
        public async Task Update()
        {
            Subscription subscription = await Client.GetDefaultSubscriptionAsync();

            ResourceGroup rg = await CreateResourceGroup(subscription, "testRg-");

            string  cdnProfileName = Recording.GenerateAssetName("profile-");
            Profile cdnProfile     = await CreateCdnProfile(rg, cdnProfileName, SkuName.StandardMicrosoft);

            string      cdnEndpointName = Recording.GenerateAssetName("endpoint-");
            CdnEndpoint cdnEndpoint     = await CreateCdnEndpoint(cdnProfile, cdnEndpointName);

            string         cdnOriginGroupName = Recording.GenerateAssetName("origingroup-");
            CdnOriginGroup cdnOriginGroup     = await CreateCdnOriginGroup(cdnEndpoint, cdnOriginGroupName, cdnEndpoint.Data.Origins[0].Name);

            OriginGroupUpdateOptions updateOptions = new OriginGroupUpdateOptions()
            {
                HealthProbeSettings = new HealthProbeParameters
                {
                    ProbePath              = "/healthz",
                    ProbeRequestType       = HealthProbeRequestType.Head,
                    ProbeProtocol          = ProbeProtocol.Https,
                    ProbeIntervalInSeconds = 60
                }
            };
            var lro = await cdnOriginGroup.UpdateAsync(updateOptions);

            CdnOriginGroup updatedCdnOriginGroup = lro.Value;

            ResourceDataHelper.AssertOriginGroupUpdate(updatedCdnOriginGroup, updateOptions);
        }