Documentation
¶
Index ¶
- func DeleteAddressGroup(client *golangsdk.ServiceClient, groupId string) error
- func DeleteGroupMember(client *golangsdk.ServiceClient, itemId string) error
- type AddGroupMemberOpts
- type AddGroupMemberResponse
- type AddressGroupData
- type AddressGroupMembersData
- type AddressGroupRecord
- type AddressGroupsData
- type AddressItem
- type AddressItemId
- type AddressItemsResponse
- type AddressSetId
- type CoveredIPVO
- type CreateOpts
- type CreateResponse
- type GetGroupMemberQueryParameters
- type GetGroupMembersResponse
- type GetResponse
- type GroupMemberRecord
- type ListQueryParameters
- type ListResponse
- type UpdateOpts
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAddressGroup ¶
func DeleteAddressGroup(client *golangsdk.ServiceClient, groupId string) error
This function is used to delete an address group. groupId: Address group ID. It is the same as ID retuned while creating an address group.
func DeleteGroupMember ¶
func DeleteGroupMember(client *golangsdk.ServiceClient, itemId string) error
This function is used to delete a member from an address group. itemId: Address group member ID. It can be obtained using GetGroupMember function.
Types ¶
type AddGroupMemberOpts ¶
type AddGroupMemberOpts struct {
// Address group ID
SetId string `json:"set_id,omitempty"`
// Address group member list.
AddressItems []AddressItem `json:"address_items,omitempty"`
}
type AddGroupMemberResponse ¶
type AddGroupMemberResponse struct {
Data AddressItemsResponse `json:"data"`
}
type AddressGroupData ¶
type AddressGroupData struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
AddressSetType int `json:"address_set_type"`
AddressType int `json:"address_type"`
}
func GetAddressGroup ¶
func GetAddressGroup(client *golangsdk.ServiceClient, groupId string) (*AddressGroupData, error)
This function is used to query address group details. groupId: Address group ID. It is the same as ID retuned while creating an address group.
type AddressGroupMembersData ¶
type AddressGroupMembersData struct {
// Number of records displayed on each page. The value ranges from 1 to 1024.
Limit int `json:"limit"`
// Offset, which specifies the start position of the record to be returned.
Offset int `json:"offset"`
// Query the total number of blacklist/whitelist records.
Total int `json:"total"`
// Address Group ID.
SetId string `json:"set_id"`
// The list of Blacklist/Whitelist records
Records []GroupMemberRecord `json:"records"`
}
type AddressGroupRecord ¶
type AddressGroupRecord struct {
// Address group ID.
SetID string `json:"set_id"`
// Number of times an address group is referenced by rules.
RefCount int `json:"ref_count"`
// Description.
Description string `json:"description"`
// Internet protocol type of an address: 0 (IPv4), 1 (IPv6).
AddressType int `json:"address_type"`
// Protected object ID, used to distinguish between Internet border protection and VPC border protection.
ObjectID string `json:"object_id"`
// Address group type:
// 0 - User-defined address group
// 1 - WAF back-to-source IP address group
// 2 - DDoS back-to-source IP address group
// 3 - NAT64 address group
AddressSetType int `json:"address_set_type"`
}
func ListAddressGroups ¶
func ListAddressGroups(client *golangsdk.ServiceClient, objectId string) ([]AddressGroupRecord, error)
This function is used to query the address group list. Protected object ID, which is used to distinguish between Internet border protection and VPC border protection after a cloud firewall is created. You can obtain the ID by calling the Get function in management package. In the return value, find the ID in ProtectObjects[n].ObjectID. If the value of type is 0, the protected object ID belongs to the Internet border. If the value of type is 1, the protected object ID belongs to the VPC border.
type AddressGroupsData ¶
type AddressGroupsData struct {
// Number of records displayed on each page. The value ranges from 1 to 1024.
Limit int `json:"limit"`
// Offset, which specifies the start position of the record to be returned.
Offset int `json:"offset"`
// Query the total number of address group records.
Total int `json:"total"`
// The list of address group records
Records []AddressGroupRecord `json:"records"`
}
type AddressItem ¶
type AddressItemId ¶
type AddressItemId struct {
// ID of an address group member.
Id string `json:"id"`
}
type AddressItemsResponse ¶
type AddressItemsResponse struct {
// List of address group member IDs.
Items []AddressItemId `json:"items"`
// List of covered IP addresses.
CoveredIp []CoveredIPVO `json:"covered_ip"`
}
func AddGroupMember ¶
func AddGroupMember(client *golangsdk.ServiceClient, opts AddGroupMemberOpts) (*AddressItemsResponse, error)
This function is used to add a member to an address group.
type AddressSetId ¶
type AddressSetId struct {
// Address group ID.
Id string `json:"id"`
// IP address group name.
Name string `json:"name"`
}
func CreateAddressGroup ¶
func CreateAddressGroup(client *golangsdk.ServiceClient, opts CreateOpts) (*AddressSetId, error)
This function is used to add an address group.
func UpdateAddressGroup ¶
func UpdateAddressGroup(client *golangsdk.ServiceClient, groupId string, opts UpdateOpts) (*AddressSetId, error)
This function is used to update address group information. groupId: Address group ID. It is the same as ID retuned while creating an address group.
type CoveredIPVO ¶
type CreateOpts ¶
type CreateOpts struct {
// Protected object ID, which is used to distinguish between Internet border protection and VPC border protection
// after a cloud firewall is created. You can obtain the ID by calling the Get function in management package.
// In the return value, find the ID in ProtectObjects[n].ObjectID.
// If the value of type is 0, the protected object ID belongs to the Internet border.
// If the value of type is 1, the protected object ID belongs to the VPC border.
ObjectID string `json:"object_id" required:"true"`
// IP address group name.
Name string `json:"name" required:"true"`
// Description.
Description string `json:"description,omitempty"`
// Internet protocol type of an address: 0 (IPv4), 1 (IPv6).
AddressType *int `json:"address_type,omitempty"`
}
type CreateResponse ¶
type CreateResponse struct {
Data AddressSetId `json:"data"`
}
type GetGroupMemberQueryParameters ¶
type GetGroupMemberQueryParameters struct {
// Address group ID. It is the same as ID retuned while creating an address group.
SetID string `q:"set_id" required:"true"`
// Offset, which specifies the start position of the record to be returned. The value must be a number no less than 0. The default value is 0.
Offset string `q:"offset" required:"true"`
// Number of records displayed on each page. The value ranges from 1 to 1024.
Limit int `q:"limit" required:"true"`
// IP address.
Address string `q:"address,omitempty"`
}
type GetGroupMembersResponse ¶
type GetGroupMembersResponse struct {
// Returned data for querying address group members.
Data AddressGroupMembersData `json:"data"`
}
type GetResponse ¶
type GetResponse struct {
Data AddressGroupData `json:"data"`
}
type GroupMemberRecord ¶
type GroupMemberRecord struct {
// ID of an address group member.
ItemID string `json:"item_id"`
// Name of an address group member.
Name string `json:"name"`
// Internet protocol type of an address: 0 (IPv4), 1 (IPv6).
AddressType int `json:"address_type"`
// IP address.
Address string `json:"address"`
// Description.
Description string `json:"description"`
}
func GetGroupMember ¶
func GetGroupMember(client *golangsdk.ServiceClient, groupId string, ipAddress string) (*GroupMemberRecord, error)
This function is used to query a particular member in an address group. groupId: Address group ID. It is the same as ID retuned while creating an address group. ipAddress: // IP address of the group member.
func ListGroupMembers ¶
func ListGroupMembers(client *golangsdk.ServiceClient, groupId string) ([]GroupMemberRecord, error)
This function is used to query members in an address group. groupId: Address group ID. It is the same as ID retuned while creating an address group.
type ListQueryParameters ¶
type ListQueryParameters struct {
// Protected object ID, which is used to distinguish between Internet border protection and VPC border protection
// after a cloud firewall is created. You can obtain the ID by calling the Get function in management package.
// In the return value, find the ID in ProtectObjects[n].ObjectID.
// If the value of type is 0, the protected object ID belongs to the Internet border.
// If the value of type is 1, the protected object ID belongs to the VPC border.
ObjectID string `q:"object_id" required:"true"`
// Offset, which specifies the start position of the record to be returned. The value must be a number no less than 0. The default value is 0.
Offset string `q:"offset" required:"true"`
// Number of records displayed on each page. The value ranges from 1 to 1024.
Limit int `q:"limit" required:"true"`
}
type ListResponse ¶
type ListResponse struct {
// Returned data for querying the address group list.
Data AddressGroupsData `json:"data"`
}
type UpdateOpts ¶
type UpdateResponse ¶
type UpdateResponse struct {
Data AddressSetId `json:"data"`
}