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\ListServicesResponse;
|
---|
21 | use Google\Service\Monitoring\MonitoringEmpty;
|
---|
22 | use Google\Service\Monitoring\Service;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "services" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $monitoringService = new Google\Service\Monitoring(...);
|
---|
29 | * $services = $monitoringService->services;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class Services extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Create a Service. (services.create)
|
---|
36 | *
|
---|
37 | * @param string $parent Required. Resource name
|
---|
38 | * (https://cloud.google.com/monitoring/api/v3#project_name) of the parent
|
---|
39 | * Metrics Scope. The format is: projects/[PROJECT_ID_OR_NUMBER]
|
---|
40 | * @param Service $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string serviceId Optional. The Service id to use for this Service.
|
---|
44 | * If omitted, an id will be generated instead. Must match the pattern
|
---|
45 | * [a-z0-9\-]+
|
---|
46 | * @return Service
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function create($parent, Service $postBody, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('create', [$params], Service::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Soft delete this Service. (services.delete)
|
---|
57 | *
|
---|
58 | * @param string $name Required. Resource name of the Service to delete. The
|
---|
59 | * format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_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 | * Get the named Service. (services.get)
|
---|
72 | *
|
---|
73 | * @param string $name Required. Resource name of the Service. The format is:
|
---|
74 | * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | * @return Service
|
---|
77 | * @throws \Google\Service\Exception
|
---|
78 | */
|
---|
79 | public function get($name, $optParams = [])
|
---|
80 | {
|
---|
81 | $params = ['name' => $name];
|
---|
82 | $params = array_merge($params, $optParams);
|
---|
83 | return $this->call('get', [$params], Service::class);
|
---|
84 | }
|
---|
85 | /**
|
---|
86 | * List Services for this Metrics Scope. (services.listServices)
|
---|
87 | *
|
---|
88 | * @param string $parent Required. Resource name of the parent containing the
|
---|
89 | * listed services, either a project
|
---|
90 | * (https://cloud.google.com/monitoring/api/v3#project_name) or a Monitoring
|
---|
91 | * Metrics Scope. The formats are: projects/[PROJECT_ID_OR_NUMBER]
|
---|
92 | * workspaces/[HOST_PROJECT_ID_OR_NUMBER]
|
---|
93 | * @param array $optParams Optional parameters.
|
---|
94 | *
|
---|
95 | * @opt_param string filter A filter specifying what Services to return. The
|
---|
96 | * filter supports filtering on a particular service-identifier type or one of
|
---|
97 | * its attributes.To filter on a particular service-identifier type, the
|
---|
98 | * identifier_case refers to which option in the identifier field is populated.
|
---|
99 | * For example, the filter identifier_case = "CUSTOM" would match all services
|
---|
100 | * with a value for the custom field. Valid options include "CUSTOM",
|
---|
101 | * "APP_ENGINE", "MESH_ISTIO", and the other options listed at
|
---|
102 | * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#ServiceTo
|
---|
103 | * filter on an attribute of a service-identifier type, apply the filter name by
|
---|
104 | * using the snake case of the service-identifier type and the attribute of that
|
---|
105 | * service-identifier type, and join the two with a period. For example, to
|
---|
106 | * filter by the meshUid field of the MeshIstio service-identifier type, you
|
---|
107 | * must filter on mesh_istio.mesh_uid = "123" to match all services with mesh
|
---|
108 | * UID "123". Service-identifier types and their attributes are described at
|
---|
109 | * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service
|
---|
110 | * @opt_param int pageSize A non-negative number that is the maximum number of
|
---|
111 | * results to return. When 0, use default page size.
|
---|
112 | * @opt_param string pageToken If this field is not empty then it must contain
|
---|
113 | * the nextPageToken value returned by a previous call to this method. Using
|
---|
114 | * this field causes the method to return additional results from the previous
|
---|
115 | * method call.
|
---|
116 | * @return ListServicesResponse
|
---|
117 | * @throws \Google\Service\Exception
|
---|
118 | */
|
---|
119 | public function listServices($parent, $optParams = [])
|
---|
120 | {
|
---|
121 | $params = ['parent' => $parent];
|
---|
122 | $params = array_merge($params, $optParams);
|
---|
123 | return $this->call('list', [$params], ListServicesResponse::class);
|
---|
124 | }
|
---|
125 | /**
|
---|
126 | * Update this Service. (services.patch)
|
---|
127 | *
|
---|
128 | * @param string $name Identifier. Resource name for this Service. The format
|
---|
129 | * is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
|
---|
130 | * @param Service $postBody
|
---|
131 | * @param array $optParams Optional parameters.
|
---|
132 | *
|
---|
133 | * @opt_param string updateMask A set of field paths defining which fields to
|
---|
134 | * use for the update.
|
---|
135 | * @return Service
|
---|
136 | * @throws \Google\Service\Exception
|
---|
137 | */
|
---|
138 | public function patch($name, Service $postBody, $optParams = [])
|
---|
139 | {
|
---|
140 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
141 | $params = array_merge($params, $optParams);
|
---|
142 | return $this->call('patch', [$params], Service::class);
|
---|
143 | }
|
---|
144 | }
|
---|
145 |
|
---|
146 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
147 | class_alias(Services::class, 'Google_Service_Monitoring_Resource_Services');
|
---|