specification

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: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendProductIOS

type ExtendProductIOS struct {
	// Storage I/O specification.
	IOSpec string `json:"io_spec"`
	// AZs where there are available resources.
	AvailableZones []string `json:"available_zones"`
	// I/O type.
	Type string `json:"type"`
	// AZs where resources are sold out.
	UnavailableZones []string `json:"unavailable_zones"`
}

type ExtendProductInfo

type ExtendProductInfo struct {
	// Instance type.
	Type string `json:"type"`
	// Product ID.
	ProductId string `json:"product_id"`
	// ECS flavor used by the product.
	ECSFlavorId string `json:"ecs_flavor_id"`
	// Supported CPU architectures.
	ArchTypes []string `json:"arch_types"`
	// Supported billing modes.
	ChargingMode []string `json:"charging_mode"`
	// Disk I/O information.
	IOS []*ExtendProductIOS `json:"ios"`
	// Supported features.
	SupportFeatures []*SupportFeature `json:"support_features"`
	// Product specification description.
	Properties Properties `json:"properties"`
	// AZs where there are available resources.
	AvailableZones []string `json:"available_zones"`
	// AZs where resources are sold out.
	UnavailableZones []string `json:"unavailable_zones"`
}

type GetSpecOpts

type GetSpecOpts struct {
	// Message engine.
	Engine string
	// Product edition.
	//    advanced: premium edition
	Type string `q:"type,omitempty"`
}

type IncreaseSpecOpts

type IncreaseSpecOpts struct {
	// Message engine.
	Engine string `json:"-" required:"true"`
	// Type of the change.
	// Value:
	//    storage: Expand the storage space without adding brokers.
	//    horizontal: Add brokers without resizing the storage space of each broker.
	//    vertical: Modify the underlying flavor of brokers without adding brokers or storage space.
	OperType string `json:"oper_type" required:"true"`
	// New storage space.
	// This parameter is valid and mandatory when oper_type is set to storage or horizontal.
	// Instance storage space = Number of brokers x Storage space of each broker.
	// If oper_type is set to storage, the number of brokers remains unchanged, and the storage space of each broker must be expanded by at least 100 GB.
	// If oper_type is set to horizontal, the storage space of each broker remains unchanged.
	NewStorageSpace *int `json:"new_storage_space,omitempty"`
	// This parameter is valid only when oper_type is set to horizontal.
	// A maximum of 30 brokers are supported.
	NewBrokerNumber *int `json:"new_broker_num,omitempty"`
	// New product ID for scale-up.
	// This parameter is valid and mandatory when oper_type is set to vertical.
	// Obtain the product ID from Querying Product Specifications List.
	NewProductId string `json:"new_product_id,omitempty"`
	// ID of the EIP bound to the instance.
	// Use commas (,) to separate multiple EIP IDs.
	// This parameter is mandatory when oper_type is set to horizontal.
	PublicIpId string `json:"publicip_id,omitempty"`
	// Specified IPv4 private IP addresses.
	// The number of specified IP addresses must be less than or equal to the number of new brokers.
	// If the number of specified IP addresses is less than the number of brokers, the unspecified brokers are randomly assigned private IP addresses.
	TenantIps []string `json:"tenant_ips,omitempty"`
	// ID of the standby subnet used by new brokers in instance expansion.
	// This value is transferred when a standby subnet is used in instance expansion.
	// Contact customer service to use the value.
	SecondTenantSubnetId string `json:"second_tenant_subnet_id,omitempty"`
}

type IncreaseSpecResp

type IncreaseSpecResp struct {
	// ID of the specification modification task.
	JobId string `json:"job_id"`
}

func IncreaseSpec

func IncreaseSpec(client *golangsdk.ServiceClient, instanceId string, opts IncreaseSpecOpts) (*IncreaseSpecResp, error)

IncreaseSpec is used to modify instance specifications. Send POST /v2/{engine}/{project_id}/instances/{instance_id}/extend

type Properties

type Properties struct {
	// Maximum number of partitions of each broker.
	MaxPartitionPerBroker string `json:"max_partition_per_broker"`
	// Maximum number of brokers.
	MaxBroker string `json:"max_broker"`
	// Maximum storage space of each broker. The unit is GB.
	MaxStoragePerNode string `json:"max_storage_per_node"`
	// Maximum number of consumers of each broker.
	MaxConsumerPerBroker string `json:"max_consumer_per_broker"`
	// Minimum number of brokers.
	MinBroker string `json:"min_broker"`
	// Maximum bandwidth of each broker.
	MaxBandwidthPerBroker string `json:"max_bandwidth_per_broker"`
	// Minimum storage space of each broker. The unit is GB.
	MinStoragePerNode string `json:"min_storage_per_node"`
	// Maximum TPS of each broker.
	MaxTPSPerBroker string `json:"max_tps_per_broker"`
	// Alias of product_id.
	ProductAlias string `json:"product_alias"`
}

type SpecResp

type SpecResp struct {
	// Message engine: Kafka.
	Engine string `json:"engine"`
	// Versions supported by the message engine.
	Versions []string `json:"versions"`
	// Product information for specification modification.
	Products []ExtendProductInfo `json:"products"`
}

func GetSpec

func GetSpec(client *golangsdk.ServiceClient, instanceId string, opts GetSpecOpts) (*SpecResp, error)

GetSpec is used to query the product information for instance specification modification. Send GET /v2/{engine}/{project_id}/instances/{instance_id}/extend

type SupportFeature

type SupportFeature struct {
	// Feature name.
	Name string `json:"name"`
	// Key-value pair of a feature.
	Properties map[string]string `json:"properties"`
}

Jump to

Keyboard shortcuts

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