Class: Couchbase::Management::AnalyticsIndexManager
- Inherits:
-
Object
- Object
- Couchbase::Management::AnalyticsIndexManager
- Defined in:
- lib/couchbase/management/analytics_index_manager.rb,
/code/couchbase-ruby-client/lib/couchbase/management/analytics_index_manager.rb
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.
632 633 634 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 632 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
761 762 763 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 761 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
673 674 675 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 673 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
645 646 647 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 645 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
718 719 720 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 718 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
799 800 801 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 799 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,
773 774 775 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 773 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
686 687 688 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 686 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
658 659 660 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 658 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
732 733 734 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 732 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
826 827 828 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 826 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
695 696 697 698 699 700 701 702 703 704 705 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 695 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
741 742 743 744 745 746 747 748 749 750 751 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 741 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
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 872 873 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 838 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.
786 787 788 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 786 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
812 813 814 |
# File 'lib/couchbase/management/analytics_index_manager.rb', line 812 def replace_link(link, = Options::Analytics::ReplaceLink.new) @backend.analytics_link_replace(link.to_backend, .to_backend) end |