github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/modelarts/v1/notebook/urls.go (about)

     1  package notebook
     2  
     3  import "github.com/chnsz/golangsdk"
     4  
     5  const (
     6  	notebookPath = "notebooks"
     7  	tablePath    = "tables"
     8  )
     9  
    10  // POST /v1/{project_id}/notebooks
    11  func createURL(c *golangsdk.ServiceClient) string {
    12  	return c.ServiceURL(notebookPath)
    13  }
    14  
    15  // GET /v1/{project_id}/notebooks
    16  func listURL(c *golangsdk.ServiceClient) string {
    17  	return c.ServiceURL(notebookPath)
    18  }
    19  
    20  // DELETE /v1/{project_id}/notebooks/{id}
    21  func deleteURL(c *golangsdk.ServiceClient, id string) string {
    22  	return c.ServiceURL(notebookPath, id)
    23  }
    24  
    25  // GET /v1/{project_id}/notebooks/{id}
    26  func getURL(c *golangsdk.ServiceClient, id string) string {
    27  	return c.ServiceURL(notebookPath, id)
    28  }
    29  
    30  // PUT /v1/{project_id}/notebooks/{id}
    31  func updateURL(c *golangsdk.ServiceClient, id string) string {
    32  	return c.ServiceURL(notebookPath, id)
    33  }
    34  
    35  // PATCH /v1/{project_id}/notebooks/{id}/lease
    36  func updateLeaseURL(c *golangsdk.ServiceClient, id string) string {
    37  	return c.ServiceURL(notebookPath, id, "lease")
    38  }
    39  
    40  // POST /v1/{project_id}/notebooks/{id}/start
    41  func startURL(c *golangsdk.ServiceClient, id string) string {
    42  	return c.ServiceURL(notebookPath, id, "start")
    43  }
    44  
    45  // POST /v1/{project_id}/notebooks/{id}/stop
    46  func stopURL(c *golangsdk.ServiceClient, id string) string {
    47  	return c.ServiceURL(notebookPath, id, "stop")
    48  }
    49  
    50  // GET /v1/{project_id}/images
    51  func imagesURL(c *golangsdk.ServiceClient) string {
    52  	return c.ServiceURL("images")
    53  }
    54  
    55  // GET /v1/{project_id}/notebooks/{id}/flavors
    56  func switchableFlavorsURL(c *golangsdk.ServiceClient, id string) string {
    57  	return c.ServiceURL(notebookPath, id, "flavors")
    58  }
    59  
    60  // POST /v1/{project_id}/notebooks/{instance_id}/storage
    61  // GET /v1/{project_id}/notebooks/{instance_id}/storage
    62  func mountURL(c *golangsdk.ServiceClient, id string) string {
    63  	return c.ServiceURL(notebookPath, id, "storage")
    64  }
    65  
    66  // GET /v1/{project_id}/notebooks/{instance_id}/storage/{storage_id}
    67  // DELETE /v1/{project_id}/notebooks/{instance_id}/storage/{storage_id}
    68  func mountDetailURL(c *golangsdk.ServiceClient, id string, storageId string) string {
    69  	return c.ServiceURL(notebookPath, id, "storage", storageId)
    70  }