github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/compute/v2/servers/urls.go (about)

     1  package servers
     2  
     3  import "github.com/opentelekomcloud/gophertelekomcloud"
     4  
     5  const (
     6  	rootPath     = "servers"
     7  	nicPath      = "os-interface"
     8  	detailPath   = "detail"
     9  	actionPath   = "action"
    10  	metadataPath = "metadata"
    11  	ipsPath      = "ips"
    12  	passwordPath = "os-server-password"
    13  )
    14  
    15  func createURL(client *golangsdk.ServiceClient) string {
    16  	return client.ServiceURL(rootPath)
    17  }
    18  
    19  func listURL(client *golangsdk.ServiceClient) string {
    20  	return createURL(client)
    21  }
    22  
    23  func listDetailURL(client *golangsdk.ServiceClient) string {
    24  	return client.ServiceURL(rootPath, detailPath)
    25  }
    26  
    27  func deleteURL(client *golangsdk.ServiceClient, id string) string {
    28  	return client.ServiceURL(rootPath, id)
    29  }
    30  
    31  func getURL(client *golangsdk.ServiceClient, id string) string {
    32  	return deleteURL(client, id)
    33  }
    34  
    35  func updateURL(client *golangsdk.ServiceClient, id string) string {
    36  	return deleteURL(client, id)
    37  }
    38  
    39  func actionURL(client *golangsdk.ServiceClient, id string) string {
    40  	return client.ServiceURL(rootPath, id, actionPath)
    41  }
    42  
    43  func metadatumURL(client *golangsdk.ServiceClient, id, key string) string {
    44  	return client.ServiceURL(rootPath, id, metadataPath, key)
    45  }
    46  
    47  func metadataURL(client *golangsdk.ServiceClient, id string) string {
    48  	return client.ServiceURL(rootPath, id, metadataPath)
    49  }
    50  
    51  func listAddressesURL(client *golangsdk.ServiceClient, id string) string {
    52  	return client.ServiceURL(rootPath, id, ipsPath)
    53  }
    54  
    55  func listAddressesByNetworkURL(client *golangsdk.ServiceClient, id, network string) string {
    56  	return client.ServiceURL(rootPath, id, ipsPath, network)
    57  }
    58  
    59  func passwordURL(client *golangsdk.ServiceClient, id string) string {
    60  	return client.ServiceURL(rootPath, id, passwordPath)
    61  }
    62  
    63  func getNICManagementURL(client *golangsdk.ServiceClient, id string) string {
    64  	return client.ServiceURL(rootPath, id, nicPath)
    65  }