Class: Bosh::Director::Api::Controllers::BaseController
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Bosh::Director::Api::Controllers::BaseController
- Defined in:
- lib/bosh/director/api/controllers/base_controller.rb
Direct Known Subclasses
BackupsController, CleanupController, CloudConfigsController, DeploymentsController, DisksController, EventsController, InfoController, LocksController, PackagesController, ReleasesController, ResourcesController, RestoreController, ResurrectionController, RuntimeConfigsController, StemcellsController, TaskController, TasksController, UsersController, VmsController
Constant Summary collapse
- ROUTES_WITH_EXTENDED_TIMEOUT =
['/stemcells', '/releases', '/restore']
Constants included from Http
Http::BAD_REQUEST, Http::CREATED, Http::FORBIDDEN, Http::INTERNAL_SERVER_ERROR, Http::NOT_FOUND, Http::NO_CONTENT, Http::OK, Http::UNAUTHORIZED
Constants included from ApiHelper
Instance Attribute Summary collapse
-
#identity_provider ⇒ Object
readonly
Returns the value of attribute identity_provider.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config) ⇒ BaseController
constructor
A new instance of BaseController.
- #requires_authentication? ⇒ Boolean
Methods included from ApiHelper
#check_available_disk_space, #json_decode, #json_encode, #prepare_yml_file, #send_disposable_file, #start_task, #validate_manifest_yml, #write_file
Constructor Details
#initialize(config) ⇒ BaseController
Returns a new instance of BaseController.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bosh/director/api/controllers/base_controller.rb', line 8 def initialize(config) super() @config = config @logger = Config.logger @identity_provider = config.identity_provider @permission_authorizer = PermissionAuthorizer.new(config.get_uuid_provider) @backup_manager = BackupManager.new @restore_manager = RestoreManager.new @resurrector_manager = ResurrectorManager.new @release_manager = ReleaseManager.new @snapshot_manager = SnapshotManager.new @stemcell_manager = StemcellManager.new @task_manager = TaskManager.new @dns_manager = DnsManagerProvider.create @disk_manager = DiskManager.new(nil, @logger) @event_manager = EventManager.new(config.record_events) end |
Instance Attribute Details
#identity_provider ⇒ Object (readonly)
Returns the value of attribute identity_provider.
36 37 38 |
# File 'lib/bosh/director/api/controllers/base_controller.rb', line 36 def identity_provider @identity_provider end |
Class Method Details
.consumes(*types) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/bosh/director/api/controllers/base_controller.rb', line 38 def self.consumes(*types) types = Set.new(types) types.map! { |t| mime_type(t) } condition do # Content-Type header may include charset or boundry info content_type = request.content_type || '' mime_type = content_type.split(';')[0] types.include?(mime_type) end end |
Instance Method Details
#requires_authentication? ⇒ Boolean
75 76 77 |
# File 'lib/bosh/director/api/controllers/base_controller.rb', line 75 def requires_authentication? true end |