You can use Function Compute in the Function Compute console or in an integrated development
environment (IDE), such as IntelliJ IDEA, Eclipse, or PyCharm. In a specific IDE,
you can run and download functions that are deployed in the cloud and create and upload
on-premises functions. This topic uses IntelliJ IDEA as an example to describe how
to manage functions.
Prerequisites
Funcraft is installed. For more information, see Install Funcraft.
Function Compute is activated. For more information, see Function Compute.
Background information
Function Compute is a fully managed and event-driven serverless computing service. Function Compute
allows you to schedule and use a large amount of computing resources with efficiency
in an elastic and stable runtime environment. When you use Function Compute, you can
focus on writing and uploading code to run the code in the cloud. You do not need
to purchase and manage infrastructure resources such as servers.
After you install Funcraft, you can create, run, debug, and deploy functions, and
run and download functions that are deployed in the cloud in a specific IDE.
You must install Alibaba Cloud Toolkit before you use an IDE, such as IntelliJ IDEA,
Eclipse, or PyCharm, to manage functions. Alibaba Cloud Toolkit supports data sharing.
After you install and configure Alibaba Cloud Toolkit in a specific IDE, you can view
the information about the functions in Function Compute within your Alibaba Cloud
account in the IDE.
Procedure
Install and configure Alibaba Cloud Toolkit.
The following content describes how to install and configure Alibaba Cloud Toolkit
in the three IDEs.
Install and configure Alibaba Cloud Toolkit in IntelliJ IDEA
Download and install Alibaba Cloud Toolkit from PyCharm Marketplace.
Open PyCharm.
In the left-side navigation pane, click Plugins.
On the Marketplace tab, enter Alibaba Cloud Toolkit in the search box.
In the Search Results section, Alibaba Cloud Toolkit is displayed. Click Install.
In the Third-party Plugins Privacy Note message, click Accept.
Perform the subsequent steps as instructed on the installation page of PyCharm.
Manage functions.
This topic uses IntelliJ IDEA as an example to describe how to manage functions.
Open IntelliJ IDEA.
In the right-side navigation pane, click Alibaba Function Compute.
In the Alibaba Function Compute panel, select a region from the drop-down list. Then, manage your on-premises resources
or resources deployed in the cloud as required.
To manage your on-premises resources, click Local Resources.
Create a resource: Click the plus sign in the upper-right corner of the Alibaba Function Compute panel. In the Create Function dialog box, set the parameters as required and click Add.
Notice When you use IntelliJ IDEA for the first time, you must create an on-premises resource
before you run and debug on-premises functions.
Run an on-premises function: Right-click the function that you want to run and select
Local Run.
Debug an on-premises function: Right-click the function that you want to debug and
select Local Debug.
View a function: Right-click the function that you want to view and select Go To Code.
Note Functions written in Java do not support this feature.
Deploy a service in Function Compute and all the functions in the service: Right-click
the service that you want to deploy and select Deploy Service.
Deploy a function: Right-click the function that you want to deploy and select Deploy Function.
To manage your resources deployed in the cloud, click Remote Resources.
Run a function deployed in the cloud: Right-click the function that you want to run
and select Remote Run or Copy URL.
Download a service in Function Compute and all the functions in the service: Right-click
the service that you require and select Import To Local.
Download a function: Right-click the function that you want to download and select
Import To Local.
View the performance of a service in Function Compute: Right-click the service whose
performance you want to view and select Properties.
View the performance of a function: Right-click the function whose performance you
want to view and select Properties.
Note When you download, run, or deploy an object, IntelliJ IDEA returns operations logs
to the Console section. You can check the operation results based on the logs.