github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/api/cloudcontroller/ccv3/environment.go (about)

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