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\Monitoring\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Monitoring\ListUptimeCheckConfigsResponse;
|
---|
21 | use Google\Service\Monitoring\MonitoringEmpty;
|
---|
22 | use Google\Service\Monitoring\UptimeCheckConfig;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "uptimeCheckConfigs" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $monitoringService = new Google\Service\Monitoring(...);
|
---|
29 | * $uptimeCheckConfigs = $monitoringService->projects_uptimeCheckConfigs;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsUptimeCheckConfigs extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a new Uptime check configuration. (uptimeCheckConfigs.create)
|
---|
36 | *
|
---|
37 | * @param string $parent Required. The project
|
---|
38 | * (https://cloud.google.com/monitoring/api/v3#project_name) in which to create
|
---|
39 | * the Uptime check. The format is: projects/[PROJECT_ID_OR_NUMBER]
|
---|
40 | * @param UptimeCheckConfig $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | * @return UptimeCheckConfig
|
---|
43 | * @throws \Google\Service\Exception
|
---|
44 | */
|
---|
45 | public function create($parent, UptimeCheckConfig $postBody, $optParams = [])
|
---|
46 | {
|
---|
47 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
48 | $params = array_merge($params, $optParams);
|
---|
49 | return $this->call('create', [$params], UptimeCheckConfig::class);
|
---|
50 | }
|
---|
51 | /**
|
---|
52 | * Deletes an Uptime check configuration. Note that this method will fail if the
|
---|
53 | * Uptime check configuration is referenced by an alert policy or other
|
---|
54 | * dependent configs that would be rendered invalid by the deletion.
|
---|
55 | * (uptimeCheckConfigs.delete)
|
---|
56 | *
|
---|
57 | * @param string $name Required. The Uptime check configuration to delete. The
|
---|
58 | * format is:
|
---|
59 | * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
|
---|
60 | * @param array $optParams Optional parameters.
|
---|
61 | * @return MonitoringEmpty
|
---|
62 | * @throws \Google\Service\Exception
|
---|
63 | */
|
---|
64 | public function delete($name, $optParams = [])
|
---|
65 | {
|
---|
66 | $params = ['name' => $name];
|
---|
67 | $params = array_merge($params, $optParams);
|
---|
68 | return $this->call('delete', [$params], MonitoringEmpty::class);
|
---|
69 | }
|
---|
70 | /**
|
---|
71 | * Gets a single Uptime check configuration. (uptimeCheckConfigs.get)
|
---|
72 | *
|
---|
73 | * @param string $name Required. The Uptime check configuration to retrieve. The
|
---|
74 | * format is:
|
---|
75 | * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
|
---|
76 | * @param array $optParams Optional parameters.
|
---|
77 | * @return UptimeCheckConfig
|
---|
78 | * @throws \Google\Service\Exception
|
---|
79 | */
|
---|
80 | public function get($name, $optParams = [])
|
---|
81 | {
|
---|
82 | $params = ['name' => $name];
|
---|
83 | $params = array_merge($params, $optParams);
|
---|
84 | return $this->call('get', [$params], UptimeCheckConfig::class);
|
---|
85 | }
|
---|
86 | /**
|
---|
87 | * Lists the existing valid Uptime check configurations for the project (leaving
|
---|
88 | * out any invalid configurations).
|
---|
89 | * (uptimeCheckConfigs.listProjectsUptimeCheckConfigs)
|
---|
90 | *
|
---|
91 | * @param string $parent Required. The project
|
---|
92 | * (https://cloud.google.com/monitoring/api/v3#project_name) whose Uptime check
|
---|
93 | * configurations are listed. The format is: projects/[PROJECT_ID_OR_NUMBER]
|
---|
94 | * @param array $optParams Optional parameters.
|
---|
95 | *
|
---|
96 | * @opt_param string filter If provided, this field specifies the criteria that
|
---|
97 | * must be met by uptime checks to be included in the response.For more details,
|
---|
98 | * see Filtering syntax (https://cloud.google.com/monitoring/api/v3/sorting-and-
|
---|
99 | * filtering#filter_syntax).
|
---|
100 | * @opt_param int pageSize The maximum number of results to return in a single
|
---|
101 | * response. The server may further constrain the maximum number of results
|
---|
102 | * returned in a single page. If the page_size is <=0, the server will decide
|
---|
103 | * the number of results to be returned.
|
---|
104 | * @opt_param string pageToken If this field is not empty then it must contain
|
---|
105 | * the nextPageToken value returned by a previous call to this method. Using
|
---|
106 | * this field causes the method to return more results from the previous method
|
---|
107 | * call.
|
---|
108 | * @return ListUptimeCheckConfigsResponse
|
---|
109 | * @throws \Google\Service\Exception
|
---|
110 | */
|
---|
111 | public function listProjectsUptimeCheckConfigs($parent, $optParams = [])
|
---|
112 | {
|
---|
113 | $params = ['parent' => $parent];
|
---|
114 | $params = array_merge($params, $optParams);
|
---|
115 | return $this->call('list', [$params], ListUptimeCheckConfigsResponse::class);
|
---|
116 | }
|
---|
117 | /**
|
---|
118 | * Updates an Uptime check configuration. You can either replace the entire
|
---|
119 | * configuration with a new one or replace only certain fields in the current
|
---|
120 | * configuration by specifying the fields to be updated via updateMask. Returns
|
---|
121 | * the updated configuration. (uptimeCheckConfigs.patch)
|
---|
122 | *
|
---|
123 | * @param string $name Identifier. A unique resource name for this Uptime check
|
---|
124 | * configuration. The format is:
|
---|
125 | * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
|
---|
126 | * [PROJECT_ID_OR_NUMBER] is the Workspace host project associated with the
|
---|
127 | * Uptime check.This field should be omitted when creating the Uptime check
|
---|
128 | * configuration; on create, the resource name is assigned by the server and
|
---|
129 | * included in the response.
|
---|
130 | * @param UptimeCheckConfig $postBody
|
---|
131 | * @param array $optParams Optional parameters.
|
---|
132 | *
|
---|
133 | * @opt_param string updateMask Optional. If present, only the listed fields in
|
---|
134 | * the current Uptime check configuration are updated with values from the new
|
---|
135 | * configuration. If this field is empty, then the current configuration is
|
---|
136 | * completely replaced with the new configuration.
|
---|
137 | * @return UptimeCheckConfig
|
---|
138 | * @throws \Google\Service\Exception
|
---|
139 | */
|
---|
140 | public function patch($name, UptimeCheckConfig $postBody, $optParams = [])
|
---|
141 | {
|
---|
142 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
143 | $params = array_merge($params, $optParams);
|
---|
144 | return $this->call('patch', [$params], UptimeCheckConfig::class);
|
---|
145 | }
|
---|
146 | }
|
---|
147 |
|
---|
148 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
149 | class_alias(ProjectsUptimeCheckConfigs::class, 'Google_Service_Monitoring_Resource_ProjectsUptimeCheckConfigs');
|
---|