blob: 95728d18558cd92e3acf1308a00cc48c9e30bd9f [file] [log] [blame]
Jon Perritt95c67522014-11-04 10:37:21 -06001package ports
2
3import (
4 "github.com/rackspace/gophercloud"
5 os "github.com/rackspace/gophercloud/openstack/networking/v2/ports"
6 "github.com/rackspace/gophercloud/pagination"
7)
8
9// List returns a Pager which allows you to iterate over a collection of
10// ports. It accepts a ListOpts struct, which allows you to filter and sort
11// the returned collection for greater efficiency.
12//
13// Default policy settings return only those ports that are owned by the tenant
14// who submits the request, unless the request is submitted by a user with
15// administrative rights.
16func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager {
17 return os.List(c, opts)
18}
19
20// Get retrieves a specific port based on its unique ID.
21func Get(c *gophercloud.ServiceClient, networkID string) os.GetResult {
22 return os.Get(c, networkID)
23}
24
25// Create accepts a CreateOpts struct and creates a new network using the values
26// provided. You must remember to provide a NetworkID value.
Jon Perrittdb9a9b32015-03-09 12:08:50 -060027//
28// NOTE: Currently the SecurityGroup option is not implemented to work with
29// Rackspace.
Jon Perritt95c67522014-11-04 10:37:21 -060030func Create(c *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult {
31 return os.Create(c, opts)
32}
33
34// Update accepts a UpdateOpts struct and updates an existing port using the
35// values provided.
36func Update(c *gophercloud.ServiceClient, networkID string, opts os.UpdateOptsBuilder) os.UpdateResult {
37 return os.Update(c, networkID, opts)
38}
39
40// Delete accepts a unique ID and deletes the port associated with it.
41func Delete(c *gophercloud.ServiceClient, networkID string) os.DeleteResult {
42 return os.Delete(c, networkID)
43}