addressgroups

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

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 address groups. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Types

type AddAddressesResult

type AddAddressesResult struct {
	// contains filtered or unexported fields
}

AddAddressesResult represents the result of an add addresses operation. Call its Extract method to interpret it as a AddressGroup.

func AddAddresses

func AddAddresses(ctx context.Context, c *gophercloud.ServiceClient, id string, opts UpdateAddressesBuilder) (r AddAddressesResult)

AddAddresses will add IP addresses to a particular address group.

func (AddAddressesResult) Extract

func (r AddAddressesResult) Extract() (*AddressGroup, error)

Extract is a function that accepts a result and extracts a address group.

type AddressGroup

type AddressGroup struct {
	// Unique identifier for the address_group object.
	ID string `json:"id"`

	// Human readable name for the address group (255 characters limit). Does not have to be unique.
	Name string `json:"name"`

	// Human readable description for the address group (255 characters limit).
	Description string `json:"description"`

	// ProjectID is the project owner of this address group.
	ProjectID string `json:"project_id"`

	// Array of address. It supports both CIDR and IP range objects.
	// An example of addresses: [“132.168.4.12/24”, “132.168.5.12-132.168.5.24”, “2001::db8::f00/64”]
	Addresses []string `json:"addresses"`
}

AddressGroup represents a container for address groups.

func ExtractGroups

func ExtractGroups(r pagination.Page) ([]AddressGroup, error)

ExtractGroups accepts a Page struct, specifically a AddressGroupPage struct, and extracts the elements into a slice of AddressGroup structs. In other words, a generic collection is mapped into a relevant slice.

type AddressGroupPage

type AddressGroupPage struct {
	pagination.LinkedPageBase
}

AddressGroupPage is the page returned by a pager when traversing over a collection of address group addresses.

func (AddressGroupPage) IsEmpty

func (r AddressGroupPage) IsEmpty() (bool, error)

IsEmpty checks whether a AddressGroupPage struct is empty.

func (AddressGroupPage) NextPageURL

func (r AddressGroupPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of address groups 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 CreateOpts

type CreateOpts struct {
	// The address group ID to associate with this address group.
	ID string `json:"id,omitempty"`

	// Human readable name for the address group (255 characters limit). Does not have to be unique.
	Name string `json:"name,omitempty"`

	// Human readable description for the address group (255 characters limit).
	Description string `json:"description,omitempty"`

	// Owner of the address group.
	// Only administrative users can specify a project UUID other than their own.
	ProjectID string `json:"project_id,omitempty"`

	// Array of address. It supports both CIDR and IP range objects.
	// An example of addresses: [“132.168.4.12/24”, “132.168.5.12-132.168.5.24”, “2001::db8::f00/64”]
	Addresses []string `json:"addresses" required:"true"`
}

CreateOpts contains all the values needed to create a new address group.

func (CreateOpts) ToAddressGroupCreateMap

func (opts CreateOpts) ToAddressGroupCreateMap() (map[string]any, error)

ToAddressGroupCreateMap builds a request body from CreateOpts.

func (CreateOpts) ToAddressesCreateMap

func (opts CreateOpts) ToAddressesCreateMap() (map[string]any, error)

ToAddressesCreateMap builds a request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToAddressGroupCreateMap() (map[string]any, 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 AddressGroup.

func Create

func Create(ctx context.Context, c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create is an operation which creates a new address group and associates it with an existing address group (whose ID is specified in CreateOpts).

func (CreateResult) Extract

func (r CreateResult) Extract() (*AddressGroup, error)

Extract is a function that accepts a result and extracts a address group.

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(ctx context.Context, c *gophercloud.ServiceClient, id string) (r DeleteResult)

Delete will permanently delete a particular address group 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 AddressGroup.

func Get

func Get(ctx context.Context, c *gophercloud.ServiceClient, id string) (r GetResult)

Get retrieves a particular address group based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*AddressGroup, error)

Extract is a function that accepts a result and extracts a address group.

type ListOpts

type ListOpts struct {
	ID          string   `q:"id"`
	Name        string   `q:"name"`
	Description string   `q:"description"`
	ProjectID   string   `q:"project_id"`
	Addresses   []string `q:"addresses"`
	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 address group attributes you want to see returned. SortKey allows you to sort by a particular network attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.

func (ListOpts) ToAddressGroupListQuery

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

ToAddressGroupListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request.

type RemoveAddressesResult

type RemoveAddressesResult struct {
	// contains filtered or unexported fields
}

RemoveAddressesResult represents the result of a remove addresses operation. Call its Extract method to interpret it as a AddressGroup.

func RemoveAddresses

func RemoveAddresses(ctx context.Context, c *gophercloud.ServiceClient, id string, opts UpdateAddressesBuilder) (r RemoveAddressesResult)

RemoveAddresses will remove particular IP addresses from a particular address group.

func (RemoveAddressesResult) Extract

func (r RemoveAddressesResult) Extract() (*AddressGroup, error)

Extract is a function that accepts a result and extracts a address group.

type UpdateAddressesBuilder

type UpdateAddressesBuilder interface {
	ToUpdateAddressesMap() (map[string]any, error)
}

AddressesBuilder allows extensions to add additional parameters to the AddAddresses or RemoveAddresses requests.

type UpdateAddressesOpts

type UpdateAddressesOpts struct {
	Addresses []string `json:"addresses" required:"true"`
}

UpdateAddressesOpts will add or remove a list of particular addresses from an address group. It is used by both AddAddresses and RemoveAddresses requests.

func (UpdateAddressesOpts) ToUpdateAddressesMap

func (opts UpdateAddressesOpts) ToUpdateAddressesMap() (map[string]any, error)

ToAddressesCreateMap builds a request body from CreateOpts.

type UpdateOpts

type UpdateOpts struct {
	// Human readable name for the address group (255 characters limit). Does not have to be unique.
	Name *string `json:"name,omitempty"`
	// Human readable description for the address group (255 characters limit).
	Description *string `json:"description,omitempty"`
}

UpdateOpts contains all the values needed to update an address group.

func (UpdateOpts) ToAddressGroupUpdateMap

func (opts UpdateOpts) ToAddressGroupUpdateMap() (map[string]any, error)

ToAddressGroupUpdateMap builds a request body from UpdateOpts.

type UpdateOptsBuilder

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

UpdateOptsBuilder allows extensions to add additional parameters to the Update requests.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult represents the result of an update address group operation. Call its Extract method to interpret it as a AddressGroup.

func Update

func Update(ctx context.Context, c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

Update will update a particular address group with a complete new set of data.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*AddressGroup, error)

Extract is a function that accepts a result and extracts a address group.

Jump to

Keyboard shortcuts

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