From 055d6c4457a03e6459dfc0f8e381de3e5e334f0d Mon Sep 17 00:00:00 2001 From: rene-gates Date: Wed, 3 Feb 2021 22:37:24 +0100 Subject: [PATCH] Update SecretKey.php Add option to add description on secretkey creation. Parameter is optional, if not defined, empty string is used. --- src/Api/Operator/SecretKey.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Api/Operator/SecretKey.php b/src/Api/Operator/SecretKey.php index 677de824..352cbf68 100644 --- a/src/Api/Operator/SecretKey.php +++ b/src/Api/Operator/SecretKey.php @@ -11,13 +11,18 @@ class SecretKey extends \PleskX\Api\Operator /** * @param string $ipAddress + * @param string $keyDescription * * @return string */ - public function create($ipAddress) + public function create($ipAddress, $keyDescription = '') { $packet = $this->_client->getPacket(); - $packet->addChild($this->_wrapperTag)->addChild('create')->addChild('ip_address', $ipAddress); + $creator = $packet->addChild($this->_wrapperTag)->addChild('create'); + + $creator->addChild('ip_address', $ipAddress); + $creator->addChild('description', $keyDescription); + $response = $this->_client->request($packet); return (string) $response->key;