説明なし

sdk-team 541be1be3e Update OTA API, including CreateOTADynamicUpgradeJob,CreateOTAStaticUpgradeJob,QueryOTAJob. 4 年 前
.github ecd09578e8 fix typo in issue template 7 年 前
3rdparty ad045aa702 fix build failed 7 年 前
acm 30fd9f48a0 Support namespaces. 6 年 前
acms-open 54883f36c2 ACM POP SDK. 6 年 前
actiontrail ff9366ef41 Support API for Trail. 5 年 前
adb 90a140992d fix: clear pop meta files 5 年 前
address-purification 8617b6ffe5 Aaaaa. 5 年 前
aegis f0c2600a26 regenerate code 6 年 前
afs f0c2600a26 regenerate code 6 年 前
airec 8ded49c937 Generated 2020-11-26 for Airec. 5 年 前
alb cf984bbcfc Support health check paging. 4 年 前
alidns 7942407bc1 Supported API for GTM. 5 年 前
alikafka 90a140992d fix: clear pop meta files 5 年 前
alimt 96f811507e Add Ext parameter to image translation API. 4 年 前
alinlp b60a834a97 Generated 2020-06-29 for alinlp. 6 年 前
aliyuncvc 648aacf470 Public beta version. 5 年 前
amqp-open e065d50def Add API for GetMetadataAmount. 6 年 前
appmallsservice f0c2600a26 regenerate code 6 年 前
arms f3e060235c Edit ListRetcodeApps. 5 年 前
arms4finance f0c2600a26 regenerate code 6 年 前
bssopenapi 5df0ee7c86 Supported DescribeSavingsPlansUsageTotal. 5 年 前
cams 05785cf5fd ChatApp third version. 6 年 前
cas f0c2600a26 regenerate code 6 年 前
cassandra 97c5e2c422 Generated 2019-01-01 for Cassandra. 5 年 前
cbn f78ca8c724 Modify the input parameter Action of DescribeCenInterRegionBandwidthLimits to be required. 4 年 前
ccc fe11ae7d12 Add API for unregister sip phone device, masked callee, etc. 4 年 前
ccs f0c2600a26 regenerate code 6 年 前
cdn 4095ec22b9 Update DescribeCdnSMCertificateDetail. 4 年 前
cdrs 0553d7374d Update Monitor Api. 5 年 前
chatbot f0c2600a26 regenerate code 6 年 前
cloudapi f0c2600a26 regenerate code 6 年 前
cloudauth 5380c7f56e Support crop face image. 5 年 前
cloudesl bdb663548a Generated 2020-02-01 for cloudesl. 5 年 前
cloudgame 6088526cd8 Supported CloudGame. 6 年 前
cloudphoto f0c2600a26 regenerate code 6 年 前
cloudwf f0c2600a26 regenerate code 6 年 前
cms 6f8b83d17e Add EventRule Content Filter. 4 年 前
codeup ac11b7e23d Add CreateSshKey OpenAPI. 5 年 前
companyreg 351e7765f5 Public version. 5 年 前
config 706b0f8216 Support query resourceType. 4 年 前
core 80acb7552c fix: free list before return #132 5 年 前
cr f0c2600a26 regenerate code 6 年 前
crm f0c2600a26 regenerate code 6 年 前
cs 9290117d12 Some new parameters are supported. 6 年 前
csb b257cba9c3 Add FindServiceList and GetService qps. 6 年 前
cusanalytic_sc_online f0c2600a26 regenerate code 6 年 前
dataworks-public fde408fe24 Generated 2020-05-18 for dataworks-public. 4 年 前
dbfs 835983db86 Support query dbfs specification. 5 年 前
dbs 33bddb5fa9 Add CreateAndStartBackupPlan. 5 年 前
dcdn 2829dacfb2 Update SetDcdnDomainSMCertificate. 4 年 前
ddoscoo 191dc8eb68 Generated 2017-12-28 for ddoscoo. 4 年 前
dds f9c588487c CreateServerlessDBInstance Add CapacityUnit. 4 年 前
democenter 56c516a238 Add demo edition auth. 6 年 前
devops-rdc 0dc704dbaa Fix ListPIpelineTemplates. 5 年 前
dg 31aec3f28f Generated 2019-03-27 for dg. 5 年 前
dms-enterprise ec69dc6bc1 Support GetSQLReviewOptimizeDetail,ListSQLReviewOriginSQL Order API. 5 年 前
domain a5a5b1c4eb Added audit status. 5 年 前
drds 4ff900857e New API- GetDrdsDbRdsRelationInfo, which can get private RDS list under certain DB out of DRDS instance ID and DB name. 5 年 前
dts eda4d09d82 DescribeDtsJobs api, delay filed change from int to long. 4 年 前
dyplsapi 1d2cdfa39f Add API for New Features. 4 年 前
dypnsapi 7107481ad3 Generated 2017-05-25 for Dypnsapi. 6 年 前
dysmsapi f0c2600a26 regenerate code 6 年 前
dyvmsapi e6902accf9 Update Dyvmsapi SDK. 4 年 前
eais 90a140992d fix: clear pop meta files 5 年 前
eas f0c2600a26 regenerate code 6 年 前
ecs 288efa5b1f Support Bond Eni. 4 年 前
edas ac628879ee Modify CreateK8sSecret. 5 年 前
ehpc 17a1e13ec3 ListAvailableEcsTypes set param ZoneId not required. 5 年 前
eipanycast e89b92569f Supported AAA for BBB. 5 年 前
elasticsearch d1aee32108 Update apm interface parameter. 4 年 前
emap d7a89ac3dc Add isv interface. 6 年 前
emr 14dc74bf6a Generated 2016-04-08 for Emr. 4 年 前
ess cc8cf316cd Update ScalingConfig parameters. 5 年 前
et-industry-openapi 9315d79274 delete invalid api code 6 年 前
examples 2e42d8fa7f update readme 7 年 前
facebody ba890b6d6c Update MergeImageFace QueryFaceImageTemplate AddFaceImageTemplate DeleteFaceImageTemplate. 4 年 前
fnf aca0a3efa8 Support ListExecutions with filter functionality. 5 年 前
foas 5f1578fdbe Support multi language. 4 年 前
ft 78e7f635c2 AMP Version Change. 5 年 前
ga 99ad81bc82 Generated 2019-11-20 for Ga. 5 年 前
geoip 90a140992d fix: clear pop meta files 5 年 前
goodstech b5e667c1d7 Update goodstech. 5 年 前
gpdb feb2350da9 Openapi support querydisplay. 4 年 前
green f9eb4e30b8 Delete MultiMedia Post Scan API. 5 年 前
hbase 669f7e68c2 Fix DescribeInstances clusterId. 4 年 前
hiknoengine f0c2600a26 regenerate code 6 年 前
hitsdb c1730219b4 Create Lindorm Open api. 5 年 前
hsm f0c2600a26 regenerate code 6 年 前
httpdns c2e912302d Supported multiple Language. 5 年 前
idrsservice d28ae22685 Supported OpenAPI for SDK. 5 年 前
imageaudit 698f5e96da Update imageaudit. 5 年 前
imageenhan 90a140992d fix: clear pop meta files 5 年 前
imageprocess 9013d93d95 Update ScreenChestCT. 5 年 前
imagerecog 58cbb932cd Update TaggingAdImage. 5 年 前
imagesearch f0c2600a26 regenerate code 6 年 前
imageseg ec2fdb4ecb Update SegmentAnimal SegmentCommonImage. 5 年 前
imgsearch 3a88e60d04 Update SearchImage. 6 年 前
imm befec9ee53 Minor changes. 4 年 前
industry-brain f82391b140 Add Content. 6 年 前
iot 541be1be3e Update OTA API, including CreateOTADynamicUpgradeJob,CreateOTAStaticUpgradeJob,QueryOTAJob. 4 年 前
iqa f0c2600a26 regenerate code 6 年 前
ivision f0c2600a26 regenerate code 6 年 前
ivpd 4332019dac Supported UpdateUserBucketConfig. 6 年 前
jarvis f0c2600a26 regenerate code 6 年 前
jarvis-public f0c2600a26 regenerate code 6 年 前
kms 3a2b4a3b0a Support key deletion protection. 5 年 前
ledgerdb d005611f56 Publish apis for ledger instances. 6 年 前
linkface f0c2600a26 regenerate code 6 年 前
linkwan 98b1ef2aea Generated 2019-03-01 for LinkWAN. 5 年 前
live 051e0b3a92 Generated 2016-11-01 for live. 4 年 前
lubancloud f0c2600a26 regenerate code 6 年 前
market f0c2600a26 regenerate code 6 年 前
metering 9fd70bc2bf Metering 1019. 6 年 前
moguan-sdk 34d72f2b3b Support APP auth. 5 年 前
mopen f0c2600a26 regenerate code 6 年 前
mts fe6548a733 SubmitURLUploadJob, support S3 Storage. 5 年 前
multimediaai 934e283efb Video Content analytics template introduced to this SDK. 5 年 前
nlp-automl f9b117f5a6 Add some console API operations. 5 年 前
objectdet cf62272b5b Update DetectVehicleICongestion DetectVehicleIllegalParking. 4 年 前
ocr a34003466f Update RecognizeCharacter. 4 年 前
ons 13d4cbf2f9 Support the IP restrictions in ram policy. 4 年 前
onsmqtt 3303c6120d Support device credential for mqtt. 5 年 前
oos 90a140992d fix: clear pop meta files 5 年 前
openanalytics f0c2600a26 regenerate code 6 年 前
openanalytics-open f063a7bdba fix: clear pop meta files 5 年 前
opensearch ededc6be9f Add API ListQuotaReviewTasks. 5 年 前
ots f0c2600a26 regenerate code 6 年 前
outboundbot 6c4aa68089 Supported new features for outbound. 4 年 前
polardb 4dea18972d Optimize the API for querying storage package information. 4 年 前
polardbx 8f21fa7c59 Supported all language sdk. 5 年 前
privatelink 9b5da5d494 Support EndpointType and ServiceType. 4 年 前
push b8ca7e85aa Supported SendChannels, AndroidMessageHuaweiUrgency, AndroidMessageHuaweiCategory for Push and MassPush. 5 年 前
pvtz 6217773578 Update new version. 5 年 前
qualitycheck 353bb56a9b Update GetSyncResult. 4 年 前
quickbi-public 524b68ac01 Add QueryEmbedTokenInfo,DeleteEmbedToken,CreateEmbedToken,DelayEmbedToken,BuildSignatureUrl, and update QueryDatasetInfo,AuthorizeMenu,AddUserTagMeta,AddUser. 4 年 前
quotas 900bb894d0 Support query quota. 5 年 前
r-kvstore 109a880552 DescirbeAvailableResource add NodeId input parameter. 5 年 前
ram f0c2600a26 regenerate code 6 年 前
rds c0e3f6e782 Update Open API. 4 年 前
reid b5c0b83b02 ListActionData add parameters. 6 年 前
reid_cloud 211ad2244b Supported cro algorithm. 5 年 前
retailcloud f73358f7e8 Supported ScaleApp totalPartitions. 4 年 前
ros f0c2600a26 regenerate code 6 年 前
rsimganalys 40d1ce44af Public V430. 5 年 前
rtc de92956a15 Delete some abandoned interface. 4 年 前
sae 6aa3c65c39 Support ACR EE, OSS, EIP for deploy. 4 年 前
saf e2a8813a1b Supported RequestDecision For YN. 4 年 前
safconsole fb12252d2d Supported console. 5 年 前
sas 056354a86e Support DescribeInstallCaptcha API. 5 年 前
sas-api f0c2600a26 regenerate code 6 年 前
scdn 0fe872d573 Fixed SDK update delay. 5 年 前
schedulerx2 7bde7a21f4 Supported List Namespaces. 5 年 前
scsp cfd8b7cb85 Publish multi language sdk. 5 年 前
sddp 4c50775cc9 Supported sdk for sddp. 5 年 前
servicemesh 82cfdabb16 Generated 2020-01-11 for servicemesh. 5 年 前
sgw 8cc78b3a3e Updated tag api. 4 年 前
slb edbe01d364 Support HealthCheckMethod for HTTP and HTTPS listener. 5 年 前
smartag c40875737f Support sts. 5 年 前
smarthosting 9693807164 Generated 2020-08-01 for SmartHosting. 6 年 前
smc 90a140992d fix: clear pop meta files 5 年 前
snsuapi f0c2600a26 regenerate code 6 年 前
sts bb60ca8fb6 Supported AssumeRoleWithOIDC. 5 年 前
tag fe60cca404 Add MetaTag APIs. 4 年 前
tdsr 565bfada36 Supported backend interface for ICBU. 6 年 前
teambition-aliyun 78ca57fe3d Fix create project task. 6 年 前
tesladam f0c2600a26 regenerate code 6 年 前
teslamaxcompute f0c2600a26 regenerate code 6 年 前
teslastream f0c2600a26 regenerate code 6 年 前
test d7f985a33b Adding some request header 6 年 前
tools c17dc7c79a refactor endpoints implementation 7 年 前
trademark f0c2600a26 regenerate code 6 年 前
ubsms f0c2600a26 regenerate code 6 年 前
vcs 1908e64fa6 Change Configuration. 5 年 前
videoenhan 90a140992d fix: clear pop meta files 5 年 前
videorecog 5590f7808b Release UnderstandVideoContent. 5 年 前
videosearch 5b5f0128c9 API GetTaskStatus return task detail. 6 年 前
videoseg df825120f3 Release SegmentGreenScreenVideo. 5 年 前
visionai-poc d7e14e0c1b Vision-poc response modified. 6 年 前
vod caafbf0de9 Set API DescribeVodDomainSrcBpsData to public. 4 年 前
voicenavigator e39d422408 Supported new features etc. 4 年 前
vpc a3a8fed5ec Generated 2016-04-28 for Vpc. 5 年 前
vs 4edd799a79 Support odcap device. 5 年 前
waf-openapi 892c369789 Generated 2019-09-10 for waf-openapi. 4 年 前
workorder c99e90b98e Encrypt Dialog Content. 5 年 前
xspace f0c2600a26 regenerate code 6 年 前
xtrace 4f16d1bd02 Add result value spanId for GetTrace api. 5 年 前
yundun f0c2600a26 regenerate code 6 年 前
yundun-ds f0c2600a26 regenerate code 6 年 前
.clang-format a57f6ec422 fix code style 6 年 前
.gitignore 175996b239 supported request headers operation 6 年 前
.travis.yml 4262cf11c8 fix travis ci config 7 年 前
CHANGELOG 541be1be3e Update OTA API, including CreateOTADynamicUpgradeJob,CreateOTAStaticUpgradeJob,QueryOTAJob. 4 年 前
CMakeLists.txt 8bed6eecc7 improve CmakeLists file 6 年 前
CONTRIBUTING.md fe958d3794 refactor readme 7 年 前
Doxyfile f6db1a27e4 Init commit 8 年 前
LICENSE 1ee62b8677 update license year 7 年 前
README-CN.md 40170293c2 chore: patch readme 5 年 前
README.md 40170293c2 chore: patch readme 5 年 前
VERSION 541be1be3e Update OTA API, including CreateOTADynamicUpgradeJob,CreateOTAStaticUpgradeJob,QueryOTAJob. 4 年 前
easyinstall.sh 31f2c5d410 improve cmake compile 6 年 前
function_test.sh 619a7827de timeout support when create client or make request 7 年 前
generate_code_cov.sh 21edc7f283 fix unit test build failed 7 年 前
unit_test.sh c99809b8e4 support http put and delete 7 年 前

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 阿里巴巴集团