Manage templates and stacks with Alibaba Cloud Toolkit for Visual Studio Code

更新时间:
复制 MD 格式

After you install and configure Alibaba Cloud Toolkit (Cloud Toolkit) in Visual Studio Code, you are provided with automatic suggestions when you write ROS templates. You can also manage templates and stacks more efficiently.

Prerequisites

Background information

Resource Orchestration Service (ROS) is integrated with the Cloud Toolkit extension. After you install and configure Cloud Toolkit in Visual Studio Code, you can use this integration to manage templates and stacks more efficiently.

For more information about Cloud Toolkit, see What is Alibaba Cloud Toolkit?.

Manage templates

In Cloud Toolkit, you can use the ROS LOCAL TEMPLATES module to manage local templates and the ROS REMOTE TEMPLATES module to manage remote templates.

  1. In Visual Studio Code, create or open a project folder.

  2. Create a template.

    1. In the Activity Bar on the left, click the 模板 icon.

    2. Click ROS LOCAL TEMPLATES.

    3. Click +, select AlibabaCloud ROS YAML Template or AlibabaCloud ROS JSON Template, and then enter a template name. This creates a local template in the JSON or YAML format.

      Note

      When you create a template for the first time, Visual Studio Code automatically generates a .ros.config.json file. The ROS LOCAL TEMPLATES module uses this file to manage templates. This file records the path of the project folder and the names of the local template files.

  3. Edit the template.

    • AlibabaCloud ROS YAML Template example

    • AlibabaCloud ROS JSON Template example

    Note
    • Under Resources, you can enter a keyword for a resource type to receive suggestions for all related resource types.

    • Cloud Toolkit automatically notifies you of any syntax error in the template.

  4. Manage local templates.

    1. Hover over ROS LOCAL TEMPLATES and click an icon to manage templates.

      The following table describes the features.

      Feature

      Description

      Open Folder

      Opens the local folder.

      Refresh

      Refreshes the local folder.

      Create

      Creates a local template. When you use this extension to create a template for the first time, a .ros.config.yml file and JSON and YAML folders are created by default.

      Upload

      Uploads the local template to a remote location.

      Note

      After you upload a template, it appears in the ROS REMOTE TEMPLATES (remote template list). You can also view the uploaded template in the Resource Orchestration Service console.

    2. Right-click a local template and perform an operation as needed.

      The following table describes the features.

      Feature

      Description

      Delete

      Deletes the local template.

      Rename

      Renames the local template.

      Upload

      Uploads the local template.

      Note

      After you upload a template, it appears in the ROS REMOTE TEMPLATES (remote template list). You can also view the uploaded template in the Resource Orchestration Service console.

    Note

    Open a local .ros.json or .ros.yaml template file. Then, right-click in the template editor and click Alibaba Cloud ROS - Create Stack. You are redirected to the Create Stack page in the ROS console to create a stack.

  5. Manage remote templates (templates in the ROS console).

    1. Hover over ROS REMOTE TEMPLATES and click an icon to manage templates.

      The following table describes the features.

      Feature

      Description

      Refresh

      Refreshes the remote template folder.

      Update

      Updates the remote template. This updates the template in the Resource Orchestration Service console.

      Download

      Downloads the remote template. You can click Download to download a template from the Resource Orchestration Service console to your local machine.

    2. Right-click a remote template and perform an operation as needed.

      The following table describes the features.

      Feature

      Description

      Delete

      Deletes the remote template. This deletes the template from the Resource Orchestration Service console.

      Download

      Downloads the remote template. You can click Download to download a template from the Resource Orchestration Service console to your local machine.

      Rename

      Renames the remote template.

      Update

      Updates the remote template.

      1. Click Update to open the remote template comparison box.

      2. Edit the template on the right.

        Note

        The template on the left cannot be edited.

      3. In the right template section, right-click. In the dialog box that appears, click Alibaba Cloud Ros - Update Template to update the template in the Resource Orchestration Service console.

      Note
      • When you click a remote template, a temporary file is opened by default for you to view the template content.

      • You can hover over a remote template to view its properties.

Manage stacks

The Alibaba Cloud View module in Alibaba Cloud Toolkit lets you manage remote stacks, which are stacks in the ROS console.

  1. In Visual Studio Code, create or open a project folder.

  2. In the Activity Bar on the left, click the 资源栈图标 icon.

  3. Select Alibaba Cloud View > ROS VIEW and perform an operation as needed.

    The following table describes the features.

    Feature

    Description

    Region

    Select the region where the stack is located.

    Search

    In the current region, search for a stack by its ID or name. If you do not enter anything, the stack list for the current region is refreshed.

    Create Stack

    Creates a stack. You are automatically redirected to the Create Stack page in the ROS console.

    Stack ID/Name

    Click the name to view the properties of the stack.

    Status

    Shows the current status of the stack.

    Create At

    Shows the creation time of the stack.

    Outputs

    Shows the output values of the stack.

    Delete

    Deletes the stack.

    More

    • Properties: Shows the properties of the stack.

    • Resources: Shows information about all resources in the stack.

    • Parameters: Shows the parameters of the stack.

Contact us

If you need further assistance or want to provide feedback, you can contact Alibaba Cloud by joining the customer support DingTalk group. The group number is 11783495.