Class: Couchbase::Management::AnalyticsIndexManager
- Inherits:
-
Object
- Object
- Couchbase::Management::AnalyticsIndexManager
- Defined in:
- lib/couchbase/management/analytics_index_manager.rb
Defined Under Namespace
Classes: ConnectLinkOptions, CreateDatasetOptions, CreateDataverseOptions, CreateIndexOptions, DisconnectLinkOptions, DropDatasetOptions, DropDataverseOptions, DropIndexOptions, GetAllDatasetsOptions, GetAllIndexesOptions, GetPendingMutationsOptions
Instance Method Summary collapse
-
#connect_link(options = ConnectLinkOptions.new) ⇒ void
Connects a link.
-
#create_dataset(dataset_name, bucket_name, options = CreateDatasetOptions.new) ⇒ void
Creates a new dataset.
-
#create_dataverse(dataverse_name, options = CreateDataverseOptions.new) ⇒ void
Creates a new dataverse.
-
#create_index(index_name, dataset_name, fields, options = CreateIndexOptions.new) ⇒ void
Creates a new index.
-
#disconnect_link(options = DisconnectLinkOptions.new) ⇒ void
Disconnects a link,.
-
#drop_dataset(dataset_name, options = DropDatasetOptions.new) ⇒ void
Drops a dataset.
-
#drop_dataverse(dataverse_name, options = DropDataverseOptions.new) ⇒ void
Drops a dataverse.
-
#drop_index(index_name, dataset_name, options = DropIndexOptions.new) ⇒ void
Drops an index.
-
#get_all_datasets(options = GetAllDatasetsOptions.new) ⇒ Array<AnalyticsDataset>
Gets all datasets.
-
#get_all_indexes(options = GetAllIndexesOptions.new) ⇒ Array<AnalyticsIndex>
Gets all indexes.
-
#get_pending_mutations(options = GetPendingMutationsOptions.new) ⇒ Hash<String => Integer>
Gets the pending mutations for all datasets.
-
#initialize(backend) ⇒ AnalyticsIndexManager
constructor
A new instance of AnalyticsIndexManager.
Constructor Details
#initialize(backend) ⇒ AnalyticsIndexManager
Returns a new instance of AnalyticsIndexManager.
23 24 25 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 23 def initialize(backend) @backend = backend end |
Instance Method Details
#connect_link(options = ConnectLinkOptions.new) ⇒ void
This method returns an undefined value.
Connects a link
185 186 187 188 189 190 191 192 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 185 def connect_link( = ConnectLinkOptions.new) @backend.analytics_link_connect( .link_name, .force, .dataverse_name, .timeout ) end |
#create_dataset(dataset_name, bucket_name, options = CreateDatasetOptions.new) ⇒ void
This method returns an undefined value.
Creates a new dataset
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 72 def create_dataset(dataset_name, bucket_name, = CreateDatasetOptions.new) @backend.analytics_dataset_create( dataset_name, bucket_name, .condition, .dataverse_name, .ignore_if_exists, .timeout ) end |
#create_dataverse(dataverse_name, options = CreateDataverseOptions.new) ⇒ void
This method returns an undefined value.
Creates a new dataverse
36 37 38 39 40 41 42 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 36 def create_dataverse(dataverse_name, = CreateDataverseOptions.new) @backend.analytics_dataverse_create( dataverse_name, .ignore_if_exists, .timeout ) end |
#create_index(index_name, dataset_name, fields, options = CreateIndexOptions.new) ⇒ void
This method returns an undefined value.
Creates a new index
129 130 131 132 133 134 135 136 137 138 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 129 def create_index(index_name, dataset_name, fields, = CreateIndexOptions.new) @backend.analytics_index_create( index_name, dataset_name, fields.entries, .dataverse_name, .ignore_if_exists, .timeout ) end |
#disconnect_link(options = DisconnectLinkOptions.new) ⇒ void
This method returns an undefined value.
Disconnects a link,
202 203 204 205 206 207 208 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 202 def disconnect_link( = DisconnectLinkOptions.new) @backend.analytics_link_disconnect( .link_name, .dataverse_name, .timeout ) end |
#drop_dataset(dataset_name, options = DropDatasetOptions.new) ⇒ void
This method returns an undefined value.
Drops a dataset
92 93 94 95 96 97 98 99 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 92 def drop_dataset(dataset_name, = DropDatasetOptions.new) @backend.analytics_dataset_drop( dataset_name, .dataverse_name, .ignore_if_does_not_exist, .timeout ) end |
#drop_dataverse(dataverse_name, options = DropDataverseOptions.new) ⇒ void
This method returns an undefined value.
Drops a dataverse
53 54 55 56 57 58 59 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 53 def drop_dataverse(dataverse_name, = DropDataverseOptions.new) @backend.analytics_dataverse_drop( dataverse_name, .ignore_if_does_not_exist, .timeout ) end |
#drop_index(index_name, dataset_name, options = DropIndexOptions.new) ⇒ void
This method returns an undefined value.
Drops an index
150 151 152 153 154 155 156 157 158 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 150 def drop_index(index_name, dataset_name, = DropIndexOptions.new) @backend.analytics_index_drop( index_name, dataset_name, .dataverse_name, .ignore_if_does_not_exist, .timeout ) end |
#get_all_datasets(options = GetAllDatasetsOptions.new) ⇒ Array<AnalyticsDataset>
Gets all datasets
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 106 def get_all_datasets( = GetAllDatasetsOptions.new) resp = @backend.analytics_dataset_get_all(.timeout) resp.map do |entry| AnalyticsDataset.new do |dataset| dataset.name = entry[:name] dataset.dataverse_name = entry[:dataverse_name] dataset.link_name = entry[:link_name] dataset.bucket_name = entry[:bucket_name] end end end |
#get_all_indexes(options = GetAllIndexesOptions.new) ⇒ Array<AnalyticsIndex>
Gets all indexes
165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 165 def get_all_indexes( = GetAllIndexesOptions.new) resp = @backend.analytics_index_get_all(.timeout) resp.map do |entry| AnalyticsIndex.new do |dataset| dataset.name = entry[:name] dataset.dataverse_name = entry[:dataverse_name] dataset.dataset_name = entry[:dataset_name] dataset.is_primary = entry[:is_primary] end end end |
#get_pending_mutations(options = GetPendingMutationsOptions.new) ⇒ Hash<String => Integer>
If a link is disconnected then it will return no results. If all links are disconnected, then
Gets the pending mutations for all datasets.
an empty object is returned.
219 220 221 222 223 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 219 def get_pending_mutations( = GetPendingMutationsOptions.new) @backend.analytics_get_pending_mutations( .timeout ) end |