instances

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangePassword

func ChangePassword(c *golangsdk.ServiceClient, instanceId string, opts PasswordOpts) error

ChangePassword is a method to update the password using given parameters.

func Delete

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

Delete an instance by id

Types

type Connection

type Connection struct {
	// advertised.listeners IP/domain name.
	AdvertisedIp string `json:"advertised_ip"`
	// The status of broker cross-VPC access modification.
	Success bool `json:"success"`
	// Listeners IP.
	ListenersIp string `json:"ip"`
}

Connection is the structure that represents the detail of the cross-VPC access.

type CreateOpts

type CreateOpts struct {
	// Indicates the name of an instance.
	// An instance name starts with a letter,
	// consists of 4 to 64 characters, and supports
	// only letters, digits, hyphens (-), and underscores (_).
	Name string `json:"name" required:"true"`

	// Indicates the description of an instance.
	// It is a character string containing not more than 1024 characters.
	Description string `json:"description,omitempty"`

	// Indicates a message engine.
	Engine string `json:"engine" required:"true"`

	// Indicates the version of a message engine.
	EngineVersion string `json:"engine_version" required:"true"`

	// Indicates the message storage space.
	StorageSpace int `json:"storage_space" required:"true"`

	// Indicates the baseline bandwidth of a Kafka instance, that is,
	// the maximum amount of data transferred per unit time. Unit: byte/s.
	Specification string `json:"specification,omitempty"`

	// Indicates the maximum number of topics in a Kafka instance.
	PartitionNum int `json:"partition_num,omitempty"`

	// Indicates a username.
	// A username consists of 1 to 64 characters
	// and supports only letters, digits, and hyphens (-).
	AccessUser string `json:"access_user,omitempty"`

	// Indicates the password of an instance.
	// An instance password must meet the following complexity requirements:
	// Must be 6 to 32 characters long.
	// Must contain at least two of the following character types:
	// Lowercase letters
	// Uppercase letters
	// Digits
	// Special characters (`~!@#$%^&*()-_=+\|[{}]:'",<.>/?)
	Password string `json:"password,omitempty"`

	// Indicates the ID of a VPC.
	VpcID string `json:"vpc_id" required:"true"`

	// Indicates the ID of a security group.
	SecurityGroupID string `json:"security_group_id" required:"true"`

	// Indicates the ID of a subnet.
	SubnetID string `json:"subnet_id" required:"true"`

	// Indicates the ID of an AZ.
	// The parameter value can be left blank or an empty array.
	AvailableZones []string `json:"available_zones" required:"true"`

	// Indicates a product ID.
	ProductID string `json:"product_id" required:"true"`

	// Indicates the time at which a maintenance time window starts.
	// Format: HH:mm:ss
	MaintainBegin string `json:"maintain_begin,omitempty"`

	// Indicates the time at which a maintenance time window ends.
	// Format: HH:mm:ss
	MaintainEnd string `json:"maintain_end,omitempty"`

	// Indicates whether to open the public network access function. Default to false.
	EnablePublicIP bool `json:"enable_publicip,omitempty"`

	// Indicates the bandwidth of the public network.
	PublicBandWidth int `json:"public_bandwidth,omitempty"`

	// Indicates the ID of the Elastic IP address bound to the instance.
	PublicIpID string `json:"publicip_id,omitempty"`

	// Indicates whether to enable SSL-encrypted access.
	SslEnable *bool `json:"ssl_enable,omitempty"`

	// Indicates the action to be taken when the memory usage reaches the disk capacity threshold. Options:
	// time_base: Automatically delete the earliest messages.
	// produce_reject: Stop producing new messages.
	RetentionPolicy string `json:"retention_policy,omitempty"`

	// Indicates whether to enable automatic topic creation.
	EnableAutoTopic *bool `json:"enable_auto_topic,omitempty"`

	// Indicates the storage I/O specification. For details on how to select a disk type
	StorageSpecCode string `json:"storage_spec_code,omitempty"`

	// Indicates whether disk encryption is enabled.
	DiskEncryptedEnable *bool `json:"disk_encrypted_enable,omitempty"`

	// Disk encryption key. If disk encryption is not enabled, this parameter is left blank.
	DiskEncryptedKey string `json:"disk_encrypted_key,omitempty"`

	// Indicates the tags of the instance
	Tags []tags.ResourceTag `json:"tags,omitempty"`
}

CreateOps is a struct that contains all the parameters.

type CrossVpc

type CrossVpc struct {
	// The result of cross-VPC access modification.
	Success bool `json:"success"`
	// The result list of broker cross-VPC access modification.
	Connections []Connection `json:"results"`
}

CrossVpc is the structure that represents the API response of 'UpdateCrossVpc' method.

func UpdateCrossVpc

func UpdateCrossVpc(c *golangsdk.ServiceClient, instanceId string, opts CrossVpcUpdateOpts) (*CrossVpc, error)

UpdateCrossVpc is a method to update the internal IP address for cross-VPC access using given parameters.

type CrossVpcUpdateOpts

type CrossVpcUpdateOpts struct {
	// User-defined advertised IP contents key-value pair.
	// The key is the listeners IP.
	// The value is advertised.listeners IP, or domain name.
	Contents map[string]string `json:"advertised_ip_contents" required:"true"`
}

CrossVpcUpdateOpts is the structure required by the UpdateCrossVpc method to update the internal IP address for cross-VPC access.

type Instance

type Instance struct {
	Name                       string             `json:"name"`
	Description                string             `json:"description"`
	Engine                     string             `json:"engine"`
	EngineVersion              string             `json:"engine_version"`
	Specification              string             `json:"specification"`
	StorageSpace               int                `json:"storage_space"`
	PartitionNum               string             `json:"partition_num"`
	BrokerNum                  int                `json:"broker_num"`
	NodeNum                    int                `json:"node_num"`
	UsedStorageSpace           int                `json:"used_storage_space"`
	ConnectAddress             string             `json:"connect_address"`
	Port                       int                `json:"port"`
	Status                     string             `json:"status"`
	InstanceID                 string             `json:"instance_id"`
	ResourceSpecCode           string             `json:"resource_spec_code"`
	ChargingMode               int                `json:"charging_mode"`
	VPCID                      string             `json:"vpc_id"`
	VPCName                    string             `json:"vpc_name"`
	CreatedAt                  string             `json:"created_at"`
	UserID                     string             `json:"user_id"`
	UserName                   string             `json:"user_name"`
	MaintainBegin              string             `json:"maintain_begin"`
	MaintainEnd                string             `json:"maintain_end"`
	EnablePublicIP             bool               `json:"enable_publicip"`
	ManagementConnectAddress   string             `json:"management_connect_address"`
	SslEnable                  bool               `json:"ssl_enable"`
	Type                       string             `json:"type"`
	ProductID                  string             `json:"product_id"`
	SecurityGroupID            string             `json:"security_group_id"`
	SecurityGroupName          string             `json:"security_group_name"`
	SubnetID                   string             `json:"subnet_id"`
	SubnetName                 string             `json:"subnet_name"`
	SubnetCIDR                 string             `json:"subnet_cidr"`
	AvailableZones             []string           `json:"available_zones"`
	TotalStorageSpace          int                `json:"total_storage_space"`
	PublicConnectionAddress    string             `json:"public_connect_address"`
	StorageResourceID          string             `json:"storage_resource_id"`
	StorageSpecCode            string             `json:"storage_spec_code"`
	ServiceType                string             `json:"service_type"`
	StorageType                string             `json:"storage_type"`
	RetentionPolicy            string             `json:"retention_policy"`
	KafkaPublicStatus          string             `json:"kafka_public_status"`
	PublicBandWidth            int                `json:"public_bandwidth"`
	CrossVpcInfo               string             `json:"cross_vpc_info"`
	MessageQueryInstEnable     bool               `json:"message_query_inst_enable"`
	SupportFeatures            string             `json:"support_features"`
	DiskEncrypted              bool               `json:"disk_encrypted"`
	DiskEncryptedKey           string             `json:"disk_encrypted_key"`
	KafkaPrivateConnectAddress string             `json:"kafka_private_connect_address"`
	PublicAccessEnabled        string             `json:"public_access_enabled"`
	AccessUser                 string             `json:"access_user"`
	Tags                       []tags.ResourceTag `json:"tags"`
}

Instance response

func Get

func Get(client *golangsdk.ServiceClient, id string) (*Instance, error)

Get an instance with detailed information by id

type InstanceCreate

type InstanceCreate struct {
	InstanceID string `json:"instance_id"`
}

InstanceCreate response

func Create

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

Create an instance with given parameters.

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOpts) (*InstanceCreate, error)

Update is a method which can be able to update the instance via accessing to the service with Put method and parameters

type ListOpts

type ListOpts struct {
	InstanceId     string `q:"instance_id"`
	Name           string `q:"name"`
	Engine         string `q:"engine"`
	Status         string `q:"status"`
	IncludeFailure string `q:"include_failure"`
	ExactMatchName string `q:"exact_match_name"`
}

type ListResponse

type ListResponse struct {
	Instances  []Instance `json:"instances"`
	TotalCount int        `json:"instance_num"`
}

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) (*ListResponse, error)

type PasswordOpts

type PasswordOpts struct {
	NewPassword string `json:"new_password" required:"true"`
}

type UpdateOpts

type UpdateOpts struct {
	// Indicates the name of an instance.
	// An instance name starts with a letter,
	// consists of 4 to 64 characters,
	// and supports only letters, digits, and hyphens (-).
	Name string `json:"name,omitempty"`

	// Indicates the description of an instance.
	// It is a character string containing not more than 1024 characters.
	Description *string `json:"description,omitempty"`

	// Indicates the time at which a maintenance time window starts.
	// Format: HH:mm:ss
	MaintainBegin string `json:"maintain_begin,omitempty"`

	// Indicates the time at which a maintenance time window ends.
	// Format: HH:mm:ss
	MaintainEnd string `json:"maintain_end,omitempty"`

	// Indicates the ID of a security group.
	SecurityGroupID string `json:"security_group_id,omitempty"`

	// Indicates the action to be taken when the memory usage reaches the disk capacity threshold. Options:
	// time_base: Automatically delete the earliest messages.
	// produce_reject: Stop producing new messages.
	RetentionPolicy string `json:"retention_policy,omitempty"`
}

UpdateOpts is a struct which represents the parameters of update function

Jump to

Keyboard shortcuts

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