Class: Google::Cloud::Bigtable::AppProfile
- Inherits:
-
Object
- Object
- Google::Cloud::Bigtable::AppProfile
- Defined in:
- lib/google/cloud/bigtable/app_profile.rb,
lib/google/cloud/bigtable/app_profile/job.rb,
lib/google/cloud/bigtable/app_profile/list.rb
Overview
AppProfile
A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application.
Defined Under Namespace
Class Method Summary collapse
-
.multi_cluster_routing ⇒ Google::Bigtable::Admin::V2::AppProfile::MultiClusterRoutingUseAny
Create instance of multi cluster routing policy.
-
.single_cluster_routing(cluster_id, allow_transactional_writes: false) ⇒ Google::Bigtable::Admin::V2::AppProfile::SingleClusterRouting
Create instance of single cluster routing.
Instance Method Summary collapse
-
#delete(ignore_warnings: false) ⇒ Boolean
Delete app profile.
-
#description ⇒ String
Description of the AppProfile.
-
#description=(text) ⇒ Object
Set description of the AppProfile.
-
#etag ⇒ String
Etag for optimistic concurrency control.
-
#instance_id ⇒ String
The unique identifier for the instance.
-
#multi_cluster_routing ⇒ Google::Bigtable::Admin::V2::AppProfile::MultiClusterRoutingUseAny
Get value of multi-cluster routing policy.
-
#name ⇒ String
The unique identifier for the app profile.
-
#path ⇒ String
The full path for the instance resource.
-
#project_id ⇒ String
The unique identifier for the project.
-
#reload! ⇒ Google::Cloud::Bigtable::AppProfile
Reload app profile information.
-
#routing_policy ⇒ Google::Bigtable::Admin::V2::AppProfile::SingleClusterRouting, Google::Bigtable::Admin::V2::AppProfile::MultiClusterRoutingUseAny
Get routing policy.
-
#routing_policy=(policy) ⇒ Object
Set routing policy.
-
#save(ignore_warnings: false) ⇒ Google::Cloud::Bigtable::AppProfile::Job
(also: #update)
Update app profile.
-
#single_cluster_routing ⇒ Google::Bigtable::Admin::V2::AppProfile::SingleClusterRouting
Get value of single cluster routing policy.
Class Method Details
.multi_cluster_routing ⇒ Google::Bigtable::Admin::V2::AppProfile::MultiClusterRoutingUseAny
Create instance of multi cluster routing policy.
Read/write requests may be routed to any cluster in the instance, and will Fail over to another cluster in the event of transient errors or delays. Choosing this option sacrifices read-your-writes consistency to improve availability
313 314 315 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 313 def self.multi_cluster_routing Google::Bigtable::Admin::V2::AppProfile::MultiClusterRoutingUseAny.new end |
.single_cluster_routing(cluster_id, allow_transactional_writes: false) ⇒ Google::Bigtable::Admin::V2::AppProfile::SingleClusterRouting
Create instance of single cluster routing
Unconditionally routes all read/write requests to a specific cluster. This option preserves read-your-writes consistency, but does not improve availability.
342 343 344 345 346 347 348 349 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 342 def self.single_cluster_routing \ cluster_id, allow_transactional_writes: false Google::Bigtable::Admin::V2::AppProfile::SingleClusterRouting.new( cluster_id: cluster_id, allow_transactional_writes: allow_transactional_writes ) end |
Instance Method Details
#delete(ignore_warnings: false) ⇒ Boolean
Delete app profile.
204 205 206 207 208 209 210 211 212 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 204 def delete ignore_warnings: false ensure_service! service.delete_app_profile( instance_id, name, ignore_warnings: ignore_warnings ) true end |
#description ⇒ String
Description of the AppProfile.
100 101 102 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 100 def description @grpc.description end |
#description=(text) ⇒ Object
Set description of the AppProfile.
107 108 109 110 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 107 def description= text @grpc.description = text @changed_fields["description"] = "description" end |
#etag ⇒ String
Etag for optimistic concurrency control.
93 94 95 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 93 def etag @grpc.etag end |
#instance_id ⇒ String
The unique identifier for the instance.
71 72 73 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 71 def instance_id @grpc.name.split("/")[3] end |
#multi_cluster_routing ⇒ Google::Bigtable::Admin::V2::AppProfile::MultiClusterRoutingUseAny
Get value of multi-cluster routing policy.
115 116 117 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 115 def multi_cluster_routing @grpc.multi_cluster_routing_use_any end |
#name ⇒ String
The unique identifier for the app profile.
78 79 80 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 78 def name @grpc.name.split("/")[5] end |
#path ⇒ String
The full path for the instance resource. Values are of the form
projects/<project_id>/instances/<instance_id>
.
86 87 88 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 86 def path @grpc.name end |
#project_id ⇒ String
The unique identifier for the project.
64 65 66 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 64 def project_id @grpc.name.split("/")[1] end |
#reload! ⇒ Google::Cloud::Bigtable::AppProfile
Reload app profile information.
296 297 298 299 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 296 def reload! @grpc = service.get_app_profile(instance_id, name) self end |
#routing_policy ⇒ Google::Bigtable::Admin::V2::AppProfile::SingleClusterRouting, Google::Bigtable::Admin::V2::AppProfile::MultiClusterRoutingUseAny
Get routing policy
180 181 182 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 180 def routing_policy @grpc.single_cluster_routing || @grpc.multi_cluster_routing_use_any end |
#routing_policy=(policy) ⇒ Object
Set routing policy
165 166 167 168 169 170 171 172 173 174 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 165 def routing_policy= policy if policy.is_a?(Google::Bigtable::Admin::V2::AppProfile:: \ SingleClusterRouting) @grpc.single_cluster_routing = policy @changed_fields["routing_policy"] = "single_cluster_routing" else @grpc.multi_cluster_routing_use_any = policy @changed_fields["routing_policy"] = "multi_cluster_routing_use_any" end end |
#save(ignore_warnings: false) ⇒ Google::Cloud::Bigtable::AppProfile::Job Also known as: update
Update app profile.
277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 277 def save ignore_warnings: false ensure_service! update_mask = Google::Protobuf::FieldMask.new( paths: @changed_fields.values ) grpc = service.update_app_profile( @grpc, update_mask, ignore_warnings: ignore_warnings ) @changed_fields.clear AppProfile::Job.from_grpc(grpc, service) end |
#single_cluster_routing ⇒ Google::Bigtable::Admin::V2::AppProfile::SingleClusterRouting
Get value of single cluster routing policy
122 123 124 |
# File 'lib/google/cloud/bigtable/app_profile.rb', line 122 def single_cluster_routing @grpc.single_cluster_routing end |