Skip to content

aliyun/aliyun-openapi-net-sdk

Folders and files

NameName
Last commit message
Last commit date
Dec 23, 2024
Jul 20, 2022
Nov 13, 2023
May 22, 2021
Aug 1, 2024
Feb 20, 2024
Jan 24, 2025
Jan 16, 2024
Mar 30, 2021
Sep 22, 2021
Dec 14, 2022
Apr 11, 2023
May 11, 2023
Mar 8, 2024
Sep 16, 2022
Mar 22, 2023
Apr 3, 2024
Feb 27, 2024
Mar 7, 2025
May 19, 2023
May 23, 2022
Jan 26, 2024
Jul 8, 2021
Nov 22, 2022
Apr 26, 2022
Nov 17, 2022
Jan 29, 2021
Dec 13, 2023
Feb 23, 2022
Apr 3, 2024
Jul 18, 2022
Jun 11, 2021
Sep 9, 2021
Apr 23, 2024
May 23, 2023
Dec 14, 2021
Feb 15, 2022
Dec 23, 2024
Dec 23, 2024
Jan 19, 2022
Apr 25, 2022
Mar 16, 2023
Jan 30, 2024
Dec 27, 2021
Jun 25, 2023
Jun 30, 2022
Dec 12, 2023
Nov 5, 2024
Jul 9, 2021
Jan 18, 2021
Jun 5, 2024
Mar 10, 2022
Apr 10, 2023
Oct 17, 2024
Mar 11, 2025
Feb 21, 2023
Jul 19, 2023
Jul 31, 2024
Sep 17, 2021
Mar 14, 2023
Oct 24, 2024
Jun 25, 2023
Oct 26, 2021
Oct 10, 2022
Jul 11, 2022
Sep 22, 2021
Oct 28, 2024
Dec 24, 2024
Sep 1, 2021
Jul 22, 2024
May 9, 2022
Dec 28, 2022
Dec 13, 2022
Mar 26, 2024
Nov 2, 2021
Aug 11, 2022
Apr 14, 2021
Dec 13, 2021
Aug 1, 2023
Apr 2, 2024
Feb 21, 2022
Jan 15, 2024
Jun 6, 2024
Dec 20, 2022
Feb 17, 2023
Dec 15, 2023
Mar 15, 2023
Jul 19, 2024
Feb 24, 2023
Apr 27, 2021
Oct 23, 2024
Feb 2, 2024
Jun 28, 2021
Aug 30, 2024
May 11, 2023
Sep 13, 2021
Aug 1, 2024
Mar 2, 2023
Mar 2, 2023
Dec 13, 2024
Feb 17, 2023
May 11, 2021
Jul 10, 2024
Jul 23, 2024
Oct 28, 2024
Apr 10, 2024
Jul 4, 2023
Dec 28, 2023
Nov 23, 2021
Nov 20, 2023
Jan 11, 2023
Feb 1, 2021
Jul 7, 2023
Dec 21, 2022
Sep 24, 2024
Jan 31, 2023
Dec 18, 2024
Mar 13, 2025
Jun 18, 2024
Jan 7, 2022
Mar 28, 2023
Mar 21, 2025
May 30, 2022
Mar 14, 2025
Aug 30, 2024
Jul 19, 2024
Jan 6, 2023
Aug 13, 2024
Aug 31, 2021
Oct 10, 2024
Jan 8, 2024
May 15, 2023
Oct 19, 2021
Jan 21, 2021
Apr 22, 2024
Dec 1, 2021
Feb 4, 2021
Jul 29, 2022
Jul 24, 2023
Jan 17, 2023
Jun 25, 2024
Mar 25, 2024
Dec 24, 2021
Apr 1, 2024
Apr 26, 2021
Mar 14, 2025
Oct 11, 2023
Mar 2, 2023
Dec 14, 2022
May 17, 2024
Nov 30, 2021
Dec 15, 2022
Nov 25, 2022
Feb 17, 2023
May 30, 2024
Mar 14, 2023
Oct 17, 2022
Mar 21, 2025
Aug 31, 2022
Mar 10, 2023
Sep 26, 2021
May 14, 2024
Jul 13, 2022
Jun 16, 2021
Feb 7, 2025
Jul 24, 2020
Jun 16, 2020
Aug 20, 2019
May 30, 2019
May 21, 2024
Mar 21, 2025
Jul 29, 2022
May 30, 2019
Jan 2, 2020
Sep 30, 2024
Sep 30, 2024
Apr 17, 2019
Aug 19, 2019

Repository files navigation

English | 简体中文

Alibaba Cloud SDK for .NET

.NET CI codecov Nuget Version Nuget Download License FOSSA Status

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

Troubleshoot

Troubleshoot Provide OpenAPI diagnosis service to help developers locate quickly and provide solutions for developers through RequestID or error message.

Online Demo

Alibaba Cloud OpenAPI Developer Portal provides the ability to call the cloud product OpenAPI online, generates SDK Example code dynamically and retrieves interface quickly, which can lessen the difficultly of using the Alibaba Cloud API significantly.

Requirements

  • The Alibaba Cloud SDK for .NET requires:
    • .NET Framework 4.5 and above
    • .NET Standard 2.0 and above
    • C# 4.0 and above

Installation

You should install ECS Nuget Package when you are using ECS Product. If you want to install a specific version, please add --version or it will install the latest version of this package.

Use .NET CLI ( Recommand )

dotnet add package aliyun-net-sdk-ecs

Use Package Manager

Install-Package aliyun-net-sdk-ecs

Quick Examples

At the beginning, you need to sign up for an Alibaba Cloud account and retrieve your Credentials.

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

Initiate a call

The following code example show three main steps to use the Alibaba Cloud SDK for .NET:

  • Create and initialize a DefaultAcsClient instance.

  • Create a request and set parameters.

  • Initiate the request and handle the response.

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

class Program
{
    static void Main(string[] args)
    {
        // Create a client used for initiating a request
        IClientProfile profile = DefaultProfile.GetProfile(
            "<your-region-id>",
            "<your-access-key-id>",
            "<your-access-key-secret>");
        DefaultAcsClient client = new DefaultAcsClient(profile);

        try
        {
            // Create the request
            DescribeInstancesRequest request = new DescribeInstancesRequest();
            request.PageSize = 10;

            // Initiate the request and get the response
            DescribeInstancesResponse response = client.GetAcsResponse(request);
            System.Console.WriteLine(response.TotalCount);
        }
        catch (ServerException ex)
        {
            System.Console.WriteLine(ex.ToString());
        }
        catch (ClientException ex)
        {
            System.Console.WriteLine(ex.ToString());
        }
    }
}

Use BearerToken to invoke CCC Product

You should install the CCC Product Nuget Package if you want to run the below demo in your local machine.

using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Profile;
using Aliyun.Acs.Core.Exceptions;
using Aliyun.Acs.CCC.Model.V20170705;

class Program
{
    static void Main(string[] args)
    {
        // Create a client used for initiating a request
        var profile = DefaultProfile.GetProfile("<your-region-id>");
        var bearerTokenCredentialProvider = new BearerTokenCredentialProvider("<your-bearertoken>");

        var client = new DefaultAcsClient(profile, bearerTokenCredentialProvider);

        try
        {
            // Create the request
            var request = new ListPhoneNumbersRequest();

            // Initiate the request and get the response
            var response = client.GetAcsResponse(request);
            
            // Do something as you want below
        }
        catch (ServerException ex)
        {
            System.Console.WriteLine(ex.ToString());
        }
        catch (ClientException ex)
        {
            System.Console.WriteLine(ex.ToString());
        }
    }
}

Documentation

Issues

Opening an Issue, Issues not conforming to the guidelines may be closed immediately.

Changelog

Detailed changes for each release are documented in the release notes.

API Reference

You can visit the API and its parameters in Product List.

License

Apache-2.0

FOSSA Status