@@ -8,35 +8,22 @@ import (
8
8
)
9
9
10
10
const (
11
- // Base API paths
12
- pipelinePath = "api/pipelines/%s"
13
- pipelineListPath = "api/pipelines/list"
14
- pipelineExecutionPath = "api/pipelines/execution/url"
15
- pipelineExecutionGetPath = "api/pipelines/execution/v2/%s"
16
- pipelineExecutionSummaryPath = "api/pipelines/execution/summary"
17
-
18
- // Prefix to prepend for external API calls
19
- externalPathPrefix = "pipeline/"
11
+ pipelinePath = "/api/pipelines/%s"
12
+ pipelineListPath = "/api/pipelines/list"
13
+ pipelineExecutionPath = "/api/pipelines/execution/url"
14
+ pipelineExecutionGetPath = "/api/pipelines/execution/v2/%s"
15
+ pipelineExecutionSummaryPath = "/api/pipelines/execution/summary"
20
16
)
21
17
22
18
type PipelineService struct {
23
- Client * Client
24
- UseInternalPaths bool
25
- }
26
-
27
- func (p * PipelineService ) buildPath (basePath string ) string {
28
- if p .UseInternalPaths {
29
- return basePath
30
- }
31
- return externalPathPrefix + basePath
19
+ Client * Client
32
20
}
33
21
34
22
func (p * PipelineService ) Get (ctx context.Context , scope dto.Scope , pipelineID string ) (
35
23
* dto.Entity [dto.PipelineData ],
36
24
error ,
37
25
) {
38
- pathTemplate := p .buildPath (pipelinePath )
39
- path := fmt .Sprintf (pathTemplate , pipelineID )
26
+ path := fmt .Sprintf (pipelinePath , pipelineID )
40
27
41
28
// Prepare query parameters
42
29
params := make (map [string ]string )
@@ -59,7 +46,7 @@ func (p *PipelineService) List(
59
46
scope dto.Scope ,
60
47
opts * dto.PipelineListOptions ,
61
48
) (* dto.ListOutput [dto.PipelineListItem ], error ) {
62
- path := p . buildPath ( pipelineListPath )
49
+ path := pipelineListPath
63
50
// Prepare query parameters
64
51
params := make (map [string ]string )
65
52
addScope (scope , params )
@@ -103,7 +90,7 @@ func (p *PipelineService) ListExecutions(
103
90
scope dto.Scope ,
104
91
opts * dto.PipelineExecutionOptions ,
105
92
) (* dto.ListOutput [dto.PipelineExecution ], error ) {
106
- path := p . buildPath ( pipelineExecutionSummaryPath )
93
+ path := pipelineExecutionSummaryPath
107
94
// Prepare query parameters
108
95
params := make (map [string ]string )
109
96
addScope (scope , params )
@@ -161,8 +148,7 @@ func (p *PipelineService) GetExecution(
161
148
scope dto.Scope ,
162
149
planExecutionID string ,
163
150
) (* dto.Entity [dto.PipelineExecution ], error ) {
164
- pathTemplate := p .buildPath (pipelineExecutionGetPath )
165
- path := fmt .Sprintf (pathTemplate , planExecutionID )
151
+ path := fmt .Sprintf (pipelineExecutionGetPath , planExecutionID )
166
152
167
153
// Prepare query parameters
168
154
params := make (map [string ]string )
@@ -191,7 +177,7 @@ func (p *PipelineService) FetchExecutionURL(
191
177
scope dto.Scope ,
192
178
pipelineID , planExecutionID string ,
193
179
) (string , error ) {
194
- path := p . buildPath ( pipelineExecutionPath )
180
+ path := pipelineExecutionPath
195
181
196
182
// Prepare query parameters
197
183
params := make (map [string ]string )
0 commit comments