client

package
v0.0.0-...-75a74b8 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InstanceDeleteMode = "terminate"
	KeepInstance       = false
)

Functions

This section is empty.

Types

type ASClient

type ASClient struct {
	// contains filtered or unexported fields
}

func GetASClient

func GetASClient(credential *tccommon.Credential, region, language string) (*ASClient, error)

func (ASClient) GetAutoScalingGroups

func (a ASClient) GetAutoScalingGroups(scalingGroupId *string) (*asapi.AutoScalingGroup, error)

func (ASClient) GetLaunchConfigurations

func (a ASClient) GetLaunchConfigurations(launchConfigurationId *string) (*asapi.LaunchConfiguration, error)

type CBSClient

type CBSClient struct {
	// contains filtered or unexported fields
}

func GetCBSClient

func GetCBSClient(credential *tccommon.Credential, region, language string) (*CBSClient, error)

func (CBSClient) GetDiskConfigQuota

func (c CBSClient) GetDiskConfigQuota(cvm *CVMClient, zoneId, instanceType string) (*cbsapi.DescribeDiskConfigQuotaResponse, error)

GetDiskConfigQuota resolves optional instanceType to an instance family via cvm, then queries CBS disk config quota for zoneId. zoneId is required. When instanceType is set but not found in the zone (e.g. sold out), returns an empty DiskConfigSet.

func (CBSClient) GetDiskConfigQuotaWithOptions

func (c CBSClient) GetDiskConfigQuotaWithOptions(zoneId string, instanceFamilies []string) (*cbsapi.DescribeDiskConfigQuotaResponse, error)

GetDiskConfigQuotaWithOptions returns disk configs for the given zone and optionally filtered by instance families. When instanceFamilies is nil or empty, returns all disk configs in the zone. When instanceFamilies is non-empty, returns only disk configs compatible with those instance families

type CVMClient

type CVMClient struct {
	// contains filtered or unexported fields
}

func GetCVMClient

func GetCVMClient(credential *tccommon.Credential, region, language string) (*CVMClient, error)

func (CVMClient) GetInstanceFamilyForZoneAndInstanceType

func (c CVMClient) GetInstanceFamilyForZoneAndInstanceType(zoneId, instanceType string) (string, error)

GetInstanceFamilyForZoneAndInstanceType returns the InstanceFamily (e.g. SA2, S5) for the given zone and instance type. Used to filter disk configs by instance family compatibility. Returns empty string if the instance type is not available in the zone (e.g. sold out).

func (CVMClient) GetInstanceTypeConfigs

func (c CVMClient) GetInstanceTypeConfigs() (*cvmapi.DescribeInstanceTypeConfigsResponse, error)

func (CVMClient) GetInstances

func (c CVMClient) GetInstances(clusterId string) (*cvmapi.DescribeInstancesResponse, error)

func (CVMClient) GetKeyPairs

func (c CVMClient) GetKeyPairs() (*cvmapi.DescribeKeyPairsResponse, error)

func (CVMClient) GetZoneInstanceConfigInfos

func (c CVMClient) GetZoneInstanceConfigInfos() (*cvmapi.DescribeZoneInstanceConfigInfosResponse, error)

func (CVMClient) GetZones

func (c CVMClient) GetZones() (*cvmapi.DescribeZonesResponse, error)

type TKEClient

type TKEClient struct {
	// contains filtered or unexported fields
}

func GetTKEClient

func GetTKEClient(credential *tccommon.Credential, region, language string) (*TKEClient, error)

func (TKEClient) CheckClusterCIDR

func (t TKEClient) CheckClusterCIDR(vpcId, clusterCIDR string) (*tkeapifull.CheckClusterCIDRBody, error)

CheckClusterCIDR checks whether the given CIDR conflicts with the VPC, other clusters in the same VPC, or VPC global routes. Uses CommonRequest because the tencentcloud-sdk-go version bundled here does not include the CheckClusterCIDR method in its generated client.

func (TKEClient) CheckInstancesUpgradeAble

func (t TKEClient) CheckInstancesUpgradeAble(clusterId, upgradeType string) ([]string, error)

CheckInstancesUpgradeAble returns the instance IDs of cluster nodes that can be upgraded to match the current master version using the given upgradeType. upgradeType: "major" for in-place major-version upgrade, "hot" for minor-version hot upgrade. Returns an empty slice when all nodes are already at the target version.

func (TKEClient) CreateCluster

func (t TKEClient) CreateCluster(spec tkev1.TKEClusterConfigSpec) (*string, error)

func (TKEClient) CreateClusterEndpoints

func (t TKEClient) CreateClusterEndpoints(spec tkev1.TKEClusterConfigSpec, extranet bool) error

func (TKEClient) CreateClusterInstances

func (t TKEClient) CreateClusterInstances() (*tkeapi.CreateClusterInstancesResponse, error)

func (TKEClient) CreateClusterNodePool

func (t TKEClient) CreateClusterNodePool(clusterId string, nodePool tkev1.NodePoolDetail) (*string, error)

func (TKEClient) CreateClusterVirtualNodePool

func (t TKEClient) CreateClusterVirtualNodePool(clusterId string, pool tkev1.VirtualNodePoolDetail) (*string, error)

func (TKEClient) DeleteCluster

func (t TKEClient) DeleteCluster(clusterId string) error

func (TKEClient) DeleteClusterInstances

func (t TKEClient) DeleteClusterInstances() (*tkeapi.DeleteClusterInstancesResponse, error)

func (TKEClient) DeleteClusterVirtualNodePool

func (t TKEClient) DeleteClusterVirtualNodePool(clusterId string, nodePoolIds []*string, force bool) error

func (TKEClient) DeleteNodePool

func (t TKEClient) DeleteNodePool(clusterId string, nodePoolIds []*string) error

func (TKEClient) DisableClusterDeletionProtection

func (t TKEClient) DisableClusterDeletionProtection(clusterID string) error

DisableClusterDeletionProtection disables deletion protection for the given cluster.

func (TKEClient) EnableClusterDeletionProtection

func (t TKEClient) EnableClusterDeletionProtection(clusterID string) error

EnableClusterDeletionProtection enables deletion protection for the given cluster.

func (TKEClient) GetCluster

func (t TKEClient) GetCluster(clusterId string) (*tkeapi.Cluster, error)

func (TKEClient) GetClusterEndpointStatus

func (t TKEClient) GetClusterEndpointStatus(clusterId string, extranet bool) (*string, error)

func (TKEClient) GetClusterEndpoints

func (t TKEClient) GetClusterEndpoints(clusterId string) (*tkeapi.DescribeClusterEndpointsResponse, error)

func (TKEClient) GetClusterInstances

func (t TKEClient) GetClusterInstances(clusterId string) ([]*tkeapi.Instance, error)

func (TKEClient) GetClusterKubeconfig

func (t TKEClient) GetClusterKubeconfig(clusterId string, extranet bool) (*string, error)

func (TKEClient) GetClusterLevelAttribute

func (t TKEClient) GetClusterLevelAttribute() (*tkeapi.DescribeClusterLevelAttributeResponse, error)

func (TKEClient) GetClusterNodePools

func (t TKEClient) GetClusterNodePools(clusterId string) ([]*tkeapi.NodePool, error)

func (TKEClient) GetClusterStatus

func (t TKEClient) GetClusterStatus(clusterId *string) (*tkeapi.ClusterStatus, error)

func (TKEClient) GetClusterVirtualNodePools

func (t TKEClient) GetClusterVirtualNodePools(clusterId string) ([]*tkeapi.VirtualNodePool, error)

func (TKEClient) GetClusterVirtualNodePoolsFull

func (t TKEClient) GetClusterVirtualNodePoolsFull(clusterId string) ([]tkeapifull.VirtualNodePool, error)

GetClusterVirtualNodePoolsFull calls DescribeClusterVirtualNodePools via CommonRequest and parses the full JSON (including SecurityGroupIds, DeletionProtection, OS, etc. missing from generated SDK models).

func (TKEClient) GetClusterVirtualNodes

func (t TKEClient) GetClusterVirtualNodes(clusterId string, nodePoolId string) ([]*tkeapi.VirtualNode, error)

func (TKEClient) GetClusters

func (t TKEClient) GetClusters() (*tkeapi.DescribeClustersResponse, error)

func (TKEClient) GetImages

func (t TKEClient) GetImages() (*tkeapi.DescribeOSImagesResponse, error)

GetImages lists TKE node OS images via DescribeOSImages (not DescribeImages, which targets container image instances).

func (TKEClient) GetRegions

func (t TKEClient) GetRegions() (*tkeapi.DescribeRegionsResponse, error)

func (TKEClient) GetUpgradeInstanceProgress

func (t TKEClient) GetUpgradeInstanceProgress(clusterId string) (string, error)

GetUpgradeInstanceProgress returns the lifeState of the latest node upgrade task for the cluster. Possible lifeState values: "pending", "process", "paused", "pauing", "done", "timeout", "aborted". Returns ("", err) when the API call fails (e.g., no upgrade task has ever been created).

func (TKEClient) GetVersions

func (t TKEClient) GetVersions() (*tkeapi.DescribeVersionsResponse, error)

func (TKEClient) ModifyClusterAttribute

func (t TKEClient) ModifyClusterAttribute(configSpec *tkev1.TKEClusterConfigSpec, upstreamBasicSettings *tkev1.ClusterBasicSettings) (*tkeapi.ModifyClusterAttributeResponse, error)

ModifyClusterAttribute updates mutable cluster attributes. upstreamBasicSettings is used to suppress fields that the TKE API rejects when the value is identical to the current upstream value (e.g. ClusterLevel).

func (TKEClient) ModifyClusterNodePool

func (t TKEClient) ModifyClusterNodePool(clusterId string, nodePool tkev1.NodePoolDetail) error

func (TKEClient) ModifyClusterVirtualNodePool

func (t TKEClient) ModifyClusterVirtualNodePool(clusterId string, nodePoolId string, fields *utils.VirtualNodePoolModifyFields) (appliedChange bool, err error)

ModifyClusterVirtualNodePool calls the TKE API when fields is non-empty. The bool is true when the API accepted a change that may apply asynchronously; false when there was nothing to send or the cloud reported no effective change ("nothing is updated").

func (TKEClient) ModifyNodePoolDesiredCapacityAboutAsg

func (t TKEClient) ModifyNodePoolDesiredCapacityAboutAsg(clusterId, nodePoolId string, DesiredCapacity int64) error

func (TKEClient) ModifyNodePoolInstanceTypes

func (t TKEClient) ModifyNodePoolInstanceTypes(clusterId, nodePoolId, instanceType string) error

func (TKEClient) UpdateClusterVersion

func (t TKEClient) UpdateClusterVersion(configSpec *tkev1.TKEClusterConfigSpec) (*tkeapi.UpdateClusterVersionResponse, error)

func (TKEClient) UpgradeClusterInstances

func (t TKEClient) UpgradeClusterInstances(clusterId, upgradeType string, instanceIds []string) error

UpgradeClusterInstances starts a node version upgrade task for the given instances. upgradeType: "major" for in-place major-version upgrade, "hot" for minor-version hot upgrade. Operation is always "create" to initiate a new upgrade task.

type VPCClient

type VPCClient struct {
	// contains filtered or unexported fields
}

func GetVPCClient

func GetVPCClient(credential *tccommon.Credential, region, language string) (*VPCClient, error)

func (VPCClient) GetSecurityGroups

func (v VPCClient) GetSecurityGroups() (*vpcapi.DescribeSecurityGroupsResponse, error)

func (VPCClient) GetSubnets

func (v VPCClient) GetSubnets() (*vpcapi.DescribeSubnetsResponse, error)

func (VPCClient) GetVPCs

func (v VPCClient) GetVPCs() (*vpcapi.DescribeVpcsResponse, error)

Jump to

Keyboard shortcuts

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