Documentation ¶
Index ¶
- Constants
- func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
- type WhiteList
- type WhiteListPage
- type WhiteLists
- type Whitelist
Constants ¶
const ( ROOTPATH = "lbaas" RESOURCEPATH = "whitelists" )
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 whitelists. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
Default policy settings return only those whitelists that are owned by the tenant who submits the request, unless an admin user submits the request.
Types ¶
type CreateOpts ¶
type CreateOpts struct { //Specifies the tenant ID. TenantId string `json:"tenant_id,omitempty"` //Specifies the listener ID. ListenerId string `json:"listener_id" required:"true"` //Specifies whether to enable the access control. EnableWhitelist *bool `json:"enable_whitelist,omitempty"` //Lists the IP addresses in the whitelist. Whitelist string `json:"whitelist,omitempty"` }
CreateOpts represents options for creating a whitelist.
func (CreateOpts) ToWhiteListCreateMap ¶
func (opts CreateOpts) ToWhiteListCreateMap() (map[string]interface{}, error)
ToWhiteListCreateMap builds a request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult represents the result of a create operation. Call its Extract method to interpret it as a WhiteList.
func Create ¶
func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create is an operation which provisions a new Whitelist based on the configuration defined in the CreateOpts struct. Once the request is validated and progress has started on the provisioning process, a CreateResult will be returned.
Users with an admin role can create Whitelist on behalf of other tenants by specifying a TenantID attribute different than their own.
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.
func Delete ¶
func Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult)
Delete will permanently delete a particular whitelist based on its unique ID.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a WhiteList.
func Get ¶
func Get(c *gophercloud.ServiceClient, id string) (r GetResult)
Get retrieves a particular whitelist based on its whitelist ID.
type ListOpts ¶
type ListOpts struct { // Specifies the ID of the last whitelist on the previous page. Marker string `q:"marker"` // Specifies the number of records on each page. Limit int `q:"limit"` // Specifies the pagination direction. PageReverse bool `q:"page_reverse"` // Specifies the whitelist ID. ID string `q:"id"` // Specifies the project ID. TenantId string `q:"tenant_id"` //Specifies the listener ID. ListenerId string `q:"listener_id"` // Specifies whether to enable access control. EnableWhitelist *bool `q:"enable_whitelist"` // Lists the IP addresses in the whitelist. Whitelist string `q:"whitelist"` }
ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map the floating whitelist attributes you want to see returned. Marker and Limit are used for pagination.
func (ListOpts) ToWhihieListsListMap ¶
ToWhihieListsListMap formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
type UpdateOpts ¶
type UpdateOpts struct { // Specifies whether to enable access control. EnableWhitelist *bool `json:"enable_whitelist,omitempty"` // Lists the IP addresses in the whitelist. Whitelist *string `json:"whitelist,omitempty"` }
UpdateOpts represents options for updating a WhiteList.
func (UpdateOpts) ToWhiteListUpdateMap ¶
func (opts UpdateOpts) ToWhiteListUpdateMap() (map[string]interface{}, error)
ToWhiteListUpdateMap builds a request body from UpdateOpts.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a WhiteList.
func Update ¶
func Update(c *gophercloud.ServiceClient, id string, opts UpdateOpts) (r UpdateResult)
Update is an operation which modifies the attributes of the specified whitelist.
type WhiteListPage ¶
type WhiteListPage struct {
pagination.LinkedPageBase
}
WhiteListPage is the page returned by a pager when traversing over a collection of whitelist.
func (WhiteListPage) IsEmpty ¶
func (r WhiteListPage) IsEmpty() (bool, error)
IsEmpty checks whether a WhiteListPage struct is empty.
func (WhiteListPage) NextPageURL ¶
func (page WhiteListPage) NextPageURL() (string, error)
NextPageURL will retrieve the next page URL.
type WhiteLists ¶
type WhiteLists struct {
Whitelists []Whitelist `json:"whitelists"`
}
func ExtractWhiteLists ¶
func ExtractWhiteLists(r pagination.Page) (WhiteLists, error)
ExtractWhiteLists accepts a Page struct, specifically a WhiteListPage struct, and extracts the elements into a slice of whitelist structs. In other words, a generic collection is mapped into a relevant slice.
type Whitelist ¶
type Whitelist struct { //Specifies the whitelist ID. ID string `json:"id"` //Specifies the tenant ID. TenantId string `json:"tenant_id"` //Specifies the listener ID. ListenerId string `json:"listener_id"` //Specifies whether to enable the access control. EnableWhitelist bool `json:"enable_whitelist"` //Lists the IP addresses in the whitelist. Whitelist string `json:"whitelist"` }