source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/base_service_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 8,728 | require 'fetchers/base_list_fetcher'
require 'fetchers/label_selector_query_generator'
module VCAP::CloudController
class BaseServiceListFetcher < BaseListFetcher
class << self
private
def fetch(klass, message, omniscient: false, readable_orgs_query: nil, readable_spaces_query: nil, eager_loaded_ass... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/log_access_fetcher.rb | Ruby | apache-2.0 | 203 | main | 422 | module VCAP::CloudController
class LogAccessFetcher
def app_exists?(guid)
AppModel.where(guid:).any? ||
ProcessModel.where(guid:).any?
end
def app_exists_by_space?(guid, space_guids)
AppModel.where(guid: guid, space_guid: space_guids).any? ||
ProcessModel.join(:apps, guid: :ap... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/process_fetcher.rb | Ruby | apache-2.0 | 203 | main | 516 | module VCAP::CloudController
class ProcessFetcher
class << self
def fetch_for_app_by_type(process_type:, app_guid:)
app = AppModel.where(guid: app_guid).first
return nil unless app
process = app.processes_dataset.where(type: process_type).last
[process, app, app.space]
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/stack_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,084 | require 'cloud_controller/paging/sequel_paginator'
require 'cloud_controller/paging/paginated_result'
require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class StackListFetcher < BaseListFetcher
class << self
def fetch_all(message)
dataset = Stack.dataset
filter(message, datas... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/buildpack_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,323 | require 'cloud_controller/paging/sequel_paginator'
require 'cloud_controller/paging/paginated_result'
require 'cloud_controller/diego/lifecycles/lifecycles'
require 'fetchers/null_filter_query_generator'
require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class BuildpackListFetcher < BaseListFetcher
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/route_binding_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 2,276 | require 'fetchers/base_list_fetcher'
module VCAP
module CloudController
class RouteBindingListFetcher < BaseListFetcher
class << self
def fetch_all(message, eager_loaded_associations: [])
filter(message, all_bindings(eager_loaded_associations)).
select_all(:route_bindings)
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/global_usage_summary_fetcher.rb | Ruby | apache-2.0 | 203 | main | 2,168 | module VCAP::CloudController
class GlobalUsageSummaryFetcher
class << self
def summary
summary = Summary.new
summary.started_instances = ProcessModel.
dataset.
where(state: ProcessModel::STARTED).
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/null_filter_query_generator.rb | Ruby | apache-2.0 | 203 | main | 527 | module VCAP::CloudController
class NullFilterQueryGenerator
class << self
def add_filter(resource_dataset, key, filter_values)
non_empty_values = filter_values.reject(&:empty?)
include_null = non_empty_values.length < filter_values.length
filter = if include_null
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/event_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,098 | require 'cloud_controller/paging/sequel_paginator'
require 'cloud_controller/paging/paginated_result'
require 'fetchers/label_selector_query_generator'
require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class EventListFetcher < BaseListFetcher
class << self
def fetch_all(message, event_datas... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/task_create_fetcher.rb | Ruby | apache-2.0 | 203 | main | 315 | module VCAP::CloudController
class TaskCreateFetcher
def fetch(app_guid:, droplet_guid: nil)
app = AppModel.where(guid: app_guid).first
droplet = app.droplets_dataset.where(guid: droplet_guid).first if droplet_guid
return nil if app.nil?
[app, app.space, droplet]
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/route_fetcher.rb | Ruby | apache-2.0 | 203 | main | 3,048 | require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class RouteFetcher < BaseListFetcher
class << self
def fetch(message, readable_space_guids_dataset: nil, eager_loaded_associations: [], omniscient: false)
dataset = Route.dataset.eager(eager_loaded_associations).
jo... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/service_binding_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 480 | require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class ServiceBindingListFetcher < BaseListFetcher
class << self
def fetch_service_instance_bindings_in_space(service_instance_guid, space_guid)
ServiceBinding.select_all(ServiceBinding.table_name).
join(:apps, guid: :app_gu... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/service_offering_fetcher.rb | Ruby | apache-2.0 | 203 | main | 202 | module VCAP::CloudController
class ServiceOfferingFetcher
class << self
def fetch(service_offering_guid)
Service.where(guid: service_offering_guid).first
end
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/security_group_fetcher.rb | Ruby | apache-2.0 | 203 | main | 599 | module VCAP::CloudController
class SecurityGroupFetcher
class << self
def fetch(guid, visible_security_group_guids=nil)
dataset = SecurityGroup.where(guid:)
dataset = dataset.where(guid: visible_security_group_guids) if visible_security_group_guids
dataset = eager_load_running_and_st... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/service_broker_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,352 | require 'fetchers/base_list_fetcher'
require 'fetchers/label_selector_query_generator'
module VCAP::CloudController
class ServiceBrokerListFetcher < BaseListFetcher
class << self
def fetch(message:, permitted_space_guids: nil, eager_loaded_associations: [])
dataset = ServiceBroker.dataset.eager(eag... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/base_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 2,852 | require 'models/helpers/relational_operators'
module VCAP::CloudController
class BaseListFetcher
class << self
def filter(message, dataset, klass)
dataset = advanced_filtering(message, dataset, klass)
dataset = dataset.where("#{klass.table_name}__guid": message.guids) if message.requested?... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/security_group_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,745 | require 'cloud_controller/paging/sequel_paginator'
require 'cloud_controller/paging/paginated_result'
require 'fetchers/label_selector_query_generator'
require 'fetchers/base_list_fetcher'
require 'fetchers/security_group_fetcher'
module VCAP::CloudController
class SecurityGroupListFetcher < BaseListFetcher
clas... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/feature_flag_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 958 | require 'cloud_controller/paging/sequel_paginator'
require 'cloud_controller/paging/paginated_result'
require 'fetchers/label_selector_query_generator'
require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class FeatureFlagListFetcher < BaseListFetcher
class << self
def fetch_all(message, eager... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/app_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 2,982 | require 'cloud_controller/paging/sequel_paginator'
require 'cloud_controller/paging/paginated_result'
require 'fetchers/label_selector_query_generator'
require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class AppListFetcher < BaseListFetcher
class << self
def fetch_all(message, eager_loaded_... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/organization_user_roles_fetcher.rb | Ruby | apache-2.0 | 203 | main | 636 | module VCAP::CloudController
class OrganizationUserRolesFetcher
def self.fetch(org, user_guid: nil)
new(user_guid:).fetch(org)
end
attr_reader :user_guid
def initialize(user_guid: nil)
@user_guid = user_guid
end
def fetch(org)
filter_if_user_guid(org.users_dataset).
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/app_usage_event_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 790 | require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class AppUsageEventListFetcher < BaseListFetcher
class << self
def fetch_all(message, dataset)
filter(message, dataset)
end
private
def filter(message, dataset)
if message.requested?(:after_guid)
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/user_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,336 | require 'cloud_controller/paging/sequel_paginator'
require 'cloud_controller/paging/paginated_result'
require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class UserListFetcher < BaseListFetcher
class << self
def fetch_all(message, readable_users_dataset)
filter(message, readable_users... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/task_fetcher.rb | Ruby | apache-2.0 | 203 | main | 424 | module VCAP::CloudController
class TaskFetcher
def fetch_for_app(task_guid:, app_guid:)
app = AppModel.where(guid: app_guid).first
return nil unless app
task = app.tasks_dataset.where(guid: task_guid).first
[task, app, app.space]
end
def fetch(task_guid:)
task = TaskModel... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/space_quota_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,218 | require 'cloud_controller/paging/sequel_paginator'
require 'cloud_controller/paging/paginated_result'
require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class SpaceQuotaListFetcher < BaseListFetcher
class << self
def fetch(message:, readable_space_quota_guids:)
dataset = SpaceQuotaDe... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/org_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 2,209 | require 'cloud_controller/paging/sequel_paginator'
require 'cloud_controller/paging/paginated_result'
require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class OrgListFetcher < BaseListFetcher
class << self
def fetch(message:, guids:, eager_loaded_associations: [])
dataset = Organizat... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/space_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,370 | require 'cloud_controller/paging/sequel_paginator'
require 'cloud_controller/paging/paginated_result'
require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class SpaceListFetcher < BaseListFetcher
class << self
def fetch(message:, guids:, eager_loaded_associations: [])
dataset = Space.w... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/deployment_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,501 | require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class DeploymentListFetcher < BaseListFetcher
class << self
def fetch_all(message)
filter(message, AppModel.select(:id))
end
def fetch_for_spaces(message, space_guids:)
app_dataset = AppModel.where(space_guid: sp... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/isolation_segment_organizations_fetcher.rb | Ruby | apache-2.0 | 203 | main | 398 | module VCAP::CloudController
class IsolationSegmentOrganizationsFetcher
def initialize(isolation_segment)
@isolation_segment = isolation_segment
end
def fetch_all
@isolation_segment.organizations
end
def fetch_for_organizations(org_guids_query:)
Organization.where(guid: org_gui... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/service_usage_event_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,107 | require 'fetchers/base_list_fetcher'
require 'cloud_controller/errors/api_error'
module VCAP::CloudController
class ServiceUsageEventListFetcher < BaseListFetcher
class << self
def fetch_all(message, dataset)
filter(message, dataset)
end
private
def filter(message, dataset)
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/role_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,179 | require 'cloud_controller/paging/sequel_paginator'
require 'cloud_controller/paging/paginated_result'
require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class RoleListFetcher < BaseListFetcher
class << self
def fetch(message, readable_roles, eager_loaded_associations: [])
filter(mess... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/task_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 2,647 | require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class TaskListFetcher < BaseListFetcher
class << self
def fetch_for_spaces(message:, space_guids:)
app_dataset = AppModel.select(:id).where(space_guid: space_guids)
filter(message).where(app: filter_app_dataset(message, app_d... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/package_fetcher.rb | Ruby | apache-2.0 | 203 | main | 224 | module VCAP::CloudController
class PackageFetcher
def fetch(package_guid)
package = PackageModel.where(guid: package_guid).first
return nil if package.nil?
[package, package.space]
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/route_destinations_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 462 | module VCAP::CloudController
class RouteDestinationsListFetcher
def initialize(message:)
@message = message
end
def fetch_for_route(route:)
filter(route.route_mappings_dataset)
end
private
def filter(dataset)
dataset = dataset.where(guid: @message.guids) if @message.reques... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/service_credential_binding_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 2,321 | require 'fetchers/base_list_fetcher'
require 'fetchers/label_selector_query_generator'
module VCAP
module CloudController
class ServiceCredentialBindingListFetcher < BaseListFetcher
class << self
FILTERABLE_PROPERTIES = %w[
service_instance_name
service_instance_guid
n... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/service_binding_create_fetcher.rb | Ruby | apache-2.0 | 203 | main | 264 | module VCAP::CloudController
class ServiceBindingCreateFetcher
def fetch(app_guid, service_instance_guid)
instance = ServiceInstance.first(guid: service_instance_guid)
app = AppModel.first(guid: app_guid)
[app, instance]
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/app_revisions_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,359 | require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class AppRevisionsListFetcher < BaseListFetcher
class << self
def fetch(app, message)
filter(message, app)
end
def fetch_deployed(app)
processes = ProcessModel.where(app_guid: app.guid, state: 'STARTED')
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/droplet_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 3,497 | require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class DropletListFetcher < BaseListFetcher
class << self
def fetch_all(message, eager_loaded_associations: [])
filter(message, nil, nil, droplet_dataset(eager_loaded_associations))
end
def fetch_for_spaces(message, space... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/build_list_fetcher.rb | Ruby | apache-2.0 | 203 | main | 1,519 | require 'fetchers/base_list_fetcher'
module VCAP::CloudController
class BuildListFetcher < BaseListFetcher
class << self
def fetch_all(message, eager_loaded_associations: [])
filter(message, AppModel.dataset, eager_loaded_associations:)
end
def fetch_for_spaces(message, space_guids:, e... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/queries/route_mapping_query.rb | Ruby | apache-2.0 | 203 | main | 859 | module VCAP::RestAPI
class RouteMappingQuery < Query
def filtered_dataset
filter_args_from_query.inject(@dataset) do |filter, cond|
if cond.respond_to?(:str) && cond.str.starts_with?('app_guid')
app_filter(filter, cond)
else
filter.filter(cond)
end
end
e... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/fetchers/queries/app_query.rb | Ruby | apache-2.0 | 203 | main | 1,646 | module VCAP::RestAPI
class AppQuery < Query
def filtered_dataset
filter_args_from_query.inject(@dataset) do |filter, cond|
if cond.is_a?(Hash)
if cond.key?(:organization)
org_filter(filter, cond)
elsif cond.key?(:stack)
stack_filter(filter, cond)
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/deployment_create.rb | Ruby | apache-2.0 | 203 | main | 12,096 | require 'repositories/deployment_event_repository'
require 'actions/revision_resolver'
require 'cloud_controller/deployments/deployment_target_state'
module VCAP::CloudController
class DeploymentCreate
class Error < StandardError; end
class << self
def create(app:, user_audit_info:, message:)
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/deployment_delete.rb | Ruby | apache-2.0 | 203 | main | 252 | module VCAP::CloudController
class DeploymentDelete
class << self
def delete(deployments)
deployments.delete
end
def delete_for_app(guid)
DeploymentModel.where(app_guid: guid).delete
end
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/manifest_route_update.rb | Ruby | apache-2.0 | 203 | main | 4,386 | require 'cloud_controller/app_manifest/manifest_route'
require 'actions/route_create'
require 'actions/route_update'
module VCAP::CloudController
class ManifestRouteUpdate
class InvalidRoute < StandardError
end
class << self
def update(app_guid, message, user_audit_info)
return unless mess... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/package_upload.rb | Ruby | apache-2.0 | 203 | main | 2,039 | module VCAP::CloudController
class PackageUpload
class InvalidPackage < StandardError; end
def upload_async(message:, package:, config:, user_audit_info:, record_event: true)
logger.info("uploading package bits for package #{package.guid}")
upload_job = build_job(message, package)
enqueued... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/organization_create.rb | Ruby | apache-2.0 | 203 | main | 1,016 | require 'role_create'
module VCAP::CloudController
class OrganizationCreate
class Error < ::StandardError
end
def initialize(user_audit_info:)
@user_audit_info = user_audit_info
end
def create(message)
org = nil
Organization.db.transaction do
org = VCAP::CloudControlle... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/organization_delete.rb | Ruby | apache-2.0 | 203 | main | 1,937 | require 'actions/space_delete'
require 'actions/label_delete'
require 'actions/annotation_delete'
module VCAP::CloudController
class OrganizationDelete
def initialize(space_deleter, user_audit_info)
@space_deleter = space_deleter
@user_audit_info = user_audit_info
end
def delete(org_dataset)... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/service_instance_unshare.rb | Ruby | apache-2.0 | 203 | main | 1,542 | require 'actions/service_credential_binding_delete'
require 'actions/mixins/bindings_delete'
module VCAP::CloudController
class ServiceInstanceUnshare
include V3::BindingsDeleteMixin
class Error < ::StandardError
end
def unshare(service_instance, target_space, user_audit_info)
errors = delete... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/staging_cancel.rb | Ruby | apache-2.0 | 203 | main | 586 | module VCAP::CloudController
class StagingCancel
def initialize(stagers)
@stagers = stagers
end
def cancel(builds)
builds = Array(builds)
builds.each do |build|
next if build.in_final_state?
begin
@stagers.stager_for_build(build).stop_stage(build.guid)
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/organization_quotas_update.rb | Ruby | apache-2.0 | 203 | main | 5,206 | require 'repositories/organization_quota_event_repository'
module VCAP::CloudController
class OrganizationQuotasUpdate
class Error < ::StandardError
end
MAX_ORGS_TO_LIST_ON_FAILURE = 2
# rubocop:disable Metrics/CyclomaticComplexity
def self.update(quota, message, user_audit_info)
if log_r... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/service_broker_create.rb | Ruby | apache-2.0 | 203 | main | 1,670 | require 'jobs/v3/services/synchronize_broker_catalog_job'
module VCAP::CloudController
module V3
class ServiceBrokerCreate
class InvalidServiceBroker < StandardError
end
class SpaceNotFound < StandardError
end
def initialize(service_event_repository)
@service_event_reposit... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/buildpack_update.rb | Ruby | apache-2.0 | 203 | main | 1,815 | require 'repositories/buildpack_event_repository'
module VCAP::CloudController
class BuildpackUpdate
class Error < ::StandardError
end
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def update(buildpack, message)
Buildpack.db.transaction do
Locking[na... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/droplet_create.rb | Ruby | apache-2.0 | 203 | main | 3,298 | module VCAP::CloudController
class DropletCreate
class Error < ::StandardError
end
DEFAULT_PROCESS_TYPES = { 'web' => '' }.freeze
def create(app, message, user_audit_info)
unless app.buildpack_lifecycle_data
error!('Droplet creation is not available for apps with docker lifecycles.')
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/droplet_delete.rb | Ruby | apache-2.0 | 203 | main | 970 | require 'repositories/droplet_event_repository'
module VCAP::CloudController
class DropletDelete
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def delete(droplets)
droplets = Array(droplets)
droplets.each do |droplet|
DropletModel.db.transaction do
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/task_cancel.rb | Ruby | apache-2.0 | 203 | main | 986 | require 'repositories/task_event_repository'
module VCAP::CloudController
class TaskCancel
class InvalidCancel < StandardError; end
def initialize(config)
@config = config
end
def cancel(task:, user_audit_info:)
reject_invalid_states!(task)
TaskModel.db.transaction do
tas... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/space_quota_unapply.rb | Ruby | apache-2.0 | 203 | main | 576 | require 'repositories/space_quota_event_repository'
module VCAP::CloudController
class SpaceQuotaUnapply
class Error < ::StandardError
end
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def unapply(space_quota, space)
SpaceQuotaDefinition.db.transaction do
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/space_update_isolation_segment.rb | Ruby | apache-2.0 | 203 | main | 1,325 | module VCAP::CloudController
class SpaceUpdateIsolationSegment
class Error < StandardError; end
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def update(space, org, message)
isolation_segment_guid = message.isolation_segment_guid
if isolation_segment_guid
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/stack_delete.rb | Ruby | apache-2.0 | 203 | main | 376 | require 'repositories/stack_event_repository'
module VCAP::CloudController
class StackDelete
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def delete(stack)
stack.db.transaction do
Repositories::StackEventRepository.new.record_stack_delete(stack, @user_audit_... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/stack_create.rb | Ruby | apache-2.0 | 203 | main | 921 | require 'repositories/stack_event_repository'
module VCAP::CloudController
class StackCreate
class Error < ::StandardError
end
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def create(message)
stack = VCAP::CloudController::Stack.create(
name: messag... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/service_credential_binding_app_create.rb | Ruby | apache-2.0 | 203 | main | 6,665 | require 'repositories/service_generic_binding_event_repository'
require 'services/service_brokers/service_client_provider'
require 'actions/v3/service_binding_create'
module VCAP::CloudController
module V3
class ServiceCredentialBindingAppCreate < V3::ServiceBindingCreate
class Unimplemented < StandardErro... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/metadata_update.rb | Ruby | apache-2.0 | 203 | main | 734 | require 'actions/labels_update'
require 'actions/annotations_update'
module VCAP::CloudController
class MetadataUpdate
class << self
def update(resource, message, destroy_nil: true)
return unless message.requested?(:metadata)
LabelsUpdate.update(resource, message.labels, labels_klass(resou... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/organization_quota_apply.rb | Ruby | apache-2.0 | 203 | main | 1,653 | require 'repositories/organization_quota_event_repository'
module VCAP::CloudController
class OrganizationQuotaApply
class Error < ::StandardError
end
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def apply(org_quota, message)
orgs = valid_orgs(message.organ... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/service_credential_binding_delete.rb | Ruby | apache-2.0 | 203 | main | 1,097 | require 'actions/v3/service_binding_delete'
require 'repositories/service_generic_binding_event_repository'
module VCAP::CloudController
module V3
class ServiceCredentialBindingDelete < V3::ServiceBindingDelete
EVENT_REPOSITORY_TYPES = {
key: Repositories::ServiceGenericBindingEventRepository::SERV... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/feature_flag_update.rb | Ruby | apache-2.0 | 203 | main | 435 | module VCAP::CloudController
class FeatureFlagUpdate
class Error < ::StandardError
end
def update(feature_flag, message)
FeatureFlag.db.transaction do
feature_flag.error_message = message.custom_error_message if message.requested?(:custom_error_message)
feature_flag.enabled = messag... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/revision_resolver.rb | Ruby | apache-2.0 | 203 | main | 3,715 | require 'actions/revision_create'
module VCAP::CloudController
class RevisionResolver
class NoUpdateRollback < StandardError; end
class << self
def update_app_revision(app, user_audit_info)
return nil unless app.revisions_enabled && app.droplet_guid.present?
latest_revision = app.lates... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/space_diff_manifest.rb | Ruby | apache-2.0 | 203 | main | 8,343 | require 'presenters/v3/app_manifest_presenter'
require 'messages/app_manifest_message'
require 'json-diff'
module VCAP::CloudController
class SpaceDiffManifest
IDENTIFIERS = {
'processes' => 'type',
'routes' => 'route',
'sidecars' => 'name'
}.freeze
class << self
# rubocop:todo M... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/app_patch_environment_variables.rb | Ruby | apache-2.0 | 203 | main | 1,154 | module VCAP::CloudController
class AppPatchEnvironmentVariables
class InvalidApp < StandardError
end
def initialize(user_audit_info, manifest_triggered: false)
@user_audit_info = user_audit_info
@logger = Steno.logger('cc.action.app_update_environment_variables')
@manifest_trig... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/space_quota_update.rb | Ruby | apache-2.0 | 203 | main | 4,969 | require 'repositories/space_quota_event_repository'
module VCAP::CloudController
class SpaceQuotaUpdate
class Error < ::StandardError
end
MAX_SPACES_TO_LIST_ON_FAILURE = 2
# rubocop:disable Metrics/CyclomaticComplexity
def self.update(quota, message, user_audit_info)
if log_rate_limit(mes... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/space_quota_apply.rb | Ruby | apache-2.0 | 203 | main | 2,407 | require 'repositories/space_quota_event_repository'
module VCAP::CloudController
class SpaceQuotaApply
class Error < ::StandardError
end
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def apply(space_quota, message, visible_space_guids: [], all_spaces_visible: fals... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/build_create.rb | Ruby | apache-2.0 | 203 | main | 8,738 | require 'cloud_controller/backends/quota_validating_staging_log_rate_limit_calculator'
require 'cloud_controller/backends/quota_validating_staging_memory_calculator'
require 'cloud_controller/backends/staging_disk_calculator'
require 'cloud_controller/backends/staging_environment_builder'
require 'cloud_controller/dieg... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/app_assign_droplet.rb | Ruby | apache-2.0 | 203 | main | 1,819 | require 'process_create_from_app_droplet'
require 'sidecar_synchronize_from_app_droplet'
module VCAP::CloudController
class AppAssignDroplet
class Error < StandardError; end
class InvalidApp < Error; end
class InvalidDroplet < Error; end
def initialize(user_audit_info)
@user_audit_info = user_... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/build_delete.rb | Ruby | apache-2.0 | 203 | main | 379 | module VCAP::CloudController
class BuildDelete
def initialize(cancel_action)
@cancel_action = cancel_action
end
def delete_for_app(guid)
builds_in_staging_state = BuildModel.where(app_guid: guid, state: BuildModel::STAGING_STATE).all
@cancel_action.cancel(builds_in_staging_state)
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/revision_create.rb | Ruby | apache-2.0 | 203 | main | 1,978 | require 'repositories/revision_event_repository'
module VCAP::CloudController
class RevisionCreate
class << self
def create(app:, droplet_guid:, environment_variables:, description:, commands_by_process_type:, user_audit_info:)
RevisionModel.db.transaction do
next_version = calculate_next... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/service_instance_share.rb | Ruby | apache-2.0 | 203 | main | 3,763 | require 'repositories/service_instance_share_event_repository'
module VCAP::CloudController
class ServiceInstanceShare
class Error < ::StandardError
end
def create(service_instance, target_spaces, user_audit_info)
validate_supported_service_type!(service_instance)
validate_service_instance_i... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/revision_delete.rb | Ruby | apache-2.0 | 203 | main | 244 | module VCAP::CloudController
class RevisionDelete
class << self
def delete(revisions)
revisions.delete
end
def delete_for_app(guid)
RevisionModel.where(app_guid: guid).delete
end
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/environment_variable_group_update.rb | Ruby | apache-2.0 | 203 | main | 779 | module VCAP::CloudController
class EnvironmentVariableGroupUpdate
class EnvironmentVariableGroupTooLong < StandardError
end
def patch(env_var_group, message)
env_var_group.db.transaction do
env_var_group.lock!
env_var_group.environment_json = merge_environment_variables(env_var_gro... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/domain_delete_shared_org.rb | Ruby | apache-2.0 | 203 | main | 942 | require 'repositories/deployment_event_repository'
module VCAP::CloudController
class DomainDeleteSharedOrg
class OrgError < ::StandardError
end
class RouteError < ::StandardError
end
def self.delete(domain:, shared_organization:)
Domain.db.transaction do
raise OrgError.new if org... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/app_apply_manifest.rb | Ruby | apache-2.0 | 203 | main | 10,372 | require 'actions/process_create'
require 'actions/process_scale'
require 'actions/process_update'
require 'actions/service_credential_binding_app_create'
require 'actions/service_credential_binding_delete'
require 'actions/manifest_route_update'
require 'cloud_controller/strategies/manifest_strategy'
require 'cloud_con... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/revisions_update.rb | Ruby | apache-2.0 | 203 | main | 519 | module VCAP::CloudController
class RevisionsUpdate
class InvalidAppRevisions < StandardError
end
def initialize
@logger = Steno.logger('cc.action.revision_update')
end
def update(revision, message)
revision.db.transaction do
MetadataUpdate.update(revision, message)
end
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/space_delete_unmapped_routes.rb | Ruby | apache-2.0 | 203 | main | 331 | module VCAP::CloudController
class SpaceDeleteUnmappedRoutes
def delete(space)
space.db.transaction do
space.lock!
space.routes_dataset.
exclude(guid: RouteMappingModel.select(:route_guid)).
exclude(id: RouteBinding.select(:route_id)).
destroy
end
end... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/package_copy.rb | Ruby | apache-2.0 | 203 | main | 1,799 | require 'repositories/package_event_repository'
module VCAP::CloudController
class PackageCopy
class InvalidPackage < StandardError; end
attr_reader :enqueued_job
def copy(destination_app_guid:, source_package:, user_audit_info:, record_event: true)
raise InvalidPackage.new('Source and destinatio... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/isolation_segment_create.rb | Ruby | apache-2.0 | 203 | main | 490 | module VCAP::CloudController
class IsolationSegmentCreate
class Error < ::StandardError
end
def self.create(message)
isolation_segment = nil
IsolationSegmentModel.db.transaction do
isolation_segment = IsolationSegmentModel.create(
name: message.name
)
Metadat... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/isolation_segment_delete.rb | Ruby | apache-2.0 | 203 | main | 883 | module VCAP::CloudController
class IsolationSegmentDelete
class AssociationNotEmptyError < StandardError; end
def delete(isolation_segment_model)
if isolation_segment_model.is_shared_segment?
raise CloudController::Errors::ApiError.new_from_details('UnprocessableEntity',
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/route_create.rb | Ruby | apache-2.0 | 203 | main | 7,670 | module VCAP::CloudController
class RouteCreate
class Error < StandardError
end
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def create(message:, space:, domain:, manifest_triggered: false)
validate_tcp_route!(domain, message)
route = Route.new(
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/organization_quota_delete.rb | Ruby | apache-2.0 | 203 | main | 537 | require 'repositories/organization_quota_event_repository'
module VCAP::CloudController
class OrganizationQuotaDeleteAction
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def delete(organization_quotas)
organization_quotas.each do |org_quota|
QuotaDefinition.d... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/route_delete.rb | Ruby | apache-2.0 | 203 | main | 446 | module VCAP::CloudController
class RouteDeleteAction
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def delete(routes)
routes.each do |route|
Route.db.transaction do
route.destroy
end
Repositories::RouteEventRepository.new.record_rout... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/service_instance_update_user_provided.rb | Ruby | apache-2.0 | 203 | main | 2,663 | require 'actions/mixins/service_instance_create'
module VCAP::CloudController
class ServiceInstanceUpdateUserProvided
include ServiceInstanceCreateMixin
class UnprocessableUpdate < ::StandardError
end
def initialize(service_event_repository)
@service_event_repository = service_event_repositor... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/process_terminate.rb | Ruby | apache-2.0 | 203 | main | 715 | module VCAP::CloudController
class ProcessTerminate
class InstanceNotFound < StandardError; end
def initialize(user_audit_info, process, index)
@user_audit_info = user_audit_info
@process = process
@index = index
end
def terminate
raise InstanceNotFound unless @index < @proce... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/domain_update.rb | Ruby | apache-2.0 | 203 | main | 494 | module VCAP::CloudController
class DomainUpdate
class InvalidDomain < StandardError
end
def initialize
@logger = Steno.logger('cc.action.domain_update')
end
def update(domain:, message:)
Domain.db.transaction do
MetadataUpdate.update(domain, message)
end
@logger.... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/route_destination_update.rb | Ruby | apache-2.0 | 203 | main | 1,041 | module VCAP::CloudController
class RouteDestinationUpdate
class Error < StandardError
end
class << self
def update(destination, message)
validate_protocol_matches_route!(destination, message)
destination.db.transaction do
destination.lock!
destination.protocol ... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/sidecar_create.rb | Ruby | apache-2.0 | 203 | main | 1,438 | module VCAP::CloudController
class SidecarCreate
class InvalidSidecar < StandardError
end
class << self
def create(app_guid, message, origin=SidecarModel::ORIGIN_USER)
logger = Steno.logger('cc.action.sidecar_create')
validate_memory_allocation!(app_guid, message) if message.reques... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/space_create.rb | Ruby | apache-2.0 | 203 | main | 911 | module VCAP::CloudController
class SpaceCreate
class Error < ::StandardError
end
def initialize(user_audit_info:)
@user_audit_info = user_audit_info
end
def create(org, message)
space = nil
Space.db.transaction do
space = VCAP::CloudController::Space.create(name: messag... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/space_delete.rb | Ruby | apache-2.0 | 203 | main | 4,112 | require 'actions/v3/service_instance_delete'
require 'jobs/v3/delete_service_instance_job'
module VCAP::CloudController
class SpaceDelete
def initialize(user_audit_info, services_event_repository)
@user_audit_info = user_audit_info
@services_event_repository = services_event_repository
end
d... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/sidecar_delete.rb | Ruby | apache-2.0 | 203 | main | 240 | module VCAP::CloudController
class SidecarDelete
class << self
def delete(sidecars)
sidecars.delete
end
def delete_for_app(guid)
SidecarModel.where(app_guid: guid).delete
end
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/service_plan_delete.rb | Ruby | apache-2.0 | 203 | main | 448 | module VCAP::CloudController
class ServicePlanDelete
class AssociationNotEmptyError < StandardError; end
def delete(service_plan_model)
association_not_empty! unless service_plan_model.service_instances.empty?
service_plan_model.destroy
end
private
def association_not_empty!
r... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/app_update.rb | Ruby | apache-2.0 | 203 | main | 3,841 | require 'models/helpers/metadata_helpers'
require 'actions/labels_update'
require 'actions/annotations_update'
module VCAP::CloudController
class AppUpdate
class DropletNotFound < StandardError; end
class InvalidApp < StandardError; end
attr_reader :warnings
def initialize(user_audit_info, manifest... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/isolation_segment_unassign.rb | Ruby | apache-2.0 | 203 | main | 1,639 | module VCAP::CloudController
class IsolationSegmentUnassign
def unassign(isolation_segment, org)
isolation_segment.db.transaction do
isolation_segment.lock!(:share)
org.lock!
org_association_error! if is_default_segment?(isolation_segment, org)
spaces = associated_spaces(is... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/buildpack_upload.rb | Ruby | apache-2.0 | 203 | main | 682 | module VCAP::CloudController
class BuildpackUpload
def initialize(user_audit_info)
@user_audit_info = user_audit_info
end
def upload_async(message:, buildpack:, config:)
logger.info("uploading buildpacks bits for buildpack #{buildpack.guid}")
upload_job = Jobs::V3::BuildpackBits.new(bu... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/route_share.rb | Ruby | apache-2.0 | 203 | main | 882 | require 'repositories/route_event_repository'
module VCAP::CloudController
class RouteShare
class Error < ::StandardError
end
def create(route, target_spaces, user_audit_info)
validate_not_sharing_to_self!(route, target_spaces)
Route.db.transaction do
target_spaces.each do |space|
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/route_unshare.rb | Ruby | apache-2.0 | 203 | main | 830 | require 'repositories/route_event_repository'
module VCAP::CloudController
class RouteUnshare
class Error < ::StandardError
end
def unshare(route, target_space, user_audit_info)
validate_not_unsharing_from_owner!(route, target_space)
Route.db.transaction do
route.remove_shared_space... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/actions/security_group_create.rb | Ruby | apache-2.0 | 203 | main | 2,086 | module VCAP::CloudController
class SecurityGroupCreate
MYSQL_INVALID_VALUE_ERROR = 1366
class Error < ::StandardError
end
class << self
def create(message)
security_group = nil
SecurityGroup.db.transaction do
security_group = SecurityGroup.create(
name: m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.