mirror of
https://github.com/rancher/norman.git
synced 2025-09-07 18:20:17 +00:00
Add Replace to generic client
This commit is contained in:
@@ -34,6 +34,7 @@ type APIBaseClientInterface interface {
|
|||||||
GetLink(resource types.Resource, link string, respObject interface{}) error
|
GetLink(resource types.Resource, link string, respObject interface{}) error
|
||||||
Create(schemaType string, createObj interface{}, respObject interface{}) error
|
Create(schemaType string, createObj interface{}, respObject interface{}) error
|
||||||
Update(schemaType string, existing *types.Resource, updates 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
|
ByID(schemaType string, id string, respObject interface{}) error
|
||||||
Delete(existing *types.Resource) error
|
Delete(existing *types.Resource) error
|
||||||
Reload(existing *types.Resource, output interface{}) 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)
|
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 {
|
func (a *APIBaseClient) ByID(schemaType string, id string, respObject interface{}) error {
|
||||||
return a.Ops.DoByID(schemaType, id, respObject)
|
return a.Ops.DoByID(schemaType, id, respObject)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user