~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/environs/interface.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
package environs
5
5
 
6
6
import (
 
7
        "io"
 
8
 
7
9
        "gopkg.in/juju/environschema.v1"
8
10
 
9
11
        "github.com/juju/juju/cloud"
88
90
        // If no credentials can be detected, DetectCredentials should
89
91
        // return an error satisfying errors.IsNotFound.
90
92
        DetectCredentials() (*cloud.CloudCredential, error)
 
93
 
 
94
        // FinalizeCredential finalizes a credential, updating any attributes
 
95
        // as necessary. This is always done client-side, when adding the
 
96
        // credential to credentials.yaml and before uploading credentials to
 
97
        // the controller. The provider may completely alter a credential, even
 
98
        // going as far as changing the auth-type, but the output must be a
 
99
        // fully formed credential.
 
100
        FinalizeCredential(
 
101
                FinalizeCredentialContext,
 
102
                FinalizeCredentialParams,
 
103
        ) (*cloud.Credential, error)
 
104
}
 
105
 
 
106
// FinalizeCredentialContext is an interface passed into FinalizeCredential
 
107
// to provide a means of interacting with the user when finalizing credentials.
 
108
type FinalizeCredentialContext interface {
 
109
        GetStderr() io.Writer
 
110
}
 
111
 
 
112
// FinalizeCredentialParams contains the parameters for
 
113
// ProviderCredentials.FinalizeCredential.
 
114
type FinalizeCredentialParams struct {
 
115
        // Credential is the credential that the provider should finalize.`
 
116
        Credential cloud.Credential
 
117
 
 
118
        // CloudEndpoint is the endpoint for the cloud that the credentials are
 
119
        // for. This may be used by the provider to communicate with the cloud
 
120
        // to finalize the credentials.
 
121
        CloudEndpoint string
 
122
 
 
123
        // CloudIdentityEndpoint is the identity endpoint for the cloud that the
 
124
        // credentials are for. This may be used by the provider to communicate
 
125
        // with the cloud to finalize the credentials.
 
126
        CloudIdentityEndpoint string
91
127
}
92
128
 
93
129
// CloudRegionDetector is an interface that an EnvironProvider implements