-
Notifications
You must be signed in to change notification settings - Fork 14
Config URI format
Stu Arnett edited this page Nov 15, 2016
·
10 revisions
Since v2.2.4, a mechanism exists that allows users to specify the complete ECS S3 client configuration in a single string by using a Config URI. A Config URI follows the standard URI spec:
<protocol>://<host>[:<port>][/path][?<param-key>=<param-value>][&<param-key>=<param-value>][...]
To convert a config URI to an S3Config object and back, use the following code:
ConfigUri<S3Config> s3ConfigUri = new ConfigUri<S3Config>(S3Config.class);
S3Config s3Config = s3ConfigUri.parseUri(uri); // convert a config URI to S3Config instance
uri = s3ConfigUri.generateUri(s3Config); // convert an S3Config instance to a config URI
Here are some examples.
-
A simple S3 client config URI for ECS Test Drive.
https://object.ecstestdrive.com?smartClient=false&useVHost=true&identity=<access-key>&secretKey=<secret-key>
-
A standard S3 client config URI for a local ECS deployment using the smart-client and unencrypted traffic.
http://10.1.83.51:9020?identity=<access-key>&secretKey=<secret-key>
-
A standard S3 client config URI for a 3-VDC deployment using encrypted traffic and geo-pinning.
https://10.1.100.11:9021?vdcs=10.1.100.11,10.1.100.12&vdcs=10.2.100.11,10.2.100.12&vdcs=10.3.100.11,10.3.100.12&geoPinningEnabled=true&geoReadRetryFailover=true&identity=<access-key>&secretKey=<secret-key>
The ECS S3 client config URI has the following available parameters.
-
checksumEnabled
-true
orfalse
, defaults totrue
. -
chunkedEncodingSize
- integer number of bytes, defaults to2MB
. -
faultInjectionRate
- long integer, defaults to0.0f
(no fault injection). -
geoPinningEnabled
-true
orfalse
, defaults tofalse
. -
geoReadRetryFailover
-true
orfalse
, defaults tofalse
. -
identity
- any string, no default. -
initialRetryDelay
- integer number of milliseconds, defaults to1000
. -
namespace
- any string, no default. -
port
- integer, defaults to9020
forHTTP
and9021
forHTTPS
protocols,-1
otherwise. Must be specified following URI syntax, not in the query. -
protocol
-HTTP
orHTTPS
, case insensitive. Must be specified following URI syntax, not in the query. -
retryBufferSize
- integer number of bytes, defaults to2MB
. -
retryEnabled
-true
orfalse
, defaults totrue
. -
retryLimit
- integer, defaults to3
. -
rootContext
- any string. Must be set following URI syntax (as the path), not in the query. -
secretKey
- any string, no default. -
serverClockSkew
- long integer number of milliseconds, defaults to0
. -
signMetadataSearch
-true
orfalse
, defaults totrue
. -
signNamespace
-true
orfalse
, defaults totrue
. -
smartClient
-true
orfalse
, defaults totrue
. -
userAgent
- any string, defaults toECS Java SDK
plus version numbers and operating system information. -
useVHost
-true
orfalse
(defaultfalse
). -
vdcs
- each instance is a single vdc, represented as a comma-separated list of hosts, with the first used as the name. Multiple instances are allowed. NOTE: You can also specify a single host in the URI, before the query, and that will be used as a single one-node VDC if novdcs
are specified in the query. - Custom config properties - passed to the HTTP client implementation, set in the query as
properties.<name>=<value>
. Example: to set Jersey's socket connect timeout to 50 secs:properties.com.sun.jersey.client.property.connectTimeout=50000
.