Documentation
¶
Index ¶
- func Delete(client *golangsdk.ServiceClient, id string) error
- func UpdateInstanceConf(client *golangsdk.ServiceClient, id string, opts UpdateInstanceConfOpts) error
- type BSSParam
- type BatchRestartDeleteOpts
- type BatchRestartDeleteResp
- type CreateDeprOpts
- type CreateOpts
- type Instance
- type InstanceConf
- type InstanceConfs
- type InstanceCreate
- type InstanceIDResp
- type KafkaConfig
- type ListOpts
- type ListResponse
- type ResultResp
- type UpdateInstanceConfOpts
- type UpdateInstanceConfResp
- type UpdateOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(client *golangsdk.ServiceClient, id string) error
Delete an instance by id
func UpdateInstanceConf ¶
func UpdateInstanceConf(client *golangsdk.ServiceClient, id string, opts UpdateInstanceConfOpts) error
UpdateInstanceConf is used to modify instance configurations. via accessing to the service with Put method and parameters Send PUT /v2/{project_id}/instances/{instance_id}
Types ¶
type BSSParam ¶
type BSSParam struct {
// Whether auto renewal is enabled.
// Options:
// true: Auto renewal is enabled.
// false: Auto renewal is not enabled.
// By default, auto renewal is disabled.
IsAutoRenew *bool `json:"is_auto_renew,omitempty"`
// Billing mode.
// This parameter specifies a payment mode.
// Options:
// prePaid: yearly/monthly billing.
// postPaid: pay-per-use billing.
// The default value is postPaid.
ChargingMode string `json:"charging_mode,omitempty"`
// Specifies whether the order is automatically or manually paid.
// Options:
// true: The order will be automatically paid.
// false: The order must be manually paid.
// The default payment mode is manual.
IsAutoPay *bool `json:"is_auto_pay,omitempty"`
// Subscription period type.
// Options:
// month
// year:
// This parameter is valid and mandatory only when chargingMode is set to prePaid. **
PeriodType string `json:"period_type,omitempty"`
// Subscribed periods.
//
// Options:
// If periodType is month, the value ranges from 1 to 9.
// If periodType is year, the value ranges from 1 to 3.
// **This parameter is valid and mandatory only when chargingMode is set to prePaid. **
PeriodNum int `json:"period_num,omitempty"`
}
type BatchRestartDeleteOpts ¶
type BatchRestartDeleteOpts struct {
// Operation to be performed on instances. The value can be restart or delete.
Action string `json:"action" required:"true"`
// Indicates List of instance IDs.
Instances string `json:"instances,omitempty"`
// Value kafka indicates all Kafka instances that fail to be created are to be deleted.
AllFailure string `json:"all_failure,omitempty"`
}
type BatchRestartDeleteResp ¶
type BatchRestartDeleteResp struct {
// Result of instance modification.
Results []ResultResp `json:"results"`
}
func BatchRestartDelete ¶
func BatchRestartDelete(client *golangsdk.ServiceClient, opts CreateOpts) (*BatchRestartDeleteResp, error)
BatchRestartDelete This API is used to restart or delete instances in batches. When an instance is being restarted, message retrieval and creation requests of the client will be rejected. Deleting an instance will delete the data in the instance without any backup. Exercise caution when performing this operation. Send POST to /v2/{project_id}/instances/action
type CreateDeprOpts ¶
type CreateDeprOpts 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"`
// BrokerNum is a number of brokers.
BrokerNum *int `json:"broker_num,omitempty"`
// 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 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"`
// BrokerNum is a number of brokers.
BrokerNum int `json:"broker_num" required:"true"`
// Indicates the message storage space.
StorageSpace int `json:"storage_space" required:"true"`
// 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
MaintainBegin string `json:"maintain_begin,omitempty"`
// Indicates the time at which a maintenance time window ends.
// Format: HH:mm
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 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"`
// Security protocol to use after SASL is enabled. This parameter is mandatory if SASL authentication is enabled (ssl_enable=true).
// If this parameter is left blank, SASL_SSL authentication is enabled by default.
// This setting is fixed once the instance is created.
// SASL_SSL: Data is encrypted with SSL certificates for high-security transmission.
// SASL_PLAINTEXT: Data is transmitted in plaintext with username and password authentication. This protocol uses the SCRAM-SHA-512 mechanism and delivers high performance.
KafkaSecurityProtocol string `json:"kafka_security_protocol,omitempty"`
// Authentication mechanism to use after SASL is enabled. This parameter is mandatory if SASL authentication is enabled (ssl_enable=true).
// If this parameter is left blank, PLAIN authentication is enabled by default.
// Select both or either of the following mechanisms for SASL authentication. Options:
// PLAIN: simple username and password verification.
// SCRAM-SHA-512: user credential verification, which is more secure than PLAIN.
SaslEnabledMechanisms []string `json:"sasl_enabled_mechanisms,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 IPv6. This parameter is available only when the VPC supports IPv6.
// Default: false
IPv6Enable bool `json:"ipv6_enable,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 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" required:"true"`
// Indicates the tags of the instance
Tags []tags.ResourceTag `json:"tags,omitempty"`
// CPU architecture. Currently, only the x86 architecture is supported.
// Options:
// X86
ArchType string `json:"arch_type,omitempty"`
// Intra-VPC plaintext access.
VpcClientPlain *bool `json:"vpc_client_plain,omitempty"`
// Parameter related to the yearly/monthly billing mode.
// If this parameter is left blank, the billing mode is pay-per-use by default. If this parameter is not left blank, the billing mode is yearly/monthly.
BSSParam *BSSParam `json:"bss_param,omitempty"`
}
CreateOpts is a struct that contains all the parameters for a creation.
type Instance ¶
type Instance struct {
// Instance name.
Name string `json:"name"`
// Message engine.
Engine string `json:"engine"`
// Version.
EngineVersion string `json:"engine_version"`
// Instance description.
Description string `json:"description"`
// Instance specifications.
Specification string `json:"specification"`
// Message storage space in GB.
StorageSpace int `json:"storage_space"`
// Number of partitions in a Kafka instance.
PartitionNum string `json:"partition_num"`
// Used message storage space in GB.
UsedStorageSpace int `json:"used_storage_space"`
// IP address of an instance.
ConnectAddress string `json:"connect_address"`
// Port of an instance.
Port int `json:"port"`
// Instance status.
Status string `json:"status"`
// Instance ID.
InstanceID string `json:"instance_id"`
// Resource specification code.
// dms.instance.kafka.cluster.c3.mini: Kafka instance with 100 MB/s bandwidth
// dms.instance.kafka.cluster.c3.small.2: Kafka instance with 300 MB/s bandwidth
// dms.instance.kafka.cluster.c3.middle.2: Kafka instance with 600 MB/s bandwidth
// dms.instance.kafka.cluster.c3.high.2: Kafka instance with 1200 MB/s bandwidth
ResourceSpecCode string `json:"resource_spec_code"`
// Billing mode. 1: pay-per-use.
ChargingMode int `json:"charging_mode"`
// VPC id.
VPCID string `json:"vpc_id"`
// VPC name.
VPCName string `json:"vpc_name"`
// Time when the instance was created.
// The time is in the format of timestamp, that is, the offset milliseconds from 1970-01-01 00:00:00 UTC to the specified time.
CreatedAt string `json:"created_at"`
// Subnet name.
SubnetName string `json:"subnet_name"`
// Subnet CIDR block.
SubnetCIDR string `json:"subnet_cidr"`
// User ID.
UserID string `json:"user_id"`
// User name.
UserName string `json:"user_name"`
// Username for accessing the instance.
AccessUser string `json:"access_user"`
// Time at which the maintenance time window starts. The format is HH:mm:ss.
MaintainBegin string `json:"maintain_begin"`
// Time at which the maintenance time window ends. The format is HH:mm:ss.
MaintainEnd string `json:"maintain_end"`
// Whether public access is enabled for the instance.
// true: enabled
// false: disabled
EnablePublicIP bool `json:"enable_publicip"`
// Whether security authentication is enabled.
// true: enable
// false: disabled
SslEnable bool `json:"ssl_enable"`
// Indicates whether to enable encrypted replica transmission among brokers.
// true: enable
// false: disable
BrokerSslEnable bool `json:"broker_ssl_enable"`
// Security protocol to use after SASL is enabled.
// SASL_SSL: Data is encrypted with SSL certificates for high-security transmission.
// SASL_PLAINTEXT: Data is transmitted in plaintext with username and password authentication. This protocol uses the SCRAM-SHA-512 mechanism and delivers high performance.
KafkaSecurityProtocol string `json:"kafka_security_protocol"`
// Authentication mechanism used after SASL is enabled.
// PLAIN: simple username and password verification.
// SCRAM-SHA-512: user credential verification, which is more secure than PLAIN.
SASLEnabledMechanisms []string `json:"sasl_enabled_mechanisms"`
// Indicates whether to enable two-way authentication.
SSLTwoWayEnable bool `json:"ssl_two_way_enable"`
// Whether the certificate can be replaced.
CertReplaced bool `json:"cert_replaced"`
// Instance type. The value can be a cluster.
Type string `json:"type"`
// Product ID.
ProductID string `json:"product_id"`
// Security group ID.
SecurityGroupID string `json:"security_group_id"`
// Security group name.
SecurityGroupName string `json:"security_group_name"`
// Subnet ID.
SubnetID string `json:"subnet_id"`
// AZ to which the instance brokers belong. The AZ ID is returned.
AvailableZones []string `json:"available_zones"`
// Name of the AZ to which the instance node belongs. The AZ name is returned.
AvailableZoneNames []string `json:"available_zone_names"`
// Message storage space in GB.
TotalStorageSpace int `json:"total_storage_space"`
// Instance public access address. This parameter is available only when public access is enabled for the instance.
PublicConnectAddress string `json:"public_connect_address"`
// Storage resource ID.
StorageResourceID string `json:"storage_resource_id"`
// I/O specifications.
StorageSpecCode string `json:"storage_spec_code"`
// Service type.
ServiceType string `json:"service_type"`
// Storage class.
StorageType string `json:"storage_type"`
// Message retention policy.
RetentionPolicy string `json:"retention_policy"`
// Whether public access is enabled for Kafka.
KafkaPublicStatus string `json:"kafka_public_status"`
// Public network access bandwidth.
PublicBandWidth int `json:"public_bandwidth"`
// Whether Kafka Manager is enabled.
KafkaManagerEnabled bool `json:"kafka_manager_enabled"`
// Indicates whether to enable a new certificate.
NewAuthCert bool `json:"new_auth_cert"`
// Cross-VPC access information.
CrossVpcInfo string `json:"cross_vpc_info"`
// Whether dumping is enabled. Dumping is not supported for the new specification type.
ConnectorEnable bool `json:"connector_enable"`
// Number of connectors.
ConnectorNodeNum int `json:"connector_node_num"`
// Kafka REST connection address.
RestConnectAddress string `json:"rest_connect_address"`
// Connection address on the tenant side.
PodConnectAddress string `json:"pod_connect_address"`
// Whether disk encryption is enabled.
DiskEncrypted bool `json:"disk_encrypted"`
// Disk encryption key. If disk encryption is not enabled, this parameter is left blank.
DiskEncryptedKey string `json:"disk_encrypted_key"`
// Private connection address of a Kafka instance.
KafkaPrivateConnectAddress string `json:"kafka_private_connect_address"`
// Cloud Eye version.
CesVersion string `json:"ces_version"`
// Time when public access was enabled for an instance. The value can be true, actived, closed, or false.
PublicAccessEnabled string `json:"public_access_enabled"`
// Node quantity.
NodeNum int `json:"node_num"`
// Indicates whether access control is enabled.
EnableACL bool `json:"enable_acl"`
// Whether billing based on new specifications is enabled.
NewSpecBillingEnabled bool `json:"new_spec_billing_enabled"`
// Broker quantity.
BrokerNum int `json:"broker_num"`
// Tag list.
Tags []tags.ResourceTag `json:"tags"`
// Indicates whether DR is enabled.
DREnable bool `json:"dr_enable"`
}
Instance response
type InstanceConf ¶
type InstanceConf struct {
// Configuration name.
Name string `json:"name"`
// Valid value.
ValidValues string `json:"valid_values"`
// Default value.
DefaultValue string `json:"default_value"`
// Configuration type. The value can be static or dynamic.
ConfigType string `json:"config_type"`
// Current value.
Value string `json:"value"`
// Value type.
ValueType string `json:"value_type"`
}
type InstanceConfs ¶
type InstanceConfs struct {
KafkaConfigs []InstanceConf `json:"kafka_configs"`
}
func GetInstanceConf ¶
func GetInstanceConf(client *golangsdk.ServiceClient, id string) (*InstanceConfs, error)
GetInstanceConf is used to obtain instance configurations. Send GET /v2/{project_id}/instances/{instance_id}/configs
type InstanceCreate ¶
type InstanceCreate struct {
InstanceID string `json:"instance_id"`
}
InstanceCreate response
func CreateDepr ¶
func CreateDepr(client *golangsdk.ServiceClient, opts CreateDeprOpts) (*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 InstanceIDResp ¶
type InstanceIDResp struct {
InstanceID string `json:"instance_id"`
}
InstanceIDResp response
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*InstanceIDResp, error)
Create an instance with given parameters. Send POST to /v2/{engine}/{project_id}/instances
type KafkaConfig ¶
type ListOpts ¶
type ListOpts struct {
// Message engine. Value: kafka.
// Default: kafka
Engine string `q:"engine,omitempty"`
// Instance name.
Name string `q:"name,omitempty"`
// Instance ID.
InstanceId string `q:"instance_id,omitempty"`
// Instance status. For details, see Instance Status.
Status string `q:"status,omitempty"`
// Indicates whether to return the number of instances that fail to be created.
// If the value is true, the number of instances that failed to be created is returned. If the value is false, the number is not returned.
IncludeFailure string `q:"include_failure,omitempty"`
// Whether to search for the instance that precisely matches a specified instance name.
// The default value is false*, indicating that a fuzzy search is performed based on a specified instance name. If the value is true, the instance that precisely matches a specified instance name is queried.
ExactMatchName string `q:"exact_match_name,omitempty"`
// Offset, which is the position where the query starts. The value must be greater than or equal to 0.
Offset string `q:"offset,omitempty"`
// Maximum number of instances returned in the current query. The default value is 10. The value ranges from 1 to 50.
Limit string `q:"limit,omitempty"`
}
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 ResultResp ¶
type UpdateInstanceConfOpts ¶
type UpdateInstanceConfOpts struct {
// Configurations to be modified.
KafkaConfigs []KafkaConfig `json:"kafka_configs,omitempty"`
}
UpdateInstanceConfOpts is a struct which represents the parameters of update function
type UpdateInstanceConfResp ¶
type UpdateInstanceConfResp struct {
// Configuration modification task ID.
JobID string `json:"job_id"`
// Number of dynamic configuration parameters to be modified.
DynamicConfig int `json:"dynamic_config"`
// Number of static configuration parameters to be modified.
StaticConfig int `json:"static_config"`
}
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