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

more collection action code

This commit is contained in:
Craig Jellick
2018-01-20 01:08:31 -07:00
parent d170661103
commit 990db51407
3 changed files with 21 additions and 0 deletions

View File

@@ -262,3 +262,8 @@ func parseResponseURLBase(requestURL string, r *http.Request) (string, error) {
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)
}
func (u *urlBuilder) CollectionAction(schema *types.Schema, versionOverride *types.APIVersion, action string) string {
collectionURL := u.Collection(schema, versionOverride)
return collectionURL + "?action=" + url.QueryEscape(action)
}