Documentation ¶
Index ¶
- func List(client *golangsdk.ServiceClient, opts ListOpsBuilder) pagination.Pager
- func Resize(client *golangsdk.ServiceClient, id string, opts ResizeInstanceOpts) (string, error)
- type AutoTopicOpts
- type AutoTopicResult
- type BssParam
- type ConfigParam
- type Connection
- type CreateOps
- type CreateOpsBuilder
- type CreateResult
- type CrossVpc
- type CrossVpcUpdateOpts
- type DeleteResult
- type GetConfigurationResp
- type GetConfigurationResult
- type GetResult
- type GetTaskResp
- type GetTasksResult
- type Instance
- type InstanceCreate
- type KafkaConfigs
- type KafkaParam
- type ListOpsBuilder
- type ListOpts
- type ListResponse
- type ModifyConfigurationResp
- type ModifyConfigurationResult
- type Page
- type PortProtocols
- type RebootResp
- type RebootResult
- type ResetPasswordOpts
- type ResetPasswordOptsBuilder
- type ResetPasswordResult
- type ResizeInstanceOpts
- type RestartInstanceOpts
- type Result
- type Task
- type TaskParams
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *golangsdk.ServiceClient, opts ListOpsBuilder) pagination.Pager
func Resize ¶
func Resize(client *golangsdk.ServiceClient, id string, opts ResizeInstanceOpts) (string, error)
Types ¶
type AutoTopicOpts ¶
type AutoTopicOpts struct { // Indicates whether to enable automatic topic creation. EnableAutoTopic *bool `json:"enable_auto_topic" required:"true"` }
AutoTopicOpts is a struct which represents the parameter of UpdateAutoTopic function
type AutoTopicResult ¶
AutoTopicResult is a struct that contains all the return parameters of UpdateAutoTopic function
func UpdateAutoTopic ¶
func UpdateAutoTopic(client *golangsdk.ServiceClient, id string, opts AutoTopicOpts) (r AutoTopicResult)
UpdateAutoTopic is used to enable or disable automatic topic creation. via accessing to the service with POST method and parameters
type BssParam ¶
type BssParam struct { // Indicates the charging mode of the instance. ChargingMode string `json:"charging_mode" required:"true"` // Indicates the charging period unit of the instance PeriodType string `json:"period_type,omitempty"` // Indicates the charging period of the instance. PeriodNum int `json:"period_num,omitempty"` // Indicates whether auto renew is enabled. IsAutoRenew *bool `json:"is_auto_renew,omitempty"` // Indicates whether the order is automatically or manually paid. IsAutoPay *bool `json:"is_auto_pay,omitempty"` }
type ConfigParam ¶
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 CreateOps ¶
type CreateOps 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 brokers in a Kafka instance. BrokerNum int `json:"broker_num,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"` // Whether to enable the IPv6. Ipv6Enable bool `json:"ipv6_enable,omitempty"` // 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"` // CPU architecture. ArchType string `json:"arch_type,omitempty"` // Indicates the username for logging in to the Kafka Manager. // The username consists of 4 to 64 characters and can contain //letters, digits, hyphens (-), and underscores (_). KafkaManagerUser string `json:"kafka_manager_user,omitempty"` // Indicates the password for logging in to the Kafka Manager. // The password must meet the following complexity requirements: // Must be a string consisting of 8 to 32 characters. // Contains at least three of the following characters: // Lowercase letters // Uppercase letters // Digits // Special characters `~!@#$%^&*()-_=+\|[{}];:',<.>/? KafkaManagerPassword string `json:"kafka_manager_password,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 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"` // Whether to enable vpc client plain VpcClientPlain bool `json:"vpc_client_plain,omitempty"` // Indicates the protocol to use after SASL is enabled. KafkaSecurityProtocol string `json:"kafka_security_protocol,omitempty"` // Indicates the authentication mechanisms to use after SASL is enabled. 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 dumping. ConnectorEnalbe bool `json:"connector_enable,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 the enterprise project ID. EnterpriseProjectID string `json:"enterprise_project_id,omitempty"` // Indicates the tags of the instance Tags []tags.ResourceTag `json:"tags,omitempty"` // Indicates the parameter related to the yearly/monthly billing mode. BssParam BssParam `json:"bss_param,omitempty"` }
CreateOps is a struct that contains all the parameters.
func (CreateOps) ToInstanceCreateMap ¶
ToInstanceCreateMap is used for type convert
type CreateOpsBuilder ¶
CreateOpsBuilder is used for creating instance parameters. any struct providing the parameters should implement this interface
type CreateResult ¶
CreateResult is a struct that contains all the return parameters of creation
func Create ¶
func Create(client *golangsdk.ServiceClient, ops CreateOpsBuilder) (r CreateResult)
Create an instance with given parameters.
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*InstanceCreate, error)
Extract from CreateResult
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 DeleteResult ¶
DeleteResult is a struct which contains the result of deletion
func Delete ¶
func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)
Delete an instance by id
type GetConfigurationResp ¶
type GetConfigurationResp struct {
KafkaConfigs []KafkaParam `json:"kafka_configs"`
}
type GetConfigurationResult ¶
type GetConfigurationResult struct {
// contains filtered or unexported fields
}
func GetConfigurations ¶
func GetConfigurations(c *golangsdk.ServiceClient, instanceID string) (r GetConfigurationResult)
func (GetConfigurationResult) Extract ¶
func (r GetConfigurationResult) Extract() (*GetConfigurationResp, error)
type GetResult ¶
GetResult contains the body of getting detailed
type GetTaskResp ¶
type GetTaskResp struct {
Tasks []TaskParams `json:"tasks"`
}
type GetTasksResult ¶
type GetTasksResult struct {
// contains filtered or unexported fields
}
func GetTask ¶
func GetTask(c *golangsdk.ServiceClient, instanceID, taskID string) (r GetTasksResult)
func GetTasks ¶
func GetTasks(c *golangsdk.ServiceClient, instanceID string) (r GetTasksResult)
func (GetTasksResult) Extract ¶
func (r GetTasksResult) Extract() (*GetTaskResp, error)
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"` OrderID string `json:"order_id"` 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"` KafkaSecurityProtocol string `json:"kafka_security_protocol"` SaslEnabledMechanisms []string `json:"sasl_enabled_mechanisms"` EnterpriseProjectID string `json:"enterprise_project_id"` IsLogicalVolume bool `json:"is_logical_volume"` ExtendTimes int `json:"extend_times"` EnableAutoTopic bool `json:"enable_auto_topic"` 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"` 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"` KafkaManagerUser string `json:"kafka_manager_user"` EnableLogCollect bool `json:"enable_log_collection"` CrossVpcInfo string `json:"cross_vpc_info"` Ipv6Enable bool `json:"ipv6_enable"` Ipv6ConnectAddresses []string `json:"ipv6_connect_addresses"` ConnectorEnalbe bool `json:"connector_enable"` ConnectorID string `json:"connector_id"` ConnectorNodeNum int `json:"connector_node_num"` RestEnable bool `json:"rest_enable"` RestConnectAddress string `json:"rest_connect_address"` MessageQueryInstEnable bool `json:"message_query_inst_enable"` VpcClientPlain bool `json:"vpc_client_plain"` SupportFeatures string `json:"support_features"` Task Task `json:"task"` TraceEnable bool `json:"trace_enable"` PodConnectAddress string `json:"pod_connect_address"` DiskEncrypted bool `json:"disk_encrypted"` KafkaPrivateConnectAddress string `json:"kafka_private_connect_address"` CesVersion string `json:"ces_version"` AccessUser string `json:"access_user"` Tags []tags.ResourceTag `json:"tags"` CertReplaced bool `json:"cert_replaced"` SslTwoWayEnable bool `json:"ssl_two_way_enable"` PortProtocols PortProtocols `json:"port_protocols"` }
Instance response
type InstanceCreate ¶
type InstanceCreate struct {
InstanceID string `json:"instance_id"`
}
InstanceCreate response
type KafkaConfigs ¶
type KafkaConfigs struct {
KafkaConfigs []ConfigParam `json:"kafka_configs"`
}
type KafkaParam ¶
type ListOpsBuilder ¶
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"` EnterpriseProjectID string `q:"enterprise_project_id"` }
func (ListOpts) ToListDetailQuery ¶
type ListResponse ¶
type ListResponse struct { Instances []Instance `json:"instances"` TotalCount int `json:"instance_num"` }
func ExtractInstances ¶
func ExtractInstances(r pagination.Page) (ListResponse, error)
ExtractCloudServers is a function that takes a ListResult and returns the services' information.
type ModifyConfigurationResp ¶
type ModifyConfigurationResult ¶
type ModifyConfigurationResult struct {
// contains filtered or unexported fields
}
func ModifyConfiguration ¶
func ModifyConfiguration(c *golangsdk.ServiceClient, instanceID string, opts KafkaConfigs) (r ModifyConfigurationResult)
func (ModifyConfigurationResult) Extract ¶
func (r ModifyConfigurationResult) Extract() (*ModifyConfigurationResp, error)
type Page ¶
type Page struct {
pagination.SinglePageBase
}
type PortProtocols ¶
type PortProtocols struct { PrivatePlainEnable bool `json:"private_plain_enable"` PrivatePlainAddress string `json:"private_plain_address"` PrivatePlainDomainName string `json:"private_plain_domain_name"` PrivateSaslSslEnable bool `json:"private_sasl_ssl_enable"` PrivateSaslSslAddress string `json:"private_sasl_ssl_address"` PrivateSaslSslDomainName string `json:"private_sasl_ssl_domain_name"` PrivateSaslPlaintextEnable bool `json:"private_sasl_plaintext_enable"` PrivateSaslPlaintextAddress string `json:"private_sasl_plaintext_address"` PrivateSaslPlaintextDomainName string `json:"private_sasl_plaintext_domain_name"` PublicPlainEnable bool `json:"public_plain_enable"` PublicPlainAddress string `json:"public_plain_address"` PublicPlainDomainName string `json:"public_plain_domain_name"` PublicSaslSslEnable bool `json:"public_sasl_ssl_enable"` PublicSaslSslAddress string `json:"public_sasl_ssl_address"` PublicSaslSslDomainName string `json:"public_sasl_ssl_domain_name"` PublicSaslPlaintextEnable bool `json:"public_sasl_plaintext_enable"` PublicSaslPlaintextAddress string `json:"public_sasl_plaintext_address"` PublicSaslPlaintextDomainName string `json:"public_sasl_plaintext_domain_name"` }
type RebootResp ¶
type RebootResp struct {
Results []Result `json:"results"`
}
type RebootResult ¶
type RebootResult struct {
// contains filtered or unexported fields
}
func RebootInstance ¶
func RebootInstance(c *golangsdk.ServiceClient, params RestartInstanceOpts) (r RebootResult)
func (RebootResult) Extract ¶
func (r RebootResult) Extract() (*RebootResp, error)
type ResetPasswordOpts ¶
type ResetPasswordOpts struct { // Indicates the new password of an instance. NewPassword string `json:"new_password" required:"true"` }
ResetPasswordOpts is a struct which represents the parameter of ResetPassword function
func (ResetPasswordOpts) ToResetPasswordMap ¶
func (opts ResetPasswordOpts) ToResetPasswordMap() (map[string]interface{}, error)
ToResetPasswordMap is used for type convert
type ResetPasswordOptsBuilder ¶
ResetPasswordOptsBuilder is an interface which can build the map parameter of ResetPassword function
type ResetPasswordResult ¶
ResetPasswordResult is a struct that contains all the return parameters of ResetPassword function
func ResetPassword ¶
func ResetPassword(client *golangsdk.ServiceClient, id string, opts ResetPasswordOptsBuilder) (r ResetPasswordResult)
ResetPassword is used to reset password for the instance via accessing to the service with POST method and parameters
type ResizeInstanceOpts ¶
type ResizeInstanceOpts struct { NewSpecCode *string `json:"new_spec_code,omitempty"` NewStorageSpace *int `json:"new_storage_space,omitempty"` OperType *string `json:"oper_type,omitempty"` NewBrokerNum *int `json:"new_broker_num,omitempty"` NewProductID *string `json:"new_product_id,omitempty"` PublicIpID *string `json:"publicip_id,omitempty"` TenantIps []string `json:"tenant_ips,omitempty"` }
type RestartInstanceOpts ¶
type TaskParams ¶
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"` // Indicates the enterprise project ID. EnterpriseProjectID string `json:"enterprise_project_id,omitempty"` }
UpdateOpts is a struct which represents the parameters of update function
func (UpdateOpts) ToInstanceUpdateMap ¶
func (opts UpdateOpts) ToInstanceUpdateMap() (map[string]interface{}, error)
ToInstanceUpdateMap is used for type convert
type UpdateOptsBuilder ¶
UpdateOptsBuilder is an interface which can build the map paramter of update function
type UpdateResult ¶
UpdateResult is a struct from which can get the result of update method
func Update ¶
func Update(client *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)
Update is a method which can be able to update the instance via accessing to the service with Put method and parameters