github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/api/controller/identity_url.go (about) 1 // Copyright 2012-2019 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package controller 5 6 import ( 7 "github.com/juju/errors" 8 "github.com/juju/juju/apiserver/params" 9 ) 10 11 // IdentityProviderURL returns the URL of the configured external identity 12 // provider for this controller or an empty string if no external identity 13 // provider has been configured when the controller was bootstrapped. 14 func (c *Client) IdentityProviderURL() (string, error) { 15 if c.BestAPIVersion() < 7 { 16 return "", errors.NotSupportedf("IdentityProviderURL not supported by this version of Juju") 17 } 18 var result params.StringResult 19 err := c.facade.FacadeCall("IdentityProviderURL", nil, &result) 20 if err != nil { 21 return "", errors.Trace(err) 22 } 23 if result.Error != nil { 24 return "", result.Error 25 } 26 return result.Result, nil 27 }