Class: Couchbase::Management::AnalyticsIndexManager
- Inherits:
-
Object
- Object
- Couchbase::Management::AnalyticsIndexManager
- Defined in:
- lib/couchbase/management/analytics_index_manager.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/management/analytics_index_manager.rb more...
Instance Method Summary collapse
-
#connect_link(options = Options::Analytics::ConnectLink.new) ⇒ void
Connects a link.
-
#create_dataset(dataset_name, bucket_name, options = Options::Analytics::CreateDataset.new) ⇒ void
Creates a new dataset.
-
#create_dataverse(dataverse_name, options = Options::Analytics::CreateDataverse.new) ⇒ void
Creates a new dataverse.
-
#create_index(index_name, dataset_name, fields, options = Options::Analytics::CreateIndex.new) ⇒ void
Creates a new index.
-
#create_link(link, options = Options::Analytics::CreateLink.new) ⇒ void
Creates a link.
-
#disconnect_link(options = Options::Analytics::DisconnectLink.new) ⇒ void
Disconnects a link,.
-
#drop_dataset(dataset_name, options = Options::Analytics::DropDataset.new) ⇒ void
Drops a dataset.
-
#drop_dataverse(dataverse_name, options = Options::Analytics::DropDataverse.new) ⇒ void
Drops a dataverse.
-
#drop_index(index_name, dataset_name, options = Options::Analytics::DropIndex.new) ⇒ void
Drops an index.
-
#drop_link(link_name, dataverse_name, options = Options::Analytics::DropLink.new) ⇒ void
Drops the link.
-
#get_all_datasets(options = Options::Analytics::GetAllDatasets.new) ⇒ Array<AnalyticsDataset>
Gets all datasets.
-
#get_all_indexes(options = Options::Analytics::GetAllIndexes.new) ⇒ Array<AnalyticsIndex>
Gets all indexes.
-
#get_links(options = Options::Analytics::GetLinks.new) ⇒ void
Retrieves the links.
-
#get_pending_mutations(options = Options::Analytics::GetPendingMutations.new) ⇒ Hash<String => Integer>
Gets the pending mutations for all datasets.
-
#initialize(backend) ⇒ AnalyticsIndexManager
constructor
A new instance of AnalyticsIndexManager.
-
#replace_link(link, options = Options::Analytics::ReplaceLink.new) ⇒ void
Replaces the link.
Constructor Details
#initialize(backend) ⇒ AnalyticsIndexManager
Returns a new instance of AnalyticsIndexManager.
630 631 632 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 630 def initialize(backend) @backend = backend end |
Instance Method Details
#connect_link(options = Options::Analytics::ConnectLink.new) ⇒ void
This method returns an undefined value.
Connects a link
759 760 761 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 759 def connect_link( = Options::Analytics::ConnectLink.new) @backend.analytics_link_connect(.to_backend) end |
#create_dataset(dataset_name, bucket_name, options = Options::Analytics::CreateDataset.new) ⇒ void
This method returns an undefined value.
Creates a new dataset
671 672 673 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 671 def create_dataset(dataset_name, bucket_name, = Options::Analytics::CreateDataset.new) @backend.analytics_dataset_create(dataset_name, bucket_name, .to_backend) end |
#create_dataverse(dataverse_name, options = Options::Analytics::CreateDataverse.new) ⇒ void
This method returns an undefined value.
Creates a new dataverse
643 644 645 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 643 def create_dataverse(dataverse_name, = Options::Analytics::CreateDataverse.new) @backend.analytics_dataverse_create(dataverse_name, .to_backend) end |
#create_index(index_name, dataset_name, fields, options = Options::Analytics::CreateIndex.new) ⇒ void
This method returns an undefined value.
Creates a new index
716 717 718 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 716 def create_index(index_name, dataset_name, fields, = Options::Analytics::CreateIndex.new) @backend.analytics_index_create(index_name, dataset_name, fields.entries, .to_backend) end |
#create_link(link, options = Options::Analytics::CreateLink.new) ⇒ void
This method returns an undefined value.
Creates a link
797 798 799 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 797 def create_link(link, = Options::Analytics::CreateLink.new) @backend.analytics_link_create(link.to_backend, .to_backend) end |
#disconnect_link(options = Options::Analytics::DisconnectLink.new) ⇒ void
This method returns an undefined value.
Disconnects a link,
771 772 773 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 771 def disconnect_link( = Options::Analytics::DisconnectLink.new) @backend.analytics_link_disconnect(.to_backend) end |
#drop_dataset(dataset_name, options = Options::Analytics::DropDataset.new) ⇒ void
This method returns an undefined value.
Drops a dataset
684 685 686 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 684 def drop_dataset(dataset_name, = Options::Analytics::DropDataset.new) @backend.analytics_dataset_drop(dataset_name, .to_backend) end |
#drop_dataverse(dataverse_name, options = Options::Analytics::DropDataverse.new) ⇒ void
This method returns an undefined value.
Drops a dataverse
656 657 658 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 656 def drop_dataverse(dataverse_name, = Options::Analytics::DropDataverse.new) @backend.analytics_dataverse_drop(dataverse_name, .to_backend) end |
#drop_index(index_name, dataset_name, options = Options::Analytics::DropIndex.new) ⇒ void
This method returns an undefined value.
Drops an index
730 731 732 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 730 def drop_index(index_name, dataset_name, = Options::Analytics::DropIndex.new) @backend.analytics_index_drop(index_name, dataset_name, .to_backend) end |
#drop_link(link_name, dataverse_name, options = Options::Analytics::DropLink.new) ⇒ void
This method returns an undefined value.
Drops the link
824 825 826 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 824 def drop_link(link_name, dataverse_name, = Options::Analytics::DropLink.new) @backend.analytics_link_drop(link_name, dataverse_name, .to_backend) end |
#get_all_datasets(options = Options::Analytics::GetAllDatasets.new) ⇒ Array<AnalyticsDataset>
Gets all datasets
693 694 695 696 697 698 699 700 701 702 703 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 693 def get_all_datasets( = Options::Analytics::GetAllDatasets.new) resp = @backend.analytics_dataset_get_all(.to_backend) 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 = Options::Analytics::GetAllIndexes.new) ⇒ Array<AnalyticsIndex>
Gets all indexes
739 740 741 742 743 744 745 746 747 748 749 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 739 def get_all_indexes( = Options::Analytics::GetAllIndexes.new) resp = @backend.analytics_index_get_all(.to_backend) 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_links(options = Options::Analytics::GetLinks.new) ⇒ void
This method returns an undefined value.
Retrieves the links
836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 836 def get_links( = Options::Analytics::GetLinks.new) resp = @backend.analytics_link_get_all(.to_backend) resp.map do |entry| case entry[:type] when :s3 S3ExternalAnalyticsLink.new( entry[:link_name], entry[:dataverse], entry[:access_key_id], nil, entry[:region], service_endpoint: entry[:service_endpoint] ) when :couchbase CouchbaseRemoteAnalyticsLink.new( entry[:link_name], entry[:dataverse], entry[:hostname], username: entry[:username], encryption: EncryptionSettings.new( level: entry[:encryption_level], certificate: entry[:certificate], client_certificate: entry[:client_certificate] ) ) when :azureblob AzureBlobExternalAnalyticsLink.new( entry[:link_name], entry[:dataverse], account_name: entry[:account_name], blob_endpoint: entry[:blob_endpoint], endpoint_suffix: entry[:endpoint_suffix] ) end end end |
#get_pending_mutations(options = Options::Analytics::GetPendingMutations.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.
784 785 786 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 784 def get_pending_mutations( = Options::Analytics::GetPendingMutations.new) @backend.analytics_get_pending_mutations(.to_backend) end |
#replace_link(link, options = Options::Analytics::ReplaceLink.new) ⇒ void
This method returns an undefined value.
Replaces the link
810 811 812 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 810 def replace_link(link, = Options::Analytics::ReplaceLink.new) @backend.analytics_link_replace(link.to_backend, .to_backend) end |