package funcgraph import ( "fmt" "mats/conf" "strings" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/functiongraph/v2/model" ) func CreateShadow(meshUrl string, assetId string, dbId string, table string, scale, width int32) error { // client := createFuncGraphClient() OsgConvStreamTopic := conf.AppConfig.Nats.OsgShadowStreamTopic streamTopics := strings.Split(OsgConvStreamTopic, "#") request := &model.AsyncInvokeFunctionRequest{Body: map[string]interface{}{ "meshUrl": meshUrl, "assetId": assetId, "dbId": dbId, "table": table, "scalex10": scale, "width": width, "notifyNatsUrl": conf.AppConfig.Nats.Url, "notifyStream": streamTopics[0], "notifySubject": streamTopics[1], }} request.FunctionUrn = "urn:fss:cn-east-3:0956c65fd600f29f2ff6c00dbb3d1e2e:function:default:shadowconv:v3" response, err := client.AsyncInvokeFunction(request) if err == nil { fmt.Printf("%+v\n", response) return nil } fmt.Println("CreateShadow request failed=>", err.Error()) return err }