We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
产品和接口: "github.com/aliyun/alibaba-cloud-sdk-go/services/cms"
平台: golang
最小代码:
import ( "fmt" "github.com/aliyun/alibaba-cloud-sdk-go/sdk" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" "github.com/aliyun/alibaba-cloud-sdk-go/services/cms" "os"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" ) func main() { config := sdk.NewConfig()
// Please ensure that the environment variables ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set. credential := credentials.NewAccessKeyCredential(os.Getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"), os.Getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET")) /* use STS Token credential := credentials.NewStsTokenCredential(os.Getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"), os.Getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"), os.Getenv("ALIBABA_CLOUD_SECURITY_TOKEN")) */ client, err := cms.NewClientWithOptions("cn-hangzhou", config, credential) if err != nil { panic(err) }
request := cms.CreateCursorRequest()
request.Scheme = "https"
request.Namespace = "acs_rds_dashboard" request.Metric = "ConnectionUsage" request.Period = requests.NewInteger(60) request.StartTime = "1641627000000" request.EndTime = "1641645000000"
response, err := client.Cursor(request) if err != nil { fmt.Print(err.Error()) } fmt.Printf("response is %#v\n", response) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
产品和接口: "github.com/aliyun/alibaba-cloud-sdk-go/services/cms"
平台: golang
最小代码:
import (
"fmt"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
"github.com/aliyun/alibaba-cloud-sdk-go/services/cms"
"os"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
)
func main() {
config := sdk.NewConfig()
// Please ensure that the environment variables ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set.
credential := credentials.NewAccessKeyCredential(os.Getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"), os.Getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
/* use STS Token
credential := credentials.NewStsTokenCredential(os.Getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"), os.Getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"), os.Getenv("ALIBABA_CLOUD_SECURITY_TOKEN"))
*/
client, err := cms.NewClientWithOptions("cn-hangzhou", config, credential)
if err != nil {
panic(err)
}
request := cms.CreateCursorRequest()
request.Scheme = "https"
request.Namespace = "acs_rds_dashboard"
request.Metric = "ConnectionUsage"
request.Period = requests.NewInteger(60)
request.StartTime = "1641627000000"
request.EndTime = "1641645000000"
response, err := client.Cursor(request)
if err != nil {
fmt.Print(err.Error())
}
fmt.Printf("response is %#v\n", response)
}
The text was updated successfully, but these errors were encountered: