Esempio n. 1
0
        /// <summary>
        /// The get vpn host.
        /// </summary>
        /// <param name="vendor">
        /// The vendor.
        /// </param>
        /// <param name="region">
        /// The region.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        /// <exception cref="ComputeApiException">
        /// </exception>
        public Uri GetVpnUrl(KnownApiVendor vendor, KnownApiRegion region)
        {
            const string urltemplate = "https://{0}/";
            string       key         = region.ToString();

            if (!KnownVpnHostNames.ContainsKey(key))
            {
                throw new ApiHostNotFoundException(vendor, region);
            }
            string apiurl = string.Format(urltemplate, KnownVpnHostNames[key]);

            return(new Uri(apiurl));
        }
Esempio n. 2
0
 /// <summary>	The add vpn host name. </summary>
 /// <param name="region">	The region. </param>
 /// <param name="apiUrl">	The API url. </param>
 private void AddVpnHostName(KnownApiRegion region, string apiUrl)
 {
     KnownVpnHostNames.Add(region.ToString(), apiUrl);
 }