diff --git a/ChangeLog.md b/ChangeLog.md index 6e18970..fd0c2f3 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +2024-12-23 Version: 2.2.0 +- Support API UpdateClusterAttribute. + + 2024-12-02 Version: 2.1.2 - Update API CreateCluster: add param DeletionProtection. - Update API DecreaseNodes: add param BatchInterval. diff --git a/src/Emr.php b/src/Emr.php index e9234bd..b7058ef 100644 --- a/src/Emr.php +++ b/src/Emr.php @@ -137,6 +137,8 @@ use AlibabaCloud\SDK\Emr\V20210320\Models\UpdateApiTemplateResponse; use AlibabaCloud\SDK\Emr\V20210320\Models\UpdateApplicationConfigsRequest; use AlibabaCloud\SDK\Emr\V20210320\Models\UpdateApplicationConfigsResponse; +use AlibabaCloud\SDK\Emr\V20210320\Models\UpdateClusterAttributeRequest; +use AlibabaCloud\SDK\Emr\V20210320\Models\UpdateClusterAttributeResponse; use AlibabaCloud\SDK\Emr\V20210320\Models\UpdateScriptRequest; use AlibabaCloud\SDK\Emr\V20210320\Models\UpdateScriptResponse; use AlibabaCloud\SDK\Emr\V20210320\Models\UpdateScriptShrinkRequest; @@ -3657,7 +3659,7 @@ public function listReleaseVersions($request) } /** - * @summary Queries the bootstrap actions or common scripts of an E-MapReduce (EMR) cluster. + * @summary Query EMR cluster bootstrap scripts or regular scripts. * * * @param ListScriptsRequest $request ListScriptsRequest * @param RuntimeOptions $runtime runtime options for this request RuntimeOptions @@ -3702,7 +3704,7 @@ public function listScriptsWithOptions($request, $runtime) } /** - * @summary Queries the bootstrap actions or common scripts of an E-MapReduce (EMR) cluster. + * @summary Query EMR cluster bootstrap scripts or regular scripts. * * * @param ListScriptsRequest $request ListScriptsRequest * @@ -4011,7 +4013,7 @@ public function runApplicationAction($request) /** * @summary Creates a pay-as-you-go or subscription E-MapReduce (EMR) cluster. * * - * @description RunCluster is an upgraded version of CreateCluster and supports more parameters. Parameters of the object and array types are in the JSON format, which are friendly for users who use CLI. + * @description RunCluster is an upgraded version of CreateCluster. RunCluster uses HTTPS POST requests and supports more parameters. Complex parameters, such as parameters of the object and array types, are in the JSON format and are more friendly for users who use CLI. * * * @param RunClusterRequest $tmpReq RunClusterRequest * @param RuntimeOptions $runtime runtime options for this request RuntimeOptions @@ -4122,7 +4124,7 @@ public function runClusterWithOptions($tmpReq, $runtime) /** * @summary Creates a pay-as-you-go or subscription E-MapReduce (EMR) cluster. * * - * @description RunCluster is an upgraded version of CreateCluster and supports more parameters. Parameters of the object and array types are in the JSON format, which are friendly for users who use CLI. + * @description RunCluster is an upgraded version of CreateCluster. RunCluster uses HTTPS POST requests and supports more parameters. Complex parameters, such as parameters of the object and array types, are in the JSON format and are more friendly for users who use CLI. * * * @param RunClusterRequest $request RunClusterRequest * @@ -4390,6 +4392,61 @@ public function updateApplicationConfigs($request) return $this->updateApplicationConfigsWithOptions($request, $runtime); } + /** + * @param UpdateClusterAttributeRequest $request UpdateClusterAttributeRequest + * @param RuntimeOptions $runtime runtime options for this request RuntimeOptions + * + * @return UpdateClusterAttributeResponse UpdateClusterAttributeResponse + */ + public function updateClusterAttributeWithOptions($request, $runtime) + { + Utils::validateModel($request); + $query = []; + if (!Utils::isUnset($request->clusterId)) { + $query['ClusterId'] = $request->clusterId; + } + if (!Utils::isUnset($request->clusterName)) { + $query['ClusterName'] = $request->clusterName; + } + if (!Utils::isUnset($request->deletionProtection)) { + $query['DeletionProtection'] = $request->deletionProtection; + } + if (!Utils::isUnset($request->description)) { + $query['Description'] = $request->description; + } + if (!Utils::isUnset($request->regionId)) { + $query['RegionId'] = $request->regionId; + } + $req = new OpenApiRequest([ + 'query' => OpenApiUtilClient::query($query), + ]); + $params = new Params([ + 'action' => 'UpdateClusterAttribute', + 'version' => '2021-03-20', + 'protocol' => 'HTTPS', + 'pathname' => '/', + 'method' => 'POST', + 'authType' => 'AK', + 'style' => 'RPC', + 'reqBodyType' => 'formData', + 'bodyType' => 'json', + ]); + + return UpdateClusterAttributeResponse::fromMap($this->callApi($params, $req, $runtime)); + } + + /** + * @param UpdateClusterAttributeRequest $request UpdateClusterAttributeRequest + * + * @return UpdateClusterAttributeResponse UpdateClusterAttributeResponse + */ + public function updateClusterAttribute($request) + { + $runtime = new RuntimeOptions([]); + + return $this->updateClusterAttributeWithOptions($request, $runtime); + } + /** * @summary Updates a bootstrap action or a common script of an E-MapReduce (EMR) cluster. * * diff --git a/src/Models/CreateClusterRequest.php b/src/Models/CreateClusterRequest.php index abe4b3f..fb9e682 100644 --- a/src/Models/CreateClusterRequest.php +++ b/src/Models/CreateClusterRequest.php @@ -9,7 +9,7 @@ class CreateClusterRequest extends Model { /** - * @description The service configurations. Number of elements in the array: 1 to 1000. + * @description The application configurations. Number of elements in the array: 1 to 1000. * * @var ApplicationConfig[] */ @@ -84,6 +84,8 @@ class CreateClusterRequest extends Model public $deployMode; /** + * @description The cluster description. + * * @example Emr cluster for ETL * * @var string @@ -91,7 +93,7 @@ class CreateClusterRequest extends Model public $description; /** - * @description The attributes of all ECS instances. The basic attributes of all ECS instances in the cluster. + * @description The attributes of all ECS instances. * * This parameter is required. * @var NodeAttributes @@ -132,7 +134,7 @@ class CreateClusterRequest extends Model public $regionId; /** - * @description The version of EMR. You can view the EMR release version on the EMR cluster purchase page. + * @description The EMR version. You can query available E-MapReduce (EMR) versions in the EMR console. * * This parameter is required. * @example EMR-5.8.0 @@ -163,14 +165,14 @@ class CreateClusterRequest extends Model public $securityMode; /** - * @description The subscription configurations. This parameter is required only if you set the PaymentType parameter to Subscription. + * @description The subscription configurations. This parameter takes effect only if you set the PaymentType parameter to Subscription. * * @var SubscriptionConfig */ public $subscriptionConfig; /** - * @description The list of tags. Number of elements in the array: 0 to 20. + * @description The tags. Number of elements in the array: 0 to 20. * * @example A7D960FA-6DBA-5E07-8746-A63E3E4D**** * diff --git a/src/Models/DecreaseNodesRequest.php b/src/Models/DecreaseNodesRequest.php index 8337995..f2ab28e 100644 --- a/src/Models/DecreaseNodesRequest.php +++ b/src/Models/DecreaseNodesRequest.php @@ -9,11 +9,15 @@ class DecreaseNodesRequest extends Model { /** + * @description The cooldown interval between two batches. + * * @var int */ public $batchInterval; /** + * @description The number of nodes to be removed in a single batch. + * * @var int */ public $batchSize; diff --git a/src/Models/DeleteApiTemplateRequest.php b/src/Models/DeleteApiTemplateRequest.php index 0cb1ec3..d7520bd 100644 --- a/src/Models/DeleteApiTemplateRequest.php +++ b/src/Models/DeleteApiTemplateRequest.php @@ -9,7 +9,7 @@ class DeleteApiTemplateRequest extends Model { /** - * @description 接口名。 + * @description Interface name. * * This parameter is required. * @example CreateCluster @@ -19,7 +19,7 @@ class DeleteApiTemplateRequest extends Model public $apiName; /** - * @description 区域ID。 + * @description Region ID * * This parameter is required. * @example cn-hangzhou @@ -29,7 +29,7 @@ class DeleteApiTemplateRequest extends Model public $regionId; /** - * @description 资源组ID。 + * @description Resource group ID. * * @example rg-acfmzabjyop**** * @@ -38,7 +38,7 @@ class DeleteApiTemplateRequest extends Model public $resourceGroupId; /** - * @description 集群模板id。 + * @description Cluster template ID. * * This parameter is required. * @example at-**** diff --git a/src/Models/DeleteApiTemplateResponseBody.php b/src/Models/DeleteApiTemplateResponseBody.php index e711d71..4f1cc4f 100644 --- a/src/Models/DeleteApiTemplateResponseBody.php +++ b/src/Models/DeleteApiTemplateResponseBody.php @@ -9,7 +9,7 @@ class DeleteApiTemplateResponseBody extends Model { /** - * @description 请求ID。 + * @description Request ID. * * @example DD6B1B2A-5837-5237-ABE4-FF0C8944**** * @@ -18,6 +18,8 @@ class DeleteApiTemplateResponseBody extends Model public $requestId; /** + * @description Whether the call was successful: - true: Call succeeded - false: Call failed. + * * @example true * * @deprecated diff --git a/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta.php b/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta.php index 27961db..6683553 100644 --- a/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta.php +++ b/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta.php @@ -126,7 +126,7 @@ class clusterCloneMeta extends Model public $existCloneConfig; /** - * @description The attributes of all ECS instances. + * @description The node attributes. * * @var NodeAttributes */ @@ -205,7 +205,7 @@ class clusterCloneMeta extends Model public $subscriptionConfig; /** - * @description The list of tags. + * @description The tags. * * @var Tag[] */ diff --git a/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta/scalingPolicies.php b/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta/scalingPolicies.php index f158c55..ff01bbc 100644 --- a/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta/scalingPolicies.php +++ b/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta/scalingPolicies.php @@ -45,6 +45,8 @@ class scalingPolicies extends Model public $scalingPolicyId; /** + * @description The type of the auto scaling policy. + * * @var string */ public $scalingPolicyType; diff --git a/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta/scalingPolicies/constraints.php b/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta/scalingPolicies/constraints.php index 12d258b..43710ae 100644 --- a/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta/scalingPolicies/constraints.php +++ b/src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta/scalingPolicies/constraints.php @@ -18,6 +18,8 @@ class constraints extends Model public $maxCapacity; /** + * @description The maximum number of nodes that you can configure based on your business requirements. + * * @var int */ public $maxOnDemandCapacity; diff --git a/src/Models/ListScriptsRequest.php b/src/Models/ListScriptsRequest.php index 4561eb0..27cd227 100644 --- a/src/Models/ListScriptsRequest.php +++ b/src/Models/ListScriptsRequest.php @@ -9,7 +9,7 @@ class ListScriptsRequest extends Model { /** - * @description 集群ID。 + * @description Cluster ID. * * This parameter is required. * @example c-b933c5aac8fe**** @@ -19,7 +19,7 @@ class ListScriptsRequest extends Model public $clusterId; /** - * @description 一次获取的最大记录数。取值范围:1~100。 + * @description The maximum number of records to retrieve at once. * * @example 10 * @@ -28,7 +28,7 @@ class ListScriptsRequest extends Model public $maxResults; /** - * @description 标记当前开始读取的位置,置空表示从头开始。 + * @description Marks the current position to start reading from. * * @example dd6b1b2a-5837-5237-abe4-ff0c89568980 * @@ -37,7 +37,7 @@ class ListScriptsRequest extends Model public $nextToken; /** - * @description 区域ID。 + * @description Region ID. * * This parameter is required. * @example cn-hangzhou @@ -47,7 +47,7 @@ class ListScriptsRequest extends Model public $regionId; /** - * @description 集群脚本类型。 + * @description Type of cluster script. Possible values: * * This parameter is required. * @example BOOTSTRAP diff --git a/src/Models/ListScriptsResponseBody.php b/src/Models/ListScriptsResponseBody.php index a639092..e892978 100644 --- a/src/Models/ListScriptsResponseBody.php +++ b/src/Models/ListScriptsResponseBody.php @@ -10,7 +10,7 @@ class ListScriptsResponseBody extends Model { /** - * @description 本次请求所返回的最大记录条数。 + * @description The maximum number of records returned in this request. * * @example 10 * @@ -19,7 +19,7 @@ class ListScriptsResponseBody extends Model public $maxResults; /** - * @description 返回读取到的数据位置,空代表数据已经读取完毕。 + * @description The position of the data read. * * @example dd6b1b2a-5837-5237-abe4-ff0c89568982 * @@ -28,7 +28,7 @@ class ListScriptsResponseBody extends Model public $nextToken; /** - * @description 请求ID。 + * @description Request ID. * * @example DD6B1B2A-5837-5237-ABE4-FF0C8944**** * @@ -37,14 +37,14 @@ class ListScriptsResponseBody extends Model public $requestId; /** - * @description The scripts. + * @description List of scripts. * * @var scripts[] */ public $scripts; /** - * @description 本次请求条件下的数据总量。 + * @description The total amount of data under the conditions of this request. * * @example 200 * diff --git a/src/Models/ListScriptsResponseBody/scripts.php b/src/Models/ListScriptsResponseBody/scripts.php index f361692..d312011 100644 --- a/src/Models/ListScriptsResponseBody/scripts.php +++ b/src/Models/ListScriptsResponseBody/scripts.php @@ -10,7 +10,7 @@ class scripts extends Model { /** - * @description The name of the API operation. + * @description API name. * * @example ListScripts * @@ -19,7 +19,7 @@ class scripts extends Model public $action; /** - * @description The time when the system finishes the running of the script. This parameter is returned only if the ScriptType parameter is set to NORMAL. + * @description End execution time. This value is returned only when `ScriptType` is `NORMAL`. * * @example 1639715635819 * @@ -28,11 +28,9 @@ class scripts extends Model public $endTime; /** - * @description The policy that is used to handle execution failures of the script. Valid values: - * - * FAILED_CONTINUE - * FAILED_BLOCK + * @description Execution failure strategy. Possible values: * + * - FAILED_BLOCK: Block after failure. * @example FAILED_CONTINUE * * @var string @@ -40,11 +38,9 @@ class scripts extends Model public $executionFailStrategy; /** - * @description The time based on which the system runs the script. Valid values: - * - * BEFORE_INSTALL - * AFTER_STARTED + * @description Execution timing. Possible values: * + * - AFTER_STARTED: After application startup. * @example BEFORE_INSTALL * * @var string @@ -52,12 +48,9 @@ class scripts extends Model public $executionMoment; /** - * @description The status of the script. This parameter is returned only if the `ScriptType` parameter is set to `NORMAL`. Valid values: - * - * SCRIPT_COMPLETED - * SCRIPT_SUBMISSION_FAILED - * SCRIPT_RUNNING + * @description Script execution state. This value is returned only when `ScriptType` is `NORMAL`. Possible values: * + * - SCRIPT_RUNNING: Script is running. * @example SCRIPT_COMPLETED * * @var string @@ -65,7 +58,7 @@ class scripts extends Model public $executionState; /** - * @description The time when the script was last modified. + * @description Time of the last update. * * @example 1639714634819 * @@ -74,14 +67,14 @@ class scripts extends Model public $lastUpdateTime; /** - * @description The node selector. + * @description Node selector. * * @var NodeSelector */ public $nodeSelector; /** - * @description The region ID. + * @description Region ID. * * @example cn-hangzhou * @@ -90,7 +83,7 @@ class scripts extends Model public $regionId; /** - * @description The runtime parameters of the script. + * @description Script execution parameters. * * @example --mode=client -h -p * @@ -99,7 +92,7 @@ class scripts extends Model public $scriptArgs; /** - * @description The script ID. + * @description Script ID. * * @example cs-bf25219d103043a0820613e32781**** * @@ -108,7 +101,7 @@ class scripts extends Model public $scriptId; /** - * @description The name of the script. + * @description Script name. * * @example check_env * @@ -117,7 +110,7 @@ class scripts extends Model public $scriptName; /** - * @description The path in which the script is stored. + * @description Script path. * * @example oss://bucket1/check_evn.sh * @@ -126,7 +119,7 @@ class scripts extends Model public $scriptPath; /** - * @description The time when the system starts to run the script. This parameter is returned only if the ScriptType parameter is set to NORMAL. + * @description Start execution time. This value is returned only when `ScriptType` is `NORMAL`. * * @example 1639714634000 * diff --git a/src/Models/RunClusterRequest.php b/src/Models/RunClusterRequest.php index 6a969f1..d2c96f6 100644 --- a/src/Models/RunClusterRequest.php +++ b/src/Models/RunClusterRequest.php @@ -9,14 +9,14 @@ class RunClusterRequest extends Model { /** - * @description The service configurations. Number of elements in the array: 1 to 1,000. + * @description The application configurations. Number of elements in the array: 1 to 1000. * * @var ApplicationConfig[] */ public $applicationConfigs; /** - * @description The list of services. Number of elements in the array: 1 to 100. + * @description The services. Number of elements in the array: 1 to 100. * * This parameter is required. * @var Application[] @@ -93,7 +93,7 @@ class RunClusterRequest extends Model public $description; /** - * @description The basic attributes of all ECS instances in the cluster. + * @description The attributes of all ECS instances. * * @var NodeAttributes */ @@ -162,14 +162,14 @@ class RunClusterRequest extends Model public $securityMode; /** - * @description The subscription configurations. This parameter is required only if you set the PaymentType parameter to Subscription. + * @description The subscription configurations. This parameter takes effect only if you set the PaymentType parameter to Subscription. * * @var SubscriptionConfig */ public $subscriptionConfig; /** - * @description The list of tags. Number of elements in the array: 0 to 20. + * @description The tags. Number of elements in the array: 0 to 20. * * @var Tag[] */ diff --git a/src/Models/RunClusterShrinkRequest.php b/src/Models/RunClusterShrinkRequest.php index 5e6120f..0829d74 100644 --- a/src/Models/RunClusterShrinkRequest.php +++ b/src/Models/RunClusterShrinkRequest.php @@ -9,14 +9,14 @@ class RunClusterShrinkRequest extends Model { /** - * @description The service configurations. Number of elements in the array: 1 to 1,000. + * @description The application configurations. Number of elements in the array: 1 to 1000. * * @var string */ public $applicationConfigsShrink; /** - * @description The list of services. Number of elements in the array: 1 to 100. + * @description The services. Number of elements in the array: 1 to 100. * * This parameter is required. * @var string @@ -93,7 +93,7 @@ class RunClusterShrinkRequest extends Model public $description; /** - * @description The basic attributes of all ECS instances in the cluster. + * @description The attributes of all ECS instances. * * @var string */ @@ -162,14 +162,14 @@ class RunClusterShrinkRequest extends Model public $securityMode; /** - * @description The subscription configurations. This parameter is required only if you set the PaymentType parameter to Subscription. + * @description The subscription configurations. This parameter takes effect only if you set the PaymentType parameter to Subscription. * * @var string */ public $subscriptionConfigShrink; /** - * @description The list of tags. Number of elements in the array: 0 to 20. + * @description The tags. Number of elements in the array: 0 to 20. * * @var string */ diff --git a/src/Models/UpdateClusterAttributeRequest.php b/src/Models/UpdateClusterAttributeRequest.php new file mode 100644 index 0000000..d251e11 --- /dev/null +++ b/src/Models/UpdateClusterAttributeRequest.php @@ -0,0 +1,113 @@ + 'ClusterId', + 'clusterName' => 'ClusterName', + 'deletionProtection' => 'DeletionProtection', + 'description' => 'Description', + 'regionId' => 'RegionId', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->clusterId) { + $res['ClusterId'] = $this->clusterId; + } + if (null !== $this->clusterName) { + $res['ClusterName'] = $this->clusterName; + } + if (null !== $this->deletionProtection) { + $res['DeletionProtection'] = $this->deletionProtection; + } + if (null !== $this->description) { + $res['Description'] = $this->description; + } + if (null !== $this->regionId) { + $res['RegionId'] = $this->regionId; + } + + return $res; + } + + /** + * @param array $map + * + * @return UpdateClusterAttributeRequest + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['ClusterId'])) { + $model->clusterId = $map['ClusterId']; + } + if (isset($map['ClusterName'])) { + $model->clusterName = $map['ClusterName']; + } + if (isset($map['DeletionProtection'])) { + $model->deletionProtection = $map['DeletionProtection']; + } + if (isset($map['Description'])) { + $model->description = $map['Description']; + } + if (isset($map['RegionId'])) { + $model->regionId = $map['RegionId']; + } + + return $model; + } +} diff --git a/src/Models/UpdateClusterAttributeResponse.php b/src/Models/UpdateClusterAttributeResponse.php new file mode 100644 index 0000000..91da85e --- /dev/null +++ b/src/Models/UpdateClusterAttributeResponse.php @@ -0,0 +1,71 @@ + 'headers', + 'statusCode' => 'statusCode', + 'body' => 'body', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->headers) { + $res['headers'] = $this->headers; + } + if (null !== $this->statusCode) { + $res['statusCode'] = $this->statusCode; + } + if (null !== $this->body) { + $res['body'] = null !== $this->body ? $this->body->toMap() : null; + } + + return $res; + } + + /** + * @param array $map + * + * @return UpdateClusterAttributeResponse + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['headers'])) { + $model->headers = $map['headers']; + } + if (isset($map['statusCode'])) { + $model->statusCode = $map['statusCode']; + } + if (isset($map['body'])) { + $model->body = UpdateClusterAttributeResponseBody::fromMap($map['body']); + } + + return $model; + } +} diff --git a/src/Models/UpdateClusterAttributeResponseBody.php b/src/Models/UpdateClusterAttributeResponseBody.php new file mode 100644 index 0000000..6839441 --- /dev/null +++ b/src/Models/UpdateClusterAttributeResponseBody.php @@ -0,0 +1,51 @@ + 'RequestId', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->requestId) { + $res['RequestId'] = $this->requestId; + } + + return $res; + } + + /** + * @param array $map + * + * @return UpdateClusterAttributeResponseBody + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['RequestId'])) { + $model->requestId = $map['RequestId']; + } + + return $model; + } +}