Code Monkey home page Code Monkey logo

ucloud-sdk-go's People

Contributors

cloudsjhan avatar fioncat avatar haowangucloud avatar jostyee avatar kavinbright avatar kellysweetie avatar lixiaojun629 avatar shawnmssu avatar tangjunjie119 avatar ucloud-bot avatar wangrzneu avatar xiaohui avatar yufeiminds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ucloud-sdk-go's Issues

AddCertificate cdn的api相关

API Requirements

API already exists, but not implemented by sdk?

  • DescribeUHostInstance

API does not exist, could you provide?

  • SomeNotExistsAPI
    AddCertificate

自己写实在太麻烦了, 要浏览器抓url. 抓实现方法

	cfg := ucloud.NewConfig()
	cfg.Region = "cn-bj2"

	cred := auth.NewCredential()
	cred.PublicKey = "*******"
	cred.PrivateKey = "*********"

	var (
		sslPubPath = "/etc/nginx/certs/fenghong.tech/fullchain.cer"
		sslKeyPath = "/etc/nginx/certs/fenghong.tech/cert.fenghong.key"
	)
	// 获取ssl key
	bufPubKey, _ := ioutil.ReadFile(sslPubPath)
	bufPriKey, _ := ioutil.ReadFile(sslKeyPath)
	pubKey := string(bufPubKey)
	priKey := string(bufPriKey)

	client  :=  ucloud.NewClient(&cfg, &cred)
	reqs := client.NewGenericRequest()
	reqs.SetAction("AddCertificate")

        // 构造prams
	ssl := make(map[string]interface{}, 5)
// 这个projectId也是浏览器抓到的.. 
	ssl["ProjectId"] = "*** "
	ssl["CertName"] = "testApi"
	ssl["UserCert"] = pubKey
	ssl["PrivateKey"] = priKey
	reqs.SetPayload(ssl)

	resp, err := client.GenericInvoke(reqs)
	if err != nil {
		fmt.Println("[ERROR]", err)
		return
	}
	fmt.Println("[RESPONSE]", resp)

什么时候sdk写好哇..

使用DescribeOrderInfo接口与原有go-SDK不兼容问题

你好,我在使用你们提供的计费接口DescribeOrderInfo进行费用拉取,想在原有的sdk基础之上添加,仿照代码风格新建了一个模块ubiling:client.go, types_ubillings_order_infos.go,
describe_order_detail_info.go ,types_ubillings_resource_tag.go,调试的时候发现在ucloud/client.go的第93行,

// use response middle to build and convert response when response has been created. // such as retry, report traceback, print log and etc. for _, handler := range c.responseHandlers { resp, err = handler(c, req, resp, err) }
所返回的resp并不是response.CommonBase的格式,我在这之前,

body := httpResp.GetBody() for _, patch := range patches { body = patch.Patch(body) } fmt.Println(body) fmt.Println(string(body))

将http真正返回的body部分,打印出来,是包含orderInfo的正确的返回值;

但是在main.go中 采用以下代码,

`cfg, credential := loadConfig()
ubillingClient := ubillings.NewClient(cfg, credential)

req := ubillingClient.NewDescribeOrderDetailInfoRequest()
req.BeginTime = 1539417292
req.EndTime = 1542095692
req.SetRegion("kr-seoul-01")
req.Limit= 100


newUBilling, err := ubillingClient.DescribeOrderDetailInfo(req)

if err != nil {
	fmt.Println(err)
}

fmt.Println(newUBilling.OrderInfo)`

打印为空

ps: 目前计费部分的sdk我已经写完,有需要的话可以review,merge一下。

来自:ucloud用户的反馈

DescribeShareBandwidthPrice 接口错误

Version of UCloud SDK?

v0.21.47

Version of Go (go version)?

go1.19.2

What issue did you see?

DescribeShareBandwidthPriceResponse 中的 TotalPrice 应该是 float

Steps to reproduce

[{"Action":"DescribeShareBandwidthPriceResponse","ListPrice":0.2,"PurchaseValue":1669563557,"Request_uuid":"0dcdfb21-2ab4-4ae1-9ea6-168a8e3761e9","RetCode":0,"TotalPrice":0.2}] got error, json: cannot unmarshal number 0.2 into Go struct field DescribeShareBandwidthPriceResponse.TotalPrice of type int

If you have have an runnable example, please include it.

can not find umon package

when i use python/go,there isn't package in ucloud-sdk-python3/go, but the example in ucloud website of api tutorial shows that it should have the umon module.

建议你们都对比以下resp的字段名称,太多问题了

Version of UCloud SDK?

0.22.18

Version of Go (go version)?

1.22.3

What issue did you see?

type DescribeEIPResponse struct {
response.CommonBase

// 外网IP数组
Infos[] EIPInfo

// 返回信息描述
Message string

// 返回现有外网IP总数
Totalcount int

}
=>
type DescribeEIPResponse struct {
response.CommonBase

// 外网IP数组
EIPSet[] EIPInfo

// 返回信息描述
Message string

// 返回现有外网IP总数
Totalcount int

}

Infos => EIPSet //建议你们都对比以下resp的字段名称,太多问题了

Steps to reproduce

If you have have an runnable example, please include it.
// PrintfT("开始执行")
region := "hk"
zone := "hk-02"

orderEID := ""
newEID := ""
resourceID := ""

cfg := ucloud.NewConfig()
cfg.Region = region
cfg.BaseUrl = "https://api.ucloud.cn"

credential := auth.NewCredential()
credential.PublicKey = ucloudPublic
credential.PrivateKey = ucloudPrivate

uhostClient := ucloudstack.NewClient(&cfg, &credential)

describeEIPReq := uhostClient.NewDescribeEIPRequest()
describeEIPReq.Region = ucloud.String(region)
describeEIPReq.Zone = ucloud.String(zone)
// describeEIPReq.ip

// send request
describeEIPResp, err := uhostClient.DescribeEIP(describeEIPReq)
if err != nil {
	fmt.Printf("something bad happened: %s\n", err)
	return
}

fmt.Printf("Describe EIP Success, Infos: %+v", describeEIPResp.Infos)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.