[ARVADOS] updated: 1.3.0-2901-g3d4c32318

Git user git at public.arvados.org
Mon Sep 14 16:26:10 UTC 2020


Summary of changes:
 lib/controller/federation/conn.go          | 4 ++--
 lib/controller/forecast/controller.go      | 4 ++--
 lib/controller/forecast/controller_test.go | 2 +-
 lib/controller/handler.go                  | 2 ++
 lib/controller/localdb/conn.go             | 2 +-
 lib/controller/router/router.go            | 7 +++++++
 lib/controller/rpc/conn.go                 | 2 +-
 sdk/go/arvados/api.go                      | 2 +-
 sdk/go/arvados/forecast.go                 | 8 ++++----
 sdk/go/arvadostest/api.go                  | 4 ++--
 10 files changed, 23 insertions(+), 14 deletions(-)

       via  3d4c323185e49c5fac8cd2f60d1e48b4246713c8 (commit)
      from  ad05fa2c2bc8b8ee1a34560d3ee345cfb42906a8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 3d4c323185e49c5fac8cd2f60d1e48b4246713c8
Author: Nico Cesar <nico at nicocesar.com>
Date:   Mon Sep 14 12:25:17 2020 -0400

    replaced  arvados.ForecastDatapointsOptions for arvados.GetOptions
    
    refs #16462
    
    Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico at curii.com>

diff --git a/lib/controller/federation/conn.go b/lib/controller/federation/conn.go
index cf89f671b..0c6c28e74 100644
--- a/lib/controller/federation/conn.go
+++ b/lib/controller/federation/conn.go
@@ -323,8 +323,8 @@ func (conn *Conn) ContainerUnlock(ctx context.Context, options arvados.GetOption
 	return conn.chooseBackend(options.UUID).ContainerUnlock(ctx, options)
 }
 
-func (conn *Conn) ForecastDatapoints(ctx context.Context, opts arvados.ForecastDatapointsOptions) (resp arvados.ForecastDatapointsResponse, err error) {
-	return conn.chooseBackend(opts.ClusterID).ForecastDatapoints(ctx, opts)
+func (conn *Conn) ForecastDatapoints(ctx context.Context, options arvados.GetOptions) (resp arvados.ForecastDatapointsResponse, err error) {
+	return conn.chooseBackend(options.UUID).ForecastDatapoints(ctx, options)
 }
 
 func (conn *Conn) SpecimenList(ctx context.Context, options arvados.ListOptions) (arvados.SpecimenList, error) {
diff --git a/lib/controller/forecast/controller.go b/lib/controller/forecast/controller.go
index 07a2f483c..201584270 100644
--- a/lib/controller/forecast/controller.go
+++ b/lib/controller/forecast/controller.go
@@ -31,7 +31,7 @@ var crs []arvados.ContainerRequest
 // ForecastDatapoints returns the datapoints we have stored in the database
 // for a Container Request UUID. This will follow the specs described in
 // https://dev.arvados.org/projects/arvados/wiki/API_HistoricalForcasting_data_for_CR
-func (ctrl *Controller) ForecastDatapoints(ctx context.Context, opts arvados.ForecastDatapointsOptions) (resp arvados.ForecastDatapointsResponse, err error) {
+func (ctrl *Controller) ForecastDatapoints(ctx context.Context, opts arvados.GetOptions) (resp arvados.ForecastDatapointsResponse, err error) {
 
 	// Direct database access
 	tx, err := ctrlctx.CurrentTx(ctx)
@@ -39,7 +39,7 @@ func (ctrl *Controller) ForecastDatapoints(ctx context.Context, opts arvados.For
 		return
 	}
 
-	query := fmt.Sprintf(`select * from container_requests where requesting_container_uuid = '%s'`, opts.ContainerRequestUUID)
+	query := fmt.Sprintf(`select * from container_requests where requesting_container_uuid = '%s'`, opts.UUID)
 	something, err := tx.QueryContext(ctx, query)
 
 	if err != nil {
diff --git a/lib/controller/forecast/controller_test.go b/lib/controller/forecast/controller_test.go
index bddc0f136..639870b9a 100644
--- a/lib/controller/forecast/controller_test.go
+++ b/lib/controller/forecast/controller_test.go
@@ -47,7 +47,7 @@ func (s *ForecastSuite) TearDownTest(c *check.C) {
 }
 
 func (s *ForecastSuite) TestDatapoints(c *check.C) {
-	_, err := s.ctrl.ForecastDatapoints(s.ctx, arvados.ForecastDatapointsOptions{ContainerRequestUUID: "test"})
+	_, err := s.ctrl.ForecastDatapoints(s.ctx, arvados.GetOptions{UUID: "test"})
 	c.Check(err, check.IsNil)
 	//c.Check(resp.Count, check.Equals, 29)
 	//c.Check(s.stub.Calls(s.stub.UserList), check.HasLen, 1)
diff --git a/lib/controller/handler.go b/lib/controller/handler.go
index 2dd1d816e..858f71edb 100644
--- a/lib/controller/handler.go
+++ b/lib/controller/handler.go
@@ -96,6 +96,8 @@ func (h *Handler) setup() {
 		mux.Handle("/arvados/v1/collections/", rtr)
 		mux.Handle("/arvados/v1/users", rtr)
 		mux.Handle("/arvados/v1/users/", rtr)
+		mux.Handle("/arvados/v1/container_requests/{uuid}/datapoints", rtr)
+		mux.Handle("/arvados/v1/container_requests/", rtr)
 		mux.Handle("/login", rtr)
 		mux.Handle("/logout", rtr)
 	}
diff --git a/lib/controller/localdb/conn.go b/lib/controller/localdb/conn.go
index 60c91515d..c4fe0879a 100644
--- a/lib/controller/localdb/conn.go
+++ b/lib/controller/localdb/conn.go
@@ -46,6 +46,6 @@ func (conn *Conn) UserAuthenticate(ctx context.Context, opts arvados.UserAuthent
 	return conn.loginController.UserAuthenticate(ctx, opts)
 }
 
-func (conn *Conn) ForecastDatapoints(ctx context.Context, opts arvados.ForecastDatapointsOptions) (resp arvados.ForecastDatapointsResponse, err error) {
+func (conn *Conn) ForecastDatapoints(ctx context.Context, opts arvados.GetOptions) (resp arvados.ForecastDatapointsResponse, err error) {
 	return conn.forecast.ForecastDatapoints(ctx, opts)
 }
diff --git a/lib/controller/router/router.go b/lib/controller/router/router.go
index 294452434..7813f5656 100644
--- a/lib/controller/router/router.go
+++ b/lib/controller/router/router.go
@@ -221,6 +221,13 @@ func (rtr *router) addRoutes() {
 				return rtr.backend.SpecimenDelete(ctx, *opts.(*arvados.DeleteOptions))
 			},
 		},
+		{
+			arvados.EndpointForecastDatapoint,
+			func() interface{} { return &arvados.GetOptions{} },
+			func(ctx context.Context, opts interface{}) (interface{}, error) {
+				return rtr.backend.ForecastDatapoints(ctx, *opts.(*arvados.GetOptions))
+			},
+		},
 		{
 			arvados.EndpointUserCreate,
 			func() interface{} { return &arvados.CreateOptions{} },
diff --git a/lib/controller/rpc/conn.go b/lib/controller/rpc/conn.go
index b6def3a20..0e61f4e56 100644
--- a/lib/controller/rpc/conn.go
+++ b/lib/controller/rpc/conn.go
@@ -287,7 +287,7 @@ func (conn *Conn) ContainerUnlock(ctx context.Context, options arvados.GetOption
 	return resp, err
 }
 
-func (conn *Conn) ForecastDatapoints(ctx context.Context, options arvados.ForecastDatapointsOptions) (arvados.ForecastDatapointsResponse, error) {
+func (conn *Conn) ForecastDatapoints(ctx context.Context, options arvados.GetOptions) (arvados.ForecastDatapointsResponse, error) {
 	ep := arvados.EndpointForecastDatapoint
 	var resp arvados.ForecastDatapointsResponse
 	err := conn.requestAndDecode(ctx, &resp, ep, nil, options)
diff --git a/sdk/go/arvados/api.go b/sdk/go/arvados/api.go
index 1943f321d..2a1ef9f81 100644
--- a/sdk/go/arvados/api.go
+++ b/sdk/go/arvados/api.go
@@ -176,7 +176,7 @@ type API interface {
 	ContainerDelete(ctx context.Context, options DeleteOptions) (Container, error)
 	ContainerLock(ctx context.Context, options GetOptions) (Container, error)
 	ContainerUnlock(ctx context.Context, options GetOptions) (Container, error)
-	ForecastDatapoints(ctx context.Context, opts ForecastDatapointsOptions) (resp ForecastDatapointsResponse, err error)
+	ForecastDatapoints(ctx context.Context, options GetOptions) (ForecastDatapointsResponse, 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)
diff --git a/sdk/go/arvados/forecast.go b/sdk/go/arvados/forecast.go
index b0ecd0f26..118f56ae4 100644
--- a/sdk/go/arvados/forecast.go
+++ b/sdk/go/arvados/forecast.go
@@ -18,10 +18,10 @@ type Datapoint struct {
 
 // ForecastDatapointsOptions will have the paramenter to fetch from the local or remote cluster
 // all datapoins
-type ForecastDatapointsOptions struct {
-	ClusterID            string `json:"cluster_id"`
-	ContainerRequestUUID string `json:"container_request_uuid"`
-}
+//type ForecastDatapointsOptions struct {
+//	ClusterID            string `json:"cluster_id"`
+//	ContainerRequestUUID string `json:"container_request_uuid"`
+//}
 
 // ForecastDatapointsResponse is the format that the user gets the data.
 type ForecastDatapointsResponse struct {
diff --git a/sdk/go/arvadostest/api.go b/sdk/go/arvadostest/api.go
index 6142291b1..1e22f61c4 100644
--- a/sdk/go/arvadostest/api.go
+++ b/sdk/go/arvadostest/api.go
@@ -105,8 +105,8 @@ func (as *APIStub) ContainerUnlock(ctx context.Context, options arvados.GetOptio
 	as.appendCall(as.ContainerUnlock, ctx, options)
 	return arvados.Container{}, as.Error
 }
-func (as *APIStub) ForecastDatapoints(ctx context.Context, opts arvados.ForecastDatapointsOptions) (resp arvados.ForecastDatapointsResponse, err error) {
-	as.appendCall(as.ForecastDatapoints, ctx, opts)
+func (as *APIStub) ForecastDatapoints(ctx context.Context, options arvados.GetOptions) (resp arvados.ForecastDatapointsResponse, err error) {
+	as.appendCall(as.ForecastDatapoints, ctx, options)
 	return arvados.ForecastDatapointsResponse{}, as.Error
 }
 func (as *APIStub) SpecimenCreate(ctx context.Context, options arvados.CreateOptions) (arvados.Specimen, error) {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list