-
Notifications
You must be signed in to change notification settings - Fork 7
/
urls.go
63 lines (50 loc) · 1.81 KB
/
urls.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package flinkjob
import (
"strconv"
"github.com/huaweicloud/terraform-provider-hcs/huaweicloudstack/sdk/huaweicloud"
)
const (
rootPath = "streaming"
sqlJobPath = "sql-jobs"
jobsPath = "jobs"
)
// POST /v1.0/{project_id}/streaming/sql-jobs
func createFlinkSqlUrl(c *golangsdk.ServiceClient) string {
return c.ServiceURL(rootPath, sqlJobPath)
}
// PUT /v1.0/{project_id}/streaming/sql-jobs/{job_id}
func updateFlinkSqlURL(c *golangsdk.ServiceClient, jobId int) string {
return c.ServiceURL(rootPath, sqlJobPath, strconv.Itoa(jobId))
}
// POST /v1.0/{project_id}/streaming/jobs/run
func runFlinkJobURL(c *golangsdk.ServiceClient) string {
return c.ServiceURL(rootPath, jobsPath, "run")
}
// GET /v1.0/{project_id}/streaming/jobs/{job_id}
func getURL(c *golangsdk.ServiceClient, jobId int) string {
return c.ServiceURL(rootPath, jobsPath, strconv.Itoa(jobId))
}
// GET /v1.0/{project_id}/streaming/jobs
func listURL(c *golangsdk.ServiceClient) string {
return c.ServiceURL(rootPath, jobsPath)
}
// DELETE /v1.0/{project_id}/streaming/jobs/{job_id}
func deleteURL(c *golangsdk.ServiceClient, jobId int) string {
return c.ServiceURL(rootPath, jobsPath, strconv.Itoa(jobId))
}
// POST /v1.0/{project_id}/dli/obs-authorize
func authorizeBucketURL(c *golangsdk.ServiceClient) string {
return c.ServiceURL("dli", "obs-authorize")
}
// POST /v1.0/{project_id}/streaming/flink-jobs
func createJarJobURL(c *golangsdk.ServiceClient) string {
return c.ServiceURL(rootPath, "flink-jobs")
}
// PUT /v1.0/{project_id}/streaming/flink-jobs/{job_id}
func updateJarJobURL(c *golangsdk.ServiceClient, jobId int) string {
return c.ServiceURL(rootPath, "flink-jobs", strconv.Itoa(jobId))
}
// POST /v1.0/{project_id}/streaming/jobs/stop
func stopJobURL(c *golangsdk.ServiceClient) string {
return c.ServiceURL(rootPath, jobsPath, "stop")
}