Sin descripción

sdk-team 73610fe6e9 ReleaseClusterHostGroup add support for ReleaseNumber. hace 4 años
.github ecd09578e8 fix typo in issue template hace 7 años
3rdparty ad045aa702 fix build failed hace 7 años
acm 30fd9f48a0 Support namespaces. hace 6 años
acms-open 54883f36c2 ACM POP SDK. hace 6 años
actiontrail ff9366ef41 Support API for Trail. hace 5 años
adb 90a140992d fix: clear pop meta files hace 5 años
address-purification 8617b6ffe5 Aaaaa. hace 5 años
aegis f0c2600a26 regenerate code hace 6 años
afs f0c2600a26 regenerate code hace 6 años
airec 8ded49c937 Generated 2020-11-26 for Airec. hace 5 años
alb d175c6ad31 Support Latest APIs. hace 4 años
alidns 7942407bc1 Supported API for GTM. hace 5 años
alikafka 90a140992d fix: clear pop meta files hace 5 años
alimt 96f811507e Add Ext parameter to image translation API. hace 4 años
alinlp b60a834a97 Generated 2020-06-29 for alinlp. hace 6 años
aliyuncvc 648aacf470 Public beta version. hace 5 años
amqp-open e065d50def Add API for GetMetadataAmount. hace 6 años
appmallsservice f0c2600a26 regenerate code hace 6 años
arms f3e060235c Edit ListRetcodeApps. hace 5 años
arms4finance f0c2600a26 regenerate code hace 6 años
bssopenapi ed52841639 Bill api add query conditions and return data field. hace 4 años
cams 05785cf5fd ChatApp third version. hace 6 años
cas f0c2600a26 regenerate code hace 6 años
cassandra 97c5e2c422 Generated 2019-01-01 for Cassandra. hace 5 años
cbn 6b5999e621 Support DeleteTransitRouter API. hace 4 años
ccc 0c86b08087 Support to pass variables to authentication IVR. hace 4 años
ccs f0c2600a26 regenerate code hace 6 años
cdn 3611eea277 Update DeleteFCTrigger. hace 4 años
cdrs 0553d7374d Update Monitor Api. hace 5 años
chatbot f0c2600a26 regenerate code hace 6 años
cloudapi f0c2600a26 regenerate code hace 6 años
cloudauth 89a2517800 Add AuthId. hace 4 años
cloudauth-console fa0fe1ae07 SDK. hace 4 años
cloudesl bdb663548a Generated 2020-02-01 for cloudesl. hace 5 años
cloudgame 6088526cd8 Supported CloudGame. hace 6 años
cloudphoto f0c2600a26 regenerate code hace 6 años
cloudwf f0c2600a26 regenerate code hace 6 años
cms 63135520bc CreateContact API Add ContactGroupName. hace 4 años
codeup ac11b7e23d Add CreateSshKey OpenAPI. hace 5 años
companyreg 351e7765f5 Public version. hace 5 años
config d5af7a4c61 Support remediation. hace 4 años
core 1f6051b3b3 fix roarequest query parameters hace 4 años
cr f0c2600a26 regenerate code hace 6 años
crm f0c2600a26 regenerate code hace 6 años
cs 9290117d12 Some new parameters are supported. hace 6 años
csb b257cba9c3 Add FindServiceList and GetService qps. hace 6 años
cusanalytic_sc_online f0c2600a26 regenerate code hace 6 años
dataworks-public 26ae377767 Generated 2020-05-18 for dataworks-public. hace 4 años
dbfs 835983db86 Support query dbfs specification. hace 5 años
dbs 33bddb5fa9 Add CreateAndStartBackupPlan. hace 5 años
dcdn d1bab4fe11 Add ListDcdnEsTemplateInfo. hace 4 años
ddoscoo 191dc8eb68 Generated 2017-12-28 for ddoscoo. hace 4 años
dds 03d0b3ce63 Update by SDK platform. hace 4 años
democenter 56c516a238 Add demo edition auth. hace 6 años
devops-rdc 0dc704dbaa Fix ListPIpelineTemplates. hace 5 años
dg 31aec3f28f Generated 2019-03-27 for dg. hace 5 años
dms-enterprise 68ed888149 Add API OfflineTaskFlow. hace 4 años
domain 624c480a29 Added reserve price range. hace 4 años
drds 4ff900857e New API- GetDrdsDbRdsRelationInfo, which can get private RDS list under certain DB out of DRDS instance ID and DB name. hace 5 años
dts eda4d09d82 DescribeDtsJobs api, delay filed change from int to long. hace 4 años
dyplsapi 1d2cdfa39f Add API for New Features. hace 4 años
dypnsapi a4d37e4317 Support New API for Dypnsapi. hace 4 años
dysmsapi c2bfeb1216 Upgrade Service for SMS. hace 4 años
dyvmsapi e6902accf9 Update Dyvmsapi SDK. hace 4 años
eais 90a140992d fix: clear pop meta files hace 5 años
eas f0c2600a26 regenerate code hace 6 años
ecs 778feae703 Support throughput for API DescribeDisks. hace 4 años
edas ac628879ee Modify CreateK8sSecret. hace 5 años
ehpc 17a1e13ec3 ListAvailableEcsTypes set param ZoneId not required. hace 5 años
eipanycast 5fb8057a45 Add UpdateAnycastEipAddressAssociations Interface. hace 4 años
elasticsearch d1aee32108 Update apm interface parameter. hace 4 años
emap d7a89ac3dc Add isv interface. hace 6 años
emr 73610fe6e9 ReleaseClusterHostGroup add support for ReleaseNumber. hace 4 años
ens a09a6e094a Support cloud disk. hace 4 años
ess cc8cf316cd Update ScalingConfig parameters. hace 5 años
et-industry-openapi 9315d79274 delete invalid api code hace 6 años
examples 2e42d8fa7f update readme hace 7 años
facebody 9b557e564e Update DetectFace. hace 4 años
fnf aca0a3efa8 Support ListExecutions with filter functionality. hace 5 años
foas 5f1578fdbe Support multi language. hace 4 años
ft 78e7f635c2 AMP Version Change. hace 5 años
ga 99ad81bc82 Generated 2019-11-20 for Ga. hace 5 años
geoip 90a140992d fix: clear pop meta files hace 5 años
goodstech b5e667c1d7 Update goodstech. hace 5 años
gpdb feb2350da9 Openapi support querydisplay. hace 4 años
green f9eb4e30b8 Delete MultiMedia Post Scan API. hace 5 años
hbase 213faf8f4f Add event tasks. hace 4 años
hiknoengine f0c2600a26 regenerate code hace 6 años
hitsdb 417b73c84f Add ListTagResources api. hace 4 años
hsm f0c2600a26 regenerate code hace 6 años
httpdns c2e912302d Supported multiple Language. hace 5 años
idrsservice d28ae22685 Supported OpenAPI for SDK. hace 5 años
imageaudit 698f5e96da Update imageaudit. hace 5 años
imageenhan 90a140992d fix: clear pop meta files hace 5 años
imageprocess 2fa9cc7eb1 Release FeedbackSession. hace 4 años
imagerecog 58cbb932cd Update TaggingAdImage. hace 5 años
imagesearch f0c2600a26 regenerate code hace 6 años
imageseg ec2fdb4ecb Update SegmentAnimal SegmentCommonImage. hace 5 años
imgsearch 3a88e60d04 Update SearchImage. hace 6 años
imm befec9ee53 Minor changes. hace 4 años
industry-brain f82391b140 Add Content. hace 6 años
iot 8d654a308d Iot_20180120 old version sdk. hace 4 años
iqa f0c2600a26 regenerate code hace 6 años
ivision f0c2600a26 regenerate code hace 6 años
ivpd 4332019dac Supported UpdateUserBucketConfig. hace 6 años
jarvis f0c2600a26 regenerate code hace 6 años
jarvis-public f0c2600a26 regenerate code hace 6 años
kms 3a2b4a3b0a Support key deletion protection. hace 5 años
ledgerdb d005611f56 Publish apis for ledger instances. hace 6 años
linkface f0c2600a26 regenerate code hace 6 años
linkwan 98b1ef2aea Generated 2019-03-01 for LinkWAN. hace 5 años
live 92868c57c0 Generated 2016-11-01 for live. hace 4 años
lubancloud f0c2600a26 regenerate code hace 6 años
market f0c2600a26 regenerate code hace 6 años
metering 9fd70bc2bf Metering 1019. hace 6 años
moguan-sdk 34d72f2b3b Support APP auth. hace 5 años
mopen f0c2600a26 regenerate code hace 6 años
mse d42d229efb Bugfix QueryMoniter. hace 4 años
mts fe6548a733 SubmitURLUploadJob, support S3 Storage. hace 5 años
multimediaai 934e283efb Video Content analytics template introduced to this SDK. hace 5 años
nas 735d46b11a Supported CPFS Protocol. hace 4 años
nlp-automl f9b117f5a6 Add some console API operations. hace 5 años
objectdet cf62272b5b Update DetectVehicleICongestion DetectVehicleIllegalParking. hace 4 años
ocr 278c4950d0 Release RecognizeUkraineIdentityCard. hace 4 años
ons 26180c8b09 Add tcpInternetEndpoint field for the api OnsInstanceBaseInfo. hace 4 años
onsmqtt 3303c6120d Support device credential for mqtt. hace 5 años
oos 90a140992d fix: clear pop meta files hace 5 años
openanalytics f0c2600a26 regenerate code hace 6 años
openanalytics-open f063a7bdba fix: clear pop meta files hace 5 años
opensearch ededc6be9f Add API ListQuotaReviewTasks. hace 5 años
ots f0c2600a26 regenerate code hace 6 años
outboundbot 4c3ae151cb Supported new features for outbound. hace 4 años
polardb 1310780a31 Support new feature. hace 4 años
polardbx 8f21fa7c59 Supported all language sdk. hace 5 años
privatelink 8137298eb1 Support resource scheduler. hace 4 años
push 7052337f54 Supported Trim, AndroidVivoPushMode, iOSInterruptionLevel, iOSRelevanceScore for Push and MassPush. hace 4 años
pvtz 6217773578 Update new version. hace 5 años
qualitycheck 353bb56a9b Update GetSyncResult. hace 4 años
quickbi-public e23adc1324 Initialize APIs. hace 4 años
quotas 900bb894d0 Support query quota. hace 5 años
r-kvstore 0bab75ea88 Update by sdk platform. hace 4 años
ram f0c2600a26 regenerate code hace 6 años
rds c0e3f6e782 Update Open API. hace 4 años
reid b5c0b83b02 ListActionData add parameters. hace 6 años
reid_cloud 211ad2244b Supported cro algorithm. hace 5 años
resourcemanager ac0162b3c7 Supported more query conditions when searching resource group. hace 4 años
retailcloud f73358f7e8 Supported ScaleApp totalPartitions. hace 4 años
ros f0c2600a26 regenerate code hace 6 años
rsimganalys 40d1ce44af Public V430. hace 5 años
rtc db5500f960 Add DescribeAppKey interface. hace 4 años
sae 40ea7cd46c Support collect logs to kafka. hace 4 años
saf e2a8813a1b Supported RequestDecision For YN. hace 4 años
safconsole fb12252d2d Supported console. hace 5 años
sas 6d5e5142e1 Generated 2018-12-03 for Sas. hace 4 años
sas-api f0c2600a26 regenerate code hace 6 años
scdn 24b001f51b Add DescribeScdnDomainCcInfo. hace 4 años
schedulerx2 08d76a4567 Create App Group Support Schedule Busy Workers. hace 4 años
scsp cfd8b7cb85 Publish multi language sdk. hace 5 años
sddp 42f2dbf095 CreateDataLimit add enable filed. hace 4 años
servicemesh 82cfdabb16 Generated 2020-01-11 for servicemesh. hace 5 años
sgw 15e8858e41 Supported CheckBlockVolumeName api for Checking the volume name has been already used by the OSS bucket folder. hace 4 años
slb edbe01d364 Support HealthCheckMethod for HTTP and HTTPS listener. hace 5 años
smartag c40875737f Support sts. hace 5 años
smarthosting 9693807164 Generated 2020-08-01 for SmartHosting. hace 6 años
smc 90a140992d fix: clear pop meta files hace 5 años
snsuapi f0c2600a26 regenerate code hace 6 años
sts bb60ca8fb6 Supported AssumeRoleWithOIDC. hace 5 años
tag fe60cca404 Add MetaTag APIs. hace 4 años
tdsr 565bfada36 Supported backend interface for ICBU. hace 6 años
teambition-aliyun 78ca57fe3d Fix create project task. hace 6 años
tesladam f0c2600a26 regenerate code hace 6 años
teslamaxcompute f0c2600a26 regenerate code hace 6 años
teslastream f0c2600a26 regenerate code hace 6 años
test 1f6051b3b3 fix roarequest query parameters hace 4 años
tools c17dc7c79a refactor endpoints implementation hace 7 años
trademark f0c2600a26 regenerate code hace 6 años
ubsms f0c2600a26 regenerate code hace 6 años
vcs 1908e64fa6 Change Configuration. hace 5 años
videoenhan 90a140992d fix: clear pop meta files hace 5 años
videorecog 5590f7808b Release UnderstandVideoContent. hace 5 años
videosearch 5b5f0128c9 API GetTaskStatus return task detail. hace 6 años
videoseg df825120f3 Release SegmentGreenScreenVideo. hace 5 años
visionai-poc d7e14e0c1b Vision-poc response modified. hace 6 años
vod 8b405dedc5 Set multiple apis to public. hace 4 años
voicenavigator 382a4ff59d Supported new features etc. hace 4 años
vpc a3a8fed5ec Generated 2016-04-28 for Vpc. hace 5 años
vs 4edd799a79 Support odcap device. hace 5 años
waf-openapi 8ca3ea3fdf Upgrade SDK. hace 4 años
workorder c99e90b98e Encrypt Dialog Content. hace 5 años
xspace f0c2600a26 regenerate code hace 6 años
xtrace 4f16d1bd02 Add result value spanId for GetTrace api. hace 5 años
yundun f0c2600a26 regenerate code hace 6 años
yundun-ds f0c2600a26 regenerate code hace 6 años
.clang-format a57f6ec422 fix code style hace 6 años
.gitignore 175996b239 supported request headers operation hace 6 años
.travis.yml 4262cf11c8 fix travis ci config hace 7 años
CHANGELOG 73610fe6e9 ReleaseClusterHostGroup add support for ReleaseNumber. hace 4 años
CMakeLists.txt 8bed6eecc7 improve CmakeLists file hace 6 años
CONTRIBUTING.md fe958d3794 refactor readme hace 7 años
Doxyfile f6db1a27e4 Init commit hace 8 años
LICENSE 1ee62b8677 update license year hace 7 años
README-CN.md 40170293c2 chore: patch readme hace 5 años
README.md 40170293c2 chore: patch readme hace 5 años
VERSION 73610fe6e9 ReleaseClusterHostGroup add support for ReleaseNumber. hace 4 años
easyinstall.sh 31f2c5d410 improve cmake compile hace 6 años
function_test.sh 619a7827de timeout support when create client or make request hace 7 años
generate_code_cov.sh 21edc7f283 fix unit test build failed hace 7 años
unit_test.sh c99809b8e4 support http put and delete hace 7 años

README-CN.md

English | 简体中文

Alibaba Cloud SDK for C++

Travis Build Status codecov

Alibaba Cloud SDK for C++ 让您不用复杂编程即可访问云服务器、负载均衡、云监控等阿里云服务。这里向您介绍如何获取 Alibaba Cloud SDK for C++ 并开始调用。

如果您在使用的过程中遇到任何问题,欢迎前往阿里云SDK问答社区提问,提问前请阅读提问引导。亦可在当前 GitHub 提交 Issues

使用诊断

Troubleshoot 提供 OpenAPI 使用诊断服务,通过 RequestID报错信息 ,帮助开发者快速定位,为开发者提供解决方案。

环境要求

在使用 Alibaba Cloud SDK for C++ 前,确保您已经:

  • 注册了阿里云账号并获取了访问密钥(AccessKey)。

说明: 为了保证您的账号安全,建议您使用RAM账号来访问阿里云服务。阿里云账号对拥有的资源有全部权限。RAM账号由阿里云账号授权创建,仅有对特定资源限定的操作权限。详情参见RAM

  • 开通了云产品服务。有些云产品如对象存储(OSS)需要先在阿里云控制台开通服务。

  • 安装支持 C++ 11 或更高版本的编译器:

    • Windows: Visual Studio 2015 或以上版本
    • Linux: GCC 4.9 或以上版本
  • 安装 CMake 3.0 或以上版本

  • 建议 4G 或以上内存

安装 (从源代码构建)

Linux

  1. 要在 Linux 平台进行编译, 您必须安装依赖的外部库文件 libcurl、libopenssl、libuuid、libjsoncpp, 通常情况下,系统的包管理器中的会有提供。
  • 例如:在基于 Redhat / Fedora 的系统上安装这些软件包

    # use yum
    yum install jsoncpp-devel openssl-devel uuid-devel libcurl-devel
    
    # use dnf
    sudo dnf install libcurl-devel openssl-devel libuuid-devel libjsoncpp-devel
    
  • 在基于 Debian/Ubuntu 的系统

    sudo apt-get install libcurl4-openssl-dev libssl-dev uuid-dev libjsoncpp-dev
    
  1. 执行以下命令,从 Github 克隆源码

    git clone https://github.com/aliyun/aliyun-openapi-cpp-sdk.git
    
  2. 编译安装

  • 手动编译安装

    cd aliyun-openapi-cpp-sdk
    mkdir sdk_build
    cd sdk_build
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
    make
    sudo make install
    
  • 或者通过 easyinstall.sh一键式安装

    cd aliyun-openapi-cpp-sdk
    sudo sh easyinstall.sh <lower name of product (like 'ecs')>
    
    # example
    sudo sh easyinstall.sh core
    sudo sh easyinstall.sh ecs
    

Alibaba Cloud SDK for C++ 将被安装在 /usr .

Windows

  1. 安装 perl

  2. 使用 git-bash 执行以下命令,从 Github 克隆源码

    git clone https://github.com/aliyun/aliyun-openapi-cpp-sdk.git
    
  3. 使用 Visual Studio 进行编译:

  • 在 aliyun-openapi-cpp-sdk 下创建 sdk_build 目录
  • 打开 cmake-gui , 然后进行以下操作
    • 选择 Browse Source源代码目录(aliyun-openapi-cpp-sdk)
    • 选择 Browse build构建目录(sdk_build)
    • 点击 configure
    • 使用小写的产品名称,设置 BUILD_PRODUCT 参数的值
    • 点击 generate, 构建 VS 解决方案。
  1. 编译安装 C++ SDK
  • 进入 sdk_build 目录,使用 Visual Studio 打开 alibabacloud-sdk.sln 解决方案
  • 选择构建 Release 输出
  • 并打开配置管理器勾选 INSTALL
  • 构建 -> 生成解决方案

Alibaba Cloud SDK for C++ 将安装在 C:\Program File (x86)\alibabacloud-sdk 目录

注意:请以管理员身份运行 Visual Studio 和 cmake-gui,否则无法安装 SDK


快速使用

在调用 Alibaba Cloud SDK for C++ 时,您首先需要配置预处理器定义 ALIBABACLOUD_SHARED 以引用阿里云 C++ SDK 的共享库,然后通过创建 Client 实例提供身份验证,并指定云服务的地域,然后发送API请求。

以下代码展示了如何调用 DescribeInstancesAPI 查询指定地域所有 ECS 实例的详细信息。

说明: 您需要替换示例中的 your-region-id、your-access-key-id 和 your-access-key-secret 的值。

#include <iostream>
#include <alibabacloud/core/AlibabaCloud.h>
#include <alibabacloud/ecs/EcsClient.h>

using namespace AlibabaCloud;
using namespace AlibabaCloud::Ecs;

int main(int argc, char** argv) {
  // 初始化 SDK
  AlibabaCloud::InitializeSdk();

  // 配置 ecs 实例
  ClientConfiguration configuration("<your-region-id>");
  EcsClient client("<your-access-key-id>", "<your-access-key-secret>", configuration);

  // 创建API请求并设置参数
  Model::DescribeInstancesRequest request;
  request.setPageSize(10);

  auto outcome = client.describeInstances(request);
  if (!outcome.isSuccess()) {
    // 异常处理
    std::cout << outcome.error().errorCode() << std::endl;
    AlibabaCloud::ShutdownSdk();
    return -1;
  }

  std::cout << "totalCount: " << outcome.result().getTotalCount() << std::endl;

  // 关闭 SDK
  AlibabaCloud::ShutdownSdk();
  return 0;
}

复制上述文件到 ecs_test.cc。

Linux 下

~$ g++ -o ecstest ecs_test.cc --std=c++11 -lalibabacloud-sdk-core -l alibabacloud-sdk-ecs
~$ ./ecstest
# 结果或错误返回将在此展示
~$

Timeout 设置

CPP SDK 使用 libcurl 作为底层 HTTP 传输库。

  • 下面两个参数用来传递超时参数到 libcurl。

    • connectTimeout: 连接超时设置。 参考.
    • readTimeout: 传输超时设置。参考
  • 默认值

    • connectTimeout: 5000ms
    • readTimeout: 10000ms
  • 可以在创建 Client 或者发 Requst 设置超时参数。

  • Requst 设置优先级高于 Client 设置。

  • 输入 0 或者 -1 到 setConnectTimeoutsetReadTimeout 可以禁用此功能。

下面代码是设置超时参数的例子,由于 Request 优先级高于 Client,所以最终 ConnectTimeout1000msreadTimeout6000ms

#include <iostream>
#include <alibabacloud/core/AlibabaCloud.h>
#include <alibabacloud/ecs/EcsClient.h>

using namespace AlibabaCloud;
using namespace AlibabaCloud::Ecs;

int main(int argc, char** argv) {
  // Initialize the SDK
  AlibabaCloud::InitializeSdk();

  // Configure the ECS instance
  ClientConfiguration configuration("<your-region-id>");
  // specify timeout when create client.
  configuration.setConnectTimeout(1500);
  configuration.setReadTimeout(4000);

  EcsClient client("<your-access-key-id>", "<your-access-key-secret>", configuration);

  // Create an API request and set parameters
  Model::DescribeInstancesRequest request;
  request.setPageSize(10);
  // specify timeout when request
  request.setConnectTimeout(1000);
  request.setReadTimeout(6000);

  auto outcome = client.describeInstances(request);
  if (!outcome.isSuccess()) {
    // Handle exceptions
    std::cout << outcome.error().errorCode() << std::endl;
    AlibabaCloud::ShutdownSdk();
    return -1;
  }

  std::cout << "totalCount: " << outcome.result().getTotalCount() << std::endl;

  // Close the SDK
  AlibabaCloud::ShutdownSdk();
  return 0;
}


更多 例程

问题

提交 Issue, 不符合指南的问题可能会立即关闭。

发行说明

每个版本的详细更改记录在发行说明中。

贡献

提交 Pull Request 之前请阅读贡献指南

许可证

Apache-2.0

版权所有 1999-2019 阿里巴巴集团