github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/fgs/v2/invoke/InvokeSync.go (about) 1 package invoke 2 3 import ( 4 golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" 6 ) 7 8 func LaunchSync(client *golangsdk.ServiceClient, funcUrn string) (*LaunchSyncResp, error) { 9 raw, err := client.Post(client.ServiceURL("fgs", "functions", funcUrn, "invocations"), nil, nil, &golangsdk.RequestOpts{ 10 OkCodes: []int{200}, 11 }) 12 if err != nil { 13 return nil, err 14 } 15 16 var res LaunchSyncResp 17 return &res, extract.Into(raw.Body, &res) 18 } 19 20 type LaunchSyncResp struct { 21 RequestID string `json:"request_id"` 22 Result string `json:"result"` 23 Log string `json:"log"` 24 Status string `json:"status"` 25 }