eip

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeEIPProtectionOpts

type ChangeEIPProtectionOpts 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"`
	// Status that an EIP will be changed to: 0 (protected), 1 (unprotected).
	// Note for dev: Don't add required tag to this field since Status: 0 will return missing input error during validation.
	Status int `json:"status"`
	// List of EIPs whose protection status is changed.
	IPInfos []IPInfo `json:"ip_infos" required:"true"`
}

type ChangeEIPProtectionQueryParams

type ChangeEIPProtectionQueryParams struct {
	// Enterprise project ID, which is the ID of a project planned based on organizations.
	EnterpriseProjectId string `q:"enterprise_project_id,omitempty"`
	// Firewall ID
	FwInstanceId string `q:"fw_instance_id,omitempty"`
}

type ChangeEIPProtectionResponse

type ChangeEIPProtectionResponse struct {
	Data EIPSwitchStatusVO `json:"data"`
}

type EIPSwitchStatusVO

type EIPSwitchStatusVO struct {
	// Protected object ID, which is used to distinguish between Internet border protection and VPC border protection
	// after a cloud firewall is created.
	ObjectID string `json:"object_id"`
	// List of EIP protection statuses that fail to be modified.
	// The status can be "successful" or "fail".
	FailEIPIDList []string `json:"fail_eip_id_list"`
	// List of failures to modify the EIP protection status.
	FailEIPList []FailedEIPInfo `json:"fail_eip_list"`
	// Firewall ID, which can be obtained by referring to "Obtaining a Firewall ID".
	ID string `json:"id"`
}

func ChangeEIPProtection

func ChangeEIPProtection(client *golangsdk.ServiceClient, firewallId string, opts ChangeEIPProtectionOpts) (*EIPSwitchStatusVO, error)

This function is used to enable or disable EIP protection. After a customer purchases an EIP, the customer needs to call ListEips to synchronize EIPs asset before enabling EIP protection for the first time. The sync field should be set to 1.

type EipResource

type EipResource struct {
	// Type of the associated instance: NATGW, ELB, or PORT.
	AssociateInstanceType string `json:"associate_instance_type"`
	// ID of the device (such as ECS and NAT) bound to the EIP.
	DeviceID string `json:"device_id"`
	// Name of the device (such as ECS and NAT) bound to the EIP
	DeviceName string `json:"device_name"`
	// Owner of the device (such as ECS and NAT) bound to the EIP.
	DeviceOwner string `json:"device_owner"`
	// ID of the user that an EIP belongs to.
	DomainID string `json:"domain_id"`
	// Enterprise project ID of the account that the EIP belongs to.
	EnterpriseProjectID string `json:"enterprise_project_id"`
	// User that a firewall belongs to.
	FwDomainID string `json:"fw_domain_id"`
	// Enterprise project ID of the firewall bound to the EIP.
	FwEnterpriseProjectID string `json:"fw_enterprise_project_id"`
	// Firewall instance ID, which is automatically generated after a CFW instance is created.
	FwInstanceID string `json:"fw_instance_id"`
	// Firewall name.
	FwInstanceName string `json:"fw_instance_name"`
	// EIP ID.
	ID string `json:"id"`
	// Protected object ID.
	ObjectID string `json:"object_id"`
	// EIP
	PublicIP string `json:"public_ip"`
	// EIP (IPV6)
	PublicIPV6 string `json:"public_ipv6"`
	// EIP protection status: 0 (protected), 1 (unprotected).
	Status int `json:"status"`
	// Tag list.
	Tags string `json:"tags"`
}

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]EipResource, error)

This function function is used to query the EIP list and display their protection status among other details.

type FailedEIPInfo

type FailedEIPInfo struct {
	// ID of an EIP whose status fails to be changed.
	ID string `json:"id"`
	// Error code of a status change failure.
	ErrorMessage string `json:"error_message"`
}

type IPInfo

type IPInfo struct {
	// EIP ID
	ID string `json:"id,omitempty"`
	// EIP IPv4 address.
	PublicIP string `json:"public_ip,omitempty"`
	// EIP IPv6 address.
	PublicIPv6 string `json:"public_ipv6,omitempty"`
}

IPInfo represents an individual EIP whose protection status is changed.

type ListEIPResponse

type ListEIPResponse struct {
	Data ListEIPResponseData `json:"data"`
}

type ListEIPResponseData

type ListEIPResponseData struct {
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
	// EIP resource record.
	Records []EipResource `json:"records"`
	Total   int           `json:"total"`
}

type ListOpts

type ListOpts 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"`
	// Keyword for querying the protected EIP list. You can set an EIP ID or an EIP.
	KeyWord string `q:"key_word,omitempty"`
	// Protection status: null (all), 0 (enabled), or 1 (disabled).
	Status string `q:"status,omitempty"`
	// Enterprise project ID of a project based on organizations. If not enabled, the value is 0.
	EnterpriseProjectID string `q:"enterprise_project_id,omitempty"`
	// Device keyword, which is the name or ID of the asset bound to an EIP.
	DeviceKey string `q:"device_key,omitempty"`
	// Internet protocol type of an address: 0 (IPv4), 1 (IPv6).
	AddressType *int `q:"address_type,omitempty"`
	// Firewall ID, which can be obtained by referring to "Obtaining a Firewall ID".
	FwInstanceID string `q:"fw_instance_id,omitempty"`
	// Firewall keyword, which can be queried based on the firewall ID or name.
	FwKeyWord string `q:"fw_key_word,omitempty"`
	// Enterprise project ID of the EIP. If not enabled, the value is 0.
	EpsID string `q:"eps_id,omitempty"`
	// Tags that can be obtained by querying in the EIP console.
	Tags string `q:"tags,omitempty"`
}

Jump to

Keyboard shortcuts

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