common

package
v1.81.61 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CVM_CHARGE_TYPE_PREPAID  = "PREPAID"
	CVM_CHARGE_TYPE_POSTPAID = "POSTPAID_BY_HOUR"
	CVM_CHARGE_TYPE_SPOTPAID = "SPOTPAID"
	CVM_CHARGE_TYPE_CDHPAID  = "CDHPAID"

	CVM_INTERNET_CHARGE_TYPE_BANDWIDTH_PREPAID  = "BANDWIDTH_PREPAID"
	CVM_INTERNET_CHARGE_TYPE_BANDWIDTH_POSTPAID = "BANDWIDTH_POSTPAID_BY_HOUR"
	CVM_INTERNET_CHARGE_TYPE_BANDWIDTH_PACKAGE  = "BANDWIDTH_PACKAGE"
	CVM_INTERNET_CHARGE_TYPE_TRAFFIC_POSTPAID   = "TRAFFIC_POSTPAID_BY_HOUR"

	CVM_STATUS_RUNNING       = "RUNNING"
	CVM_STATUS_STOPPED       = "STOPPED"
	CVM_STATUS_SHUTDOWN      = "SHUTDOWN"
	CVM_STATUS_TERMINATING   = "TERMINATING"
	CVM_STATUS_LAUNCH_FAILED = "LAUNCH_FAILED"

	CVM_LATEST_OPERATION_STATE_OPERATING = "OPERATING"
	CVM_LATEST_OPERATION_STATE_SUCCESS   = "SUCCESS"
	CVM_LATEST_OPERATION_STATE_FAILED    = "FAILED"

	CVM_PREPAID_RENEW_FLAG_NOTIFY_NOTIFY_AND_AUTO_RENEW    = "NOTIFY_AND_AUTO_RENEW"
	CVM_PREPAID_RENEW_FLAG_NOTIFY_AND_MANUAL_RENEW         = "NOTIFY_AND_MANUAL_RENEW"
	CVM_PREPAID_RENEW_FLAG_DISABLE_NOTIFY_AND_MANUAL_RENEW = "DISABLE_NOTIFY_AND_MANUAL_RENEW"

	CVM_DISK_TYPE_LOCAL_BASIC   = "LOCAL_BASIC"
	CVM_DISK_TYPE_LOCAL_SSD     = "LOCAL_SSD"
	CVM_DISK_TYPE_CLOUD_BASIC   = "CLOUD_BASIC"
	CVM_DISK_TYPE_CLOUD_SSD     = "CLOUD_SSD"
	CVM_DISK_TYPE_CLOUD_PREMIUM = "CLOUD_PREMIUM"
	CVM_DISK_TYPE_CLOUD_BSSD    = "CLOUD_BSSD"
	CVM_DISK_TYPE_CLOUD_HSSD    = "CLOUD_HSSD"
	CVM_DISK_TYPE_CLOUD_TSSD    = "CLOUD_TSSD"

	CVM_PLACEMENT_GROUP_TYPE_HOST = "HOST"
	CVM_PLACEMENT_GROUP_TYPE_SW   = "SW"
	CVM_PLACEMENT_GROUP_TYPE_RACK = "RACK"

	ZONE_STATE_AVAILABLE   = "AVAILABLE"
	ZONE_STATE_UNAVAILABLE = "UNAVAILABLE"

	CVM_NOT_FOUND_ERROR        = "InvalidInstanceId.NotFound"
	KEY_PAIR_NOT_SUPPORT_ERROR = "InvalidParameterValue.KeyPairNotSupported"
	KYE_PAIR_INVALID_ERROR     = "InvalidKeyPair"

	CVM_SPOT_INSTANCE_TYPE_ONE_TIME = "ONE-TIME"

	CVM_MARKET_TYPE_SPOT = "spot"

	CVM_IMAGE_LOGIN     = "TRUE"
	CVM_IMAGE_LOGIN_NOT = "FALSE"

	// @Deprecated use cvm.INVALIDPARAMETERVALUE_ZONENOTSUPPORTED
	CVM_ZONE_NOT_SUPPORT_ERROR = "InvalidParameterValue.ZoneNotSupported"
	// @Deprecated use cvm.RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT instead
	CVM_CLOUD_DISK_SOLD_OUT_ERROR = "ResourceInsufficient.CloudDiskSoldOut"

	CVM_STOP_MODE_KEEP_CHARGING   = "KEEP_CHARGING"
	CVM_STOP_MODE_STOP_CHARGING   = "STOP_CHARGING"
	CVM_SELL_STATUS               = "SELL"
	CVM_SOLD_OUT_STATUS           = "SOLD_OUT"
	MIDLINE                       = "-"
	UNDERLINE                     = "_"
	IMAGE_SHARE_PERMISSION_SHARE  = "SHARE"
	IMAGE_SHARE_PERMISSION_CANCEL = "CANCEL"
)

Variables

View Source
var CVM_PREPAID_PERIOD = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36}
View Source
var CVM_RETRYABLE_ERROR = []string{

	"ClientError.HttpStatusCodeError",
}

Only client error can cvm retry, others will directly returns

View Source
var CVM_SPOT_INSTANCE_TYPE = []string{
	CVM_SPOT_INSTANCE_TYPE_ONE_TIME,
}

Functions

func DataSourceTencentCloudAvailabilityRegions

func DataSourceTencentCloudAvailabilityRegions() *schema.Resource

func DataSourceTencentCloudAvailabilityZones

func DataSourceTencentCloudAvailabilityZones() *schema.Resource

func DataSourceTencentCloudAvailabilityZonesByProduct

func DataSourceTencentCloudAvailabilityZonesByProduct() *schema.Resource

Types

type APIService

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

func (*APIService) DescribeZonesWithProduct

func (me *APIService) DescribeZonesWithProduct(ctx context.Context, product string) (zones []*api.ZoneInfo, errRet error)

type CvmService

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

func (*CvmService) BindKeyPair

func (me *CvmService) BindKeyPair(ctx context.Context, keyIds []*string, instanceId string) error

func (*CvmService) CreatePlacementGroup

func (me *CvmService) CreatePlacementGroup(ctx context.Context, placementName, placementType string) (placementId string, errRet error)

func (*CvmService) CreateReservedInstance

func (me *CvmService) CreateReservedInstance(ctx context.Context, configId string, count int64, extendParams map[string]interface{}) (instanceId string, errRet error)

func (*CvmService) CvmChcInstanceDeployVpcStateRefreshFunc

func (me *CvmService) CvmChcInstanceDeployVpcStateRefreshFunc(chcId string, failStates []string) resource.StateRefreshFunc

func (*CvmService) CvmChcInstanceStateRefreshFunc

func (me *CvmService) CvmChcInstanceStateRefreshFunc(chcId string, failStates []string) resource.StateRefreshFunc

func (*CvmService) CvmSyncImagesStateRefreshFunc

func (me *CvmService) CvmSyncImagesStateRefreshFunc(imageId string, failStates []string) resource.StateRefreshFunc

func (*CvmService) DeleteCvmChcAssistVpcById

func (me *CvmService) DeleteCvmChcAssistVpcById(ctx context.Context, chcId string) (errRet error)

func (*CvmService) DeleteCvmHpcClusterById

func (me *CvmService) DeleteCvmHpcClusterById(ctx context.Context, hpcClusterId string) (errRet error)

func (*CvmService) DeleteCvmLaunchTemplateById

func (me *CvmService) DeleteCvmLaunchTemplateById(ctx context.Context, launchTemplateId string) (errRet error)

func (*CvmService) DeleteCvmLaunchTemplateVersionById

func (me *CvmService) DeleteCvmLaunchTemplateVersionById(ctx context.Context, launchTemplateId, launchTemplateVersionNumber string) (errRet error)

func (*CvmService) DeleteImage

func (me *CvmService) DeleteImage(ctx context.Context, imageId string) error

func (*CvmService) DeleteInstance

func (me *CvmService) DeleteInstance(ctx context.Context, instanceId string) error

func (*CvmService) DeleteInstanceSetByIds

func (me *CvmService) DeleteInstanceSetByIds(ctx context.Context, instanceSetIds string) error

func (*CvmService) DeleteKeyPair

func (me *CvmService) DeleteKeyPair(ctx context.Context, keyId string) error

func (*CvmService) DeletePlacementGroup

func (me *CvmService) DeletePlacementGroup(ctx context.Context, placementId string) error

func (*CvmService) DescribeCvmChcDeniedActionsByFilter

func (me *CvmService) DescribeCvmChcDeniedActionsByFilter(ctx context.Context, param map[string]interface{}) (chcDeniedActions []*cvm.ChcHostDeniedActions, errRet error)

func (*CvmService) DescribeCvmChcHostsByFilter

func (me *CvmService) DescribeCvmChcHostsByFilter(ctx context.Context, param map[string]interface{}) (chcHosts []*cvm.ChcHost, errRet error)

func (*CvmService) DescribeCvmHpcClusterById

func (me *CvmService) DescribeCvmHpcClusterById(ctx context.Context, hpcClusterId string) (hpcCluster *cvm.HpcClusterInfo, errRet error)

func (*CvmService) DescribeCvmImageQuotaByFilter

func (me *CvmService) DescribeCvmImageQuotaByFilter(ctx context.Context, param map[string]interface{}) (imageQuota int64, errRet error)

func (*CvmService) DescribeCvmImageSharePermissionByFilter

func (me *CvmService) DescribeCvmImageSharePermissionByFilter(ctx context.Context, param map[string]interface{}) (imageSharePermission []*cvm.SharePermission, errRet error)

func (*CvmService) DescribeCvmLaunchTemplateById

func (me *CvmService) DescribeCvmLaunchTemplateById(ctx context.Context, launchTemplateId string) (launchTemplate *cvm.LaunchTemplateInfo, errRet error)

func (*CvmService) DescribeCvmLaunchTemplateVersionById

func (me *CvmService) DescribeCvmLaunchTemplateVersionById(ctx context.Context, launchTemplateId, launchTemplateVersionNumber string) (launchTemplateVersion *cvm.LaunchTemplateVersionInfo, errRet error)

func (*CvmService) DescribeImageById

func (me *CvmService) DescribeImageById(ctx context.Context, keyId string, isDelete bool) (image *cvm.Image, has bool, errRet error)

func (*CvmService) DescribeImagesByFilter

func (me *CvmService) DescribeImagesByFilter(ctx context.Context, filters map[string][]string, instanceType string) (images []*cvm.Image, errRet error)

func (*CvmService) DescribeInstanceByFilter

func (me *CvmService) DescribeInstanceByFilter(ctx context.Context, instancesId []*string, filters map[string]string) (instances []*cvm.Instance, errRet error)

func (*CvmService) DescribeInstanceById

func (me *CvmService) DescribeInstanceById(ctx context.Context, instanceId string) (instance *cvm.Instance, errRet error)

func (*CvmService) DescribeInstanceInParallelByFilter

func (me *CvmService) DescribeInstanceInParallelByFilter(ctx context.Context, filters map[string]string) (instances []*cvm.Instance, errRet error)

func (*CvmService) DescribeInstanceSetByIds

func (me *CvmService) DescribeInstanceSetByIds(ctx context.Context, instanceSetIds string) (instance []*cvm.Instance, errRet error)

func (*CvmService) DescribeInstanceTypes

func (me *CvmService) DescribeInstanceTypes(ctx context.Context, zone string) (instanceTypes []*cvm.InstanceTypeConfig, errRet error)

func (*CvmService) DescribeInstanceTypesByFilter

func (me *CvmService) DescribeInstanceTypesByFilter(ctx context.Context, filters map[string][]string) (instanceTypes []*cvm.InstanceTypeConfig, errRet error)

func (*CvmService) DescribeInstancesSellTypeByFilter

func (me *CvmService) DescribeInstancesSellTypeByFilter(ctx context.Context, filters map[string][]string) (instanceTypes []*cvm.InstanceTypeQuotaItem, errRet error)

func (*CvmService) DescribeKeyPairByFilter

func (me *CvmService) DescribeKeyPairByFilter(ctx context.Context, id, name string, projectId *int) (keyPairs []*cvm.KeyPair, errRet error)

func (*CvmService) DescribeKeyPairById

func (me *CvmService) DescribeKeyPairById(ctx context.Context, keyId string) (keyPair *cvm.KeyPair, errRet error)

func (*CvmService) DescribeLaunchTemplateVersions

func (me *CvmService) DescribeLaunchTemplateVersions(ctx context.Context, launchTemplateId string) (launchTemplates []*cvm.LaunchTemplateVersionInfo, errRet error)

func (*CvmService) DescribeLaunchTemplateVersionsById

func (me *CvmService) DescribeLaunchTemplateVersionsById(ctx context.Context, launchTemplateId string) (launchTemplate *cvm.LaunchTemplateVersionInfo, errRet error)

func (*CvmService) DescribePlacementGroupByFilter

func (me *CvmService) DescribePlacementGroupByFilter(ctx context.Context, id, name string) (placementGroups []*cvm.DisasterRecoverGroup, errRet error)

func (*CvmService) DescribePlacementGroupById

func (me *CvmService) DescribePlacementGroupById(ctx context.Context, placementId string) (placementGroup *cvm.DisasterRecoverGroup, errRet error)

func (*CvmService) DescribeRegions

func (me *CvmService) DescribeRegions(ctx context.Context) (zones []*cvm.RegionInfo, errRet error)

func (*CvmService) DescribeReservedInstanceByFilter

func (me *CvmService) DescribeReservedInstanceByFilter(ctx context.Context, filters map[string]string) (instances []*cvm.ReservedInstances, errRet error)

func (*CvmService) DescribeReservedInstanceConfigs

func (me *CvmService) DescribeReservedInstanceConfigs(ctx context.Context, filters map[string]string) (configs []*cvm.ReservedInstancesOffering, errRet error)

func (*CvmService) DescribeZones

func (me *CvmService) DescribeZones(ctx context.Context) (zones []*cvm.ZoneInfo, errRet error)

func (*CvmService) ModifyDisableApiTermination

func (me *CvmService) ModifyDisableApiTermination(ctx context.Context, instanceId string, disableApiTermination bool) error

func (*CvmService) ModifyImage

func (me *CvmService) ModifyImage(ctx context.Context, instanceId, imageName, imageDesc string) (errRet error)

func (*CvmService) ModifyImageSharePermission

func (me *CvmService) ModifyImageSharePermission(ctx context.Context, imageId, permission string, accountIds []string) (errRet error)

func (*CvmService) ModifyInstanceChargeType

func (me *CvmService) ModifyInstanceChargeType(ctx context.Context, instanceId string, chargeType string, period int,
	renewFlag string) error

func (*CvmService) ModifyInstanceName

func (me *CvmService) ModifyInstanceName(ctx context.Context, instanceId, instanceName string) error

func (*CvmService) ModifyInstanceType

func (me *CvmService) ModifyInstanceType(ctx context.Context, instanceId, instanceType string) error

func (*CvmService) ModifyInternetMaxBandwidthOut

func (me *CvmService) ModifyInternetMaxBandwidthOut(ctx context.Context, instanceId, internetChargeType string, internetMaxBandWidthOut int64) error

func (*CvmService) ModifyKeyPairName

func (me *CvmService) ModifyKeyPairName(ctx context.Context, keyId, keyName string) error

func (*CvmService) ModifyLaunchTemplateDefaultVersion

func (me *CvmService) ModifyLaunchTemplateDefaultVersion(ctx context.Context, launchTemplateId string, defaultVersion int) error

func (*CvmService) ModifyPassword

func (me *CvmService) ModifyPassword(ctx context.Context, instanceId, password string) error

func (*CvmService) ModifyPlacementGroup

func (me *CvmService) ModifyPlacementGroup(ctx context.Context, placementId, name string) error

func (*CvmService) ModifyProjectId

func (me *CvmService) ModifyProjectId(ctx context.Context, instanceId string, projectId int64) error

func (*CvmService) ModifyRenewParam

func (me *CvmService) ModifyRenewParam(ctx context.Context, instanceId string, renewFlag string) error

func (*CvmService) ModifySecurityGroups

func (me *CvmService) ModifySecurityGroups(ctx context.Context, instanceId string, securityGroups []*string) error

func (*CvmService) ModifyVpc

func (me *CvmService) ModifyVpc(ctx context.Context, instanceId, vpcId, subnetId, privateIp string) error

func (*CvmService) ResetInstance

func (me *CvmService) ResetInstance(ctx context.Context, request *cvm.ResetInstanceRequest) (errRet error)

func (*CvmService) ResizeInstanceDisks

func (me *CvmService) ResizeInstanceDisks(ctx context.Context, request *cvm.ResizeInstanceDisksRequest) (errRet error)

func (*CvmService) StartInstance

func (me *CvmService) StartInstance(ctx context.Context, instanceId string) error

func (*CvmService) StopInstance

func (me *CvmService) StopInstance(ctx context.Context, instanceId string, stoppedMode string) error

func (*CvmService) UnbindKeyPair

func (me *CvmService) UnbindKeyPair(ctx context.Context, keyIds []*string, instanceIds []*string) error

Jump to

Keyboard shortcuts

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