Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PhoenixClient"/> class. If the client is used
 /// within a VNET or on an on-premise cluster, no cluster credentials required. Pass null in
 /// this case.
 /// </summary>
 public PhoenixClient(ClusterCredentials credentials)
 {
     if (credentials != null) // gateway mode
     {
         _requester = new GatewayWebRequester(credentials);
     }
     else // vnet mode
     {
         _requester = new VNetWebRequester();
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PhoenixClient"/> class. If the client is used
 /// within a VNET or on an on-premise cluster, no cluster credentials required. Pass null in 
 /// this case.
 /// </summary>
 public PhoenixClient(ClusterCredentials credentials)
 {
     if (credentials != null) // gateway mode
     {
         _requester = new GatewayWebRequester(credentials);
     }
     else // vnet mode
     {
         _requester = new VNetWebRequester();
     }
 }
        internal static ClusterCredentials CreateFromList(List<string> lines)
        {
            if (lines.Count() != 3)
            {
                throw new ArgumentException(
                    string.Format(
                        CultureInfo.InvariantCulture,
                        "Expected the credentials file to have exactly three lines, " +
                        "first containing the cluster URL, second the username, third the password. " + "Given {0} lines!",
                        lines.Count()),
                        "lines");
            }

            var rv = new ClusterCredentials(new Uri(lines[0]), lines[1], lines[2]);
            return rv;
        }
 public void TestInitialize()
 {
     _credentials = ClusterCredentialsFactory.CreateFromFile(@"credentials.txt");
 }