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\BigtableAdmin\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\BigtableAdmin\BigtableadminEmpty;
|
---|
21 | use Google\Service\BigtableAdmin\CreateInstanceRequest;
|
---|
22 | use Google\Service\BigtableAdmin\GetIamPolicyRequest;
|
---|
23 | use Google\Service\BigtableAdmin\Instance;
|
---|
24 | use Google\Service\BigtableAdmin\ListInstancesResponse;
|
---|
25 | use Google\Service\BigtableAdmin\Operation;
|
---|
26 | use Google\Service\BigtableAdmin\Policy;
|
---|
27 | use Google\Service\BigtableAdmin\SetIamPolicyRequest;
|
---|
28 | use Google\Service\BigtableAdmin\TestIamPermissionsRequest;
|
---|
29 | use Google\Service\BigtableAdmin\TestIamPermissionsResponse;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * The "instances" collection of methods.
|
---|
33 | * Typical usage is:
|
---|
34 | * <code>
|
---|
35 | * $bigtableadminService = new Google\Service\BigtableAdmin(...);
|
---|
36 | * $instances = $bigtableadminService->projects_instances;
|
---|
37 | * </code>
|
---|
38 | */
|
---|
39 | class ProjectsInstances extends \Google\Service\Resource
|
---|
40 | {
|
---|
41 | /**
|
---|
42 | * Create an instance within a project. Note that exactly one of
|
---|
43 | * Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can
|
---|
44 | * be set. If serve_nodes is set to non-zero, then the cluster is manually
|
---|
45 | * scaled. If cluster_config.cluster_autoscaling_config is non-empty, then
|
---|
46 | * autoscaling is enabled. (instances.create)
|
---|
47 | *
|
---|
48 | * @param string $parent Required. The unique name of the project in which to
|
---|
49 | * create the new instance. Values are of the form `projects/{project}`.
|
---|
50 | * @param CreateInstanceRequest $postBody
|
---|
51 | * @param array $optParams Optional parameters.
|
---|
52 | * @return Operation
|
---|
53 | * @throws \Google\Service\Exception
|
---|
54 | */
|
---|
55 | public function create($parent, CreateInstanceRequest $postBody, $optParams = [])
|
---|
56 | {
|
---|
57 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
58 | $params = array_merge($params, $optParams);
|
---|
59 | return $this->call('create', [$params], Operation::class);
|
---|
60 | }
|
---|
61 | /**
|
---|
62 | * Delete an instance from a project. (instances.delete)
|
---|
63 | *
|
---|
64 | * @param string $name Required. The unique name of the instance to be deleted.
|
---|
65 | * Values are of the form `projects/{project}/instances/{instance}`.
|
---|
66 | * @param array $optParams Optional parameters.
|
---|
67 | * @return BigtableadminEmpty
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function delete($name, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['name' => $name];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('delete', [$params], BigtableadminEmpty::class);
|
---|
75 | }
|
---|
76 | /**
|
---|
77 | * Gets information about an instance. (instances.get)
|
---|
78 | *
|
---|
79 | * @param string $name Required. The unique name of the requested instance.
|
---|
80 | * Values are of the form `projects/{project}/instances/{instance}`.
|
---|
81 | * @param array $optParams Optional parameters.
|
---|
82 | * @return Instance
|
---|
83 | * @throws \Google\Service\Exception
|
---|
84 | */
|
---|
85 | public function get($name, $optParams = [])
|
---|
86 | {
|
---|
87 | $params = ['name' => $name];
|
---|
88 | $params = array_merge($params, $optParams);
|
---|
89 | return $this->call('get', [$params], Instance::class);
|
---|
90 | }
|
---|
91 | /**
|
---|
92 | * Gets the access control policy for an instance resource. Returns an empty
|
---|
93 | * policy if an instance exists but does not have a policy set.
|
---|
94 | * (instances.getIamPolicy)
|
---|
95 | *
|
---|
96 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
97 | * requested. See [Resource
|
---|
98 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
99 | * appropriate value for this field.
|
---|
100 | * @param GetIamPolicyRequest $postBody
|
---|
101 | * @param array $optParams Optional parameters.
|
---|
102 | * @return Policy
|
---|
103 | * @throws \Google\Service\Exception
|
---|
104 | */
|
---|
105 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
106 | {
|
---|
107 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
108 | $params = array_merge($params, $optParams);
|
---|
109 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
110 | }
|
---|
111 | /**
|
---|
112 | * Lists information about instances in a project.
|
---|
113 | * (instances.listProjectsInstances)
|
---|
114 | *
|
---|
115 | * @param string $parent Required. The unique name of the project for which a
|
---|
116 | * list of instances is requested. Values are of the form `projects/{project}`.
|
---|
117 | * @param array $optParams Optional parameters.
|
---|
118 | *
|
---|
119 | * @opt_param string pageToken DEPRECATED: This field is unused and ignored.
|
---|
120 | * @return ListInstancesResponse
|
---|
121 | * @throws \Google\Service\Exception
|
---|
122 | */
|
---|
123 | public function listProjectsInstances($parent, $optParams = [])
|
---|
124 | {
|
---|
125 | $params = ['parent' => $parent];
|
---|
126 | $params = array_merge($params, $optParams);
|
---|
127 | return $this->call('list', [$params], ListInstancesResponse::class);
|
---|
128 | }
|
---|
129 | /**
|
---|
130 | * Partially updates an instance within a project. This method can modify all
|
---|
131 | * fields of an Instance and is the preferred way to update an Instance.
|
---|
132 | * (instances.partialUpdateInstance)
|
---|
133 | *
|
---|
134 | * @param string $name The unique name of the instance. Values are of the form
|
---|
135 | * `projects/{project}/instances/a-z+[a-z0-9]`.
|
---|
136 | * @param Instance $postBody
|
---|
137 | * @param array $optParams Optional parameters.
|
---|
138 | *
|
---|
139 | * @opt_param string updateMask Required. The subset of Instance fields which
|
---|
140 | * should be replaced. Must be explicitly set.
|
---|
141 | * @return Operation
|
---|
142 | * @throws \Google\Service\Exception
|
---|
143 | */
|
---|
144 | public function partialUpdateInstance($name, Instance $postBody, $optParams = [])
|
---|
145 | {
|
---|
146 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
147 | $params = array_merge($params, $optParams);
|
---|
148 | return $this->call('partialUpdateInstance', [$params], Operation::class);
|
---|
149 | }
|
---|
150 | /**
|
---|
151 | * Sets the access control policy on an instance resource. Replaces any existing
|
---|
152 | * policy. (instances.setIamPolicy)
|
---|
153 | *
|
---|
154 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
155 | * specified. See [Resource
|
---|
156 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
157 | * appropriate value for this field.
|
---|
158 | * @param SetIamPolicyRequest $postBody
|
---|
159 | * @param array $optParams Optional parameters.
|
---|
160 | * @return Policy
|
---|
161 | * @throws \Google\Service\Exception
|
---|
162 | */
|
---|
163 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
164 | {
|
---|
165 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
166 | $params = array_merge($params, $optParams);
|
---|
167 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
168 | }
|
---|
169 | /**
|
---|
170 | * Returns permissions that the caller has on the specified instance resource.
|
---|
171 | * (instances.testIamPermissions)
|
---|
172 | *
|
---|
173 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
174 | * being requested. See [Resource
|
---|
175 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
176 | * appropriate value for this field.
|
---|
177 | * @param TestIamPermissionsRequest $postBody
|
---|
178 | * @param array $optParams Optional parameters.
|
---|
179 | * @return TestIamPermissionsResponse
|
---|
180 | * @throws \Google\Service\Exception
|
---|
181 | */
|
---|
182 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
183 | {
|
---|
184 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
185 | $params = array_merge($params, $optParams);
|
---|
186 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
187 | }
|
---|
188 | /**
|
---|
189 | * Updates an instance within a project. This method updates only the display
|
---|
190 | * name and type for an Instance. To update other Instance properties, such as
|
---|
191 | * labels, use PartialUpdateInstance. (instances.update)
|
---|
192 | *
|
---|
193 | * @param string $name The unique name of the instance. Values are of the form
|
---|
194 | * `projects/{project}/instances/a-z+[a-z0-9]`.
|
---|
195 | * @param Instance $postBody
|
---|
196 | * @param array $optParams Optional parameters.
|
---|
197 | * @return Instance
|
---|
198 | * @throws \Google\Service\Exception
|
---|
199 | */
|
---|
200 | public function update($name, Instance $postBody, $optParams = [])
|
---|
201 | {
|
---|
202 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
203 | $params = array_merge($params, $optParams);
|
---|
204 | return $this->call('update', [$params], Instance::class);
|
---|
205 | }
|
---|
206 | }
|
---|
207 |
|
---|
208 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
209 | class_alias(ProjectsInstances::class, 'Google_Service_BigtableAdmin_Resource_ProjectsInstances');
|
---|