source: vendor/google/apiclient-services/src/Compute/Resource/Zones.php

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

Upload project files

  • Property mode set to 100644
File size: 5.9 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\Zone;
21use Google\Service\Compute\ZoneList;
22
23/**
24 * The "zones" collection of methods.
25 * Typical usage is:
26 * <code>
27 * $computeService = new Google\Service\Compute(...);
28 * $zones = $computeService->zones;
29 * </code>
30 */
31class Zones extends \Google\Service\Resource
32{
33 /**
34 * Returns the specified Zone resource. (zones.get)
35 *
36 * @param string $project Project ID for this request.
37 * @param string $zone Name of the zone resource to return.
38 * @param array $optParams Optional parameters.
39 * @return Zone
40 * @throws \Google\Service\Exception
41 */
42 public function get($project, $zone, $optParams = [])
43 {
44 $params = ['project' => $project, 'zone' => $zone];
45 $params = array_merge($params, $optParams);
46 return $this->call('get', [$params], Zone::class);
47 }
48 /**
49 * Retrieves the list of Zone resources available to the specified project.
50 * (zones.listZones)
51 *
52 * @param string $project Project ID for this request.
53 * @param array $optParams Optional parameters.
54 *
55 * @opt_param string filter A filter expression that filters resources listed in
56 * the response. Most Compute resources support two types of filter expressions:
57 * expressions that support regular expressions and expressions that follow API
58 * improvement proposal AIP-160. These two types of filter expressions cannot be
59 * mixed in one request. If you want to use AIP-160, your expression must
60 * specify the field name, an operator, and the value that you want to use for
61 * filtering. The value must be a string, a number, or a boolean. The operator
62 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
63 * are filtering Compute Engine instances, you can exclude instances named
64 * `example-instance` by specifying `name != example-instance`. The `:*`
65 * comparison can be used to test whether a key has been defined. For example,
66 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
67 * also filter nested fields. For example, you could specify
68 * `scheduling.automaticRestart = false` to include instances only if they are
69 * not scheduled for automatic restarts. You can use filtering on nested fields
70 * to filter based on resource labels. To filter on multiple expressions,
71 * provide each separate expression within parentheses. For example: ```
72 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
73 * default, each expression is an `AND` expression. However, you can include
74 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
75 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
76 * (scheduling.automaticRestart = true) ``` If you want to use a regular
77 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
78 * single un-parenthesized expression with or without quotes or against multiple
79 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
80 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
81 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
82 * interpreted as a regular expression using Google RE2 library syntax. The
83 * literal value must match the entire field. For example, to filter for
84 * instances that do not end with name "instance", you would use `name ne
85 * .*instance`. You cannot combine constraints on multiple fields using regular
86 * expressions.
87 * @opt_param string maxResults The maximum number of results per page that
88 * should be returned. If the number of available results is larger than
89 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
90 * get the next page of results in subsequent list requests. Acceptable values
91 * are `0` to `500`, inclusive. (Default: `500`)
92 * @opt_param string orderBy Sorts list results by a certain order. By default,
93 * results are returned in alphanumerical order based on the resource name. You
94 * can also sort results in descending order based on the creation timestamp
95 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
96 * `creationTimestamp` field in reverse chronological order (newest result
97 * first). Use this to sort resources like operations so that the newest
98 * operation is returned first. Currently, only sorting by `name` or
99 * `creationTimestamp desc` is supported.
100 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
101 * the `nextPageToken` returned by a previous list request to get the next page
102 * of results.
103 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
104 * which provides partial results in case of failure. The default value is
105 * false. For example, when partial success behavior is enabled, aggregatedList
106 * for a single zone scope either returns all resources in the zone or no
107 * resources, with an error code.
108 * @return ZoneList
109 * @throws \Google\Service\Exception
110 */
111 public function listZones($project, $optParams = [])
112 {
113 $params = ['project' => $project];
114 $params = array_merge($params, $optParams);
115 return $this->call('list', [$params], ZoneList::class);
116 }
117}
118
119// Adding a class alias for backwards compatibility with the previous class name.
120class_alias(Zones::class, 'Google_Service_Compute_Resource_Zones');
Note: See TracBrowser for help on using the repository browser.