Constructor
new CloudController(endPointopt, optionsopt)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
endPoint |
String |
<optional> |
Cloud Controller API endpoint URL | |
options |
Object |
<optional> |
{} | Options (same as CloudControllerBase) |
Methods
getAuthorizationEndpoint() → {Promise.<String>}
Get the UAA authorization endpoint URL from Cloud Controller info.
Works with both v2 and v3 — abstracts away the response shape difference.
Throws:
-
If authorization endpoint is not found in the info response
- Type
- Error
Returns:
Resolves with the authorization endpoint URL
- Type
- Promise.<String>
getFeaturedFlag(flag) → {Promise}
Get a specific feature flag
v2: http://apidocs.cloudfoundry.org/214/feature_flags/get_the_diego_docker_feature_flag.html
v3: https://v3-apidocs.cloudfoundry.org/#get-a-feature-flag
Parameters:
| Name | Type | Description |
|---|---|---|
flag |
String | Feature flag name |
Returns:
Resolves with JSON feature flag
- Type
- Promise
getFeaturedFlags() → {Promise}
Get all feature flags
v2: http://apidocs.cloudfoundry.org/214/feature_flags/get_all_feature_flags.html
v3: https://v3-apidocs.cloudfoundry.org/#list-feature-flags
Returns:
Resolves with JSON feature flags list
- Type
- Promise
getInfo() → {Promise}
Get information from Cloud Controller.
v2: http://apidocs.cloudfoundry.org/214/info/get_info.html
v3: Uses the root endpoint (/) — CF v3 has no /v3/info.
The response is **normalized** so that `authorization_endpoint`
and `token_endpoint` are always present at the top level,
keeping backward compatibility with existing consumer code.
Returns:
Resolves with JSON info (always contains
`authorization_endpoint` and `token_endpoint`)
- Type
- Promise
setFeaturedFlag(flag, flagOptionsopt) → {Promise}
Enable / set a feature flag
v2: http://apidocs.cloudfoundry.org/214/feature_flags/set_a_feature_flag.html
v3: https://v3-apidocs.cloudfoundry.org/#update-a-feature-flag
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
flag |
String | Feature flag name | |
flagOptions |
Object |
<optional> |
v3 body (e.g. { enabled: true }) |
Returns:
Resolves with JSON response
- Type
- Promise