veyron2/services/mgmt/node: rename node->device, cl 1 of N (go/vissue/496)

Starting by renaming the VDL interface Node->Device

Change-Id: I0fc383529665d50993f37cc2ec5793ae7588b812
diff --git a/services/mgmt/node/impl/dispatcher.go b/services/mgmt/node/impl/dispatcher.go
index d5fd892..5d3cb2b 100644
--- a/services/mgmt/node/impl/dispatcher.go
+++ b/services/mgmt/node/impl/dispatcher.go
@@ -355,7 +355,7 @@
 	// prefix.
 	switch components[0] {
 	case nodeSuffix:
-		receiver := node.NodeServer(&nodeService{
+		receiver := node.DeviceServer(&nodeService{
 			callback: d.internal.callback,
 			updating: d.internal.updating,
 			config:   d.config,
diff --git a/services/mgmt/node/impl/impl_test.go b/services/mgmt/node/impl/impl_test.go
index eefe69e..09e4f6d 100644
--- a/services/mgmt/node/impl/impl_test.go
+++ b/services/mgmt/node/impl/impl_test.go
@@ -806,7 +806,7 @@
 
 	*envelope = envelopeFromShell(sh, nil, appCmd, "google naps", "trapp")
 
-	nodeStub := node.NodeClient("nm//nm")
+	nodeStub := node.DeviceClient("nm//nm")
 	selfRT := globalRT
 	otherRT := newRuntime(t)
 	defer otherRT.Cleanup()
@@ -892,7 +892,7 @@
 	// Create an envelope for an app.
 	*envelope = envelopeFromShell(sh, nil, appCmd, "google naps")
 
-	nodeStub := node.NodeClient("nm//nm")
+	nodeStub := node.DeviceClient("nm//nm")
 	acl, etag, err := nodeStub.GetACL(selfRT.NewContext())
 	if err != nil {
 		t.Fatalf("GetACL failed:%v", err)
@@ -1225,7 +1225,7 @@
 	}
 }
 
-func listAndVerifyAssociations(t *testing.T, stub node.NodeClientMethods, run veyron2.Runtime, expected []node.Association) {
+func listAndVerifyAssociations(t *testing.T, stub node.DeviceClientMethods, run veyron2.Runtime, expected []node.Association) {
 	assocs, err := stub.ListAssociations(run.NewContext())
 	if err != nil {
 		t.Fatalf("ListAssociations failed %v", err)
@@ -1267,7 +1267,7 @@
 	pid := readPID(t, nms)
 	defer syscall.Kill(pid, syscall.SIGINT)
 
-	nodeStub := node.NodeClient("nm//nm")
+	nodeStub := node.DeviceClient("nm//nm")
 
 	// Attempt to list associations on the node manager without having
 	// claimed it.
@@ -1377,7 +1377,7 @@
 	pid := readPID(t, nms)
 	defer syscall.Kill(pid, syscall.SIGINT)
 
-	nodeStub := node.NodeClient("nm//nm")
+	nodeStub := node.DeviceClient("nm//nm")
 
 	// Create the local server that the app uses to tell us which system name
 	// the node manager wished to run it as.
diff --git a/services/mgmt/node/impl/node_service.go b/services/mgmt/node/impl/node_service.go
index 380a3f0..f46b086 100644
--- a/services/mgmt/node/impl/node_service.go
+++ b/services/mgmt/node/impl/node_service.go
@@ -240,7 +240,7 @@
 	}
 	// Check that invoking Revert() succeeds.
 	childName = naming.Join(childName, "nm")
-	nmClient := node.NodeClient(childName)
+	nmClient := node.DeviceClient(childName)
 	linkOld, pathOld, err := i.getCurrentFileInfo()
 	if err != nil {
 		return verror2.Make(ErrOperationFailed, ctx)
diff --git a/services/mgmt/node/impl/util_test.go b/services/mgmt/node/impl/util_test.go
index 1d0e119..c210818 100644
--- a/services/mgmt/node/impl/util_test.go
+++ b/services/mgmt/node/impl/util_test.go
@@ -203,9 +203,9 @@
 // The following set of functions are convenience wrappers around Update and
 // Revert for node manager.
 
-func nodeStub(name string) node.NodeClientMethods {
+func nodeStub(name string) node.DeviceClientMethods {
 	nodeName := naming.Join(name, "nm")
-	return node.NodeClient(nodeName)
+	return node.DeviceClient(nodeName)
 }
 
 func updateNodeExpectError(t *testing.T, name string, errID verror.ID) {
diff --git a/tools/mgmt/nodex/associate_impl.go b/tools/mgmt/nodex/associate_impl.go
index 0b529f1..479046e 100644
--- a/tools/mgmt/nodex/associate_impl.go
+++ b/tools/mgmt/nodex/associate_impl.go
@@ -25,7 +25,7 @@
 
 	ctx, cancel := runtime.NewContext().WithTimeout(time.Minute)
 	defer cancel()
-	assocs, err := node.NodeClient(args[0]).ListAssociations(ctx)
+	assocs, err := node.DeviceClient(args[0]).ListAssociations(ctx)
 	if err != nil {
 		return fmt.Errorf("ListAssociations failed: %v", err)
 	}
@@ -54,7 +54,7 @@
 	}
 	ctx, cancel := runtime.NewContext().WithTimeout(time.Minute)
 	defer cancel()
-	return node.NodeClient(args[0]).AssociateAccount(ctx, args[2:], args[1])
+	return node.DeviceClient(args[0]).AssociateAccount(ctx, args[2:], args[1])
 }
 
 var cmdRemove = &cmdline.Command{
@@ -74,7 +74,7 @@
 	}
 	ctx, cancel := runtime.NewContext().WithTimeout(time.Minute)
 	defer cancel()
-	return node.NodeClient(args[0]).AssociateAccount(ctx, args[1:], "")
+	return node.DeviceClient(args[0]).AssociateAccount(ctx, args[1:], "")
 }
 
 func associateRoot() *cmdline.Command {
diff --git a/tools/mgmt/nodex/impl.go b/tools/mgmt/nodex/impl.go
index c6112f1..51fb0f6 100644
--- a/tools/mgmt/nodex/impl.go
+++ b/tools/mgmt/nodex/impl.go
@@ -91,7 +91,7 @@
 		return cmd.UsageErrorf("claim: incorrect number of arguments, expected %d, got %d", expected, got)
 	}
 	nodeName, grant := args[0], args[1]
-	if err := node.NodeClient(nodeName).Claim(runtime.NewContext(), &granter{p: runtime.Principal(), extension: grant}); err != nil {
+	if err := node.DeviceClient(nodeName).Claim(runtime.NewContext(), &granter{p: runtime.Principal(), extension: grant}); err != nil {
 		return fmt.Errorf("Claim failed: %v", err)
 	}
 	fmt.Fprintln(cmd.Stdout(), "Successfully claimed.")
diff --git a/tools/mgmt/nodex/nodemanager_mock_test.go b/tools/mgmt/nodex/nodemanager_mock_test.go
index 83141da..82b1593 100644
--- a/tools/mgmt/nodex/nodemanager_mock_test.go
+++ b/tools/mgmt/nodex/nodemanager_mock_test.go
@@ -157,7 +157,7 @@
 }
 
 func (d *dispatcher) Lookup(suffix string) (interface{}, security.Authorizer, error) {
-	return node.NodeServer(&mockNodeInvoker{tape: d.tape, t: d.t}), nil, nil
+	return node.DeviceServer(&mockNodeInvoker{tape: d.tape, t: d.t}), nil, nil
 }
 
 func startServer(t *testing.T, r veyron2.Runtime, tape *Tape) (ipc.Server, naming.Endpoint, error) {