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\Monitoring\Resource; 19 20use Google\Service\Monitoring\ListMonitoredResourceDescriptorsResponse; 21use Google\Service\Monitoring\MonitoredResourceDescriptor; 22 23/** 24 * The "monitoredResourceDescriptors" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $monitoringService = new Google\Service\Monitoring(...); 28 * $monitoredResourceDescriptors = $monitoringService->monitoredResourceDescriptors; 29 * </code> 30 */ 31class ProjectsMonitoredResourceDescriptors extends \Google\Service\Resource 32{ 33 /** 34 * Gets a single monitored resource descriptor. 35 * (monitoredResourceDescriptors.get) 36 * 37 * @param string $name Required. The monitored resource descriptor to get. The 38 * format is: 39 * projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] 40 * The [RESOURCE_TYPE] is a predefined type, such as cloudsql_database. 41 * @param array $optParams Optional parameters. 42 * @return MonitoredResourceDescriptor 43 */ 44 public function get($name, $optParams = []) 45 { 46 $params = ['name' => $name]; 47 $params = array_merge($params, $optParams); 48 return $this->call('get', [$params], MonitoredResourceDescriptor::class); 49 } 50 /** 51 * Lists monitored resource descriptors that match a filter. 52 * (monitoredResourceDescriptors.listProjectsMonitoredResourceDescriptors) 53 * 54 * @param string $name Required. The project 55 * (https://cloud.google.com/monitoring/api/v3#project_name) on which to execute 56 * the request. The format is: projects/[PROJECT_ID_OR_NUMBER] 57 * @param array $optParams Optional parameters. 58 * 59 * @opt_param string filter An optional filter 60 * (https://cloud.google.com/monitoring/api/v3/filters) describing the 61 * descriptors to be returned. The filter can reference the descriptor's type 62 * and labels. For example, the following filter returns only Google Compute 63 * Engine descriptors that have an id label: resource.type = starts_with("gce_") 64 * AND resource.label:id 65 * @opt_param int pageSize A positive number that is the maximum number of 66 * results to return. 67 * @opt_param string pageToken If this field is not empty then it must contain 68 * the nextPageToken value returned by a previous call to this method. Using 69 * this field causes the method to return additional results from the previous 70 * method call. 71 * @return ListMonitoredResourceDescriptorsResponse 72 */ 73 public function listProjectsMonitoredResourceDescriptors($name, $optParams = []) 74 { 75 $params = ['name' => $name]; 76 $params = array_merge($params, $optParams); 77 return $this->call('list', [$params], ListMonitoredResourceDescriptorsResponse::class); 78 } 79} 80 81// Adding a class alias for backwards compatibility with the previous class name. 82class_alias(ProjectsMonitoredResourceDescriptors::class, 'Google_Service_Monitoring_Resource_ProjectsMonitoredResourceDescriptors'); 83