9374: Add arvados.APIClientAuthorization.
authorTom Clegg <tom@curoverse.com>
Fri, 10 Jun 2016 03:18:24 +0000 (23:18 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 15 Jun 2016 13:50:03 +0000 (09:50 -0400)
sdk/go/arvados/api_client_authorization.go [new file with mode: 0644]
sdk/go/dispatch/dispatch.go
services/crunch-run/crunchrun.go

diff --git a/sdk/go/arvados/api_client_authorization.go b/sdk/go/arvados/api_client_authorization.go
new file mode 100644 (file)
index 0000000..b7f9db6
--- /dev/null
@@ -0,0 +1,12 @@
+package arvados
+
+// APIClientAuthorization is an arvados#apiClientAuthorization resource.
+type APIClientAuthorization struct {
+       UUID     string `json:"uuid"`
+       APIToken string `json:"api_token"`
+}
+
+// APIClientAuthorizationList is an arvados#apiClientAuthorizationList resource.
+type APIClientAuthorizationList struct {
+       Items []APIClientAuthorization `json:"items"`
+}
index 4b66c23b7c8a6c5291d9d6cfa3aaafb0c7a66883..ce536de47a07be129d7f9e1f9ed730bdf30f6918 100644 (file)
@@ -22,15 +22,6 @@ const (
        Cancelled = arvados.ContainerStateCancelled
 )
 
-type apiClientAuthorization struct {
-       UUID     string `json:"uuid"`
-       APIToken string `json:"api_token"`
-}
-
-type apiClientAuthorizationList struct {
-       Items []apiClientAuthorization `json:"items"`
-}
-
 // Dispatcher holds the state of the dispatcher
 type Dispatcher struct {
        // The Arvados client
@@ -58,7 +49,7 @@ type Dispatcher struct {
 
        mineMutex  sync.Mutex
        mineMap    map[string]chan arvados.Container
-       Auth       apiClientAuthorization
+       Auth       arvados.APIClientAuthorization
        containers chan arvados.Container
 }
 
index 9eee309f4856cf04fc779e913081a4997f51715c..c4ea92938af5e7d374bade3f8fa0d2fd500caa39 100644 (file)
@@ -46,12 +46,6 @@ type CollectionRecord struct {
        PortableDataHash string `json:"portable_data_hash"`
 }
 
-// APIClientAuthorization is an arvados#api_client_authorization resource.
-type APIClientAuthorization struct {
-       UUID     string `json:"uuid"`
-       APIToken string `json:"api_token"`
-}
-
 // NewLogWriter is a factory function to create a new log writer.
 type NewLogWriter func(name string) io.WriteCloser
 
@@ -639,7 +633,7 @@ func (runner *ContainerRunner) ContainerToken() (string, error) {
                return runner.token, nil
        }
 
-       var auth APIClientAuthorization
+       var auth arvados.APIClientAuthorization
        err := runner.ArvClient.Call("GET", "containers", runner.Container.UUID, "auth", nil, &auth)
        if err != nil {
                return "", err