diff --git a/Dataproc/metadata/V1/Clusters.php b/Dataproc/metadata/V1/Clusters.php index 86349e1b7f52..62ee42198cdd 100644 Binary files a/Dataproc/metadata/V1/Clusters.php and b/Dataproc/metadata/V1/Clusters.php differ diff --git a/Dataproc/metadata/V1/Jobs.php b/Dataproc/metadata/V1/Jobs.php index 1348c2b462a1..ea9bc69247c6 100644 Binary files a/Dataproc/metadata/V1/Jobs.php and b/Dataproc/metadata/V1/Jobs.php differ diff --git a/Dataproc/metadata/V1/NodeGroups.php b/Dataproc/metadata/V1/NodeGroups.php new file mode 100644 index 000000000000..f322c217cbc9 --- /dev/null +++ b/Dataproc/metadata/V1/NodeGroups.php @@ -0,0 +1,58 @@ +internalAddGeneratedFile( + ' +Í +*google/cloud/dataproc/v1/node_groups.protogoogle.cloud.dataproc.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto\'google/cloud/dataproc/v1/clusters.proto#google/longrunning/operations.protogoogle/protobuf/duration.proto"Æ +CreateNodeGroupRequest9 +parent ( B)àAúA#!dataproc.googleapis.com/NodeGroup< + +node_group ( 2#.google.cloud.dataproc.v1.NodeGroupBàA + node_group_id ( BàA + +request_id ( BàA"ž +ResizeNodeGroupRequest +name ( BàA +size (BàA + +request_id ( BàAE +graceful_decommission_timeout ( 2.google.protobuf.DurationBàA"N +GetNodeGroupRequest7 +name ( B)àAúA# +!dataproc.googleapis.com/NodeGroup2§ +NodeGroupController• +CreateNodeGroup0.google.cloud.dataproc.v1.CreateNodeGroupRequest.google.longrunning.Operation"°‚Óä“E"7/v1/{parent=projects/*/regions/*/clusters/*}/nodeGroups: +node_groupÚAparent,node_group,node_group_idÊA@ + NodeGroup3google.cloud.dataproc.v1.NodeGroupOperationMetadataý +ResizeNodeGroup0.google.cloud.dataproc.v1.ResizeNodeGroupRequest.google.longrunning.Operation"˜‚Óä“C">/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}:resize:*ÚA name,sizeÊA@ + NodeGroup3google.cloud.dataproc.v1.NodeGroupOperationMetadataª + GetNodeGroup-.google.cloud.dataproc.v1.GetNodeGroupRequest#.google.cloud.dataproc.v1.NodeGroup"F‚Óä“97/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}ÚAnameKÊAdataproc.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBÕ +com.google.cloud.dataproc.v1BNodeGroupsProtoPZ@google.golang.org/genproto/googleapis/cloud/dataproc/v1;dataprocêA_ +%dataproc.googleapis.com/ClusterRegion6projects/{project}/regions/{region}/clusters/{cluster}bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/Dataproc/metadata/V1/Operations.php b/Dataproc/metadata/V1/Operations.php index 83a8f2398eb3..a38cf56a02fd 100644 Binary files a/Dataproc/metadata/V1/Operations.php and b/Dataproc/metadata/V1/Operations.php differ diff --git a/Dataproc/samples/V1/ClusterControllerClient/create_cluster.php b/Dataproc/samples/V1/ClusterControllerClient/create_cluster.php index ce6b675ea88e..ca6d1ff3e6d8 100644 --- a/Dataproc/samples/V1/ClusterControllerClient/create_cluster.php +++ b/Dataproc/samples/V1/ClusterControllerClient/create_cluster.php @@ -38,8 +38,10 @@ * belongs to. * @param string $region The Dataproc region in which to handle the request. * @param string $clusterProjectId The Google Cloud Platform project ID that the cluster belongs to. - * @param string $clusterClusterName The cluster name. Cluster names within a project must be - * unique. Names of deleted clusters can be reused. + * @param string $clusterClusterName The cluster name, which must be unique within a project. + * The name must start with a lowercase letter, and can contain + * up to 51 lowercase letters, numbers, and hyphens. It cannot end + * with a hyphen. The name of a deleted cluster can be reused. */ function create_cluster_sample( string $projectId, diff --git a/Dataproc/samples/V1/ClusterControllerClient/update_cluster.php b/Dataproc/samples/V1/ClusterControllerClient/update_cluster.php index e563369a6cb1..f1df6b7d2ff7 100644 --- a/Dataproc/samples/V1/ClusterControllerClient/update_cluster.php +++ b/Dataproc/samples/V1/ClusterControllerClient/update_cluster.php @@ -34,7 +34,8 @@ * Updates a cluster in a project. The returned * [Operation.metadata][google.longrunning.Operation.metadata] will be * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - * The cluster must be in a [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error + * The cluster must be in a + * [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error * is returned. * * @param string $projectId The ID of the Google Cloud Platform project the @@ -42,8 +43,10 @@ * @param string $region The Dataproc region in which to handle the request. * @param string $clusterName The cluster name. * @param string $clusterProjectId The Google Cloud Platform project ID that the cluster belongs to. - * @param string $clusterClusterName The cluster name. Cluster names within a project must be - * unique. Names of deleted clusters can be reused. + * @param string $clusterClusterName The cluster name, which must be unique within a project. + * The name must start with a lowercase letter, and can contain + * up to 51 lowercase letters, numbers, and hyphens. It cannot end + * with a hyphen. The name of a deleted cluster can be reused. */ function update_cluster_sample( string $projectId, diff --git a/Dataproc/samples/V1/NodeGroupControllerClient/create_node_group.php b/Dataproc/samples/V1/NodeGroupControllerClient/create_node_group.php new file mode 100644 index 000000000000..a8f6726d3c68 --- /dev/null +++ b/Dataproc/samples/V1/NodeGroupControllerClient/create_node_group.php @@ -0,0 +1,93 @@ +setRoles($nodeGroupRoles); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $nodeGroupControllerClient->createNodeGroup($formattedParent, $nodeGroup); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var NodeGroup $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = NodeGroupControllerClient::clusterRegionName( + '[PROJECT]', + '[REGION]', + '[CLUSTER]' + ); + $nodeGroupRolesElement = Role::ROLE_UNSPECIFIED; + + create_node_group_sample($formattedParent, $nodeGroupRolesElement); +} +// [END dataproc_v1_generated_NodeGroupController_CreateNodeGroup_sync] diff --git a/Dataproc/samples/V1/NodeGroupControllerClient/get_node_group.php b/Dataproc/samples/V1/NodeGroupControllerClient/get_node_group.php new file mode 100644 index 000000000000..b7c881040a71 --- /dev/null +++ b/Dataproc/samples/V1/NodeGroupControllerClient/get_node_group.php @@ -0,0 +1,74 @@ +getNodeGroup($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NodeGroupControllerClient::nodeGroupName( + '[PROJECT]', + '[REGION]', + '[CLUSTER]', + '[NODE_GROUP]' + ); + + get_node_group_sample($formattedName); +} +// [END dataproc_v1_generated_NodeGroupController_GetNodeGroup_sync] diff --git a/Dataproc/samples/V1/NodeGroupControllerClient/resize_node_group.php b/Dataproc/samples/V1/NodeGroupControllerClient/resize_node_group.php new file mode 100644 index 000000000000..55b65d19d16a --- /dev/null +++ b/Dataproc/samples/V1/NodeGroupControllerClient/resize_node_group.php @@ -0,0 +1,85 @@ +resizeNodeGroup($name, $size); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var NodeGroup $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $size = 0; + + resize_node_group_sample($name, $size); +} +// [END dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_sync] diff --git a/Dataproc/src/V1/AuxiliaryNodeGroup.php b/Dataproc/src/V1/AuxiliaryNodeGroup.php new file mode 100644 index 000000000000..a64f09df28d9 --- /dev/null +++ b/Dataproc/src/V1/AuxiliaryNodeGroup.php @@ -0,0 +1,123 @@ +google.cloud.dataproc.v1.AuxiliaryNodeGroup + */ +class AuxiliaryNodeGroup extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Node group configuration. + * + * Generated from protobuf field .google.cloud.dataproc.v1.NodeGroup node_group = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $node_group = null; + /** + * Optional. A node group ID. Generated if not specified. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). Cannot begin or end with underscore + * or hyphen. Must consist of from 3 to 33 characters. + * + * Generated from protobuf field string node_group_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $node_group_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dataproc\V1\NodeGroup $node_group + * Required. Node group configuration. + * @type string $node_group_id + * Optional. A node group ID. Generated if not specified. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). Cannot begin or end with underscore + * or hyphen. Must consist of from 3 to 33 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dataproc\V1\Clusters::initOnce(); + parent::__construct($data); + } + + /** + * Required. Node group configuration. + * + * Generated from protobuf field .google.cloud.dataproc.v1.NodeGroup node_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dataproc\V1\NodeGroup|null + */ + public function getNodeGroup() + { + return $this->node_group; + } + + public function hasNodeGroup() + { + return isset($this->node_group); + } + + public function clearNodeGroup() + { + unset($this->node_group); + } + + /** + * Required. Node group configuration. + * + * Generated from protobuf field .google.cloud.dataproc.v1.NodeGroup node_group = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dataproc\V1\NodeGroup $var + * @return $this + */ + public function setNodeGroup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\NodeGroup::class); + $this->node_group = $var; + + return $this; + } + + /** + * Optional. A node group ID. Generated if not specified. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). Cannot begin or end with underscore + * or hyphen. Must consist of from 3 to 33 characters. + * + * Generated from protobuf field string node_group_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNodeGroupId() + { + return $this->node_group_id; + } + + /** + * Optional. A node group ID. Generated if not specified. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). Cannot begin or end with underscore + * or hyphen. Must consist of from 3 to 33 characters. + * + * Generated from protobuf field string node_group_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNodeGroupId($var) + { + GPBUtil::checkString($var, True); + $this->node_group_id = $var; + + return $this; + } + +} + diff --git a/Dataproc/src/V1/Cluster.php b/Dataproc/src/V1/Cluster.php index 328136f4b152..c528f6a49607 100644 --- a/Dataproc/src/V1/Cluster.php +++ b/Dataproc/src/V1/Cluster.php @@ -23,8 +23,10 @@ class Cluster extends \Google\Protobuf\Internal\Message */ private $project_id = ''; /** - * Required. The cluster name. Cluster names within a project must be - * unique. Names of deleted clusters can be reused. + * Required. The cluster name, which must be unique within a project. + * The name must start with a lowercase letter, and can contain + * up to 51 lowercase letters, numbers, and hyphens. It cannot end + * with a hyphen. The name of a deleted cluster can be reused. * * Generated from protobuf field string cluster_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ @@ -38,13 +40,15 @@ class Cluster extends \Google\Protobuf\Internal\Message */ private $config = null; /** - * Optional. The virtual cluster config, used when creating a Dataproc cluster that - * does not directly control the underlying compute resources, for example, - * when creating a [Dataproc-on-GKE - * cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster). - * Note that Dataproc may set default values, and values may change when - * clusters are updated. Exactly one of config or virtualClusterConfig must be - * specified. + * Optional. The virtual cluster config is used when creating a Dataproc + * cluster that does not directly control the underlying compute resources, + * for example, when creating a [Dataproc-on-GKE + * cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke). + * Dataproc may set default values, and values may change when + * clusters are updated. Exactly one of + * [config][google.cloud.dataproc.v1.Cluster.config] or + * [virtual_cluster_config][google.cloud.dataproc.v1.Cluster.virtual_cluster_config] + * must be specified. * * Generated from protobuf field .google.cloud.dataproc.v1.VirtualClusterConfig virtual_cluster_config = 10 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -98,20 +102,24 @@ class Cluster extends \Google\Protobuf\Internal\Message * @type string $project_id * Required. The Google Cloud Platform project ID that the cluster belongs to. * @type string $cluster_name - * Required. The cluster name. Cluster names within a project must be - * unique. Names of deleted clusters can be reused. + * Required. The cluster name, which must be unique within a project. + * The name must start with a lowercase letter, and can contain + * up to 51 lowercase letters, numbers, and hyphens. It cannot end + * with a hyphen. The name of a deleted cluster can be reused. * @type \Google\Cloud\Dataproc\V1\ClusterConfig $config * Optional. The cluster config for a cluster of Compute Engine Instances. * Note that Dataproc may set default values, and values may change * when clusters are updated. * @type \Google\Cloud\Dataproc\V1\VirtualClusterConfig $virtual_cluster_config - * Optional. The virtual cluster config, used when creating a Dataproc cluster that - * does not directly control the underlying compute resources, for example, - * when creating a [Dataproc-on-GKE - * cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster). - * Note that Dataproc may set default values, and values may change when - * clusters are updated. Exactly one of config or virtualClusterConfig must be - * specified. + * Optional. The virtual cluster config is used when creating a Dataproc + * cluster that does not directly control the underlying compute resources, + * for example, when creating a [Dataproc-on-GKE + * cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke). + * Dataproc may set default values, and values may change when + * clusters are updated. Exactly one of + * [config][google.cloud.dataproc.v1.Cluster.config] or + * [virtual_cluster_config][google.cloud.dataproc.v1.Cluster.virtual_cluster_config] + * must be specified. * @type array|\Google\Protobuf\Internal\MapField $labels * Optional. The labels to associate with this cluster. * Label **keys** must contain 1 to 63 characters, and must conform to @@ -165,8 +173,10 @@ public function setProjectId($var) } /** - * Required. The cluster name. Cluster names within a project must be - * unique. Names of deleted clusters can be reused. + * Required. The cluster name, which must be unique within a project. + * The name must start with a lowercase letter, and can contain + * up to 51 lowercase letters, numbers, and hyphens. It cannot end + * with a hyphen. The name of a deleted cluster can be reused. * * Generated from protobuf field string cluster_name = 2 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -177,8 +187,10 @@ public function getClusterName() } /** - * Required. The cluster name. Cluster names within a project must be - * unique. Names of deleted clusters can be reused. + * Required. The cluster name, which must be unique within a project. + * The name must start with a lowercase letter, and can contain + * up to 51 lowercase letters, numbers, and hyphens. It cannot end + * with a hyphen. The name of a deleted cluster can be reused. * * Generated from protobuf field string cluster_name = 2 [(.google.api.field_behavior) = REQUIRED]; * @param string $var @@ -233,13 +245,15 @@ public function setConfig($var) } /** - * Optional. The virtual cluster config, used when creating a Dataproc cluster that - * does not directly control the underlying compute resources, for example, - * when creating a [Dataproc-on-GKE - * cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster). - * Note that Dataproc may set default values, and values may change when - * clusters are updated. Exactly one of config or virtualClusterConfig must be - * specified. + * Optional. The virtual cluster config is used when creating a Dataproc + * cluster that does not directly control the underlying compute resources, + * for example, when creating a [Dataproc-on-GKE + * cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke). + * Dataproc may set default values, and values may change when + * clusters are updated. Exactly one of + * [config][google.cloud.dataproc.v1.Cluster.config] or + * [virtual_cluster_config][google.cloud.dataproc.v1.Cluster.virtual_cluster_config] + * must be specified. * * Generated from protobuf field .google.cloud.dataproc.v1.VirtualClusterConfig virtual_cluster_config = 10 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\Dataproc\V1\VirtualClusterConfig|null @@ -260,13 +274,15 @@ public function clearVirtualClusterConfig() } /** - * Optional. The virtual cluster config, used when creating a Dataproc cluster that - * does not directly control the underlying compute resources, for example, - * when creating a [Dataproc-on-GKE - * cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster). - * Note that Dataproc may set default values, and values may change when - * clusters are updated. Exactly one of config or virtualClusterConfig must be - * specified. + * Optional. The virtual cluster config is used when creating a Dataproc + * cluster that does not directly control the underlying compute resources, + * for example, when creating a [Dataproc-on-GKE + * cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke). + * Dataproc may set default values, and values may change when + * clusters are updated. Exactly one of + * [config][google.cloud.dataproc.v1.Cluster.config] or + * [virtual_cluster_config][google.cloud.dataproc.v1.Cluster.virtual_cluster_config] + * must be specified. * * Generated from protobuf field .google.cloud.dataproc.v1.VirtualClusterConfig virtual_cluster_config = 10 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\Dataproc\V1\VirtualClusterConfig $var diff --git a/Dataproc/src/V1/ClusterConfig.php b/Dataproc/src/V1/ClusterConfig.php index 0b41d82fe689..014a125ffcde 100644 --- a/Dataproc/src/V1/ClusterConfig.php +++ b/Dataproc/src/V1/ClusterConfig.php @@ -32,15 +32,13 @@ class ClusterConfig extends \Google\Protobuf\Internal\Message */ private $config_bucket = ''; /** - * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data, - * such as Spark and MapReduce history files. - * If you do not specify a temp bucket, - * Dataproc will determine a Cloud Storage location (US, - * ASIA, or EU) for your cluster's temp bucket according to the - * Compute Engine zone where your cluster is deployed, and then create - * and manage this project-level, per-location bucket. The default bucket has - * a TTL of 90 days, but you can use any TTL (or none) if you specify a - * bucket (see + * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs + * data, such as Spark and MapReduce history files. If you do not specify a + * temp bucket, Dataproc will determine a Cloud Storage location (US, ASIA, or + * EU) for your cluster's temp bucket according to the Compute Engine zone + * where your cluster is deployed, and then create and manage this + * project-level, per-location bucket. The default bucket has a TTL of 90 + * days, but you can use any TTL (or none) if you specify a bucket (see * [Dataproc staging and temp * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to @@ -143,6 +141,12 @@ class ClusterConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.dataproc.v1.DataprocMetricConfig dataproc_metric_config = 23 [(.google.api.field_behavior) = OPTIONAL]; */ private $dataproc_metric_config = null; + /** + * Optional. The node group settings. + * + * Generated from protobuf field repeated .google.cloud.dataproc.v1.AuxiliaryNodeGroup auxiliary_node_groups = 25 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $auxiliary_node_groups; /** * Constructor. @@ -163,15 +167,13 @@ class ClusterConfig extends \Google\Protobuf\Internal\Message * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to * a Cloud Storage bucket.** * @type string $temp_bucket - * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data, - * such as Spark and MapReduce history files. - * If you do not specify a temp bucket, - * Dataproc will determine a Cloud Storage location (US, - * ASIA, or EU) for your cluster's temp bucket according to the - * Compute Engine zone where your cluster is deployed, and then create - * and manage this project-level, per-location bucket. The default bucket has - * a TTL of 90 days, but you can use any TTL (or none) if you specify a - * bucket (see + * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs + * data, such as Spark and MapReduce history files. If you do not specify a + * temp bucket, Dataproc will determine a Cloud Storage location (US, ASIA, or + * EU) for your cluster's temp bucket according to the Compute Engine zone + * where your cluster is deployed, and then create and manage this + * project-level, per-location bucket. The default bucket has a TTL of 90 + * days, but you can use any TTL (or none) if you specify a bucket (see * [Dataproc staging and temp * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to @@ -218,6 +220,8 @@ class ClusterConfig extends \Google\Protobuf\Internal\Message * Optional. Metastore configuration. * @type \Google\Cloud\Dataproc\V1\DataprocMetricConfig $dataproc_metric_config * Optional. The config for Dataproc metrics. + * @type array<\Google\Cloud\Dataproc\V1\AuxiliaryNodeGroup>|\Google\Protobuf\Internal\RepeatedField $auxiliary_node_groups + * Optional. The node group settings. * } */ public function __construct($data = NULL) { @@ -272,15 +276,13 @@ public function setConfigBucket($var) } /** - * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data, - * such as Spark and MapReduce history files. - * If you do not specify a temp bucket, - * Dataproc will determine a Cloud Storage location (US, - * ASIA, or EU) for your cluster's temp bucket according to the - * Compute Engine zone where your cluster is deployed, and then create - * and manage this project-level, per-location bucket. The default bucket has - * a TTL of 90 days, but you can use any TTL (or none) if you specify a - * bucket (see + * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs + * data, such as Spark and MapReduce history files. If you do not specify a + * temp bucket, Dataproc will determine a Cloud Storage location (US, ASIA, or + * EU) for your cluster's temp bucket according to the Compute Engine zone + * where your cluster is deployed, and then create and manage this + * project-level, per-location bucket. The default bucket has a TTL of 90 + * days, but you can use any TTL (or none) if you specify a bucket (see * [Dataproc staging and temp * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to @@ -295,15 +297,13 @@ public function getTempBucket() } /** - * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data, - * such as Spark and MapReduce history files. - * If you do not specify a temp bucket, - * Dataproc will determine a Cloud Storage location (US, - * ASIA, or EU) for your cluster's temp bucket according to the - * Compute Engine zone where your cluster is deployed, and then create - * and manage this project-level, per-location bucket. The default bucket has - * a TTL of 90 days, but you can use any TTL (or none) if you specify a - * bucket (see + * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs + * data, such as Spark and MapReduce history files. If you do not specify a + * temp bucket, Dataproc will determine a Cloud Storage location (US, ASIA, or + * EU) for your cluster's temp bucket according to the Compute Engine zone + * where your cluster is deployed, and then create and manage this + * project-level, per-location bucket. The default bucket has a TTL of 90 + * days, but you can use any TTL (or none) if you specify a bucket (see * [Dataproc staging and temp * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to @@ -811,5 +811,31 @@ public function setDataprocMetricConfig($var) return $this; } + /** + * Optional. The node group settings. + * + * Generated from protobuf field repeated .google.cloud.dataproc.v1.AuxiliaryNodeGroup auxiliary_node_groups = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAuxiliaryNodeGroups() + { + return $this->auxiliary_node_groups; + } + + /** + * Optional. The node group settings. + * + * Generated from protobuf field repeated .google.cloud.dataproc.v1.AuxiliaryNodeGroup auxiliary_node_groups = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dataproc\V1\AuxiliaryNodeGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAuxiliaryNodeGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dataproc\V1\AuxiliaryNodeGroup::class); + $this->auxiliary_node_groups = $arr; + + return $this; + } + } diff --git a/Dataproc/src/V1/ClusterControllerGrpcClient.php b/Dataproc/src/V1/ClusterControllerGrpcClient.php index 75f2d0f28c7a..f911d98d0a71 100644 --- a/Dataproc/src/V1/ClusterControllerGrpcClient.php +++ b/Dataproc/src/V1/ClusterControllerGrpcClient.php @@ -54,7 +54,8 @@ public function CreateCluster(\Google\Cloud\Dataproc\V1\CreateClusterRequest $ar * Updates a cluster in a project. The returned * [Operation.metadata][google.longrunning.Operation.metadata] will be * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - * The cluster must be in a [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error + * The cluster must be in a + * [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error * is returned. * @param \Google\Cloud\Dataproc\V1\UpdateClusterRequest $argument input argument * @param array $metadata metadata diff --git a/Dataproc/src/V1/ConfidentialInstanceConfig.php b/Dataproc/src/V1/ConfidentialInstanceConfig.php index 4143a2e7368e..0f442241ddfa 100644 --- a/Dataproc/src/V1/ConfidentialInstanceConfig.php +++ b/Dataproc/src/V1/ConfidentialInstanceConfig.php @@ -17,7 +17,8 @@ class ConfidentialInstanceConfig extends \Google\Protobuf\Internal\Message { /** - * Optional. Defines whether the instance should have confidential compute enabled. + * Optional. Defines whether the instance should have confidential compute + * enabled. * * Generated from protobuf field bool enable_confidential_compute = 1 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -30,7 +31,8 @@ class ConfidentialInstanceConfig extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type bool $enable_confidential_compute - * Optional. Defines whether the instance should have confidential compute enabled. + * Optional. Defines whether the instance should have confidential compute + * enabled. * } */ public function __construct($data = NULL) { @@ -39,7 +41,8 @@ public function __construct($data = NULL) { } /** - * Optional. Defines whether the instance should have confidential compute enabled. + * Optional. Defines whether the instance should have confidential compute + * enabled. * * Generated from protobuf field bool enable_confidential_compute = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -50,7 +53,8 @@ public function getEnableConfidentialCompute() } /** - * Optional. Defines whether the instance should have confidential compute enabled. + * Optional. Defines whether the instance should have confidential compute + * enabled. * * Generated from protobuf field bool enable_confidential_compute = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/Dataproc/src/V1/CreateClusterRequest.php b/Dataproc/src/V1/CreateClusterRequest.php index 03bc6c9a6f9b..7278efc446aa 100644 --- a/Dataproc/src/V1/CreateClusterRequest.php +++ b/Dataproc/src/V1/CreateClusterRequest.php @@ -35,11 +35,12 @@ class CreateClusterRequest extends \Google\Protobuf\Internal\Message */ private $cluster = null; /** - * Optional. A unique ID used to identify the request. If the server receives two + * Optional. A unique ID used to identify the request. If the server receives + * two * [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the backend - * is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -69,11 +70,12 @@ class CreateClusterRequest extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Dataproc\V1\Cluster $cluster * Required. The cluster to create. * @type string $request_id - * Optional. A unique ID used to identify the request. If the server receives two + * Optional. A unique ID used to identify the request. If the server receives + * two * [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the backend - * is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -178,11 +180,12 @@ public function setCluster($var) } /** - * Optional. A unique ID used to identify the request. If the server receives two + * Optional. A unique ID used to identify the request. If the server receives + * two * [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the backend - * is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -197,11 +200,12 @@ public function getRequestId() } /** - * Optional. A unique ID used to identify the request. If the server receives two + * Optional. A unique ID used to identify the request. If the server receives + * two * [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the backend - * is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), diff --git a/Dataproc/src/V1/CreateNodeGroupRequest.php b/Dataproc/src/V1/CreateNodeGroupRequest.php new file mode 100644 index 000000000000..0387479c75c7 --- /dev/null +++ b/Dataproc/src/V1/CreateNodeGroupRequest.php @@ -0,0 +1,231 @@ +google.cloud.dataproc.v1.CreateNodeGroupRequest + */ +class CreateNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource where this node group will be created. + * Format: `projects/{project}/regions/{region}/clusters/{cluster}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. The node group to create. + * + * Generated from protobuf field .google.cloud.dataproc.v1.NodeGroup node_group = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $node_group = null; + /** + * Optional. An optional node group ID. Generated if not specified. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). Cannot begin or end with underscore + * or hyphen. Must consist of from 3 to 33 characters. + * + * Generated from protobuf field string node_group_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $node_group_id = ''; + /** + * Optional. A unique ID used to identify the request. If the server receives + * two + * [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource where this node group will be created. + * Format: `projects/{project}/regions/{region}/clusters/{cluster}` + * @type \Google\Cloud\Dataproc\V1\NodeGroup $node_group + * Required. The node group to create. + * @type string $node_group_id + * Optional. An optional node group ID. Generated if not specified. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). Cannot begin or end with underscore + * or hyphen. Must consist of from 3 to 33 characters. + * @type string $request_id + * Optional. A unique ID used to identify the request. If the server receives + * two + * [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dataproc\V1\NodeGroups::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource where this node group will be created. + * Format: `projects/{project}/regions/{region}/clusters/{cluster}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource where this node group will be created. + * Format: `projects/{project}/regions/{region}/clusters/{cluster}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The node group to create. + * + * Generated from protobuf field .google.cloud.dataproc.v1.NodeGroup node_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dataproc\V1\NodeGroup|null + */ + public function getNodeGroup() + { + return $this->node_group; + } + + public function hasNodeGroup() + { + return isset($this->node_group); + } + + public function clearNodeGroup() + { + unset($this->node_group); + } + + /** + * Required. The node group to create. + * + * Generated from protobuf field .google.cloud.dataproc.v1.NodeGroup node_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dataproc\V1\NodeGroup $var + * @return $this + */ + public function setNodeGroup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\NodeGroup::class); + $this->node_group = $var; + + return $this; + } + + /** + * Optional. An optional node group ID. Generated if not specified. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). Cannot begin or end with underscore + * or hyphen. Must consist of from 3 to 33 characters. + * + * Generated from protobuf field string node_group_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNodeGroupId() + { + return $this->node_group_id; + } + + /** + * Optional. An optional node group ID. Generated if not specified. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). Cannot begin or end with underscore + * or hyphen. Must consist of from 3 to 33 characters. + * + * Generated from protobuf field string node_group_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNodeGroupId($var) + { + GPBUtil::checkString($var, True); + $this->node_group_id = $var; + + return $this; + } + + /** + * Optional. A unique ID used to identify the request. If the server receives + * two + * [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A unique ID used to identify the request. If the server receives + * two + * [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/Dataproc/src/V1/DeleteClusterRequest.php b/Dataproc/src/V1/DeleteClusterRequest.php index 47e552acd07c..071d8ad7fdbb 100644 --- a/Dataproc/src/V1/DeleteClusterRequest.php +++ b/Dataproc/src/V1/DeleteClusterRequest.php @@ -46,8 +46,8 @@ class DeleteClusterRequest extends \Google\Protobuf\Internal\Message * receives two * [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -78,8 +78,8 @@ class DeleteClusterRequest extends \Google\Protobuf\Internal\Message * receives two * [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -204,8 +204,8 @@ public function setClusterUuid($var) * receives two * [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -224,8 +224,8 @@ public function getRequestId() * receives two * [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), diff --git a/Dataproc/src/V1/DiskConfig.php b/Dataproc/src/V1/DiskConfig.php index b3e2333ee340..f731e3be9304 100644 --- a/Dataproc/src/V1/DiskConfig.php +++ b/Dataproc/src/V1/DiskConfig.php @@ -32,7 +32,7 @@ class DiskConfig extends \Google\Protobuf\Internal\Message */ private $boot_disk_size_gb = 0; /** - * Optional. Number of attached SSDs, from 0 to 4 (default is 0). + * Optional. Number of attached SSDs, from 0 to 8 (default is 0). * If SSDs are not attached, the boot disk is used to store runtime logs and * [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. * If one or more SSDs are attached, this runtime bulk @@ -68,7 +68,7 @@ class DiskConfig extends \Google\Protobuf\Internal\Message * @type int $boot_disk_size_gb * Optional. Size in GB of the boot disk (default is 500GB). * @type int $num_local_ssds - * Optional. Number of attached SSDs, from 0 to 4 (default is 0). + * Optional. Number of attached SSDs, from 0 to 8 (default is 0). * If SSDs are not attached, the boot disk is used to store runtime logs and * [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. * If one or more SSDs are attached, this runtime bulk @@ -148,7 +148,7 @@ public function setBootDiskSizeGb($var) } /** - * Optional. Number of attached SSDs, from 0 to 4 (default is 0). + * Optional. Number of attached SSDs, from 0 to 8 (default is 0). * If SSDs are not attached, the boot disk is used to store runtime logs and * [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. * If one or more SSDs are attached, this runtime bulk @@ -164,7 +164,7 @@ public function getNumLocalSsds() } /** - * Optional. Number of attached SSDs, from 0 to 4 (default is 0). + * Optional. Number of attached SSDs, from 0 to 8 (default is 0). * If SSDs are not attached, the boot disk is used to store runtime logs and * [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. * If one or more SSDs are attached, this runtime bulk diff --git a/Dataproc/src/V1/DriverSchedulingConfig.php b/Dataproc/src/V1/DriverSchedulingConfig.php new file mode 100644 index 000000000000..5fd3f2633226 --- /dev/null +++ b/Dataproc/src/V1/DriverSchedulingConfig.php @@ -0,0 +1,101 @@ +google.cloud.dataproc.v1.DriverSchedulingConfig + */ +class DriverSchedulingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The amount of memory in MB the driver is requesting. + * + * Generated from protobuf field int32 memory_mb = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $memory_mb = 0; + /** + * Required. The number of vCPUs the driver is requesting. + * + * Generated from protobuf field int32 vcores = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $vcores = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $memory_mb + * Required. The amount of memory in MB the driver is requesting. + * @type int $vcores + * Required. The number of vCPUs the driver is requesting. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dataproc\V1\Jobs::initOnce(); + parent::__construct($data); + } + + /** + * Required. The amount of memory in MB the driver is requesting. + * + * Generated from protobuf field int32 memory_mb = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMemoryMb() + { + return $this->memory_mb; + } + + /** + * Required. The amount of memory in MB the driver is requesting. + * + * Generated from protobuf field int32 memory_mb = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMemoryMb($var) + { + GPBUtil::checkInt32($var); + $this->memory_mb = $var; + + return $this; + } + + /** + * Required. The number of vCPUs the driver is requesting. + * + * Generated from protobuf field int32 vcores = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getVcores() + { + return $this->vcores; + } + + /** + * Required. The number of vCPUs the driver is requesting. + * + * Generated from protobuf field int32 vcores = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setVcores($var) + { + GPBUtil::checkInt32($var); + $this->vcores = $var; + + return $this; + } + +} + diff --git a/Dataproc/src/V1/Gapic/ClusterControllerGapicClient.php b/Dataproc/src/V1/Gapic/ClusterControllerGapicClient.php index 79106a9ed9a8..49f74b3fd199 100644 --- a/Dataproc/src/V1/Gapic/ClusterControllerGapicClient.php +++ b/Dataproc/src/V1/Gapic/ClusterControllerGapicClient.php @@ -277,11 +277,12 @@ public function __construct(array $options = []) * Optional. * * @type string $requestId - * Optional. A unique ID used to identify the request. If the server receives two + * Optional. A unique ID used to identify the request. If the server receives + * two * [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the backend - * is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). @@ -379,8 +380,8 @@ public function createCluster($projectId, $region, $cluster, array $optionalArgs * receives two * [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). @@ -700,8 +701,8 @@ public function listClusters($projectId, $region, array $optionalArgs = []) * receives two * [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * * Recommendation: Set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). @@ -797,8 +798,8 @@ public function startCluster($projectId, $region, $clusterName, array $optionalA * receives two * [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * * Recommendation: Set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). @@ -842,7 +843,8 @@ public function stopCluster($projectId, $region, $clusterName, array $optionalAr * Updates a cluster in a project. The returned * [Operation.metadata][google.longrunning.Operation.metadata] will be * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - * The cluster must be in a [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error + * The cluster must be in a + * [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error * is returned. * * Sample code: @@ -959,8 +961,8 @@ public function stopCluster($projectId, $region, $clusterName, array $optionalAr * receives two * [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). diff --git a/Dataproc/src/V1/Gapic/NodeGroupControllerGapicClient.php b/Dataproc/src/V1/Gapic/NodeGroupControllerGapicClient.php new file mode 100644 index 000000000000..6d1ffe182c90 --- /dev/null +++ b/Dataproc/src/V1/Gapic/NodeGroupControllerGapicClient.php @@ -0,0 +1,589 @@ +clusterRegionName('[PROJECT]', '[REGION]', '[CLUSTER]'); + * $nodeGroup = new NodeGroup(); + * $operationResponse = $nodeGroupControllerClient->createNodeGroup($formattedParent, $nodeGroup); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $nodeGroupControllerClient->createNodeGroup($formattedParent, $nodeGroup); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupControllerClient->resumeOperation($operationName, 'createNodeGroup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $nodeGroupControllerClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + */ +class NodeGroupControllerGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dataproc.v1.NodeGroupController'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dataproc.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $clusterRegionNameTemplate; + + private static $nodeGroupNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/node_group_controller_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/node_group_controller_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/node_group_controller_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/node_group_controller_rest_client_config.php', + ], + ], + ]; + } + + private static function getClusterRegionNameTemplate() + { + if (self::$clusterRegionNameTemplate == null) { + self::$clusterRegionNameTemplate = new PathTemplate('projects/{project}/regions/{region}/clusters/{cluster}'); + } + + return self::$clusterRegionNameTemplate; + } + + private static function getNodeGroupNameTemplate() + { + if (self::$nodeGroupNameTemplate == null) { + self::$nodeGroupNameTemplate = new PathTemplate('projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}'); + } + + return self::$nodeGroupNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'clusterRegion' => self::getClusterRegionNameTemplate(), + 'nodeGroup' => self::getNodeGroupNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * cluster_region resource. + * + * @param string $project + * @param string $region + * @param string $cluster + * + * @return string The formatted cluster_region resource. + */ + public static function clusterRegionName($project, $region, $cluster) + { + return self::getClusterRegionNameTemplate()->render([ + 'project' => $project, + 'region' => $region, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a node_group + * resource. + * + * @param string $project + * @param string $region + * @param string $cluster + * @param string $nodeGroup + * + * @return string The formatted node_group resource. + */ + public static function nodeGroupName($project, $region, $cluster, $nodeGroup) + { + return self::getNodeGroupNameTemplate()->render([ + 'project' => $project, + 'region' => $region, + 'cluster' => $cluster, + 'node_group' => $nodeGroup, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - clusterRegion: projects/{project}/regions/{region}/clusters/{cluster} + * - nodeGroup: projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dataproc.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates a node group in a cluster. The returned + * [Operation.metadata][google.longrunning.Operation.metadata] is + * [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + * + * Sample code: + * ``` + * $nodeGroupControllerClient = new NodeGroupControllerClient(); + * try { + * $formattedParent = $nodeGroupControllerClient->clusterRegionName('[PROJECT]', '[REGION]', '[CLUSTER]'); + * $nodeGroup = new NodeGroup(); + * $operationResponse = $nodeGroupControllerClient->createNodeGroup($formattedParent, $nodeGroup); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $nodeGroupControllerClient->createNodeGroup($formattedParent, $nodeGroup); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupControllerClient->resumeOperation($operationName, 'createNodeGroup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $nodeGroupControllerClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource where this node group will be created. + * Format: `projects/{project}/regions/{region}/clusters/{cluster}` + * @param NodeGroup $nodeGroup Required. The node group to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $nodeGroupId + * Optional. An optional node group ID. Generated if not specified. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). Cannot begin or end with underscore + * or hyphen. Must consist of from 3 to 33 characters. + * @type string $requestId + * Optional. A unique ID used to identify the request. If the server receives + * two + * [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. + * + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createNodeGroup($parent, $nodeGroup, array $optionalArgs = []) + { + $request = new CreateNodeGroupRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setNodeGroup($nodeGroup); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['nodeGroupId'])) { + $request->setNodeGroupId($optionalArgs['nodeGroupId']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateNodeGroup', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets the resource representation for a node group in a + * cluster. + * + * Sample code: + * ``` + * $nodeGroupControllerClient = new NodeGroupControllerClient(); + * try { + * $formattedName = $nodeGroupControllerClient->nodeGroupName('[PROJECT]', '[REGION]', '[CLUSTER]', '[NODE_GROUP]'); + * $response = $nodeGroupControllerClient->getNodeGroup($formattedName); + * } finally { + * $nodeGroupControllerClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the node group to retrieve. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Dataproc\V1\NodeGroup + * + * @throws ApiException if the remote call fails + */ + public function getNodeGroup($name, array $optionalArgs = []) + { + $request = new GetNodeGroupRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetNodeGroup', NodeGroup::class, $optionalArgs, $request)->wait(); + } + + /** + * Resizes a node group in a cluster. The returned + * [Operation.metadata][google.longrunning.Operation.metadata] is + * [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + * + * Sample code: + * ``` + * $nodeGroupControllerClient = new NodeGroupControllerClient(); + * try { + * $name = 'name'; + * $size = 0; + * $operationResponse = $nodeGroupControllerClient->resizeNodeGroup($name, $size); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $nodeGroupControllerClient->resizeNodeGroup($name, $size); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupControllerClient->resumeOperation($operationName, 'resizeNodeGroup'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $nodeGroupControllerClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the node group to resize. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * @param int $size Required. The number of running instances for the node group to maintain. + * The group adds or removes instances to maintain the number of instances + * specified by this parameter. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A unique ID used to identify the request. If the server receives + * two + * [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. + * + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @type Duration $gracefulDecommissionTimeout + * Optional. Timeout for graceful YARN decommissioning. [Graceful + * decommissioning] + * (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) + * allows the removal of nodes from the Compute Engine node group + * without interrupting jobs in progress. This timeout specifies how long to + * wait for jobs in progress to finish before forcefully removing nodes (and + * potentially interrupting jobs). Default timeout is 0 (for forceful + * decommission), and the maximum allowed timeout is 1 day. (see JSON + * representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + * + * Only supported on Dataproc image versions 1.2 and higher. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function resizeNodeGroup($name, $size, array $optionalArgs = []) + { + $request = new ResizeNodeGroupRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setSize($size); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['gracefulDecommissionTimeout'])) { + $request->setGracefulDecommissionTimeout($optionalArgs['gracefulDecommissionTimeout']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ResizeNodeGroup', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } +} diff --git a/Dataproc/src/V1/GceClusterConfig.php b/Dataproc/src/V1/GceClusterConfig.php index 3b1792bcf14d..0b4c912f7bd5 100644 --- a/Dataproc/src/V1/GceClusterConfig.php +++ b/Dataproc/src/V1/GceClusterConfig.php @@ -132,7 +132,8 @@ class GceClusterConfig extends \Google\Protobuf\Internal\Message */ private $node_group_affinity = null; /** - * Optional. Shielded Instance Config for clusters using [Compute Engine Shielded + * Optional. Shielded Instance Config for clusters using [Compute Engine + * Shielded * VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). * * Generated from protobuf field .google.cloud.dataproc.v1.ShieldedInstanceConfig shielded_instance_config = 14 [(.google.api.field_behavior) = OPTIONAL]; @@ -224,7 +225,8 @@ class GceClusterConfig extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Dataproc\V1\NodeGroupAffinity $node_group_affinity * Optional. Node Group Affinity for sole-tenant clusters. * @type \Google\Cloud\Dataproc\V1\ShieldedInstanceConfig $shielded_instance_config - * Optional. Shielded Instance Config for clusters using [Compute Engine Shielded + * Optional. Shielded Instance Config for clusters using [Compute Engine + * Shielded * VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). * @type \Google\Cloud\Dataproc\V1\ConfidentialInstanceConfig $confidential_instance_config * Optional. Confidential Instance Config for clusters using [Confidential @@ -641,7 +643,8 @@ public function setNodeGroupAffinity($var) } /** - * Optional. Shielded Instance Config for clusters using [Compute Engine Shielded + * Optional. Shielded Instance Config for clusters using [Compute Engine + * Shielded * VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). * * Generated from protobuf field .google.cloud.dataproc.v1.ShieldedInstanceConfig shielded_instance_config = 14 [(.google.api.field_behavior) = OPTIONAL]; @@ -663,7 +666,8 @@ public function clearShieldedInstanceConfig() } /** - * Optional. Shielded Instance Config for clusters using [Compute Engine Shielded + * Optional. Shielded Instance Config for clusters using [Compute Engine + * Shielded * VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). * * Generated from protobuf field .google.cloud.dataproc.v1.ShieldedInstanceConfig shielded_instance_config = 14 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/Dataproc/src/V1/GceClusterConfig/PrivateIpv6GoogleAccess.php b/Dataproc/src/V1/GceClusterConfig/PrivateIpv6GoogleAccess.php index a2b7e7586073..5299b26dbe18 100644 --- a/Dataproc/src/V1/GceClusterConfig/PrivateIpv6GoogleAccess.php +++ b/Dataproc/src/V1/GceClusterConfig/PrivateIpv6GoogleAccess.php @@ -19,7 +19,8 @@ class PrivateIpv6GoogleAccess { /** * If unspecified, Compute Engine default behavior will apply, which - * is the same as [INHERIT_FROM_SUBNETWORK][google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess.INHERIT_FROM_SUBNETWORK]. + * is the same as + * [INHERIT_FROM_SUBNETWORK][google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess.INHERIT_FROM_SUBNETWORK]. * * Generated from protobuf enum PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; */ diff --git a/Dataproc/src/V1/GetNodeGroupRequest.php b/Dataproc/src/V1/GetNodeGroupRequest.php new file mode 100644 index 000000000000..79039483cda0 --- /dev/null +++ b/Dataproc/src/V1/GetNodeGroupRequest.php @@ -0,0 +1,75 @@ +google.cloud.dataproc.v1.GetNodeGroupRequest + */ +class GetNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the node group to retrieve. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the node group to retrieve. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dataproc\V1\NodeGroups::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the node group to retrieve. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the node group to retrieve. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/Dataproc/src/V1/InstanceGroupConfig/Preemptibility.php b/Dataproc/src/V1/InstanceGroupConfig/Preemptibility.php index 27f17ea057ff..985741aa6e7c 100644 --- a/Dataproc/src/V1/InstanceGroupConfig/Preemptibility.php +++ b/Dataproc/src/V1/InstanceGroupConfig/Preemptibility.php @@ -7,10 +7,7 @@ use UnexpectedValueException; /** - * Controls the use of - * [preemptible instances] - * (https://cloud.google.com/compute/docs/instances/preemptible) - * within the group. + * Controls the use of preemptible instances within the group. * * Protobuf type google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility */ @@ -32,8 +29,11 @@ class Preemptibility */ const NON_PREEMPTIBLE = 1; /** - * Instances are preemptible. - * This option is allowed only for secondary worker groups. + * Instances are [preemptible] + * (https://cloud.google.com/compute/docs/instances/preemptible). + * This option is allowed only for [secondary worker] + * (https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms) + * groups. * * Generated from protobuf enum PREEMPTIBLE = 2; */ diff --git a/Dataproc/src/V1/Job.php b/Dataproc/src/V1/Job.php index acb96b9a354d..f75c033914b4 100644 --- a/Dataproc/src/V1/Job.php +++ b/Dataproc/src/V1/Job.php @@ -95,14 +95,20 @@ class Job extends \Google\Protobuf\Internal\Message */ private $job_uuid = ''; /** - * Output only. Indicates whether the job is completed. If the value is `false`, - * the job is still in progress. If `true`, the job is completed, and + * Output only. Indicates whether the job is completed. If the value is + * `false`, the job is still in progress. If `true`, the job is completed, and * `status.state` field will indicate if it was successful, failed, * or cancelled. * * Generated from protobuf field bool done = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $done = false; + /** + * Optional. Driver scheduling configuration. + * + * Generated from protobuf field .google.cloud.dataproc.v1.DriverSchedulingConfig driver_scheduling_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $driver_scheduling_config = null; protected $type_job; /** @@ -167,10 +173,12 @@ class Job extends \Google\Protobuf\Internal\Message * over time. This is in contrast to a user-settable reference.job_id that * may be reused over time. * @type bool $done - * Output only. Indicates whether the job is completed. If the value is `false`, - * the job is still in progress. If `true`, the job is completed, and + * Output only. Indicates whether the job is completed. If the value is + * `false`, the job is still in progress. If `true`, the job is completed, and * `status.state` field will indicate if it was successful, failed, * or cancelled. + * @type \Google\Cloud\Dataproc\V1\DriverSchedulingConfig $driver_scheduling_config + * Optional. Driver scheduling configuration. * } */ public function __construct($data = NULL) { @@ -765,8 +773,8 @@ public function setJobUuid($var) } /** - * Output only. Indicates whether the job is completed. If the value is `false`, - * the job is still in progress. If `true`, the job is completed, and + * Output only. Indicates whether the job is completed. If the value is + * `false`, the job is still in progress. If `true`, the job is completed, and * `status.state` field will indicate if it was successful, failed, * or cancelled. * @@ -779,8 +787,8 @@ public function getDone() } /** - * Output only. Indicates whether the job is completed. If the value is `false`, - * the job is still in progress. If `true`, the job is completed, and + * Output only. Indicates whether the job is completed. If the value is + * `false`, the job is still in progress. If `true`, the job is completed, and * `status.state` field will indicate if it was successful, failed, * or cancelled. * @@ -796,6 +804,42 @@ public function setDone($var) return $this; } + /** + * Optional. Driver scheduling configuration. + * + * Generated from protobuf field .google.cloud.dataproc.v1.DriverSchedulingConfig driver_scheduling_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dataproc\V1\DriverSchedulingConfig|null + */ + public function getDriverSchedulingConfig() + { + return $this->driver_scheduling_config; + } + + public function hasDriverSchedulingConfig() + { + return isset($this->driver_scheduling_config); + } + + public function clearDriverSchedulingConfig() + { + unset($this->driver_scheduling_config); + } + + /** + * Optional. Driver scheduling configuration. + * + * Generated from protobuf field .google.cloud.dataproc.v1.DriverSchedulingConfig driver_scheduling_config = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dataproc\V1\DriverSchedulingConfig $var + * @return $this + */ + public function setDriverSchedulingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\DriverSchedulingConfig::class); + $this->driver_scheduling_config = $var; + + return $this; + } + /** * @return string */ diff --git a/Dataproc/src/V1/JobPlacement.php b/Dataproc/src/V1/JobPlacement.php index 495aa071bcb5..0a5ccff35886 100644 --- a/Dataproc/src/V1/JobPlacement.php +++ b/Dataproc/src/V1/JobPlacement.php @@ -29,7 +29,8 @@ class JobPlacement extends \Google\Protobuf\Internal\Message */ private $cluster_uuid = ''; /** - * Optional. Cluster labels to identify a cluster where the job will be submitted. + * Optional. Cluster labels to identify a cluster where the job will be + * submitted. * * Generated from protobuf field map cluster_labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -47,7 +48,8 @@ class JobPlacement extends \Google\Protobuf\Internal\Message * Output only. A cluster UUID generated by the Dataproc service when * the job is submitted. * @type array|\Google\Protobuf\Internal\MapField $cluster_labels - * Optional. Cluster labels to identify a cluster where the job will be submitted. + * Optional. Cluster labels to identify a cluster where the job will be + * submitted. * } */ public function __construct($data = NULL) { @@ -110,7 +112,8 @@ public function setClusterUuid($var) } /** - * Optional. Cluster labels to identify a cluster where the job will be submitted. + * Optional. Cluster labels to identify a cluster where the job will be + * submitted. * * Generated from protobuf field map cluster_labels = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Protobuf\Internal\MapField @@ -121,7 +124,8 @@ public function getClusterLabels() } /** - * Optional. Cluster labels to identify a cluster where the job will be submitted. + * Optional. Cluster labels to identify a cluster where the job will be + * submitted. * * Generated from protobuf field map cluster_labels = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param array|\Google\Protobuf\Internal\MapField $var diff --git a/Dataproc/src/V1/JobReference.php b/Dataproc/src/V1/JobReference.php index 93ed7c80fbf8..0840696143ac 100644 --- a/Dataproc/src/V1/JobReference.php +++ b/Dataproc/src/V1/JobReference.php @@ -16,8 +16,8 @@ class JobReference extends \Google\Protobuf\Internal\Message { /** - * Optional. The ID of the Google Cloud Platform project that the job belongs to. If - * specified, must match the request project ID. + * Optional. The ID of the Google Cloud Platform project that the job belongs + * to. If specified, must match the request project ID. * * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -39,8 +39,8 @@ class JobReference extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $project_id - * Optional. The ID of the Google Cloud Platform project that the job belongs to. If - * specified, must match the request project ID. + * Optional. The ID of the Google Cloud Platform project that the job belongs + * to. If specified, must match the request project ID. * @type string $job_id * Optional. The job ID, which must be unique within the project. * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -54,8 +54,8 @@ public function __construct($data = NULL) { } /** - * Optional. The ID of the Google Cloud Platform project that the job belongs to. If - * specified, must match the request project ID. + * Optional. The ID of the Google Cloud Platform project that the job belongs + * to. If specified, must match the request project ID. * * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -66,8 +66,8 @@ public function getProjectId() } /** - * Optional. The ID of the Google Cloud Platform project that the job belongs to. If - * specified, must match the request project ID. + * Optional. The ID of the Google Cloud Platform project that the job belongs + * to. If specified, must match the request project ID. * * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Dataproc/src/V1/JobScheduling.php b/Dataproc/src/V1/JobScheduling.php index 8db7ca87ccbb..a11db612d32f 100644 --- a/Dataproc/src/V1/JobScheduling.php +++ b/Dataproc/src/V1/JobScheduling.php @@ -19,27 +19,25 @@ class JobScheduling extends \Google\Protobuf\Internal\Message * Optional. Maximum number of times per hour a driver may be restarted as * a result of driver exiting with non-zero code before job is * reported failed. - * A job may be reported as thrashing if driver exits with non-zero code - * 4 times within 10 minute window. + * A job may be reported as thrashing if the driver exits with a non-zero code + * four times within a 10-minute window. * Maximum value is 10. - * **Note:** Currently, this restartable job option is - * not supported in Dataproc - * [workflow - * template](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template) - * jobs. + * **Note:** This restartable job option is not supported in Dataproc + * [workflow templates] + * (https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). * * Generated from protobuf field int32 max_failures_per_hour = 1 [(.google.api.field_behavior) = OPTIONAL]; */ private $max_failures_per_hour = 0; /** - * Optional. Maximum number of times in total a driver may be restarted as a result of - * driver exiting with non-zero code before job is reported failed. + * Optional. Maximum total number of times a driver may be restarted as a + * result of the driver exiting with a non-zero code. After the maximum number + * is reached, the job will be reported as failed. * Maximum value is 240. * **Note:** Currently, this restartable job option is * not supported in Dataproc * [workflow - * template](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template) - * jobs. + * templates](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). * * Generated from protobuf field int32 max_failures_total = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -55,23 +53,21 @@ class JobScheduling extends \Google\Protobuf\Internal\Message * Optional. Maximum number of times per hour a driver may be restarted as * a result of driver exiting with non-zero code before job is * reported failed. - * A job may be reported as thrashing if driver exits with non-zero code - * 4 times within 10 minute window. + * A job may be reported as thrashing if the driver exits with a non-zero code + * four times within a 10-minute window. * Maximum value is 10. - * **Note:** Currently, this restartable job option is - * not supported in Dataproc - * [workflow - * template](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template) - * jobs. + * **Note:** This restartable job option is not supported in Dataproc + * [workflow templates] + * (https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). * @type int $max_failures_total - * Optional. Maximum number of times in total a driver may be restarted as a result of - * driver exiting with non-zero code before job is reported failed. + * Optional. Maximum total number of times a driver may be restarted as a + * result of the driver exiting with a non-zero code. After the maximum number + * is reached, the job will be reported as failed. * Maximum value is 240. * **Note:** Currently, this restartable job option is * not supported in Dataproc * [workflow - * template](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template) - * jobs. + * templates](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). * } */ public function __construct($data = NULL) { @@ -83,14 +79,12 @@ public function __construct($data = NULL) { * Optional. Maximum number of times per hour a driver may be restarted as * a result of driver exiting with non-zero code before job is * reported failed. - * A job may be reported as thrashing if driver exits with non-zero code - * 4 times within 10 minute window. + * A job may be reported as thrashing if the driver exits with a non-zero code + * four times within a 10-minute window. * Maximum value is 10. - * **Note:** Currently, this restartable job option is - * not supported in Dataproc - * [workflow - * template](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template) - * jobs. + * **Note:** This restartable job option is not supported in Dataproc + * [workflow templates] + * (https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). * * Generated from protobuf field int32 max_failures_per_hour = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -104,14 +98,12 @@ public function getMaxFailuresPerHour() * Optional. Maximum number of times per hour a driver may be restarted as * a result of driver exiting with non-zero code before job is * reported failed. - * A job may be reported as thrashing if driver exits with non-zero code - * 4 times within 10 minute window. + * A job may be reported as thrashing if the driver exits with a non-zero code + * four times within a 10-minute window. * Maximum value is 10. - * **Note:** Currently, this restartable job option is - * not supported in Dataproc - * [workflow - * template](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template) - * jobs. + * **Note:** This restartable job option is not supported in Dataproc + * [workflow templates] + * (https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). * * Generated from protobuf field int32 max_failures_per_hour = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var @@ -126,14 +118,14 @@ public function setMaxFailuresPerHour($var) } /** - * Optional. Maximum number of times in total a driver may be restarted as a result of - * driver exiting with non-zero code before job is reported failed. + * Optional. Maximum total number of times a driver may be restarted as a + * result of the driver exiting with a non-zero code. After the maximum number + * is reached, the job will be reported as failed. * Maximum value is 240. * **Note:** Currently, this restartable job option is * not supported in Dataproc * [workflow - * template](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template) - * jobs. + * templates](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). * * Generated from protobuf field int32 max_failures_total = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -144,14 +136,14 @@ public function getMaxFailuresTotal() } /** - * Optional. Maximum number of times in total a driver may be restarted as a result of - * driver exiting with non-zero code before job is reported failed. + * Optional. Maximum total number of times a driver may be restarted as a + * result of the driver exiting with a non-zero code. After the maximum number + * is reached, the job will be reported as failed. * Maximum value is 240. * **Note:** Currently, this restartable job option is * not supported in Dataproc * [workflow - * template](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template) - * jobs. + * templates](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). * * Generated from protobuf field int32 max_failures_total = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var diff --git a/Dataproc/src/V1/KerberosConfig.php b/Dataproc/src/V1/KerberosConfig.php index c03b567a3cb9..49ccbd79d3e1 100644 --- a/Dataproc/src/V1/KerberosConfig.php +++ b/Dataproc/src/V1/KerberosConfig.php @@ -16,8 +16,8 @@ class KerberosConfig extends \Google\Protobuf\Internal\Message { /** - * Optional. Flag to indicate whether to Kerberize the cluster (default: false). Set - * this field to true to enable Kerberos on a cluster. + * Optional. Flag to indicate whether to Kerberize the cluster (default: + * false). Set this field to true to enable Kerberos on a cluster. * * Generated from protobuf field bool enable_kerberos = 1 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -135,8 +135,8 @@ class KerberosConfig extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type bool $enable_kerberos - * Optional. Flag to indicate whether to Kerberize the cluster (default: false). Set - * this field to true to enable Kerberos on a cluster. + * Optional. Flag to indicate whether to Kerberize the cluster (default: + * false). Set this field to true to enable Kerberos on a cluster. * @type string $root_principal_password_uri * Optional. The Cloud Storage URI of a KMS encrypted file containing the root * principal password. @@ -194,8 +194,8 @@ public function __construct($data = NULL) { } /** - * Optional. Flag to indicate whether to Kerberize the cluster (default: false). Set - * this field to true to enable Kerberos on a cluster. + * Optional. Flag to indicate whether to Kerberize the cluster (default: + * false). Set this field to true to enable Kerberos on a cluster. * * Generated from protobuf field bool enable_kerberos = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -206,8 +206,8 @@ public function getEnableKerberos() } /** - * Optional. Flag to indicate whether to Kerberize the cluster (default: false). Set - * this field to true to enable Kerberos on a cluster. + * Optional. Flag to indicate whether to Kerberize the cluster (default: + * false). Set this field to true to enable Kerberos on a cluster. * * Generated from protobuf field bool enable_kerberos = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/Dataproc/src/V1/LifecycleConfig.php b/Dataproc/src/V1/LifecycleConfig.php index 7f1d7cf25ef8..ac926d99e5ea 100644 --- a/Dataproc/src/V1/LifecycleConfig.php +++ b/Dataproc/src/V1/LifecycleConfig.php @@ -49,7 +49,8 @@ class LifecycleConfig extends \Google\Protobuf\Internal\Message * representation of * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). * @type \Google\Protobuf\Timestamp $auto_delete_time - * Optional. The time when cluster will be auto-deleted (see JSON representation of + * Optional. The time when cluster will be auto-deleted (see JSON + * representation of * [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). * @type \Google\Protobuf\Duration $auto_delete_ttl * Optional. The lifetime duration of cluster. The cluster will be @@ -113,7 +114,8 @@ public function setIdleDeleteTtl($var) } /** - * Optional. The time when cluster will be auto-deleted (see JSON representation of + * Optional. The time when cluster will be auto-deleted (see JSON + * representation of * [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). * * Generated from protobuf field .google.protobuf.Timestamp auto_delete_time = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -130,7 +132,8 @@ public function hasAutoDeleteTime() } /** - * Optional. The time when cluster will be auto-deleted (see JSON representation of + * Optional. The time when cluster will be auto-deleted (see JSON + * representation of * [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). * * Generated from protobuf field .google.protobuf.Timestamp auto_delete_time = 2 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/Dataproc/src/V1/NodeGroup.php b/Dataproc/src/V1/NodeGroup.php new file mode 100644 index 000000000000..6a1ec5999f83 --- /dev/null +++ b/Dataproc/src/V1/NodeGroup.php @@ -0,0 +1,206 @@ +google.cloud.dataproc.v1.NodeGroup + */ +class NodeGroup extends \Google\Protobuf\Internal\Message +{ + /** + * The Node group [resource name](https://aip.dev/122). + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * Required. Node group roles. + * + * Generated from protobuf field repeated .google.cloud.dataproc.v1.NodeGroup.Role roles = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $roles; + /** + * Optional. The node group instance group configuration. + * + * Generated from protobuf field .google.cloud.dataproc.v1.InstanceGroupConfig node_group_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $node_group_config = null; + /** + * Optional. Node group labels. + * * Label **keys** must consist of from 1 to 63 characters and conform to + * [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + * * Label **values** can be empty. If specified, they must consist of from + * 1 to 63 characters and conform to [RFC 1035] + * (https://www.ietf.org/rfc/rfc1035.txt). + * * The node group must have no more than 32 labels. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The Node group [resource name](https://aip.dev/122). + * @type array|\Google\Protobuf\Internal\RepeatedField $roles + * Required. Node group roles. + * @type \Google\Cloud\Dataproc\V1\InstanceGroupConfig $node_group_config + * Optional. The node group instance group configuration. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Node group labels. + * * Label **keys** must consist of from 1 to 63 characters and conform to + * [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + * * Label **values** can be empty. If specified, they must consist of from + * 1 to 63 characters and conform to [RFC 1035] + * (https://www.ietf.org/rfc/rfc1035.txt). + * * The node group must have no more than 32 labels. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dataproc\V1\Clusters::initOnce(); + parent::__construct($data); + } + + /** + * The Node group [resource name](https://aip.dev/122). + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The Node group [resource name](https://aip.dev/122). + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Node group roles. + * + * Generated from protobuf field repeated .google.cloud.dataproc.v1.NodeGroup.Role roles = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoles() + { + return $this->roles; + } + + /** + * Required. Node group roles. + * + * Generated from protobuf field repeated .google.cloud.dataproc.v1.NodeGroup.Role roles = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dataproc\V1\NodeGroup\Role::class); + $this->roles = $arr; + + return $this; + } + + /** + * Optional. The node group instance group configuration. + * + * Generated from protobuf field .google.cloud.dataproc.v1.InstanceGroupConfig node_group_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dataproc\V1\InstanceGroupConfig|null + */ + public function getNodeGroupConfig() + { + return $this->node_group_config; + } + + public function hasNodeGroupConfig() + { + return isset($this->node_group_config); + } + + public function clearNodeGroupConfig() + { + unset($this->node_group_config); + } + + /** + * Optional. The node group instance group configuration. + * + * Generated from protobuf field .google.cloud.dataproc.v1.InstanceGroupConfig node_group_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dataproc\V1\InstanceGroupConfig $var + * @return $this + */ + public function setNodeGroupConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\InstanceGroupConfig::class); + $this->node_group_config = $var; + + return $this; + } + + /** + * Optional. Node group labels. + * * Label **keys** must consist of from 1 to 63 characters and conform to + * [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + * * Label **values** can be empty. If specified, they must consist of from + * 1 to 63 characters and conform to [RFC 1035] + * (https://www.ietf.org/rfc/rfc1035.txt). + * * The node group must have no more than 32 labels. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Node group labels. + * * Label **keys** must consist of from 1 to 63 characters and conform to + * [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + * * Label **values** can be empty. If specified, they must consist of from + * 1 to 63 characters and conform to [RFC 1035] + * (https://www.ietf.org/rfc/rfc1035.txt). + * * The node group must have no more than 32 labels. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/Dataproc/src/V1/NodeGroup/Role.php b/Dataproc/src/V1/NodeGroup/Role.php new file mode 100644 index 000000000000..3c6f3dfd17c5 --- /dev/null +++ b/Dataproc/src/V1/NodeGroup/Role.php @@ -0,0 +1,57 @@ +google.cloud.dataproc.v1.NodeGroup.Role + */ +class Role +{ + /** + * Required unspecified role. + * + * Generated from protobuf enum ROLE_UNSPECIFIED = 0; + */ + const ROLE_UNSPECIFIED = 0; + /** + * Job drivers run on the node group. + * + * Generated from protobuf enum DRIVER = 1; + */ + const DRIVER = 1; + + private static $valueToName = [ + self::ROLE_UNSPECIFIED => 'ROLE_UNSPECIFIED', + self::DRIVER => 'DRIVER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Role::class, \Google\Cloud\Dataproc\V1\NodeGroup_Role::class); + diff --git a/Dataproc/src/V1/NodeGroupAffinity.php b/Dataproc/src/V1/NodeGroupAffinity.php index 5d5d078c905f..4a3a6b82f62c 100644 --- a/Dataproc/src/V1/NodeGroupAffinity.php +++ b/Dataproc/src/V1/NodeGroupAffinity.php @@ -10,6 +10,8 @@ /** * Node Group Affinity for clusters using sole-tenant node groups. + * **The Dataproc `NodeGroupAffinity` resource is not related to the + * Dataproc [NodeGroup][google.cloud.dataproc.v1.NodeGroup] resource.** * * Generated from protobuf message google.cloud.dataproc.v1.NodeGroupAffinity */ diff --git a/Dataproc/src/V1/NodeGroupControllerClient.php b/Dataproc/src/V1/NodeGroupControllerClient.php new file mode 100644 index 000000000000..b5a857d6efd5 --- /dev/null +++ b/Dataproc/src/V1/NodeGroupControllerClient.php @@ -0,0 +1,34 @@ +_simpleRequest('/google.cloud.dataproc.v1.NodeGroupController/CreateNodeGroup', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Resizes a node group in a cluster. The returned + * [Operation.metadata][google.longrunning.Operation.metadata] is + * [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + * @param \Google\Cloud\Dataproc\V1\ResizeNodeGroupRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ResizeNodeGroup(\Google\Cloud\Dataproc\V1\ResizeNodeGroupRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.dataproc.v1.NodeGroupController/ResizeNodeGroup', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Gets the resource representation for a node group in a + * cluster. + * @param \Google\Cloud\Dataproc\V1\GetNodeGroupRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetNodeGroup(\Google\Cloud\Dataproc\V1\GetNodeGroupRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.dataproc.v1.NodeGroupController/GetNodeGroup', + $argument, + ['\Google\Cloud\Dataproc\V1\NodeGroup', 'decode'], + $metadata, $options); + } + +} diff --git a/Dataproc/src/V1/NodeGroupOperationMetadata.php b/Dataproc/src/V1/NodeGroupOperationMetadata.php new file mode 100644 index 000000000000..7f52039f5bff --- /dev/null +++ b/Dataproc/src/V1/NodeGroupOperationMetadata.php @@ -0,0 +1,315 @@ +google.cloud.dataproc.v1.NodeGroupOperationMetadata + */ +class NodeGroupOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Node group ID for the operation. + * + * Generated from protobuf field string node_group_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $node_group_id = ''; + /** + * Output only. Cluster UUID associated with the node group operation. + * + * Generated from protobuf field string cluster_uuid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $cluster_uuid = ''; + /** + * Output only. Current operation status. + * + * Generated from protobuf field .google.cloud.dataproc.v1.ClusterOperationStatus status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $status = null; + /** + * Output only. The previous operation status. + * + * Generated from protobuf field repeated .google.cloud.dataproc.v1.ClusterOperationStatus status_history = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $status_history; + /** + * The operation type. + * + * Generated from protobuf field .google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType operation_type = 5; + */ + private $operation_type = 0; + /** + * Output only. Short description of operation. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $description = ''; + /** + * Output only. Labels associated with the operation. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $labels; + /** + * Output only. Errors encountered during operation execution. + * + * Generated from protobuf field repeated string warnings = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $warnings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_group_id + * Output only. Node group ID for the operation. + * @type string $cluster_uuid + * Output only. Cluster UUID associated with the node group operation. + * @type \Google\Cloud\Dataproc\V1\ClusterOperationStatus $status + * Output only. Current operation status. + * @type array<\Google\Cloud\Dataproc\V1\ClusterOperationStatus>|\Google\Protobuf\Internal\RepeatedField $status_history + * Output only. The previous operation status. + * @type int $operation_type + * The operation type. + * @type string $description + * Output only. Short description of operation. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Output only. Labels associated with the operation. + * @type array|\Google\Protobuf\Internal\RepeatedField $warnings + * Output only. Errors encountered during operation execution. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dataproc\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Node group ID for the operation. + * + * Generated from protobuf field string node_group_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNodeGroupId() + { + return $this->node_group_id; + } + + /** + * Output only. Node group ID for the operation. + * + * Generated from protobuf field string node_group_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNodeGroupId($var) + { + GPBUtil::checkString($var, True); + $this->node_group_id = $var; + + return $this; + } + + /** + * Output only. Cluster UUID associated with the node group operation. + * + * Generated from protobuf field string cluster_uuid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getClusterUuid() + { + return $this->cluster_uuid; + } + + /** + * Output only. Cluster UUID associated with the node group operation. + * + * Generated from protobuf field string cluster_uuid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setClusterUuid($var) + { + GPBUtil::checkString($var, True); + $this->cluster_uuid = $var; + + return $this; + } + + /** + * Output only. Current operation status. + * + * Generated from protobuf field .google.cloud.dataproc.v1.ClusterOperationStatus status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dataproc\V1\ClusterOperationStatus|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Output only. Current operation status. + * + * Generated from protobuf field .google.cloud.dataproc.v1.ClusterOperationStatus status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dataproc\V1\ClusterOperationStatus $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\ClusterOperationStatus::class); + $this->status = $var; + + return $this; + } + + /** + * Output only. The previous operation status. + * + * Generated from protobuf field repeated .google.cloud.dataproc.v1.ClusterOperationStatus status_history = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStatusHistory() + { + return $this->status_history; + } + + /** + * Output only. The previous operation status. + * + * Generated from protobuf field repeated .google.cloud.dataproc.v1.ClusterOperationStatus status_history = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Dataproc\V1\ClusterOperationStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStatusHistory($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dataproc\V1\ClusterOperationStatus::class); + $this->status_history = $arr; + + return $this; + } + + /** + * The operation type. + * + * Generated from protobuf field .google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType operation_type = 5; + * @return int + */ + public function getOperationType() + { + return $this->operation_type; + } + + /** + * The operation type. + * + * Generated from protobuf field .google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType operation_type = 5; + * @param int $var + * @return $this + */ + public function setOperationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dataproc\V1\NodeGroupOperationMetadata\NodeGroupOperationType::class); + $this->operation_type = $var; + + return $this; + } + + /** + * Output only. Short description of operation. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Output only. Short description of operation. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Labels associated with the operation. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Output only. Labels associated with the operation. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Errors encountered during operation execution. + * + * Generated from protobuf field repeated string warnings = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWarnings() + { + return $this->warnings; + } + + /** + * Output only. Errors encountered during operation execution. + * + * Generated from protobuf field repeated string warnings = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWarnings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->warnings = $arr; + + return $this; + } + +} + diff --git a/Dataproc/src/V1/NodeGroupOperationMetadata/NodeGroupOperationType.php b/Dataproc/src/V1/NodeGroupOperationMetadata/NodeGroupOperationType.php new file mode 100644 index 000000000000..4d13ed48a9be --- /dev/null +++ b/Dataproc/src/V1/NodeGroupOperationMetadata/NodeGroupOperationType.php @@ -0,0 +1,78 @@ +google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType + */ +class NodeGroupOperationType +{ + /** + * Node group operation type is unknown. + * + * Generated from protobuf enum NODE_GROUP_OPERATION_TYPE_UNSPECIFIED = 0; + */ + const NODE_GROUP_OPERATION_TYPE_UNSPECIFIED = 0; + /** + * Create node group operation type. + * + * Generated from protobuf enum CREATE = 1; + */ + const CREATE = 1; + /** + * Update node group operation type. + * + * Generated from protobuf enum UPDATE = 2; + */ + const UPDATE = 2; + /** + * Delete node group operation type. + * + * Generated from protobuf enum DELETE = 3; + */ + const DELETE = 3; + /** + * Resize node group operation type. + * + * Generated from protobuf enum RESIZE = 4; + */ + const RESIZE = 4; + + private static $valueToName = [ + self::NODE_GROUP_OPERATION_TYPE_UNSPECIFIED => 'NODE_GROUP_OPERATION_TYPE_UNSPECIFIED', + self::CREATE => 'CREATE', + self::UPDATE => 'UPDATE', + self::DELETE => 'DELETE', + self::RESIZE => 'RESIZE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NodeGroupOperationType::class, \Google\Cloud\Dataproc\V1\NodeGroupOperationMetadata_NodeGroupOperationType::class); + diff --git a/Dataproc/src/V1/NodeGroupOperationMetadata_NodeGroupOperationType.php b/Dataproc/src/V1/NodeGroupOperationMetadata_NodeGroupOperationType.php new file mode 100644 index 000000000000..98daf6390e22 --- /dev/null +++ b/Dataproc/src/V1/NodeGroupOperationMetadata_NodeGroupOperationType.php @@ -0,0 +1,16 @@ +google.cloud.dataproc.v1.ResizeNodeGroupRequest + */ +class ResizeNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the node group to resize. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $name = ''; + /** + * Required. The number of running instances for the node group to maintain. + * The group adds or removes instances to maintain the number of instances + * specified by this parameter. + * + * Generated from protobuf field int32 size = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $size = 0; + /** + * Optional. A unique ID used to identify the request. If the server receives + * two + * [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + /** + * Optional. Timeout for graceful YARN decommissioning. [Graceful + * decommissioning] + * (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) + * allows the removal of nodes from the Compute Engine node group + * without interrupting jobs in progress. This timeout specifies how long to + * wait for jobs in progress to finish before forcefully removing nodes (and + * potentially interrupting jobs). Default timeout is 0 (for forceful + * decommission), and the maximum allowed timeout is 1 day. (see JSON + * representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + * Only supported on Dataproc image versions 1.2 and higher. + * + * Generated from protobuf field .google.protobuf.Duration graceful_decommission_timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $graceful_decommission_timeout = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the node group to resize. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * @type int $size + * Required. The number of running instances for the node group to maintain. + * The group adds or removes instances to maintain the number of instances + * specified by this parameter. + * @type string $request_id + * Optional. A unique ID used to identify the request. If the server receives + * two + * [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @type \Google\Protobuf\Duration $graceful_decommission_timeout + * Optional. Timeout for graceful YARN decommissioning. [Graceful + * decommissioning] + * (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) + * allows the removal of nodes from the Compute Engine node group + * without interrupting jobs in progress. This timeout specifies how long to + * wait for jobs in progress to finish before forcefully removing nodes (and + * potentially interrupting jobs). Default timeout is 0 (for forceful + * decommission), and the maximum allowed timeout is 1 day. (see JSON + * representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + * Only supported on Dataproc image versions 1.2 and higher. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dataproc\V1\NodeGroups::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the node group to resize. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the node group to resize. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The number of running instances for the node group to maintain. + * The group adds or removes instances to maintain the number of instances + * specified by this parameter. + * + * Generated from protobuf field int32 size = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSize() + { + return $this->size; + } + + /** + * Required. The number of running instances for the node group to maintain. + * The group adds or removes instances to maintain the number of instances + * specified by this parameter. + * + * Generated from protobuf field int32 size = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkInt32($var); + $this->size = $var; + + return $this; + } + + /** + * Optional. A unique ID used to identify the request. If the server receives + * two + * [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A unique ID used to identify the request. If the server receives + * two + * [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. Timeout for graceful YARN decommissioning. [Graceful + * decommissioning] + * (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) + * allows the removal of nodes from the Compute Engine node group + * without interrupting jobs in progress. This timeout specifies how long to + * wait for jobs in progress to finish before forcefully removing nodes (and + * potentially interrupting jobs). Default timeout is 0 (for forceful + * decommission), and the maximum allowed timeout is 1 day. (see JSON + * representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + * Only supported on Dataproc image versions 1.2 and higher. + * + * Generated from protobuf field .google.protobuf.Duration graceful_decommission_timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getGracefulDecommissionTimeout() + { + return $this->graceful_decommission_timeout; + } + + public function hasGracefulDecommissionTimeout() + { + return isset($this->graceful_decommission_timeout); + } + + public function clearGracefulDecommissionTimeout() + { + unset($this->graceful_decommission_timeout); + } + + /** + * Optional. Timeout for graceful YARN decommissioning. [Graceful + * decommissioning] + * (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) + * allows the removal of nodes from the Compute Engine node group + * without interrupting jobs in progress. This timeout specifies how long to + * wait for jobs in progress to finish before forcefully removing nodes (and + * potentially interrupting jobs). Default timeout is 0 (for forceful + * decommission), and the maximum allowed timeout is 1 day. (see JSON + * representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + * Only supported on Dataproc image versions 1.2 and higher. + * + * Generated from protobuf field .google.protobuf.Duration graceful_decommission_timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setGracefulDecommissionTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->graceful_decommission_timeout = $var; + + return $this; + } + +} + diff --git a/Dataproc/src/V1/SparkJob.php b/Dataproc/src/V1/SparkJob.php index ba573d14aa02..7eb838a10215 100644 --- a/Dataproc/src/V1/SparkJob.php +++ b/Dataproc/src/V1/SparkJob.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A Dataproc job for running [Apache Spark](http://spark.apache.org/) + * A Dataproc job for running [Apache Spark](https://spark.apache.org/) * applications on YARN. * * Generated from protobuf message google.cloud.dataproc.v1.SparkJob diff --git a/Dataproc/src/V1/SparkSqlJob.php b/Dataproc/src/V1/SparkSqlJob.php index 94d760deac88..2ed893d94092 100644 --- a/Dataproc/src/V1/SparkSqlJob.php +++ b/Dataproc/src/V1/SparkSqlJob.php @@ -10,7 +10,7 @@ /** * A Dataproc job for running [Apache Spark - * SQL](http://spark.apache.org/sql/) queries. + * SQL](https://spark.apache.org/sql/) queries. * * Generated from protobuf message google.cloud.dataproc.v1.SparkSqlJob */ diff --git a/Dataproc/src/V1/StartClusterRequest.php b/Dataproc/src/V1/StartClusterRequest.php index 25e5844cd57a..9ae57597980c 100644 --- a/Dataproc/src/V1/StartClusterRequest.php +++ b/Dataproc/src/V1/StartClusterRequest.php @@ -46,8 +46,8 @@ class StartClusterRequest extends \Google\Protobuf\Internal\Message * receives two * [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * Recommendation: Set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -78,8 +78,8 @@ class StartClusterRequest extends \Google\Protobuf\Internal\Message * receives two * [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * Recommendation: Set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -204,8 +204,8 @@ public function setClusterUuid($var) * receives two * [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * Recommendation: Set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -224,8 +224,8 @@ public function getRequestId() * receives two * [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * Recommendation: Set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), diff --git a/Dataproc/src/V1/StopClusterRequest.php b/Dataproc/src/V1/StopClusterRequest.php index 85d52327b78b..fa4d305a2633 100644 --- a/Dataproc/src/V1/StopClusterRequest.php +++ b/Dataproc/src/V1/StopClusterRequest.php @@ -46,8 +46,8 @@ class StopClusterRequest extends \Google\Protobuf\Internal\Message * receives two * [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * Recommendation: Set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -78,8 +78,8 @@ class StopClusterRequest extends \Google\Protobuf\Internal\Message * receives two * [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * Recommendation: Set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -204,8 +204,8 @@ public function setClusterUuid($var) * receives two * [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * Recommendation: Set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -224,8 +224,8 @@ public function getRequestId() * receives two * [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * Recommendation: Set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), diff --git a/Dataproc/src/V1/UpdateClusterRequest.php b/Dataproc/src/V1/UpdateClusterRequest.php index c461fb3e50a4..dead99971673 100644 --- a/Dataproc/src/V1/UpdateClusterRequest.php +++ b/Dataproc/src/V1/UpdateClusterRequest.php @@ -111,8 +111,8 @@ class UpdateClusterRequest extends \Google\Protobuf\Internal\Message * receives two * [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -200,8 +200,8 @@ class UpdateClusterRequest extends \Google\Protobuf\Internal\Message * receives two * [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -514,8 +514,8 @@ public function setUpdateMask($var) * receives two * [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), @@ -534,8 +534,8 @@ public function getRequestId() * receives two * [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s * with the same id, then the second request will be ignored and the - * first [google.longrunning.Operation][google.longrunning.Operation] created and stored in the - * backend is returned. + * first [google.longrunning.Operation][google.longrunning.Operation] created + * and stored in the backend is returned. * It is recommended to always set this value to a * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). * The ID must contain only letters (a-z, A-Z), numbers (0-9), diff --git a/Dataproc/src/V1/VirtualClusterConfig.php b/Dataproc/src/V1/VirtualClusterConfig.php index efe136167966..a30cabffe580 100644 --- a/Dataproc/src/V1/VirtualClusterConfig.php +++ b/Dataproc/src/V1/VirtualClusterConfig.php @@ -9,16 +9,16 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Dataproc cluster config for a cluster that does not directly control the + * The Dataproc cluster config for a cluster that does not directly control the * underlying compute resources, such as a [Dataproc-on-GKE - * cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster). + * cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke). * * Generated from protobuf message google.cloud.dataproc.v1.VirtualClusterConfig */ class VirtualClusterConfig extends \Google\Protobuf\Internal\Message { /** - * Optional. A Storage bucket used to stage job + * Optional. A Cloud Storage bucket used to stage job * dependencies, config files, and job driver console output. * If you do not specify a staging bucket, Cloud * Dataproc will determine a Cloud Storage location (US, @@ -48,7 +48,7 @@ class VirtualClusterConfig extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $staging_bucket - * Optional. A Storage bucket used to stage job + * Optional. A Cloud Storage bucket used to stage job * dependencies, config files, and job driver console output. * If you do not specify a staging bucket, Cloud * Dataproc will determine a Cloud Storage location (US, @@ -60,7 +60,8 @@ class VirtualClusterConfig extends \Google\Protobuf\Internal\Message * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to * a Cloud Storage bucket.** * @type \Google\Cloud\Dataproc\V1\KubernetesClusterConfig $kubernetes_cluster_config - * Required. The configuration for running the Dataproc cluster on Kubernetes. + * Required. The configuration for running the Dataproc cluster on + * Kubernetes. * @type \Google\Cloud\Dataproc\V1\AuxiliaryServicesConfig $auxiliary_services_config * Optional. Configuration of auxiliary services used by this cluster. * } @@ -71,7 +72,7 @@ public function __construct($data = NULL) { } /** - * Optional. A Storage bucket used to stage job + * Optional. A Cloud Storage bucket used to stage job * dependencies, config files, and job driver console output. * If you do not specify a staging bucket, Cloud * Dataproc will determine a Cloud Storage location (US, @@ -92,7 +93,7 @@ public function getStagingBucket() } /** - * Optional. A Storage bucket used to stage job + * Optional. A Cloud Storage bucket used to stage job * dependencies, config files, and job driver console output. * If you do not specify a staging bucket, Cloud * Dataproc will determine a Cloud Storage location (US, @@ -117,7 +118,8 @@ public function setStagingBucket($var) } /** - * Required. The configuration for running the Dataproc cluster on Kubernetes. + * Required. The configuration for running the Dataproc cluster on + * Kubernetes. * * Generated from protobuf field .google.cloud.dataproc.v1.KubernetesClusterConfig kubernetes_cluster_config = 6 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Cloud\Dataproc\V1\KubernetesClusterConfig|null @@ -133,7 +135,8 @@ public function hasKubernetesClusterConfig() } /** - * Required. The configuration for running the Dataproc cluster on Kubernetes. + * Required. The configuration for running the Dataproc cluster on + * Kubernetes. * * Generated from protobuf field .google.cloud.dataproc.v1.KubernetesClusterConfig kubernetes_cluster_config = 6 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Cloud\Dataproc\V1\KubernetesClusterConfig $var diff --git a/Dataproc/src/V1/gapic_metadata.json b/Dataproc/src/V1/gapic_metadata.json index 0c58f68a88ea..ae71cfb4a8c8 100644 --- a/Dataproc/src/V1/gapic_metadata.json +++ b/Dataproc/src/V1/gapic_metadata.json @@ -204,6 +204,30 @@ } } } + }, + "NodeGroupController": { + "clients": { + "grpc": { + "libraryClient": "NodeGroupControllerGapicClient", + "rpcs": { + "CreateNodeGroup": { + "methods": [ + "createNodeGroup" + ] + }, + "GetNodeGroup": { + "methods": [ + "getNodeGroup" + ] + }, + "ResizeNodeGroup": { + "methods": [ + "resizeNodeGroup" + ] + } + } + } + } } } } \ No newline at end of file diff --git a/Dataproc/src/V1/resources/node_group_controller_client_config.json b/Dataproc/src/V1/resources/node_group_controller_client_config.json new file mode 100644 index 000000000000..3024a015dd76 --- /dev/null +++ b/Dataproc/src/V1/resources/node_group_controller_client_config.json @@ -0,0 +1,37 @@ +{ + "interfaces": { + "google.cloud.dataproc.v1.NodeGroupController": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateNodeGroup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetNodeGroup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ResizeNodeGroup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/Dataproc/src/V1/resources/node_group_controller_descriptor_config.php b/Dataproc/src/V1/resources/node_group_controller_descriptor_config.php new file mode 100644 index 000000000000..d021bf861c32 --- /dev/null +++ b/Dataproc/src/V1/resources/node_group_controller_descriptor_config.php @@ -0,0 +1,28 @@ + [ + 'google.cloud.dataproc.v1.NodeGroupController' => [ + 'CreateNodeGroup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dataproc\V1\NodeGroup', + 'metadataReturnType' => '\Google\Cloud\Dataproc\V1\NodeGroupOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ResizeNodeGroup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dataproc\V1\NodeGroup', + 'metadataReturnType' => '\Google\Cloud\Dataproc\V1\NodeGroupOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + ], + ], +]; diff --git a/Dataproc/src/V1/resources/node_group_controller_rest_client_config.php b/Dataproc/src/V1/resources/node_group_controller_rest_client_config.php new file mode 100644 index 000000000000..5d3428dc9178 --- /dev/null +++ b/Dataproc/src/V1/resources/node_group_controller_rest_client_config.php @@ -0,0 +1,223 @@ + [ + 'google.cloud.dataproc.v1.NodeGroupController' => [ + 'CreateNodeGroup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/regions/*/clusters/*}/nodeGroups', + 'body' => 'node_group', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetNodeGroup' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ResizeNodeGroup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}:resize', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/regions/*/operations/*}:cancel', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/regions/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/regions/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/regions/*/operations}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/Dataproc/tests/Unit/V1/NodeGroupControllerClientTest.php b/Dataproc/tests/Unit/V1/NodeGroupControllerClientTest.php new file mode 100644 index 000000000000..f0ff56cc237e --- /dev/null +++ b/Dataproc/tests/Unit/V1/NodeGroupControllerClientTest.php @@ -0,0 +1,375 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NodeGroupControllerClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NodeGroupControllerClient($options); + } + + /** @test */ + public function createNodeGroupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createNodeGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new NodeGroup(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createNodeGroupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->clusterRegionName('[PROJECT]', '[REGION]', '[CLUSTER]'); + $nodeGroup = new NodeGroup(); + $nodeGroupRoles = []; + $nodeGroup->setRoles($nodeGroupRoles); + $response = $gapicClient->createNodeGroup($formattedParent, $nodeGroup); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dataproc.v1.NodeGroupController/CreateNodeGroup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createNodeGroupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createNodeGroupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createNodeGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->clusterRegionName('[PROJECT]', '[REGION]', '[CLUSTER]'); + $nodeGroup = new NodeGroup(); + $nodeGroupRoles = []; + $nodeGroup->setRoles($nodeGroupRoles); + $response = $gapicClient->createNodeGroup($formattedParent, $nodeGroup); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createNodeGroupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getNodeGroupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new NodeGroup(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->nodeGroupName('[PROJECT]', '[REGION]', '[CLUSTER]', '[NODE_GROUP]'); + $response = $gapicClient->getNodeGroup($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dataproc.v1.NodeGroupController/GetNodeGroup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNodeGroupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->nodeGroupName('[PROJECT]', '[REGION]', '[CLUSTER]', '[NODE_GROUP]'); + try { + $gapicClient->getNodeGroup($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resizeNodeGroupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/resizeNodeGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $expectedResponse = new NodeGroup(); + $expectedResponse->setName($name2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/resizeNodeGroupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $size = 3530753; + $response = $gapicClient->resizeNodeGroup($name, $size); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dataproc.v1.NodeGroupController/ResizeNodeGroup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualApiRequestObject->getSize(); + $this->assertProtobufEquals($size, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/resizeNodeGroupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function resizeNodeGroupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/resizeNodeGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $size = 3530753; + $response = $gapicClient->resizeNodeGroup($name, $size); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/resizeNodeGroupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +}