huaweicloud

package
v0.0.0-...-5381133 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Package huaweicloud

  • Copyright 2024-2025 Bilibili Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	HwSeverSpecs = map[string]string{
		"normal":            "通用计算型",
		"entry":             "通用入门型",
		"cpuv1":             "计算I型",
		"cpuv2":             "计算II型",
		"computingv3":       "通用计算增强型",
		"kunpeng_computing": "鲲鹏通用计算增强型",
		"kunpeng_highmem":   "鲲鹏内存优化型",
		"highmem":           "内存优化型",
		"saphana":           "大内存型",
		"diskintensive":     "磁盘增强型",
		"highio":            "超高I/O型",
		"ultracpu":          "超高性能计算型",
		"gpu":               "GPU加速型",
		"fpga":              "FPGA加速型",
		"ascend":            "AI加速型",
		"arm64":             "鲲鹏计算",
	}
)

Functions

func IsNotFoundErr

func IsNotFoundErr(err error) bool

IsNotFoundErr 判断是否为不存在错误

Types

type Client

type Client struct {
	Region    string
	SecretId  string
	SecretKey string
}

func NewClient

func NewClient(region, secretId, secretKey string) *Client

func (*Client) ChangeServerConfig

ChangeServerConfig 变更云服务器配置

func (*Client) DeletePostPaidServer

func (c *Client) DeletePostPaidServer(req *cloudrepo.DeleteCloudServerReq) (string, error)

DeletePostPaidServer 删除按需云服务器

func (*Client) DeletePrePaidServer

func (c *Client) DeletePrePaidServer(req *cloudrepo.DeleteCloudServerReq) (string, error)

DeletePrePaidServer 删除包年/包月云服务器

func (*Client) DeleteServer

DeleteServer 删除云服务器

func (*Client) DescribeServer

DescribeServer 查询云服务器信息

func (*Client) ListCloudSecurityGroup

func (c *Client) ListCloudSecurityGroup(req *cloudrepo.GetCloudProductReq) ([]cloudrepo.CloudSecurityGroup, error)

ListCloudSecurityGroup 获取安全组列表

func (*Client) ListPayPerUseCustomerResources

func (c *Client) ListPayPerUseCustomerResources(resourceIds []string) (instance []model.OrderInstanceV2, err error)

ListPayPerUseCustomerResources 查询订单资源

func (*Client) ListProject

ListProject 获取云项目列表

func (*Client) ListProjectIam

func (c *Client) ListProjectIam(req *cloudrepo.GetCloudProductReq) (data []iamModel.AuthProjectResult, err error)

ListProjectIam 获取云项目Iam列表

func (*Client) ListRegion

ListRegion 获取地域列表

func (*Client) ListServer

func (c *Client) ListServer(req *cloudrepo.GetCloudProductReq) ([]cloudrepo.CloudServer, error)

ListServer 获取云服务器列表

func (*Client) ListServerImage

func (c *Client) ListServerImage(req *cloudrepo.GetCloudProductReq) ([]cloudrepo.CloudServerImage, error)

ListServerImage 获取镜像列表

func (*Client) ListServerSpec

func (c *Client) ListServerSpec(req *cloudrepo.GetCloudProductReq) ([]cloudrepo.CloudServerSpec, error)

ListServerSpec 获取服务器规格列表

func (*Client) ListSubnet

func (c *Client) ListSubnet(req *cloudrepo.GetCloudProductReq) ([]cloudrepo.CloudSubnet, error)

ListSubnet 获取子网列表

func (*Client) ListVpc

ListVpc 获取专有网路列表

func (*Client) ListZone

ListZone 获取可用区列表

func (*Client) RebootServer

RebootServer 重启云服务器

func (*Client) ReinstallServer

ReinstallServer 重装云服务器系统

func (*Client) RenameServer

RenameServer 重命名云服务器

func (*Client) StartServer

StartServer 启动云服务器

func (*Client) StopServer

StopServer 停止云服务器

type CloudProject

type CloudProject struct {
	cloudrepo.CloudProductCommon
}

CloudProject 云项目

func (*CloudProject) GetCID

func (c *CloudProject) GetCID() string

GetCID 获取云项目CID

func (*CloudProject) GetName

func (c *CloudProject) GetName() string

GetName 获取云项目名称

func (*CloudProject) GetStatus

func (c *CloudProject) GetStatus() string

GetStatus 获取云项目状态

type CloudRegion

type CloudRegion struct {
	cloudrepo.CloudProductCommon
	// contains filtered or unexported fields
}

CloudRegion 云地域

func (*CloudRegion) GetCID

func (c *CloudRegion) GetCID() string

GetCID 获取云地域CID

func (*CloudRegion) GetName

func (c *CloudRegion) GetName() string

GetName 获取云地域名称

func (*CloudRegion) GetStatus

func (c *CloudRegion) GetStatus() string

GetStatus 获取云地域状态

type CloudSecurityGroup

type CloudSecurityGroup struct {
	cloudrepo.CloudProductCommon

	Project string
	Vpc     string
}

CloudSecurityGroup 云安全组

func (*CloudSecurityGroup) GetCID

func (c *CloudSecurityGroup) GetCID() string

GetCID 获取云安全组CID

func (*CloudSecurityGroup) GetName

func (c *CloudSecurityGroup) GetName() string

GetName 获取云安全组名称

func (*CloudSecurityGroup) GetProject

func (c *CloudSecurityGroup) GetProject() string

GetProject 获取云安全组项目

func (*CloudSecurityGroup) GetStatus

func (c *CloudSecurityGroup) GetStatus() string

GetStatus 获取云安全组状态

func (*CloudSecurityGroup) GetVpc

func (c *CloudSecurityGroup) GetVpc() string

GetVpc 获取云安全组专有网络

type CloudServer

type CloudServer struct {
	cloudrepo.CloudProductCommon

	SeverSecurityGroupCid []string
	SubnetCid             string
	VpcCid                string
	ImageCid              string
	ZoneCid               string
	ProjectCid            string
	ServerSpec            string
	ChangeType            string
	RenewStatus           string
	PrivateIP             string
	PublicIP              string
	ExpireTime            string
}

CloudServer 云服务器

func (*CloudServer) GetCID

func (c *CloudServer) GetCID() string

GetCID 获取云服务器CID

func (*CloudServer) GetChangeType

func (c *CloudServer) GetChangeType() string

GetChangeType 获取云服务器计费方式

func (*CloudServer) GetExpireTime

func (c *CloudServer) GetExpireTime() string

GetExpireTime 获取云服务器到期时间

func (*CloudServer) GetImageCid

func (c *CloudServer) GetImageCid() string

GetImageCid 获取云服务器镜像

func (*CloudServer) GetName

func (c *CloudServer) GetName() string

GetName 获取云服务器名称

func (*CloudServer) GetPrivateIP

func (c *CloudServer) GetPrivateIP() string

GetPrivateIP 获取云服务器内网IP

func (*CloudServer) GetProjectCid

func (c *CloudServer) GetProjectCid() string

GetProjectCid 获取云服务器项目

func (*CloudServer) GetPublicIP

func (c *CloudServer) GetPublicIP() string

GetPublicIP 获取云服务器外网IP

func (*CloudServer) GetRenewStatus

func (c *CloudServer) GetRenewStatus() string

GetRenewStatus 获取云服务器续费状态

func (*CloudServer) GetSecurityGroupCid

func (c *CloudServer) GetSecurityGroupCid() []string

GetSecurityGroupCid 获取云服务器安全组

func (*CloudServer) GetServerSpec

func (c *CloudServer) GetServerSpec() string

GetServerSpec 获取云服务器规格

func (*CloudServer) GetStatus

func (c *CloudServer) GetStatus() string

GetStatus 获取云服务器状态

func (*CloudServer) GetSubnetCid

func (c *CloudServer) GetSubnetCid() string

GetSubnetCid 获取云服务器子网

func (*CloudServer) GetVpcCid

func (c *CloudServer) GetVpcCid() string

GetVpcCid 获取云服务器专有网络

func (*CloudServer) GetZoneCid

func (c *CloudServer) GetZoneCid() string

GetZoneCid 获取云服务器可用区

type CloudServerImage

type CloudServerImage struct {
	cloudrepo.CloudProductCommon

	OsName string
	Type   string
}

CloudServerImage 云镜像

func (*CloudServerImage) GetCID

func (c *CloudServerImage) GetCID() string

GetCID 获取云镜像CID

func (*CloudServerImage) GetName

func (c *CloudServerImage) GetName() string

GetName 获取云镜像名称

func (*CloudServerImage) GetOsName

func (c *CloudServerImage) GetOsName() string

GetOsName 获取云镜像系统

func (*CloudServerImage) GetStatus

func (c *CloudServerImage) GetStatus() string

GetStatus 获取云镜像状态

func (*CloudServerImage) GetType

func (c *CloudServerImage) GetType() string

GetType 获取云镜像类型

type CloudServerSpec

type CloudServerSpec struct {
	cloudrepo.CloudProductCommon

	BandWidth float64
	Category  string
	CPU       int
	GPU       int
	GPUModel  string
	Family    string
	Memory    int
	PPS       float64
}

CloudServerSpec 云服务器规格

func (*CloudServerSpec) GetBandWidth

func (c *CloudServerSpec) GetBandWidth() float64

GetBandWidth 获取云服务器规格带宽

func (*CloudServerSpec) GetCID

func (c *CloudServerSpec) GetCID() string

GetCID 获取云服务器规格CID

func (*CloudServerSpec) GetCPU

func (c *CloudServerSpec) GetCPU() int

GetCPU 获取云服务器规格CPU

func (*CloudServerSpec) GetCategory

func (c *CloudServerSpec) GetCategory() string

GetCategory 获取云服务器规格类别

func (*CloudServerSpec) GetFamily

func (c *CloudServerSpec) GetFamily() string

GetFamily 获取云服务器规格系列

func (*CloudServerSpec) GetGPU

func (c *CloudServerSpec) GetGPU() int

GetGPU 获取云服务器规格GPU

func (*CloudServerSpec) GetGPUModel

func (c *CloudServerSpec) GetGPUModel() string

GetGPUModel 获取云服务器规格GPU型号

func (*CloudServerSpec) GetMemory

func (c *CloudServerSpec) GetMemory() int

GetMemory 获取云服务器规格内存

func (*CloudServerSpec) GetName

func (c *CloudServerSpec) GetName() string

GetName 获取云服务器规格名称

func (*CloudServerSpec) GetPPS

func (c *CloudServerSpec) GetPPS() float64

GetPPS 获取云服务器规格PPS

func (*CloudServerSpec) GetStatus

func (c *CloudServerSpec) GetStatus() string

GetStatus 获取云服务器规格状态

type CloudSubnet

type CloudSubnet struct {
	cloudrepo.CloudProductCommon

	Cidr    string
	Project string
	Vpc     string
	Zone    string
}

CloudSubnet 云子网

func (*CloudSubnet) GetCID

func (c *CloudSubnet) GetCID() string

GetCID 获取云子网CID

func (*CloudSubnet) GetCidr

func (c *CloudSubnet) GetCidr() string

GetCidr 获取云子网CIDR

func (*CloudSubnet) GetName

func (c *CloudSubnet) GetName() string

GetName 获取云子网名称

func (*CloudSubnet) GetProject

func (c *CloudSubnet) GetProject() string

GetProject 获取云子网项目

func (*CloudSubnet) GetStatus

func (c *CloudSubnet) GetStatus() string

GetStatus 获取云子网状态

func (*CloudSubnet) GetVpc

func (c *CloudSubnet) GetVpc() string

GetVpc 获取云子网专有网络

func (*CloudSubnet) GetZone

func (c *CloudSubnet) GetZone() string

GetZone 获取云子网可用区

type CloudVpc

type CloudVpc struct {
	cloudrepo.CloudProductCommon
	Cidr    string
	Project string
}

CloudVpc 云专有网络

func (*CloudVpc) GetCID

func (c *CloudVpc) GetCID() string

GetCID 获取云专有网络CID

func (*CloudVpc) GetCidr

func (c *CloudVpc) GetCidr() string

GetCidr 获取云专有网络CIDR

func (*CloudVpc) GetName

func (c *CloudVpc) GetName() string

GetName 获取云专有网络名称

func (*CloudVpc) GetProject

func (c *CloudVpc) GetProject() string

GetProject 获取云专有网络项目

func (*CloudVpc) GetStatus

func (c *CloudVpc) GetStatus() string

GetStatus 获取云专有网络状态

type CloudZone

type CloudZone struct {
	cloudrepo.CloudProductCommon
}

CloudZone 云可用区

func (*CloudZone) GetCID

func (c *CloudZone) GetCID() string

GetCID 获取云可用区CID

func (*CloudZone) GetName

func (c *CloudZone) GetName() string

GetName 获取云可用区名称

func (*CloudZone) GetStatus

func (c *CloudZone) GetStatus() string

GetStatus 获取云可用区状态

Jump to

Keyboard shortcuts

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