Corrected the v2_api? helper method

* Checks case sensitivity of '/v2'
* Checks that the '/v2' is in the start of the path
* Backfilled tests

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Remove hooks for model controller delete and add model deletion job

* refactored model controlled delete to add do_delete helper
* find_guid_and_validate_access now takes the model to find
* cleaned up service instances and app controller's overrides of delete

[#60026682]

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Model Controller #delete returns async job info

[#60026682]

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Normalize ruby declaration in .travis.yml
optimize seeding shared domains

With 67k organizations on a local postgres database, this used to take
509 seconds.

Now it takes 0.45 seconds.

[finishes #61496058]

Signed-off-by: Mark Rushakoff <mrushakoff@pivotallabs.com>
don't use EXCEPT as it doesn't work on mysql

Signed-off-by: Mark Rushakoff <mrushakoff@pivotallabs.com>
Normalize spacing
d -> domain

ran the tests this time

Signed-off-by: Mark Rushakoff <mrushakoff@pivotallabs.com>
Added tests for ModelController#find_guid_and_validate_access

* Also removed some inappropriate stubs on the subject

[#60026682]

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Regrouped controller route bindings.

* Modernized some hashes to 1.9 style.
* Other formatting changes.

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Concrete ModelControllers implement #delete explicitly.

* ModelController#delete implementation is removed.
* Currently the controllers magically add CRUD methods. We want to move
  away from this and have controllers specify each CRUD method, even if
  that method just calls another helper method.

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Added the aysnc command to the request params.

Currently not correct see: [#61517340].

[finishes #60026682]

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Removed rest_controller metaprogramming.

* Concrete controllers inherit directly from ModelController.
* #define_routes must be at the end of the controller class definition to
  avoid shadowing routes defined in the class (sinatra always reads
  routes top to bottom).

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Move the Snapshot Controller to Services

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Add 1.9.3 back, and allow failures in for p484 awaiting travis update.

Signed-off-by: Phan Le <ple@pivotallabs.com>
Swap ruby version so that 1.9.3 can hopefully be picked up first

Signed-off-by: Phan Le <ple@pivotallabs.com>
remove dead code

Signed-off-by: Mark Rushakoff <mrushakoff@pivotallabs.com>
Try allow_failures without ruby prefix

Signed-off-by: Phan Le <ple@pivotallabs.com>
Properly escape pagination URLs

This ensures Cloud Controller generates pagination URLs that it can
later consume. Addressable::URI handles proper escaping of query string
values, in particular the semicolons used to separate filter conditions.

This effectively restores #111, which was erroneously reverted by #112.
Refactor a AppStopper which can be used in background jobs.

Inline methods in DeaClient

[#60026682]

Signed-off-by: Phan Le <ple@pivotallabs.com>