-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathproject_updates.go
40 lines (34 loc) · 973 Bytes
/
project_updates.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
package awx
import (
"fmt"
)
// ProjectUpdatesService implements awx projects apis.
type ProjectUpdatesService struct {
client *Client
}
// ProjectUpdateCancel cancel of awx projects update.
func (p *ProjectUpdatesService) ProjectUpdateCancel(id int) (*ProjectUpdateCancel, error) {
result := new(ProjectUpdateCancel)
endpoint := fmt.Sprintf("/api/v2/project_updates/%d/cancel", id)
resp, err := p.client.Requester.GetJSON(endpoint, result, nil)
if err != nil {
return nil, err
}
if err := CheckResponse(resp); err != nil {
return nil, err
}
return result, nil
}
// ProjectUpdateGet get of awx projects update.
func (p *ProjectUpdatesService) ProjectUpdateGet(id int) (*Job, error) {
result := new(Job)
endpoint := fmt.Sprintf("/api/v2/project_updates/%d", id)
resp, err := p.client.Requester.GetJSON(endpoint, result, nil)
if err != nil {
return nil, err
}
if err := CheckResponse(resp); err != nil {
return nil, err
}
return result, nil
}