-
Notifications
You must be signed in to change notification settings - Fork 927
/
environment.go
39 lines (34 loc) · 1.45 KB
/
environment.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package ccv3
import (
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/internal"
)
// Environment variables that will be provided to an app at runtime. It will
// include environment variables for Environment Variable Groups and Service
// Bindings.
type Environment struct {
// Application contains basic application settings set by the user and CF
// instance.
Application map[string]interface{} `json:"application_env_json"`
// EnvironmentVariables are user provided environment variables.
EnvironmentVariables map[string]interface{} `json:"environment_variables"`
//Running is the set of default environment variables available to running
//apps.
Running map[string]interface{} `json:"running_env_json"`
//Staging is the set of default environment variables available during
//staging.
Staging map[string]interface{} `json:"staging_env_json"`
// System contains information about bound services for the application. AKA
// VCAP_SERVICES.
System map[string]interface{} `json:"system_env_json"`
}
// GetApplicationEnvironment fetches all the environment variables on
// an application by groups.
func (client *Client) GetApplicationEnvironment(appGUID string) (Environment, Warnings, error) {
var responseBody Environment
_, warnings, err := client.MakeRequest(RequestParams{
RequestName: internal.GetApplicationEnvRequest,
URIParams: internal.Params{"app_guid": appGUID},
ResponseBody: &responseBody,
})
return responseBody, warnings, err
}