Scalr_Environment::keychain PHP Method

keychain() public method

Gets specified cloud credentials for this environment
public keychain ( string $cloud ) : CloudCredentials
$cloud string The cloud name
return Scalr\Model\Entity\CloudCredentials
    public function keychain($cloud)
    {
        return $this->getContainer()->keychain($cloud, $this->id);
    }

Usage Example

コード例 #1
0
 /**
  * Gets the list of available locations
  *
  * @param \Scalr_Environment $environment
  * @return \Scalr_Environment Returns the list of available locations looks like array(location => description)
  */
 public function getLocations(\Scalr_Environment $environment = null)
 {
     $accountType = null;
     if ($environment instanceof \Scalr_Environment) {
         $accountType = $environment->keychain(SERVER_PLATFORMS::EC2)->properties[Entity\CloudCredentialsProperty::AWS_ACCOUNT_TYPE];
     }
     return $this->getLocationsByAccountType($accountType);
 }
All Usage Examples Of Scalr_Environment::keychain