当前位置: 首页>>代码示例>>PHP>>正文


PHP DynamoDbClient::listTables方法代码示例

本文整理汇总了PHP中Aws\DynamoDb\DynamoDbClient::listTables方法的典型用法代码示例。如果您正苦于以下问题:PHP DynamoDbClient::listTables方法的具体用法?PHP DynamoDbClient::listTables怎么用?PHP DynamoDbClient::listTables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aws\DynamoDb\DynamoDbClient的用法示例。


在下文中一共展示了DynamoDbClient::listTables方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createTable

 /**
  * Create the table
  */
 protected static function createTable($wait = false)
 {
     $tables = self::$dynamodb->listTables();
     if (in_array(self::TABLE_NAME, $tables['TableNames'])) {
         self::deleteTable(true);
     }
     self::$dynamodb->createTable(['TableName' => self::TABLE_NAME, 'AttributeDefinitions' => [['AttributeName' => 'key', 'AttributeType' => 'S']], 'KeySchema' => [['AttributeName' => 'key', 'KeyType' => 'HASH']], 'ProvisionedThroughput' => ['ReadCapacityUnits' => 1, 'WriteCapacityUnits' => 1]]);
     if (!$wait) {
         return;
     }
     self::$dynamodb->waitUntil('TableExists', ['TableName' => self::TABLE_NAME, 'waiter.interval' => 1, 'waiter.max_attempts' => 5]);
 }
开发者ID:sven4ask,项目名称:config,代码行数:15,代码来源:DynamoDBLoaderTest.php

示例2: listTables

 /**
  * List tables via the list_tables call
  * @param integer $limit
  * @param string $exclusiveStartTableName
  * @return Table\TableCollection
  */
 public function listTables($limit = null, $exclusiveStartTableName = null)
 {
     if (null !== $this->logger) {
         $this->log('List tables');
     }
     $parameters = array();
     if (null !== $limit) {
         $parameters['Limit'] = $limit;
     }
     if (null !== $exclusiveStartTableName) {
         $parameters['ExclusiveStartTableName'] = $exclusiveStartTableName;
     }
     if (null !== $this->logger) {
         $this->log('ListTable request paramaters : ' . print_r($parameters, true), Logger::DEBUG);
     }
     $response = $this->connector->listTables($parameters);
     if (null !== $this->logger) {
         $this->log('ListTable request response : ' . print_r($response, true), Logger::DEBUG);
     }
     $tables = new Table\TableCollection(isset($response['LastEvaluatedTableName']) ? $response['LastEvaluatedTableName'] : null);
     if (!empty($response['TableNames'])) {
         foreach ($response['TableNames'] as $table) {
             $tables->add($table);
         }
     }
     return $tables;
 }
开发者ID:16hands,项目名称:riverline-dynamodb,代码行数:33,代码来源:Connection.php

示例3: getTables

 /**
  * @return array
  */
 public function getTables()
 {
     $out = [];
     do {
         $result = $this->dbConn->listTables(['Limit' => 100, 'ExclusiveStartTableName' => isset($result) ? $result['LastEvaluatedTableName'] : null]);
         $out = array_merge($out, $result['TableNames']);
     } while ($result['LastEvaluatedTableName']);
     return $out;
 }
开发者ID:pkdevboxy,项目名称:df-aws,代码行数:12,代码来源:DynamoDb.php

示例4: listTables

 /**
  * Returns an array of all the tables associated with the current account and endpoint.
  *
  * @param string  $exclusiveStartTableName Name of the table that starts the list.
  * @param integer $limit                   A maximum number of tables to return.
  *
  * @return  Guzzle\Service\Resource\Model
  *
  * @see http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.DynamoDb.DynamoDbClient.html#_listTables
  */
 public function listTables($exclusiveStartTableName = null, $limit = null)
 {
     $params = [];
     if (is_string($exclusiveStartTableName)) {
         $params['ExclusiveStartTableName'] = $exclusiveStartTableName;
     }
     if (is_numeric($limit)) {
         $params['Limit'] = $limit;
     }
     return $this->client->listTables($params);
 }
开发者ID:m6web,项目名称:aws-bundle,代码行数:21,代码来源:Client.php

示例5: testListsTables

 /**
  * @depends testCreatesTable
  */
 public function testListsTables()
 {
     $result = $this->client->listTables();
     $this->assertContains($this->table, $result['TableNames']);
 }
开发者ID:romainneutron,项目名称:aws-sdk-php,代码行数:8,代码来源:IntegrationTest.php


注:本文中的Aws\DynamoDb\DynamoDbClient::listTables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。