Merge branch '13383-trash-workers'
[arvados.git] / sdk / go / arvadosclient / arvadosclient.go
index 4cfda94581518fd9360ebc4f3268e231893797c7..91da5a3fd62ce6eb099e4ce0c0e206a1220268ae 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: Apache-2.0
+
 /* Simple Arvados Go SDK for communicating with API server. */
 
 package arvadosclient
@@ -118,6 +122,9 @@ type ArvadosClient struct {
 
        // Number of retries
        Retries int
+
+       // X-Request-Id for outgoing requests
+       RequestID string
 }
 
 var CertFiles = []string{
@@ -262,6 +269,9 @@ func (c *ArvadosClient) CallRaw(method string, resourceType string, uuid string,
 
                // Add api token header
                req.Header.Add("Authorization", fmt.Sprintf("OAuth2 %s", c.ApiToken))
+               if c.RequestID != "" {
+                       req.Header.Add("X-Request-Id", c.RequestID)
+               }
                if c.External {
                        req.Header.Add("X-External-Client", "1")
                }