コード例 #1
0
func NewCloudControllerClient(config commands.Config) (*ccv2.CloudControllerClient, error) {
	if config.Target() == "" {
		return nil, NoAPISetError{
			BinaryName: config.BinaryName(),
		}
	}

	client := ccv2.NewCloudControllerClient()
	_, err := client.TargetCF(config.Target(), config.SkipSSLValidation())
	if err != nil {
		return nil, err
	}

	uaaClient := uaa.NewClient(client.TokenEndpoint(), config)
	client.WrapConnection(wrapper.NewUAAAuthentication(uaaClient))
	//Retry Wrapper
	return client, err
}
コード例 #2
0
func NewCloudControllerClient(config commands.Config) (*cloudcontrollerv2.CloudControllerClient, error) {
	client := cloudcontrollerv2.NewCloudControllerClient()
	_, err := client.TargetCF(config.Target(), config.SkipSSLValidation())
	return client, err
}