/** * Factory method to create a new Amazon STS client using an array of configuration options: * * @param array|Collection $config Client configuration data * * @return self * @throws InvalidArgumentException * @link http://docs.aws.amazon.com/aws-sdk-php/guide/latest/configuration.html#client-configuration-options */ public static function factory($config = array()) { // Always need long term credentials if (!isset($config[Options::CREDENTIALS]) && isset($config[Options::TOKEN])) { throw new InvalidArgumentException('You must use long-term credentials with Amazon STS'); } // Construct the STS client with the client builder $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/sts-%s.php'))->build(); // Attach a listener to prevent AssumeRoleWithWebIdentity requests from being signed $client->getEventDispatcher()->addListener('command.before_send', function (Event $event) { /** @var AbstractCommand $command */ $command = $event['command']; if ($command->getName() === 'AssumeRoleWithWebIdentity') { /** @var EventDispatcher $dispatcher */ $dispatcher = $command->getRequest()->getEventDispatcher(); foreach ($dispatcher->getListeners('request.before_send') as $listener) { if (is_array($listener) && $listener[0] instanceof SignatureListener) { $dispatcher->removeListener('request.before_send', $listener); break; } } } }); return $client; }
/** * Factory method to create a new Amazon Simple Queue Service client using an array of configuration options. * * @param array|Collection $config Client configuration data * * @return self * @see \Aws\Common\Client\DefaultClient for a list of available configuration options */ public static function factory($config = array()) { $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/sqs-%s.php'))->build(); $client->addSubscriber(new QueueUrlListener()); $client->addSubscriber(new Md5ValidatorListener()); return $client; }
/** * Factory method to create a new Amazon CloudFront client using an array of configuration options. * * CloudFront specific options (in addition to the default client configuration options): * - key_pair_id: The ID of the key pair used to sign CloudFront URLs for private distributions. * - private_key: The filepath ot the private key used to sign CloudFront URLs for private distributions. * * @param array|Collection $config Client configuration data * * @return self * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options */ public static function factory($config = array()) { // Decide which signature to use if (isset($config[Options::VERSION]) && $config[Options::VERSION] < self::LATEST_API_VERSION) { $config[Options::SIGNATURE] = new CloudFrontSignature(); } // Instantiate the CloudFront client return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cloudfront-%s.php'))->setExceptionParser(new DefaultXmlExceptionParser())->build(); }
/** * Factory method to create a new Amazon DynamoDB Streams client using an array of configuration options. * * See http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options * * @param array|Collection $config Client configuration data * * @return self * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options */ public static function factory($config = array()) { // Configure the custom exponential backoff plugin for DynamoDB throttling $exceptionParser = new JsonQueryExceptionParser(); if (!isset($config[Options::BACKOFF])) { $config[Options::BACKOFF] = new BackoffPlugin(DynamoDbClient::createDynamoDbBackoffStrategy($exceptionParser)); } return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/dynamodbstreams-%s.php'))->setExceptionParser($exceptionParser)->build(); }
/** * Factory method to create a new Amazon CloudFront client using an array of configuration options. * * CloudFront specific options (in addition to the default client configuration options): * - key_pair_id: The ID of the key pair used to sign CloudFront URLs for private distributions. * - private_key: The filepath ot the private key used to sign CloudFront URLs for private distributions. * * @param array|Collection $config Client configuration data * * @return self * @see \Aws\Common\Client\DefaultClient for a list of other available configuration options */ public static function factory($config = array()) { // Decide which signature to use if (isset($config[Options::VERSION]) && $config[Options::VERSION] < self::LATEST_API_VERSION) { $config[Options::SIGNATURE] = new CloudFrontSignature(); } // Instantiate the CloudFront client return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cloudfront-%s.php'))->setExceptionParser(new DefaultXmlExceptionParser())->setIteratorsConfig(array('token_param' => 'Marker', 'token_key' => 'NextMarker', 'more_key' => 'IsTruncated', 'result_key' => 'Items', 'operations' => array('ListCloudFrontOriginAccessIdentities', 'ListDistributions', 'ListInvalidations', 'ListStreamingDistributions')))->build(); }
/** * Factory method to create a new Amazon DynamoDB client using an array of configuration options. * * @param array|Collection $config Client configuration data * * @return self * @see \Aws\Common\Client\DefaultClient for a list of available configuration options */ public static function factory($config = array()) { // Configure the custom exponential backoff plugin for DynamoDB throttling $exceptionParser = new JsonQueryExceptionParser(); if (!isset($config[Options::BACKOFF])) { $config[Options::BACKOFF] = new BackoffPlugin(new Crc32ErrorChecker(new TruncatedBackoffStrategy(11, new ThrottlingErrorChecker($exceptionParser, new HttpBackoffStrategy(null, new CurlBackoffStrategy(null, new ExpiredCredentialsChecker($exceptionParser, new CallbackBackoffStrategy(__CLASS__ . '::calculateRetryDelay', false)))))))); } // Construct the DynamoDB client with the client builder return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(self::DISABLE_REDIRECTS => true, Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/dynamodb-%s.php', self::COMMAND_PARAMS => array(Cmd::RESPONSE_PROCESSING => Cmd::TYPE_NO_TRANSLATION)))->setExceptionParser($exceptionParser)->setIteratorsConfig(array('result_key' => 'Items', 'token_param' => 'ExclusiveStartKey', 'token_key' => 'LastEvaluatedKey', 'operations' => array('BatchGetItem' => array('token_param' => 'RequestItems', 'token_key' => 'UnprocessedKeys', 'result_key' => 'Responses/*'), 'ListTables' => array('result_key' => 'TableNames', 'token_param' => 'ExclusiveStartTableName', 'token_key' => 'LastEvaluatedTableName'), 'Query', 'Scan')))->build(); }
/** * Factory method to create a new Amazon STS client using an array of configuration options: * * Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true * to use the default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object. * - credentials.cache.key: Optional custom cache key to use with the credentials * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your * credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials) * * Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required) * * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) * - scheme: URI Scheme of the base URL (e.g. 'https', 'http'). * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints * * Generic client options * * - ssl.certificate_authority: Set to true to use the bundled CA cert (default), system to use the certificate * bundled with your system, or pass the full path to an SSL certificate bundle. This option should be used when * you encounter curl error code 60. * - curl.options: Array of cURL options to apply to every request. * See http://www.php.net/manual/en/function.curl-setopt.php for a list of available options * - signature: You can optionally provide a custom signature implementation used to sign requests * - signature.service: Set to explicitly override the service name used in signatures * - signature.region: Set to explicitly override the region name used in signatures * - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information. * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { // Construct the STS client with the client builder return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/sts-2011-06-15.php'))->setCredentialsResolver(new CredentialsOptionResolver(function (Collection $config) { // Always need long term credentials if ($config->get(Options::KEY) && $config->get(Options::SECRET) && !$config->get(Options::TOKEN)) { return Credentials::factory($config->getAll(array_keys(Credentials::getConfigDefaults()))); } }))->build(); }
/** * Factory method to create a new Amazon STS client using an array of configuration options: * * Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true * to use the default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object. * - credentials.cache.key: Optional custom cache key to use with the credentials * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your * credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials) * * Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required) * * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) * - scheme: URI Scheme of the base URL (e.g. 'https', 'http'). * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints * * Generic client options * * - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This * option should be used when you encounter curl error code 60. * - curl.options: Array of cURL options to apply to every request. * See http://www.php.net/manual/en/function.curl-setopt.php for a list of available options * - signature: You can optionally provide a custom signature implementation used to sign requests * - signature.service: Set to explicitly override the service name used in signatures * - signature.region: Set to explicitly override the region name used in signatures * - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information. * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { // Construct the STS client with the client builder return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE => 'sts', Options::SCHEME => 'https', Options::REGION => 'us-east-1'))->setCredentialsResolver(new CredentialsOptionResolver(function (Collection $config) { // Always need long term credentials if ($config->get(Options::KEY) && $config->get(Options::SECRET) && !$config->get(Options::TOKEN)) { return Credentials::factory($config->getAll(array_keys(Credentials::getConfigDefaults()))); } }))->setSignature(new SignatureV4())->build(); }
/** * Factory method to create a new Amazon DynamoDB client using an array of configuration options. * * @param array|Collection $config Client configuration data * * @return self * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options */ public static function factory($config = array()) { // Configure the custom exponential backoff plugin for DynamoDB throttling $exceptionParser = new JsonQueryExceptionParser(); if (!isset($config[Options::BACKOFF])) { $config[Options::BACKOFF] = new BackoffPlugin(new Crc32ErrorChecker(self::createDynamoDbBackoffStrategy($exceptionParser))); } // Construct the DynamoDB client with the client builder return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(self::DISABLE_REDIRECTS => true, Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/dynamodb-%s.php', self::COMMAND_PARAMS => array(Cmd::RESPONSE_PROCESSING => Cmd::TYPE_NO_TRANSLATION)))->setExceptionParser($exceptionParser)->build(); }
/** * Factory method to create a new AWS Import/Export client using an array of configuration options. * * @param array|Collection $config Client configuration data * * @return self * @see \Aws\Common\Client\DefaultClient for a list of available configuration options */ public static function factory($config = array()) { $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/importexport-%s.php'))->build(); // If the Symfony YAML component is installed, add a listener that will convert arrays to proper YAML in when // specifying the "Manifest" parameter of the "CreateJob" operation if (class_exists('Symfony\\Component\\Yaml\\Yaml')) { $client->addSubscriber(new JobManifestListener()); } return $client; }
/** * Factory method to create a new Amazon Glacier client using an array of configuration options. * * @param array|Collection $config Client configuration data * * @return GlacierClient * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options */ public static function factory($config = array()) { // Setup the Glacier client $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/glacier-%s.php', 'command.params' => array('accountId' => '-', Options::MODEL_PROCESSING => true)))->setExceptionParser(new JsonRestExceptionParser())->build(); // Add the Glacier version header required for all operations $client->getConfig()->setPath('request.options/headers/x-amz-glacier-version', $client->getDescription()->getApiVersion()); // Allow for specifying bodies with file paths and file handles $uploadOperations = array('UploadArchive', 'UploadMultipartPart'); $client->addSubscriber(new UploadBodyListener($uploadOperations, 'body', 'sourceFile')); // Listen for upload operations and make sure the required hash headers are added $client->addSubscriber(new GlacierUploadListener()); return $client; }
protected function getClientFactoryInterfaceMock() { $mock = new \mock\LLS\Bundle\AWSBundle\Interfaces\ClientFactoryInterface(); $config = $this->config; $mock->getMockController()->createClient = function ($type, IdentityInterface $identity) use($config) { $reflection = new \ReflectionClass("Aws\\Sqs\\SqsClient"); $file = $reflection->getFileName(); $client = ClientBuilder::factory("mock\\Aws\\Sqs")->setConfig($config)->setConfigDefaults(array(Options::VERSION => \Aws\Sqs\SqsClient::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => dirname($file) . '/Resources/sqs-%s.php'))->build(); $client->addSubscriber(new QueueUrlListener()); $client->addSubscriber(new Md5ValidatorListener()); return $client; }; return $mock; }
/** * Factory method to create a new Amazon Cognito Identity client using an array of configuration options. * * See http://docs.aws.amazon.com/aws-sdk-php/guide/latest/configuration.html#client-configuration-options * * @param array|Collection $config Client configuration data * * @return self * @link http://docs.aws.amazon.com/aws-sdk-php/guide/latest/configuration.html#client-configuration-options */ public static function factory($config = array()) { $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cognitoidentity-%s.php'))->setExceptionParser(new JsonQueryExceptionParser())->build(); // Attach a listener to prevent some requests from being signed $client->getEventDispatcher()->addListener('command.before_send', function (Event $event) { /** @var AbstractCommand $command */ $command = $event['command']; if (in_array($command->getName(), array('GetId', 'GetOpenIdToken', 'UnlinkIdentity'))) { /** @var EventDispatcher $dispatcher */ $dispatcher = $command->getRequest()->getEventDispatcher(); foreach ($dispatcher->getListeners('request.before_send') as $listener) { if (is_array($listener) && $listener[0] instanceof SignatureListener) { $dispatcher->removeListener('request.before_send', $listener); break; } } } }); return $client; }
/** * Factory method to create a new AWS Config client using an array of configuration options. * * See http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options * * @param array|Collection $config Client configuration data * * @return self * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options */ public static function factory($config = array()) { return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/configservice-%s.php'))->setExceptionParser(new JsonQueryExceptionParser())->build(); }
/** * Factory method to create a new Amazon Simple Workflow Service client using an array of configuration options. * * The following array keys and values are available options: * * - Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache.key: Optional custom cache key to use with the credentials * - Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required) * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) * - scheme: URI Scheme of the base URL (e.g. 'https', 'http'). * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints * - Generic client options * - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This * option should be used when you encounter curl error code 60. * - curl.CURLOPT_VERBOSE: Set to true to output curl debug information during transfers * - curl.*: Prefix any available cURL option with `curl.` to add cURL options to each request. * See: http://www.php.net/manual/en/function.curl-setopt.php * - service.description.cache.ttl: Optional TTL used for the service description cache * - Signature options * - signature: You can optionally provide a custom signature implementation used to sign requests * - signature.service: Set to explicitly override the service name used in signatures * - signature.region: Set to explicitly override the region name used in signatures * - Exponential backoff options * - client.backoff.logger: `Guzzle\Common\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Http\Plugin\ExponentialBackoffLogger` for formatting information. * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/swf-2012-01-25.php'))->setExceptionParser(new JsonQueryExceptionParser())->build(); }
/** * Factory method to create a new Amazon DynamoDB client using an array of configuration options: * * Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true * to use the default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object. * - credentials.cache.key: Optional custom cache key to use with the credentials * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your * credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials) * * Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required) * * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) * - scheme: URI Scheme of the base URL (e.g. 'https', 'http'). * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints * * Generic client options * * - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This * option should be used when you encounter curl error code 60. * - curl.options: Array of cURL options to apply to every request. * See http://www.php.net/manual/en/function.curl-setopt.php for a list of available options * - signature: You can optionally provide a custom signature implementation used to sign requests * - signature.service: Set to explicitly override the service name used in signatures * - signature.region: Set to explicitly override the region name used in signatures * - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information. * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { // Configure the custom exponential backoff plugin for DynamoDB throttling $exponentialBackoffResolver = new BackoffOptionResolver(function ($config, $client) { return new BackoffPlugin(new ThrottlingErrorChecker(new HttpBackoffStrategy(null, new TruncatedBackoffStrategy(11, new CurlBackoffStrategy(null, new CallbackBackoffStrategy(array($client, 'calculateRetryDelay'), false)))))); }); // Construct the DynamoDB client with the client builder return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE => 'dynamodb', Options::SCHEME => 'https'))->setSignature(new SignatureV4())->addClientResolver($exponentialBackoffResolver)->setExceptionParser(new JsonQueryExceptionParser())->build(); }
/** * Factory method to create a new Auto Scaling client using an array of configuration options. * * @param array|Collection $config Client configuration data * * @return self * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options */ public static function factory($config = array()) { return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/autoscaling-%s.php'))->build(); }
/** * Factory method to create a default client using an array of configuration options. * * The following array keys and values are available options: * * - Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true * to use the default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object. * - credentials.cache.key: Optional custom cache key to use with the credentials * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your * credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials) * - Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required) * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) * - scheme: URI Scheme of the base URL (e.g. 'https', 'http'). * - service: Specify the name of the service * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints * - Signature options * - signature: You can optionally provide a custom signature implementation used to sign requests * - signature.service: Set to explicitly override the service name used in signatures * - signature.region: Set to explicitly override the region name used in signatures * - Exponential backoff options * - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information. * - Generic client options * - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This * option should be used when you encounter curl error code 60. * - curl.CURLOPT_VERBOSE: Set to true to output curl debug information during transfers * - curl.*: Prefix any available cURL option with `curl.` to add cURL options to each request. * See: http://www.php.net/manual/en/function.curl-setopt.php * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { return ClientBuilder::factory()->setConfig($config)->setConfigRequirements(array(Options::REGION, Options::SIGNATURE))->setConfigDefaults(array(Options::SCHEME => 'https'))->build(); }
/** * Factory method to create a new Amazon CloudWatch client using an array of configuration options. * * The following array keys and values are available options: * * - Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache.key: Optional custom cache key to use with the credentials * - Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required) * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) * - scheme: URI Scheme of the base URL (e.g. 'https', 'http'). * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client * - Generic client options * - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This * option should be used when you encounter curl error code 60. * - curl.CURLOPT_VERBOSE: Set to true to output curl debug information during transfers * - curl.*: Prefix any available cURL option with `curl.` to add cURL options to each request. * See: http://www.php.net/manual/en/function.curl-setopt.php * - service.description.cache.ttl: Optional TTL used for the service description cache * - Signature options * - signature: You can optionally provide a custom signature implementation used to sign requests * - signature.service: Set to explicitly override the service name used in signatures * - signature.region: Set to explicitly override the region name used in signatures * - Exponential backoff options * - client.backoff.logger: `Guzzle\Common\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Http\Plugin\ExponentialBackoffLogger` for formatting information. * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cloudwatch-2010-08-01.php'))->build(); }
/** * Factory method to create a new Amazon SimpleDB client using an array of configuration options. * * The following array keys and values are available options: * * - Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache.key: Optional custom cache key to use with the credentials * - Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required) * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) * - scheme: URI Scheme of the base URL (e.g. 'https', 'http'). * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints * - Generic client options * - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This * option should be used when you encounter curl error code 60. * - curl.CURLOPT_VERBOSE: Set to true to output curl debug information during transfers * - curl.*: Prefix any available cURL option with `curl.` to add cURL options to each request. * See: http://www.php.net/manual/en/function.curl-setopt.php * - service.description.cache.ttl: Optional TTL used for the service description cache * - Signature options * - signature: You can optionally provide a custom signature implementation used to sign requests * - signature.service: Set to explicitly override the service name used in signatures * - signature.region: Set to explicitly override the region name used in signatures * - Exponential backoff options * - client.backoff.logger: `Guzzle\Common\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Http\Plugin\ExponentialBackoffLogger` for formatting information. * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/simpledb-2009-04-15.php'))->setIteratorsConfig(array('token_key' => 'NextToken', 'token_param' => 'NextToken', 'operations' => array('ListDomains' => array('result_key' => 'DomainNames', 'limit_key' => 'MaxNumberOfDomains'), 'Select' => array('result_key' => 'Items'))))->build(); }
/** * Factory method to create a new Amazon Glacier client using an array of configuration options: * * Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true * to use the default APC cache or provide a `Guzzle\Common\Cache\CacheAdapterInterface` object. * - credentials.cache.key: Optional custom cache key to use with the credentials * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your * credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials) * * Region and Endpoint options * * - base_url: You can specify a custom base URL for the client * * Generic client options * * - ssl.certificate_authority: Set to true to use the bundled CA cert (default), system to use the certificate * bundled with your system, or pass the full path to an SSL certificate bundle. This option should be used when * you encounter curl error code 60. * - curl.options: Array of cURL options to apply to every request. * See http://www.php.net/manual/en/function.curl-setopt.php for a list of available options * - signature: You can optionally provide a custom signature implementation used to sign requests * - client.backoff.logger: `Guzzle\Common\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Http\Plugin\ExponentialBackoffLogger` for formatting information. * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { // Setup Route53 client $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/route53-2012-12-12.php'))->build(); return $client; }
/** * Factory method to create a new Amazon DynamoDB client using an array of configuration options: * * Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true * to use the default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object. * - credentials.cache.key: Optional custom cache key to use with the credentials * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your * credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials) * * Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required) * * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) * - scheme: URI Scheme of the base URL (e.g. 'https', 'http'). * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints * * Generic client options * * - ssl.certificate_authority: Set to true to use the bundled CA cert (default), system to use the certificate * bundled with your system, or pass the full path to an SSL certificate bundle. This option should be used when * you encounter curl error code 60. * - curl.options: Array of cURL options to apply to every request. * See http://www.php.net/manual/en/function.curl-setopt.php for a list of available options * - signature: You can optionally provide a custom signature implementation used to sign requests * - signature.service: Set to explicitly override the service name used in signatures * - signature.region: Set to explicitly override the region name used in signatures * - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information. * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { // Configure the custom exponential backoff plugin for DynamoDB throttling $exponentialBackoffResolver = new BackoffOptionResolver(function ($config, $client) { return new BackoffPlugin(new Crc32ErrorChecker(new ThrottlingErrorChecker(new HttpBackoffStrategy(null, new TruncatedBackoffStrategy(11, new CurlBackoffStrategy(null, new CallbackBackoffStrategy(array($client, 'calculateRetryDelay'), false))))))); }); // Construct the DynamoDB client with the client builder return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/dynamodb-2011-12-05.php', self::COMMAND_PARAMS => array(Cmd::RESPONSE_PROCESSING => Cmd::TYPE_NO_TRANSLATION)))->addClientResolver($exponentialBackoffResolver)->setExceptionParser(new JsonQueryExceptionParser())->setIteratorsConfig(array('result_key' => 'Items', 'token_param' => 'ExclusiveStartKey', 'token_key' => 'LastEvaluatedKey', 'operations' => array('BatchGetItem' => array('token_param' => 'RequestItems', 'token_key' => 'UnprocessedKeys'), 'ListTables' => array('result_key' => 'TableNames', 'token_param' => 'ExclusiveStartTableName', 'token_key' => 'LastEvaluatedTableName'), 'Query', 'Scan')))->build(); }
/** * Factory method to create a new Amazon Data Pipeline client using an array of configuration options: * * Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true * to use the default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object. * - credentials.cache.key: Optional custom cache key to use with the credentials * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your * credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials) * * Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required) * * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) * - scheme: URI Scheme of the base URL (e.g. 'https', 'http'). * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client * * Generic client options * * - ssl.certificate_authority: Set to true to use the bundled CA cert (default), system to use the certificate * bundled with your system, or pass the full path to an SSL certificate bundle. This option should be used when * you encounter curl error code 60. * - curl.options: Array of cURL options to apply to every request. * See http://www.php.net/manual/en/function.curl-setopt.php for a list of available options * - signature: You can optionally provide a custom signature implementation used to sign requests * - signature.service: Set to explicitly override the service name used in signatures * - signature.region: Set to explicitly override the region name used in signatures * - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information. * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { // Construct the Data Pipeline client with the client builder $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/datapipeline-%s.php'))->setExceptionParser(new JsonQueryExceptionParser())->setIteratorsConfig(array('limit_key' => 'limit', 'more_key' => 'hasMoreResults', 'token_param' => 'marker', 'token_key' => 'marker', 'operations' => array('ListPipelines' => array('result_key' => 'pipelineIdList'), 'DescribeObjects' => array('result_key' => 'pipelineObjects'), 'QueryObjects' => array('result_key' => 'ids'))))->build(); return $client; }
/** * Factory method to create a new Amazon CloudFront client using an array of configuration options: * * Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache: Used to cache credentials when using providers that require HTTP requests. Set the true * to use the default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object. * - credentials.cache.key: Optional custom cache key to use with the credentials * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your * credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials) * * Region and Endpoint options * * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints * * Generic client options * * - ssl.certificate_authority: Set to true to use the bundled CA cert (default), system to use the certificate * bundled with your system, or pass the full path to an SSL certificate bundle. This option should be used when * you encounter curl error code 60. * - curl.options: Array of cURL options to apply to every request. * See http://www.php.net/manual/en/function.curl-setopt.php for a list of available options * - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information. * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { // Instantiate the CloudFront client $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cloudfront-2012-05-05.php', Options::SIGNATURE => new CloudFrontSignature()))->setExceptionParser(new DefaultXmlExceptionParser())->setIteratorsConfig(array('token_param' => 'Marker', 'token_key' => 'NextMarker', 'more_key' => 'IsTruncated', 'result_key' => 'Items', 'operations' => array('ListCloudFrontOriginAccessIdentities', 'ListDistributions', 'ListInvalidations', 'ListStreamingDistributions')))->build(); return $client; }
/** * Factory method to create a new Amazon Data Pipeline client using an array of configuration options. * * @param array|Collection $config Client configuration data * * @return self * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options */ public static function factory($config = array()) { // Construct the Data Pipeline client with the client builder $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/datapipeline-%s.php'))->setExceptionParser(new JsonQueryExceptionParser())->build(); return $client; }
/** * Factory method to create a new AWS Direct Connect client using an array of configuration options. * * @param array|Collection $config Client configuration data * * @return self * @see \Aws\Common\Client\DefaultClient for a list of available configuration options */ public static function factory($config = array()) { return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/directconnect-%s.php'))->setExceptionParser(new JsonQueryExceptionParser())->setIteratorsConfig(array('operations' => array('DescribeConnections' => array('result_key' => 'connections'), 'DescribeOfferings' => array('result_key' => 'offerings'), 'DescribeVirtualGateways' => array('result_key' => 'virtualGateways'), 'DescribeVirtualInterfaces' => array('result_key' => 'virtualInterfaces'))))->build(); }
/** * Factory method to create a new Amazon Simple Email Service client using an array of configuration options. * * The following array keys and values are available options: * * - Credential options (`key`, `secret`, and optional `token` OR `credentials` is required) * - key: AWS Access Key ID * - secret: AWS secret access key * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object * - token: Custom AWS security token to use with request authentication * - token.ttd: UNIX timestamp for when the custom credentials expire * - credentials.cache.key: Optional custom cache key to use with the credentials * - Region and Endpoint options (a `region` and optional `scheme` OR a `base_url` is required) * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) * - scheme: URI Scheme of the base URL (e.g. 'https', 'http'). * - base_url: Instead of using a `region` and `scheme`, you can specify a custom base URL for the client * - endpoint_provider: Optional `Aws\Common\Region\EndpointProviderInterface` used to provide region endpoints * - Generic client options * - ssl.cert: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This * option should be used when you encounter curl error code 60. * - curl.CURLOPT_VERBOSE: Set to true to output curl debug information during transfers * - curl.*: Prefix any available cURL option with `curl.` to add cURL options to each request. * See: http://www.php.net/manual/en/function.curl-setopt.php * - service.description.cache.ttl: Optional TTL used for the service description cache * - Signature options * - signature: You can optionally provide a custom signature implementation used to sign requests * - signature.service: Set to explicitly override the service name used in signatures * - signature.region: Set to explicitly override the region name used in signatures * - Exponential backoff options * - client.backoff.logger: `Guzzle\Common\Log\LogAdapterInterface` object used to log backoff retries. Use * 'debug' to emit PHP warnings when a retry is issued. * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See * `Guzzle\Http\Plugin\ExponentialBackoffLogger` for formatting information. * * @param array|Collection $config Client configuration data * * @return self */ public static function factory($config = array()) { return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/ses-2010-12-01.php', Options::SIGNATURE_SERVICE => 'ses'))->build(); }
/** * Factory method to create a new Amazon Machine Learning client using an array of configuration options. * * See http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options * * @param array|Collection $config Client configuration data * * @return self * @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options */ public static function factory($config = array()) { $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/machinelearning-%s.php'))->setExceptionParser(new JsonQueryExceptionParser())->build(); $client->addSubscriber(new PredictEndpointListener()); return $client; }
/** * Factory method to create a new Amazon S3 client using an array of configuration options. * * @param array|Collection $config Client configuration data * * @return self * @see \Aws\Common\Client\DefaultClient for a list of available configuration options */ public static function factory($config = array()) { $exceptionParser = new S3ExceptionParser(); // Configure the custom exponential backoff plugin for retrying S3 specific errors if (!isset($config[Options::BACKOFF])) { $config[Options::BACKOFF] = self::createBackoffPlugin($exceptionParser); } $config[Options::SIGNATURE] = $signature = self::createSignature($config); $client = ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/s3-%s.php'))->setExceptionParser($exceptionParser)->setIteratorsConfig(array('more_key' => 'IsTruncated', 'operations' => array('ListBuckets', 'ListMultipartUploads' => array('limit_param' => 'MaxUploads', 'token_param' => array('KeyMarker', 'UploadIdMarker'), 'token_key' => array('NextKeyMarker', 'NextUploadIdMarker')), 'ListObjects' => array('limit_param' => 'MaxKeys', 'token_param' => 'Marker', 'token_key' => 'NextMarker'), 'ListObjectVersions' => array('limit_param' => 'MaxKeys', 'token_param' => array('KeyMarker', 'VersionIdMarker'), 'token_key' => array('nextKeyMarker', 'nextVersionIdMarker')), 'ListParts' => array('limit_param' => 'MaxParts', 'result_key' => 'Parts', 'token_param' => 'PartNumberMarker', 'token_key' => 'NextPartNumberMarker'))))->build(); // Use virtual hosted buckets when possible $client->addSubscriber(new BucketStyleListener()); // Ensure that ACP headers are applied when needed $client->addSubscriber(new AcpListener()); // Validate and add required Content-MD5 hashes (e.g. DeleteObjects) $client->addSubscriber(new S3Md5Listener($signature)); // Allow for specifying bodies with file paths and file handles $client->addSubscriber(new UploadBodyListener(array('PutObject', 'UploadPart'))); // Add aliases for some S3 operations $default = CompositeFactory::getDefaultChain($client); $default->add(new AliasFactory($client, self::$commandAliases), 'Guzzle\\Service\\Command\\Factory\\ServiceDescriptionFactory'); $client->setCommandFactory($default); return $client; }
/** * Factory method to create a new AWS Elastic Beanstalk client using an array of configuration options. * * @param array|Collection $config Client configuration data * * @return self * @link http://docs.aws.amazon.com/aws-sdk-php/guide/latest/configuration.html#client-configuration-options */ public static function factory($config = array()) { if (isset($config['region']) && substr($config['region'], 0, 3) == 'cn-') { $config[Options::SIGNATURE] = new SignatureV4(); } return ClientBuilder::factory(__NAMESPACE__)->setConfig($config)->setConfigDefaults(array(Options::VERSION => self::LATEST_API_VERSION, Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/ec2-%s.php'))->build(); }