aliyun / aliyun-openapi-php-sdk

[Abandoned] Open API SDK for PHP developers
Other
606 stars 806 forks source link

ECS cannot delete KeyPairs. #29

Closed RockfordWei closed 7 years ago

RockfordWei commented 7 years ago

问题已经在此处汇报,无人搭理: https://github.com/aliyun/aliyun-openapi-python-sdk/issues/16 https://github.com/aliyun/aliyun-cli/issues/31

include_once './aliyun-php-sdk-core/Config.php';
use Ecs\Request\V20140526 as Ecs;

$iClientProfile = DefaultProfile::getProfile("<my region id>", "<my access key id>", "<my key secret>");
$client = new DefaultAcsClient($iClientProfile);
$request = new Ecs\DeleteKeyPairsRequest();
$request->setKeyPairNames("alikeytest");
$response = $client->getAcsResponse($request);
print_r($response);

PHP Fatal error:  Uncaught ServerException: InvalidKeyPairNames.ValueNotSupported The specified parameter "KeyPairNames" is not valid. HTTP Status: 400 RequestID: E591F222-1538-4059-9931-F4B618B7EB49 in /root/Playground/aliyun-openapi-php-sdk/aliyun-php-sdk-core/DefaultAcsClient.php:107
Stack trace:
#0 /root/Playground/aliyun-openapi-php-sdk/aliyun-php-sdk-core/DefaultAcsClient.php(36): DefaultAcsClient->buildApiException(Object(stdClass), 400)
#1 /root/Playground/aliyun-openapi-php-sdk/test.php(11): DefaultAcsClient->getAcsResponse(Object(Ecs\Request\V20140526\DeleteKeyPairsRequest))
#2 {main}
  thrown in /root/Playground/aliyun-openapi-php-sdk/aliyun-php-sdk-core/DefaultAcsClient.php on line 107