All Projects → VAllens → aliyun-openapi-sdk-net-core

VAllens / aliyun-openapi-sdk-net-core

Licence: other
aliyun open api sdk for .net core 2.0

Projects that are alternatives of or similar to aliyun-openapi-sdk-net-core

Raft.net
Implementation of RAFT distributed consensus algorithm among TCP Peers on .NET / .NETStandard / .NETCore / dotnet
Stars: ✭ 112 (+558.82%)
Mutual labels:  dotnetcore, netcore, net
awesome-dotnet-async
A curated list of awesome articles and resources to learning and practicing about async, threading, and channels in .Net platform. 😉
Stars: ✭ 84 (+394.12%)
Mutual labels:  dotnetcore, netcore
Cosmos.Identity
A Cosmos storage provider for ASP.NET Core Identity.
Stars: ✭ 26 (+52.94%)
Mutual labels:  dotnetcore, netcore
Module Shop
一个基于 .NET Core构建的简单、跨平台、模块化的商城系统
Stars: ✭ 398 (+2241.18%)
Mutual labels:  dotnetcore, netcore
Capstone.NET
.NET Core and .NET Framework binding for the Capstone Disassembly Framework
Stars: ✭ 108 (+535.29%)
Mutual labels:  dotnetcore, netcore
DotNetGraph
Create GraphViz DOT graph with .NET / C#
Stars: ✭ 57 (+235.29%)
Mutual labels:  dotnetcore, netcore
Gb28181.solution
Linux/Win/Docker/kubernetes/Chart/Kustomize/GB28181/SIP/RTP/SDP/WebRTC/作为上下级域/平台级联互联
Stars: ✭ 323 (+1800%)
Mutual labels:  dotnetcore, netcore
Winton.extensions.configuration.consul
Enables Consul to be used as a configuration source in dotnet core applications
Stars: ✭ 239 (+1305.88%)
Mutual labels:  netcore, net
Restfulsense
A RESTFul operations client that serializes responses and throws meaningful exceptions for >= 400 status codes.
Stars: ✭ 28 (+64.71%)
Mutual labels:  dotnetcore, netcore
Dispatchproxyasync
System.Reflection.DispatchProxy to Async Proxy
Stars: ✭ 33 (+94.12%)
Mutual labels:  dotnetcore, netcore
Module Shop Mini Program
一个基于 .NET Core构建的简单、跨平台、模块化的商城系统
Stars: ✭ 89 (+423.53%)
Mutual labels:  dotnetcore, netcore
Openapi Core Nodejs Sdk
OpenAPI POP core SDK for Node.js
Stars: ✭ 156 (+817.65%)
Mutual labels:  openapi, aliyun
Waliyun
阿里云Node.js Open API SDK(完整版)
Stars: ✭ 40 (+135.29%)
Mutual labels:  openapi, aliyun
Awesome-Nuget-Packages
📦 A collection of awesome and top .NET packages sorted by most popular needs.
Stars: ✭ 87 (+411.76%)
Mutual labels:  dotnetcore, netcore
Aliyun Sdk Js
阿里云 SDK for Javascript,支持在浏览器和 Nodejs 环境使用,支持大部分阿里云服务。
Stars: ✭ 727 (+4176.47%)
Mutual labels:  openapi, aliyun
Simplcommerce
A simple, cross platform, modularized ecommerce system built on .NET Core
Stars: ✭ 3,474 (+20335.29%)
Mutual labels:  dotnetcore, netcore
Anndotnet
ANNdotNET - deep learning tool on .NET Platform.
Stars: ✭ 109 (+541.18%)
Mutual labels:  netcore, net
Mqttnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 2,486 (+14523.53%)
Mutual labels:  netcore, net
Networker
A simple to use TCP and UDP networking library for .NET. Compatible with Unity.
Stars: ✭ 408 (+2300%)
Mutual labels:  dotnetcore, netcore
Mmalsharp
C# wrapper to Broadcom's MMAL with an API to the Raspberry Pi camera.
Stars: ✭ 152 (+794.12%)
Mutual labels:  dotnetcore, netcore

Open API SDK for .Net Core developers

Requirements

  • 仅支持 .NET Core 2.0 及以上版本(为推进新版本发展,停止支持 .NET Core 1.0、1.1版本);
  • 下载SDK 把 Aliyun.Acs.Core.dll 和相应产品的 .dll 文件添加引用到项目中。

Installation

进入 Alibaba Cloud SDK for .NET Nuget Package 页面,查看已发布的阿里云产品 SDK 模块列表。

注意: 部分阿里云产品的 SDK 未收录到这个列表中,例如对象存储(OSS),表格存储(Table Store),请前往这些产品的详情页获取相应的 SDK。

使用ECS产品时,应安装 ECS Nuget Package。 如果要安装特定版本,请添加--version,否则它将安装此软件包的最新版本。

您可以通过 NuGet 程序包管理器来安装:

  • 解决方案资源管理器面板 中右击您的项目选择 管理 NuGet 程序包 菜单,在打开的 NuGet 管理面板 中点击 浏览 选项卡输入 aliyun-net-sdk,在下方列表中选择 AuthorsAlibaba Cloud 由官方发布的各产品模块,选择您期望的模块点击 安装 即可。

或者通过 .NET CLI 工具来安装(以安装 ECS为例)

dotnet add package aliyun-net-sdk-ecs

使用程序包管理器控制台

Install-Package aliyun-net-sdk-ecs

Examples

using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Exceptions;
using Aliyun.Acs.Core.Profile;
using Aliyun.Acs.Ecs.Model.V20140526;
using System;

class Sample
{
    static void Main(string[] args)
    {
        TestDescribeInstanceAttribute();
    }

    private static void TestDescribeInstanceAttribute()
    {

        IClientProfile clientProfile = DefaultProfile.GetProfile("cn-hangzhou", "<your access key id>", "<your access key secret>");
        DefaultAcsClient client = new DefaultAcsClient(clientProfile);

        DescribeInstanceAttributeRequest request = new DescribeInstanceAttributeRequest();
        request.InstanceId = "<your instances id>";
        try
        {
            DescribeInstanceAttributeResponse response = client.GetAcsResponse(request);
            Console.Write(response.InstanceId);
        }
        catch (ServerException e)
        {
            Console.WriteLine(e.ErrorCode);
            Console.WriteLine(e.ErrorMessage);
        }
        catch (ClientException e)
        {
            Console.WriteLine(e.ErrorCode);
            Console.WriteLine(e.ErrorMessage);
        }
    }
}

Questions

  1. 怎么判断API调用成功?

    通过catch异常判断API是否调用成功,当 API 的 http status >= 200 && http status < 300 表示API调用成功;当http status >= 300 && http status < 500 SDK 抛出 ClientException;当http status >= 500 SDK 抛出 ServerException.

  2. IClientProfile clientProfile = DefaultProfile.GetProfile("< your request regionid >", "< your access key id >", "< your access key secret >");

    此处的regionid参数指你需要操作的regionid,例如要操作杭州region,则regionid=cn-hangzhou;默认填cn-hangzhou.

  3. docker for linux 环境中,如何无错运行Aliyun SDK Application? 请在Dockerfile中指定FROM microsoft/dotnet:latest, 而不是FROM microsoft/aspnetcore:latest.

Authors && Contributors

License

licensed under the Apache License 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].