Commit Graph

21 Commits (bba5147643ab3f87c4fe3d4c2b2a0e4fbb41779d)

Author SHA1 Message Date
Clayton Coleman 904d0d46c3 Rename ServerOp to Operation in v1beta3 and internal
Add the appropriate rename logic internally.
2014-12-12 18:08:41 -05:00
Clayton Coleman d5ee171410 Allow clients to determine the difference between create or update on PUT
PUT allows an object to be created (http 201).  This allows REST code to
indicate an object has been created and clients to react to it.

APIServer now deals with <-chan RESTResult instead of <-chan runtime.Object,
allowing more data to be passed through.
2014-10-24 14:41:15 -04:00
Clayton Coleman 7550c146dc Replace struct initializers for TypeMeta with ObjectMeta 2014-10-24 11:22:21 -04:00
Clayton Coleman bb77a5d15f Rename ID -> Name 2014-10-22 15:00:26 -04:00
Clayton Coleman d3e51a0f24 Rename JSONBase -> TypeMeta in preparation for v1beta3
Will make subsequent refactor much easier
2014-10-07 11:12:16 -04:00
Daniel Smith 37e505601e add self linking to apiserver 2014-09-26 15:08:02 -07:00
Daniel Smith 0d30a656ef Do interface{} -> runtime.Object rename everywhere 2014-09-07 22:19:24 -07:00
Vojtech Vitek (V-Teq) 59f58cd043 Unify Godoc formatting, fix various typos
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-09-02 13:41:03 +02:00
Clayton Coleman 0a841a49fd Naming of Reason constants is inconsistent
Changed ReasonType to StatusReason (to match the field) and
changed CauseReason to CauseType and renamed StatusCause.Reason to
Type.
2014-08-26 13:39:21 -04:00
Brendan Burns a198bbb0ae Switch api.Status to *api.Status in a bunch of places. 2014-08-20 10:21:49 -07:00
Clayton Coleman a74fac7d70 Centralize path magic in apiserver into the New method
Make OperationHandler and WatchHandler properly encapsulate their
concerns and make them not depend on the global path
2014-08-08 16:33:44 -04:00
Clayton Coleman c9fc0bcf3d Decouple apiserver from codec implementation
The apiserver on initialization must be provided with a codec
for encoding and decoding all handled objects including api.Status
and api.ServerOp.  In addition, the RESTStorage Extract() method
has been changed to New(), which returns a pointer object that the
codec must decode into (the internal object).  Switched registry
methods to use pointers for Create/Update instead of values.
2014-08-07 13:35:35 -04:00
Clayton Coleman 4f88b778a6 Evolve the api.Status object with Reason/Details
Contains breaking API change on api.Status#Details (type change)

Turn Details from string -> StatusDetails - a general
bucket for keyed error behavior.  Define an open enumeration
ReasonType exposed as Reason on the status object to provide
machine readable subcategorization beyond HTTP Status Code. Define
a human readable field Message which is common convention (previously
this was joined into Details).

Precedence order: HTTP Status Code, Reason, Details. apiserver would
impose restraints on the ReasonTypes defined by the main apiobject,
and ensure their use is consistent.

There are four long term scenarios this change supports:

1. Allow a client access to a machine readable field that can be
   easily switched on for improving or translating the generic
   server Message.

2. Return a 404 when a composite operation on multiple resources
   fails with enough data so that a client can distinguish which
   item does not exist.  E.g. resource Parent and resource Child,
   POST /parents/1/children to create a new Child, but /parents/1
   is deleted.  POST returns 404, ReasonTypeNotFound, and
   Details.ID = "1", Details.Kind = "parent"

3. Allow a client to receive validation data that is keyed by
   attribute for building user facing UIs around field submission.
   Validation is usually expressed as map[string][]string, but
   that type is less appropriate for many other uses.

4. Allow specific API errors to return more granular failure status
   for specific operations.  An example might be a minion proxy,
   where the operation that failed may be both proxying OR the
   minion itself.  In this case a reason may be defined "proxy_failed"
   corresponding to 502, where the Details field may be extended
   to contain a nested error object.

At this time only ID and Kind are exposed
2014-08-05 16:17:53 -04:00
Clayton Coleman 75aa364b3c /api/v1beta1/operations was returning Not Found
Splitting an empty string returns []string{""}, not []string{}
2014-08-03 19:35:17 -04:00
Clayton Coleman e64a393e1a Move handle* methods to their respective locations
Fix names
2014-07-30 17:15:09 -04:00
Yifan Gu 0e9e2ee7f4 Changed op.notify<-true to close(op.notify). 2014-07-15 15:08:04 -07:00
Daniel Smith 61917a0628 Revert "Changed op.notify<-true to close(op.notify)." 2014-07-15 10:34:05 -07:00
Yifan Gu 90cc060699 Changed op.notify<-true to close(op.notify). 2014-07-15 00:29:43 -07:00
Yuki Yugui Sonoda 5cfbed4453 Fixes golint errors in pkg/apiserver 2014-07-08 16:10:11 +09:00
Daniel Smith afd13edd6a Address comments; also, demonstrate one more property in test. 2014-06-26 11:36:15 -07:00
Daniel Smith 59a6489e84 Add tracked operations to apiserver 2014-06-26 10:33:21 -07:00