PHP Class Scalr\Model\Entity\SshKey

Since: 5.5 (30.04.2015)
Author: Igor Vodiasov ([email protected])
Inheritance: extends Scalr\Model\AbstractEntity, implements Scalr\DataType\AccessPermissionsInterface
显示文件 Open project: scalr/scalr Class Usage Examples

Public Properties

Property Type Description
$cloudKeyName string Name of Ssh Key in cloud
$cloudLocation string Cloud Location
$envId integer The identifier of the client's environment
$farmId integer The identifier of the farm
$id integer The identifier of Ssh Key
$platform string Platform
$privateKey string Private Key
$publicKey string Public Key
$type string Type of Ssh key

Public Methods

Method Description
generateKeypair ( ) : array Generate private and public key
generatePublicKey ( ) : string Generate public key
getEnvironmentPlatforms ( $envId ) : array Get list of platforms where ssh keys are available on environment
getPuttyPrivateKey ( ) : string Convert private key to putty format
hasAccessPermissions ( $user, $environment = null, $modify = null )
isUsed ( ) : boolean Check if key is used by any farm role
loadGlobalByFarmId ( integer $envId, string $platform, string $cloudLocation, integer $farmId = null ) : SshKey | null Find global key by FarmID
loadGlobalByName ( integer $envId, string $platform, string $cloudLocation, string $name ) : SshKey | null Find global key by Name

Private Methods

Method Description
getSshKeygenValue ( array $args, string $tmpFileContents, boolean $readTmpFile = false ) : string External call to ssh-keygen utility

Method Details

generateKeypair() public method

Generate private and public key
public generateKeypair ( ) : array
return array

generatePublicKey() public method

Generate public key
public generatePublicKey ( ) : string
return string

getEnvironmentPlatforms() public method

Get list of platforms where ssh keys are available on environment
public getEnvironmentPlatforms ( $envId ) : array
$envId
return array

getPuttyPrivateKey() public method

Convert private key to putty format
public getPuttyPrivateKey ( ) : string
return string

hasAccessPermissions() public method

See also: Scalr\DataType\AccessPermissionsInterface::hasAccessPermissions()
public hasAccessPermissions ( $user, $environment = null, $modify = null )

isUsed() public method

Check if key is used by any farm role
public isUsed ( ) : boolean
return boolean

loadGlobalByFarmId() public method

Find global key by FarmID
public loadGlobalByFarmId ( integer $envId, string $platform, string $cloudLocation, integer $farmId = null ) : SshKey | null
$envId integer
$platform string
$cloudLocation string
$farmId integer optional
return SshKey | null

loadGlobalByName() public method

Find global key by Name
public loadGlobalByName ( integer $envId, string $platform, string $cloudLocation, string $name ) : SshKey | null
$envId integer
$platform string
$cloudLocation string
$name string
return SshKey | null

Property Details

$cloudKeyName public_oe property

Name of Ssh Key in cloud
public string $cloudKeyName
return string

$cloudLocation public_oe property

Cloud Location
public string $cloudLocation
return string

$envId public_oe property

The identifier of the client's environment
public int $envId
return integer

$farmId public_oe property

The identifier of the farm
public int $farmId
return integer

$id public_oe property

The identifier of Ssh Key
public int $id
return integer

$platform public_oe property

Platform
public string $platform
return string

$privateKey public_oe property

Private Key
public string $privateKey
return string

$publicKey public_oe property

Public Key
public string $publicKey
return string

$type public_oe property

Type of Ssh key
public string $type
return string