Skip to content

Commit

Permalink
feat(deploy-v1): Added support for deploy policies (#27370)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] authored Sep 27, 2024
1 parent bbeff3e commit d0966be
Show file tree
Hide file tree
Showing 25 changed files with 3,595 additions and 112 deletions.
9 changes: 9 additions & 0 deletions google-cloud-deploy-v1/.owlbot-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"lib/google/cloud/deploy/v1/cloud_deploy_services_pb.rb",
"lib/google/cloud/deploy/v1/customtargettype_notification_payload_pb.rb",
"lib/google/cloud/deploy/v1/deliverypipeline_notification_payload_pb.rb",
"lib/google/cloud/deploy/v1/deploypolicy_evaluation_payload_pb.rb",
"lib/google/cloud/deploy/v1/deploypolicy_notification_payload_pb.rb",
"lib/google/cloud/deploy/v1/jobrun_notification_payload_pb.rb",
"lib/google/cloud/deploy/v1/log_enums_pb.rb",
Expand All @@ -51,6 +52,7 @@
"proto_docs/google/cloud/deploy/v1/cloud_deploy.rb",
"proto_docs/google/cloud/deploy/v1/customtargettype_notification_payload.rb",
"proto_docs/google/cloud/deploy/v1/deliverypipeline_notification_payload.rb",
"proto_docs/google/cloud/deploy/v1/deploypolicy_evaluation_payload.rb",
"proto_docs/google/cloud/deploy/v1/deploypolicy_notification_payload.rb",
"proto_docs/google/cloud/deploy/v1/jobrun_notification_payload.rb",
"proto_docs/google/cloud/deploy/v1/log_enums.rb",
Expand All @@ -67,7 +69,9 @@
"proto_docs/google/protobuf/timestamp.rb",
"proto_docs/google/rpc/status.rb",
"proto_docs/google/type/date.rb",
"proto_docs/google/type/dayofweek.rb",
"proto_docs/google/type/expr.rb",
"proto_docs/google/type/timeofday.rb",
"snippets/Gemfile",
"snippets/cloud_deploy/abandon_release.rb",
"snippets/cloud_deploy/advance_rollout.rb",
Expand All @@ -77,18 +81,21 @@
"snippets/cloud_deploy/create_automation.rb",
"snippets/cloud_deploy/create_custom_target_type.rb",
"snippets/cloud_deploy/create_delivery_pipeline.rb",
"snippets/cloud_deploy/create_deploy_policy.rb",
"snippets/cloud_deploy/create_release.rb",
"snippets/cloud_deploy/create_rollout.rb",
"snippets/cloud_deploy/create_target.rb",
"snippets/cloud_deploy/delete_automation.rb",
"snippets/cloud_deploy/delete_custom_target_type.rb",
"snippets/cloud_deploy/delete_delivery_pipeline.rb",
"snippets/cloud_deploy/delete_deploy_policy.rb",
"snippets/cloud_deploy/delete_target.rb",
"snippets/cloud_deploy/get_automation.rb",
"snippets/cloud_deploy/get_automation_run.rb",
"snippets/cloud_deploy/get_config.rb",
"snippets/cloud_deploy/get_custom_target_type.rb",
"snippets/cloud_deploy/get_delivery_pipeline.rb",
"snippets/cloud_deploy/get_deploy_policy.rb",
"snippets/cloud_deploy/get_job_run.rb",
"snippets/cloud_deploy/get_release.rb",
"snippets/cloud_deploy/get_rollout.rb",
Expand All @@ -98,6 +105,7 @@
"snippets/cloud_deploy/list_automations.rb",
"snippets/cloud_deploy/list_custom_target_types.rb",
"snippets/cloud_deploy/list_delivery_pipelines.rb",
"snippets/cloud_deploy/list_deploy_policies.rb",
"snippets/cloud_deploy/list_job_runs.rb",
"snippets/cloud_deploy/list_releases.rb",
"snippets/cloud_deploy/list_rollouts.rb",
Expand All @@ -108,6 +116,7 @@
"snippets/cloud_deploy/update_automation.rb",
"snippets/cloud_deploy/update_custom_target_type.rb",
"snippets/cloud_deploy/update_delivery_pipeline.rb",
"snippets/cloud_deploy/update_deploy_policy.rb",
"snippets/cloud_deploy/update_target.rb",
"snippets/snippet_metadata_google.cloud.deploy.v1.json",
"test/google/cloud/deploy/v1/cloud_deploy_operations_test.rb",
Expand Down
25 changes: 25 additions & 0 deletions google-cloud-deploy-v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,31 @@
"abandon_release"
]
},
"CreateDeployPolicy": {
"methods": [
"create_deploy_policy"
]
},
"UpdateDeployPolicy": {
"methods": [
"update_deploy_policy"
]
},
"DeleteDeployPolicy": {
"methods": [
"delete_deploy_policy"
]
},
"ListDeployPolicies": {
"methods": [
"list_deploy_policies"
]
},
"GetDeployPolicy": {
"methods": [
"get_deploy_policy"
]
},
"ApproveRollout": {
"methods": [
"approve_rollout"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,25 @@ def delivery_pipeline_path project:, location:, delivery_pipeline:
"projects/#{project}/locations/#{location}/deliveryPipelines/#{delivery_pipeline}"
end

##
# Create a fully-qualified DeployPolicy resource string.
#
# The resource will be in the following format:
#
# `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`
#
# @param project [String]
# @param location [String]
# @param deploy_policy [String]
#
# @return [::String]
def deploy_policy_path project:, location:, deploy_policy:
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

"projects/#{project}/locations/#{location}/deployPolicies/#{deploy_policy}"
end

##
# Create a fully-qualified Job resource string.
#
Expand Down
Loading

0 comments on commit d0966be

Please sign in to comment.