예제 #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));
        }