Git Product home page Git Product logo

tcpicli's People

Contributors

allenoooo avatar cynful avatar kiyor avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tcpicli's Issues

API Return Values Standard Change for CVM and IMG

The return values are changing from this:

{
"code":"0", ## Indicates success(0) or error(1), and populates message field if 1
"message":"",
"data":{
"taskId":"17382"
}
}

To this:

Success: |
{
"Response": {
"InstanceIdSet": [
"xxx1",
"xxx2"
],
"RequestId": "eac6b301-a322-493a-8e36-83b295459397"
}
}

Error: |
{
"Response": {
"Error": {
"Code": "AuthFailure",
"Message": "qcloud was not able to validate the provided access credentials"
},
"RequestId": "eac6b301-a322-493a-8e36-83b295459397"
}
}

Need to incorporate new standard into data struct templating in core.

verbose mode doesn't work

Example:

➜ tcpicli git:(dev-james) ✗ tcpicli -vv cmq ListQueue Region=gz
{
"clientRequestId": 0,
"code": 0,
"message": "",
"queueList": [
{
"queueId": "queue-pjccrx90",
"queueName": "test"
}
],
"requestId": "3164904643766547922",
"totalCount": 1
}

SDK usage

In general, the package doesn't really use convenient structs but it can be useful to automatically create or purge some services without having to write a Tencent implementation myself.

Can this package be used as an SDK?

The CLI version of this command below works, using it as below always returns an authentication error:

package main

import (
	"fmt"

	"github.com/tencentcloudplatform/tcpicli/cdn"
	"github.com/tencentcloudplatform/tcpicli/core"
)

func main() {
	fmt.Println("CurrentProfile:", core.CurrentProfile())

	var options string
	options += " host=www.example.com"
	options += " projectId=0"
	options += " hostType=cname"
	options += " origin=1.1.1.1"
	options += " origin=1.1.1.2"
	options += " origin=1.1.1.3"

	b, err := cdn.AddCdnHost(options)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Printf("%s (%s)", b.CodeDesc, b.Message)
}
CurrentProfile: default
{
  "code": 4100,
  "codeDesc": "AuthFailure",
  "message": "鉴权失败,请参考文档中鉴权部分。"
}

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.