groups

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List returns a Pager which allows you to iterate over a collection of security groups. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Types

type ListOpts

type ListOpts struct {
	//Specifies that the VPC ID is used as the filtering condition.
	VpcID string `q:"vpc_id"`

	//Specifies the tenant ID of the operator.
	TenantID string `q:"tenant_id"`

	//Specifies the number of records returned on each page.
	//The value ranges from 0 to intmax.
	Limit int `q:"limit"`

	//Specifies the resource ID of pagination query.
	//If the parameter is left blank, only resources on the first page are queried.
	Marker string `q:"marker"`

	//The value can contain a maximum of 36 characters.
	//It is string "0" or in UUID format with hyphens (-). Value 
	//"0" indicates the default enterprise project.Specifies the enterprise project ID.
	//This field can be used to filter the security groups of an enterprise project.
	EnterpriseProjectID string `q:"enterprise_project_id"`
}

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 group attributes you want to see returned.

type SecGroup

type SecGroup struct {
	ID                  string              `json:"id"`
	Name                string              `json:"name"`
	Description         string              `json:"description"`
	VpcID               string              `json:"vpc_id"`
	EnterpriseProjectID string              `json:"enterprise_project_id"`
	SecurityGroupRules  []SecurityGroupRule `json:"security_group_rules"`
}

SecGroup represents a container for security group rules.

func ExtractGroups

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

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

type SecGroupPage

type SecGroupPage struct {
	pagination.LinkedPageBase
}

SecGroupPage is the page returned by a pager when traversing over a collection of security groups.

func (SecGroupPage) IsEmpty

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

IsEmpty checks whether a SecGroupPage struct is empty.

func (SecGroupPage) NextPageURL

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

type SecurityGroupRule

type SecurityGroupRule struct {
	Direction       string `json:"direction"`
	Ethertype       string `json:"ethertype"`
	ID              string `json:"id"`
	Description     string `json:"description"`
	SecurityGroupID string `json:"security_group_id"`
	RemoteGroupID   string `json:"remote_group_id,omitempty"`
	RemoteIPPrefix  string `json:"remote_ip_prefix,omitempty"`
	Protocol        string `json:"protocol,omitempty"`
	PortRangeMin    int    `json:"port_range_min,omitempty"`
	PortRangeMax    int    `json:"port_range_max,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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