Ejemplo n.º 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
            ProfileResource profile = await resourceGroup.GetProfiles().GetAsync("myProfile");

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

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

            // With UpdateAsync(), we can update the origin group
            PatchableCdnOriginGroupData input = new PatchableCdnOriginGroupData()
            {
                HealthProbeSettings = new HealthProbeParameters
                {
                    ProbePath              = "/healthz",
                    ProbeRequestType       = HealthProbeRequestType.Head,
                    ProbeProtocol          = ProbeProtocol.Https,
                    ProbeIntervalInSeconds = 60
                }
            };
            ArmOperation <CdnOriginGroupResource> lro = await originGroup.UpdateAsync(WaitUntil.Completed, input);

            originGroup = lro.Value;
            #endregion Snippet:Managing_OriginGroups_UpdateAnOriginGroup
        }
Ejemplo n.º 2
0
        public async Task DeleteOriginGroups()
        {
            #region Snippet:Managing_OriginGroups_DeleteAnOriginGroup
            // First we need to get the cdn origin group collection from the specific endpoint
            ProfileResource profile = await resourceGroup.GetProfiles().GetAsync("myProfile");

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

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

            // With DeleteAsync(), we can delete the origin group
            await originGroup.DeleteAsync(WaitUntil.Completed);

            #endregion Snippet:Managing_OriginGroups_DeleteAnOriginGroup
        }