17119: merge SharedOptions into ListOptions, which now gets an extra
authorWard Vandewege <ward@curii.com>
Tue, 23 Feb 2021 15:55:15 +0000 (10:55 -0500)
committerWard Vandewege <ward@curii.com>
Tue, 23 Feb 2021 22:10:28 +0000 (17:10 -0500)
       'Include' field (unused except optionally when requesting the
       shared groups list).

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

lib/controller/federation/conn.go
lib/controller/router/router.go
lib/controller/rpc/conn.go
sdk/go/arvados/api.go
sdk/go/arvadostest/api.go

index 88648fbb191833767cda02baebe3c7d5db0c9996..51cf7f55e8e063fe15cfadecea5809cf768e7090 100644 (file)
@@ -422,7 +422,7 @@ func (conn *Conn) GroupContents(ctx context.Context, options arvados.ContentsOpt
        return conn.chooseBackend(options.UUID).GroupContents(ctx, options)
 }
 
        return conn.chooseBackend(options.UUID).GroupContents(ctx, options)
 }
 
-func (conn *Conn) GroupShared(ctx context.Context, options arvados.SharedOptions) (arvados.GroupList, error) {
+func (conn *Conn) GroupShared(ctx context.Context, options arvados.ListOptions) (arvados.GroupList, error) {
        // FIXME is this right?? We don't have options.UUID to cue the chooseBackend off
        return conn.chooseBackend(conn.cluster.ClusterID).GroupShared(ctx, options)
 }
        // FIXME is this right?? We don't have options.UUID to cue the chooseBackend off
        return conn.chooseBackend(conn.cluster.ClusterID).GroupShared(ctx, options)
 }
index 3f4a7e30b1cb61337b90cd103adcdc3f368e055f..79afa9dfac6ea50e9c01134acda8843987c6c013 100644 (file)
@@ -265,9 +265,9 @@ func (rtr *router) addRoutes() {
                },
                {
                        arvados.EndpointGroupShared,
                },
                {
                        arvados.EndpointGroupShared,
-                       func() interface{} { return &arvados.SharedOptions{Limit: -1} },
+                       func() interface{} { return &arvados.ListOptions{Limit: -1} },
                        func(ctx context.Context, opts interface{}) (interface{}, error) {
                        func(ctx context.Context, opts interface{}) (interface{}, error) {
-                               return rtr.backend.GroupShared(ctx, *opts.(*arvados.SharedOptions))
+                               return rtr.backend.GroupShared(ctx, *opts.(*arvados.ListOptions))
                        },
                },
                {
                        },
                },
                {
index e44a8e2d3d5c10c3e519627bb8e191147d846694..7d221cfe7731db671006208f49f73b1d3e5438db 100644 (file)
@@ -451,7 +451,7 @@ func (conn *Conn) GroupContents(ctx context.Context, options arvados.ContentsOpt
        return resp, err
 }
 
        return resp, err
 }
 
-func (conn *Conn) GroupShared(ctx context.Context, options arvados.SharedOptions) (arvados.GroupList, error) {
+func (conn *Conn) GroupShared(ctx context.Context, options arvados.ListOptions) (arvados.GroupList, error) {
        ep := arvados.EndpointGroupShared
        var resp arvados.GroupList
        err := conn.requestAndDecode(ctx, &resp, ep, nil, options)
        ep := arvados.EndpointGroupShared
        var resp arvados.GroupList
        err := conn.requestAndDecode(ctx, &resp, ep, nil, options)
index 107d2b39260ecd96ee0c417446b07bc277d84f31..13d09872b24d4226bdf70c7e8bf68a48f3e4023e 100644 (file)
@@ -118,6 +118,7 @@ type ListOptions struct {
        IncludeOldVersions bool                   `json:"include_old_versions"`
        BypassFederation   bool                   `json:"bypass_federation"`
        ForwardedFor       string                 `json:"forwarded_for,omitempty"`
        IncludeOldVersions bool                   `json:"include_old_versions"`
        BypassFederation   bool                   `json:"bypass_federation"`
        ForwardedFor       string                 `json:"forwarded_for,omitempty"`
+       Include            string                 `json:"include"`
 }
 
 type CreateOptions struct {
 }
 
 type CreateOptions struct {
@@ -145,17 +146,6 @@ type ContentsOptions struct {
        ExcludeHomeProject bool     `json:"exclude_home_project"`
 }
 
        ExcludeHomeProject bool     `json:"exclude_home_project"`
 }
 
-type SharedOptions struct {
-       UUID    string   `json:"uuid,omitempty"`
-       Select  []string `json:"select"`
-       Filters []Filter `json:"filters"`
-       Limit   int64    `json:"limit"`
-       Offset  int64    `json:"offset"`
-       Count   string   `json:"count"`
-       Order   []string `json:"order"`
-       Include string   `json:"include"`
-}
-
 type UpdateUUIDOptions struct {
        UUID    string `json:"uuid"`
        NewUUID string `json:"new_uuid"`
 type UpdateUUIDOptions struct {
        UUID    string `json:"uuid"`
        NewUUID string `json:"new_uuid"`
@@ -240,7 +230,7 @@ type API interface {
        GroupGet(ctx context.Context, options GetOptions) (Group, error)
        GroupList(ctx context.Context, options ListOptions) (GroupList, error)
        GroupContents(ctx context.Context, options ContentsOptions) (ObjectList, error)
        GroupGet(ctx context.Context, options GetOptions) (Group, error)
        GroupList(ctx context.Context, options ListOptions) (GroupList, error)
        GroupContents(ctx context.Context, options ContentsOptions) (ObjectList, error)
-       GroupShared(ctx context.Context, options SharedOptions) (GroupList, error)
+       GroupShared(ctx context.Context, options ListOptions) (GroupList, error)
        GroupDelete(ctx context.Context, options DeleteOptions) (Group, error)
        GroupUntrash(ctx context.Context, options UntrashOptions) (Group, error)
        SpecimenCreate(ctx context.Context, options CreateOptions) (Specimen, error)
        GroupDelete(ctx context.Context, options DeleteOptions) (Group, error)
        GroupUntrash(ctx context.Context, options UntrashOptions) (Group, error)
        SpecimenCreate(ctx context.Context, options CreateOptions) (Specimen, error)
index c90933bc1ebc79f53619ae845609cee8ddc22b32..9b418e674e4bc6f60e638a22b71b5056b03c8b94 100644 (file)
@@ -149,7 +149,7 @@ func (as *APIStub) GroupContents(ctx context.Context, options arvados.ContentsOp
        as.appendCall(ctx, as.GroupContents, options)
        return arvados.ObjectList{}, as.Error
 }
        as.appendCall(ctx, as.GroupContents, options)
        return arvados.ObjectList{}, as.Error
 }
-func (as *APIStub) GroupShared(ctx context.Context, options arvados.SharedOptions) (arvados.GroupList, error) {
+func (as *APIStub) GroupShared(ctx context.Context, options arvados.ListOptions) (arvados.GroupList, error) {
        as.appendCall(ctx, as.GroupShared, options)
        return arvados.GroupList{}, as.Error
 }
        as.appendCall(ctx, as.GroupShared, options)
        return arvados.GroupList{}, as.Error
 }