Fără Descriere

jxyowen 07e2b81c13 add readme 8 ani în urmă
.idea 07e2b81c13 add readme 8 ani în urmă
3rdparty b61a72e58e Fix build failed 8 ani în urmă
aegis 7be1f34dae Fix build failed on windows 8 ani în urmă
afs 7be1f34dae Fix build failed on windows 8 ani în urmă
ccc 7be1f34dae Fix build failed on windows 8 ani în urmă
cdn 7721032f82 由温仰发起的CDN SDK自动发布, BUILD_ID=465, 版本号:1.2.12 8 ani în urmă
cloudphoto 1c441b53f5 由廷诚发起的CLOUDPHOTO SDK自动发布, 版本号:1.6.5 8 ani în urmă
cms 7be1f34dae Fix build failed on windows 8 ani în urmă
core b87f210c4c Fix setEndpoint bug 8 ani în urmă
core-tests f6db1a27e4 Init commit 8 ani în urmă
cs 7be1f34dae Fix build failed on windows 8 ani în urmă
csb 7f8b47c92f 由颍川发起的CSB SDK自动发布, 版本号:1.5.1 8 ani în urmă
dcdn 76c5ad81b7 由智久发起的DCDN SDK自动发布, 版本号:1.7.2 8 ani în urmă
domain 6ecfd8332a 由洛衡发起的DOMAIN SDK自动发布, 版本号:1.7.0 8 ani în urmă
ecs 1911aed209 由厚勇发起的ECS SDK自动发布, 版本号:1.8.0 8 ani în urmă
ehpc 7be1f34dae Fix build failed on windows 8 ani în urmă
ess 8968d04f56 由武进发起的ESS SDK自动发布, 版本号:1.6.3 8 ani în urmă
green 4fa1912a54 由尛宏发起的GREEN SDK自动发布, 版本号:1.5.0 8 ani în urmă
hsm 339cf28edd 由鸿逸发起的HSM SDK自动发布, 版本号:1.7.1 8 ani în urmă
push c3ff60fd73 由释一发起的PUSH SDK自动发布, BUILD_ID=490, 版本号:1.3.0 8 ani în urmă
rds 2d1a1c0e06 由温仰发起的RDS SDK自动发布, BUILD_ID=464, 版本号:1.2.11 8 ani în urmă
slb 4a15d5788a 由温仰发起的SLB SDK自动发布, BUILD_ID=467, 版本号:1.2.14 8 ani în urmă
tesladam 7be1f34dae Fix build failed on windows 8 ani în urmă
teslamaxcompute 442f784284 由荣旸发起的TESLAMAXCOMPUTE SDK自动发布, 版本号:1.3.8 8 ani în urmă
vpc 85da4ff587 由温仰发起的VPC SDK自动发布, BUILD_ID=466, 版本号:1.2.13 8 ani în urmă
CHANGELOG 1911aed209 由厚勇发起的ECS SDK自动发布, 版本号:1.8.0 8 ani în urmă
CMakeLists.txt 76c5ad81b7 由智久发起的DCDN SDK自动发布, 版本号:1.7.2 8 ani în urmă
Doxyfile f6db1a27e4 Init commit 8 ani în urmă
LICENSE f6db1a27e4 Init commit 8 ani în urmă
README.md 07e2b81c13 add readme 8 ani în urmă
README_zh.md 07e2b81c13 add readme 8 ani în urmă
VERSION 1911aed209 由厚勇发起的ECS SDK自动发布, 版本号:1.8.0 8 ani în urmă

README.md

Alibaba Cloud C++ Software Development Kit

中文文档

The Alibaba Cloud C++ Software Development Kit (SDK) allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Server Load Balancer (SLB), and CloudMonitor. You can access Alibaba Cloud services without the need to handle API related tasks, such as signing and constructing your requests.

This document introduces how to obtain and call Alibaba Cloud C++ SDK.

If you have any problem while using C++ SDK, please join the DingTalk group: 11771185 (the official SDK customer service group of Alibaba Cloud) for consultation.

Prerequisites

  • To use Alibaba Cloud C++ SDK, you must have an Alibaba Cloud account and an AccessKey.

    The AccessKey is required when initializing the client. You can create an AccessKey in the Alibaba Cloud console. For more information, see Create an AccessKey.

    Note: To increase the security of your account, we recommend that you use the AccessKey of the RAM user to access Alibaba Cloud services.

  • To use Alibaba Cloud C++ SDK to access the APIs of a product, you must first activate the product on the Alibaba Cloud console if required.

Install C++ SDK

  1. Install third-party libraries on the Linux platform, including libcurl, libopenssl, libuuid, and libjsoncpp.

    • Run the following commands on the Redhat/Fedora system to install third-party libraries.

      sudo dnf install libcurl-devel openssl-devel libuuid-devel libjsoncpp-devel
      

      - Run the following commands on the Debian/Ubuntu system to install third-party libraries. ``` sudo apt-get install libcurl4-openssl-dev libssl-dev uuid-dev libjsoncpp-dev

      2. Run the following commands to clone source codes from GitHub.
      
      

git clone https://github.com/aliyun/aliyun-openapi-cpp-sdk.git


## Use the C++ SDK

Before using C++ SDK, you must first configure the preprocessor to define `ALIBABACLOUD_SHARED` to achieve dynamic linking with Alibaba Cloud C++ SDK shared libraries. Then you must create a client instance, specify the region of cloud services and provide authentication parameters before sending API requests.

The following code shows how to call the [DescribeInstances](~~25506~~) API of ECS to query detailed information of all ECS instances in a specific region.

#include #include #include

using namespace AlibabaCloud; using namespace AlibabaCloud::Ecs;

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

// Configure the ECS instance ClientConfiguration configuration(""); EcsClient client("", "", configuration);

// Create an API request and set parameters Model::DescribeInstancesRequest request; request.setPageSize(10);

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; } ```