Documentation ¶
Index ¶
- func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type AttachOpts
- type AttachOptsBuilder
- type AttachResult
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type DetachResult
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type Subnet
- type SubnetDetail
- type SubnetPage
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List returns a Pager which allows you to iterate over a collection of subnets. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
Default policy settings return only those subnets that are owned by the tenant who submits the request, unless the request is submitted by a user with administrative rights.
Types ¶
type AttachOpts ¶
type AttachOpts struct {
RoutingtableID string `json:"routingtable_id" required:"true"`
}
func (AttachOpts) ToSubnetAttachMap ¶
func (opts AttachOpts) ToSubnetAttachMap() (map[string]interface{}, error)
type AttachOptsBuilder ¶
type AttachResult ¶
type AttachResult struct {
gophercloud.ErrResult
}
func Attach ¶
func Attach(c *gophercloud.ServiceClient, id string, opts AttachOptsBuilder) (r AttachResult)
type CreateOpts ¶
type CreateOpts struct { // VPC ID to which subnet is assigned VpcId string `json:"vpc_id" required:"true"` // CIDR of subnet CIDR string `json:"cidr" required:"true"` // Subnet name Name string `json:"name, required:"true""` // Tenant ID to which subnet is assigned TenantID string `json:"tenant_id,omitempty"` }
func (CreateOpts) ToSubnetCreateMap ¶
func (opts CreateOpts) ToSubnetCreateMap() (map[string]interface{}, error)
type CreateOptsBuilder ¶
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
func Create ¶
func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*SubnetDetail, error)
@tc-iaas-compute/1452 LIST is only pre-flight, as we can take the result in more detail from GET
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
func Delete ¶
func Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult)
type DetachResult ¶
type DetachResult struct {
gophercloud.ErrResult
}
func Detach ¶
func Detach(c *gophercloud.ServiceClient, id string) (r DetachResult)
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
func Get ¶
func Get(c *gophercloud.ServiceClient, id string) (r GetResult)
func (GetResult) Extract ¶
func (r GetResult) Extract() (*SubnetDetail, error)
@tc-iaas-compute/1452 LIST is only pre-flight, as we can take the result in more detail from GET
type ListOpts ¶
type ListOpts struct { TenantID string `q:"tenant_id"` ID string `q:"id"` Name string `q:"name"` Limit int `q:"limit"` Marker string `q:"marker"` SortKey string `q:"sort_key"` SortDir string `q:"sort_dir"` }
ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the subnet attributes you want to see returned. SortKey allows you to sort by a particular subnet attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.
func (ListOpts) ToSubnetListQuery ¶
type ListOptsBuilder ¶
type Subnet ¶
type Subnet struct { // Subnet name Name string `json:"name"` // Tenant ID that subnet belongs to TenantID string `json:"tenant_id"` // Subnet ID ID string `json:"id"` // Subnet status State string `json:"state"` // Created time for subnet CreateTime string `json:"create_time"` // ID of VPC that subnet belongs to VpcId string `json:"vpc_id"` Shared bool `json:"shared"` // CIDR of subnet CIDR string `json:"cidr"` // Gateway IP of subnet Gateway string `json:"gateway:` }
func ExtractSubnets ¶
func ExtractSubnets(r pagination.Page) ([]Subnet, error)
ExtractSubnets accepts a Page struct, specifically a SubnetPage struct, and extracts the elements into a slice of Subnet structs. In other words, a generic collection is mapped into a relevant slice.
type SubnetDetail ¶
type SubnetDetail struct { External bool `json:"router:external,omitempty"` Name string `json:"name,omitempty"` TenantID string `json:"tenant_id,omitempty"` State string `json:"state,omitempty"` ID string `json:"id,omitempty"` Routingtable struct { GatewayID string `json:"gateway_id,omitempty"` DefaultTable bool `json:"default_table,omitempty"` Explicit bool `json:"explicit,omitempty"` ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` } `json:"routingtable,omitempty"` CreateTime string `json:"create_time,omitempty"` AvailableIPCount int `json:"available_ip_count,omitempty"` VPC struct { Shared bool `json:"shared,omitempty"` State string `json:"state,omitempty"` ID string `json:"id,omitempty"` Cidrv4 string `json:"cidrv4,omitempty"` Name string `json:"name,omitempty"` } `json:"vpc,omitempty"` VpcId string `json:"vpc_id,omitempty"` Routes []struct { SubnetID string `json:"subnet_id,omitempty"` TenantID string `json:"tenant_id,omitempty"` Mask int `json:"mask,omitempty"` Gateway string `json:"gateway,omitempty"` CIDR string `json:"cidr,omitempty"` ID string `json:"id,omitempty"` } `json:"routes,omitempty"` CIDR string `json:"cidr,omitempty"` Gateway string `json:"gateway,omitempty"` }
type SubnetPage ¶
type SubnetPage struct {
pagination.LinkedPageBase
}
func (SubnetPage) IsEmpty ¶
func (r SubnetPage) IsEmpty() (bool, error)
IsEmpty checks whether a SubnetPage struct is empty.
func (SubnetPage) NextPageURL ¶
func (r SubnetPage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of subnets has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type UpdateOpts ¶
type UpdateOpts struct { Name *string `json:"name" required:"true"` // RevisionNumber implements extension:standard-attr-revisions. If != "" it // will set revision_number=%s. If the revision number does not match, the // update will fail. RevisionNumber *int `json:"-" h:"If-Match"` }
func (UpdateOpts) ToSubnetUpdateMap ¶
func (opts UpdateOpts) ToSubnetUpdateMap() (map[string]interface{}, error)
type UpdateOptsBuilder ¶
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
func Update ¶
func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*SubnetDetail, error)
@tc-iaas-compute/1452 LIST is only pre-flight, as we can take the result in more detail from GET