14287: Move federation.Interface to arvados.API.
authorTom Clegg <tclegg@veritasgenetics.com>
Thu, 13 Jun 2019 20:58:43 +0000 (16:58 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Mon, 17 Jun 2019 13:54:39 +0000 (09:54 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

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

index 0e9b285f9435fe74b3b5874790354a1cc3b368bb..3b60328954eb8a73cecdf9c648ff29b40a3ddf05 100644 (file)
@@ -21,38 +21,13 @@ import (
        "git.curoverse.com/arvados.git/sdk/go/ctxlog"
 )
 
-type Interface interface {
-       CollectionCreate(ctx context.Context, options arvados.CreateOptions) (arvados.Collection, error)
-       CollectionUpdate(ctx context.Context, options arvados.UpdateOptions) (arvados.Collection, error)
-       CollectionGet(ctx context.Context, options arvados.GetOptions) (arvados.Collection, error)
-       CollectionList(ctx context.Context, options arvados.ListOptions) (arvados.CollectionList, error)
-       CollectionProvenance(ctx context.Context, options arvados.GetOptions) (map[string]interface{}, error)
-       CollectionUsedBy(ctx context.Context, options arvados.GetOptions) (map[string]interface{}, error)
-       CollectionDelete(ctx context.Context, options arvados.DeleteOptions) (arvados.Collection, error)
-       CollectionTrash(ctx context.Context, options arvados.DeleteOptions) (arvados.Collection, error)
-       CollectionUntrash(ctx context.Context, options arvados.UntrashOptions) (arvados.Collection, error)
-       ContainerCreate(ctx context.Context, options arvados.CreateOptions) (arvados.Container, error)
-       ContainerUpdate(ctx context.Context, options arvados.UpdateOptions) (arvados.Container, error)
-       ContainerGet(ctx context.Context, options arvados.GetOptions) (arvados.Container, error)
-       ContainerList(ctx context.Context, options arvados.ListOptions) (arvados.ContainerList, error)
-       ContainerDelete(ctx context.Context, options arvados.DeleteOptions) (arvados.Container, error)
-       ContainerLock(ctx context.Context, options arvados.GetOptions) (arvados.Container, error)
-       ContainerUnlock(ctx context.Context, options arvados.GetOptions) (arvados.Container, error)
-       SpecimenCreate(ctx context.Context, options arvados.CreateOptions) (arvados.Specimen, error)
-       SpecimenUpdate(ctx context.Context, options arvados.UpdateOptions) (arvados.Specimen, error)
-       SpecimenGet(ctx context.Context, options arvados.GetOptions) (arvados.Specimen, error)
-       SpecimenList(ctx context.Context, options arvados.ListOptions) (arvados.SpecimenList, error)
-       SpecimenDelete(ctx context.Context, options arvados.DeleteOptions) (arvados.Specimen, error)
-       APIClientAuthorizationCurrent(ctx context.Context, options arvados.GetOptions) (arvados.APIClientAuthorization, error)
-}
-
 type Conn struct {
        cluster *arvados.Cluster
        local   backend
        remotes map[string]backend
 }
 
-func New(cluster *arvados.Cluster) Interface {
+func New(cluster *arvados.Cluster) arvados.API {
        local := railsproxy.NewConn(cluster)
        remotes := map[string]backend{}
        for id, remote := range cluster.RemoteClusters {
@@ -316,7 +291,7 @@ func (conn *Conn) APIClientAuthorizationCurrent(ctx context.Context, options arv
        return conn.chooseBackend(options.UUID).APIClientAuthorizationCurrent(ctx, options)
 }
 
-type backend interface{ Interface }
+type backend interface{ arvados.API }
 
 type notFoundError struct{}
 
index 6f2b0f5cb2e4579ce3538555bd5cd906158398f0..1d08046b691544f4e29e297b6a1e855e75ef13a5 100644 (file)
@@ -21,7 +21,7 @@ import (
 
 type router struct {
        mux *httprouter.Router
-       fed federation.Interface
+       fed arvados.API
 }
 
 func New(cluster *arvados.Cluster) *router {
index ec44d6a5a16447c440370a35b51b0567310cdfef..71265756da9f4c691235efd80bdab35dba22fc3c 100644 (file)
@@ -4,6 +4,8 @@
 
 package arvados
 
+import "context"
+
 type APIEndpoint struct {
        Method string
        Path   string
@@ -76,3 +78,28 @@ type UpdateOptions struct {
 type DeleteOptions struct {
        UUID string `json:"uuid"`
 }
+
+type API interface {
+       CollectionCreate(ctx context.Context, options CreateOptions) (Collection, error)
+       CollectionUpdate(ctx context.Context, options UpdateOptions) (Collection, error)
+       CollectionGet(ctx context.Context, options GetOptions) (Collection, error)
+       CollectionList(ctx context.Context, options ListOptions) (CollectionList, error)
+       CollectionProvenance(ctx context.Context, options GetOptions) (map[string]interface{}, error)
+       CollectionUsedBy(ctx context.Context, options GetOptions) (map[string]interface{}, error)
+       CollectionDelete(ctx context.Context, options DeleteOptions) (Collection, error)
+       CollectionTrash(ctx context.Context, options DeleteOptions) (Collection, error)
+       CollectionUntrash(ctx context.Context, options UntrashOptions) (Collection, error)
+       ContainerCreate(ctx context.Context, options CreateOptions) (Container, error)
+       ContainerUpdate(ctx context.Context, options UpdateOptions) (Container, error)
+       ContainerGet(ctx context.Context, options GetOptions) (Container, error)
+       ContainerList(ctx context.Context, options ListOptions) (ContainerList, error)
+       ContainerDelete(ctx context.Context, options DeleteOptions) (Container, error)
+       ContainerLock(ctx context.Context, options GetOptions) (Container, error)
+       ContainerUnlock(ctx context.Context, options GetOptions) (Container, error)
+       SpecimenCreate(ctx context.Context, options CreateOptions) (Specimen, error)
+       SpecimenUpdate(ctx context.Context, options UpdateOptions) (Specimen, error)
+       SpecimenGet(ctx context.Context, options GetOptions) (Specimen, error)
+       SpecimenList(ctx context.Context, options ListOptions) (SpecimenList, error)
+       SpecimenDelete(ctx context.Context, options DeleteOptions) (Specimen, error)
+       APIClientAuthorizationCurrent(ctx context.Context, options GetOptions) (APIClientAuthorization, error)
+}