jinleileiking / ksyun_sdk
ksyun openapi offical sdk
v0.6
2016-09-26 08:53 UTC
Requires
- php: >=5.5
- guzzlehttp/guzzle: ~6.2
This package is not auto-updated.
Last update: 2025-01-04 21:08:51 UTC
README
##使用方式 ####composer引用
composer require kscsdk/ksyun_sdk
####ak|sk配置
获取到用户的aksk后配置在文件
~\.ksyun\config
####config文件结构
{
"ak":"AKLTPeYwGi78S5-6y9RrHello",
"sk":"OOiXFoKYYQSJ4YNtvlN8hsnLbJ6/kARKU+sHxgfUUy0/JqpzKgPyx=="
}
##功能列表
敬请期待
##推荐demo
<?php
require('./vendor/autoload.php');
use Ksyun\Service\Iam;
$response = Iam::getInstance()->request('ListUsers');
echo (string)$response->getBody();
<?php
require('./vendor/autoload.php');
use Ksyun\Service\Kec;
$response = Kec::getInstance()->request('DescribeInstances', [], 'cn-beijing-6');
echo (string)$response->getBody();
<?php
require('./vendor/autoload.php');
use Ksyun\Service\Eip;
$response = Eip::getInstance()->request('DescribeAddresses', ['query' => ['MaxResults' => 10]], 'cn-beijing-6');
echo (string)$response->getBody();
<?php
require('./vendor/autoload.php');
use Ksyun\Service\Iam;
$ak = 'this is ak';
$sk = 'this is sk';
$response = Iam::getInstance()->request('ListUsers', ['v4_credentials' => ['ak' => $ak, 'sk' => $sk]]);
echo (string)$response->getBody();