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\CloudMemorystoreforMemcached\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudMemorystoreforMemcached\ApplyParametersRequest;
|
---|
21 | use Google\Service\CloudMemorystoreforMemcached\GoogleCloudMemcacheV1UpgradeInstanceRequest;
|
---|
22 | use Google\Service\CloudMemorystoreforMemcached\Instance;
|
---|
23 | use Google\Service\CloudMemorystoreforMemcached\ListInstancesResponse;
|
---|
24 | use Google\Service\CloudMemorystoreforMemcached\Operation;
|
---|
25 | use Google\Service\CloudMemorystoreforMemcached\RescheduleMaintenanceRequest;
|
---|
26 | use Google\Service\CloudMemorystoreforMemcached\UpdateParametersRequest;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "instances" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $memcacheService = new Google\Service\CloudMemorystoreforMemcached(...);
|
---|
33 | * $instances = $memcacheService->projects_locations_instances;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsInstances extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * `ApplyParameters` restarts the set of specified nodes in order to update them
|
---|
40 | * to the current set of parameters for the Memcached Instance.
|
---|
41 | * (instances.applyParameters)
|
---|
42 | *
|
---|
43 | * @param string $name Required. Resource name of the Memcached instance for
|
---|
44 | * which parameter group updates should be applied.
|
---|
45 | * @param ApplyParametersRequest $postBody
|
---|
46 | * @param array $optParams Optional parameters.
|
---|
47 | * @return Operation
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function applyParameters($name, ApplyParametersRequest $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('applyParameters', [$params], Operation::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Creates a new Instance in a given location. (instances.create)
|
---|
58 | *
|
---|
59 | * @param string $parent Required. The resource name of the instance location
|
---|
60 | * using the form: `projects/{project_id}/locations/{location_id}` where
|
---|
61 | * `location_id` refers to a GCP region
|
---|
62 | * @param Instance $postBody
|
---|
63 | * @param array $optParams Optional parameters.
|
---|
64 | *
|
---|
65 | * @opt_param string instanceId Required. The logical name of the Memcached
|
---|
66 | * instance in the user project with the following restrictions: * Must contain
|
---|
67 | * only lowercase letters, numbers, and hyphens. * Must start with a letter. *
|
---|
68 | * Must be between 1-40 characters. * Must end with a number or a letter. * Must
|
---|
69 | * be unique within the user project / location. If any of the above are not
|
---|
70 | * met, the API raises an invalid argument error.
|
---|
71 | * @return Operation
|
---|
72 | * @throws \Google\Service\Exception
|
---|
73 | */
|
---|
74 | public function create($parent, Instance $postBody, $optParams = [])
|
---|
75 | {
|
---|
76 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
77 | $params = array_merge($params, $optParams);
|
---|
78 | return $this->call('create', [$params], Operation::class);
|
---|
79 | }
|
---|
80 | /**
|
---|
81 | * Deletes a single Instance. (instances.delete)
|
---|
82 | *
|
---|
83 | * @param string $name Required. Memcached instance resource name in the format:
|
---|
84 | * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where
|
---|
85 | * `location_id` refers to a GCP region
|
---|
86 | * @param array $optParams Optional parameters.
|
---|
87 | * @return Operation
|
---|
88 | * @throws \Google\Service\Exception
|
---|
89 | */
|
---|
90 | public function delete($name, $optParams = [])
|
---|
91 | {
|
---|
92 | $params = ['name' => $name];
|
---|
93 | $params = array_merge($params, $optParams);
|
---|
94 | return $this->call('delete', [$params], Operation::class);
|
---|
95 | }
|
---|
96 | /**
|
---|
97 | * Gets details of a single Instance. (instances.get)
|
---|
98 | *
|
---|
99 | * @param string $name Required. Memcached instance resource name in the format:
|
---|
100 | * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where
|
---|
101 | * `location_id` refers to a GCP region
|
---|
102 | * @param array $optParams Optional parameters.
|
---|
103 | * @return Instance
|
---|
104 | * @throws \Google\Service\Exception
|
---|
105 | */
|
---|
106 | public function get($name, $optParams = [])
|
---|
107 | {
|
---|
108 | $params = ['name' => $name];
|
---|
109 | $params = array_merge($params, $optParams);
|
---|
110 | return $this->call('get', [$params], Instance::class);
|
---|
111 | }
|
---|
112 | /**
|
---|
113 | * Lists Instances in a given location.
|
---|
114 | * (instances.listProjectsLocationsInstances)
|
---|
115 | *
|
---|
116 | * @param string $parent Required. The resource name of the instance location
|
---|
117 | * using the form: `projects/{project_id}/locations/{location_id}` where
|
---|
118 | * `location_id` refers to a GCP region
|
---|
119 | * @param array $optParams Optional parameters.
|
---|
120 | *
|
---|
121 | * @opt_param string filter List filter. For example, exclude all Memcached
|
---|
122 | * instances with name as my-instance by specifying `"name != my-instance"`.
|
---|
123 | * @opt_param string orderBy Sort results. Supported values are "name", "name
|
---|
124 | * desc" or "" (unsorted).
|
---|
125 | * @opt_param int pageSize The maximum number of items to return. If not
|
---|
126 | * specified, a default value of 1000 will be used by the service. Regardless of
|
---|
127 | * the `page_size` value, the response may include a partial list and a caller
|
---|
128 | * should only rely on response's `next_page_token` to determine if there are
|
---|
129 | * more instances left to be queried.
|
---|
130 | * @opt_param string pageToken The `next_page_token` value returned from a
|
---|
131 | * previous List request, if any.
|
---|
132 | * @return ListInstancesResponse
|
---|
133 | * @throws \Google\Service\Exception
|
---|
134 | */
|
---|
135 | public function listProjectsLocationsInstances($parent, $optParams = [])
|
---|
136 | {
|
---|
137 | $params = ['parent' => $parent];
|
---|
138 | $params = array_merge($params, $optParams);
|
---|
139 | return $this->call('list', [$params], ListInstancesResponse::class);
|
---|
140 | }
|
---|
141 | /**
|
---|
142 | * Updates an existing Instance in a given project and location.
|
---|
143 | * (instances.patch)
|
---|
144 | *
|
---|
145 | * @param string $name Required. Unique name of the resource in this scope
|
---|
146 | * including project and location using the form:
|
---|
147 | * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` Note:
|
---|
148 | * Memcached instances are managed and addressed at the regional level so
|
---|
149 | * `location_id` here refers to a Google Cloud region; however, users may choose
|
---|
150 | * which zones Memcached nodes should be provisioned in within an instance.
|
---|
151 | * Refer to zones field for more details.
|
---|
152 | * @param Instance $postBody
|
---|
153 | * @param array $optParams Optional parameters.
|
---|
154 | *
|
---|
155 | * @opt_param string updateMask Required. Mask of fields to update. *
|
---|
156 | * `displayName`
|
---|
157 | * @return Operation
|
---|
158 | * @throws \Google\Service\Exception
|
---|
159 | */
|
---|
160 | public function patch($name, Instance $postBody, $optParams = [])
|
---|
161 | {
|
---|
162 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
163 | $params = array_merge($params, $optParams);
|
---|
164 | return $this->call('patch', [$params], Operation::class);
|
---|
165 | }
|
---|
166 | /**
|
---|
167 | * Reschedules upcoming maintenance event. (instances.rescheduleMaintenance)
|
---|
168 | *
|
---|
169 | * @param string $instance Required. Memcache instance resource name using the
|
---|
170 | * form: `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
|
---|
171 | * where `location_id` refers to a GCP region.
|
---|
172 | * @param RescheduleMaintenanceRequest $postBody
|
---|
173 | * @param array $optParams Optional parameters.
|
---|
174 | * @return Operation
|
---|
175 | * @throws \Google\Service\Exception
|
---|
176 | */
|
---|
177 | public function rescheduleMaintenance($instance, RescheduleMaintenanceRequest $postBody, $optParams = [])
|
---|
178 | {
|
---|
179 | $params = ['instance' => $instance, 'postBody' => $postBody];
|
---|
180 | $params = array_merge($params, $optParams);
|
---|
181 | return $this->call('rescheduleMaintenance', [$params], Operation::class);
|
---|
182 | }
|
---|
183 | /**
|
---|
184 | * Updates the defined Memcached parameters for an existing instance. This
|
---|
185 | * method only stages the parameters, it must be followed by `ApplyParameters`
|
---|
186 | * to apply the parameters to nodes of the Memcached instance.
|
---|
187 | * (instances.updateParameters)
|
---|
188 | *
|
---|
189 | * @param string $name Required. Resource name of the Memcached instance for
|
---|
190 | * which the parameters should be updated.
|
---|
191 | * @param UpdateParametersRequest $postBody
|
---|
192 | * @param array $optParams Optional parameters.
|
---|
193 | * @return Operation
|
---|
194 | * @throws \Google\Service\Exception
|
---|
195 | */
|
---|
196 | public function updateParameters($name, UpdateParametersRequest $postBody, $optParams = [])
|
---|
197 | {
|
---|
198 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
199 | $params = array_merge($params, $optParams);
|
---|
200 | return $this->call('updateParameters', [$params], Operation::class);
|
---|
201 | }
|
---|
202 | /**
|
---|
203 | * Upgrades the Memcache instance to a newer memcached engine version specified
|
---|
204 | * in the request. (instances.upgrade)
|
---|
205 | *
|
---|
206 | * @param string $name Required. Memcache instance resource name using the form:
|
---|
207 | * `projects/{project}/locations/{location}/instances/{instance}` where
|
---|
208 | * `location_id` refers to a GCP region.
|
---|
209 | * @param GoogleCloudMemcacheV1UpgradeInstanceRequest $postBody
|
---|
210 | * @param array $optParams Optional parameters.
|
---|
211 | * @return Operation
|
---|
212 | * @throws \Google\Service\Exception
|
---|
213 | */
|
---|
214 | public function upgrade($name, GoogleCloudMemcacheV1UpgradeInstanceRequest $postBody, $optParams = [])
|
---|
215 | {
|
---|
216 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
217 | $params = array_merge($params, $optParams);
|
---|
218 | return $this->call('upgrade', [$params], Operation::class);
|
---|
219 | }
|
---|
220 | }
|
---|
221 |
|
---|
222 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
223 | class_alias(ProjectsLocationsInstances::class, 'Google_Service_CloudMemorystoreforMemcached_Resource_ProjectsLocationsInstances');
|
---|