From 80e284d18d1e1c5de4348ca0ad909cadb3dbf77c Mon Sep 17 00:00:00 2001 From: Vishwaraj Anand Date: Wed, 30 Mar 2022 09:28:12 +0000 Subject: [PATCH 1/9] Added new operators and unit tests --- Datastore/src/Query/Query.php | 11 +++++++++- Datastore/tests/Unit/Query/QueryTest.php | 27 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Datastore/src/Query/Query.php b/Datastore/src/Query/Query.php index 8b7fe70ebc7a..baa65aec6a92 100644 --- a/Datastore/src/Query/Query.php +++ b/Datastore/src/Query/Query.php @@ -83,6 +83,9 @@ class Query implements QueryInterface const OP_GREATER_THAN = 'GREATER_THAN'; const OP_GREATER_THAN_OR_EQUAL = 'GREATER_THAN_OR_EQUAL'; const OP_EQUALS = 'EQUAL'; + const OP_NOT_EQUALS = 'NOT_EQUAL'; + const OP_IN = 'IN'; + const OP_NOT_IN = 'NOT_IN'; const OP_HAS_ANCESTOR = 'HAS_ANCESTOR'; const ORDER_DEFAULT = self::ORDER_ASCENDING; @@ -99,6 +102,9 @@ class Query implements QueryInterface self::OP_GREATER_THAN_OR_EQUAL, self::OP_EQUALS, self::OP_HAS_ANCESTOR, + self::OP_NOT_EQUALS, + self::OP_IN, + self::OP_NOT_IN, ]; /** @@ -109,7 +115,10 @@ class Query implements QueryInterface '<=' => self::OP_LESS_THAN_OR_EQUAL, '>' => self::OP_GREATER_THAN, '>=' => self::OP_GREATER_THAN_OR_EQUAL, - '=' => self::OP_EQUALS + '=' => self::OP_EQUALS, + '!=' => self::OP_NOT_EQUALS, + 'IN' => self::OP_IN, + 'NOT_IN' => self::OP_NOT_IN, ]; /** diff --git a/Datastore/tests/Unit/Query/QueryTest.php b/Datastore/tests/Unit/Query/QueryTest.php index ba7585980546..e83aa09a2db2 100644 --- a/Datastore/tests/Unit/Query/QueryTest.php +++ b/Datastore/tests/Unit/Query/QueryTest.php @@ -214,6 +214,33 @@ public function testOperatorConstantsEquals() $this->assertEquals('EQUAL', $filters[0]['propertyFilter']['op']); } + public function testOperatorConstantsNotEquals() + { + $this->query->filter('propName', Query::OP_NOT_EQUALS, 'val'); + $res = $this->query->queryObject(); + + $filters = $res['filter']['compositeFilter']['filters']; + $this->assertEquals('NOT_EQUAL', $filters[0]['propertyFilter']['op']); + } + + public function testOperatorConstantsIn() + { + $this->query->filter('propName', Query::OP_IN, 'val'); + $res = $this->query->queryObject(); + + $filters = $res['filter']['compositeFilter']['filters']; + $this->assertEquals('IN', $filters[0]['propertyFilter']['op']); + } + + public function testOperatorConstantsNotIn() + { + $this->query->filter('propName', Query::OP_NOT_IN, 'val'); + $res = $this->query->queryObject(); + + $filters = $res['filter']['compositeFilter']['filters']; + $this->assertEquals('NOT_IN', $filters[0]['propertyFilter']['op']); + } + public function testOperatorConstantsHasAncestor() { $this->query->filter('propName', Query::OP_HAS_ANCESTOR, 'val'); From 76fb88c0db240aabf53220ed9cea28e631328bc0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 10:01:31 -0700 Subject: [PATCH 2/9] fix: [PubSub] removing misspelled field, add correctly spelled field (#5115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix!: removing misspelled field, add correctly spelled field PiperOrigin-RevId: 428023165 Source-Link: https://github.com/googleapis/googleapis/commit/63d374da58fba5cf1308cf1df74b0b2afa1454f1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6be9b6c6b6c85face18adbdbdd3fc06356810b4a Copy-Tag: eyJwIjoiUHViU3ViLy5Pd2xCb3QueWFtbCIsImgiOiI2YmU5YjZjNmI2Yzg1ZmFjZTE4YWRiZGJkZDNmYzA2MzU2ODEwYjRhIn0= * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- PubSub/metadata/V1/Pubsub.php | Bin 12789 -> 12796 bytes PubSub/src/V1/StreamingPullResponse.php | 26 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/PubSub/metadata/V1/Pubsub.php b/PubSub/metadata/V1/Pubsub.php index b985d88957a1e9508e3820ef424cbf4d7d66775c..6b21981baa88112ccb22909fbeb468a55b17fb7e 100644 GIT binary patch delta 81 zcmeyG{3m(CS!Tvto6j)|iZX7R{6HdHIgv{uF*!RgzdR>3B|SAhIX^EgvnV&QBr`ux lf>nW0gWJe{a-gp8WP2&m&5e@WOl)2(983btn|q`)#Q^&D8jk<~ delta 83 zcmV-Z0IdJ~WA$UO%>x0`v(5t%6#=W0;22jTU.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowlege_confirmation = 2; + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; */ - private $acknowlege_confirmation = null; + private $acknowledge_confirmation = null; /** * This field will only be set if `enable_exactly_once_delivery` is set to * `true`. @@ -51,7 +51,7 @@ class StreamingPullResponse extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\PubSub\V1\ReceivedMessage[]|\Google\Protobuf\Internal\RepeatedField $received_messages * Received Pub/Sub messages. This will not be empty. - * @type \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation $acknowlege_confirmation + * @type \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation $acknowledge_confirmation * This field will only be set if `enable_exactly_once_delivery` is set to * `true`. * @type \Google\Cloud\PubSub\V1\StreamingPullResponse\ModifyAckDeadlineConfirmation $modify_ack_deadline_confirmation @@ -96,36 +96,36 @@ public function setReceivedMessages($var) * This field will only be set if `enable_exactly_once_delivery` is set to * `true`. * - * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowlege_confirmation = 2; + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; * @return \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation|null */ - public function getAcknowlegeConfirmation() + public function getAcknowledgeConfirmation() { - return $this->acknowlege_confirmation; + return $this->acknowledge_confirmation; } - public function hasAcknowlegeConfirmation() + public function hasAcknowledgeConfirmation() { - return isset($this->acknowlege_confirmation); + return isset($this->acknowledge_confirmation); } - public function clearAcknowlegeConfirmation() + public function clearAcknowledgeConfirmation() { - unset($this->acknowlege_confirmation); + unset($this->acknowledge_confirmation); } /** * This field will only be set if `enable_exactly_once_delivery` is set to * `true`. * - * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowlege_confirmation = 2; + * Generated from protobuf field .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; * @param \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation $var * @return $this */ - public function setAcknowlegeConfirmation($var) + public function setAcknowledgeConfirmation($var) { GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\StreamingPullResponse\AcknowledgeConfirmation::class); - $this->acknowlege_confirmation = $var; + $this->acknowledge_confirmation = $var; return $this; } From 28ae794eb63af8c002b2059ddf8a6c555001b3a3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 10:36:33 -0700 Subject: [PATCH 3/9] fix: [CertificateManager] Updated resource patterns to comply with https://google.aip.dev/123#annotating-resource-types (#5199) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix!: Updated resource patterns to comply with https://google.aip.dev/123#annotating-resource-types PiperOrigin-RevId: 438230444 Source-Link: https://github.com/googleapis/googleapis/commit/1821985de2cfa4d05590abd0bdf4fef2fde22480 Source-Link: https://github.com/googleapis/googleapis-gen/commit/30cb53f99d252b366aa837b38cf9d1f8b283ec4a Copy-Tag: eyJwIjoiQ2VydGlmaWNhdGVNYW5hZ2VyLy5Pd2xCb3QueWFtbCIsImgiOiIzMGNiNTNmOTlkMjUyYjM2NmFhODM3YjM4Y2Y5ZDFmOGIyODNlYzRhIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../metadata/V1/CertificateManager.php | Bin 15417 -> 15421 bytes CertificateManager/src/V1/Certificate.php | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CertificateManager/metadata/V1/CertificateManager.php b/CertificateManager/metadata/V1/CertificateManager.php index b96ee3c4f02090ac8455f8fbe39b1fed88727045..cdf10e409c8af874f0e2aa542dc8e4a6f9258212 100644 GIT binary patch delta 107 zcmdm4vA1HwEM~^bn`blon6WpraH%Ed=T6=zp*&g8>IGxXNm7fgO` G9RvVktS8?9 delta 86 zcmdm6v9n^sEM~^@n`blon6dw7=2A<}&z-zcLV2>F)eFX|$-k_07=0(l%WF*bx0d4b qC@Co@4k*g6sH}bESTb2(PHS?kycST3ZSrMnA(r6coPf!%t%CreQy@tI diff --git a/CertificateManager/src/V1/Certificate.php b/CertificateManager/src/V1/Certificate.php index 36e00eaa2dec..9a0e5961ca84 100644 --- a/CertificateManager/src/V1/Certificate.php +++ b/CertificateManager/src/V1/Certificate.php @@ -48,7 +48,9 @@ class Certificate extends \Google\Protobuf\Internal\Message private $labels; /** * Output only. The list of Subject Alternative Names of dnsName type defined in the - * certificate (see RFC 5280 4.2.1.6) + * certificate (see RFC 5280 4.2.1.6). + * Managed certificates that haven't been provisioned yet have this field + * populated with a value of the managed.domains field. * * Generated from protobuf field repeated string san_dnsnames = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -96,7 +98,9 @@ class Certificate extends \Google\Protobuf\Internal\Message * If set, contains configuration and state of a managed certificate. * @type string[]|\Google\Protobuf\Internal\RepeatedField $san_dnsnames * Output only. The list of Subject Alternative Names of dnsName type defined in the - * certificate (see RFC 5280 4.2.1.6) + * certificate (see RFC 5280 4.2.1.6). + * Managed certificates that haven't been provisioned yet have this field + * populated with a value of the managed.domains field. * @type string $pem_certificate * Output only. The PEM-encoded certificate chain. * @type \Google\Protobuf\Timestamp $expire_time @@ -326,7 +330,9 @@ public function setManaged($var) /** * Output only. The list of Subject Alternative Names of dnsName type defined in the - * certificate (see RFC 5280 4.2.1.6) + * certificate (see RFC 5280 4.2.1.6). + * Managed certificates that haven't been provisioned yet have this field + * populated with a value of the managed.domains field. * * Generated from protobuf field repeated string san_dnsnames = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Protobuf\Internal\RepeatedField @@ -338,7 +344,9 @@ public function getSanDnsnames() /** * Output only. The list of Subject Alternative Names of dnsName type defined in the - * certificate (see RFC 5280 4.2.1.6) + * certificate (see RFC 5280 4.2.1.6). + * Managed certificates that haven't been provisioned yet have this field + * populated with a value of the managed.domains field. * * Generated from protobuf field repeated string san_dnsnames = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string[]|\Google\Protobuf\Internal\RepeatedField $var From 594a33593c8f10e03f2cab4f06f5f04c3e136a6d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 10:40:24 -0700 Subject: [PATCH 4/9] feat: [DataprocMetastore] Added DatabaseType field for the type of backing store used (#5162) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Added DatabaseType field for the type of backing store used feat: Added AVRO DatabaseDumpSpec for importing and exporting Avro files feat: Added additional endTime field for MetadataImports feat: Added RESTORING status on Backups feat: Added support to record the services that are restoring the backup feat: Added configuration for Dataplex integration feat: Added support for IAM management for metadata resources feat: Added AuxiliaryVersionConfig for configuring the auxiliary hive versions during creation or update of the DPMS instance feat: Added NetworkConfig for exposing the DPMS endpoint in multiple subnetworks using PSC (this skips the need for VPC peering) feat: Added EncryptionConfig which contains information used to configure the Dataproc Metastore service to encrypt customer data at rest (CMEK) docs: formatting improvements PiperOrigin-RevId: 436271267 Source-Link: https://github.com/googleapis/googleapis/commit/463cacaf4733629b8a37803796777856013c27fc Source-Link: https://github.com/googleapis/googleapis-gen/commit/e1cd57321c6bc6ee599c1cb3b831794598048a6f Copy-Tag: eyJwIjoiRGF0YXByb2NNZXRhc3RvcmUvLk93bEJvdC55YW1sIiwiaCI6ImUxY2Q1NzMyMWM2YmM2ZWU1OTljMWNiM2I4MzE3OTQ1OTgwNDhhNmYifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../metadata/V1Alpha/Metastore.php | Bin 13001 -> 14899 bytes .../src/V1alpha/AuxiliaryVersionConfig.php | 169 ++++++++++++++++++ DataprocMetastore/src/V1alpha/Backup.php | 34 ++++ .../src/V1alpha/Backup/State.php | 7 + .../src/V1alpha/CreateBackupRequest.php | 8 +- .../V1alpha/CreateMetadataImportRequest.php | 8 +- .../src/V1alpha/DatabaseDumpSpec/Type.php | 7 + .../src/V1alpha/DataplexConfig.php | 76 ++++++++ .../V1alpha/DataprocMetastoreGrpcClient.php | 6 +- .../src/V1alpha/EncryptionConfig.php | 75 ++++++++ .../src/V1alpha/ExportMetadataRequest.php | 8 +- .../Gapic/DataprocMetastoreGapicClient.php | 16 +- .../src/V1alpha/HiveMetastoreConfig.php | 116 +++++++++++- .../HiveMetastoreConfig/EndpointProtocol.php | 64 +++++++ .../HiveMetastoreConfig_EndpointProtocol.php | 16 ++ .../src/V1alpha/KerberosConfig.php | 8 +- DataprocMetastore/src/V1alpha/Lake.php | 75 ++++++++ .../src/V1alpha/MetadataImport.php | 52 +++++- .../src/V1alpha/MetadataIntegration.php | 44 +++++ .../src/V1alpha/NetworkConfig.php | 71 ++++++++ .../src/V1alpha/NetworkConfig/Consumer.php | 130 ++++++++++++++ .../src/V1alpha/NetworkConfig_Consumer.php | 16 ++ DataprocMetastore/src/V1alpha/Restore.php | 8 +- .../src/V1alpha/Restore/RestoreType.php | 2 +- .../src/V1alpha/RestoreServiceRequest.php | 16 +- DataprocMetastore/src/V1alpha/Service.php | 138 ++++++++++++++ .../src/V1alpha/Service/DatabaseType.php | 64 +++++++ .../src/V1alpha/Service_DatabaseType.php | 16 ++ .../dataproc_metastore_descriptor_config.php | 54 +++--- .../dataproc_metastore_rest_client_config.php | 48 +++++ 30 files changed, 1277 insertions(+), 75 deletions(-) create mode 100644 DataprocMetastore/src/V1alpha/AuxiliaryVersionConfig.php create mode 100644 DataprocMetastore/src/V1alpha/DataplexConfig.php create mode 100644 DataprocMetastore/src/V1alpha/EncryptionConfig.php create mode 100644 DataprocMetastore/src/V1alpha/HiveMetastoreConfig/EndpointProtocol.php create mode 100644 DataprocMetastore/src/V1alpha/HiveMetastoreConfig_EndpointProtocol.php create mode 100644 DataprocMetastore/src/V1alpha/Lake.php create mode 100644 DataprocMetastore/src/V1alpha/NetworkConfig.php create mode 100644 DataprocMetastore/src/V1alpha/NetworkConfig/Consumer.php create mode 100644 DataprocMetastore/src/V1alpha/NetworkConfig_Consumer.php create mode 100644 DataprocMetastore/src/V1alpha/Service/DatabaseType.php create mode 100644 DataprocMetastore/src/V1alpha/Service_DatabaseType.php diff --git a/DataprocMetastore/metadata/V1Alpha/Metastore.php b/DataprocMetastore/metadata/V1Alpha/Metastore.php index 9b198732f162dae90fd7adac0cc523164791d959..bf83dbd860aba2ec2d5fee6c09d046b64d87818f 100644 GIT binary patch delta 1425 zcmaJ>O>Y}j6lG>Sb$tEFbJ92gw}~BsrMBb7txBlEV(geSNwFQr1Ql6~rju7=c|0?k zk5DVBx?;rw!7CDC1**iVLP7omtU$10!Gb00h!x8&5cB3E!MI}OnRm~*bKbf4_-8z} zPyXT}rvnf^+ZDzukyjY@i{x13Pq;j4!OK`v%#mUDbxl%q?Lohnn_Xf`@yd0wc44Vp zKdaWfVwL+tgJ?2&?Zvj`Gn7wg?a#K1qk#2knB9{t9{uVNk`bU+|gS(-ZNk)I?+dyzm>k>Fe--(3BTf#gI9H6W(A<8X$q>A_O^woSkUSFMNf;<#wROn87c z04(Re=0`BttJUXX5thmI%KWYUv)Y}P&;lgR7RWLCIjT5DTXNMDB#sOv3+O85R;ulX4yXr2iV5&d}I5uu@nf ze-~c|I(6}&-ORA#*H%7Gvd=j3Z0+&NFYKi)FErh5P1T*lZucE*%TxjGb`REM)%Z{* zS1Nn_sVMt~B+d;%8)Of%cTL=*fhZsQ50A>{cDje>FON>e&i{uM-EplZOl^ld%nS0+0feCl1(?Xc9S-z!0UAcoVMz;Rd5A6akZ87zwjw6#@hT>I1WB z86*J$B2tsE8d9?n8(9w)I|>j)VRT_)VRL0fb!~7{aAjj6Tql!%DkrnBDuoRP&;be} gV{dJfF$N!#TR2+<>OoEl9+NOR7nAllHIwE!P2$5l4*&oF diff --git a/DataprocMetastore/src/V1alpha/AuxiliaryVersionConfig.php b/DataprocMetastore/src/V1alpha/AuxiliaryVersionConfig.php new file mode 100644 index 000000000000..26d59c62321c --- /dev/null +++ b/DataprocMetastore/src/V1alpha/AuxiliaryVersionConfig.php @@ -0,0 +1,169 @@ +google.cloud.metastore.v1alpha.AuxiliaryVersionConfig + */ +class AuxiliaryVersionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The Hive metastore version of the auxiliary service. It must be less + * than the primary Hive metastore service's version. + * + * Generated from protobuf field string version = 1; + */ + private $version = ''; + /** + * A mapping of Hive metastore configuration key-value pairs to apply to the + * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to + * the primary version's overrides. If keys are present in both the auxiliary + * version's overrides and the primary version's overrides, the value from + * the auxiliary version's overrides takes precedence. + * + * Generated from protobuf field map config_overrides = 2; + */ + private $config_overrides; + /** + * Output only. The network configuration contains the endpoint URI(s) of the auxiliary + * Hive metastore service. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $network_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $version + * The Hive metastore version of the auxiliary service. It must be less + * than the primary Hive metastore service's version. + * @type array|\Google\Protobuf\Internal\MapField $config_overrides + * A mapping of Hive metastore configuration key-value pairs to apply to the + * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to + * the primary version's overrides. If keys are present in both the auxiliary + * version's overrides and the primary version's overrides, the value from + * the auxiliary version's overrides takes precedence. + * @type \Google\Cloud\Metastore\V1alpha\NetworkConfig $network_config + * Output only. The network configuration contains the endpoint URI(s) of the auxiliary + * Hive metastore service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); + parent::__construct($data); + } + + /** + * The Hive metastore version of the auxiliary service. It must be less + * than the primary Hive metastore service's version. + * + * Generated from protobuf field string version = 1; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The Hive metastore version of the auxiliary service. It must be less + * than the primary Hive metastore service's version. + * + * Generated from protobuf field string version = 1; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * A mapping of Hive metastore configuration key-value pairs to apply to the + * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to + * the primary version's overrides. If keys are present in both the auxiliary + * version's overrides and the primary version's overrides, the value from + * the auxiliary version's overrides takes precedence. + * + * Generated from protobuf field map config_overrides = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getConfigOverrides() + { + return $this->config_overrides; + } + + /** + * A mapping of Hive metastore configuration key-value pairs to apply to the + * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to + * the primary version's overrides. If keys are present in both the auxiliary + * version's overrides and the primary version's overrides, the value from + * the auxiliary version's overrides takes precedence. + * + * Generated from protobuf field map config_overrides = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setConfigOverrides($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->config_overrides = $arr; + + return $this; + } + + /** + * Output only. The network configuration contains the endpoint URI(s) of the auxiliary + * Hive metastore service. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Metastore\V1alpha\NetworkConfig|null + */ + public function getNetworkConfig() + { + return $this->network_config; + } + + public function hasNetworkConfig() + { + return isset($this->network_config); + } + + public function clearNetworkConfig() + { + unset($this->network_config); + } + + /** + * Output only. The network configuration contains the endpoint URI(s) of the auxiliary + * Hive metastore service. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Metastore\V1alpha\NetworkConfig $var + * @return $this + */ + public function setNetworkConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\NetworkConfig::class); + $this->network_config = $var; + + return $this; + } + +} + diff --git a/DataprocMetastore/src/V1alpha/Backup.php b/DataprocMetastore/src/V1alpha/Backup.php index c877bda26bc0..d69c5d9e04eb 100644 --- a/DataprocMetastore/src/V1alpha/Backup.php +++ b/DataprocMetastore/src/V1alpha/Backup.php @@ -52,6 +52,12 @@ class Backup extends \Google\Protobuf\Internal\Message * Generated from protobuf field string description = 6; */ private $description = ''; + /** + * Output only. Services that are restoring from the backup. + * + * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $restoring_services; /** * Constructor. @@ -72,6 +78,8 @@ class Backup extends \Google\Protobuf\Internal\Message * Output only. The revision of the service at the time of backup. * @type string $description * The description of the backup. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $restoring_services + * Output only. Services that are restoring from the backup. * } */ public function __construct($data = NULL) { @@ -267,5 +275,31 @@ public function setDescription($var) return $this; } + /** + * Output only. Services that are restoring from the backup. + * + * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRestoringServices() + { + return $this->restoring_services; + } + + /** + * Output only. Services that are restoring from the backup. + * + * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRestoringServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->restoring_services = $arr; + + return $this; + } + } diff --git a/DataprocMetastore/src/V1alpha/Backup/State.php b/DataprocMetastore/src/V1alpha/Backup/State.php index 9259ff4912ad..d5770f420c45 100644 --- a/DataprocMetastore/src/V1alpha/Backup/State.php +++ b/DataprocMetastore/src/V1alpha/Backup/State.php @@ -43,6 +43,12 @@ class State * Generated from protobuf enum FAILED = 4; */ const FAILED = 4; + /** + * The backup is being restored. + * + * Generated from protobuf enum RESTORING = 5; + */ + const RESTORING = 5; private static $valueToName = [ self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', @@ -50,6 +56,7 @@ class State self::DELETING => 'DELETING', self::ACTIVE => 'ACTIVE', self::FAILED => 'FAILED', + self::RESTORING => 'RESTORING', ]; public static function name($value) diff --git a/DataprocMetastore/src/V1alpha/CreateBackupRequest.php b/DataprocMetastore/src/V1alpha/CreateBackupRequest.php index 9f0190b915f8..edf1dde8cf99 100644 --- a/DataprocMetastore/src/V1alpha/CreateBackupRequest.php +++ b/DataprocMetastore/src/V1alpha/CreateBackupRequest.php @@ -18,7 +18,7 @@ class CreateBackupRequest extends \Google\Protobuf\Internal\Message /** * Required. The relative resource name of the service in which to create a backup * of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}` + * `projects/{project_number}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -65,7 +65,7 @@ class CreateBackupRequest extends \Google\Protobuf\Internal\Message * @type string $parent * Required. The relative resource name of the service in which to create a backup * of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}` + * `projects/{project_number}/locations/{location_id}/services/{service_id}`. * @type string $backup_id * Required. The ID of the backup, which is used as the final component of the * backup's name. @@ -96,7 +96,7 @@ public function __construct($data = NULL) { /** * Required. The relative resource name of the service in which to create a backup * of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}` + * `projects/{project_number}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -109,7 +109,7 @@ public function getParent() /** * Required. The relative resource name of the service in which to create a backup * of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}` + * `projects/{project_number}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DataprocMetastore/src/V1alpha/CreateMetadataImportRequest.php b/DataprocMetastore/src/V1alpha/CreateMetadataImportRequest.php index de483bdc7f65..befe3f56c5f9 100644 --- a/DataprocMetastore/src/V1alpha/CreateMetadataImportRequest.php +++ b/DataprocMetastore/src/V1alpha/CreateMetadataImportRequest.php @@ -18,7 +18,7 @@ class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message /** * Required. The relative resource name of the service in which to create a metastore * import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}` + * `projects/{project_number}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -66,7 +66,7 @@ class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message * @type string $parent * Required. The relative resource name of the service in which to create a metastore * import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}` + * `projects/{project_number}/locations/{location_id}/services/{service_id}`. * @type string $metadata_import_id * Required. The ID of the metadata import, which is used as the final component of the * metadata import's name. @@ -98,7 +98,7 @@ public function __construct($data = NULL) { /** * Required. The relative resource name of the service in which to create a metastore * import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}` + * `projects/{project_number}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -111,7 +111,7 @@ public function getParent() /** * Required. The relative resource name of the service in which to create a metastore * import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}` + * `projects/{project_number}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec/Type.php b/DataprocMetastore/src/V1alpha/DatabaseDumpSpec/Type.php index 021712d3d97e..290359f1c193 100644 --- a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec/Type.php +++ b/DataprocMetastore/src/V1alpha/DatabaseDumpSpec/Type.php @@ -25,10 +25,17 @@ class Type * Generated from protobuf enum MYSQL = 1; */ const MYSQL = 1; + /** + * Database dump contains Avro files. + * + * Generated from protobuf enum AVRO = 2; + */ + const AVRO = 2; private static $valueToName = [ self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', self::MYSQL => 'MYSQL', + self::AVRO => 'AVRO', ]; public static function name($value) diff --git a/DataprocMetastore/src/V1alpha/DataplexConfig.php b/DataprocMetastore/src/V1alpha/DataplexConfig.php new file mode 100644 index 000000000000..0d5a00bd37c4 --- /dev/null +++ b/DataprocMetastore/src/V1alpha/DataplexConfig.php @@ -0,0 +1,76 @@ +google.cloud.metastore.v1alpha.DataplexConfig + */ +class DataplexConfig extends \Google\Protobuf\Internal\Message +{ + /** + * A reference to the Lake resources that this metastore service is attached + * to. The key is the lake resource name. Example: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * + * Generated from protobuf field map lake_resources = 1; + */ + private $lake_resources; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $lake_resources + * A reference to the Lake resources that this metastore service is attached + * to. The key is the lake resource name. Example: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); + parent::__construct($data); + } + + /** + * A reference to the Lake resources that this metastore service is attached + * to. The key is the lake resource name. Example: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * + * Generated from protobuf field map lake_resources = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLakeResources() + { + return $this->lake_resources; + } + + /** + * A reference to the Lake resources that this metastore service is attached + * to. The key is the lake resource name. Example: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * + * Generated from protobuf field map lake_resources = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLakeResources($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\Lake::class); + $this->lake_resources = $arr; + + return $this; + } + +} + diff --git a/DataprocMetastore/src/V1alpha/DataprocMetastoreGrpcClient.php b/DataprocMetastore/src/V1alpha/DataprocMetastoreGrpcClient.php index 967761d1bc34..f14c2b06272d 100644 --- a/DataprocMetastore/src/V1alpha/DataprocMetastoreGrpcClient.php +++ b/DataprocMetastore/src/V1alpha/DataprocMetastoreGrpcClient.php @@ -20,8 +20,8 @@ /** * Configures and manages metastore services. - * Metastore services are fully managed, highly available, auto-scaled, - * auto-healing, OSS-native deployments of technical metadata management + * Metastore services are fully managed, highly available, autoscaled, + * autohealing, OSS-native deployments of technical metadata management * software. Each metastore service exposes a network endpoint through which * metadata queries are served. Metadata queries can originate from a variety * of sources, including Apache Hive, Apache Presto, and Apache Spark. @@ -245,7 +245,7 @@ public function GetBackup(\Google\Cloud\Metastore\V1alpha\GetBackupRequest $argu } /** - * Creates a new Backup in a given project and location. + * Creates a new backup in a given project and location. * @param \Google\Cloud\Metastore\V1alpha\CreateBackupRequest $argument input argument * @param array $metadata metadata * @param array $options call options diff --git a/DataprocMetastore/src/V1alpha/EncryptionConfig.php b/DataprocMetastore/src/V1alpha/EncryptionConfig.php new file mode 100644 index 000000000000..5d796e484eb4 --- /dev/null +++ b/DataprocMetastore/src/V1alpha/EncryptionConfig.php @@ -0,0 +1,75 @@ +google.cloud.metastore.v1alpha.EncryptionConfig + */ +class EncryptionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified customer provided Cloud KMS key name to use for + * customer data encryption, in the following form: + * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. + * + * Generated from protobuf field string kms_key = 1; + */ + private $kms_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kms_key + * The fully qualified customer provided Cloud KMS key name to use for + * customer data encryption, in the following form: + * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified customer provided Cloud KMS key name to use for + * customer data encryption, in the following form: + * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. + * + * Generated from protobuf field string kms_key = 1; + * @return string + */ + public function getKmsKey() + { + return $this->kms_key; + } + + /** + * The fully qualified customer provided Cloud KMS key name to use for + * customer data encryption, in the following form: + * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. + * + * Generated from protobuf field string kms_key = 1; + * @param string $var + * @return $this + */ + public function setKmsKey($var) + { + GPBUtil::checkString($var, True); + $this->kms_key = $var; + + return $this; + } + +} + diff --git a/DataprocMetastore/src/V1alpha/ExportMetadataRequest.php b/DataprocMetastore/src/V1alpha/ExportMetadataRequest.php index 23e6c5ac8d24..8440ee4ffdc8 100644 --- a/DataprocMetastore/src/V1alpha/ExportMetadataRequest.php +++ b/DataprocMetastore/src/V1alpha/ExportMetadataRequest.php @@ -18,7 +18,7 @@ class ExportMetadataRequest extends \Google\Protobuf\Internal\Message /** * Required. The relative resource name of the metastore service to run export, in the * following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -59,7 +59,7 @@ class ExportMetadataRequest extends \Google\Protobuf\Internal\Message * @type string $service * Required. The relative resource name of the metastore service to run export, in the * following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}`. * @type string $request_id * Optional. A request ID. Specify a unique request ID to allow the server to ignore the * request if it has completed. The server will ignore subsequent requests @@ -118,7 +118,7 @@ public function setDestinationGcsFolder($var) /** * Required. The relative resource name of the metastore service to run export, in the * following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -131,7 +131,7 @@ public function getService() /** * Required. The relative resource name of the metastore service to run export, in the * following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreGapicClient.php b/DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreGapicClient.php index 5406d66d86eb..ba0821b59d0e 100644 --- a/DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreGapicClient.php +++ b/DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreGapicClient.php @@ -69,8 +69,8 @@ /** * Service Description: Configures and manages metastore services. - * Metastore services are fully managed, highly available, auto-scaled, - * auto-healing, OSS-native deployments of technical metadata management + * Metastore services are fully managed, highly available, autoscaled, + * autohealing, OSS-native deployments of technical metadata management * software. Each metastore service exposes a network endpoint through which * metadata queries are served. Metadata queries can originate from a variety * of sources, including Apache Hive, Apache Presto, and Apache Spark. @@ -509,7 +509,7 @@ public function __construct(array $options = []) } /** - * Creates a new Backup in a given project and location. + * Creates a new backup in a given project and location. * * Sample code: * ``` @@ -552,7 +552,7 @@ public function __construct(array $options = []) * @param string $parent Required. The relative resource name of the service in which to create a backup * of the following form: * - * `projects/{project_number}/locations/{location_id}/services/{service_id}` + * `projects/{project_number}/locations/{location_id}/services/{service_id}`. * @param string $backupId Required. The ID of the backup, which is used as the final component of the * backup's name. * @@ -651,7 +651,7 @@ public function createBackup($parent, $backupId, $backup, array $optionalArgs = * @param string $parent Required. The relative resource name of the service in which to create a metastore * import, in the following form: * - * `projects/{project_number}/locations/{location_id}/services/{service_id}` + * `projects/{project_number}/locations/{location_id}/services/{service_id}`. * @param string $metadataImportId Required. The ID of the metadata import, which is used as the final component of the * metadata import's name. * @@ -1019,7 +1019,7 @@ public function deleteService($name, array $optionalArgs = []) * @param string $service Required. The relative resource name of the metastore service to run export, in the * following form: * - * `projects/{project_id}/locations/{location_id}/services/{service_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}`. * @param array $optionalArgs { * Optional. * @@ -1521,11 +1521,11 @@ public function listServices($parent, array $optionalArgs = []) * @param string $service Required. The relative resource name of the metastore service to run restore, in the * following form: * - * `projects/{project_id}/locations/{location_id}/services/{service_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}`. * @param string $backup Required. The relative resource name of the metastore service backup to restore * from, in the following form: * - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. * @param array $optionalArgs { * Optional. * diff --git a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig.php b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig.php index bf8ceec2a074..ce72c2d916b6 100644 --- a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig.php +++ b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig.php @@ -25,7 +25,9 @@ class HiveMetastoreConfig extends \Google\Protobuf\Internal\Message /** * A mapping of Hive metastore configuration key-value pairs to apply to the * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). + * override system defaults (some keys cannot be overridden). These + * overrides are also applied to auxiliary versions and can be further + * customized in the auxiliary version's `AuxiliaryVersionConfig`. * * Generated from protobuf field map config_overrides = 2; */ @@ -40,6 +42,26 @@ class HiveMetastoreConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.metastore.v1alpha.KerberosConfig kerberos_config = 3; */ private $kerberos_config = null; + /** + * The protocol to use for the metastore service endpoint. If unspecified, + * defaults to `THRIFT`. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; + */ + private $endpoint_protocol = 0; + /** + * A mapping of Hive metastore version to the auxiliary version + * configuration. When specified, a secondary Hive metastore service is + * created along with the primary service. All auxiliary versions must be less + * than the service's primary version. The key is the auxiliary service name + * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This + * means that the first character must be a lowercase letter, and all the + * following characters must be hyphens, lowercase letters, or digits, except + * the last character, which cannot be a hyphen. + * + * Generated from protobuf field map auxiliary_versions = 5; + */ + private $auxiliary_versions; /** * Constructor. @@ -52,13 +74,27 @@ class HiveMetastoreConfig extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\MapField $config_overrides * A mapping of Hive metastore configuration key-value pairs to apply to the * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). + * override system defaults (some keys cannot be overridden). These + * overrides are also applied to auxiliary versions and can be further + * customized in the auxiliary version's `AuxiliaryVersionConfig`. * @type \Google\Cloud\Metastore\V1alpha\KerberosConfig $kerberos_config * Information used to configure the Hive metastore service as a service * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` * method and specify this field's path * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` * while omitting this field from the request's `service`. + * @type int $endpoint_protocol + * The protocol to use for the metastore service endpoint. If unspecified, + * defaults to `THRIFT`. + * @type array|\Google\Protobuf\Internal\MapField $auxiliary_versions + * A mapping of Hive metastore version to the auxiliary version + * configuration. When specified, a secondary Hive metastore service is + * created along with the primary service. All auxiliary versions must be less + * than the service's primary version. The key is the auxiliary service name + * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This + * means that the first character must be a lowercase letter, and all the + * following characters must be hyphens, lowercase letters, or digits, except + * the last character, which cannot be a hyphen. * } */ public function __construct($data = NULL) { @@ -95,7 +131,9 @@ public function setVersion($var) /** * A mapping of Hive metastore configuration key-value pairs to apply to the * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). + * override system defaults (some keys cannot be overridden). These + * overrides are also applied to auxiliary versions and can be further + * customized in the auxiliary version's `AuxiliaryVersionConfig`. * * Generated from protobuf field map config_overrides = 2; * @return \Google\Protobuf\Internal\MapField @@ -108,7 +146,9 @@ public function getConfigOverrides() /** * A mapping of Hive metastore configuration key-value pairs to apply to the * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). + * override system defaults (some keys cannot be overridden). These + * overrides are also applied to auxiliary versions and can be further + * customized in the auxiliary version's `AuxiliaryVersionConfig`. * * Generated from protobuf field map config_overrides = 2; * @param array|\Google\Protobuf\Internal\MapField $var @@ -166,5 +206,73 @@ public function setKerberosConfig($var) return $this; } + /** + * The protocol to use for the metastore service endpoint. If unspecified, + * defaults to `THRIFT`. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; + * @return int + */ + public function getEndpointProtocol() + { + return $this->endpoint_protocol; + } + + /** + * The protocol to use for the metastore service endpoint. If unspecified, + * defaults to `THRIFT`. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; + * @param int $var + * @return $this + */ + public function setEndpointProtocol($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig\EndpointProtocol::class); + $this->endpoint_protocol = $var; + + return $this; + } + + /** + * A mapping of Hive metastore version to the auxiliary version + * configuration. When specified, a secondary Hive metastore service is + * created along with the primary service. All auxiliary versions must be less + * than the service's primary version. The key is the auxiliary service name + * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This + * means that the first character must be a lowercase letter, and all the + * following characters must be hyphens, lowercase letters, or digits, except + * the last character, which cannot be a hyphen. + * + * Generated from protobuf field map auxiliary_versions = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAuxiliaryVersions() + { + return $this->auxiliary_versions; + } + + /** + * A mapping of Hive metastore version to the auxiliary version + * configuration. When specified, a secondary Hive metastore service is + * created along with the primary service. All auxiliary versions must be less + * than the service's primary version. The key is the auxiliary service name + * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This + * means that the first character must be a lowercase letter, and all the + * following characters must be hyphens, lowercase letters, or digits, except + * the last character, which cannot be a hyphen. + * + * Generated from protobuf field map auxiliary_versions = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAuxiliaryVersions($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\AuxiliaryVersionConfig::class); + $this->auxiliary_versions = $arr; + + return $this; + } + } diff --git a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig/EndpointProtocol.php b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig/EndpointProtocol.php new file mode 100644 index 000000000000..4b93919c49c6 --- /dev/null +++ b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig/EndpointProtocol.php @@ -0,0 +1,64 @@ +google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol + */ +class EndpointProtocol +{ + /** + * The protocol is not set. + * + * Generated from protobuf enum ENDPOINT_PROTOCOL_UNSPECIFIED = 0; + */ + const ENDPOINT_PROTOCOL_UNSPECIFIED = 0; + /** + * Use the legacy Apache Thrift protocol for the metastore service endpoint. + * + * Generated from protobuf enum THRIFT = 1; + */ + const THRIFT = 1; + /** + * Use the modernized gRPC protocol for the metastore service endpoint. + * + * Generated from protobuf enum GRPC = 2; + */ + const GRPC = 2; + + private static $valueToName = [ + self::ENDPOINT_PROTOCOL_UNSPECIFIED => 'ENDPOINT_PROTOCOL_UNSPECIFIED', + self::THRIFT => 'THRIFT', + self::GRPC => 'GRPC', + ]; + + 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(EndpointProtocol::class, \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig_EndpointProtocol::class); + diff --git a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig_EndpointProtocol.php b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig_EndpointProtocol.php new file mode 100644 index 000000000000..cfb1ce7c78e4 --- /dev/null +++ b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig_EndpointProtocol.php @@ -0,0 +1,16 @@ +string krb5_config_gcs_uri = 3; @@ -54,7 +54,7 @@ class KerberosConfig extends \Google\Protobuf\Internal\Message * `primary/instance@REALM`, but there is no exact format. * @type string $krb5_config_gcs_uri * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form gs://{bucket_name}/path/to/krb5.conf, + * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, * although the file does not need to be named krb5.conf explicitly. * } */ @@ -133,7 +133,7 @@ public function setPrincipal($var) /** * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form gs://{bucket_name}/path/to/krb5.conf, + * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, * although the file does not need to be named krb5.conf explicitly. * * Generated from protobuf field string krb5_config_gcs_uri = 3; @@ -146,7 +146,7 @@ public function getKrb5ConfigGcsUri() /** * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form gs://{bucket_name}/path/to/krb5.conf, + * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, * although the file does not need to be named krb5.conf explicitly. * * Generated from protobuf field string krb5_config_gcs_uri = 3; diff --git a/DataprocMetastore/src/V1alpha/Lake.php b/DataprocMetastore/src/V1alpha/Lake.php new file mode 100644 index 000000000000..fdc707844623 --- /dev/null +++ b/DataprocMetastore/src/V1alpha/Lake.php @@ -0,0 +1,75 @@ +google.cloud.metastore.v1alpha.Lake + */ +class Lake extends \Google\Protobuf\Internal\Message +{ + /** + * The Lake resource name. + * Example: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The Lake resource name. + * Example: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); + parent::__construct($data); + } + + /** + * The Lake resource name. + * Example: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The Lake resource name. + * Example: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` + * + * Generated from protobuf field string name = 1 [(.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/DataprocMetastore/src/V1alpha/MetadataImport.php b/DataprocMetastore/src/V1alpha/MetadataImport.php index bcf1c06e98eb..a7d59ba3430b 100644 --- a/DataprocMetastore/src/V1alpha/MetadataImport.php +++ b/DataprocMetastore/src/V1alpha/MetadataImport.php @@ -29,7 +29,7 @@ class MetadataImport extends \Google\Protobuf\Internal\Message */ private $description = ''; /** - * Output only. The time when the metadata import was created. + * Output only. The time when the metadata import was started. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -40,6 +40,12 @@ class MetadataImport extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $update_time = null; + /** + * Output only. The time when the metadata import finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $end_time = null; /** * Output only. The current state of the metadata import. * @@ -62,9 +68,11 @@ class MetadataImport extends \Google\Protobuf\Internal\Message * @type string $description * The description of the metadata import. * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metadata import was created. + * Output only. The time when the metadata import was started. * @type \Google\Protobuf\Timestamp $update_time * Output only. The time when the metadata import was last updated. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time when the metadata import finished. * @type int $state * Output only. The current state of the metadata import. * } @@ -160,7 +168,7 @@ public function setDescription($var) } /** - * Output only. The time when the metadata import was created. + * Output only. The time when the metadata import was started. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Protobuf\Timestamp|null @@ -181,7 +189,7 @@ public function clearCreateTime() } /** - * Output only. The time when the metadata import was created. + * Output only. The time when the metadata import was started. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Protobuf\Timestamp $var @@ -231,6 +239,42 @@ public function setUpdateTime($var) return $this; } + /** + * Output only. The time when the metadata import finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time when the metadata import finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + /** * Output only. The current state of the metadata import. * diff --git a/DataprocMetastore/src/V1alpha/MetadataIntegration.php b/DataprocMetastore/src/V1alpha/MetadataIntegration.php index 81475bb850a1..5a5dae1e4f9e 100644 --- a/DataprocMetastore/src/V1alpha/MetadataIntegration.php +++ b/DataprocMetastore/src/V1alpha/MetadataIntegration.php @@ -21,6 +21,12 @@ class MetadataIntegration extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.metastore.v1alpha.DataCatalogConfig data_catalog_config = 1; */ private $data_catalog_config = null; + /** + * The integration config for the Dataplex service. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.DataplexConfig dataplex_config = 2; + */ + private $dataplex_config = null; /** * Constructor. @@ -30,6 +36,8 @@ class MetadataIntegration extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\Metastore\V1alpha\DataCatalogConfig $data_catalog_config * The integration config for the Data Catalog service. + * @type \Google\Cloud\Metastore\V1alpha\DataplexConfig $dataplex_config + * The integration config for the Dataplex service. * } */ public function __construct($data = NULL) { @@ -73,5 +81,41 @@ public function setDataCatalogConfig($var) return $this; } + /** + * The integration config for the Dataplex service. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.DataplexConfig dataplex_config = 2; + * @return \Google\Cloud\Metastore\V1alpha\DataplexConfig|null + */ + public function getDataplexConfig() + { + return $this->dataplex_config; + } + + public function hasDataplexConfig() + { + return isset($this->dataplex_config); + } + + public function clearDataplexConfig() + { + unset($this->dataplex_config); + } + + /** + * The integration config for the Dataplex service. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.DataplexConfig dataplex_config = 2; + * @param \Google\Cloud\Metastore\V1alpha\DataplexConfig $var + * @return $this + */ + public function setDataplexConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\DataplexConfig::class); + $this->dataplex_config = $var; + + return $this; + } + } diff --git a/DataprocMetastore/src/V1alpha/NetworkConfig.php b/DataprocMetastore/src/V1alpha/NetworkConfig.php new file mode 100644 index 000000000000..87fb012431d7 --- /dev/null +++ b/DataprocMetastore/src/V1alpha/NetworkConfig.php @@ -0,0 +1,71 @@ +google.cloud.metastore.v1alpha.NetworkConfig + */ +class NetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The consumer-side network configuration for the Dataproc Metastore + * instance. + * + * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + private $consumers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Metastore\V1alpha\NetworkConfig\Consumer[]|\Google\Protobuf\Internal\RepeatedField $consumers + * Immutable. The consumer-side network configuration for the Dataproc Metastore + * instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The consumer-side network configuration for the Dataproc Metastore + * instance. + * + * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConsumers() + { + return $this->consumers; + } + + /** + * Immutable. The consumer-side network configuration for the Dataproc Metastore + * instance. + * + * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\Metastore\V1alpha\NetworkConfig\Consumer[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConsumers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\NetworkConfig\Consumer::class); + $this->consumers = $arr; + + return $this; + } + +} + diff --git a/DataprocMetastore/src/V1alpha/NetworkConfig/Consumer.php b/DataprocMetastore/src/V1alpha/NetworkConfig/Consumer.php new file mode 100644 index 000000000000..67ea24ad4bd2 --- /dev/null +++ b/DataprocMetastore/src/V1alpha/NetworkConfig/Consumer.php @@ -0,0 +1,130 @@ +google.cloud.metastore.v1alpha.NetworkConfig.Consumer + */ +class Consumer extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The URI of the endpoint used to access the metastore service. + * + * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $endpoint_uri = ''; + protected $vpc_resource; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subnetwork + * The subnetwork of the customer project from which an IP address is + * reserved and used as the Dataproc Metastore service's + * endpoint. It is accessible to hosts in the subnet and to all + * hosts in a subnet in the same region and same network. There must + * be at least one IP address available in the subnet's primary range. The + * subnet is specified in the following form: + * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id} + * @type string $endpoint_uri + * Output only. The URI of the endpoint used to access the metastore service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); + parent::__construct($data); + } + + /** + * The subnetwork of the customer project from which an IP address is + * reserved and used as the Dataproc Metastore service's + * endpoint. It is accessible to hosts in the subnet and to all + * hosts in a subnet in the same region and same network. There must + * be at least one IP address available in the subnet's primary range. The + * subnet is specified in the following form: + * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id} + * + * Generated from protobuf field string subnetwork = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getSubnetwork() + { + return $this->readOneof(1); + } + + public function hasSubnetwork() + { + return $this->hasOneof(1); + } + + /** + * The subnetwork of the customer project from which an IP address is + * reserved and used as the Dataproc Metastore service's + * endpoint. It is accessible to hosts in the subnet and to all + * hosts in a subnet in the same region and same network. There must + * be at least one IP address available in the subnet's primary range. The + * subnet is specified in the following form: + * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id} + * + * Generated from protobuf field string subnetwork = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Output only. The URI of the endpoint used to access the metastore service. + * + * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEndpointUri() + { + return $this->endpoint_uri; + } + + /** + * Output only. The URI of the endpoint used to access the metastore service. + * + * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEndpointUri($var) + { + GPBUtil::checkString($var, True); + $this->endpoint_uri = $var; + + return $this; + } + + /** + * @return string + */ + public function getVpcResource() + { + return $this->whichOneof("vpc_resource"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Consumer::class, \Google\Cloud\Metastore\V1alpha\NetworkConfig_Consumer::class); + diff --git a/DataprocMetastore/src/V1alpha/NetworkConfig_Consumer.php b/DataprocMetastore/src/V1alpha/NetworkConfig_Consumer.php new file mode 100644 index 000000000000..68e992af58b2 --- /dev/null +++ b/DataprocMetastore/src/V1alpha/NetworkConfig_Consumer.php @@ -0,0 +1,16 @@ +string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ @@ -70,7 +70,7 @@ class Restore extends \Google\Protobuf\Internal\Message * @type string $backup * Output only. The relative resource name of the metastore service backup to restore * from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. * @type int $type * Output only. The type of restore. * @type string $details @@ -184,7 +184,7 @@ public function setState($var) /** * Output only. The relative resource name of the metastore service backup to restore * from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. * * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @return string @@ -197,7 +197,7 @@ public function getBackup() /** * Output only. The relative resource name of the metastore service backup to restore * from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. * * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @param string $var diff --git a/DataprocMetastore/src/V1alpha/Restore/RestoreType.php b/DataprocMetastore/src/V1alpha/Restore/RestoreType.php index dc3324f0b028..ac00e6c12f01 100644 --- a/DataprocMetastore/src/V1alpha/Restore/RestoreType.php +++ b/DataprocMetastore/src/V1alpha/Restore/RestoreType.php @@ -7,7 +7,7 @@ use UnexpectedValueException; /** - * The type of restore. + * The type of restore. If unspecified, defaults to `METADATA_ONLY`. * * Protobuf type google.cloud.metastore.v1alpha.Restore.RestoreType */ diff --git a/DataprocMetastore/src/V1alpha/RestoreServiceRequest.php b/DataprocMetastore/src/V1alpha/RestoreServiceRequest.php index 85506550359d..b6deaddb6812 100644 --- a/DataprocMetastore/src/V1alpha/RestoreServiceRequest.php +++ b/DataprocMetastore/src/V1alpha/RestoreServiceRequest.php @@ -18,7 +18,7 @@ class RestoreServiceRequest extends \Google\Protobuf\Internal\Message /** * Required. The relative resource name of the metastore service to run restore, in the * following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -26,7 +26,7 @@ class RestoreServiceRequest extends \Google\Protobuf\Internal\Message /** * Required. The relative resource name of the metastore service backup to restore * from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. * * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -62,11 +62,11 @@ class RestoreServiceRequest extends \Google\Protobuf\Internal\Message * @type string $service * Required. The relative resource name of the metastore service to run restore, in the * following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}`. * @type string $backup * Required. The relative resource name of the metastore service backup to restore * from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. * @type int $restore_type * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. * @type string $request_id @@ -90,7 +90,7 @@ public function __construct($data = NULL) { /** * Required. The relative resource name of the metastore service to run restore, in the * following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -103,7 +103,7 @@ public function getService() /** * Required. The relative resource name of the metastore service to run restore, in the * following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -120,7 +120,7 @@ public function setService($var) /** * Required. The relative resource name of the metastore service backup to restore * from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. * * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -133,7 +133,7 @@ public function getBackup() /** * Required. The relative resource name of the metastore service backup to restore * from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}` + * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. * * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DataprocMetastore/src/V1alpha/Service.php b/DataprocMetastore/src/V1alpha/Service.php index 7184ba1e9cbf..6c3a5a1f4b85 100644 --- a/DataprocMetastore/src/V1alpha/Service.php +++ b/DataprocMetastore/src/V1alpha/Service.php @@ -96,6 +96,8 @@ class Service extends \Google\Protobuf\Internal\Message /** * The one hour maintenance window of the metastore service. This specifies * when the service can be restarted for maintenance purposes in UTC time. + * Maintenance window is not needed for services with the SPANNER + * database type. * * Generated from protobuf field .google.cloud.metastore.v1alpha.MaintenanceWindow maintenance_window = 15; */ @@ -119,6 +121,26 @@ class Service extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; */ private $release_channel = 0; + /** + * Immutable. Information used to configure the Dataproc Metastore service to encrypt + * customer data at rest. Cannot be updated. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; + */ + private $encryption_config = null; + /** + * Immutable. The configuration specifying the network settings for the + * Dataproc Metastore service. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 21 [(.google.api.field_behavior) = IMMUTABLE]; + */ + private $network_config = null; + /** + * Immutable. The database type that the Metastore service stores its data. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; + */ + private $database_type = 0; protected $metastore_config; /** @@ -163,6 +185,8 @@ class Service extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Metastore\V1alpha\MaintenanceWindow $maintenance_window * The one hour maintenance window of the metastore service. This specifies * when the service can be restarted for maintenance purposes in UTC time. + * Maintenance window is not needed for services with the SPANNER + * database type. * @type string $uid * Output only. The globally unique resource identifier of the metastore service. * @type \Google\Cloud\Metastore\V1alpha\MetadataManagementActivity $metadata_management_activity @@ -170,6 +194,14 @@ class Service extends \Google\Protobuf\Internal\Message * @type int $release_channel * Immutable. The release channel of the service. * If unspecified, defaults to `STABLE`. + * @type \Google\Cloud\Metastore\V1alpha\EncryptionConfig $encryption_config + * Immutable. Information used to configure the Dataproc Metastore service to encrypt + * customer data at rest. Cannot be updated. + * @type \Google\Cloud\Metastore\V1alpha\NetworkConfig $network_config + * Immutable. The configuration specifying the network settings for the + * Dataproc Metastore service. + * @type int $database_type + * Immutable. The database type that the Metastore service stores its data. * } */ public function __construct($data = NULL) { @@ -567,6 +599,8 @@ public function setMetadataIntegration($var) /** * The one hour maintenance window of the metastore service. This specifies * when the service can be restarted for maintenance purposes in UTC time. + * Maintenance window is not needed for services with the SPANNER + * database type. * * Generated from protobuf field .google.cloud.metastore.v1alpha.MaintenanceWindow maintenance_window = 15; * @return \Google\Cloud\Metastore\V1alpha\MaintenanceWindow|null @@ -589,6 +623,8 @@ public function clearMaintenanceWindow() /** * The one hour maintenance window of the metastore service. This specifies * when the service can be restarted for maintenance purposes in UTC time. + * Maintenance window is not needed for services with the SPANNER + * database type. * * Generated from protobuf field .google.cloud.metastore.v1alpha.MaintenanceWindow maintenance_window = 15; * @param \Google\Cloud\Metastore\V1alpha\MaintenanceWindow $var @@ -692,6 +728,108 @@ public function setReleaseChannel($var) return $this; } + /** + * Immutable. Information used to configure the Dataproc Metastore service to encrypt + * customer data at rest. Cannot be updated. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\Metastore\V1alpha\EncryptionConfig|null + */ + public function getEncryptionConfig() + { + return $this->encryption_config; + } + + public function hasEncryptionConfig() + { + return isset($this->encryption_config); + } + + public function clearEncryptionConfig() + { + unset($this->encryption_config); + } + + /** + * Immutable. Information used to configure the Dataproc Metastore service to encrypt + * customer data at rest. Cannot be updated. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\Metastore\V1alpha\EncryptionConfig $var + * @return $this + */ + public function setEncryptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\EncryptionConfig::class); + $this->encryption_config = $var; + + return $this; + } + + /** + * Immutable. The configuration specifying the network settings for the + * Dataproc Metastore service. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 21 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\Metastore\V1alpha\NetworkConfig|null + */ + public function getNetworkConfig() + { + return $this->network_config; + } + + public function hasNetworkConfig() + { + return isset($this->network_config); + } + + public function clearNetworkConfig() + { + unset($this->network_config); + } + + /** + * Immutable. The configuration specifying the network settings for the + * Dataproc Metastore service. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 21 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\Metastore\V1alpha\NetworkConfig $var + * @return $this + */ + public function setNetworkConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\NetworkConfig::class); + $this->network_config = $var; + + return $this; + } + + /** + * Immutable. The database type that the Metastore service stores its data. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getDatabaseType() + { + return $this->database_type; + } + + /** + * Immutable. The database type that the Metastore service stores its data. + * + * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setDatabaseType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Service\DatabaseType::class); + $this->database_type = $var; + + return $this; + } + /** * @return string */ diff --git a/DataprocMetastore/src/V1alpha/Service/DatabaseType.php b/DataprocMetastore/src/V1alpha/Service/DatabaseType.php new file mode 100644 index 000000000000..af3d2b8bc594 --- /dev/null +++ b/DataprocMetastore/src/V1alpha/Service/DatabaseType.php @@ -0,0 +1,64 @@ +google.cloud.metastore.v1alpha.Service.DatabaseType + */ +class DatabaseType +{ + /** + * The DATABASE_TYPE is not set. + * + * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; + */ + const DATABASE_TYPE_UNSPECIFIED = 0; + /** + * MySQL is used to persist the metastore data. + * + * Generated from protobuf enum MYSQL = 1; + */ + const MYSQL = 1; + /** + * Spanner is used to persist the metastore data. + * + * Generated from protobuf enum SPANNER = 2; + */ + const SPANNER = 2; + + private static $valueToName = [ + self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', + self::MYSQL => 'MYSQL', + self::SPANNER => 'SPANNER', + ]; + + 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(DatabaseType::class, \Google\Cloud\Metastore\V1alpha\Service_DatabaseType::class); + diff --git a/DataprocMetastore/src/V1alpha/Service_DatabaseType.php b/DataprocMetastore/src/V1alpha/Service_DatabaseType.php new file mode 100644 index 000000000000..6abe29c080db --- /dev/null +++ b/DataprocMetastore/src/V1alpha/Service_DatabaseType.php @@ -0,0 +1,16 @@ + [ 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Backup', 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '60000', + 'initialPollDelayMillis' => '500', 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '120000', - 'totalPollTimeoutMillis' => '4800000', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', ], ], 'CreateMetadataImport' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\MetadataImport', 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '60000', + 'initialPollDelayMillis' => '500', 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '120000', - 'totalPollTimeoutMillis' => '4800000', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', ], ], 'CreateService' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Service', 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '60000', + 'initialPollDelayMillis' => '500', 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '120000', - 'totalPollTimeoutMillis' => '4800000', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', ], ], 'DeleteBackup' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '10000', + 'initialPollDelayMillis' => '500', 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '60000', - 'totalPollTimeoutMillis' => '1500000', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', ], ], 'DeleteService' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '10000', + 'initialPollDelayMillis' => '500', 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '60000', - 'totalPollTimeoutMillis' => '1500000', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', ], ], 'ExportMetadata' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\MetadataExport', 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '60000', + 'initialPollDelayMillis' => '500', 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '120000', - 'totalPollTimeoutMillis' => '4800000', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', ], ], 'RestoreService' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Restore', 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '60000', + 'initialPollDelayMillis' => '500', 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '120000', - 'totalPollTimeoutMillis' => '4800000', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', ], ], 'UpdateMetadataImport' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\MetadataImport', 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '60000', + 'initialPollDelayMillis' => '500', 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '120000', - 'totalPollTimeoutMillis' => '1200000', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', ], ], 'UpdateService' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Service', 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '60000', + 'initialPollDelayMillis' => '500', 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '120000', - 'totalPollTimeoutMillis' => '3000000', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', ], ], 'ListBackups' => [ diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_rest_client_config.php b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_rest_client_config.php index df0dcc2bf393..35b4cc840426 100644 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_rest_client_config.php +++ b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_rest_client_config.php @@ -221,6 +221,20 @@ 'GetIamPolicy' => [ 'method' => 'get', 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:getIamPolicy', + ], + ], 'placeholders' => [ 'resource' => [ 'getters' => [ @@ -233,6 +247,23 @@ 'method' => 'post', 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:setIamPolicy', 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:setIamPolicy', + 'body' => '*', + ], + ], 'placeholders' => [ 'resource' => [ 'getters' => [ @@ -245,6 +276,23 @@ 'method' => 'post', 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:testIamPermissions', 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:testIamPermissions', + 'body' => '*', + ], + ], 'placeholders' => [ 'resource' => [ 'getters' => [ From 5c93be3042cf0a1ca806ace84d866361ac06e50b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 10:41:00 -0700 Subject: [PATCH 5/9] docs: [Talent] Added functionality in the companyDisplayNames filter to support fuzzy matching (#5159) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Added functionality in the companyDisplayNames filter to support fuzzy matching PiperOrigin-RevId: 435467010 Source-Link: https://github.com/googleapis/googleapis/commit/cb382857a71e5fbfbddd2f276fd4395754318a40 Source-Link: https://github.com/googleapis/googleapis-gen/commit/799e10e82d04aa27aafbc6c537f5be1eaf891cad Copy-Tag: eyJwIjoiVGFsZW50Ly5Pd2xCb3QueWFtbCIsImgiOiI3OTllMTBlODJkMDRhYTI3YWFmYmM2YzUzN2Y1YmUxZWFmODkxY2FkIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- Talent/metadata/V4/Common.php | Bin 6320 -> 6233 bytes Talent/metadata/V4/Company.php | 5 +-- Talent/metadata/V4/CompletionService.php | Bin 2303 -> 2303 bytes Talent/metadata/V4/Event.php | Bin 1636 -> 1549 bytes Talent/metadata/V4/Filters.php | Bin 3070 -> 2983 bytes Talent/metadata/V4/Histogram.php | 1 - Talent/metadata/V4/Job.php | 5 +-- Talent/metadata/V4/JobService.php | Bin 7702 -> 7621 bytes Talent/metadata/V4/Tenant.php | 5 +-- Talent/src/V4/Gapic/JobServiceGapicClient.php | 4 ++ Talent/src/V4/JobQuery.php | 40 ++++++++++++++---- Talent/src/V4/LocationFilter.php | 24 +++++++---- Talent/src/V4/SearchJobsRequest.php | 4 ++ 13 files changed, 62 insertions(+), 26 deletions(-) diff --git a/Talent/metadata/V4/Common.php b/Talent/metadata/V4/Common.php index a976dfc231407070dcabebf68d31e458031936b5..70571a39f68a68d58b86cb0c501449a53562ff88 100644 GIT binary patch delta 28 kcmdmBc++6RZ>Gs6%=#?PHMx{0dMi)vVqUj7j3r700H8n$8UO$Q delta 70 zcmcaGuj8AbRU3o>II^YZdb5=%1k^CsIfiBJB`q|elinternalAddGeneratedFile( ' -Ý -$google/cloud/talent/v4/company.protogoogle.cloud.talent.v4google/api/resource.proto#google/cloud/talent/v4/common.protogoogle/api/annotations.proto"Ä +¿ +$google/cloud/talent/v4/company.protogoogle.cloud.talent.v4google/api/resource.proto#google/cloud/talent/v4/common.proto"Ä Company name (  display_name ( BàA diff --git a/Talent/metadata/V4/CompletionService.php b/Talent/metadata/V4/CompletionService.php index ef5f82d2e6ff053a0f6d823667294ba0e774ef08..b691f94989e548902e29c39e068fbe5f94b11398 100644 GIT binary patch delta 57 zcmew__+M}X57XqmOfr-8nItCjFwLBNlc`!lJUu@@JttK^u^>}FIVUqUuSBn)D8D3s Naxin^=CjO3tN>OU6mdBU?nl4b*0FsmmegFUf delta 68 zcmZ23{!e_vNv6p$Od|Y_1(`99d3pIIi6xo&dBu}AGr2Og3QqpTv`a!tCOtntJttK^ Qu^>}F5us-DI_9730DAozN&o-= diff --git a/Talent/metadata/V4/Histogram.php b/Talent/metadata/V4/Histogram.php index 143289ee87a3..f2cb209face7 100644 --- a/Talent/metadata/V4/Histogram.php +++ b/Talent/metadata/V4/Histogram.php @@ -14,7 +14,6 @@ public static function initOnce() { if (static::$is_initialized == true) { return; } - \GPBMetadata\Google\Api\Annotations::initOnce(); $pool->internalAddGeneratedFile( ' › diff --git a/Talent/metadata/V4/Job.php b/Talent/metadata/V4/Job.php index bf2d46fe45eb..49d123b8f245 100644 --- a/Talent/metadata/V4/Job.php +++ b/Talent/metadata/V4/Job.php @@ -18,11 +18,10 @@ public static function initOnce() { \GPBMetadata\Google\Api\Resource::initOnce(); \GPBMetadata\Google\Cloud\Talent\V4\Common::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); - \GPBMetadata\Google\Api\Annotations::initOnce(); $pool->internalAddGeneratedFile( ' -§ - google/cloud/talent/v4/job.protogoogle.cloud.talent.v4google/api/resource.proto#google/cloud/talent/v4/common.protogoogle/protobuf/timestamp.protogoogle/api/annotations.proto"õ +‰ + google/cloud/talent/v4/job.protogoogle.cloud.talent.v4google/api/resource.proto#google/cloud/talent/v4/common.protogoogle/protobuf/timestamp.proto"õ Job name ( 4 company ( B#àAúA diff --git a/Talent/metadata/V4/JobService.php b/Talent/metadata/V4/JobService.php index 7c9ae8669f2f8dac7f937ffbc48b92bd908d0980..da9813a81a32eaf62fecdd572af05d5d5eb1c976 100644 GIT binary patch delta 30 mcmbPcbJTjnOXkV)EI(Lg8**t({>v)9*@)GWadR8n1aSblqYBjk delta 59 zcmV-B0L1^rJC;1K=>r2nZh4dO12dE91Na2CF$yS?p#>MS`~*1x6d7l4Z)a>}FK}{i RbZ=sHW-noGd9yACmlwkv7JC2y diff --git a/Talent/metadata/V4/Tenant.php b/Talent/metadata/V4/Tenant.php index c81ac2dcadcf..91355f9ac1e6 100644 --- a/Talent/metadata/V4/Tenant.php +++ b/Talent/metadata/V4/Tenant.php @@ -16,11 +16,10 @@ public static function initOnce() { } \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); - \GPBMetadata\Google\Api\Annotations::initOnce(); $pool->internalAddGeneratedFile( ' -ç -#google/cloud/talent/v4/tenant.protogoogle.cloud.talent.v4google/api/resource.protogoogle/api/annotations.proto"v +É +#google/cloud/talent/v4/tenant.protogoogle.cloud.talent.v4google/api/resource.proto"v Tenant name (  external_id ( BàA:DêAA diff --git a/Talent/src/V4/Gapic/JobServiceGapicClient.php b/Talent/src/V4/Gapic/JobServiceGapicClient.php index f84d49390206..2fb72018a167 100644 --- a/Talent/src/V4/Gapic/JobServiceGapicClient.php +++ b/Talent/src/V4/Gapic/JobServiceGapicClient.php @@ -943,6 +943,8 @@ public function listJobs($parent, $filter, array $optionalArgs = []) * * `count(numeric_histogram_facet, list of buckets)`: Count the number of * matching entities within each bucket. * + * A maximum of 200 histogram buckets are supported. + * * Data types: * * * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. @@ -1283,6 +1285,8 @@ public function searchJobs($parent, $requestMetadata, array $optionalArgs = []) * * `count(numeric_histogram_facet, list of buckets)`: Count the number of * matching entities within each bucket. * + * A maximum of 200 histogram buckets are supported. + * * Data types: * * * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. diff --git a/Talent/src/V4/JobQuery.php b/Talent/src/V4/JobQuery.php index e2a64e6bb1d4..624e70024a86 100644 --- a/Talent/src/V4/JobQuery.php +++ b/Talent/src/V4/JobQuery.php @@ -84,8 +84,14 @@ class JobQuery extends \Google\Protobuf\Internal\Message */ private $commute_filter = null; /** - * This filter specifies the exact company [Company.display_name][google.cloud.talent.v4.Company.display_name] - * of the jobs to search against. + * This filter specifies the company [Company.display_name][google.cloud.talent.v4.Company.display_name] + * of the jobs to search against. The company name must match the value + * exactly (case sensitive). + * Alternatively, if the value being searched for is wrapped in + * `SUBSTRING_MATCH([value])`, the company name must contain a case + * insensitive substring match of the value. Using this function may increase + * latency. + * Sample Values: `["Google LLC", "SUBSTRING_MATCH(google)"]` * If a value isn't specified, jobs within the search results are * associated with any company. * If multiple values are specified, jobs within the search results may be @@ -226,8 +232,14 @@ class JobQuery extends \Google\Protobuf\Internal\Message * [location_filters][google.cloud.talent.v4.JobQuery.location_filters] is ignored. * Currently we don't support sorting by commute time. * @type string[]|\Google\Protobuf\Internal\RepeatedField $company_display_names - * This filter specifies the exact company [Company.display_name][google.cloud.talent.v4.Company.display_name] - * of the jobs to search against. + * This filter specifies the company [Company.display_name][google.cloud.talent.v4.Company.display_name] + * of the jobs to search against. The company name must match the value + * exactly (case sensitive). + * Alternatively, if the value being searched for is wrapped in + * `SUBSTRING_MATCH([value])`, the company name must contain a case + * insensitive substring match of the value. Using this function may increase + * latency. + * Sample Values: `["Google LLC", "SUBSTRING_MATCH(google)"]` * If a value isn't specified, jobs within the search results are * associated with any company. * If multiple values are specified, jobs within the search results may be @@ -522,8 +534,14 @@ public function setCommuteFilter($var) } /** - * This filter specifies the exact company [Company.display_name][google.cloud.talent.v4.Company.display_name] - * of the jobs to search against. + * This filter specifies the company [Company.display_name][google.cloud.talent.v4.Company.display_name] + * of the jobs to search against. The company name must match the value + * exactly (case sensitive). + * Alternatively, if the value being searched for is wrapped in + * `SUBSTRING_MATCH([value])`, the company name must contain a case + * insensitive substring match of the value. Using this function may increase + * latency. + * Sample Values: `["Google LLC", "SUBSTRING_MATCH(google)"]` * If a value isn't specified, jobs within the search results are * associated with any company. * If multiple values are specified, jobs within the search results may be @@ -539,8 +557,14 @@ public function getCompanyDisplayNames() } /** - * This filter specifies the exact company [Company.display_name][google.cloud.talent.v4.Company.display_name] - * of the jobs to search against. + * This filter specifies the company [Company.display_name][google.cloud.talent.v4.Company.display_name] + * of the jobs to search against. The company name must match the value + * exactly (case sensitive). + * Alternatively, if the value being searched for is wrapped in + * `SUBSTRING_MATCH([value])`, the company name must contain a case + * insensitive substring match of the value. Using this function may increase + * latency. + * Sample Values: `["Google LLC", "SUBSTRING_MATCH(google)"]` * If a value isn't specified, jobs within the search results are * associated with any company. * If multiple values are specified, jobs within the search results may be diff --git a/Talent/src/V4/LocationFilter.php b/Talent/src/V4/LocationFilter.php index ab80539e4ed5..d169f22db113 100644 --- a/Talent/src/V4/LocationFilter.php +++ b/Talent/src/V4/LocationFilter.php @@ -61,8 +61,10 @@ class LocationFilter extends \Google\Protobuf\Internal\Message * If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED], * telecommuting jobs are searched, and [address][google.cloud.talent.v4.LocationFilter.address] and [lat_lng][google.cloud.talent.v4.LocationFilter.lat_lng] are * ignored. If not set or set to - * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not - * searched. + * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], the telecommute status of + * the jobs is ignored. Jobs that have [PostingRegion.TELECOMMUTE][google.cloud.talent.v4.PostingRegion.TELECOMMUTE] and have + * additional [Job.addresses][google.cloud.talent.v4.Job.addresses] may still be matched based on other location + * filters using [address][google.cloud.talent.v4.LocationFilter.address] or [latlng][]. * This filter can be used by itself to search exclusively for telecommuting * jobs, or it can be combined with another location * filter to search for a combination of job locations, @@ -111,8 +113,10 @@ class LocationFilter extends \Google\Protobuf\Internal\Message * If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED], * telecommuting jobs are searched, and [address][google.cloud.talent.v4.LocationFilter.address] and [lat_lng][google.cloud.talent.v4.LocationFilter.lat_lng] are * ignored. If not set or set to - * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not - * searched. + * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], the telecommute status of + * the jobs is ignored. Jobs that have [PostingRegion.TELECOMMUTE][google.cloud.talent.v4.PostingRegion.TELECOMMUTE] and have + * additional [Job.addresses][google.cloud.talent.v4.Job.addresses] may still be matched based on other location + * filters using [address][google.cloud.talent.v4.LocationFilter.address] or [latlng][]. * This filter can be used by itself to search exclusively for telecommuting * jobs, or it can be combined with another location * filter to search for a combination of job locations, @@ -277,8 +281,10 @@ public function setDistanceInMiles($var) * If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED], * telecommuting jobs are searched, and [address][google.cloud.talent.v4.LocationFilter.address] and [lat_lng][google.cloud.talent.v4.LocationFilter.lat_lng] are * ignored. If not set or set to - * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not - * searched. + * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], the telecommute status of + * the jobs is ignored. Jobs that have [PostingRegion.TELECOMMUTE][google.cloud.talent.v4.PostingRegion.TELECOMMUTE] and have + * additional [Job.addresses][google.cloud.talent.v4.Job.addresses] may still be matched based on other location + * filters using [address][google.cloud.talent.v4.LocationFilter.address] or [latlng][]. * This filter can be used by itself to search exclusively for telecommuting * jobs, or it can be combined with another location * filter to search for a combination of job locations, @@ -303,8 +309,10 @@ public function getTelecommutePreference() * If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED], * telecommuting jobs are searched, and [address][google.cloud.talent.v4.LocationFilter.address] and [lat_lng][google.cloud.talent.v4.LocationFilter.lat_lng] are * ignored. If not set or set to - * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not - * searched. + * [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], the telecommute status of + * the jobs is ignored. Jobs that have [PostingRegion.TELECOMMUTE][google.cloud.talent.v4.PostingRegion.TELECOMMUTE] and have + * additional [Job.addresses][google.cloud.talent.v4.Job.addresses] may still be matched based on other location + * filters using [address][google.cloud.talent.v4.LocationFilter.address] or [latlng][]. * This filter can be used by itself to search exclusively for telecommuting * jobs, or it can be combined with another location * filter to search for a combination of job locations, diff --git a/Talent/src/V4/SearchJobsRequest.php b/Talent/src/V4/SearchJobsRequest.php index 37917e2cbb6d..55e414511e1d 100644 --- a/Talent/src/V4/SearchJobsRequest.php +++ b/Talent/src/V4/SearchJobsRequest.php @@ -62,6 +62,7 @@ class SearchJobsRequest extends \Google\Protobuf\Internal\Message * for each distinct attribute value. * * `count(numeric_histogram_facet, list of buckets)`: Count the number of * matching entities within each bucket. + * A maximum of 200 histogram buckets are supported. * Data types: * * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. * * String: string like "any string with backslash escape for quote(\")." @@ -320,6 +321,7 @@ class SearchJobsRequest extends \Google\Protobuf\Internal\Message * for each distinct attribute value. * * `count(numeric_histogram_facet, list of buckets)`: Count the number of * matching entities within each bucket. + * A maximum of 200 histogram buckets are supported. * Data types: * * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. * * String: string like "any string with backslash escape for quote(\")." @@ -685,6 +687,7 @@ public function setEnableBroadening($var) * for each distinct attribute value. * * `count(numeric_histogram_facet, list of buckets)`: Count the number of * matching entities within each bucket. + * A maximum of 200 histogram buckets are supported. * Data types: * * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. * * String: string like "any string with backslash escape for quote(\")." @@ -777,6 +780,7 @@ public function getHistogramQueries() * for each distinct attribute value. * * `count(numeric_histogram_facet, list of buckets)`: Count the number of * matching entities within each bucket. + * A maximum of 200 histogram buckets are supported. * Data types: * * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. * * String: string like "any string with backslash escape for quote(\")." From a6707c4d5d082d2406fdd9777237be37bd16b4bd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 10:44:15 -0700 Subject: [PATCH 6/9] feat: introduce hot tablet/ping and warm RPCs (#5119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add WarmAndPing request for channel priming PiperOrigin-RevId: 428795660 Source-Link: https://github.com/googleapis/googleapis/commit/6cce671cb21e5ba9ee785dfe50f5a86b87bb5f21 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2282bc1b081364ea783300be91a8c14cb4a718c4 Copy-Tag: eyJwIjoiQmlndGFibGUvLk93bEJvdC55YW1sIiwiaCI6IjIyODJiYzFiMDgxMzY0ZWE3ODMzMDBiZTkxYThjMTRjYjRhNzE4YzQifQ== * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add ListHotTablets API method and protobufs PiperOrigin-RevId: 436758628 Source-Link: https://github.com/googleapis/googleapis/commit/92ab86a79f4a9e774dfd6ee533d9376af084b376 Source-Link: https://github.com/googleapis/googleapis-gen/commit/931ef114d5f845abf117bf8e0a29836ca300b694 Copy-Tag: eyJwIjoiQmlndGFibGUvLk93bEJvdC55YW1sIiwiaCI6IjkzMWVmMTE0ZDVmODQ1YWJmMTE3YmY4ZTBhMjk4MzZjYTMwMGI2OTQifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: Update `cpu_utilization_percent` limit docs: Remove the limitation of all clusters in a CMEK instance must use the same key PiperOrigin-RevId: 438385300 Source-Link: https://github.com/googleapis/googleapis/commit/c59f02e87d3ce01699ebf2adda7381af7c5eca31 Source-Link: https://github.com/googleapis/googleapis-gen/commit/04d03d17aafa7b4422f73c93600f040542817fcd Copy-Tag: eyJwIjoiQmlndGFibGUvLk93bEJvdC55YW1sIiwiaCI6IjA0ZDAzZDE3YWFmYTdiNDQyMmY3M2M5MzYwMGYwNDA1NDI4MTdmY2QifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../Admin/V2/BigtableInstanceAdmin.php | 19 +- Bigtable/metadata/Admin/V2/Instance.php | Bin 3569 -> 3965 bytes Bigtable/metadata/V2/Bigtable.php | Bin 5910 -> 6367 bytes Bigtable/src/Admin/V2/AutoscalingTargets.php | 12 +- .../V2/BigtableInstanceAdminGrpcClient.php | 16 + .../src/Admin/V2/Cluster/EncryptionConfig.php | 4 - .../BigtableInstanceAdminGapicClient.php | 95 +++++- Bigtable/src/Admin/V2/HotTablet.php | 315 ++++++++++++++++++ .../src/Admin/V2/ListHotTabletsRequest.php | 275 +++++++++++++++ .../src/Admin/V2/ListHotTabletsResponse.php | 125 +++++++ ...bigtable_instance_admin_client_config.json | 5 + ...table_instance_admin_descriptor_config.php | 10 + ...able_instance_admin_rest_client_config.php | 11 + Bigtable/src/V2/BigtableGrpcClient.php | 16 + Bigtable/src/V2/Gapic/BigtableGapicClient.php | 87 +++++ Bigtable/src/V2/PingAndWarmRequest.php | 109 ++++++ Bigtable/src/V2/PingAndWarmResponse.php | 33 ++ Bigtable/src/V2/gapic_metadata.json | 5 + .../V2/resources/bigtable_client_config.json | 5 + .../resources/bigtable_rest_client_config.php | 12 + .../V2/BigtableInstanceAdminClientTest.php | 76 ++++- Bigtable/tests/Unit/V2/BigtableClientTest.php | 63 ++++ 22 files changed, 1279 insertions(+), 14 deletions(-) create mode 100644 Bigtable/src/Admin/V2/HotTablet.php create mode 100644 Bigtable/src/Admin/V2/ListHotTabletsRequest.php create mode 100644 Bigtable/src/Admin/V2/ListHotTabletsResponse.php create mode 100644 Bigtable/src/V2/PingAndWarmRequest.php create mode 100644 Bigtable/src/V2/PingAndWarmResponse.php diff --git a/Bigtable/metadata/Admin/V2/BigtableInstanceAdmin.php b/Bigtable/metadata/Admin/V2/BigtableInstanceAdmin.php index 8df9f1d39e1e..c4ca99083462 100644 --- a/Bigtable/metadata/Admin/V2/BigtableInstanceAdmin.php +++ b/Bigtable/metadata/Admin/V2/BigtableInstanceAdmin.php @@ -27,7 +27,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -Á@ +ÍD 6google/bigtable/admin/v2/bigtable_instance_admin.protogoogle.bigtable.admin.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto\'google/bigtable/admin/v2/instance.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"Û CreateInstanceRequestC parent ( B3àAúA- @@ -127,7 +127,19 @@ public static function initOnce() { name ( B/àAúA) \'bigtableadmin.googleapis.com/AppProfile ignore_warnings (BàA" -UpdateAppProfileMetadata2‰ +UpdateAppProfileMetadata"Ú +ListHotTabletsRequest< +parent ( B,àAúA& +$bigtableadmin.googleapis.com/Cluster. + +start_time ( 2.google.protobuf.Timestamp, +end_time ( 2.google.protobuf.Timestamp + page_size ( + +page_token ( "k +ListHotTabletsResponse8 + hot_tablets ( 2#.google.bigtable.admin.v2.HotTablet +next_page_token ( 2Ë! BigtableInstanceAdminÚ CreateInstance/.google.bigtable.admin.v2.CreateInstanceRequest.google.longrunning.Operation"x‚Óä“&"!/v2/{parent=projects/*}/instances:*ÚA$parent,instance_id,instance,clustersÊA" InstanceCreateInstanceMetadata‘ @@ -156,7 +168,8 @@ public static function initOnce() { DeleteAppProfile1.google.bigtable.admin.v2.DeleteAppProfileRequest.google.protobuf.Empty">‚Óä“1*//v2/{name=projects/*/instances/*/appProfiles/*}ÚAname“ GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"H‚Óä“7"2/v2/{resource=projects/*/instances/*}:getIamPolicy:*ÚAresourceš SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"O‚Óä“7"2/v2/{resource=projects/*/instances/*}:setIamPolicy:*ÚAresource,policyÅ -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"Z‚Óä“="8/v2/{resource=projects/*/instances/*}:testIamPermissions:*ÚAresource,permissionsšÊAbigtableadmin.googleapis.comÒA÷https://www.googleapis.com/auth/bigtable.admin,https://www.googleapis.com/auth/bigtable.admin.cluster,https://www.googleapis.com/auth/bigtable.admin.instance,https://www.googleapis.com/auth/cloud-bigtable.admin,https://www.googleapis.com/auth/cloud-bigtable.admin.cluster,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyBâ +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"Z‚Óä“="8/v2/{resource=projects/*/instances/*}:testIamPermissions:*ÚAresource,permissions¿ +ListHotTablets/.google.bigtable.admin.v2.ListHotTabletsRequest0.google.bigtable.admin.v2.ListHotTabletsResponse"J‚Óä“;9/v2/{parent=projects/*/instances/*/clusters/*}/hotTabletsÚAparentšÊAbigtableadmin.googleapis.comÒA÷https://www.googleapis.com/auth/bigtable.admin,https://www.googleapis.com/auth/bigtable.admin.cluster,https://www.googleapis.com/auth/bigtable.admin.instance,https://www.googleapis.com/auth/cloud-bigtable.admin,https://www.googleapis.com/auth/cloud-bigtable.admin.cluster,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyBâ com.google.bigtable.admin.v2BBigtableInstanceAdminProtoPZ=google.golang.org/genproto/googleapis/bigtable/admin/v2;adminªGoogle.Cloud.Bigtable.Admin.V2ÊGoogle\\Cloud\\Bigtable\\Admin\\V2ê"Google::Cloud::Bigtable::Admin::V2bproto3' , true); diff --git a/Bigtable/metadata/Admin/V2/Instance.php b/Bigtable/metadata/Admin/V2/Instance.php index c1a5ecb89fd804495582ac26ca43b133bda30523..e1e6f19af8ec2f2b7df6de99ba9dc26d5a05217e 100644 GIT binary patch delta 262 zcmew;{a0=SGc)T-39cCRiQej)^_k^3EtEQ#xi~%YOF|Npa#Bl#c(_>d5_3}}7!?>b zIEAdaxJp3c@nA6~keE}9`Y%TnE~UvAxn)JcnuLtGxQa^>i%Q~4GJ!goCm&}~8bGr zsYS`Dc_k9;KzSx7<_C__fdKSGc)TvQLY&EiQej)^_k^3H{ax4!UzC)1_*Ef diff --git a/Bigtable/metadata/V2/Bigtable.php b/Bigtable/metadata/V2/Bigtable.php index 084764919797c4113949aff1a0e9e6cef6f8fe13..ab1c621f186a92d6a3f240ca299aa4ec4702dd24 100644 GIT binary patch delta 313 zcmbQHci(VBH#1X<*5+R3v+R1ATtWevdFhUMDdCAlxk0IgrK!awLe^X?d5O8H5{wFr z8k|nL4;-0(ImW1SsZO5AA#3iLS6q^qmz*jj#>JOdP!L~Gl%JNFlNz6yBEbYwuO!MP zjACYSL4ICw>gGspenzGZBAc^#n%D&2F>-MuDH2kfe34H?6iEc?6sZ_>kc={l48%aC zUdE=&PbM>IE2-(18R=I~ZseDisint32 cpu_utilization_percent = 2; */ @@ -33,7 +34,8 @@ class AutoscalingTargets extends \Google\Protobuf\Internal\Message * @type int $cpu_utilization_percent * The cpu utilization that the Autoscaler should be trying to achieve. * This number is on a scale from 0 (no utilization) to - * 100 (total utilization). + * 100 (total utilization), and is limited between 10 and 80, otherwise it + * will return INVALID_ARGUMENT error. * } */ public function __construct($data = NULL) { @@ -44,7 +46,8 @@ public function __construct($data = NULL) { /** * The cpu utilization that the Autoscaler should be trying to achieve. * This number is on a scale from 0 (no utilization) to - * 100 (total utilization). + * 100 (total utilization), and is limited between 10 and 80, otherwise it + * will return INVALID_ARGUMENT error. * * Generated from protobuf field int32 cpu_utilization_percent = 2; * @return int @@ -57,7 +60,8 @@ public function getCpuUtilizationPercent() /** * The cpu utilization that the Autoscaler should be trying to achieve. * This number is on a scale from 0 (no utilization) to - * 100 (total utilization). + * 100 (total utilization), and is limited between 10 and 80, otherwise it + * will return INVALID_ARGUMENT error. * * Generated from protobuf field int32 cpu_utilization_percent = 2; * @param int $var diff --git a/Bigtable/src/Admin/V2/BigtableInstanceAdminGrpcClient.php b/Bigtable/src/Admin/V2/BigtableInstanceAdminGrpcClient.php index d0b131b9e597..d86ac2c55ab7 100644 --- a/Bigtable/src/Admin/V2/BigtableInstanceAdminGrpcClient.php +++ b/Bigtable/src/Admin/V2/BigtableInstanceAdminGrpcClient.php @@ -366,4 +366,20 @@ public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsReques $metadata, $options); } + /** + * Lists hot tablets in a cluster, within the time range provided. Hot + * tablets are ordered based on CPU usage. + * @param \Google\Cloud\Bigtable\Admin\V2\ListHotTabletsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListHotTablets(\Google\Cloud\Bigtable\Admin\V2\ListHotTabletsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListHotTablets', + $argument, + ['\Google\Cloud\Bigtable\Admin\V2\ListHotTabletsResponse', 'decode'], + $metadata, $options); + } + } diff --git a/Bigtable/src/Admin/V2/Cluster/EncryptionConfig.php b/Bigtable/src/Admin/V2/Cluster/EncryptionConfig.php index 7c96053470d6..0c7007aa5881 100644 --- a/Bigtable/src/Admin/V2/Cluster/EncryptionConfig.php +++ b/Bigtable/src/Admin/V2/Cluster/EncryptionConfig.php @@ -24,7 +24,6 @@ class EncryptionConfig extends \Google\Protobuf\Internal\Message * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. * 2) Only regional keys can be used and the region of the CMEK key must * match the region of the cluster. - * 3) All clusters within an instance must use the same CMEK key. * * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { */ @@ -44,7 +43,6 @@ class EncryptionConfig extends \Google\Protobuf\Internal\Message * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. * 2) Only regional keys can be used and the region of the CMEK key must * match the region of the cluster. - * 3) All clusters within an instance must use the same CMEK key. * } */ public function __construct($data = NULL) { @@ -60,7 +58,6 @@ public function __construct($data = NULL) { * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. * 2) Only regional keys can be used and the region of the CMEK key must * match the region of the cluster. - * 3) All clusters within an instance must use the same CMEK key. * * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { * @return string @@ -78,7 +75,6 @@ public function getKmsKeyName() * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. * 2) Only regional keys can be used and the region of the CMEK key must * match the region of the cluster. - * 3) All clusters within an instance must use the same CMEK key. * * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { * @param string $var diff --git a/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php b/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php index 650f23ec50b0..028badd52799 100644 --- a/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php +++ b/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php @@ -54,13 +54,15 @@ use Google\Cloud\Bigtable\Admin\V2\GetAppProfileRequest; use Google\Cloud\Bigtable\Admin\V2\GetClusterRequest; use Google\Cloud\Bigtable\Admin\V2\GetInstanceRequest; - use Google\Cloud\Bigtable\Admin\V2\Instance; + use Google\Cloud\Bigtable\Admin\V2\Instance\Type; use Google\Cloud\Bigtable\Admin\V2\ListAppProfilesRequest; use Google\Cloud\Bigtable\Admin\V2\ListAppProfilesResponse; use Google\Cloud\Bigtable\Admin\V2\ListClustersRequest; use Google\Cloud\Bigtable\Admin\V2\ListClustersResponse; +use Google\Cloud\Bigtable\Admin\V2\ListHotTabletsRequest; +use Google\Cloud\Bigtable\Admin\V2\ListHotTabletsResponse; use Google\Cloud\Bigtable\Admin\V2\ListInstancesRequest; use Google\Cloud\Bigtable\Admin\V2\ListInstancesResponse; use Google\Cloud\Bigtable\Admin\V2\PartialUpdateClusterRequest; @@ -73,8 +75,8 @@ use Google\Cloud\Iam\V1\TestIamPermissionsRequest; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; use Google\LongRunning\Operation; - use Google\Protobuf\FieldMask; + use Google\Protobuf\GPBEmpty; use Google\Protobuf\Timestamp; @@ -1099,6 +1101,95 @@ public function listClusters($parent, array $optionalArgs = []) return $this->startCall('ListClusters', ListClustersResponse::class, $optionalArgs, $request)->wait(); } + /** + * Lists hot tablets in a cluster, within the time range provided. Hot + * tablets are ordered based on CPU usage. + * + * Sample code: + * ``` + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); + * try { + * $formattedParent = $bigtableInstanceAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + * // Iterate over pages of elements + * $pagedResponse = $bigtableInstanceAdminClient->listHotTablets($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $bigtableInstanceAdminClient->listHotTablets($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $bigtableInstanceAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param array $optionalArgs { + * Optional. + * + * @type Timestamp $startTime + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * @type Timestamp $endTime + * The end time to list hot tablets. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listHotTablets($parent, array $optionalArgs = []) + { + $request = new ListHotTabletsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['startTime'])) { + $request->setStartTime($optionalArgs['startTime']); + } + + if (isset($optionalArgs['endTime'])) { + $request->setEndTime($optionalArgs['endTime']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListHotTablets', $optionalArgs, ListHotTabletsResponse::class, $request); + } + /** * Lists information about instances in a project. * diff --git a/Bigtable/src/Admin/V2/HotTablet.php b/Bigtable/src/Admin/V2/HotTablet.php new file mode 100644 index 000000000000..e3e13a3a8ab2 --- /dev/null +++ b/Bigtable/src/Admin/V2/HotTablet.php @@ -0,0 +1,315 @@ +google.bigtable.admin.v2.HotTablet + */ +class HotTablet extends \Google\Protobuf\Internal\Message +{ + /** + * The unique name of the hot tablet. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * Name of the table that contains the tablet. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * + * Generated from protobuf field string table_name = 2 [(.google.api.resource_reference) = { + */ + private $table_name = ''; + /** + * Output only. The start time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $start_time = null; + /** + * Output only. The end time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $end_time = null; + /** + * Tablet Start Key (inclusive). + * + * Generated from protobuf field string start_key = 5; + */ + private $start_key = ''; + /** + * Tablet End Key (inclusive). + * + * Generated from protobuf field string end_key = 6; + */ + private $end_key = ''; + /** + * Output only. The average CPU usage spent by a node on this tablet over the start_time to + * end_time time range. The percentage is the amount of CPU used by the node + * to serve the tablet, from 0% (tablet was not interacted with) to 100% (the + * node spent all cycles serving the hot tablet). + * + * Generated from protobuf field float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $node_cpu_usage_percent = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the hot tablet. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`. + * @type string $table_name + * Name of the table that contains the tablet. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The start time of the hot tablet. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The end time of the hot tablet. + * @type string $start_key + * Tablet Start Key (inclusive). + * @type string $end_key + * Tablet End Key (inclusive). + * @type float $node_cpu_usage_percent + * Output only. The average CPU usage spent by a node on this tablet over the start_time to + * end_time time range. The percentage is the amount of CPU used by the node + * to serve the tablet, from 0% (tablet was not interacted with) to 100% (the + * node spent all cycles serving the hot tablet). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The unique name of the hot tablet. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique name of the hot tablet. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`. + * + * 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; + } + + /** + * Name of the table that contains the tablet. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * + * Generated from protobuf field string table_name = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getTableName() + { + return $this->table_name; + } + + /** + * Name of the table that contains the tablet. Values are of the form + * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * + * Generated from protobuf field string table_name = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTableName($var) + { + GPBUtil::checkString($var, True); + $this->table_name = $var; + + return $this; + } + + /** + * Output only. The start time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The start time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. The end time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The end time of the hot tablet. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Tablet Start Key (inclusive). + * + * Generated from protobuf field string start_key = 5; + * @return string + */ + public function getStartKey() + { + return $this->start_key; + } + + /** + * Tablet Start Key (inclusive). + * + * Generated from protobuf field string start_key = 5; + * @param string $var + * @return $this + */ + public function setStartKey($var) + { + GPBUtil::checkString($var, True); + $this->start_key = $var; + + return $this; + } + + /** + * Tablet End Key (inclusive). + * + * Generated from protobuf field string end_key = 6; + * @return string + */ + public function getEndKey() + { + return $this->end_key; + } + + /** + * Tablet End Key (inclusive). + * + * Generated from protobuf field string end_key = 6; + * @param string $var + * @return $this + */ + public function setEndKey($var) + { + GPBUtil::checkString($var, True); + $this->end_key = $var; + + return $this; + } + + /** + * Output only. The average CPU usage spent by a node on this tablet over the start_time to + * end_time time range. The percentage is the amount of CPU used by the node + * to serve the tablet, from 0% (tablet was not interacted with) to 100% (the + * node spent all cycles serving the hot tablet). + * + * Generated from protobuf field float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getNodeCpuUsagePercent() + { + return $this->node_cpu_usage_percent; + } + + /** + * Output only. The average CPU usage spent by a node on this tablet over the start_time to + * end_time time range. The percentage is the amount of CPU used by the node + * to serve the tablet, from 0% (tablet was not interacted with) to 100% (the + * node spent all cycles serving the hot tablet). + * + * Generated from protobuf field float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setNodeCpuUsagePercent($var) + { + GPBUtil::checkFloat($var); + $this->node_cpu_usage_percent = $var; + + return $this; + } + +} + diff --git a/Bigtable/src/Admin/V2/ListHotTabletsRequest.php b/Bigtable/src/Admin/V2/ListHotTabletsRequest.php new file mode 100644 index 000000000000..e23d3bb663d0 --- /dev/null +++ b/Bigtable/src/Admin/V2/ListHotTabletsRequest.php @@ -0,0 +1,275 @@ +google.bigtable.admin.v2.ListHotTabletsRequest + */ +class ListHotTabletsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + */ + private $start_time = null; + /** + * The end time to list hot tablets. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + */ + private $end_time = null; + /** + * Maximum number of results per page. + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 4; + */ + private $page_size = 0; + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 5; + */ + private $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @type \Google\Protobuf\Timestamp $start_time + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * @type \Google\Protobuf\Timestamp $end_time + * The end time to list hot tablets. + * @type int $page_size + * Maximum number of results per page. + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + * @type string $page_token + * The value of `next_page_token` returned by a previous call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/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 cluster name to list hot tablets. + * Value is in the following form: + * `projects/{project}/instances/{instance}/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; + } + + /** + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The start time to list hot tablets. The hot tablets in the response will + * have start times between the requested start time and end time. Start time + * defaults to Now if it is unset, and end time defaults to Now - 24 hours if + * it is unset. The start time should be less than the end time, and the + * maximum allowed time range between start time and end time is 48 hours. + * Start time and end time should have values between Now and Now - 14 days. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The end time to list hot tablets. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The end time to list hot tablets. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Maximum number of results per page. + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of results per page. + * A page_size that is empty or zero lets the server choose the number of + * items to return. A page_size which is strictly positive will return at most + * that many items. A negative page_size will cause an error. + * Following the first request, subsequent paginated calls do not need a + * page_size field. If a page_size is set in subsequent calls, it must match + * the page_size given in the first request. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 5; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The value of `next_page_token` returned by a previous call. + * + * Generated from protobuf field string page_token = 5; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/Bigtable/src/Admin/V2/ListHotTabletsResponse.php b/Bigtable/src/Admin/V2/ListHotTabletsResponse.php new file mode 100644 index 000000000000..e0e86dbcbb37 --- /dev/null +++ b/Bigtable/src/Admin/V2/ListHotTabletsResponse.php @@ -0,0 +1,125 @@ +google.bigtable.admin.v2.ListHotTabletsResponse + */ +class ListHotTabletsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of hot tablets in the tables of the requested cluster that fall + * within the requested time range. Hot tablets are ordered by node cpu usage + * percent. If there are multiple hot tablets that correspond to the same + * tablet within a 15-minute interval, only the hot tablet with the highest + * node cpu usage will be included in the response. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + private $hot_tablets; + /** + * Set if not all hot tablets could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\HotTablet[]|\Google\Protobuf\Internal\RepeatedField $hot_tablets + * List of hot tablets in the tables of the requested cluster that fall + * within the requested time range. Hot tablets are ordered by node cpu usage + * percent. If there are multiple hot tablets that correspond to the same + * tablet within a 15-minute interval, only the hot tablet with the highest + * node cpu usage will be included in the response. + * @type string $next_page_token + * Set if not all hot tablets could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * List of hot tablets in the tables of the requested cluster that fall + * within the requested time range. Hot tablets are ordered by node cpu usage + * percent. If there are multiple hot tablets that correspond to the same + * tablet within a 15-minute interval, only the hot tablet with the highest + * node cpu usage will be included in the response. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHotTablets() + { + return $this->hot_tablets; + } + + /** + * List of hot tablets in the tables of the requested cluster that fall + * within the requested time range. Hot tablets are ordered by node cpu usage + * percent. If there are multiple hot tablets that correspond to the same + * tablet within a 15-minute interval, only the hot tablet with the highest + * node cpu usage will be included in the response. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\HotTablet[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHotTablets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\HotTablet::class); + $this->hot_tablets = $arr; + + return $this; + } + + /** + * Set if not all hot tablets could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Set if not all hot tablets could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_client_config.json b/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_client_config.json index 777756e61754..536c98a6fb2b 100644 --- a/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_client_config.json +++ b/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_client_config.json @@ -80,6 +80,11 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "ListHotTablets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, "ListInstances": { "timeout_millis": 60000, "retry_codes_name": "idempotent", diff --git a/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_descriptor_config.php b/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_descriptor_config.php index 0eba9c88f588..8ed837538e7f 100644 --- a/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_descriptor_config.php +++ b/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_descriptor_config.php @@ -73,6 +73,16 @@ 'resourcesGetMethod' => 'getAppProfiles', ], ], + 'ListHotTablets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getHotTablets', + ], + ], ], ], ]; diff --git a/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_rest_client_config.php b/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_rest_client_config.php index ad875d67545a..239d8b10ede8 100644 --- a/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_rest_client_config.php +++ b/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_rest_client_config.php @@ -148,6 +148,17 @@ ], ], ], + 'ListHotTablets' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/instances/*/clusters/*}/hotTablets', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListInstances' => [ 'method' => 'get', 'uriTemplate' => '/v2/{parent=projects/*}/instances', diff --git a/Bigtable/src/V2/BigtableGrpcClient.php b/Bigtable/src/V2/BigtableGrpcClient.php index c677934a3f71..d96b2cd00ce7 100644 --- a/Bigtable/src/V2/BigtableGrpcClient.php +++ b/Bigtable/src/V2/BigtableGrpcClient.php @@ -117,6 +117,22 @@ public function CheckAndMutateRow(\Google\Cloud\Bigtable\V2\CheckAndMutateRowReq $metadata, $options); } + /** + * Warm up associated instance metadata for this connection. + * This call is not required but may be useful for connection keep-alive. + * @param \Google\Cloud\Bigtable\V2\PingAndWarmRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function PingAndWarm(\Google\Cloud\Bigtable\V2\PingAndWarmRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.bigtable.v2.Bigtable/PingAndWarm', + $argument, + ['\Google\Cloud\Bigtable\V2\PingAndWarmResponse', 'decode'], + $metadata, $options); + } + /** * Modifies a row atomically on the server. The method reads the latest * existing timestamp and value from the specified columns and writes a new diff --git a/Bigtable/src/V2/Gapic/BigtableGapicClient.php b/Bigtable/src/V2/Gapic/BigtableGapicClient.php index f4c8d7765309..7c125a4ed853 100644 --- a/Bigtable/src/V2/Gapic/BigtableGapicClient.php +++ b/Bigtable/src/V2/Gapic/BigtableGapicClient.php @@ -43,6 +43,8 @@ use Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry; use Google\Cloud\Bigtable\V2\MutateRowsResponse; use Google\Cloud\Bigtable\V2\Mutation; +use Google\Cloud\Bigtable\V2\PingAndWarmRequest; +use Google\Cloud\Bigtable\V2\PingAndWarmResponse; use Google\Cloud\Bigtable\V2\ReadModifyWriteRowRequest; use Google\Cloud\Bigtable\V2\ReadModifyWriteRowResponse; use Google\Cloud\Bigtable\V2\ReadModifyWriteRule; @@ -111,6 +113,8 @@ class BigtableGapicClient 'https://www.googleapis.com/auth/cloud-platform.read-only', ]; + private static $instanceNameTemplate; + private static $tableNameTemplate; private static $pathTemplateMap; @@ -134,6 +138,15 @@ private static function getClientDefaults() ]; } + private static function getInstanceNameTemplate() + { + if (self::$instanceNameTemplate == null) { + self::$instanceNameTemplate = new PathTemplate('projects/{project}/instances/{instance}'); + } + + return self::$instanceNameTemplate; + } + private static function getTableNameTemplate() { if (self::$tableNameTemplate == null) { @@ -147,6 +160,7 @@ private static function getPathTemplateMap() { if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ + 'instance' => self::getInstanceNameTemplate(), 'table' => self::getTableNameTemplate(), ]; } @@ -154,6 +168,23 @@ private static function getPathTemplateMap() return self::$pathTemplateMap; } + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $instance + * + * @return string The formatted instance resource. + */ + public static function instanceName($project, $instance) + { + return self::getInstanceNameTemplate()->render([ + 'project' => $project, + 'instance' => $instance, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a table * resource. @@ -177,6 +208,7 @@ public static function tableName($project, $instance, $table) * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - instance: projects/{project}/instances/{instance} * - table: projects/{project}/instances/{instance}/tables/{table} * * The optional $template argument can be supplied to specify a particular pattern, @@ -492,6 +524,61 @@ public function mutateRows($tableName, $entries, array $optionalArgs = []) return $this->startCall('MutateRows', MutateRowsResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); } + /** + * Warm up associated instance metadata for this connection. + * This call is not required but may be useful for connection keep-alive. + * + * Sample code: + * ``` + * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); + * try { + * $formattedName = $bigtableClient->instanceName('[PROJECT]', '[INSTANCE]'); + * $response = $bigtableClient->pingAndWarm($formattedName); + * } finally { + * $bigtableClient->close(); + * } + * ``` + * + * @param string $name Required. The unique name of the instance to check permissions for as well as + * respond. Values are of the form `projects//instances/`. + * @param array $optionalArgs { + * Optional. + * + * @type string $appProfileId + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Bigtable\V2\PingAndWarmResponse + * + * @throws ApiException if the remote call fails + */ + public function pingAndWarm($name, array $optionalArgs = []) + { + $request = new PingAndWarmRequest(); + $requestParamHeaders = []; + $request->setName($name); + $nameMatches = []; + if (preg_match('/^(?projects\/[^\/]+\/instances\/[^\/]+)$/', $name, $nameMatches)) { + $requestParamHeaders['name'] = $nameMatches['name']; + } + + + if (isset($optionalArgs['appProfileId'])) { + $request->setAppProfileId($optionalArgs['appProfileId']); + $requestParamHeaders['app_profile_id'] = $optionalArgs['app_profile_id']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('PingAndWarm', PingAndWarmResponse::class, $optionalArgs, $request)->wait(); + } + /** * Modifies a row atomically on the server. The method reads the latest * existing timestamp and value from the specified columns and writes a new diff --git a/Bigtable/src/V2/PingAndWarmRequest.php b/Bigtable/src/V2/PingAndWarmRequest.php new file mode 100644 index 000000000000..4918a6050b62 --- /dev/null +++ b/Bigtable/src/V2/PingAndWarmRequest.php @@ -0,0 +1,109 @@ +google.bigtable.v2.PingAndWarmRequest + */ +class PingAndWarmRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique name of the instance to check permissions for as well as + * respond. Values are of the form `projects//instances/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2; + */ + private $app_profile_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique name of the instance to check permissions for as well as + * respond. Values are of the form `projects//instances/`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique name of the instance to check permissions for as well as + * respond. Values are of the form `projects//instances/`. + * + * 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 unique name of the instance to check permissions for as well as + * respond. Values are of the form `projects//instances/`. + * + * 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; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2; + * @return string + */ + public function getAppProfileId() + { + return $this->app_profile_id; + } + + /** + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * + * Generated from protobuf field string app_profile_id = 2; + * @param string $var + * @return $this + */ + public function setAppProfileId($var) + { + GPBUtil::checkString($var, True); + $this->app_profile_id = $var; + + return $this; + } + +} + diff --git a/Bigtable/src/V2/PingAndWarmResponse.php b/Bigtable/src/V2/PingAndWarmResponse.php new file mode 100644 index 000000000000..a14857274660 --- /dev/null +++ b/Bigtable/src/V2/PingAndWarmResponse.php @@ -0,0 +1,33 @@ +google.bigtable.v2.PingAndWarmResponse + */ +class PingAndWarmResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + +} + diff --git a/Bigtable/src/V2/gapic_metadata.json b/Bigtable/src/V2/gapic_metadata.json index 48bd5c1367bc..2c2a36147539 100644 --- a/Bigtable/src/V2/gapic_metadata.json +++ b/Bigtable/src/V2/gapic_metadata.json @@ -25,6 +25,11 @@ "mutateRows" ] }, + "PingAndWarm": { + "methods": [ + "pingAndWarm" + ] + }, "ReadModifyWriteRow": { "methods": [ "readModifyWriteRow" diff --git a/Bigtable/src/V2/resources/bigtable_client_config.json b/Bigtable/src/V2/resources/bigtable_client_config.json index c26bce8a7d2b..c0e9a393fec9 100644 --- a/Bigtable/src/V2/resources/bigtable_client_config.json +++ b/Bigtable/src/V2/resources/bigtable_client_config.json @@ -33,6 +33,11 @@ "MutateRows": { "timeout_millis": 60000 }, + "PingAndWarm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "ReadModifyWriteRow": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", diff --git a/Bigtable/src/V2/resources/bigtable_rest_client_config.php b/Bigtable/src/V2/resources/bigtable_rest_client_config.php index b38f79acdf33..38fffbd53013 100644 --- a/Bigtable/src/V2/resources/bigtable_rest_client_config.php +++ b/Bigtable/src/V2/resources/bigtable_rest_client_config.php @@ -39,6 +39,18 @@ ], ], ], + 'PingAndWarm' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/instances/*}:ping', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'ReadModifyWriteRow' => [ 'method' => 'post', 'uriTemplate' => '/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow', diff --git a/Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php b/Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php index 83898442c278..0411d15821b4 100644 --- a/Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php +++ b/Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php @@ -33,11 +33,13 @@ use Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient; use Google\Cloud\Bigtable\Admin\V2\Cluster; -use Google\Cloud\Bigtable\Admin\V2\Instance; +use Google\Cloud\Bigtable\Admin\V2\HotTablet; +use Google\Cloud\Bigtable\Admin\V2\Instance; use Google\Cloud\Bigtable\Admin\V2\Instance\Type; use Google\Cloud\Bigtable\Admin\V2\ListAppProfilesResponse; use Google\Cloud\Bigtable\Admin\V2\ListClustersResponse; +use Google\Cloud\Bigtable\Admin\V2\ListHotTabletsResponse; use Google\Cloud\Bigtable\Admin\V2\ListInstancesResponse; use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; @@ -1067,6 +1069,78 @@ public function listClustersExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** + * @test + */ + public function listHotTabletsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $hotTabletsElement = new HotTablet(); + $hotTablets = [ + $hotTabletsElement, + ]; + $expectedResponse = new ListHotTabletsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setHotTablets($hotTablets); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + $response = $client->listHotTablets($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getHotTablets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListHotTablets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listHotTabletsExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 + $formattedParent = $client->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + try { + $client->listHotTablets($formattedParent); + // If the $client 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 */ diff --git a/Bigtable/tests/Unit/V2/BigtableClientTest.php b/Bigtable/tests/Unit/V2/BigtableClientTest.php index a9619a17e80d..5884f230856d 100644 --- a/Bigtable/tests/Unit/V2/BigtableClientTest.php +++ b/Bigtable/tests/Unit/V2/BigtableClientTest.php @@ -33,6 +33,7 @@ use Google\Cloud\Bigtable\V2\CheckAndMutateRowResponse; use Google\Cloud\Bigtable\V2\MutateRowResponse; use Google\Cloud\Bigtable\V2\MutateRowsResponse; +use Google\Cloud\Bigtable\V2\PingAndWarmResponse; use Google\Cloud\Bigtable\V2\ReadModifyWriteRowResponse; use Google\Cloud\Bigtable\V2\ReadRowsResponse; use Google\Cloud\Bigtable\V2\SampleRowKeysResponse; @@ -289,6 +290,68 @@ public function mutateRowsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** + * @test + */ + public function pingAndWarmTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new PingAndWarmResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->instanceName('[PROJECT]', '[INSTANCE]'); + $response = $client->pingAndWarm($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.bigtable.v2.Bigtable/PingAndWarm', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function pingAndWarmExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->instanceName('[PROJECT]', '[INSTANCE]'); + try { + $client->pingAndWarm($formattedName); + // If the $client 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 */ From bf95626a166bffd6bdd619942f7557260ee5de81 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 10:45:09 -0700 Subject: [PATCH 7/9] feat: Add the ability to plumb environment capabilities through v1beta3 protos. (#5137) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix!: Use http binding with location field as primary http bindings Changing HTTP bindings and/or their order might be a breaking change for libraries. PiperOrigin-RevId: 430239565 Source-Link: https://github.com/googleapis/googleapis/commit/71fe7ff3f97d992e18d9390c61bd7fabf3d70eef Source-Link: https://github.com/googleapis/googleapis-gen/commit/1f496cc36dd77921e45a278114bbc2198cc8352a Copy-Tag: eyJwIjoiRGF0YWZsb3cvLk93bEJvdC55YW1sIiwiaCI6IjFmNDk2Y2MzNmRkNzc5MjFlNDVhMjc4MTE0YmJjMjE5OGNjODM1MmEifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add the ability to plumb environment capabilities through v1beta3 protos. PiperOrigin-RevId: 434899727 Source-Link: https://github.com/googleapis/googleapis/commit/392ae91765566c9a32512b9b889fac1d7000acf9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/febf173172483fcebd5668dd32f3d7352a4420ce Copy-Tag: eyJwIjoiRGF0YWZsb3cvLk93bEJvdC55YW1sIiwiaCI6ImZlYmYxNzMxNzI0ODNmY2ViZDU2NjhkZDMyZjNkNzM1MmE0NDIwY2UifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- Dataflow/metadata/V1Beta3/Environment.php | Bin 4663 -> 4686 bytes Dataflow/metadata/V1Beta3/Jobs.php | Bin 9122 -> 9123 bytes Dataflow/metadata/V1Beta3/Messages.php | Bin 3096 -> 3096 bytes Dataflow/metadata/V1Beta3/Metrics.php | Bin 4645 -> 4645 bytes Dataflow/metadata/V1Beta3/Snapshots.php | Bin 3089 -> 3091 bytes Dataflow/metadata/V1Beta3/Templates.php | Bin 8213 -> 8213 bytes Dataflow/src/V1beta3/Job.php | 1 - .../src/V1beta3/SdkHarnessContainerImage.php | 38 ++++++++++++++++++ .../jobs_v1_beta3_rest_client_config.php | 20 ++++----- .../messages_v1_beta3_rest_client_config.php | 4 +- .../metrics_v1_beta3_rest_client_config.php | 4 +- .../snapshots_v1_beta3_rest_client_config.php | 12 +++--- .../templates_service_rest_client_config.php | 12 +++--- 13 files changed, 64 insertions(+), 27 deletions(-) diff --git a/Dataflow/metadata/V1Beta3/Environment.php b/Dataflow/metadata/V1Beta3/Environment.php index 6eb60d0042d5cecf12953934c544af020faff076..d8b39d231684eab15dac8ab887e7e0d66fccdb0e 100644 GIT binary patch delta 47 zcmdn4a!zGKCllk3&0S2t*_b*QC%17Hi3o{s@gye}Bqn9%WR_&67E7=wFmL|G>Bs>9 Dn$Zu{ delta 31 ncmX@7vR!3ECllkt&0S2t*_eyCBqs0Wm6*JcGh#D8mpumn#Ka2U diff --git a/Dataflow/metadata/V1Beta3/Jobs.php b/Dataflow/metadata/V1Beta3/Jobs.php index bf0438cd6b210e5e51bfb524f0b56297aa5c42d5..0f3b111b454a8044ad55a582975d30b4885c239f 100644 GIT binary patch delta 128 zcmZ4FzSw=kT^UBx$q9<4Tvp6k`AJbR>PiYguFPZ$*l$<V)FP3j%WHbUApf!1cA~#EvkCHo* MX1X1 diff --git a/Dataflow/metadata/V1Beta3/Metrics.php b/Dataflow/metadata/V1Beta3/Metrics.php index 064367dc020da08280154d0f931018603a78e1c3..47491a4e066a68e64ab56e4c6690a4a5a98d2c19 100644 GIT binary patch delta 28 kcmZ3gvQ%ZmBVIp;wlh1L=0R_4zf8bOD3Thz>@=t!nQ4Nxq VypGeJ8KFUR@^nt|&0<`C83B@BANK$N diff --git a/Dataflow/metadata/V1Beta3/Templates.php b/Dataflow/metadata/V1Beta3/Templates.php index 7eb6dd99b39336a8e9b4648bff379ab876841734..476548baf099eca7cf2351eec155432e2447d164 100644 GIT binary patch delta 77 zcmbR0Fx6qhSINnWQg$p+T1u*uFUZPF{w>8dIaaE1vZ8b-OO&IM4pdNia+!1qqaBcE VIN4K%mnBMDNE4=hbFj=IW&jYd8XEur delta 97 zcmbR0Fx6qhS4l?I$rog01WHnK3vv=mQj4t^wW92mtbl@slLe%?CdW!OGU|YoOb(V- kW{C<@a)e4LPcD-#VblamdCKszL^%lA!E|j7mN~=>04google.dataflow.v1beta3.Job */ diff --git a/Dataflow/src/V1beta3/SdkHarnessContainerImage.php b/Dataflow/src/V1beta3/SdkHarnessContainerImage.php index 7d4638867c5d..acdf9f0819a3 100644 --- a/Dataflow/src/V1beta3/SdkHarnessContainerImage.php +++ b/Dataflow/src/V1beta3/SdkHarnessContainerImage.php @@ -38,6 +38,13 @@ class SdkHarnessContainerImage extends \Google\Protobuf\Internal\Message * Generated from protobuf field string environment_id = 3; */ private $environment_id = ''; + /** + * The set of capabilities enumerated in the above Environment proto. See also + * https://github.com/apache/beam/blob/master/model/pipeline/src/main/proto/beam_runner_api.proto + * + * Generated from protobuf field repeated string capabilities = 4; + */ + private $capabilities; /** * Constructor. @@ -56,6 +63,9 @@ class SdkHarnessContainerImage extends \Google\Protobuf\Internal\Message * @type string $environment_id * Environment ID for the Beam runner API proto Environment that corresponds * to the current SDK Harness. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $capabilities + * The set of capabilities enumerated in the above Environment proto. See also + * https://github.com/apache/beam/blob/master/model/pipeline/src/main/proto/beam_runner_api.proto * } */ public function __construct($data = NULL) { @@ -151,5 +161,33 @@ public function setEnvironmentId($var) return $this; } + /** + * The set of capabilities enumerated in the above Environment proto. See also + * https://github.com/apache/beam/blob/master/model/pipeline/src/main/proto/beam_runner_api.proto + * + * Generated from protobuf field repeated string capabilities = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCapabilities() + { + return $this->capabilities; + } + + /** + * The set of capabilities enumerated in the above Environment proto. See also + * https://github.com/apache/beam/blob/master/model/pipeline/src/main/proto/beam_runner_api.proto + * + * Generated from protobuf field repeated string capabilities = 4; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCapabilities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->capabilities = $arr; + + return $this; + } + } diff --git a/Dataflow/src/V1beta3/resources/jobs_v1_beta3_rest_client_config.php b/Dataflow/src/V1beta3/resources/jobs_v1_beta3_rest_client_config.php index 8714c06915e6..a2703167fed9 100644 --- a/Dataflow/src/V1beta3/resources/jobs_v1_beta3_rest_client_config.php +++ b/Dataflow/src/V1beta3/resources/jobs_v1_beta3_rest_client_config.php @@ -16,12 +16,12 @@ ], 'CreateJob' => [ 'method' => 'post', - 'uriTemplate' => '/v1b3/projects/{project_id}/jobs', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs', 'body' => 'job', 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs', + 'uriTemplate' => '/v1b3/projects/{project_id}/jobs', 'body' => 'job', ], ], @@ -40,11 +40,11 @@ ], 'GetJob' => [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/jobs/{job_id}', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}', 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}', + 'uriTemplate' => '/v1b3/projects/{project_id}/jobs/{job_id}', ], ], 'placeholders' => [ @@ -67,11 +67,11 @@ ], 'ListJobs' => [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/jobs', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs', 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs', + 'uriTemplate' => '/v1b3/projects/{project_id}/jobs', ], ], 'placeholders' => [ @@ -89,12 +89,12 @@ ], 'SnapshotJob' => [ 'method' => 'post', - 'uriTemplate' => '/v1b3/projects/{project_id}/jobs/{job_id}:snapshot', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}:snapshot', 'body' => '*', 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}:snapshot', + 'uriTemplate' => '/v1b3/projects/{project_id}/jobs/{job_id}:snapshot', 'body' => '*', ], ], @@ -118,12 +118,12 @@ ], 'UpdateJob' => [ 'method' => 'put', - 'uriTemplate' => '/v1b3/projects/{project_id}/jobs/{job_id}', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}', 'body' => 'job', 'additionalBindings' => [ [ 'method' => 'put', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}', + 'uriTemplate' => '/v1b3/projects/{project_id}/jobs/{job_id}', 'body' => 'job', ], ], diff --git a/Dataflow/src/V1beta3/resources/messages_v1_beta3_rest_client_config.php b/Dataflow/src/V1beta3/resources/messages_v1_beta3_rest_client_config.php index 4dbaaa8646d4..3ce2653db7b8 100644 --- a/Dataflow/src/V1beta3/resources/messages_v1_beta3_rest_client_config.php +++ b/Dataflow/src/V1beta3/resources/messages_v1_beta3_rest_client_config.php @@ -5,11 +5,11 @@ 'google.dataflow.v1beta3.MessagesV1Beta3' => [ 'ListJobMessages' => [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/jobs/{job_id}/messages', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/messages', 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/messages', + 'uriTemplate' => '/v1b3/projects/{project_id}/jobs/{job_id}/messages', ], ], 'placeholders' => [ diff --git a/Dataflow/src/V1beta3/resources/metrics_v1_beta3_rest_client_config.php b/Dataflow/src/V1beta3/resources/metrics_v1_beta3_rest_client_config.php index 5a1f03e59b9a..28120e7fada4 100644 --- a/Dataflow/src/V1beta3/resources/metrics_v1_beta3_rest_client_config.php +++ b/Dataflow/src/V1beta3/resources/metrics_v1_beta3_rest_client_config.php @@ -26,11 +26,11 @@ ], 'GetJobMetrics' => [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/jobs/{job_id}/metrics', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/metrics', 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/metrics', + 'uriTemplate' => '/v1b3/projects/{project_id}/jobs/{job_id}/metrics', ], ], 'placeholders' => [ diff --git a/Dataflow/src/V1beta3/resources/snapshots_v1_beta3_rest_client_config.php b/Dataflow/src/V1beta3/resources/snapshots_v1_beta3_rest_client_config.php index 52637dcf2f2f..14108f53ebed 100644 --- a/Dataflow/src/V1beta3/resources/snapshots_v1_beta3_rest_client_config.php +++ b/Dataflow/src/V1beta3/resources/snapshots_v1_beta3_rest_client_config.php @@ -5,11 +5,11 @@ 'google.dataflow.v1beta3.SnapshotsV1Beta3' => [ 'DeleteSnapshot' => [ 'method' => 'delete', - 'uriTemplate' => '/v1b3/projects/{project_id}/snapshots', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}', 'additionalBindings' => [ [ 'method' => 'delete', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}', + 'uriTemplate' => '/v1b3/projects/{project_id}/snapshots', ], ], 'placeholders' => [ @@ -32,11 +32,11 @@ ], 'GetSnapshot' => [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/snapshots/{snapshot_id}', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}', 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}', + 'uriTemplate' => '/v1b3/projects/{project_id}/snapshots/{snapshot_id}', ], ], 'placeholders' => [ @@ -59,7 +59,7 @@ ], 'ListSnapshots' => [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/snapshots', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/snapshots', 'additionalBindings' => [ [ 'method' => 'get', @@ -67,7 +67,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/snapshots', + 'uriTemplate' => '/v1b3/projects/{project_id}/snapshots', ], ], 'placeholders' => [ diff --git a/Dataflow/src/V1beta3/resources/templates_service_rest_client_config.php b/Dataflow/src/V1beta3/resources/templates_service_rest_client_config.php index b4e443cfbe8b..7b3c01358599 100644 --- a/Dataflow/src/V1beta3/resources/templates_service_rest_client_config.php +++ b/Dataflow/src/V1beta3/resources/templates_service_rest_client_config.php @@ -5,12 +5,12 @@ 'google.dataflow.v1beta3.TemplatesService' => [ 'CreateJobFromTemplate' => [ 'method' => 'post', - 'uriTemplate' => '/v1b3/projects/{project_id}/templates', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/templates', 'body' => '*', 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/templates', + 'uriTemplate' => '/v1b3/projects/{project_id}/templates', 'body' => '*', ], ], @@ -29,11 +29,11 @@ ], 'GetTemplate' => [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/templates:get', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/templates:get', 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/templates:get', + 'uriTemplate' => '/v1b3/projects/{project_id}/templates:get', ], ], 'placeholders' => [ @@ -51,12 +51,12 @@ ], 'LaunchTemplate' => [ 'method' => 'post', - 'uriTemplate' => '/v1b3/projects/{project_id}/templates:launch', + 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/templates:launch', 'body' => 'launch_parameters', 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1b3/projects/{project_id}/locations/{location}/templates:launch', + 'uriTemplate' => '/v1b3/projects/{project_id}/templates:launch', 'body' => 'launch_parameters', ], ], From 3bb58ea72d01e2a7b9a370c80bee46d0565a85b3 Mon Sep 17 00:00:00 2001 From: Vishwaraj Anand Date: Wed, 25 May 2022 14:09:02 +0000 Subject: [PATCH 8/9] limiting shorthand operators to not equals --- Datastore/src/Query/Query.php | 4 +--- Datastore/tests/Unit/Query/QueryTest.php | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Datastore/src/Query/Query.php b/Datastore/src/Query/Query.php index dbdc51f3c592..d342e1b413c9 100644 --- a/Datastore/src/Query/Query.php +++ b/Datastore/src/Query/Query.php @@ -116,9 +116,7 @@ class Query implements QueryInterface '>' => self::OP_GREATER_THAN, '>=' => self::OP_GREATER_THAN_OR_EQUAL, '=' => self::OP_EQUALS, - '!=' => self::OP_NOT_EQUALS, - 'IN' => self::OP_IN, - 'NOT_IN' => self::OP_NOT_IN, + '!=' => self::OP_NOT_EQUALS ]; /** diff --git a/Datastore/tests/Unit/Query/QueryTest.php b/Datastore/tests/Unit/Query/QueryTest.php index f7047cf6ebc7..de289d9ba90b 100644 --- a/Datastore/tests/Unit/Query/QueryTest.php +++ b/Datastore/tests/Unit/Query/QueryTest.php @@ -297,6 +297,15 @@ public function testShortOperatorEquals() $this->assertEquals('EQUAL', $filters[0]['propertyFilter']['op']); } + public function testShortOperatorNotEquals() + { + $this->query->filter('propName', '!=', 'val'); + $res = $this->query->queryObject(); + + $filters = $res['filter']['compositeFilter']['filters']; + $this->assertEquals('NOT_EQUAL', $filters[0]['propertyFilter']['op']); + } + public function testOrder() { $direction = 'DESCENDING'; From 4bb83968619d808c437397da6a686f9f85225afd Mon Sep 17 00:00:00 2001 From: Vishwaraj Anand Date: Thu, 26 May 2022 07:53:28 +0000 Subject: [PATCH 9/9] Added short operator to filter documentation --- Datastore/src/Query/Query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Datastore/src/Query/Query.php b/Datastore/src/Query/Query.php index d342e1b413c9..0d3a62dc595b 100644 --- a/Datastore/src/Query/Query.php +++ b/Datastore/src/Query/Query.php @@ -250,7 +250,7 @@ public function kind($kinds) * [here](https://cloud.google.com/datastore/reference/rest/v1/projects/runQuery#operator_1). * Short comparison operators are provided for convenience and are * mapped to their datastore-compatible equivalents. Available short - * operators are `=`, `<`, `<=`, `>`, and `>=`. + * operators are `=`, `!=`, `<`, `<=`, `>`, and `>=`. * @param mixed $value The value to check. * @return Query */