whitelist

package
v1.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ROOTPATH     = "lbaas"
	RESOURCEPATH = "whitelists"
)

Variables

This section is empty.

Functions

func List

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

type CreateOptsBuilder interface {
	ToWhiteListCreateMap() (map[string]interface{}, error)
}

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

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.

func (CreateResult) Extract

func (r CreateResult) Extract() (WhiteList, error)

Extract is a function that accepts a result and extracts a whitelist.

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.

func (GetResult) Extract

func (r GetResult) Extract() (WhiteList, error)

Extract is a function that accepts a result and extracts a whitelist.

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

func (opts ListOpts) ToWhihieListsListMap() (string, error)

ToWhihieListsListMap formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToWhihieListsListMap() (string, error)
}

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

type UpdateOptsBuilder interface {
	ToWhiteListUpdateMap() (map[string]interface{}, error)
}

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.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (WhiteList, error)

Extract is a function that accepts a result and extracts a whitelist.

type WhiteList

type WhiteList struct {
	WhiteList Whitelist `json:"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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL