Skip to content
Snippets Groups Projects

Add Google Cloud Compute services

Merged Pedro Pombeiro requested to merge pedropombeiro/438315/add-services into master
8 files
+ 101
52
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -9,6 +9,8 @@ class BaseService < ::BaseProjectService
@@ -9,6 +9,8 @@ class BaseService < ::BaseProjectService
VALID_ORDER_BY_COLUMNS = %w[creationTimestamp name].freeze
VALID_ORDER_BY_COLUMNS = %w[creationTimestamp name].freeze
VALID_ORDER_BY_DIRECTIONS = %w[asc desc].freeze
VALID_ORDER_BY_DIRECTIONS = %w[asc desc].freeze
 
MAX_RESULTS_LIMIT = 500
 
SAAS_ONLY = "This is a SaaS-only feature that can't run here"
SAAS_ONLY = "This is a SaaS-only feature that can't run here"
FEATURE_FLAG_NOT_ENABLED = 'Feature flag not enabled'
FEATURE_FLAG_NOT_ENABLED = 'Feature flag not enabled'
ACCESS_DENIED = 'Access denied'
ACCESS_DENIED = 'Access denied'
@@ -19,13 +21,6 @@ class BaseService < ::BaseProjectService
@@ -19,13 +21,6 @@ class BaseService < ::BaseProjectService
GCP_AUTHENTICATION_ERROR_MESSAGE = 'Unable to authenticate against Google Cloud'
GCP_AUTHENTICATION_ERROR_MESSAGE = 'Unable to authenticate against Google Cloud'
GCP_API_ERROR_MESSAGE = 'Unsuccessful Google Cloud API request'
GCP_API_ERROR_MESSAGE = 'Unsuccessful Google Cloud API request'
attr_accessor :project, :current_user
def initialize(project:, current_user:)
@project = project
@current_user = current_user
end
private
private
def before_execute
def before_execute
@@ -83,6 +78,22 @@ def project_integration
@@ -83,6 +78,22 @@ def project_integration
end
end
strong_memoize_attr :project_integration
strong_memoize_attr :project_integration
 
def max_results
 
params[:max_results]
 
end
 
 
def filter
 
params[:filter]
 
end
 
 
def order_by
 
params[:order_by]
 
end
 
 
def page_token
 
params[:page_token]
 
end
 
def handling_client_errors
def handling_client_errors
yield
yield
rescue ::GoogleCloudPlatform::AuthenticationError
rescue ::GoogleCloudPlatform::AuthenticationError
Loading