Update references from Path() to the appropriate segment use

This commit is contained in:
Clayton Coleman
2014-12-26 15:06:25 -05:00
parent afedbba3fc
commit e355f54eda
20 changed files with 258 additions and 111 deletions

View File

@@ -59,7 +59,9 @@ type RESTClient struct {
// NewRESTClient creates a new RESTClient. This client performs generic REST functions
// such as Get, Put, Post, and Delete on specified paths. Codec controls encoding and
// decoding of responses from the server.
// decoding of responses from the server. If the namespace should be specified as part
// of the path (after the resource), set namespaceInPath to true, otherwise it will be
// passed as "namespace" in the query string.
func NewRESTClient(baseURL *url.URL, c runtime.Codec, namespaceInPath bool) *RESTClient {
base := *baseURL
if !strings.HasSuffix(base.Path, "/") {
@@ -129,7 +131,7 @@ func (c *RESTClient) Delete() *Request {
// PollFor makes a request to do a single poll of the completion of the given operation.
func (c *RESTClient) Operation(name string) *Request {
return c.Get().Path("operations").Path(name).Sync(false).NoPoll()
return c.Get().Resource("operations").Name(name).Sync(false).NoPoll()
}
func (c *RESTClient) DefaultPoll(name string) (*Request, bool) {