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

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

  1. 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

    1. Download and install the following tools:
    2. Install and configure Alibaba Cloud Toolkit.
      Download and install Alibaba Cloud Toolkit from the plug-in marketplace.
      1. In the top navigation bar of IntelliJ IDEA, choose File > Settings.
      2. In the Settings dialog box, click Plugins in the left-side navigation pane.
      3. In the Plugins section, click Marketplace.
      4. Enter Alibaba Cloud Toolkit in the search box.
      5. In the Search Results section, Alibaba Cloud Toolkit is displayed. Click Install.
        search toolkit
      6. After you download and install Alibaba Cloud Toolkit, click Restart IDE.

    Install and configure Alibaba Cloud Toolkit in Eclipse

    1. Download and install the following tools:
      Note To use the built-in Target Management (TM) Terminal, make sure that the version of the TM Terminal is 4.1.0 or later.
    2. Install and configure Alibaba Cloud Toolkit.
      Download and install Alibaba Cloud Toolkit from Eclipse Marketplace.
      1. In the top navigation bar of Eclipse, choose Help > Eclipse Marketplace.
      2. In the Eclipse Marketplace dialog box, enter Alibaba Cloud Toolkit in the Find field and click Go or press Enter.
        eclipse marketplace.png
      3. In the search results, click Install in the lower-right corner of the Alibaba Cloud Toolkit section.
      4. Perform the subsequent steps as instructed on the Install page of Eclipse.

    Install and configure Alibaba Cloud Toolkit in PyCharm

    1. Install PyCharm 2018.01 or later.
    2. Install and configure Alibaba Cloud Toolkit.
      Download and install Alibaba Cloud Toolkit from PyCharm Marketplace.
      1. Open PyCharm.
      2. In the left-side navigation pane, click Plugins.
      3. On the Marketplace tab, enter Alibaba Cloud Toolkit in the search box.
      4. In the Search Results section, Alibaba Cloud Toolkit is displayed. Click Install.
        pycharm marketplace
      5. In the Third-party Plugins Privacy Note message, click Accept.
      6. Perform the subsequent steps as instructed on the installation page of PyCharm.
  2. Manage functions.

    This topic uses IntelliJ IDEA as an example to describe how to manage functions.

    1. Open IntelliJ IDEA.
    2. In the right-side navigation pane, click Alibaba Function Compute.
    3. 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.
      qitafacs
      • 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.