Add package_state to App api.

'package_state' will be returned by the API amongst the rest of the App details.
The package_state is read-only, as indicated in the App api spec.
Catch instances less than zero error

This change prevents the number of App instances being set to a negative
number
Allow apps to be scaled down or stopped when the quota is lowered.

Finishes: #52843321. User should be able to stop or scale down an app after quota is lowered.
Before the fix, when quota is lowered, memory requested always returned 0 or more, even when the requested change represented lowering of the requested memory below the memory remaining in the organization.
The above behavior caused failures when bringing the app within quota limits. The running apps could not be stopped if they were running above quota levels.
Making the condition more readable based on comments from Tim Labeeuw
Merge branch 'package_state' of https://github.com/bravera/cloud_controller_ng into bravera-package_state
Print #inspect of response body instead of #to_s

This will make it clearer when the response is nil
[#57777458]

Signed-off-by: Matt Royal <mroyal@pivotallabs.com>
Check service is bindable before create binding.

[finishes #60015472]

Signed-off-by: Zach Robinson <zrobinson@pivotallabs.com>
(migration) fix events table timestamps, +truncate

[finishes #57955268]

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
Fix failing cc test

Binding a new service was unstaging an app; just needed to reload to
make in-memory data matched crud data.
Merge branch 'quota_scale_down' of https://github.com/brahmaroutu/cloud_controller_ng into scale_down
Allow unauthenticated access to jobs controller. Added a api test for jobs.

[fnished #59799604]
Switch to v2 of the loggregator gem, also add shared_secret to emitter config
Don't use rspec doc api params

Setting parameters and reading later from them causes failures when
there is an rspec example method with the name same as the api field.
Instead we build request explicitly in each test.

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Cause exception to be thrown properly if any service has no plans.

[Finishes #60198676]

Signed-off-by: Jimmy Da <jda@pivotallabs.com>
Added event types doc tests, removed some magic

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Mark events endpoint as experimental

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Allow empty string to reset start command

[closes #56378166]
Clarify tests about scaling from above quota to below quota

[Closes #52843321]

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
Add missing config flapping_crash_count_threshold

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Add HEADER_BROKER_API_VERSION to broker request headers.

[finishes #60302194]