github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/compute/v2/extensions/secgroups/urls.go (about)

     1  package secgroups
     2  
     3  import "github.com/huaweicloud/golangsdk"
     4  
     5  const (
     6  	secgrouppath = "os-security-groups"
     7  	rulepath     = "os-security-group-rules"
     8  )
     9  
    10  func resourceURL(c *golangsdk.ServiceClient, id string) string {
    11  	return c.ServiceURL(secgrouppath, id)
    12  }
    13  
    14  func rootURL(c *golangsdk.ServiceClient) string {
    15  	return c.ServiceURL(secgrouppath)
    16  }
    17  
    18  func listByServerURL(c *golangsdk.ServiceClient, serverID string) string {
    19  	return c.ServiceURL("servers", serverID, secgrouppath)
    20  }
    21  
    22  func rootRuleURL(c *golangsdk.ServiceClient) string {
    23  	return c.ServiceURL(rulepath)
    24  }
    25  
    26  func resourceRuleURL(c *golangsdk.ServiceClient, id string) string {
    27  	return c.ServiceURL(rulepath, id)
    28  }
    29  
    30  func serverActionURL(c *golangsdk.ServiceClient, id string) string {
    31  	return c.ServiceURL("servers", id, "action")
    32  }