For director version <= 265.x
sudo su
/var/vcap/jobs/director/bin/director_ctl console
For director version >= 266.x
sudo su
/var/vcap/jobs/director/bin/console
Bosh::Director::Config.db.foreign_key_list(:instances)
Bosh::Director::Config.db[:instances].where(variable_set_id: nil).first
Bosh::Director::Config.db[:schema_migrations].where(filename: "xxx").first
Bosh::Director::Config.db[:schema_migrations].order(:filename).last
Bosh::Director::Config.db[:schema_migrations] << {filename: "xxx"}
Bosh::Director::Models::Instance.first.update(boostrap: false)
Bosh::Director::Models::PersistentDisk.where(disk_cid: "...").all
Bosh::Director::Models::PersistentDisk.where(disk_cid: "...").delete
File.open("/tmp/my-temp-blob-file", 'wb') { |file| Bosh::Director::App.instance.blobstores.blobstore.get("some-blobstore-id", file) }