github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/imageservice/v2/imagedata/urls.go (about)

     1  package imagedata
     2  
     3  import "github.com/huaweicloud/golangsdk"
     4  
     5  const (
     6  	rootPath   = "images"
     7  	uploadPath = "file"
     8  	stagePath  = "stage"
     9  )
    10  
    11  // `imageDataURL(c,i)` is the URL for the binary image data for the
    12  // image identified by ID `i` in the service `c`.
    13  func uploadURL(c *golangsdk.ServiceClient, imageID string) string {
    14  	return c.ServiceURL(rootPath, imageID, uploadPath)
    15  }
    16  
    17  func stageURL(c *golangsdk.ServiceClient, imageID string) string {
    18  	return c.ServiceURL(rootPath, imageID, stagePath)
    19  }
    20  
    21  func downloadURL(c *golangsdk.ServiceClient, imageID string) string {
    22  	return uploadURL(c, imageID)
    23  }