Skip to content

Commit

Permalink
Support API UpdateClusterAttribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdk-team committed Dec 23, 2024
1 parent 7427c4d commit 8b81f9e
Show file tree
Hide file tree
Showing 17 changed files with 360 additions and 59 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
65 changes: 61 additions & 4 deletions src/Emr.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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.
* *
Expand Down
12 changes: 7 additions & 5 deletions src/Models/CreateClusterRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
*/
Expand Down Expand Up @@ -84,14 +84,16 @@ class CreateClusterRequest extends Model
public $deployMode;

/**
* @description The cluster description.
*
* @example Emr cluster for ETL
*
* @var string
*/
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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****
*
Expand Down
4 changes: 4 additions & 0 deletions src/Models/DecreaseNodesRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/Models/DeleteApiTemplateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class DeleteApiTemplateRequest extends Model
{
/**
* @description 接口名。
* @description Interface name.
*
* This parameter is required.
* @example CreateCluster
Expand All @@ -19,7 +19,7 @@ class DeleteApiTemplateRequest extends Model
public $apiName;

/**
* @description 区域ID。
* @description Region ID
*
* This parameter is required.
* @example cn-hangzhou
Expand All @@ -29,7 +29,7 @@ class DeleteApiTemplateRequest extends Model
public $regionId;

/**
* @description 资源组ID。
* @description Resource group ID.
*
* @example rg-acfmzabjyop****
*
Expand All @@ -38,7 +38,7 @@ class DeleteApiTemplateRequest extends Model
public $resourceGroupId;

/**
* @description 集群模板id。
* @description Cluster template ID.
*
* This parameter is required.
* @example at-****
Expand Down
4 changes: 3 additions & 1 deletion src/Models/DeleteApiTemplateResponseBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class DeleteApiTemplateResponseBody extends Model
{
/**
* @description 请求ID。
* @description Request ID.
*
* @example DD6B1B2A-5837-5237-ABE4-FF0C8944****
*
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class clusterCloneMeta extends Model
public $existCloneConfig;

/**
* @description The attributes of all ECS instances.
* @description The node attributes.
*
* @var NodeAttributes
*/
Expand Down Expand Up @@ -205,7 +205,7 @@ class clusterCloneMeta extends Model
public $subscriptionConfig;

/**
* @description The list of tags.
* @description The tags.
*
* @var Tag[]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class scalingPolicies extends Model
public $scalingPolicyId;

/**
* @description The type of the auto scaling policy.
*
* @var string
*/
public $scalingPolicyType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/Models/ListScriptsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class ListScriptsRequest extends Model
{
/**
* @description 集群ID。
* @description Cluster ID.
*
* This parameter is required.
* @example c-b933c5aac8fe****
Expand All @@ -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
*
Expand All @@ -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
*
Expand All @@ -37,7 +37,7 @@ class ListScriptsRequest extends Model
public $nextToken;

/**
* @description 区域ID。
* @description Region ID.
*
* This parameter is required.
* @example cn-hangzhou
Expand All @@ -47,7 +47,7 @@ class ListScriptsRequest extends Model
public $regionId;

/**
* @description 集群脚本类型。
* @description Type of cluster script. Possible values:
*
* This parameter is required.
* @example BOOTSTRAP
Expand Down
10 changes: 5 additions & 5 deletions src/Models/ListScriptsResponseBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class ListScriptsResponseBody extends Model
{
/**
* @description 本次请求所返回的最大记录条数。
* @description The maximum number of records returned in this request.
*
* @example 10
*
Expand All @@ -19,7 +19,7 @@ class ListScriptsResponseBody extends Model
public $maxResults;

/**
* @description 返回读取到的数据位置,空代表数据已经读取完毕。
* @description The position of the data read.
*
* @example dd6b1b2a-5837-5237-abe4-ff0c89568982
*
Expand All @@ -28,7 +28,7 @@ class ListScriptsResponseBody extends Model
public $nextToken;

/**
* @description 请求ID。
* @description Request ID.
*
* @example DD6B1B2A-5837-5237-ABE4-FF0C8944****
*
Expand All @@ -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
*
Expand Down
Loading

0 comments on commit 8b81f9e

Please sign in to comment.