1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-05 01:00:36 +00:00

Add Replace to generic client

This commit is contained in:
Darren Shepherd
2018-07-31 10:14:09 -07:00
parent bfc612cdcb
commit 19878010e4

View File

@@ -34,6 +34,7 @@ type APIBaseClientInterface interface {
GetLink(resource types.Resource, link string, respObject interface{}) error
Create(schemaType string, createObj interface{}, respObject interface{}) error
Update(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error
Replace(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error
ByID(schemaType string, id string, respObject interface{}) error
Delete(existing *types.Resource) error
Reload(existing *types.Resource, output interface{}) error
@@ -326,6 +327,10 @@ func (a *APIBaseClient) Update(schemaType string, existing *types.Resource, upda
return a.Ops.DoUpdate(schemaType, existing, updates, respObject)
}
func (a *APIBaseClient) Replace(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error {
return a.Ops.DoReplace(schemaType, existing, updates, respObject)
}
func (a *APIBaseClient) ByID(schemaType string, id string, respObject interface{}) error {
return a.Ops.DoByID(schemaType, id, respObject)
}