github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/identity/v3/credentials/urls.go (about)

     1  package credentials
     2  
     3  import (
     4  	"strings"
     5  
     6  	"github.com/opentelekomcloud/gophertelekomcloud"
     7  )
     8  
     9  const (
    10  	rootPath           = "OS-CREDENTIAL"
    11  	credentialsPath    = "credentials"
    12  	tmpCredentialsPath = "securitytokens"
    13  )
    14  
    15  func broken30Url(serviceUrl string) string {
    16  	return strings.Replace(serviceUrl, "v3/", "v3.0/", 1)
    17  }
    18  
    19  func listURL(client *golangsdk.ServiceClient) string {
    20  	return broken30Url(client.ServiceURL(rootPath, credentialsPath))
    21  }
    22  
    23  func getURL(client *golangsdk.ServiceClient, credID string) string {
    24  	return broken30Url(client.ServiceURL(rootPath, credentialsPath, credID))
    25  }
    26  
    27  func createURL(client *golangsdk.ServiceClient) string {
    28  	return broken30Url(client.ServiceURL(rootPath, credentialsPath))
    29  }
    30  
    31  func updateURL(client *golangsdk.ServiceClient, credID string) string {
    32  	return broken30Url(client.ServiceURL(rootPath, credentialsPath, credID))
    33  }
    34  
    35  func deleteURL(client *golangsdk.ServiceClient, credID string) string {
    36  	return broken30Url(client.ServiceURL(rootPath, credentialsPath, credID))
    37  }
    38  
    39  func createTempURL(client *golangsdk.ServiceClient) string {
    40  	return broken30Url(client.ServiceURL(rootPath, tmpCredentialsPath))
    41  }