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/messages/process_scale_message.rb | Ruby | apache-2.0 | 203 | main | 845 | require 'messages/base_message'
module VCAP::CloudController
class ProcessScaleMessage < BaseMessage
register_allowed_keys %i[instances memory_in_mb disk_in_mb log_rate_limit_in_bytes_per_second]
validates_with NoAdditionalKeysValidator
validates :instances, numericality: { only_integer: true, greater_... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/service_usage_events_list_message.rb | Ruby | apache-2.0 | 203 | main | 793 | require 'messages/list_message'
module VCAP::CloudController
class ServiceUsageEventsListMessage < ListMessage
register_allowed_keys %i[
after_guid
service_instance_types
service_offering_guids
]
validates_with NoAdditionalParamsValidator
validates_with DisallowUpdatedAtsParamValid... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/metadata_list_message.rb | Ruby | apache-2.0 | 203 | main | 496 | require 'messages/list_message'
require 'messages/validators/label_selector_requirement_validator'
module VCAP::CloudController
class MetadataListMessage < ListMessage
def self.register_allowed_keys(allowed_keys)
super(allowed_keys + [:label_selector])
end
def self.label_selector_requested?
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/security_group_update_message.rb | Ruby | apache-2.0 | 203 | main | 1,283 | require 'messages/base_message'
module VCAP::CloudController
class SecurityGroupUpdateMessage < BaseMessage
MAX_SECURITY_GROUP_NAME_LENGTH = 250
def self.key_requested?(key)
proc { |a| a.requested?(key) }
end
register_allowed_keys %i[name globally_enabled rules]
validates_with NoAddition... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/task_create_message.rb | Ruby | apache-2.0 | 203 | main | 1,588 | require 'messages/metadata_base_message'
module VCAP::CloudController
class TaskCreateMessage < MetadataBaseMessage
register_allowed_keys %i[name command disk_in_mb memory_in_mb log_rate_limit_in_bytes_per_second droplet_guid template user]
validates_with NoAdditionalKeysValidator
def self.validate_tem... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/update_environment_variables_message.rb | Ruby | apache-2.0 | 203 | main | 502 | require 'messages/base_message'
module VCAP::CloudController
class UpdateEnvironmentVariablesMessage < BaseMessage
register_allowed_keys [:var]
validates_with NoAdditionalKeysValidator
validates :var, environment_variables_string_values: true
def self.for_env_var_group(params)
params = { var... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/space_quota_update_message.rb | Ruby | apache-2.0 | 203 | main | 2,365 | require 'messages/metadata_base_message'
require 'messages/validators'
module VCAP::CloudController
class SpaceQuotaUpdateMessage < BaseMessage
MAX_SPACE_QUOTA_NAME_LENGTH = 250
def self.key_requested?(key)
proc { |a| a.requested?(key) }
end
register_allowed_keys %i[name apps services routes]... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/route_update_message.rb | Ruby | apache-2.0 | 203 | main | 536 | require 'messages/metadata_base_message'
require 'messages/route_options_message'
module VCAP::CloudController
class RouteUpdateMessage < MetadataBaseMessage
register_allowed_keys %i[options]
def self.options_requested?
@options_requested ||= proc { |a| a.requested?(:options) }
end
def option... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/route_show_message.rb | Ruby | apache-2.0 | 203 | main | 426 | require 'messages/base_message'
module VCAP::CloudController
class RouteShowMessage < BaseMessage
register_allowed_keys %i[guid include]
validates_with NoAdditionalParamsValidator
validates_with IncludeParamValidator, valid_values: ['domain', 'space', 'space.organization']
validates :guid, presence... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/list_message.rb | Ruby | apache-2.0 | 203 | main | 4,342 | require 'active_model'
require 'messages/validators'
require 'messages/base_message'
require 'cloud_controller/paging/pagination_options'
module VCAP::CloudController
class ListMessage < BaseMessage
include ActiveModel::Model
include Validators
ALLOWED_PAGINATION_KEYS = %i[page per_page order_by].freeze... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/buildpacks_list_message.rb | Ruby | apache-2.0 | 203 | main | 1,114 | require 'messages/metadata_list_message'
module VCAP::CloudController
class BuildpacksListMessage < MetadataListMessage
register_allowed_keys %i[
stacks
names
lifecycle
page
per_page
]
validates :names, array: true, allow_nil: true
validates :stacks, array: true, allow_... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/validators/url_validator.rb | Ruby | apache-2.0 | 203 | main | 462 | require 'active_model'
require 'cloud_controller/domain_decorator'
module VCAP::CloudController::Validators
class UrlValidator < ActiveModel::Validator
def validate(record)
if URI::DEFAULT_PARSER.make_regexp(%w[https http]).match?(record.url.to_s)
record.errors.add(:url, 'must not contain authentic... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/validators/metadata_validator.rb | Ruby | apache-2.0 | 203 | main | 2,331 | require 'active_model'
require 'models/helpers/metadata_helpers'
require 'cloud_controller/domain_decorator'
require 'messages/metadata_validator_helper'
module VCAP::CloudController::Validators
class MetadataValidator < ActiveModel::Validator
MAX_ANNOTATION_VALUE_SIZE = 5000
attr_accessor :labels, :annotat... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/validators/bits_data_validator.rb | Ruby | apache-2.0 | 203 | main | 462 | require 'messages/nested_message_validator'
module VCAP::CloudController
class BitsDataValidator < NestedMessageValidator
validates :data, inclusion: { in: [{}],
message: 'must be empty if provided for bits packages',
allow_nil: true }
def ... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/validators/security_group_rule_validator.rb | Ruby | apache-2.0 | 203 | main | 6,987 | require 'active_model'
class RulesValidator < ActiveModel::Validator
ALLOWED_RULE_KEYS = %i[
code
description
destination
log
ports
protocol
type
].freeze
MAX_DESTINATIONS_PER_RULE = 6000
def validate(record)
unless record.rules.is_a?(Array)
record.errors.add :rules, 'mu... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/validators/docker_data_validator.rb | Ruby | apache-2.0 | 203 | main | 716 | require 'messages/nested_message_validator'
module VCAP::CloudController
class DockerDataValidator < NestedMessageValidator
ALLOWED_KEYS = %i[image username password].freeze
validates :image, string: true, presence: { message: 'required' }
validates_with BaseMessage::NoAdditionalKeysValidator
dele... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/validators/authentication_validator.rb | Ruby | apache-2.0 | 203 | main | 1,700 | require 'active_model'
module VCAP::CloudController::Validators
class AuthenticationValidator < ActiveModel::Validator
def validate(record)
ValidateAuthentication.new(record).validate
end
class ValidateAuthentication
attr_reader :record
def initialize(record)
@record = record
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/validators/maintenance_info_validator.rb | Ruby | apache-2.0 | 203 | main | 364 | require 'active_model'
module VCAP::CloudController::Validators
class MaintenanceInfoValidator < ActiveModel::Validator
def validate(record)
return if record.maintenance_info_message.valid?
record.maintenance_info_message.errors.full_messages.each do |message|
record.errors.add(:maintenance_... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/validators/label_selector_requirement_validator.rb | Ruby | apache-2.0 | 203 | main | 1,514 | require 'active_model'
require 'models/helpers/metadata_helpers'
require 'messages/metadata_validator_helper'
module VCAP::CloudController::Validators
class LabelSelectorRequirementValidator < ActiveModel::Validator
MAX_REQUIREMENTS = 50
MISSING_LABEL_SELECTOR_ERROR = 'Missing label_selector value'.freeze
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | app/messages/mixins/authentication_message_mixin.rb | Ruby | apache-2.0 | 203 | main | 698 | require 'messages/basic_credentials_message'
require 'messages/authentication_message'
require 'presenters/helpers/censorship'
module VCAP::CloudController::AuthenticationMessageMixin
def username
HashUtils.dig(authentication, :credentials, :username)
end
def password
HashUtils.dig(authentication, :cred... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/routes.rb | Ruby | apache-2.0 | 203 | main | 16,432 | Rails.application.routes.draw do
get '/', to: 'root#v3_root'
# admin actions
post '/admin/actions/clear_buildpack_cache', to: 'admin_actions#clear_buildpack_cache'
# apps
get '/apps', to: 'apps_v3#index'
post '/apps', to: 'apps_v3#create'
get '/apps/:guid', to: 'apps_v3#show'
patch '/apps/:guid', to: ... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/boot.rb | Ruby | apache-2.0 | 203 | main | 329 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
$LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
$LOAD_PATH.unshift(File.expand_path('../app', __dir__))
$LOAD_PATH.unshift(File.expand_path('../middleware', __dir__))
require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'bootsna... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/application.rb | Ruby | apache-2.0 | 203 | main | 984 | require 'action_controller/railtie'
class Application < Rails::Application
config.exceptions_app = routes
config.middleware.delete ActionDispatch::Session::CookieStore
config.middleware.delete ActionDispatch::Cookies
config.middleware.delete ActionDispatch::Flash
config.middleware.delete ActionDispatch::Requ... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/environments/development.rb | Ruby | apache-2.0 | 203 | main | 697 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/environments/production.rb | Ruby | apache-2.0 | 203 | main | 1,130 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
config.autoload_paths = ['/Users/pivotal/workspace/cf-release/src/capi-release/src/cloud_controller_ng/app/controllers/v3']
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/environments/test.rb | Ruby | apache-2.0 | 203 | main | 1,267 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suit... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/initializers/wrap_parameters.rb | Ruby | apache-2.0 | 203 | main | 411 | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
module CCInitializers
def self.wrap_parameters(_)
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
Activ... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/initializers/json.rb | Ruby | apache-2.0 | 203 | main | 852 | require 'bigdecimal'
# Override BigDecimal's 'as_json' to return self so that Oj can handle it according to its configuration.
# By default, ActiveSupport encodes BigDecimal as a string which we do not want.
class BigDecimal
def as_json(*_args)
self
end
end
module CCInitializers
def self.json(_cc_config)
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/initializers/cloudfront_signer.rb | Ruby | apache-2.0 | 203 | main | 578 | require 'cloudfront-signer'
module CCInitializers
def self.cloudfront_signer(cc_config)
return if cc_config[:droplets].blank?
cdn_config = cc_config[:droplets][:cdn]
return unless cdn_config && cdn_config[:private_key].present?
key_file = Tempfile.open('pk-cdn.pem') do |file|
file.write(cc_co... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/initializers/feature_flag_overrides.rb | Ruby | apache-2.0 | 203 | main | 382 | module CCInitializers
def self.feature_flag_overrides(cc_config)
@logger ||= Steno.logger('cc.feature_flag_overrides')
@logger.info("Initializing feature_flag_overrides: #{cc_config[:feature_flag_overrides]}")
return unless cc_config[:feature_flag_overrides]
VCAP::CloudController::FeatureFlag.overrid... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/newrelic/initializers/new_relic_app_observer_instrumentation.rb | Ruby | apache-2.0 | 203 | main | 597 | require 'new_relic/agent/method_tracer'
require 'cloud_controller/process_observer'
module CCInitializers
def self.new_relic_app_observer_instrumentation(_)
VCAP::CloudController::ProcessObserver.class_eval do
include ::NewRelic::Agent::MethodTracer
class << self
%w[
deleted
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | config/newrelic/initializers/new_relic_loggregator_instrumentation.rb | Ruby | apache-2.0 | 203 | main | 536 | require 'new_relic/agent/method_tracer'
require 'app_log_emitter'
module CCInitializers
def self.new_relic_loggregator_instrumentation(_)
VCAP::AppLogEmitter.class_eval do
include ::NewRelic::Agent::MethodTracer
class << self
%w[
emit
emit_error
].each do |method_... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | scripts/seed_users.rb | Ruby | apache-2.0 | 203 | main | 524 | # usage: pipe this script into bin/console on the api vm
NUM_USERS = 5000
org_roles = %w[manager auditor billing_manager]
space_roles = %w[developer manager auditor]
NUM_USERS.times do |i|
org = Organization.all.sample
space = org.spaces.sample
user = User.create(guid: "user-#{i}")
org.add_user(user)
org.s... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | scripts/seed_roles.rb | Ruby | apache-2.0 | 203 | main | 842 | # For creating a few users with many roles
# 1 users; 20 orgs; 10 spaces per org
# usage: pipe this script into bin/console on the api vm
NUM_ORGS = 20
NUM_SPACES = 10
org_roles = %w[manager auditor billing_manager]
space_roles = %w[developer manager auditor]
user = User.find_or_create(guid: 'seed-role-user')
NUM_O... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | scripts/benchmark_rate_limiting.rb | Ruby | apache-2.0 | 203 | main | 2,120 | # usage: pipe this script into bin/console on the api vm
# this script logs to stderr, thus you might want to redirect stdout to /dev/null
NUM_USERS = 1000
NUM_REQUESTS_PER_USER = 1000
logger = Logger.new($stderr)
rate_limiter = CloudFoundry::Middleware::RateLimiter::EXPIRING_REQUEST_COUNTER
rate_limiter_v2 = CloudF... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | scripts/seed_service_instances.rb | Ruby | apache-2.0 | 203 | main | 899 | # usage: pipe this script into bin/console on the api vm
NUM_ORGS = 10
NUM_SPACES = 10
NUM_SERVICES = 10
NUM_SERVICE_PLANS = 5
NUM_SERVICE_INSTANCES = 50_000
NUM_ORGS.times do |i|
Organization.create(name: "perf-org-#{i}")
end
NUM_SPACES.times do |i|
Space.create(name: "perf-space#{i}", organization: Organization... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | scripts/generate_jobs.rb | Ruby | apache-2.0 | 203 | main | 604 | # usage: pipe this script into bin/console on a cc-worker vm
NUM_JOBS = 1
DELAY = 1
puts "Generating #{NUM_JOBS} dummy job(s) with delay of #{DELAY} seconds"
enqueuer = VCAP::CloudController::Jobs::Enqueuer.new(queue: VCAP::CloudController::Jobs::Queues.generic)
start_time = Time.now
NUM_JOBS.times do
dummy_job = V... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/membrane.rb | Ruby | apache-2.0 | 203 | main | 344 | # Vendored Membrane library - inlined from https://github.com/cloudfoundry/membrane
# This shim makes `require "membrane"` load the vendored code from lib/membrane/
# Original upstream: cloudfoundry/membrane (Apache 2.0 licensed)
require 'membrane/errors'
require 'membrane/schemas'
require 'membrane/schema_parser'
req... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/cloud_controller.rb | Ruby | apache-2.0 | 203 | main | 4,242 | require 'sinatra'
require 'sequel'
require 'oj'
require 'delayed_job'
require 'allowy/allowy'
require 'uaa/token_coder'
module VCAP; end
require 'sinatra/vcap'
require File.expand_path('../config/environment', __dir__)
Sequel.default_timezone = :utc
ActiveSupport::JSON::Encoding.time_precision = 0
module VCAP::Cl... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/fluent_emitter.rb | Ruby | apache-2.0 | 203 | main | 666 | require 'fluent-logger'
module VCAP
class FluentEmitter
class Error < StandardError; end
SOURCE_TYPE = 'API'.freeze
PRIMARY_TAG = 'API'.freeze
attr_reader :fluent_logger
def initialize(fluent_logger)
@fluent_logger = fluent_logger
end
def emit(app_id, message)
return if flu... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/app_log_emitter.rb | Ruby | apache-2.0 | 203 | main | 1,409 | require 'fluent_emitter'
module VCAP
class AppLogEmitter
class << self
attr_accessor :emitter, :logger, :fluent_emitter
def emit(app_id, message)
fluent_emitter.emit(app_id, message) if fluent_emitter
emitter.emit(app_id, message, generate_tags(app_id)) if emitter
rescue Standa... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/ext/validation_error_message_overrides.rb | Ruby | apache-2.0 | 203 | main | 342 | class ::Membrane::Schemas::Regexp::MatchValidator
def fail!(regexp, object)
emsg = if regexp.respond_to?(:default_error_message)
regexp.default_error_message
else
"Value #{object} doesn't match regexp #{regexp.inspect}"
end
raise ::Membrane::SchemaValidationErro... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/loggregator_emitter/client.rb | Ruby | apache-2.0 | 203 | main | 2,286 | require 'loggregator-api/v2/ingress_services_pb'
require 'loggregator-api/v2/envelope_pb'
module LoggregatorEmitter
class Client
def initialize(endpoint:, origin:, source_type:, instance_id: nil, ca_cert_file: nil, client_cert_file: nil, client_key_file: nil, subject_name: nil)
raise ArgumentError.new('Mus... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/sinatra/vcap.rb | Ruby | apache-2.0 | 203 | main | 3,196 | require 'vcap/rest_api'
require 'vcap/request'
require 'presenters/error_presenter'
require 'sinatra/reloader'
require 'securerandom'
require 'steno/steno'
module Sinatra
module VCAP
module Helpers
def in_test_mode?
ENV.fetch('CC_TEST', nil)
end
end
# Called when the caller registers... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/delayed_job_plugins/deserialization_retry.rb | Ruby | apache-2.0 | 203 | main | 1,189 | class DeserializationRetry < Delayed::Plugin
callbacks do |lifecycle|
lifecycle.around(:failure) do |job, *args, &block|
db_job = args[0]
if deserialization_error?(db_job)
if expired?(db_job)
logger.info("Deserialization for job '#{db_job.guid}' failed, job is expired")
bl... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/delayed_job_plugins/after_enqueue_hook.rb | Ruby | apache-2.0 | 203 | main | 219 | class AfterEnqueueHook < Delayed::Plugin
callbacks do |lifecycle|
lifecycle.after(:enqueue) do |job|
job.payload_object.try(:after_enqueue, job)
end
end
end
Delayed::Worker.plugins << AfterEnqueueHook |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/delayed_job_plugins/before_enqueue_hook.rb | Ruby | apache-2.0 | 203 | main | 223 | class BeforeEnqueueHook < Delayed::Plugin
callbacks do |lifecycle|
lifecycle.before(:enqueue) do |job|
job.payload_object.try(:before_enqueue, job)
end
end
end
Delayed::Worker.plugins << BeforeEnqueueHook |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/delayed_job_plugins/delayed_jobs_metrics.rb | Ruby | apache-2.0 | 203 | main | 793 | module DelayedJobMetrics
class Plugin < Delayed::Plugin
class << self
attr_writer :prometheus
def prometheus
@prometheus ||= CloudController::DependencyLocator.instance.prometheus_updater
end
end
callbacks do |lifecycle|
lifecycle.after(:perform) do |worker, job|
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/routes.rb | Ruby | apache-2.0 | 203 | main | 1,000 | module Diego
module Routes
PING = '/v1/ping'.freeze
UPSERT_DOMAIN = '/v1/domains/upsert'.freeze
DESIRE_TASK = '/v1/tasks/desire.r2'.freeze
CANCEL_TASK = '/v1/tasks/cancel'.freeze
LIST_TASKS = '/v1/tasks/list... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/action_builder.rb | Ruby | apache-2.0 | 203 | main | 2,300 | require 'diego/bbs/bbs'
module Diego
module ActionBuilder
extend Forwardable
ACTION_TYPE_MAP = {
Bbs::Models::DownloadAction => :download_action,
Bbs::Models::EmitProgressAction => :emit_progress_action,
Bbs::Models::RunAction => :run_action,
Bbs::Models::UploadAction => :upload_acti... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/client.rb | Ruby | apache-2.0 | 203 | main | 7,865 | require 'diego/bbs/bbs'
require 'diego/errors'
require 'diego/routes'
require 'http/httpclient'
module Diego
class Client
def initialize(url:, ca_cert_file:, client_cert_file:, client_key_file:,
connect_timeout:, send_timeout:, receive_timeout:)
ENV['PB_IGNORE_DEPRECATIONS'] ||= 'true'
... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/bbs.rb | Ruby | apache-2.0 | 203 | main | 886 | $LOAD_PATH.unshift(File.expand_path('models', __dir__))
require 'diego/bbs/models/actions_pb'
require 'diego/bbs/models/actual_lrp_pb'
require 'diego/bbs/models/actual_lrp_requests_pb'
require 'diego/bbs/models/cached_dependency_pb'
require 'diego/bbs/models/cells_pb'
require 'diego/bbs/models/desired_lrp_pb'
require ... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/error_types.rb | Ruby | apache-2.0 | 203 | main | 2,768 | require 'diego/bbs/models/error_pb'
module Diego::Bbs::ErrorTypes
class << self
def lookup_error_type(error_type)
::Diego::Bbs::Models::Error::Type.lookup(error_type)
end
end
UnknownError = lookup_error_type(::Diego::Bbs::Models::Error::Type::UnknownError)
InvalidRecord ... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/actions_pb.rb | Ruby | apache-2.0 | 203 | main | 4,897 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: actions.proto
require 'google/protobuf'
require 'environment_variables_pb'
require 'file_pb'
descriptor_data = "\n\ractions.proto\x12\x10\x64iego.bbs.models\x1a\x1b\x65nvironment_variables.proto\x1a\nfile.proto\"\x8c\... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/file_pb.rb | Ruby | apache-2.0 | 203 | main | 567 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: file.proto
require 'google/protobuf'
descriptor_data = "\n\nfile.proto\x12\x10\x64iego.bbs.models\"%\n\x04\x46ile\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\tb\x06proto3"
pool = Google::Pr... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/error_pb.rb | Ruby | apache-2.0 | 203 | main | 1,927 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: error.proto
require 'google/protobuf'
descriptor_data = "\n\x0b\x65rror.proto\x12\x10\x64iego.bbs.models\"\xb0\x05\n\x05\x45rror\x12*\n\x04type\x18\x01 \x01(\x0e\x32\x1c.diego.bbs.models.Error.Type\x12\x0f\n\x07message... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/task_pb.rb | Ruby | apache-2.0 | 203 | main | 3,977 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: task.proto
require 'google/protobuf'
require 'actions_pb'
require 'environment_variables_pb'
require 'security_group_pb'
require 'cached_dependency_pb'
require 'volume_mount_pb'
require 'network_pb'
require 'certificate... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/ping_pb.rb | Ruby | apache-2.0 | 203 | main | 556 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ping.proto
require 'google/protobuf'
descriptor_data = "\n\nping.proto\x12\x10\x64iego.bbs.models\"!\n\x0cPingResponse\x12\x11\n\tavailable\x18\x01 \x01(\x08\x62\x06proto3"
pool = Google::Protobuf::DescriptorPool.gene... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/cells_pb.rb | Ruby | apache-2.0 | 203 | main | 1,754 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: cells.proto
require 'google/protobuf'
require 'error_pb'
descriptor_data = "\n\x0b\x63\x65lls.proto\x12\x10\x64iego.bbs.models\x1a\x0b\x65rror.proto\"F\n\x0c\x43\x65llCapacity\x12\x11\n\tmemory_mb\x18\x01 \x01(\x05\x1... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/environment_variables_pb.rb | Ruby | apache-2.0 | 203 | main | 644 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: environment_variables.proto
require 'google/protobuf'
descriptor_data = "\n\x1b\x65nvironment_variables.proto\x12\x10\x64iego.bbs.models\"2\n\x13\x45nvironmentVariable\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/volume_mount_pb.rb | Ruby | apache-2.0 | 203 | main | 1,559 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: volume_mount.proto
require 'google/protobuf'
descriptor_data = "\n\x12volume_mount.proto\x12\x10\x64iego.bbs.models\"7\n\x0cSharedDevice\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x14\n\x0cmount_config\x18\x02 \x01(\t\"R... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/sidecar_pb.rb | Ruby | apache-2.0 | 203 | main | 703 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: sidecar.proto
require 'google/protobuf'
require 'actions_pb'
descriptor_data = "\n\rsidecar.proto\x12\x10\x64iego.bbs.models\x1a\ractions.proto\"W\n\x07Sidecar\x12(\n\x06\x61\x63tion\x18\x01 \x01(\x0b\x32\x18.diego.bb... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/log_rate_limit_pb.rb | Ruby | apache-2.0 | 203 | main | 590 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: log_rate_limit.proto
require 'google/protobuf'
descriptor_data = "\n\x14log_rate_limit.proto\x12\x10\x64iego.bbs.models\"(\n\x0cLogRateLimit\x12\x18\n\x10\x62ytes_per_second\x18\x01 \x01(\x03\x62\x06proto3"
pool = Goo... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/image_layer_pb.rb | Ruby | apache-2.0 | 203 | main | 1,750 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: image_layer.proto
require 'google/protobuf'
descriptor_data = "\n\x11image_layer.proto\x12\x10\x64iego.bbs.models\"\xd4\x03\n\nImageLayer\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x18\n\x10... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/cached_dependency_pb.rb | Ruby | apache-2.0 | 203 | main | 853 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: cached_dependency.proto
require 'google/protobuf'
descriptor_data = "\n\x17\x63\x61\x63hed_dependency.proto\x12\x10\x64iego.bbs.models\"\x95\x01\n\x10\x43\x61\x63hedDependency\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/domain_pb.rb | Ruby | apache-2.0 | 203 | main | 1,152 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: domain.proto
require 'google/protobuf'
require 'error_pb'
descriptor_data = "\n\x0c\x64omain.proto\x12\x10\x64iego.bbs.models\x1a\x0b\x65rror.proto\"J\n\x0f\x44omainsResponse\x12&\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/task_requests_pb.rb | Ruby | apache-2.0 | 203 | main | 3,965 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: task_requests.proto
require 'google/protobuf'
require 'task_pb'
require 'error_pb'
descriptor_data = "\n\x13task_requests.proto\x12\x10\x64iego.bbs.models\x1a\ntask.proto\x1a\x0b\x65rror.proto\"?\n\x15TaskLifecycleRes... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/security_group_pb.rb | Ruby | apache-2.0 | 203 | main | 1,317 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: security_group.proto
require 'google/protobuf'
descriptor_data = "\n\x14security_group.proto\x12\x10\x64iego.bbs.models\"\'\n\tPortRange\x12\r\n\x05start\x18\x01 \x01(\r\x12\x0b\n\x03\x65nd\x18\x02 \x01(\r\"&\n\x08ICMP... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/desired_lrp_pb.rb | Ruby | apache-2.0 | 203 | main | 8,745 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: desired_lrp.proto
require 'google/protobuf'
require 'actions_pb'
require 'cached_dependency_pb'
require 'certificate_properties_pb'
require 'environment_variables_pb'
require 'modification_tag_pb'
require 'network_pb'
r... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/modification_tag_pb.rb | Ruby | apache-2.0 | 203 | main | 618 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: modification_tag.proto
require 'google/protobuf'
descriptor_data = "\n\x16modification_tag.proto\x12\x10\x64iego.bbs.models\"/\n\x0fModificationTag\x12\r\n\x05\x65poch\x18\x01 \x01(\t\x12\r\n\x05index\x18\x02 \x01(\rb\... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/actual_lrp_requests_pb.rb | Ruby | apache-2.0 | 203 | main | 6,182 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: actual_lrp_requests.proto
require 'google/protobuf'
require 'actual_lrp_pb'
require 'error_pb'
descriptor_data = "\n\x19\x61\x63tual_lrp_requests.proto\x12\x10\x64iego.bbs.models\x1a\x10\x61\x63tual_lrp.proto\x1a\x0b\... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/network_pb.rb | Ruby | apache-2.0 | 203 | main | 699 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: network.proto
require 'google/protobuf'
descriptor_data = "\n\rnetwork.proto\x12\x10\x64iego.bbs.models\"{\n\x07Network\x12=\n\nproperties\x18\x01 \x03(\x0b\x32).diego.bbs.models.Network.PropertiesEntry\x1a\x31\n\x0fPr... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/metric_tags_pb.rb | Ruby | apache-2.0 | 203 | main | 950 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: metric_tags.proto
require 'google/protobuf'
descriptor_data = "\n\x11metric_tags.proto\x12\x10\x64iego.bbs.models\"\xa7\x01\n\x0eMetricTagValue\x12\x0e\n\x06static\x18\x01 \x01(\t\x12>\n\x07\x64ynamic\x18\x02 \x01(\x0e... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/events_pb.rb | Ruby | apache-2.0 | 203 | main | 5,825 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: events.proto
require 'google/protobuf'
require 'actual_lrp_pb'
require 'desired_lrp_pb'
require 'task_pb'
require 'modification_tag_pb'
descriptor_data = "\n\x0c\x65vents.proto\x12\x10\x64iego.bbs.models\x1a\x10\x61\x... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/actual_lrp_pb.rb | Ruby | apache-2.0 | 203 | main | 4,035 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: actual_lrp.proto
require 'google/protobuf'
require 'modification_tag_pb'
descriptor_data = "\n\x10\x61\x63tual_lrp.proto\x12\x10\x64iego.bbs.models\x1a\x16modification_tag.proto\"t\n\x0e\x41\x63tualLRPGroup\x12-\n\x08... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/check_definition_pb.rb | Ruby | apache-2.0 | 203 | main | 1,567 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: check_definition.proto
require 'google/protobuf'
descriptor_data = "\n\x16\x63heck_definition.proto\x12\x10\x64iego.bbs.models\"\x81\x01\n\x0f\x43heckDefinition\x12\'\n\x06\x63hecks\x18\x01 \x03(\x0b\x32\x17.diego.bbs.... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/evacuation_pb.rb | Ruby | apache-2.0 | 203 | main | 3,632 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: evacuation.proto
require 'google/protobuf'
require 'actual_lrp_pb'
require 'error_pb'
descriptor_data = "\n\x10\x65vacuation.proto\x12\x10\x64iego.bbs.models\x1a\x10\x61\x63tual_lrp.proto\x1a\x0b\x65rror.proto\"T\n\x1... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/desired_lrp_requests_pb.rb | Ruby | apache-2.0 | 203 | main | 3,497 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: desired_lrp_requests.proto
require 'google/protobuf'
require 'desired_lrp_pb'
require 'error_pb'
descriptor_data = "\n\x1a\x64\x65sired_lrp_requests.proto\x12\x10\x64iego.bbs.models\x1a\x11\x64\x65sired_lrp.proto\x1a\... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/diego/bbs/models/certificate_properties_pb.rb | Ruby | apache-2.0 | 203 | main | 640 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: certificate_properties.proto
require 'google/protobuf'
descriptor_data = "\n\x1c\x63\x65rtificate_properties.proto\x12\x10\x64iego.bbs.models\"4\n\x15\x43\x65rtificateProperties\x12\x1b\n\x13organizational_unit\x18\x01... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/http/httpclient.rb | Ruby | apache-2.0 | 203 | main | 1,305 | require 'httpclient'
module HTTPClientMonkeyPatch
module SocketConnectTimeout
attr_reader :socket_connect_timeout
def socket_connect_timeout=(timeout)
@socket_connect_timeout = timeout
end
end
module TCPSocketWithConnectTimeout
def create_socket(host, port)
@debug_dev << "! CONNECT ... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/service_brokers.rb | Ruby | apache-2.0 | 203 | main | 472 | module VCAP::Services::ServiceBrokers end
require 'services/service_brokers/user_provided'
require 'services/service_brokers/v2'
require 'services/service_brokers/null_client'
require 'services/service_brokers/service_client_provider'
require 'services/service_brokers/service_manager'
require 'services/service_broker... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/validation_errors.rb | Ruby | apache-2.0 | 203 | main | 557 | module VCAP::Services
class ValidationErrors
attr_reader :messages, :nested_errors
def initialize
@messages = []
@nested_errors = {}
end
def add(message)
messages << message
self
end
def add_nested(object_with_errors, validation_errors=ValidationErrors.new)
nes... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/sso/commands.rb | Ruby | apache-2.0 | 203 | main | 312 | module VCAP::Services::SSO::Commands end
require 'services/sso/commands/create_client_command'
require 'services/sso/commands/delete_client_command'
require 'services/sso/commands/update_client_command'
require 'services/sso/commands/claim_client_command'
require 'services/sso/commands/unclaim_client_command' |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/sso/dashboard_client_differ.rb | Ruby | apache-2.0 | 203 | main | 1,510 | module VCAP::Services::SSO
class DashboardClientDiffer
def initialize(broker)
@broker = broker
end
def create_db_changeset(requested_clients, existing_cc_clients)
requested_ids = requested_clients.map { |client| client.fetch('id') }
create_and_update_commands = requested_clients.map do... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/sso/dashboard_client_manager.rb | Ruby | apache-2.0 | 203 | main | 5,510 | module VCAP::Services::SSO
class DashboardClientManager
attr_reader :errors, :warnings
REQUESTED_FEATURE_DISABLED_WARNING = [
'Warning: This broker includes configuration for a dashboard client.',
'Auto-creation of OAuth2 clients has been disabled in this Cloud Foundry instance.',
'The brok... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/sso/commands/claim_client_command.rb | Ruby | apache-2.0 | 203 | main | 361 | module VCAP::Services::SSO::Commands
class ClaimClientCommand
attr_reader :client_id, :service_broker
def initialize(client_id, service_broker)
@client_id = client_id
@service_broker = service_broker
end
def db_command
VCAP::CloudController::ServiceDashboardClient.claim_client(clie... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/sso/commands/create_client_command.rb | Ruby | apache-2.0 | 203 | main | 235 | module VCAP::Services::SSO::Commands
class CreateClientCommand
attr_reader :client_attrs
def initialize(client_attrs)
@client_attrs = client_attrs
end
def uaa_command
{ action: 'add' }
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/sso/commands/update_client_command.rb | Ruby | apache-2.0 | 203 | main | 245 | module VCAP::Services::SSO::Commands
class UpdateClientCommand
attr_reader :client_attrs
def initialize(client_attrs)
@client_attrs = client_attrs
end
def uaa_command
{ action: 'update,secret' }
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/sso/commands/unclaim_client_command.rb | Ruby | apache-2.0 | 203 | main | 277 | module VCAP::Services::SSO::Commands
class UnclaimClientCommand
attr_reader :client_id
def initialize(client_id)
@client_id = client_id
end
def db_command
VCAP::CloudController::ServiceDashboardClient.release_client(client_id)
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/sso/commands/delete_client_command.rb | Ruby | apache-2.0 | 203 | main | 285 | module VCAP::Services::SSO::Commands
class DeleteClientCommand
attr_reader :client_id, :client_attrs
def initialize(client_id)
@client_id = client_id
@client_attrs = { 'id' => client_id }
end
def uaa_command
{ action: 'delete' }
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/sso/uaa/uaa_client_manager.rb | Ruby | apache-2.0 | 203 | main | 3,544 | require 'uaa'
module VCAP::Services::SSO::UAA
class UaaClientManager
ROUTER_404_KEY = 'X-Cf-Routererror'.freeze
ROUTER_404_VALUE = 'unknown_route'.freeze
def initialize(opts={})
@opts = opts
@uaa_client = create_uaa_client
end
delegate :get_clients, to: :@uaa_client
def... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/service_brokers/service_broker_remover.rb | Ruby | apache-2.0 | 203 | main | 1,739 | module VCAP::Services::ServiceBrokers
class ServiceBrokerRemover
def initialize(services_event_repository)
@services_event_repository = services_event_repository
end
# Necessary for async deletion. See DeleteActionJob
def delete(brokers)
remove(brokers.first)
VCAP::CloudController::... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/service_brokers/validation_errors_formatter.rb | Ruby | apache-2.0 | 203 | main | 1,346 | module VCAP::Services::ServiceBrokers
class ValidationErrorsFormatter
INDENT = ' '.freeze
def format(validation_errors)
message = "\n"
validation_errors.messages.each { |e| message += "#{e}\n" }
validation_errors.nested_errors.each do |service, service_errors|
next if service_error... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/service_brokers/service_broker_registration.rb | Ruby | apache-2.0 | 203 | main | 4,081 | module VCAP::Services::ServiceBrokers
class ServiceBrokerRegistration
attr_reader :broker, :warnings
def initialize(broker, service_manager, services_event_repository, route_services_enabled, volume_services_enabled)
@broker = broker
@service_manager = service_manager
@warnings = []
@... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/service_brokers/service_manager.rb | Ruby | apache-2.0 | 203 | main | 8,282 | module VCAP::Services::ServiceBrokers
class ServiceManager
class ServiceBrokerSyncError < StandardError
end
attr_reader :warnings
def initialize(service_event_repository)
@services_event_repository = service_event_repository
@warnings = []
@logger = Steno.logger('cc.service_broker.s... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/service_brokers/service_client_provider.rb | Ruby | apache-2.0 | 203 | main | 1,016 | require 'services/service_brokers/user_provided/client'
require 'services/service_brokers/v2/client'
module VCAP::Services
class ServiceClientProvider
def self.provide(opts={})
return provide_client_for_broker(opts[:broker]) if opts[:broker]
provide_client_for_instance(opts[:instance]) if opts[:inst... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/service_brokers/v2.rb | Ruby | apache-2.0 | 203 | main | 841 | module VCAP::Services::ServiceBrokers::V2 end
require 'services/service_brokers/v2/catalog_validation_helper'
require 'services/service_brokers/v2/catalog'
require 'services/service_brokers/v2/catalog_service'
require 'services/service_brokers/v2/catalog_plan'
require 'services/service_brokers/v2/catalog_schemas'
requ... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/service_brokers/null_client.rb | Ruby | apache-2.0 | 203 | main | 242 | module VCAP::Services::ServiceBrokers
class NullClient
def unbind(_)
{}
end
def deprovision(_, accepts_incomplete: false)
{
last_operation: {
state: 'succeeded'
}
}
end
end
end |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/service_brokers/v2/service_binding_schema.rb | Ruby | apache-2.0 | 203 | main | 943 | module VCAP::Services::ServiceBrokers::V2
class ServiceBindingSchema
include CatalogValidationHelper
attr_reader :errors, :create
def initialize(instance)
@errors = VCAP::Services::ValidationErrors.new
@instance = instance
@create_data = instance['create']
@path = ['service_bind... |
github | cloudfoundry/cloud_controller_ng | https://github.com/cloudfoundry/cloud_controller_ng | lib/services/service_brokers/v2/orphan_mitigator.rb | Ruby | apache-2.0 | 203 | main | 1,541 | require 'jobs/v2/services/delete_orphaned_binding'
require 'jobs/v2/services/delete_orphaned_instance'
require 'jobs/v2/services/delete_orphaned_key'
module VCAP::Services
module ServiceBrokers
module V2
class OrphanMitigator
def cleanup_failed_provision(service_instance)
orphan_deprovisi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.