This topic describes how to install and use Alibaba Cloud Developer Toolkit in a JetBrains integrated development environment (IDE).
Install Alibaba Cloud Developer Toolkit
Prerequisites
A JetBrains IDE such as IntelliJ IDEA, PyCharm, or GoLand is installed.
The version of the JetBrains IDE is 2022.2 or later.
In this example, two methods are provided to install Alibaba Cloud Developer Toolkit in IntelliJ IDEA for Windows.
Method 1: Download and install Alibaba Cloud Developer Toolkit from the plug-in marketplace
In the top navigation bar of IntelliJ IDEA, click the icon. On the page that appears, click
in the left-side navigation pane. Alternatively, choose in the top navigation bar. On the page that appears, click Plugins in the left-side navigation pane.On the Plugins page, click the Marketplace tab.
Search for Alibaba Cloud Developer Toolkit and click Install.
Click Apply and then click OK.
Method 2: Download the installation package by using a browser
Visit JetBrains Marketplace by using a browser and download the plug-in package to your on-premises device.
In the top navigation bar of IntelliJ IDEA, click the icon. On the page that appears, click
in the left-side navigation pane. Alternatively, choose in the top navigation bar. On the page that appears, click Plugins in the left-side navigation pane.On the Plugins page, click the icon and select
. Select the package that you download to install Alibaba Cloud Developer Toolkit. You do not need to decompress the package.
Verify the installation
If the shortcut for Alibaba Cloud Developer Toolkit is displayed in the left-side navigation pane of IntelliJ IDEA, the plug-in is installed.
Configure profiles
You must configure a profile with valid user identity and credential information if you want to call Alibaba Cloud API operations. Alibaba Cloud Developer Toolkit supports only an AccessKey pair as the user identity and credential. You can use one of the following methods to configure profiles.
Method 1
In the upper-left corner of the Alibaba Cloud Developer Toolkit page, click New Profile or the icon.
Configure the Profile Name, RegionId, Access Key ID, and Secret Access Key parameters. For more information about AccessKey pairs, see View the AccessKey pair of a RAM user.
ImportantAn Alibaba Cloud account has full permissions on resources. If the AccessKey pair of an Alibaba Cloud account is leaked, all resources within the account face great security risks. We recommend that you do not use the AccessKey pair of an Alibaba Cloud account.
Click Add Configurations.
In the lower-right corner of the Alibaba Cloud Developer Toolkit page, the Profile added. message appears. Click the drop-down list in the left-side navigation pane to view the profile that is added.
Click the name of a profile to switch to the profile.
Method 2
If you have installed Alibaba Cloud CLI, Alibaba Cloud Developer Toolkit automatically reuses the configurations of Alibaba Cloud CLI. For more information about how to configure credentials for Alibaba Cloud CLI, see Overview.
Click the drop-down list in the left-side navigation pane view existing profiles. You can also view the profile that is in use in the lower-right corner of the page.
Click the name of a profile to switch the profile.
Feature description
After Alibaba Cloud Developer Toolkit is installed in a JetBrains IDE, you can conveniently access Alibaba Cloud services in the IDE. For example, you can search for the APIs of Alibaba Cloud services, debug API operations, and generate and insert SDK demos.
Search for Alibaba Cloud services and API operations
In the left-side navigation pane of the Alibaba Cloud Developer Toolkit page, Alibaba Cloud services are displayed in a tree view. You can search for a service by entering a keyword in the search box. You can also click a service in the tree view to view the API operations of the service and search for a specific API operation on the Alibaba Cloud API tab on the right side.
View API references
After you click an API operation, a new tab appears and displays the API reference. The API reference contains information such as the usage notes, request parameters, response parameters, and error codes.
Debug API operations
You can debug API operations after you configure a valid profile that passes the authentication of Alibaba Cloud.
You can configure the parameters on the tab of an API operation based on the API reference and debug the API operation. The debugging result is displayed in the JetBrains IDE. You can also click Debug to debug the API operation in OpenAPI Explorer.
View and insert SDK sample code
View SDK sample code
Alibaba Cloud Developer Toolkit allows you to generate SDK sample code in the JetBrains IDE.
After you configure the parameters of an API operation, the sample code that is used to call the API operation is dynamically generated. You can view and edit the sample code in the JetBrains IDE.
Maven dependencies can be automatically added.
You can click Installation Method to view the methods to install dependencies. You can also click View Source Code to view the SDK sample code.
Insert SDK sample code
You can insert a sample code snippet of an SDK for Java or an SDK for Java for asynchronous invocation into your code within a few clicks. The corresponding maven dependencies can be automatically added to the pom.xml file. If you want to enable or disable this feature, right-click ctrl+cmd+p
.