source: vendor/google/apiclient-services/src/Compute/Resource/RegionInstanceGroups.php@ f9c482b

Last change on this file since f9c482b was f9c482b, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload new project files

  • Property mode set to 100644
File size: 13.2 KB
Line 
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
18namespace Google\Service\Compute\Resource;
19
20use Google\Service\Compute\InstanceGroup;
21use Google\Service\Compute\Operation;
22use Google\Service\Compute\RegionInstanceGroupList;
23use Google\Service\Compute\RegionInstanceGroupsListInstances;
24use Google\Service\Compute\RegionInstanceGroupsListInstancesRequest;
25use Google\Service\Compute\RegionInstanceGroupsSetNamedPortsRequest;
26
27/**
28 * The "regionInstanceGroups" collection of methods.
29 * Typical usage is:
30 * <code>
31 * $computeService = new Google\Service\Compute(...);
32 * $regionInstanceGroups = $computeService->regionInstanceGroups;
33 * </code>
34 */
35class RegionInstanceGroups extends \Google\Service\Resource
36{
37 /**
38 * Returns the specified instance group resource. (regionInstanceGroups.get)
39 *
40 * @param string $project Project ID for this request.
41 * @param string $region Name of the region scoping this request.
42 * @param string $instanceGroup Name of the instance group resource to return.
43 * @param array $optParams Optional parameters.
44 * @return InstanceGroup
45 * @throws \Google\Service\Exception
46 */
47 public function get($project, $region, $instanceGroup, $optParams = [])
48 {
49 $params = ['project' => $project, 'region' => $region, 'instanceGroup' => $instanceGroup];
50 $params = array_merge($params, $optParams);
51 return $this->call('get', [$params], InstanceGroup::class);
52 }
53 /**
54 * Retrieves the list of instance group resources contained within the specified
55 * region. (regionInstanceGroups.listRegionInstanceGroups)
56 *
57 * @param string $project Project ID for this request.
58 * @param string $region Name of the region scoping this request.
59 * @param array $optParams Optional parameters.
60 *
61 * @opt_param string filter A filter expression that filters resources listed in
62 * the response. Most Compute resources support two types of filter expressions:
63 * expressions that support regular expressions and expressions that follow API
64 * improvement proposal AIP-160. These two types of filter expressions cannot be
65 * mixed in one request. If you want to use AIP-160, your expression must
66 * specify the field name, an operator, and the value that you want to use for
67 * filtering. The value must be a string, a number, or a boolean. The operator
68 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
69 * are filtering Compute Engine instances, you can exclude instances named
70 * `example-instance` by specifying `name != example-instance`. The `:*`
71 * comparison can be used to test whether a key has been defined. For example,
72 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
73 * also filter nested fields. For example, you could specify
74 * `scheduling.automaticRestart = false` to include instances only if they are
75 * not scheduled for automatic restarts. You can use filtering on nested fields
76 * to filter based on resource labels. To filter on multiple expressions,
77 * provide each separate expression within parentheses. For example: ```
78 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
79 * default, each expression is an `AND` expression. However, you can include
80 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
81 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
82 * (scheduling.automaticRestart = true) ``` If you want to use a regular
83 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
84 * single un-parenthesized expression with or without quotes or against multiple
85 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
86 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
87 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
88 * interpreted as a regular expression using Google RE2 library syntax. The
89 * literal value must match the entire field. For example, to filter for
90 * instances that do not end with name "instance", you would use `name ne
91 * .*instance`. You cannot combine constraints on multiple fields using regular
92 * expressions.
93 * @opt_param string maxResults The maximum number of results per page that
94 * should be returned. If the number of available results is larger than
95 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
96 * get the next page of results in subsequent list requests. Acceptable values
97 * are `0` to `500`, inclusive. (Default: `500`)
98 * @opt_param string orderBy Sorts list results by a certain order. By default,
99 * results are returned in alphanumerical order based on the resource name. You
100 * can also sort results in descending order based on the creation timestamp
101 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
102 * `creationTimestamp` field in reverse chronological order (newest result
103 * first). Use this to sort resources like operations so that the newest
104 * operation is returned first. Currently, only sorting by `name` or
105 * `creationTimestamp desc` is supported.
106 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
107 * the `nextPageToken` returned by a previous list request to get the next page
108 * of results.
109 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
110 * which provides partial results in case of failure. The default value is
111 * false. For example, when partial success behavior is enabled, aggregatedList
112 * for a single zone scope either returns all resources in the zone or no
113 * resources, with an error code.
114 * @return RegionInstanceGroupList
115 * @throws \Google\Service\Exception
116 */
117 public function listRegionInstanceGroups($project, $region, $optParams = [])
118 {
119 $params = ['project' => $project, 'region' => $region];
120 $params = array_merge($params, $optParams);
121 return $this->call('list', [$params], RegionInstanceGroupList::class);
122 }
123 /**
124 * Lists the instances in the specified instance group and displays information
125 * about the named ports. Depending on the specified options, this method can
126 * list all instances or only the instances that are running. The orderBy query
127 * parameter is not supported. (regionInstanceGroups.listInstances)
128 *
129 * @param string $project Project ID for this request.
130 * @param string $region Name of the region scoping this request.
131 * @param string $instanceGroup Name of the regional instance group for which we
132 * want to list the instances.
133 * @param RegionInstanceGroupsListInstancesRequest $postBody
134 * @param array $optParams Optional parameters.
135 *
136 * @opt_param string filter A filter expression that filters resources listed in
137 * the response. Most Compute resources support two types of filter expressions:
138 * expressions that support regular expressions and expressions that follow API
139 * improvement proposal AIP-160. These two types of filter expressions cannot be
140 * mixed in one request. If you want to use AIP-160, your expression must
141 * specify the field name, an operator, and the value that you want to use for
142 * filtering. The value must be a string, a number, or a boolean. The operator
143 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
144 * are filtering Compute Engine instances, you can exclude instances named
145 * `example-instance` by specifying `name != example-instance`. The `:*`
146 * comparison can be used to test whether a key has been defined. For example,
147 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
148 * also filter nested fields. For example, you could specify
149 * `scheduling.automaticRestart = false` to include instances only if they are
150 * not scheduled for automatic restarts. You can use filtering on nested fields
151 * to filter based on resource labels. To filter on multiple expressions,
152 * provide each separate expression within parentheses. For example: ```
153 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
154 * default, each expression is an `AND` expression. However, you can include
155 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
156 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
157 * (scheduling.automaticRestart = true) ``` If you want to use a regular
158 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
159 * single un-parenthesized expression with or without quotes or against multiple
160 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
161 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
162 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
163 * interpreted as a regular expression using Google RE2 library syntax. The
164 * literal value must match the entire field. For example, to filter for
165 * instances that do not end with name "instance", you would use `name ne
166 * .*instance`. You cannot combine constraints on multiple fields using regular
167 * expressions.
168 * @opt_param string maxResults The maximum number of results per page that
169 * should be returned. If the number of available results is larger than
170 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
171 * get the next page of results in subsequent list requests. Acceptable values
172 * are `0` to `500`, inclusive. (Default: `500`)
173 * @opt_param string orderBy Sorts list results by a certain order. By default,
174 * results are returned in alphanumerical order based on the resource name. You
175 * can also sort results in descending order based on the creation timestamp
176 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
177 * `creationTimestamp` field in reverse chronological order (newest result
178 * first). Use this to sort resources like operations so that the newest
179 * operation is returned first. Currently, only sorting by `name` or
180 * `creationTimestamp desc` is supported.
181 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
182 * the `nextPageToken` returned by a previous list request to get the next page
183 * of results.
184 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
185 * which provides partial results in case of failure. The default value is
186 * false. For example, when partial success behavior is enabled, aggregatedList
187 * for a single zone scope either returns all resources in the zone or no
188 * resources, with an error code.
189 * @return RegionInstanceGroupsListInstances
190 * @throws \Google\Service\Exception
191 */
192 public function listInstances($project, $region, $instanceGroup, RegionInstanceGroupsListInstancesRequest $postBody, $optParams = [])
193 {
194 $params = ['project' => $project, 'region' => $region, 'instanceGroup' => $instanceGroup, 'postBody' => $postBody];
195 $params = array_merge($params, $optParams);
196 return $this->call('listInstances', [$params], RegionInstanceGroupsListInstances::class);
197 }
198 /**
199 * Sets the named ports for the specified regional instance group.
200 * (regionInstanceGroups.setNamedPorts)
201 *
202 * @param string $project Project ID for this request.
203 * @param string $region Name of the region scoping this request.
204 * @param string $instanceGroup The name of the regional instance group where
205 * the named ports are updated.
206 * @param RegionInstanceGroupsSetNamedPortsRequest $postBody
207 * @param array $optParams Optional parameters.
208 *
209 * @opt_param string requestId An optional request ID to identify requests.
210 * Specify a unique request ID so that if you must retry your request, the
211 * server will know to ignore the request if it has already been completed. For
212 * example, consider a situation where you make an initial request and the
213 * request times out. If you make the request again with the same request ID,
214 * the server can check if original operation with the same request ID was
215 * received, and if so, will ignore the second request. This prevents clients
216 * from accidentally creating duplicate commitments. The request ID must be a
217 * valid UUID with the exception that zero UUID is not supported (
218 * 00000000-0000-0000-0000-000000000000).
219 * @return Operation
220 * @throws \Google\Service\Exception
221 */
222 public function setNamedPorts($project, $region, $instanceGroup, RegionInstanceGroupsSetNamedPortsRequest $postBody, $optParams = [])
223 {
224 $params = ['project' => $project, 'region' => $region, 'instanceGroup' => $instanceGroup, 'postBody' => $postBody];
225 $params = array_merge($params, $optParams);
226 return $this->call('setNamedPorts', [$params], Operation::class);
227 }
228}
229
230// Adding a class alias for backwards compatibility with the previous class name.
231class_alias(RegionInstanceGroups::class, 'Google_Service_Compute_Resource_RegionInstanceGroups');
Note: See TracBrowser for help on using the repository browser.