projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix type of ContainerRequestState consts.
[arvados.git]
/
sdk
/
go
/
arvadosclient
/
arvadosclient.go
diff --git
a/sdk/go/arvadosclient/arvadosclient.go
b/sdk/go/arvadosclient/arvadosclient.go
index 9247bc4a33fd38ca4406119bb44981edd574ab36..e2c046662769f4ebd3956394375ab59cde7ebe51 100644
(file)
--- a/
sdk/go/arvadosclient/arvadosclient.go
+++ b/
sdk/go/arvadosclient/arvadosclient.go
@@
-24,7
+24,7
@@
import (
"sync"
"time"
"sync"
"time"
- "git.
curoverse.com
/arvados.git/sdk/go/arvados"
+ "git.
arvados.org
/arvados.git/sdk/go/arvados"
)
type StringMatcher func(string) bool
)
type StringMatcher func(string) bool
@@
-122,6
+122,9
@@
type ArvadosClient struct {
// Number of retries
Retries int
// Number of retries
Retries int
+
+ // X-Request-Id for outgoing requests
+ RequestID string
}
var CertFiles = []string{
}
var CertFiles = []string{
@@
-170,8
+173,11
@@
func New(c *arvados.Client) (*ArvadosClient, error) {
ApiServer: c.APIHost,
ApiToken: c.AuthToken,
ApiInsecure: c.Insecure,
ApiServer: c.APIHost,
ApiToken: c.AuthToken,
ApiInsecure: c.Insecure,
- Client: &http.Client{Transport: &http.Transport{
- TLSClientConfig: MakeTLSConfig(c.Insecure)}},
+ Client: &http.Client{
+ Timeout: 5 * time.Minute,
+ Transport: &http.Transport{
+ TLSClientConfig: MakeTLSConfig(c.Insecure)},
+ },
External: false,
Retries: 2,
KeepServiceURIs: c.KeepServiceURIs,
External: false,
Retries: 2,
KeepServiceURIs: c.KeepServiceURIs,
@@
-266,6
+272,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))
// 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")
}
if c.External {
req.Header.Add("X-External-Client", "1")
}