Skip to content
New issue

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

cms.CreateCursorRequest() 在最新版本里面没有 #590

Open
zerophpchina opened this issue May 29, 2023 · 0 comments
Open

cms.CreateCursorRequest() 在最新版本里面没有 #590

zerophpchina opened this issue May 29, 2023 · 0 comments

Comments

@zerophpchina
Copy link

zerophpchina commented May 29, 2023

  • 产品和接口: "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)
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant