/// <summary>
        /// The create persistence profile http cookie.
        /// </summary>
        /// <param name="networkId">
        /// The network id.
        /// </param>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <param name="serverFarmId">
        /// The server farm id.
        /// </param>
        /// <param name="timeOutMinutes">
        /// The time out minutes.
        /// </param>
        /// <param name="cookieName">
        /// The cookie name.
        /// </param>
        /// <param name="cookieType">
        /// The cookie type.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <Status> CreatePersistenceProfileHttpCookie(
            string networkId,
            string name,
            string serverFarmId,
            int timeOutMinutes,
            string cookieName,
            PersistenceProfileCookieType cookieType)
        {
            var persProfile = new NewPersistenceProfile
            {
                name           = name,
                serverFarmId   = serverFarmId,
                timeoutMinutes = timeOutMinutes.ToString(CultureInfo.InvariantCulture),
                type           = PersistenceProfileType.HTTP_COOKIE,
                cookieName     = cookieName,
                cookieType     = cookieType.ToString()
            };


            Status status =
                await
                this._apiClient.PostAsync <NewPersistenceProfile, Status>(
                    ApiUris.CreateOrGetVipPersistenceProfile(this._apiClient.OrganizationId, networkId),
                    persProfile);

            return(status);
        }
Beispiel #2
0
 public static async Task <Status> CreatePersistenceProfileHttpCookie(
     this IComputeApiClient client,
     string networkId,
     string name,
     string serverFarmId,
     int timeOutMinutes,
     string cookieName,
     PersistenceProfileCookieType cookieType)
 {
     return
         (await
          client.NetworkingLegacy.NetworkVip.CreatePersistenceProfileHttpCookie(
              networkId,
              name,
              serverFarmId,
              timeOutMinutes,
              cookieName,
              cookieType));
 }
		/// <summary>
		/// Create a HttpCookie persistence profile for network VIP
		/// </summary>
		/// <param name="client">
		/// The <see cref="IComputeApiClient"/> object.
		/// </param>
		/// <param name="networkId">
		/// The network id
		/// </param>
		/// <param name="name">
		/// </param>
		/// <param name="serverFarmId">
		/// </param>
		/// <param name="timeOutMinutes">
		/// </param>
		/// <param name="cookieName">
		/// </param>
		/// <param name="cookieType">
		/// </param>
		/// <returns>
		/// The <see cref="Task"/>.
		/// </returns>
		public static async Task<Status> CreatePersistenceProfileHttpCookie(this IComputeApiClient client, string networkId, 
			string name, string serverFarmId, int timeOutMinutes, string cookieName, PersistenceProfileCookieType cookieType)
		{
			var persProfile = new NewPersistenceProfile
			{
				name = name, 
				serverFarmId = serverFarmId, 
				timeoutMinutes = timeOutMinutes.ToString(CultureInfo.InvariantCulture), 
				type = PersistenceProfileType.HTTP_COOKIE, 
				cookieName = cookieName, 
				cookieType = cookieType.ToString()
			};


			Status status =
				await
					client.WebApi.ApiPostAsync<NewPersistenceProfile, Status>(
						ApiUris.CreateOrGetVipPersistenceProfile(client.Account.OrganizationId, networkId), persProfile);
			return status;
		}
		public static async Task<Status> CreatePersistenceProfileHttpCookie(
			this IComputeApiClient client,
			string networkId,
			string name,
			string serverFarmId,
			int timeOutMinutes,
			string cookieName,
			PersistenceProfileCookieType cookieType)
		{
			return
				await
				client.NetworkingLegacy.NetworkVip.CreatePersistenceProfileHttpCookie(
					networkId,
					name,
					serverFarmId,
					timeOutMinutes,
					cookieName,
					cookieType);
		}