update_machine_group
Modifies the information of a machine group.
Request syntax
aliyunlog log update_machine_group --project_name=<value> --group_detail=<value> [--access-id=<value>] [--access-key=<value>] [--sts-token=<value>] [--region-endpoint=<value>] [--client-name=<value>] [--jmes-filter=<value>] [--format-output=<value>] [--decode-output=<value>]Request parameters
The following table describes the required and specific parameters of the update_machine_group command.
Parameter | Type | Required | Example | Description |
--project_name | String | Yes | aliyun-test-project | The name of the project. |
--group_detail | JSON Object | Yes | file://./machinegroup.json | The modified configuration file of the machine group. |
For information about the global parameters of the Log Service command-line interface (CLI), see Global parameters.
Examples
Modify a file named machinegroup.json in which the machine group name is group_name2. The following example shows the content of the machinegroup.json file:
{ "machine_list": [ "machine1", "machine2" ], "machine_type": "userdefined", "group_name": "group_name2", "group_type": "", "group_attribute": { "groupTopic": "topic x" } }Parameters:
Parameter
Description
machine_list
Server identifiers in the machine group.
-
If machineIdentifyType is ip, enter server IP addresses.
-
If machineIdentifyType is userdefined, enter custom IDs. Create a custom ID-based machine group.
machine_type
Machine group identifier type. Valid values:
-
ip: IP address identifiers.
-
userdefined: Custom ID identifiers.
group_name
Machine group name. Requirements:
-
Must be unique within the project.
-
Contains only lowercase letters, digits, hyphens (-), and underscores (_).
-
Starts and ends with a lowercase letter or digit.
-
3 to 128 characters long.
group_type
Machine group type. Set to null.
group_attribute
Machine group attributes, described in the following table.
group_attribute parameters:
Parameter
Description
groupTopic
Machine group topic.
-
Use the default account to modify the configuration file of a machine group named group_name2.
aliyunlog log update_machine_group --project_name="aliyun-test-project" --group_detail="file://./machinegroup.json"Query the information of the machine group. Run the following command:
aliyunlog log get_machine_group --project_name="aliyun-test-project" --group_name="group_name2"The following output is returned:
{ "createTime": 1622105480, "groupAttribute": { "externalName": "", "groupTopic": "topic x", "osType": "", "policy": "", "region": "" }, "groupName": "group_name2", "groupType": "", "lastModifyTime": 1622105480, "machineIdentifyType": "userdefined", "machineList": [ "machine1", "machine2" ] }
Error codes
If an error message is returned, fix the error based on the error codes of the related API operation. For more information, see Error codes.