Skip to content

Commit

Permalink
fix!: deprecated various PSC instance configuration fields (#27581)
Browse files Browse the repository at this point in the history
feat: add new PSC instance configuration setting and output the PSC DNS name
feat: add new API to upgrade a cluster
feat: add new API to execute SQL statements
feat: add new cluster and instance level configurations to interact with Gemini
feat: add support for Free Trials
feat: add support to schedule maintenance
feat: additional field to set tags on a backup or cluster
feat: add more observability options on the Instance level
feat: add new API to perform a promotion or switchover on secondary instances
feat: add new CloudSQL backup resource
feat: support for obtaining the public ip addresses of an instance and enabling outbound public ip
feat: add optional field to keep extra roles on a user if it already exists
docs: various typo fixes, correcting the formatting, and clarifications on the request_id and validate_only fields in API requests and on the page_size when listing the database
  • Loading branch information
gcf-owl-bot[bot] authored Nov 9, 2024
1 parent 2edf96c commit 9d7675b
Show file tree
Hide file tree
Showing 22 changed files with 2,911 additions and 497 deletions.
9 changes: 9 additions & 0 deletions google-cloud-alloy_db-v1beta/.owlbot-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"lib/google/cloud/alloy_db/v1beta/bindings_override.rb",
"lib/google/cloud/alloy_db/v1beta/rest.rb",
"lib/google/cloud/alloy_db/v1beta/version.rb",
"lib/google/cloud/alloydb/v1beta/csql_resources_pb.rb",
"lib/google/cloud/alloydb/v1beta/data_model_pb.rb",
"lib/google/cloud/alloydb/v1beta/gemini_pb.rb",
"lib/google/cloud/alloydb/v1beta/resources_pb.rb",
"lib/google/cloud/alloydb/v1beta/service_pb.rb",
"lib/google/cloud/alloydb/v1beta/service_services_pb.rb",
Expand All @@ -36,6 +39,9 @@
"proto_docs/google/api/field_info.rb",
"proto_docs/google/api/launch_stage.rb",
"proto_docs/google/api/resource.rb",
"proto_docs/google/cloud/alloydb/v1beta/csql_resources.rb",
"proto_docs/google/cloud/alloydb/v1beta/data_model.rb",
"proto_docs/google/cloud/alloydb/v1beta/gemini.rb",
"proto_docs/google/cloud/alloydb/v1beta/resources.rb",
"proto_docs/google/cloud/alloydb/v1beta/service.rb",
"proto_docs/google/longrunning/operations.rb",
Expand All @@ -61,6 +67,7 @@
"snippets/alloy_db_admin/delete_cluster.rb",
"snippets/alloy_db_admin/delete_instance.rb",
"snippets/alloy_db_admin/delete_user.rb",
"snippets/alloy_db_admin/execute_sql.rb",
"snippets/alloy_db_admin/failover_instance.rb",
"snippets/alloy_db_admin/generate_client_certificate.rb",
"snippets/alloy_db_admin/get_backup.rb",
Expand All @@ -78,10 +85,12 @@
"snippets/alloy_db_admin/promote_cluster.rb",
"snippets/alloy_db_admin/restart_instance.rb",
"snippets/alloy_db_admin/restore_cluster.rb",
"snippets/alloy_db_admin/switchover_cluster.rb",
"snippets/alloy_db_admin/update_backup.rb",
"snippets/alloy_db_admin/update_cluster.rb",
"snippets/alloy_db_admin/update_instance.rb",
"snippets/alloy_db_admin/update_user.rb",
"snippets/alloy_db_admin/upgrade_cluster.rb",
"snippets/snippet_metadata_google.cloud.alloydb.v1beta.json",
"test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb",
"test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb",
Expand Down
15 changes: 15 additions & 0 deletions google-cloud-alloy_db-v1beta/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
"update_cluster"
]
},
"UpgradeCluster": {
"methods": [
"upgrade_cluster"
]
},
"DeleteCluster": {
"methods": [
"delete_cluster"
Expand All @@ -40,6 +45,11 @@
"promote_cluster"
]
},
"SwitchoverCluster": {
"methods": [
"switchover_cluster"
]
},
"RestoreCluster": {
"methods": [
"restore_cluster"
Expand Down Expand Up @@ -100,6 +110,11 @@
"restart_instance"
]
},
"ExecuteSql": {
"methods": [
"execute_sql"
]
},
"ListBackups": {
"methods": [
"list_backups"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,44 @@ def update_cluster request_pb, options = nil
result
end

##
# Baseline implementation for the upgrade_cluster REST call
#
# @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest]
# A request object representing the call parameters. Required.
# @param options [::Gapic::CallOptions]
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
#
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Longrunning::Operation]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Google::Longrunning::Operation]
# A result object deserialized from the server's reply
def upgrade_cluster request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?

verb, uri, query_string_params, body = ServiceStub.transcode_upgrade_cluster_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end

response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true

yield result, operation if block_given?
result
end

##
# Baseline implementation for the delete_cluster REST call
#
Expand Down Expand Up @@ -289,6 +327,44 @@ def promote_cluster request_pb, options = nil
result
end

##
# Baseline implementation for the switchover_cluster REST call
#
# @param request_pb [::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest]
# A request object representing the call parameters. Required.
# @param options [::Gapic::CallOptions]
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
#
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Longrunning::Operation]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Google::Longrunning::Operation]
# A result object deserialized from the server's reply
def switchover_cluster request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?

verb, uri, query_string_params, body = ServiceStub.transcode_switchover_cluster_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end

response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true

yield result, operation if block_given?
result
end

##
# Baseline implementation for the restore_cluster REST call
#
Expand Down Expand Up @@ -745,6 +821,44 @@ def restart_instance request_pb, options = nil
result
end

##
# Baseline implementation for the execute_sql REST call
#
# @param request_pb [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest]
# A request object representing the call parameters. Required.
# @param options [::Gapic::CallOptions]
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
#
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse]
# A result object deserialized from the server's reply
def execute_sql request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?

verb, uri, query_string_params, body = ServiceStub.transcode_execute_sql_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end

response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse.decode_json response.body, ignore_unknown_fields: true

yield result, operation if block_given?
result
end

##
# Baseline implementation for the list_backups REST call
#
Expand Down Expand Up @@ -1363,6 +1477,28 @@ def self.transcode_update_cluster_request request_pb
transcoder.transcode request_pb
end

##
# @private
#
# GRPC transcoding helper method for the upgrade_cluster REST call
#
# @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest]
# A request object representing the call parameters. Required.
# @return [Array(String, [String, nil], Hash{String => String})]
# Uri, Body, Query string parameters
def self.transcode_upgrade_cluster_request request_pb
transcoder = Gapic::Rest::GrpcTranscoder.new
.with_bindings(
uri_method: :patch,
uri_template: "/v1beta/{name}:upgrade",
body: "*",
matches: [
["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false]
]
)
transcoder.transcode request_pb
end

##
# @private
#
Expand Down Expand Up @@ -1406,6 +1542,28 @@ def self.transcode_promote_cluster_request request_pb
transcoder.transcode request_pb
end

##
# @private
#
# GRPC transcoding helper method for the switchover_cluster REST call
#
# @param request_pb [::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest]
# A request object representing the call parameters. Required.
# @return [Array(String, [String, nil], Hash{String => String})]
# Uri, Body, Query string parameters
def self.transcode_switchover_cluster_request request_pb
transcoder = Gapic::Rest::GrpcTranscoder.new
.with_bindings(
uri_method: :post,
uri_template: "/v1beta/{name}:switchover",
body: "*",
matches: [
["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false]
]
)
transcoder.transcode request_pb
end

##
# @private
#
Expand Down Expand Up @@ -1667,6 +1825,28 @@ def self.transcode_restart_instance_request request_pb
transcoder.transcode request_pb
end

##
# @private
#
# GRPC transcoding helper method for the execute_sql REST call
#
# @param request_pb [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest]
# A request object representing the call parameters. Required.
# @return [Array(String, [String, nil], Hash{String => String})]
# Uri, Body, Query string parameters
def self.transcode_execute_sql_request request_pb
transcoder = Gapic::Rest::GrpcTranscoder.new
.with_bindings(
uri_method: :post,
uri_template: "/v1beta/{instance}:executeSql",
body: "*",
matches: [
["instance", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false]
]
)
transcoder.transcode request_pb
end

##
# @private
#
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9d7675b

Please sign in to comment.