Sin descripción

sdk-team 05c8bd2c86 Modify DescribeVodUserDomains api. hace 3 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 015109df88 Support AK Audit API. hace 4 años
adb 9816949ec1 Support ModifyDBClusterPayType. hace 4 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 8f41f27e09 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
amptest 5cb1bae857 Automatically generate sdk tasks. hace 4 años
amqp-open e065d50def Add API for GetMetadataAmount. hace 6 años
antiddos-public 98aeacc7c2 Init amp. hace 4 años
apds a54f4e6f8d CreateMigrationJob SDK. hace 4 años
appmallsservice f0c2600a26 regenerate code hace 6 años
arms 15ad2ff078 Update sdk. hace 4 años
arms4finance f0c2600a26 regenerate code hace 6 años
bssopenapi 26956db67d Update QuerySavingsPlansDeductLog add field OwnerId. hace 4 años
btripopen f9cb2e2167 Test. 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 8fbb3ee026 Update ListTransitRouterVpnAttachments fix ResourceType . hace 3 años
ccc 0c86b08087 Support to pass variables to authentication IVR. hace 4 años
ccs f0c2600a26 regenerate code hace 6 años
cdn 6f27a24f42 Support STS. 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 6f86a0ac33 Add Mutimedia Screen API Support. hace 4 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 99c7c0b611 Fix ListManagedRules bugs. 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 df03038e74 Generated 2020-05-18 for dataworks-public. hace 3 años
dbfs 6d52fc0e8d Automatically generate sdk tasks. hace 4 años
dbs 979ae0c882 Automatically generate sdk tasks. hace 4 años
dcdn d1bab4fe11 Add ListDcdnEsTemplateInfo. hace 4 años
ddoscoo 1f7b94e379 Update sdk. hace 4 años
dds 40a58a91ea Update by SDK platform. hace 3 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 29faefa1ab Support ListProxies API to return protocolType, protocolPort and remove mysqlPort. hace 4 años
domain 53badb17c1 Ram action config. 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
dytnsapi 1b0819437f Automatically generate sdk tasks. hace 4 años
dyvmsapi e6902accf9 Update Dyvmsapi SDK. hace 4 años
eais 180641e5ac OpenAPI CreateEaiJupyter add optional parameter EnvironmentVar. hace 3 años
eas 01ed244f91 Fix bug. hace 4 años
ecd a336e2d994 Support remote coordinate control. hace 4 años
ecs 894262087a Add GPUMemorySize to DescribeInstanceTypes api. hace 3 años
edas ac628879ee Modify CreateK8sSecret. hace 5 años
ehpc 1b0c1eab88 Generated 2017-07-14 for EHPC. hace 4 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 82ac445152 Support DescribeAICImages. hace 3 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 ff12aa8e1c Update MonitorExamination. 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 4840d6ca87 AMP version. hace 4 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 6a9f707edb Update Lindorm OpenAPI. hace 3 años
hsm f0c2600a26 regenerate code hace 6 años
httpdns c2e912302d Supported multiple Language. hace 5 años
idaas-doraemon 2864623659 Support all language. hace 4 años
idrsservice d28ae22685 Supported OpenAPI for SDK. hace 5 años
imageaudit 698f5e96da Update imageaudit. hace 5 años
imageenhan 08bb846a89 Update MakeSuperResolutionImage. hace 3 años
imageprocess ab2dee526e Release ScreenEC. hace 3 años
imagerecog eb40626c68 Update TaggingAdImage. hace 3 años
imagesearch f0c2600a26 regenerate code hace 6 años
imageseg e4a8dc8cd4 Generated 2019-12-30 for imageseg. hace 3 años
imgsearch 3a88e60d04 Update SearchImage. hace 6 años
imm 51c7466a7c Add Body Detection and Image Splicing API. hace 4 años
industry-brain f82391b140 Add Content. hace 6 años
iot 97a4f5217e 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 192d947607 Update CreateKey and CreateSecret. hace 4 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 aa1a6d2362 Generated 2016-11-01 for live. hace 4 años
lmztest 9fde20e6f6 Automatically generate sdk tasks. 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
mns-open a358f4d5f0 Remove useless Agent parameters. hace 4 años
moguan-sdk 34d72f2b3b Support APP auth. hace 5 años
mopen f0c2600a26 regenerate code hace 6 años
mse 5706cda196 Add ListDashboardUrl api. 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 e4a6e73946 Support Elastic Desktop Service. hace 4 años
nlp-automl f9b117f5a6 Add some console API operations. hace 5 años
objectdet 57aece2625 Update DetectVehicleICongestion DetectVehicleIllegalParking. hace 3 años
ocr e7cf03a9fd Release RecognizeVATInvoice. hace 3 años
ons 949e7960dc Add spInstanceId and spInstanceType for api OnsInstanceBaseInfo. hace 4 años
onsmqtt 3303c6120d Support device credential for mqtt. hace 5 años
oos acb3224329 Add cmsGroupId parameter to CreateApplicationGroupRequest. hace 4 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 04416d35c6 Supported new features for outbound. hace 4 años
polardb e6d150f65f Support serverless feature. hace 3 años
polardbx 8f21fa7c59 Supported all language sdk. hace 5 años
privatelink 8137298eb1 Support resource scheduler. hace 4 años
push 0ff3487fe7 Supported AndroidNotificationGroup for Push and MassPush. hace 3 años
pvtz 6217773578 Update new version. hace 5 años
qualitycheck 422f236430 Add Api. hace 4 años
quickbi-public 469ca3633e Add API BatchAddFeishuUsers. hace 4 años
quotas 900bb894d0 Support query quota. hace 5 años
r-kvstore a514d1586b Update by sdk platform. hace 4 años
ram f0c2600a26 regenerate code hace 6 años
rds 82ed15642d Support More 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 2f4318d56c Supported more language for resourcemanager. hace 3 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 52e8716a55 Support UpdateApplicationVswitches and DescribeComponents. hace 4 años
saf e2a8813a1b Supported RequestDecision For YN. hace 4 años
safconsole fb12252d2d Supported console. hace 5 años
sas c786e7174e Change RefreshAssets Public. hace 4 años
sas-api f0c2600a26 regenerate code hace 6 años
scdn 5c849887e8 Support STS. hace 4 años
schedulerx2 ca43fa689c Create Job Support XAttrs. 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
smartsales 852d78709b SmartSales-OpenAPI. hace 4 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
threedvision 3b853470ee Release EstimateMonocularVideoDepth. hace 3 años
tingwu fb4f6ae3b1 Init. 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
viapi-regen b42b0028db Release CustomizeClassifyImage. hace 4 años
videoenhan 1eec105bda Release MergeVideoModelFace. hace 3 años
videorecog a1bc2cb5af Update RecognizeVideoCastCrewList. hace 3 años
videosearch 5b5f0128c9 API GetTaskStatus return task detail. hace 6 años
videoseg 2f4689f88a Update videoseg. hace 3 años
visionai-poc d7e14e0c1b Vision-poc response modified. hace 6 años
vod 05c8bd2c86 Modify DescribeVodUserDomains api. hace 3 años
voicenavigator 8ec9faabe1 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
wfts 6f08307187 Automatically generate sdk tasks. 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 99c7c0b611 Fix ListManagedRules bugs. hace 4 años
CHANGELOG.md 3e81be19ef AMP version. 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 05c8bd2c86 Modify DescribeVodUserDomains api. hace 3 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 阿里巴巴集团