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

Add action to url builder

This commit is contained in:
Craig Jellick
2017-12-15 19:24:04 -07:00
committed by Darren Shepherd
parent df13831994
commit f26502f753
2 changed files with 5 additions and 0 deletions

View File

@@ -254,3 +254,7 @@ func parseResponseURLBase(requestURL string, r *http.Request) (string, error) {
return requestURL[0:index], nil
}
func (u *urlBuilder) Action(action string, resource *types.RawResource) string {
return u.constructBasicURL(resource.Schema.Version, resource.Schema.PluralName, resource.ID) + "?action=" + url.QueryEscape(action)
}