-
Notifications
You must be signed in to change notification settings - Fork 0
/
job-status-api.go
52 lines (45 loc) · 1.52 KB
/
job-status-api.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
package btpentitlements
import (
"context"
"github.com/nnicora/sap-sdk-go/sap/http/request"
"github.com/nnicora/sap-sdk-go/service/types"
)
// GET /jobs-management/v1/jobs/{jobInstanceIdOrUniqueId}/status
// Get available jobs
type GetJobStatusInput struct {
//ID of the job for which to get status
JobId string `dest:"uri" dest-name:"jobInstanceIdOrUniqueId"`
}
type GetJobStatusOutput struct {
//A description of the exit status of a job when it ends.
Description string `json:"description,omitempty"`
//The current state of the job.
//
//IN_PROGRESS: The job is being executed.
//COMPLETED: The job has completed.
//FAILED: The job failed and did not complete. The job can be restarted.
//Enum:
// [ IN_PROGRESS, COMPLETED, FAILED ]
Status string `json:"status,omitempty"`
Error *types.Error `json:"error,omitempty"`
types.StatusAndBodyFromResponse
}
func (c *EntitlementsV1) GetJobStatus(ctx context.Context, input *GetJobStatusInput) (*GetJobStatusOutput, error) {
req, out := c.getJobStatusRequest(ctx, input)
return out, req.Send()
}
func (c *EntitlementsV1) getJobStatusRequest(ctx context.Context, input *GetJobStatusInput) (*request.Request, *GetJobStatusOutput) {
op := &request.Operation{
Name: "Get Job Status",
Http: request.HTTP{
Method: request.GET,
Path: "/jobs-management/v1/jobs/{jobInstanceIdOrUniqueId}/status",
UsePathAsIs: true,
},
}
if input == nil {
input = &GetJobStatusInput{}
}
output := &GetJobStatusOutput{}
return c.newRequest(ctx, op, input, output), output
}