public function findElbs() { $result = $this->elbClient->describeLoadBalancers(); $rows = $result->search('LoadBalancerDescriptions[]'); $collection = new \AwsInspector\Model\Collection(); foreach ($rows as $row) { $collection->attach(new Elb($row)); } return $collection; }
public function testFactoryInitializesClient() { $client = ElasticLoadBalancingClient::factory(array('key' => 'foo', 'secret' => 'bar', 'region' => 'us-west-2')); $this->assertInstanceOf('Aws\\Common\\Signature\\SignatureV4', $this->readAttribute($client, 'signature')); $this->assertInstanceOf('Aws\\Common\\Credentials\\Credentials', $client->getCredentials()); $this->assertEquals('https://elasticloadbalancing.us-west-2.amazonaws.com', $client->getBaseUrl()); }
public function testDescribesLoadBalancerPolicyTypes() { $command = $this->client->getCommand('DescribeLoadBalancerPolicies'); $result = $command->execute(); $this->assertNotNull($result->getPath('ResponseMetadata/RequestId')); $this->assertInternalType('array', $result['PolicyDescriptions']); if (count($result['PolicyDescriptions'])) { foreach ($result['PolicyDescriptions'] as $i => $p) { // Ensure that the list is enumerated $this->assertInternalType('integer', $i); $this->assertInternalType('string', $p['PolicyName']); $this->assertInternalType('string', $p['PolicyTypeName']); $this->assertInternalType('array', $p['PolicyAttributeDescriptions']); $this->assertArrayHasKey(0, $p['PolicyAttributeDescriptions']); } } }
/** * Picker constructor. * * @inheritdoc */ public function __construct(array $args, $load_balancer_name = '') { parent::__construct($args); // if we specified a load balancer name go ahead and set it if (!empty($load_balancer_name)) { $this->setLoadBalancerName($load_balancer_name); } }
public function getELBClient() { return ElasticLoadBalancingClient::factory($this->getCredentials()); }