Managing Resource Labels
Scenarios
You can set labels to identify and group host and application resources managed in a bastion host. In this way, you can identify all resources related to a managed host or application resource.
After a label is added to a resource, all resources related to the resource will be labeled. In this way, you can search for resources by label.
As show in Figure 1, each managed resource, such as ECSs and RDS instances, is tagged with two labels. Label 1 is identified by team, and Label 2 and Label 3 are identified by project. You can search for resources by label.
Notes and Constraints
- You can define resource labels for your exclusive use as long as you have required permission. Labels cannot be shared among system users.
- A resource can have up to 10 labels.
- If a label is not used by any resources, the system will automatically delete it.
Prerequisites
Your role has the management permission for the corresponding resource modules (Host, Application Publish, Host Operations, and App Operations). For details about the permissions of each role, see Role.
Adding a Label to a Resource
The following describes how to add a label to a host resource. The method to add labels for other types of resources is similar. Their entries are listed in Resource Label Operation Entries and Supported Actions.
- Log in to your bastion host system.
- In the navigation pane on the left, choose to go to the host resource management page.
- Add labels to host resources as required.
- Adding a label to a single resource
- Locate the row that contains the target host resource, and click the resource name or Manage in the Operation column to go to the details page.
- In the Basic Info area, click Edit on the right.
- Enter a custom label in the Label text box.
- A maximum of 20 characters are allowed. Spaces are not allowed.
- Press Enter to automatically create the label.
- If the entered label is incorrect, click
to delete it.
- Click OK.
- Adding a label to multiple resources at once
- On the host list page, select all the target host resources.
- Click Add Label below the list.
- Enter a custom label in the Label text box.
- A maximum of 20 characters are allowed. Spaces are not allowed.
- Press Enter to automatically create the label.
- If the entered label is incorrect, click
to delete it.
- Click OK.
- Adding a label to a single resource
- Return to the host list and view the added labels in the Label column.
Querying Resources by Label
The following describes how to query host resources by label. The method to query other types of resources by label is similar. Their entries are listed in Resource Label Operation Entries and Supported Actions.
- Log in to your bastion host system.
- In the navigation pane on the left, choose to go to the host resource management page.
- In the Label column on the host list page, click
. - Select a match method.
- Any match: A host can be filtered out as long as it contains one of the selected labels.
- Match All: A host can be filtered out only when it contains all the selected labels.
- Select the labels for the query. The hosts that meet the query conditions appear in the host list.
Deleting a Resource Label
The following describes how to delete a label from a host resource. The method to delete labels for other types of resources is similar. Their entries are listed in Resource Label Operation Entries and Supported Actions.
- Log in to your bastion host system.
- In the navigation pane on the left, choose to go to the host resource management page.
- Delete host resource labels as required.
- Deleting a label from a single resource
- Locate the row that contains the target host resource, and click the resource name or Manage in the Operation column to go to the details page.
- In the Basic Info area, click Edit on the right.
- In the Label text box, click
on the right of the label to delete it. - Click OK.
- Deleting labels from multiple resources at once
- On the host list page, select all the target host resources.
- Click Delete Label below the list.
- Click OK.
All labels on the selected hosts will be deleted.
- Deleting a label from a single resource
Resource Label Operation Entries and Supported Actions
| Operation Entry | Supported Operation |
|---|---|
|
| Search for resources. |
|
| Search for resources. |
|
| Search for resources. |
|
| Search for resources. |
|
| Add, delete, or edit labels and search for resources by labels. |
|
| Add, delete, or edit labels and search for resources by labels. |
|
| Add or delete labels and search for resources by label. |
|
| Add or delete labels and search for resources by label. |
