Class: Arango::Server
- Inherits:
-
Object
- Object
- Arango::Server
- Includes:
- Helper::Satisfaction, Administration, Databases, Monitoring, OpalSupport, Tasks
- Defined in:
- lib/arango/server.rb,
lib/arango/server/user.rb,
lib/arango/server/async.rb,
lib/arango/server/tasks.rb,
lib/arango/server/agency.rb,
lib/arango/server/databases.rb,
lib/arango/server/monitoring.rb,
lib/arango/server/opal_support.rb,
lib/arango/server/administration.rb
Overview
Arango Server
Defined Under Namespace
Modules: Administration, Agency, Async, Databases, Monitoring, OpalSupport, Tasks, User
Instance Attribute Summary collapse
-
#async ⇒ Object
readonly
Returns the value of attribute async.
-
#base_uri ⇒ Object
readonly
Returns the value of attribute base_uri.
-
#current_database ⇒ Object
Returns the value of attribute current_database.
-
#driver_instance ⇒ Object
readonly
Returns the value of attribute driver_instance.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#tls ⇒ Object
readonly
Returns the value of attribute tls.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #endpoint ⇒ Object
-
#initialize(username: "root", password:, host: "localhost", port: "8529", tls: false, driver_options: nil) ⇒ Arango::Server
constructor
Connect to a ArangoDB server.
-
#transactions ⇒ Arango::Result
Returns information about the currently running transactions.
-
#transactions_running? ⇒ Boolean
Check if transactions are running on server.
Methods included from OpalSupport
Methods included from Tasks
#all_tasks, #create_task, #drop_task, #get_task, #list_tasks, #new_task, #task_exists?
Methods included from Monitoring
#cluster_health, #cluster_statistics
Methods included from Databases
#all_databases, #all_user_databases, #create_database, #database_exists?, #delete_database, #get_database, #list_databases, #list_user_databases, #new_database
Methods included from Administration
#agent?, #available?, #cluster_endpoints, #coordinator?, #detailed_version, #echo, #endpoints, #engine, #enterprise?, #flush_wal, #in_cluster?, #log, #log_level, #log_level=, #mmfiles?, #mode, #mode=, #primary?, #read_only?, #reload_routing, #rocksdb?, #role, #secondary?, #server_id, #shutdown, #single?, #statistics, #statistics_description, #status, #target_version, #time, #version, #wal_properties, #wal_properties=
Methods included from Helper::Satisfaction
#satisfy_category?, #satisfy_class?, #satisfy_class_or_string?, #satisfy_module?, #satisfy_module_or_nil?, #satisfy_module_or_string?, #warning_deprecated
Constructor Details
#initialize(username: "root", password:, host: "localhost", port: "8529", tls: false, driver_options: nil) ⇒ Arango::Server
Connect to a ArangoDB server.
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/arango/server.rb', line 23 def initialize(username: "root", password:, host: "localhost", port: "8529", tls: false, driver_options: nil) @host = host @port = port @tls = tls @username = username @base_uri = "http" @base_uri += "s" if tls @base_uri += "://#{host}:#{port}" = { username: username, password: password } = {} unless @driver_instance = Arango.driver.new(base_uri: base_uri, options: .merge()) end |
Instance Attribute Details
#async ⇒ Object (readonly)
Returns the value of attribute async.
13 14 15 |
# File 'lib/arango/server.rb', line 13 def async @async end |
#base_uri ⇒ Object (readonly)
Returns the value of attribute base_uri.
13 14 15 |
# File 'lib/arango/server.rb', line 13 def base_uri @base_uri end |
#current_database ⇒ Object
Returns the value of attribute current_database.
14 15 16 |
# File 'lib/arango/server.rb', line 14 def current_database @current_database end |
#driver_instance ⇒ Object (readonly)
Returns the value of attribute driver_instance.
13 14 15 |
# File 'lib/arango/server.rb', line 13 def driver_instance @driver_instance end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
13 14 15 |
# File 'lib/arango/server.rb', line 13 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
13 14 15 |
# File 'lib/arango/server.rb', line 13 def port @port end |
#tls ⇒ Object (readonly)
Returns the value of attribute tls.
13 14 15 |
# File 'lib/arango/server.rb', line 13 def tls @tls end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
13 14 15 |
# File 'lib/arango/server.rb', line 13 def username @username end |
Instance Method Details
#endpoint ⇒ Object
36 37 38 |
# File 'lib/arango/server.rb', line 36 def endpoint "tcp://#{@host}:#{@port}" end |
#transactions ⇒ Arango::Result
Returns information about the currently running transactions.
42 43 44 |
# File 'lib/arango/server.rb', line 42 def transactions Arango::Requests::Wal::Transactions.execute(server: self) end |
#transactions_running? ⇒ Boolean
Check if transactions are running on server.
48 49 50 |
# File 'lib/arango/server.rb', line 48 def transactions_running? transactions.running_transactions > 0 end |