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\ListServiceLevelObjectivesResponse;
|
---|
21 | use Google\Service\Monitoring\MonitoringEmpty;
|
---|
22 | use Google\Service\Monitoring\ServiceLevelObjective;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "serviceLevelObjectives" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $monitoringService = new Google\Service\Monitoring(...);
|
---|
29 | * $serviceLevelObjectives = $monitoringService->services_serviceLevelObjectives;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ServicesServiceLevelObjectives extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Create a ServiceLevelObjective for the given Service.
|
---|
36 | * (serviceLevelObjectives.create)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. Resource name of the parent Service. The
|
---|
39 | * format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
|
---|
40 | * @param ServiceLevelObjective $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string serviceLevelObjectiveId Optional. The ServiceLevelObjective
|
---|
44 | * id to use for this ServiceLevelObjective. If omitted, an id will be generated
|
---|
45 | * instead. Must match the pattern ^[a-zA-Z0-9-_:.]+$
|
---|
46 | * @return ServiceLevelObjective
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function create($parent, ServiceLevelObjective $postBody, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('create', [$params], ServiceLevelObjective::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Delete the given ServiceLevelObjective. (serviceLevelObjectives.delete)
|
---|
57 | *
|
---|
58 | * @param string $name Required. Resource name of the ServiceLevelObjective to
|
---|
59 | * delete. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/
|
---|
60 | * serviceLevelObjectives/[SLO_NAME]
|
---|
61 | * @param array $optParams Optional parameters.
|
---|
62 | * @return MonitoringEmpty
|
---|
63 | * @throws \Google\Service\Exception
|
---|
64 | */
|
---|
65 | public function delete($name, $optParams = [])
|
---|
66 | {
|
---|
67 | $params = ['name' => $name];
|
---|
68 | $params = array_merge($params, $optParams);
|
---|
69 | return $this->call('delete', [$params], MonitoringEmpty::class);
|
---|
70 | }
|
---|
71 | /**
|
---|
72 | * Get a ServiceLevelObjective by name. (serviceLevelObjectives.get)
|
---|
73 | *
|
---|
74 | * @param string $name Required. Resource name of the ServiceLevelObjective to
|
---|
75 | * get. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/ser
|
---|
76 | * viceLevelObjectives/[SLO_NAME]
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | *
|
---|
79 | * @opt_param string view View of the ServiceLevelObjective to return. If
|
---|
80 | * DEFAULT, return the ServiceLevelObjective as originally defined. If EXPLICIT
|
---|
81 | * and the ServiceLevelObjective is defined in terms of a BasicSli, replace the
|
---|
82 | * BasicSli with a RequestBasedSli spelling out how the SLI is computed.
|
---|
83 | * @return ServiceLevelObjective
|
---|
84 | * @throws \Google\Service\Exception
|
---|
85 | */
|
---|
86 | public function get($name, $optParams = [])
|
---|
87 | {
|
---|
88 | $params = ['name' => $name];
|
---|
89 | $params = array_merge($params, $optParams);
|
---|
90 | return $this->call('get', [$params], ServiceLevelObjective::class);
|
---|
91 | }
|
---|
92 | /**
|
---|
93 | * List the ServiceLevelObjectives for the given Service.
|
---|
94 | * (serviceLevelObjectives.listServicesServiceLevelObjectives)
|
---|
95 | *
|
---|
96 | * @param string $parent Required. Resource name of the parent containing the
|
---|
97 | * listed SLOs, either a project or a Monitoring Metrics Scope. The formats are:
|
---|
98 | * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
|
---|
99 | * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/-
|
---|
100 | * @param array $optParams Optional parameters.
|
---|
101 | *
|
---|
102 | * @opt_param string filter A filter specifying what ServiceLevelObjectives to
|
---|
103 | * return.
|
---|
104 | * @opt_param int pageSize A non-negative number that is the maximum number of
|
---|
105 | * results to return. When 0, use default page size.
|
---|
106 | * @opt_param string pageToken If this field is not empty then it must contain
|
---|
107 | * the nextPageToken value returned by a previous call to this method. Using
|
---|
108 | * this field causes the method to return additional results from the previous
|
---|
109 | * method call.
|
---|
110 | * @opt_param string view View of the ServiceLevelObjectives to return. If
|
---|
111 | * DEFAULT, return each ServiceLevelObjective as originally defined. If EXPLICIT
|
---|
112 | * and the ServiceLevelObjective is defined in terms of a BasicSli, replace the
|
---|
113 | * BasicSli with a RequestBasedSli spelling out how the SLI is computed.
|
---|
114 | * @return ListServiceLevelObjectivesResponse
|
---|
115 | * @throws \Google\Service\Exception
|
---|
116 | */
|
---|
117 | public function listServicesServiceLevelObjectives($parent, $optParams = [])
|
---|
118 | {
|
---|
119 | $params = ['parent' => $parent];
|
---|
120 | $params = array_merge($params, $optParams);
|
---|
121 | return $this->call('list', [$params], ListServiceLevelObjectivesResponse::class);
|
---|
122 | }
|
---|
123 | /**
|
---|
124 | * Update the given ServiceLevelObjective. (serviceLevelObjectives.patch)
|
---|
125 | *
|
---|
126 | * @param string $name Identifier. Resource name for this ServiceLevelObjective.
|
---|
127 | * The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceL
|
---|
128 | * evelObjectives/[SLO_NAME]
|
---|
129 | * @param ServiceLevelObjective $postBody
|
---|
130 | * @param array $optParams Optional parameters.
|
---|
131 | *
|
---|
132 | * @opt_param string updateMask A set of field paths defining which fields to
|
---|
133 | * use for the update.
|
---|
134 | * @return ServiceLevelObjective
|
---|
135 | * @throws \Google\Service\Exception
|
---|
136 | */
|
---|
137 | public function patch($name, ServiceLevelObjective $postBody, $optParams = [])
|
---|
138 | {
|
---|
139 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
140 | $params = array_merge($params, $optParams);
|
---|
141 | return $this->call('patch', [$params], ServiceLevelObjective::class);
|
---|
142 | }
|
---|
143 | }
|
---|
144 |
|
---|
145 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
146 | class_alias(ServicesServiceLevelObjectives::class, 'Google_Service_Monitoring_Resource_ServicesServiceLevelObjectives');
|
---|