Aucune description

sdk-team ea23aa89b7 Fixed bugs for CCC. il y a 5 ans
.github ecd09578e8 fix typo in issue template il y a 7 ans
3rdparty ad045aa702 fix build failed il y a 7 ans
acm 30fd9f48a0 Support namespaces. il y a 6 ans
acms-open 54883f36c2 ACM POP SDK. il y a 6 ans
actiontrail 2f2b5d5ffe Generated 2020-07-06, 2017-12-04 for Actiontrail. il y a 5 ans
adb a4f9a98de3 Support Tag API. il y a 6 ans
address-purification e3faa7d285 Support for addrp. il y a 6 ans
aegis f0c2600a26 regenerate code il y a 6 ans
afs f0c2600a26 regenerate code il y a 6 ans
airec 1a401aa70a Generated 2018-10-12 for Airec. il y a 6 ans
alidns 0ccab36f2f Supported PaymentType for DescribeDnsProductInstance. il y a 5 ans
alimt c2dc12f92b Add a new interface for asynchronous image translation. il y a 5 ans
alinlp b60a834a97 Generated 2020-06-29 for alinlp. il y a 6 ans
aliyuncvc f5fe7fb428 Public beta version. il y a 6 ans
amqp-open e065d50def Add API for GetMetadataAmount. il y a 6 ans
appmallsservice f0c2600a26 regenerate code il y a 6 ans
arms f1590ff81a Add OpenARMS api. il y a 5 ans
arms4finance f0c2600a26 regenerate code il y a 6 ans
bssopenapi 2191c80b02 Add PipCode and CommodityCode for QueryInstanceBill, QueryBillOverview, QueryBill, QuerySettleBill, QueryAccountBill, QuerySplitItemBill. il y a 6 ans
cams 05785cf5fd ChatApp third version. il y a 6 ans
cas f0c2600a26 regenerate code il y a 6 ans
cassandra 134828d83c Generated 2019-01-01 for Cassandra. il y a 6 ans
cbn f0c2600a26 regenerate code il y a 6 ans
ccc ea23aa89b7 Fixed bugs for CCC. il y a 5 ans
ccs f0c2600a26 regenerate code il y a 6 ans
cdn 17a893fab4 Update SetVideoSeekConfig. il y a 5 ans
chatbot f0c2600a26 regenerate code il y a 6 ans
cloudapi f0c2600a26 regenerate code il y a 6 ans
cloudauth b176afa994 ContrastFaceVerify Support Video. il y a 5 ans
cloudesl 838459913d Fix bug. il y a 5 ans
cloudgame 6088526cd8 Supported CloudGame. il y a 6 ans
cloudphoto f0c2600a26 regenerate code il y a 6 ans
cloudwf f0c2600a26 regenerate code il y a 6 ans
cms f0c2600a26 regenerate code il y a 6 ans
codeup f937d7b2e5 Add tags api, include GetRepositoryTag, ListRepositoryTags, DeleteRepositoryTag. il y a 5 ans
companyreg f0c2600a26 regenerate code il y a 6 ans
config 2a0fc860e2 Support event type in timeline of resource properties. il y a 5 ans
core ee91c28732 fix: set http body with body parameters il y a 6 ans
cr f0c2600a26 regenerate code il y a 6 ans
crm f0c2600a26 regenerate code il y a 6 ans
cs 9290117d12 Some new parameters are supported. il y a 6 ans
csb b257cba9c3 Add FindServiceList and GetService qps. il y a 6 ans
cusanalytic_sc_online f0c2600a26 regenerate code il y a 6 ans
dataworks-public 6a7977923c Generated 2020-05-18 for dataworks-public. il y a 5 ans
dbfs c811dc5d85 Generate dbfs sdk. il y a 6 ans
dbs 2d5bf1dbd8 Add DisableBackupLog. il y a 6 ans
dcdn 61acf6ad90 Update OpenDcdnService. il y a 5 ans
ddoscoo 42b2b25562 Generated 2020-01-01 for ddoscoo. il y a 5 ans
dds 78d79a3d5b Update DescribeDedicatedClusterInstanceList return data. il y a 5 ans
democenter 56c516a238 Add demo edition auth. il y a 6 ans
devops-rdc 8fdebda354 Support taskList. il y a 5 ans
dms-enterprise a15ee90c20 Supported ApproveOrder to add comment message. il y a 6 ans
domain da7aefe5aa Support SubmitOperationAuditInfo for Support self-service submission of approval information. il y a 6 ans
drds f76139580d Supported golang sdk. il y a 5 ans
dts 843a2c0be7 Support CPP and Go and PHP. il y a 5 ans
dyplsapi f289e0290b Add AddSecretBlacklist and DeleteSecretBlacklist. il y a 6 ans
dypnsapi 7107481ad3 Generated 2017-05-25 for Dypnsapi. il y a 6 ans
dysmsapi f0c2600a26 regenerate code il y a 6 ans
dyvmsapi f0c2600a26 regenerate code il y a 6 ans
eas f0c2600a26 regenerate code il y a 6 ans
ecs 032ffdc520 Support autoPtovisioning whth DiskConfigs. il y a 5 ans
ehpc b5790be0db Support multiple security group for one ehpc cluster. il y a 6 ans
elasticsearch f66ec181b6 Supported International-26888 Sites Region Endpoints. il y a 5 ans
emap d7a89ac3dc Add isv interface. il y a 6 ans
emr f0c2600a26 regenerate code il y a 6 ans
ess cc8cf316cd Update ScalingConfig parameters. il y a 5 ans
et-industry-openapi 9315d79274 delete invalid api code il y a 6 ans
examples 2e42d8fa7f update readme il y a 7 ans
facebody df2d0d89e1 Update SearchFace. il y a 5 ans
fnf aca0a3efa8 Support ListExecutions with filter functionality. il y a 5 ans
foas f0c2600a26 regenerate code il y a 6 ans
ft f0c2600a26 regenerate code il y a 6 ans
geoip 84659b3f3e Support offline instance. il y a 6 ans
goodstech b5e667c1d7 Update goodstech. il y a 5 ans
gpdb f0c2600a26 regenerate code il y a 6 ans
green a3f2125666 Supported webpage scan. il y a 5 ans
hbase 9052652131 Add SourceType for severless instance. il y a 5 ans
hiknoengine f0c2600a26 regenerate code il y a 6 ans
hitsdb 830db8c54b Create TSDB Open api. il y a 5 ans
hsm f0c2600a26 regenerate code il y a 6 ans
httpdns c2e912302d Supported multiple Language. il y a 5 ans
imageaudit 2d9dc66719 Update Imageaudit. il y a 5 ans
imageenhan f3b00eade0 Release ErasePerson. il y a 5 ans
imageprocess 8f6d6d4d1d Update DetectLungNodule. il y a 5 ans
imagerecog 7f711be94a Update imagerecog. il y a 5 ans
imagesearch f0c2600a26 regenerate code il y a 6 ans
imageseg 9d2395215f Update SegmentBody. il y a 5 ans
imgsearch 3a88e60d04 Update SearchImage. il y a 6 ans
imm 9d980b6731 Support drm. il y a 5 ans
industry-brain f82391b140 Add Content. il y a 6 ans
iot efb0804bf2 fix: RRpcResult messageId type il y a 5 ans
iqa f0c2600a26 regenerate code il y a 6 ans
ivision f0c2600a26 regenerate code il y a 6 ans
ivpd 4332019dac Supported UpdateUserBucketConfig. il y a 6 ans
jarvis f0c2600a26 regenerate code il y a 6 ans
jarvis-public f0c2600a26 regenerate code il y a 6 ans
kms 3c991c9ca9 Add Certificate Manager Api. il y a 5 ans
ledgerdb d005611f56 Publish apis for ledger instances. il y a 6 ans
linkface f0c2600a26 regenerate code il y a 6 ans
live a180b00ed8 Generated 2016-11-01 for live. il y a 5 ans
lubancloud f0c2600a26 regenerate code il y a 6 ans
market f0c2600a26 regenerate code il y a 6 ans
metering 9fd70bc2bf Metering 1019. il y a 6 ans
mopen f0c2600a26 regenerate code il y a 6 ans
mts cc6cea96e4 Add TemplateId. il y a 6 ans
multimediaai 934e283efb Video Content analytics template introduced to this SDK. il y a 5 ans
nlp-automl c4348c87cb Modify CreateAsyncPredict add new parameters. il y a 6 ans
objectdet e54c1961cb Update objectdet. il y a 5 ans
ocr 02122aa7ea Release DetectCardScreenshot RecognizePoiName. il y a 5 ans
ons e3b1009a94 Add API OpenOnsService which can active ons service. il y a 6 ans
onsmqtt 06eedce285 Support session query operations. il y a 6 ans
oos 5f2a993b52 Support GetParameters, GetParametersByPath, GetSecretParameters, GetSecretParametersByPath. il y a 5 ans
openanalytics f0c2600a26 regenerate code il y a 6 ans
openanalytics-open 423fdd2fe5 Supported Open Api. il y a 5 ans
ots f0c2600a26 regenerate code il y a 6 ans
outboundbot f0c2600a26 regenerate code il y a 6 ans
polardb 59fadb7eb2 Support DescribeDBClusterVersion. il y a 5 ans
polardbx 9663b548cf Supported all language sdk. il y a 5 ans
push 38438abdfb Supported AndroidNotificationNotifyId for Push and MassPush. il y a 6 ans
pvtz 6217773578 Update new version. il y a 5 ans
r-kvstore 97fa00faef Add DeccribeEngineVersion DescribeTasks DescribeInstanceConfig and more APIs. il y a 5 ans
ram f0c2600a26 regenerate code il y a 6 ans
rds 653f3e596c regenerate the rds c++ sdk. il y a 5 ans
reid b5c0b83b02 ListActionData add parameters. il y a 6 ans
retailcloud 0e02d3bc63 Supported AAA for BBB. il y a 6 ans
ros f0c2600a26 regenerate code il y a 6 ans
rsimganalys 060788e017 Public. il y a 5 ans
rtc c68f639be4 Generated 2018-01-11 for rtc. il y a 5 ans
sae 1309d87fdb Release latest features. il y a 5 ans
saf 86f01c44a8 Support sg for ml region. il y a 6 ans
sas 95a93b89f1 Support DescribeAllEntity API. il y a 6 ans
sas-api f0c2600a26 regenerate code il y a 6 ans
scdn 5ae199177a Update DescribeScdnDomainCertificateInfo. il y a 5 ans
schedulerx2 03fb512456 Supported Grant Permission. il y a 6 ans
sddp f0c2600a26 regenerate code il y a 6 ans
sgw 0cf373bc60 Cloud Storage Gateway openapi sdk is released. il y a 5 ans
slb f0c2600a26 regenerate code il y a 6 ans
smartag f0c2600a26 regenerate code il y a 6 ans
smarthosting 9693807164 Generated 2020-08-01 for SmartHosting. il y a 6 ans
smc d6aeb545bc Generated 2019-06-01 for smc. il y a 5 ans
snsuapi f0c2600a26 regenerate code il y a 6 ans
sts f0c2600a26 regenerate code il y a 6 ans
tag 243879b17f Generated 2018-08-28 for Tag. il y a 6 ans
tdsr 565bfada36 Supported backend interface for ICBU. il y a 6 ans
teambition-aliyun 78ca57fe3d Fix create project task. il y a 6 ans
tesladam f0c2600a26 regenerate code il y a 6 ans
teslamaxcompute f0c2600a26 regenerate code il y a 6 ans
teslastream f0c2600a26 regenerate code il y a 6 ans
test d7f985a33b Adding some request header il y a 6 ans
tools c17dc7c79a refactor endpoints implementation il y a 7 ans
trademark f0c2600a26 regenerate code il y a 6 ans
ubsms f0c2600a26 regenerate code il y a 6 ans
vcs 1908e64fa6 Change Configuration. il y a 5 ans
videoenhan 5c14e9a77f Update videoenhan. il y a 5 ans
videorecog fb8137a8d3 Update videorecog. il y a 5 ans
videosearch 5b5f0128c9 API GetTaskStatus return task detail. il y a 6 ans
videoseg 8af4775c5e Release SegmentHalfBody. il y a 6 ans
visionai-poc d7e14e0c1b Vision-poc response modified. il y a 6 ans
vod d088239972 Add a new api named SubmitAIImageAuditJob to submit image ai detection job. il y a 6 ans
voicenavigator f0c2600a26 regenerate code il y a 6 ans
vpc f0c2600a26 regenerate code il y a 6 ans
vs c707baa95b Generated 2018-12-12 for vs. il y a 6 ans
waf-openapi 0e778cd17c Generated 2019-09-10 for waf-openapi. il y a 5 ans
workorder feab9dcc06 New api publish. il y a 6 ans
xspace f0c2600a26 regenerate code il y a 6 ans
xtrace b4903d0fd0 Support Sampling for jaeger. il y a 5 ans
yundun f0c2600a26 regenerate code il y a 6 ans
yundun-ds f0c2600a26 regenerate code il y a 6 ans
.clang-format a57f6ec422 fix code style il y a 6 ans
.gitignore 175996b239 supported request headers operation il y a 6 ans
.travis.yml 4262cf11c8 fix travis ci config il y a 7 ans
CHANGELOG ea23aa89b7 Fixed bugs for CCC. il y a 5 ans
CMakeLists.txt 8bed6eecc7 improve CmakeLists file il y a 6 ans
CONTRIBUTING.md fe958d3794 refactor readme il y a 7 ans
Doxyfile f6db1a27e4 Init commit il y a 8 ans
LICENSE 1ee62b8677 update license year il y a 7 ans
README-CN.md f5057db511 doc : add Troubleshoot il y a 6 ans
README.md f5057db511 doc : add Troubleshoot il y a 6 ans
VERSION 5a6bd32d63 DescribeCameraStatistics add parameters. il y a 6 ans
easyinstall.sh 31f2c5d410 improve cmake compile il y a 6 ans
function_test.sh 619a7827de timeout support when create client or make request il y a 7 ans
generate_code_cov.sh 21edc7f283 fix unit test build failed il y a 7 ans
unit_test.sh c99809b8e4 support http put and delete il y a 7 ans

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