addressgroup

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(client *golangsdk.ServiceClient, groupId string) error

This function is used to delete an IP address group.

Types

type AddressGroup

type AddressGroup struct {
	// ID of an IP address group. After an IP address group is created, an IP address
	ID string `json:"id"`
	// The name of an IP address group.
	Name string `json:"name"`
	// Description about an IP address group.
	Description string `json:"description"`
	// Maximum number of IP address entries in an IP address group.
	MaxCapacity int `json:"max_capacity"`
	// IP address entries in an IP address group.
	IPSet []string `json:"ip_set"`
	// IP address version of an IP address group.
	// 4: IPv4 address group
	// 6: IPv6 address group
	IPVersion int `json:"ip_version"`
	// Time when an IP address group was created.
	// The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ss.
	CreatedAt string `json:"created_at"`
	// Time when an IP address group was last updated.
	// The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ss.
	UpdatedAt string `json:"updated_at"`
	// ID of the project that an IP address group belongs to.
	TenantID string `json:"tenant_id"`
	// ID of the enterprise project that an IP address group belongs to.
	// The value is 0 or a string in UUID format with hyphens (-).
	// 0 indicates the default enterprise project.
	EnterpriseProjectID string `json:"enterprise_project_id"`
	// Tags of an IP address group, including tag keys and tag values,
	// which can be used to classify and identify resources.
	Tags []ResponseTag `json:"tags"`
	// Status of an IP address group. If the IP address group is in the UPDATING
	// state, it cannot be updated again.
	// NORMAL: normal (default value)
	// UPDATING: being updated
	// UPDATE_FAILED: update failed
	Status string `json:"status"`
	// Details about the IP address group status.
	StatusMessage string `json:"status_message"`
	// IP address entries in an IP address group and their remarks.
	IPExtraSet []IpExtraSetRespOption `json:"ip_extra_set"`
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*AddressGroup, error)

This function is used to create an IP address group.

func Get

func Get(client *golangsdk.ServiceClient, groupId string) (*AddressGroup, error)

This function is used to obtain details about an IP address group.

func Update

func Update(client *golangsdk.ServiceClient, groupId string, opts UpdateOpts) (*AddressGroup, error)

This function is used to update an IP address group.

type AddressGroupOptions

type AddressGroupOptions struct {
	// IP Address group name.
	// The value can contain 1 to 64 characters, including letters, digits, underscores (_), hyphens (-), and periods (.).
	Name string `json:"name" required:"true"`
	// Description about the IP Address group.
	// The value can contain up to 255 characters and cannot contain angle brackets (< or >).
	Description string `json:"description,omitempty"`
	// IP address version of an IP address group.
	// 4: IPv4 address group
	// 6: IPv6 address group
	IpVersion int `json:"ip_version" required:"true"`
	// Enterprise project ID.
	// When creating an IP address group, associate an enterprise project ID with the IP address group.
	// The project ID can be 0 or a string that contains a maximum of 36 characters in UUID format with hyphens (-).
	// 0 indicates the default enterprise project.
	EnterpriseProjectId string `json:"enterprise_project_id,omitempty"`
	// Maximum number of IP address entries in an IP address group.
	// Range: 0 to 20
	// Default: 0
	MaxCapacity int `json:"max_capacity,omitempty"`
	// IP address entries in an IP address group. Both IPv4 and IPv6 address entries are supported.
	// The default maximum number of IP address sets, including IP addresses, IP address ranges, and CIDR blocks, in an IP address group is 20.
	// The ip_set and ip_extra_set parameters cannot be both specified in a request.
	// If you need to add remarks for IP address entries, use the ip_extra_set parameter.
	// An IP address entry in an IP address set can be:
	// 		A single IP address, for example, 192.168.21.25
	// 		An IP address range, for example, 192.168.21.25-192.168.21.30
	// 		A CIDR block, for example, 192.168.21.0/24
	IpSet []string `json:"ip_set,omitempty"`
	// IP address entries in an IP address group and their remarks.
	// There are multiple IP address entry objects in an IP address group.
	// Each IP address entry object contains one IP address entry and its remarks.
	// An IP address entry is the same as that in ip_set.
	// The remarks can describe the usage of the IP address entry.
	IpExtraSet []IpExtraSetOption `json:"ip_extra_set,omitempty"`
}

type AddressGroupResponse

type AddressGroupResponse struct {
	// Request ID.
	RequestID string `json:"request_id"`
	// Response body for creating an IP address group.
	AddressGroup AddressGroup `json:"address_group"`
}

type CreateOpts

type CreateOpts struct {
	// Whether to only send the check request.
	// The value can be:
	// true: A check request will be sent and no IP address group will be created.
	// 	Check items include mandatory parameters, request format, and constraints.
	// 	If the check fails, an error will be returned.
	// 	If the check succeeds, response code 202 will be returned.
	// false: A request will be sent and an IP address group will be created.
	DryRun bool `json:"dry_run,omitempty"`
	// Request body for creating an IP address group.
	AddressGroup AddressGroupOptions `json:"address_group" required:"true"`
}

type IpExtraSetOption

type IpExtraSetOption struct {
	// IP address entries in an IP address group. Both IPv4 and IPv6 address entries are supported.
	// A single IP address, for example, 192.168.21.25
	// An IP address range, for example, 192.168.21.25-192.168.21.30
	// A CIDR block, for example, 192.168.21.0/24
	Ip string `json:"ip" required:"true"`
	// Remarks of an IP address entry. The value can contain 0 to 255 characters and cannot contain angle brackets (< or >).
	Remarks string `json:"remarks,omitempty"`
}

type IpExtraSetRespOption

type IpExtraSetRespOption struct {
	// IP address entry. Can be a single IP address (e.g. 192.168.21.25),
	// an IP address range (e.g. 192.168.21.25-192.168.21.30),
	// or a CIDR block (e.g. 192.168.21.0/24).
	IP string `json:"ip"`
	// Remark or description for the IP address entry.
	Remark string `json:"remark"`
}

type ListQueryParams

type ListQueryParams struct {
	// Specifies the number of records displayed on each page.
	// The value ranges from 1 to 2000.
	Limit int `q:"limit"`
	// Specifies the start resource ID of pagination query. If the parameter is left blank, only resources on the first page are queried.
	// The value is obtained from next_marker or previous_marker in PageInfo queried last time.
	Marker string `q:"marker"`
	// Specifies the IP address group ID.
	Id []string `q:"id"`
	// Specifies the IP address group name.
	Name []string `q:"name"`
	// IP address version of an IP address group.
	// 4: IPv4 address group
	// 6: IPv6 address group
	IpVersion int `q:"ip_version"`
	// Specifies the Description about an IP address group.
	// This field can be used to precisely filter IP address groups. Multiple descriptions can be specified for filtering.
	Description []string `q:"description"`
}

type ListResponse

type ListResponse struct {
	// Specifies the response body for querying IP address groups.
	AddressGroups []AddressGroup `json:"address_groups"`
	// Request ID
	RequestID string `json:"request_id"`
	// Specifies the pagination information.
	PageInfo PageInfo `json:"page_info"`
}

func List

This function is used to query all IP address groups of a tenant.

type PageInfo

type PageInfo struct {
	// Specifies the ID of the last record in this query, which can be used in the next query.
	NextMarker string `json:"next_marker"`
	// Specifies the ID of the first record in the pagination query result.
	// When page_reverse is set to true, this parameter is used together to query resources on the previous page.
	PreviousMarker string `json:"previous_marker"`
	// Specifies the ID of the last record in the pagination query result. It is usually used to query resources on the next page. Value range: 1-200
	CurrentCount int `json:"current_count"`
}

type ResponseTag

type ResponseTag struct {
	// Tag key.
	Key string `json:"key"`
	// Tag value.
	Value string `json:"value"`
}

ResponseTag represents a tag object associated with an IP address group.

type UpdateAddressGroupOptions

type UpdateAddressGroupOptions struct {
	// IP Address group name.
	// The value can contain 1 to 64 characters, including letters, digits, underscores (_), hyphens (-), and periods (.).
	Name string `json:"name,omitempty"`
	// Description about the IP Address group.
	// The value can contain up to 255 characters and cannot contain angle brackets (< or >).
	Description string `json:"description,omitempty"`
	// IP address entries in an IP address group. Both IPv4 and IPv6 address entries are supported.
	// The default maximum number of IP address sets, including IP addresses, IP address ranges, and CIDR blocks, in an IP address group is 20.
	// The ip_set and ip_extra_set parameters cannot be both specified in a request.
	// If you need to add remarks for IP address entries, use the ip_extra_set parameter.
	// An IP address entry in an IP address set can be:
	// 		A single IP address, for example, 192.168.21.25
	// 		An IP address range, for example, 192.168.21.25-192.168.21.30
	// 		A CIDR block, for example, 192.168.21.0/24
	IpSet []string `json:"ip_set,omitempty"`
	// IP address entries in an IP address group and their remarks.
	// There are multiple IP address entry objects in an IP address group.
	// Each IP address entry object contains one IP address entry and its remarks.
	// An IP address entry is the same as that in ip_set.
	// The remarks can describe the usage of the IP address entry.
	IpExtraSet []IpExtraSetOption `json:"ip_extra_set,omitempty"`
}

type UpdateOpts

type UpdateOpts struct {
	// Whether to only send the check request.
	// The value can be:
	// true: A check request will be sent and the IP address group will not be updated.
	// 	Check items include mandatory parameters, request format, and constraints.
	// 	If the check fails, an error will be returned.
	// 	If the check succeeds, response code 202 will be returned.
	// false: A request will be sent and an IP address group will be created.
	DryRun bool `json:"dry_run,omitempty"`
	// Request body for creating an IP address group.
	AddressGroup UpdateAddressGroupOptions `json:"address_group" required:"true"`
}

Jump to

Keyboard shortcuts

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