Skip to content

Commit 149680b

Browse files
1 parent 488f7ca commit 149680b

7 files changed

Lines changed: 289 additions & 1 deletion

src/SQLAdmin.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*
2828
* <p>
2929
* For more information about this service, see the API
30-
* <a href="https://developers.google.com/cloud-sql/" target="_blank">Documentation</a>
30+
* <a href="https://cloud.google.com/sql/docs" target="_blank">Documentation</a>
3131
* </p>
3232
*
3333
* @author Google, Inc.
@@ -726,6 +726,21 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
726726
'required' => true,
727727
],
728728
],
729+
],'preCheckMajorVersionUpgrade' => [
730+
'path' => 'v1/projects/{project}/instances/{instance}/preCheckMajorVersionUpgrade',
731+
'httpMethod' => 'POST',
732+
'parameters' => [
733+
'project' => [
734+
'location' => 'path',
735+
'type' => 'string',
736+
'required' => true,
737+
],
738+
'instance' => [
739+
'location' => 'path',
740+
'type' => 'string',
741+
'required' => true,
742+
],
743+
],
729744
],'promoteReplica' => [
730745
'path' => 'v1/projects/{project}/instances/{instance}/promoteReplica',
731746
'httpMethod' => 'POST',
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\SQLAdmin;
19+
20+
class InstancesPreCheckMajorVersionUpgradeRequest extends \Google\Model
21+
{
22+
protected $preCheckMajorVersionUpgradeContextType = PreCheckMajorVersionUpgradeContext::class;
23+
protected $preCheckMajorVersionUpgradeContextDataType = '';
24+
25+
/**
26+
* @param PreCheckMajorVersionUpgradeContext
27+
*/
28+
public function setPreCheckMajorVersionUpgradeContext(PreCheckMajorVersionUpgradeContext $preCheckMajorVersionUpgradeContext)
29+
{
30+
$this->preCheckMajorVersionUpgradeContext = $preCheckMajorVersionUpgradeContext;
31+
}
32+
/**
33+
* @return PreCheckMajorVersionUpgradeContext
34+
*/
35+
public function getPreCheckMajorVersionUpgradeContext()
36+
{
37+
return $this->preCheckMajorVersionUpgradeContext;
38+
}
39+
}
40+
41+
// Adding a class alias for backwards compatibility with the previous class name.
42+
class_alias(InstancesPreCheckMajorVersionUpgradeRequest::class, 'Google_Service_SQLAdmin_InstancesPreCheckMajorVersionUpgradeRequest');

src/SQLAdmin/Operation.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class Operation extends \Google\Model
5151
* @var string
5252
*/
5353
public $operationType;
54+
protected $preCheckMajorVersionUpgradeContextType = PreCheckMajorVersionUpgradeContext::class;
55+
protected $preCheckMajorVersionUpgradeContextDataType = '';
5456
/**
5557
* @var string
5658
*/
@@ -236,6 +238,20 @@ public function getOperationType()
236238
{
237239
return $this->operationType;
238240
}
241+
/**
242+
* @param PreCheckMajorVersionUpgradeContext
243+
*/
244+
public function setPreCheckMajorVersionUpgradeContext(PreCheckMajorVersionUpgradeContext $preCheckMajorVersionUpgradeContext)
245+
{
246+
$this->preCheckMajorVersionUpgradeContext = $preCheckMajorVersionUpgradeContext;
247+
}
248+
/**
249+
* @return PreCheckMajorVersionUpgradeContext
250+
*/
251+
public function getPreCheckMajorVersionUpgradeContext()
252+
{
253+
return $this->preCheckMajorVersionUpgradeContext;
254+
}
239255
/**
240256
* @param string
241257
*/
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\SQLAdmin;
19+
20+
class PreCheckMajorVersionUpgradeContext extends \Google\Collection
21+
{
22+
protected $collection_key = 'preCheckResponse';
23+
/**
24+
* @var string
25+
*/
26+
public $kind;
27+
protected $preCheckResponseType = PreCheckResponse::class;
28+
protected $preCheckResponseDataType = 'array';
29+
/**
30+
* @var string
31+
*/
32+
public $targetDatabaseVersion;
33+
34+
/**
35+
* @param string
36+
*/
37+
public function setKind($kind)
38+
{
39+
$this->kind = $kind;
40+
}
41+
/**
42+
* @return string
43+
*/
44+
public function getKind()
45+
{
46+
return $this->kind;
47+
}
48+
/**
49+
* @param PreCheckResponse[]
50+
*/
51+
public function setPreCheckResponse($preCheckResponse)
52+
{
53+
$this->preCheckResponse = $preCheckResponse;
54+
}
55+
/**
56+
* @return PreCheckResponse[]
57+
*/
58+
public function getPreCheckResponse()
59+
{
60+
return $this->preCheckResponse;
61+
}
62+
/**
63+
* @param string
64+
*/
65+
public function setTargetDatabaseVersion($targetDatabaseVersion)
66+
{
67+
$this->targetDatabaseVersion = $targetDatabaseVersion;
68+
}
69+
/**
70+
* @return string
71+
*/
72+
public function getTargetDatabaseVersion()
73+
{
74+
return $this->targetDatabaseVersion;
75+
}
76+
}
77+
78+
// Adding a class alias for backwards compatibility with the previous class name.
79+
class_alias(PreCheckMajorVersionUpgradeContext::class, 'Google_Service_SQLAdmin_PreCheckMajorVersionUpgradeContext');

src/SQLAdmin/PreCheckResponse.php

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\SQLAdmin;
19+
20+
class PreCheckResponse extends \Google\Collection
21+
{
22+
protected $collection_key = 'actionsRequired';
23+
/**
24+
* @var string[]
25+
*/
26+
public $actionsRequired;
27+
/**
28+
* @var string
29+
*/
30+
public $message;
31+
/**
32+
* @var string
33+
*/
34+
public $messageType;
35+
36+
/**
37+
* @param string[]
38+
*/
39+
public function setActionsRequired($actionsRequired)
40+
{
41+
$this->actionsRequired = $actionsRequired;
42+
}
43+
/**
44+
* @return string[]
45+
*/
46+
public function getActionsRequired()
47+
{
48+
return $this->actionsRequired;
49+
}
50+
/**
51+
* @param string
52+
*/
53+
public function setMessage($message)
54+
{
55+
$this->message = $message;
56+
}
57+
/**
58+
* @return string
59+
*/
60+
public function getMessage()
61+
{
62+
return $this->message;
63+
}
64+
/**
65+
* @param string
66+
*/
67+
public function setMessageType($messageType)
68+
{
69+
$this->messageType = $messageType;
70+
}
71+
/**
72+
* @return string
73+
*/
74+
public function getMessageType()
75+
{
76+
return $this->messageType;
77+
}
78+
}
79+
80+
// Adding a class alias for backwards compatibility with the previous class name.
81+
class_alias(PreCheckResponse::class, 'Google_Service_SQLAdmin_PreCheckResponse');

src/SQLAdmin/ReadPoolAutoScaleConfig.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ class ReadPoolAutoScaleConfig extends \Google\Collection
3636
* @var int
3737
*/
3838
public $minNodeCount;
39+
/**
40+
* @var int
41+
*/
42+
public $scaleInCooldownSeconds;
43+
/**
44+
* @var int
45+
*/
46+
public $scaleOutCooldownSeconds;
3947
protected $targetMetricsType = TargetMetric::class;
4048
protected $targetMetricsDataType = 'array';
4149

@@ -95,6 +103,34 @@ public function getMinNodeCount()
95103
{
96104
return $this->minNodeCount;
97105
}
106+
/**
107+
* @param int
108+
*/
109+
public function setScaleInCooldownSeconds($scaleInCooldownSeconds)
110+
{
111+
$this->scaleInCooldownSeconds = $scaleInCooldownSeconds;
112+
}
113+
/**
114+
* @return int
115+
*/
116+
public function getScaleInCooldownSeconds()
117+
{
118+
return $this->scaleInCooldownSeconds;
119+
}
120+
/**
121+
* @param int
122+
*/
123+
public function setScaleOutCooldownSeconds($scaleOutCooldownSeconds)
124+
{
125+
$this->scaleOutCooldownSeconds = $scaleOutCooldownSeconds;
126+
}
127+
/**
128+
* @return int
129+
*/
130+
public function getScaleOutCooldownSeconds()
131+
{
132+
return $this->scaleOutCooldownSeconds;
133+
}
98134
/**
99135
* @param TargetMetric[]
100136
*/

src/SQLAdmin/Resource/Instances.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use Google\Service\SQLAdmin\InstancesListResponse;
3030
use Google\Service\SQLAdmin\InstancesListServerCasResponse;
3131
use Google\Service\SQLAdmin\InstancesListServerCertificatesResponse;
32+
use Google\Service\SQLAdmin\InstancesPreCheckMajorVersionUpgradeRequest;
3233
use Google\Service\SQLAdmin\InstancesReencryptRequest;
3334
use Google\Service\SQLAdmin\InstancesRestoreBackupRequest;
3435
use Google\Service\SQLAdmin\InstancesRotateServerCaRequest;
@@ -434,6 +435,24 @@ public function pointInTimeRestore($parent, PointInTimeRestoreContext $postBody,
434435
$params = array_merge($params, $optParams);
435436
return $this->call('pointInTimeRestore', [$params], Operation::class);
436437
}
438+
/**
439+
* Execute MVU Pre-checks (instances.preCheckMajorVersionUpgrade)
440+
*
441+
* @param string $project Required. Project ID of the project that contains the
442+
* instance.
443+
* @param string $instance Required. Cloud SQL instance ID. This does not
444+
* include the project ID.
445+
* @param InstancesPreCheckMajorVersionUpgradeRequest $postBody
446+
* @param array $optParams Optional parameters.
447+
* @return Operation
448+
* @throws \Google\Service\Exception
449+
*/
450+
public function preCheckMajorVersionUpgrade($project, $instance, InstancesPreCheckMajorVersionUpgradeRequest $postBody, $optParams = [])
451+
{
452+
$params = ['project' => $project, 'instance' => $instance, 'postBody' => $postBody];
453+
$params = array_merge($params, $optParams);
454+
return $this->call('preCheckMajorVersionUpgrade', [$params], Operation::class);
455+
}
437456
/**
438457
* Promotes the read replica instance to be an independent Cloud SQL primary
439458
* instance. Using this operation might cause your instance to restart.

0 commit comments

Comments
 (0)