CloudObjects / Directory / Account Gateways / AccountClusterFinder
Sign in

AccountClusterFinder

a phpmae:Class in Account Gateways
Public PHP Methods
  • getForAAUID($aauid)

    No documentation available.

Source Code
<?php

/**
 * Implementation for coid://aauid.net/AccountClusterFinder
 */
class AccountClusterFinder {

    private $awsClient;

    public function __construct(AWSClientProvider $awsClientProvider) {
        $this->awsClient = $awsClientProvider->getClient();
    }
    
    public function getForAAUID($aauid) {
        $dynamoDbApiResponse = json_decode($this->awsClient->post('https://dynamodb.eu-central-1.amazonaws.com/', [
            'headers' => [
                'X-Amz-Target' => 'DynamoDB_20120810.GetItem'
            ],
            'json' => [
                'TableName' => 'AccountGateway-AAUIDs',
                'Key' => [
                    'AAUID' => [ 'S' => $aauid ]
                ]
            ]
        ])->getBody(), true);

        if (isset($dynamoDbApiResponse['Item']) && isset($dynamoDbApiResponse['Item']['ClusterID']))
            return [
                'found' => true,
                'cluster' => $dynamoDbApiResponse['Item']['ClusterID']['S']
            ];
        else
            return [
                'found' => false
            ];
    }

}
Meta
URI / COID
coid://aauid.net/AccountClusterFinder content_copy
Revision
4-7c1fc8aaa8db1c280368f5b0b5d1a6b7 content_copy
Short ID
agws:AccountClusterFinder content_copy
Reference URL
https://coid.link/aauid.net/AccountClusterFinder content_copy
Last updated
2021-04-28 11:58 (UTC)
Created at
2021-04-28 11:55 (UTC)