Skip to content

Commit 66a9e33

Browse files
1 parent bb8aadd commit 66a9e33

File tree

3 files changed

+136
-0
lines changed

3 files changed

+136
-0
lines changed

src/SQLAdmin.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,21 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
884884
'required' => true,
885885
],
886886
],
887+
],'restoreBackupMcp' => [
888+
'path' => 'v1/projects/{targetProject}/instances/{targetInstance}:restoreBackupMcp',
889+
'httpMethod' => 'POST',
890+
'parameters' => [
891+
'targetProject' => [
892+
'location' => 'path',
893+
'type' => 'string',
894+
'required' => true,
895+
],
896+
'targetInstance' => [
897+
'location' => 'path',
898+
'type' => 'string',
899+
'required' => true,
900+
],
901+
],
887902
],'rotateServerCa' => [
888903
'path' => 'v1/projects/{project}/instances/{instance}/rotateServerCa',
889904
'httpMethod' => 'POST',

src/SQLAdmin/Resource/Instances.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
use Google\Service\SQLAdmin\SqlInstancesAcquireSsrsLeaseResponse;
4343
use Google\Service\SQLAdmin\SqlInstancesExecuteSqlResponse;
4444
use Google\Service\SQLAdmin\SqlInstancesReleaseSsrsLeaseResponse;
45+
use Google\Service\SQLAdmin\SqlInstancesRestoreBackupMcpRequest;
4546

4647
/**
4748
* The "instances" collection of methods.
@@ -629,6 +630,24 @@ public function restoreBackup($project, $instance, InstancesRestoreBackupRequest
629630
$params = array_merge($params, $optParams);
630631
return $this->call('restoreBackup', [$params], Operation::class);
631632
}
633+
/**
634+
* Restores a backup of a Cloud SQL instance for Model Context Protocol (MCP)
635+
* server. (instances.restoreBackupMcp)
636+
*
637+
* @param string $targetProject Required. Project ID of the target project.
638+
* @param string $targetInstance Required. Cloud SQL instance ID of the target.
639+
* This does not include the project ID.
640+
* @param SqlInstancesRestoreBackupMcpRequest $postBody
641+
* @param array $optParams Optional parameters.
642+
* @return Operation
643+
* @throws \Google\Service\Exception
644+
*/
645+
public function restoreBackupMcp($targetProject, $targetInstance, SqlInstancesRestoreBackupMcpRequest $postBody, $optParams = [])
646+
{
647+
$params = ['targetProject' => $targetProject, 'targetInstance' => $targetInstance, 'postBody' => $postBody];
648+
$params = array_merge($params, $optParams);
649+
return $this->call('restoreBackupMcp', [$params], Operation::class);
650+
}
632651
/**
633652
* Rotates the server certificate to one signed by the Certificate Authority
634653
* (CA) version previously added with the addServerCA method. For instances that
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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 SqlInstancesRestoreBackupMcpRequest extends \Google\Model
21+
{
22+
/**
23+
* Required. The identifier of the backup to restore. This will be one of the
24+
* following: 1. An int64 containing a backup_run_id. 2. A backup name of the
25+
* format 'projects/{project}/backups/{backup-uid}'. 3. A backupDR name of the
26+
* format 'projects/{project}/locations/{location}/backupVaults/{backupvault}/
27+
* dataSources/{datasource}/backups/{backup-uid}'.
28+
*
29+
* @var string
30+
*/
31+
public $backupId;
32+
/**
33+
* Optional. The Cloud SQL instance ID of the source instance containing the
34+
* backup. Only necessary if the backup_id is a backup_run_id.
35+
*
36+
* @var string
37+
*/
38+
public $sourceInstance;
39+
/**
40+
* Required. The project ID of the source instance containing the backup.
41+
*
42+
* @var string
43+
*/
44+
public $sourceProject;
45+
46+
/**
47+
* Required. The identifier of the backup to restore. This will be one of the
48+
* following: 1. An int64 containing a backup_run_id. 2. A backup name of the
49+
* format 'projects/{project}/backups/{backup-uid}'. 3. A backupDR name of the
50+
* format 'projects/{project}/locations/{location}/backupVaults/{backupvault}/
51+
* dataSources/{datasource}/backups/{backup-uid}'.
52+
*
53+
* @param string $backupId
54+
*/
55+
public function setBackupId($backupId)
56+
{
57+
$this->backupId = $backupId;
58+
}
59+
/**
60+
* @return string
61+
*/
62+
public function getBackupId()
63+
{
64+
return $this->backupId;
65+
}
66+
/**
67+
* Optional. The Cloud SQL instance ID of the source instance containing the
68+
* backup. Only necessary if the backup_id is a backup_run_id.
69+
*
70+
* @param string $sourceInstance
71+
*/
72+
public function setSourceInstance($sourceInstance)
73+
{
74+
$this->sourceInstance = $sourceInstance;
75+
}
76+
/**
77+
* @return string
78+
*/
79+
public function getSourceInstance()
80+
{
81+
return $this->sourceInstance;
82+
}
83+
/**
84+
* Required. The project ID of the source instance containing the backup.
85+
*
86+
* @param string $sourceProject
87+
*/
88+
public function setSourceProject($sourceProject)
89+
{
90+
$this->sourceProject = $sourceProject;
91+
}
92+
/**
93+
* @return string
94+
*/
95+
public function getSourceProject()
96+
{
97+
return $this->sourceProject;
98+
}
99+
}
100+
101+
// Adding a class alias for backwards compatibility with the previous class name.
102+
class_alias(SqlInstancesRestoreBackupMcpRequest::class, 'Google_Service_SQLAdmin_SqlInstancesRestoreBackupMcpRequest');

0 commit comments

Comments
 (0)