Esempio n. 1
0
        public TrafficManagerProfile SetTrafficManagerProfile(TrafficManagerProfile profile)
        {
            var parameters = new ProfileCreateOrUpdateParameters
            {
                Profile = profile.ToSDKProfile()
            };

            ProfileCreateOrUpdateResponse response = this.TrafficManagerManagementClient.Profiles.CreateOrUpdate(
                profile.ResourceGroupName,
                profile.Name,
                parameters
                );

            return(TrafficManagerClient.GetPowershellTrafficManagerProfile(profile.ResourceGroupName, profile.Name, response.Profile));
        }
 /// <summary>
 /// Create or update a Traffic Manager profile.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.TrafficManager.IProfileOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group containing the Traffic
 /// Manager profile.
 /// </param>
 /// <param name='profileName'>
 /// Required. The name of the Traffic Manager profile.
 /// </param>
 /// <param name='parameters'>
 /// Required. The Traffic Manager profile parameters supplied to the
 /// CreateOrUpdate operation.
 /// </param>
 /// <returns>
 /// The response to a Traffic Manager profile 'CreateOrUpdate'
 /// operation.
 /// </returns>
 public static Task <ProfileCreateOrUpdateResponse> CreateOrUpdateAsync(this IProfileOperations operations, string resourceGroupName, string profileName, ProfileCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, profileName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Create or update a Traffic Manager profile.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.TrafficManager.IProfileOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group containing the Traffic
 /// Manager profile.
 /// </param>
 /// <param name='profileName'>
 /// Required. The name of the Traffic Manager profile.
 /// </param>
 /// <param name='parameters'>
 /// Required. The Traffic Manager profile parameters supplied to the
 /// CreateOrUpdate operation.
 /// </param>
 /// <returns>
 /// The response to a Traffic Manager profile 'CreateOrUpdate'
 /// operation.
 /// </returns>
 public static ProfileCreateOrUpdateResponse CreateOrUpdate(this IProfileOperations operations, string resourceGroupName, string profileName, ProfileCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IProfileOperations)s).CreateOrUpdateAsync(resourceGroupName, profileName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
        public TrafficManagerProfile SetTrafficManagerProfile(TrafficManagerProfile profile)
        {
            var parameters = new ProfileCreateOrUpdateParameters
            {
                Profile = profile.ToSDKProfile()
            };

            ProfileCreateOrUpdateResponse response = this.TrafficManagerManagementClient.Profiles.CreateOrUpdate(
                profile.ResourceGroupName,
                profile.Name,
                parameters
                );

            return TrafficManagerClient.GetPowershellTrafficManagerProfile(profile.ResourceGroupName, profile.Name, response.Profile);
        }