Skip to content

Commit d668a08

Browse files
send application resources
1 parent 73f9910 commit d668a08

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.19.5
1+
0.19.6

pkg/codefresh/gitops.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type (
99
DeleteEnvironment(name string) error
1010
GetEnvironments() ([]CFEnvironment, error)
1111
SendEvent(name string, props map[string]string) error
12+
SendApplicationResources(resources *ApplicationResources) error
1213
}
1314

1415
gitops struct {
@@ -107,6 +108,13 @@ type (
107108
LiveImages []string `json:"liveImages"`
108109
ReplicaSet EnvironmentActivityRS `json:"replicaSet"`
109110
}
111+
112+
ApplicationResources struct {
113+
Name string `json:"name, omitempty"`
114+
HistoryId int64 `json:"historyId"`
115+
Revision string `json:"revision, omitempty"`
116+
Resources interface{} `json:"resources"`
117+
}
110118
)
111119

112120
func newGitopsAPI(codefresh Codefresh) GitopsAPI {
@@ -198,3 +206,15 @@ func (a *gitops) SendEvent(name string, props map[string]string) error {
198206

199207
return nil
200208
}
209+
210+
func (a *gitops) SendApplicationResources(resources *ApplicationResources) error {
211+
_, err := a.codefresh.requestAPI(&requestOptions{
212+
method: "POST",
213+
path: fmt.Sprintf("/gitops/resources"),
214+
body: &resources,
215+
})
216+
if err != nil {
217+
return err
218+
}
219+
return nil
220+
}

0 commit comments

Comments
 (0)