Beispiel #1
0
        public ManagementConnection(
            string scheme         = Connection.DEFAULT_SCHEME,
            string host           = Connection.DEFAULT_HOST,
            int port              = Connection.DEFAULT_PORT,
            RAIInfra infra        = Connection.DEFAULT_INFRA,
            RAIRegion region      = Connection.DEFAULT_REGION,
            RAICredentials creds  = null,
            bool verifySSL        = Connection.DEFAULT_VERIFY_SSL,
            int connectionTimeout = Connection.DEFAULT_CONNECTION_TIMEOUT
            )
        {
            Scheme            = scheme;
            Host              = host;
            Port              = port;
            Infra             = infra;
            Region            = region;
            Creds             = creds;
            VerifySSL         = verifySSL;
            ConnectionTimeout = connectionTimeout;

            if (creds == null)
            {
                this.Creds = _read_creds(Config.DotRaiConfigPath());
            }

            new DelveCloudClient(this); //to register the connection with a client
        }
Beispiel #2
0
 /// <summary>
 /// CloudConnection constructor
 /// </summary>
 /// <param name="conn">The base connection to use `LocalConnection` parameters from.</param>
 /// <param name="infra">Underlying cloud provider (AWS/AZURE)</param>
 /// <param name="region">Region of rAI Cloud deployments</param>
 /// <param name="creds">Credentials for authenticating with rAI Cloud</param>
 /// <param name="verifySSL">Verify SSL configuration</param>
 /// <param name="computeName">Compute to be used for this connection. If not specified, the default compute will be used.</param>
 public CloudConnection(
     Connection conn,
     RAIInfra infra        = Connection.DEFAULT_INFRA,
     RAIRegion region      = Connection.DEFAULT_REGION,
     RAICredentials creds  = null,
     bool verifySSL        = Connection.DEFAULT_VERIFY_SSL,
     string computeName    = null,
     int connectionTimeout = Connection.DEFAULT_CONNECTION_TIMEOUT
     ) : this(conn.DbName, conn.DefaultOpenMode, conn.Scheme, conn.Host, conn.Port, infra, region, creds, verifySSL, computeName, connectionTimeout)
 {
 }
Beispiel #3
0
 public static RAICredentials _read_creds(string configPath, string profile = "default")
 {
     try {
         // Try to load the credentials.
         return(RAICredentials.FromFile(configPath, profile));
     } catch (Exception e) {
         // No credentials found. It's ok. Let's just warn the user.
         Console.WriteLine(string.Format("[WARN] Credential File ({0}) Not Found!"), Config.DotRaiConfigPath());
     }
     return(null);
 }
 public RAIRequest(
     HttpRequestMessage innerReq,
     RAICredentials creds = null,
     RAIRegion region     = Connection.DEFAULT_REGION,
     string service       = DEFAULT_SERVICE
     )
 {
     this.Creds    = creds;
     this.InnerReq = innerReq;
     this.Region   = region;
     this.Service  = service;
 }
Beispiel #5
0
        /// <summary>
        /// CloudConnection constructor
        /// </summary>
        /// <param name="dbname">database to execute transactions with</param>
        /// <param name="defaultOpenMode">`= TransactionMode.OPEN`: How to open the database `dbname`</param>
        /// <param name="scheme">= `http`: The scheme used for connecting to a running server (e.g., `http`)</param>
        /// <param name="host"> = `127.0.0.1`: The host of a running server.</param>
        /// <param name="port"> = `8010`: The port of a running server.</param>
        /// <param name="infra">Underlying cloud provider (AWS/AZURE)</param>
        /// <param name="region">Region of rAI Cloud deployments</param>
        /// <param name="creds">Credentials for authenticating with rAI Cloud</param>
        /// <param name="verifySSL">Verify SSL configuration</param>
        /// <param name="computeName">Compute to be used for this connection. If not specified, the default compute will be used.</param>
        public CloudConnection(
            string dbname,
            TransactionMode defaultOpenMode = Connection.DEFAULT_OPEN_MODE,
            string scheme         = Connection.DEFAULT_SCHEME,
            string host           = Connection.DEFAULT_HOST,
            int port              = Connection.DEFAULT_PORT,
            RAIInfra infra        = Connection.DEFAULT_INFRA,
            RAIRegion region      = Connection.DEFAULT_REGION,
            RAICredentials creds  = null,
            bool verifySSL        = Connection.DEFAULT_VERIFY_SSL,
            string computeName    = null,
            int connectionTimeout = Connection.DEFAULT_CONNECTION_TIMEOUT
            ) : base(dbname, defaultOpenMode, scheme, host, port, connectionTimeout)
        {
            this.managementConn = new ManagementConnection(scheme, host, port, infra, region, creds, verifySSL, connectionTimeout);
            this.ComputeName    = computeName;

            new DelveClient(this); //to register the connection with a client
        }