Skip to content

Commit

Permalink
feat: Add IAM GetPolicyOptions support and update retry and t… (#2129)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and jdpedrie committed Jul 25, 2019
1 parent d9b5dcb commit 029263b
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 74 deletions.
7 changes: 7 additions & 0 deletions src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
use Google\Cloud\Bigtable\Admin\V2\PartialUpdateInstanceRequest;
use Google\Cloud\Bigtable\Admin\V2\UpdateAppProfileRequest;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\GetPolicyOptions;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
Expand Down Expand Up @@ -1609,6 +1610,9 @@ public function deleteAppProfile($name, $ignoreWarnings, array $optionalArgs = [
* @param array $optionalArgs {
* Optional.
*
* @type GetPolicyOptions $options
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
* `GetIamPolicy`. This field is only used by Cloud IAM.
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a
* {@see Google\ApiCore\RetrySettings} object, or an associative array
Expand All @@ -1625,6 +1629,9 @@ public function getIamPolicy($resource, array $optionalArgs = [])
{
$request = new GetIamPolicyRequest();
$request->setResource($resource);
if (isset($optionalArgs['options'])) {
$request->setOptions($optionalArgs['options']);
}

$requestParams = new RequestParamsHeaderDescriptor([
'resource' => $request->getResource(),
Expand Down
64 changes: 40 additions & 24 deletions src/Admin/V2/resources/bigtable_instance_admin_client_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,116 +6,132 @@
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": [
"UNAVAILABLE"
]
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retry_delay_millis": 5,
"idempotent_params": {
"initial_retry_delay_millis": 1000,
"retry_delay_multiplier": 2.0,
"max_retry_delay_millis": 60000,
"initial_rpc_timeout_millis": 60000,
"rpc_timeout_multiplier": 1.0,
"max_rpc_timeout_millis": 60000,
"total_timeout_millis": 600000
},
"non_idempotent_params": {
"initial_retry_delay_millis": 0,
"retry_delay_multiplier": 1.0,
"max_retry_delay_millis": 0,
"initial_rpc_timeout_millis": 60000,
"rpc_timeout_multiplier": 1.0,
"max_rpc_timeout_millis": 60000,
"total_timeout_millis": 60000
},
"non_idempotent_heavy_params": {
"initial_retry_delay_millis": 0,
"retry_delay_multiplier": 1.0,
"max_retry_delay_millis": 0,
"initial_rpc_timeout_millis": 300000,
"rpc_timeout_multiplier": 1.0,
"max_rpc_timeout_millis": 300000,
"total_timeout_millis": 300000
}
},
"methods": {
"CreateInstance": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_heavy_params"
},
"GetInstance": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"ListInstances": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"UpdateInstance": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"PartialUpdateInstance": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"DeleteInstance": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_params"
},
"CreateCluster": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_params"
},
"GetCluster": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"ListClusters": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"UpdateCluster": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"DeleteCluster": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_params"
},
"CreateAppProfile": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_params"
},
"GetAppProfile": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"ListAppProfiles": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"UpdateAppProfile": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"DeleteAppProfile": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_params"
},
"GetIamPolicy": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"SetIamPolicy": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_params"
},
"TestIamPermissions": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'initialPollDelayMillis' => '500',
'pollDelayMultiplier' => '1.5',
'maxPollDelayMillis' => '5000',
'totalPollTimeoutMillis' => '300000',
'totalPollTimeoutMillis' => '600000',
],
],
'PartialUpdateInstance' => [
Expand All @@ -20,17 +20,17 @@
'initialPollDelayMillis' => '500',
'pollDelayMultiplier' => '1.5',
'maxPollDelayMillis' => '5000',
'totalPollTimeoutMillis' => '300000',
'totalPollTimeoutMillis' => '600000',
],
],
'CreateCluster' => [
'longRunning' => [
'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Cluster',
'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata',
'initialPollDelayMillis' => '500',
'initialPollDelayMillis' => '5000',
'pollDelayMultiplier' => '1.5',
'maxPollDelayMillis' => '5000',
'totalPollTimeoutMillis' => '300000',
'maxPollDelayMillis' => '60000',
'totalPollTimeoutMillis' => '21600000',
],
],
'UpdateCluster' => [
Expand All @@ -40,17 +40,17 @@
'initialPollDelayMillis' => '500',
'pollDelayMultiplier' => '1.5',
'maxPollDelayMillis' => '5000',
'totalPollTimeoutMillis' => '300000',
'totalPollTimeoutMillis' => '600000',
],
],
'UpdateAppProfile' => [
'longRunning' => [
'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\AppProfile',
'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\UpdateAppProfileMetadata',
'initialPollDelayMillis' => '5',
'initialPollDelayMillis' => '500',
'pollDelayMultiplier' => '1.5',
'maxPollDelayMillis' => '5000',
'totalPollTimeoutMillis' => '300000',
'totalPollTimeoutMillis' => '600000',
],
],
'ListAppProfiles' => [
Expand Down
63 changes: 45 additions & 18 deletions src/Admin/V2/resources/bigtable_table_admin_client_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,81 +9,108 @@
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retry_delay_millis": 100,
"retry_delay_multiplier": 1.3,
"idempotent_params": {
"initial_retry_delay_millis": 1000,
"retry_delay_multiplier": 2.0,
"max_retry_delay_millis": 60000,
"initial_rpc_timeout_millis": 20000,
"initial_rpc_timeout_millis": 60000,
"rpc_timeout_multiplier": 1.0,
"max_rpc_timeout_millis": 20000,
"max_rpc_timeout_millis": 60000,
"total_timeout_millis": 600000
},
"non_idempotent_params": {
"initial_retry_delay_millis": 0,
"retry_delay_multiplier": 1.0,
"max_retry_delay_millis": 0,
"initial_rpc_timeout_millis": 60000,
"rpc_timeout_multiplier": 1.0,
"max_rpc_timeout_millis": 60000,
"total_timeout_millis": 60000
},
"non_idempotent_heavy_params": {
"initial_retry_delay_millis": 0,
"retry_delay_multiplier": 1.0,
"max_retry_delay_millis": 0,
"initial_rpc_timeout_millis": 300000,
"rpc_timeout_multiplier": 1.0,
"max_rpc_timeout_millis": 300000,
"total_timeout_millis": 300000
},
"drop_row_range_params": {
"initial_retry_delay_millis": 0,
"retry_delay_multiplier": 1.0,
"max_retry_delay_millis": 0,
"initial_rpc_timeout_millis": 3600000,
"rpc_timeout_multiplier": 1.0,
"max_rpc_timeout_millis": 3600000,
"total_timeout_millis": 3600000
}
},
"methods": {
"CreateTable": {
"timeout_millis": 130000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_heavy_params"
},
"CreateTableFromSnapshot": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_params"
},
"ListTables": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"GetTable": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"DeleteTable": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_params"
},
"ModifyColumnFamilies": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_heavy_params"
},
"DropRowRange": {
"timeout_millis": 900000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "drop_row_range_params"
},
"GenerateConsistencyToken": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"CheckConsistency": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"SnapshotTable": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_params"
},
"GetSnapshot": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"ListSnapshots": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
"retry_params_name": "idempotent_params"
},
"DeleteSnapshot": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
"retry_params_name": "non_idempotent_params"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
'longRunning' => [
'operationReturnType' => '\Google\Cloud\Bigtable\Admin\V2\Table',
'metadataReturnType' => '\Google\Cloud\Bigtable\Admin\V2\CreateTableFromSnapshotMetadata',
'initialPollDelayMillis' => '500',
'initialPollDelayMillis' => '5000',
'pollDelayMultiplier' => '1.5',
'maxPollDelayMillis' => '5000',
'totalPollTimeoutMillis' => '300000',
'maxPollDelayMillis' => '60000',
'totalPollTimeoutMillis' => '3600000',
],
],
'SnapshotTable' => [
Expand All @@ -20,7 +20,7 @@
'initialPollDelayMillis' => '500',
'pollDelayMultiplier' => '1.5',
'maxPollDelayMillis' => '5000',
'totalPollTimeoutMillis' => '300000',
'totalPollTimeoutMillis' => '600000',
],
],
'ListTables' => [
Expand Down
Loading

0 comments on commit 029263b

Please sign in to comment.