Skip to content

Commit

Permalink
Update API CreateCluster: add param DeletionProtection.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdk-team committed Dec 2, 2024
1 parent b30eeec commit 7427c4d
Show file tree
Hide file tree
Showing 17 changed files with 419 additions and 68 deletions.
8 changes: 8 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2024-12-02 Version: 2.1.2
- Update API CreateCluster: add param DeletionProtection.
- Update API DecreaseNodes: add param BatchInterval.
- Update API DecreaseNodes: add param BatchSize.
- Update API GetClusterCloneMeta: update response param.
- Update API RunCluster: add param DeletionProtection.


2024-10-25 Version: 2.1.1
- Update API GetAutoScalingActivity: update response param.
- Update API ListAutoScalingActivities: add param ScalingPolicyType.
Expand Down
20 changes: 20 additions & 0 deletions src/Emr.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ public function createClusterWithOptions($request, $runtime)
if (!Utils::isUnset($request->clusterType)) {
$query['ClusterType'] = $request->clusterType;
}
if (!Utils::isUnset($request->deletionProtection)) {
$query['DeletionProtection'] = $request->deletionProtection;
}
if (!Utils::isUnset($request->deployMode)) {
$query['DeployMode'] = $request->deployMode;
}
Expand Down Expand Up @@ -503,6 +506,12 @@ public function decreaseNodesWithOptions($request, $runtime)
{
Utils::validateModel($request);
$query = [];
if (!Utils::isUnset($request->batchInterval)) {
$query['BatchInterval'] = $request->batchInterval;
}
if (!Utils::isUnset($request->batchSize)) {
$query['BatchSize'] = $request->batchSize;
}
if (!Utils::isUnset($request->clusterId)) {
$query['ClusterId'] = $request->clusterId;
}
Expand Down Expand Up @@ -4000,6 +4009,10 @@ 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.
* *
* @param RunClusterRequest $tmpReq RunClusterRequest
* @param RuntimeOptions $runtime runtime options for this request RuntimeOptions
*
Expand Down Expand Up @@ -4054,6 +4067,9 @@ public function runClusterWithOptions($tmpReq, $runtime)
if (!Utils::isUnset($request->clusterType)) {
$body['ClusterType'] = $request->clusterType;
}
if (!Utils::isUnset($request->deletionProtection)) {
$body['DeletionProtection'] = $request->deletionProtection;
}
if (!Utils::isUnset($request->deployMode)) {
$body['DeployMode'] = $request->deployMode;
}
Expand Down Expand Up @@ -4104,6 +4120,10 @@ 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.
* *
* @param RunClusterRequest $request RunClusterRequest
*
* @return RunClusterResponse RunClusterResponse
Expand Down
14 changes: 14 additions & 0 deletions src/Models/Cluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ class Cluster extends Model
*/
public $createTime;

/**
* @example false
*
* @var bool
*/
public $deletionProtection;

/**
* @description 部署模式。
*
Expand Down Expand Up @@ -179,6 +186,7 @@ class Cluster extends Model
'clusterState' => 'ClusterState',
'clusterType' => 'ClusterType',
'createTime' => 'CreateTime',
'deletionProtection' => 'DeletionProtection',
'deployMode' => 'DeployMode',
'description' => 'Description',
'emrDefaultRole' => 'EmrDefaultRole',
Expand Down Expand Up @@ -218,6 +226,9 @@ public function toMap()
if (null !== $this->createTime) {
$res['CreateTime'] = $this->createTime;
}
if (null !== $this->deletionProtection) {
$res['DeletionProtection'] = $this->deletionProtection;
}
if (null !== $this->deployMode) {
$res['DeployMode'] = $this->deployMode;
}
Expand Down Expand Up @@ -296,6 +307,9 @@ public static function fromMap($map = [])
if (isset($map['CreateTime'])) {
$model->createTime = $map['CreateTime'];
}
if (isset($map['DeletionProtection'])) {
$model->deletionProtection = $map['DeletionProtection'];
}
if (isset($map['DeployMode'])) {
$model->deployMode = $map['DeployMode'];
}
Expand Down
42 changes: 27 additions & 15 deletions src/Models/ClusterSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ class ClusterSummary extends Model
*/
public $createTime;

/**
* @var bool
*/
public $deletionProtection;

/**
* @var string
*/
Expand Down Expand Up @@ -133,21 +138,22 @@ class ClusterSummary extends Model
*/
public $tags;
protected $_name = [
'clusterId' => 'ClusterId',
'clusterName' => 'ClusterName',
'clusterState' => 'ClusterState',
'clusterType' => 'ClusterType',
'createTime' => 'CreateTime',
'description' => 'Description',
'emrDefaultRole' => 'EmrDefaultRole',
'endTime' => 'EndTime',
'expireTime' => 'ExpireTime',
'paymentType' => 'PaymentType',
'readyTime' => 'ReadyTime',
'releaseVersion' => 'ReleaseVersion',
'resourceGroupId' => 'ResourceGroupId',
'stateChangeReason' => 'StateChangeReason',
'tags' => 'Tags',
'clusterId' => 'ClusterId',
'clusterName' => 'ClusterName',
'clusterState' => 'ClusterState',
'clusterType' => 'ClusterType',
'createTime' => 'CreateTime',
'deletionProtection' => 'DeletionProtection',
'description' => 'Description',
'emrDefaultRole' => 'EmrDefaultRole',
'endTime' => 'EndTime',
'expireTime' => 'ExpireTime',
'paymentType' => 'PaymentType',
'readyTime' => 'ReadyTime',
'releaseVersion' => 'ReleaseVersion',
'resourceGroupId' => 'ResourceGroupId',
'stateChangeReason' => 'StateChangeReason',
'tags' => 'Tags',
];

public function validate()
Expand All @@ -172,6 +178,9 @@ public function toMap()
if (null !== $this->createTime) {
$res['CreateTime'] = $this->createTime;
}
if (null !== $this->deletionProtection) {
$res['DeletionProtection'] = $this->deletionProtection;
}
if (null !== $this->description) {
$res['Description'] = $this->description;
}
Expand Down Expand Up @@ -235,6 +244,9 @@ public static function fromMap($map = [])
if (isset($map['CreateTime'])) {
$model->createTime = $map['CreateTime'];
}
if (isset($map['DeletionProtection'])) {
$model->deletionProtection = $map['DeletionProtection'];
}
if (isset($map['Description'])) {
$model->description = $map['Description'];
}
Expand Down
12 changes: 12 additions & 0 deletions src/Models/CreateClusterRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ class CreateClusterRequest extends Model
*/
public $clusterType;

/**
* @var bool
*/
public $deletionProtection;

/**
* @description The deployment mode of master nodes in the cluster. Valid values:
*
Expand Down Expand Up @@ -179,6 +184,7 @@ class CreateClusterRequest extends Model
'clientToken' => 'ClientToken',
'clusterName' => 'ClusterName',
'clusterType' => 'ClusterType',
'deletionProtection' => 'DeletionProtection',
'deployMode' => 'DeployMode',
'description' => 'Description',
'nodeAttributes' => 'NodeAttributes',
Expand Down Expand Up @@ -235,6 +241,9 @@ public function toMap()
if (null !== $this->clusterType) {
$res['ClusterType'] = $this->clusterType;
}
if (null !== $this->deletionProtection) {
$res['DeletionProtection'] = $this->deletionProtection;
}
if (null !== $this->deployMode) {
$res['DeployMode'] = $this->deployMode;
}
Expand Down Expand Up @@ -328,6 +337,9 @@ public static function fromMap($map = [])
if (isset($map['ClusterType'])) {
$model->clusterType = $map['ClusterType'];
}
if (isset($map['DeletionProtection'])) {
$model->deletionProtection = $map['DeletionProtection'];
}
if (isset($map['DeployMode'])) {
$model->deployMode = $map['DeployMode'];
}
Expand Down
24 changes: 24 additions & 0 deletions src/Models/DecreaseNodesRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@

class DecreaseNodesRequest extends Model
{
/**
* @var int
*/
public $batchInterval;

/**
* @var int
*/
public $batchSize;

/**
* @description The cluster ID.
*
Expand Down Expand Up @@ -56,6 +66,8 @@ class DecreaseNodesRequest extends Model
*/
public $regionId;
protected $_name = [
'batchInterval' => 'BatchInterval',
'batchSize' => 'BatchSize',
'clusterId' => 'ClusterId',
'decreaseNodeCount' => 'DecreaseNodeCount',
'nodeGroupId' => 'NodeGroupId',
Expand All @@ -70,6 +82,12 @@ public function validate()
public function toMap()
{
$res = [];
if (null !== $this->batchInterval) {
$res['BatchInterval'] = $this->batchInterval;
}
if (null !== $this->batchSize) {
$res['BatchSize'] = $this->batchSize;
}
if (null !== $this->clusterId) {
$res['ClusterId'] = $this->clusterId;
}
Expand Down Expand Up @@ -97,6 +115,12 @@ public function toMap()
public static function fromMap($map = [])
{
$model = new self();
if (isset($map['BatchInterval'])) {
$model->batchInterval = $map['BatchInterval'];
}
if (isset($map['BatchSize'])) {
$model->batchSize = $map['BatchSize'];
}
if (isset($map['ClusterId'])) {
$model->clusterId = $map['ClusterId'];
}
Expand Down
12 changes: 12 additions & 0 deletions src/Models/GetClusterCloneMetaResponseBody/clusterCloneMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ class clusterCloneMeta extends Model
*/
public $clusterType;

/**
* @var bool
*/
public $deletionProtection;

/**
* @description The deployment mode of master nodes in the cluster. Valid values:
*
Expand Down Expand Up @@ -213,6 +218,7 @@ class clusterCloneMeta extends Model
'clusterName' => 'ClusterName',
'clusterState' => 'ClusterState',
'clusterType' => 'ClusterType',
'deletionProtection' => 'DeletionProtection',
'deployMode' => 'DeployMode',
'emrDefaultRole' => 'EmrDefaultRole',
'existCloneConfig' => 'ExistCloneConfig',
Expand Down Expand Up @@ -274,6 +280,9 @@ public function toMap()
if (null !== $this->clusterType) {
$res['ClusterType'] = $this->clusterType;
}
if (null !== $this->deletionProtection) {
$res['DeletionProtection'] = $this->deletionProtection;
}
if (null !== $this->deployMode) {
$res['DeployMode'] = $this->deployMode;
}
Expand Down Expand Up @@ -382,6 +391,9 @@ public static function fromMap($map = [])
if (isset($map['ClusterType'])) {
$model->clusterType = $map['ClusterType'];
}
if (isset($map['DeletionProtection'])) {
$model->deletionProtection = $map['DeletionProtection'];
}
if (isset($map['DeployMode'])) {
$model->deployMode = $map['DeployMode'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,24 @@ class scalingPolicies extends Model
*/
public $scalingPolicyId;

/**
* @var string
*/
public $scalingPolicyType;

/**
* @description The list of auto scaling rules.
*
* @var scalingRules[]
*/
public $scalingRules;
protected $_name = [
'clusterId' => 'ClusterId',
'constraints' => 'Constraints',
'nodeGroupId' => 'NodeGroupId',
'scalingPolicyId' => 'ScalingPolicyId',
'scalingRules' => 'ScalingRules',
'clusterId' => 'ClusterId',
'constraints' => 'Constraints',
'nodeGroupId' => 'NodeGroupId',
'scalingPolicyId' => 'ScalingPolicyId',
'scalingPolicyType' => 'ScalingPolicyType',
'scalingRules' => 'ScalingRules',
];

public function validate()
Expand All @@ -77,6 +83,9 @@ public function toMap()
if (null !== $this->scalingPolicyId) {
$res['ScalingPolicyId'] = $this->scalingPolicyId;
}
if (null !== $this->scalingPolicyType) {
$res['ScalingPolicyType'] = $this->scalingPolicyType;
}
if (null !== $this->scalingRules) {
$res['ScalingRules'] = [];
if (null !== $this->scalingRules && \is_array($this->scalingRules)) {
Expand Down Expand Up @@ -110,6 +119,9 @@ public static function fromMap($map = [])
if (isset($map['ScalingPolicyId'])) {
$model->scalingPolicyId = $map['ScalingPolicyId'];
}
if (isset($map['ScalingPolicyType'])) {
$model->scalingPolicyType = $map['ScalingPolicyType'];
}
if (isset($map['ScalingRules'])) {
if (!empty($map['ScalingRules'])) {
$model->scalingRules = [];
Expand Down
Loading

0 comments on commit 7427c4d

Please sign in to comment.