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\ListTimeSeriesResponse; 21 22/** 23 * The "timeSeries" collection of methods. 24 * Typical usage is: 25 * <code> 26 * $monitoringService = new Google\Service\Monitoring(...); 27 * $timeSeries = $monitoringService->timeSeries; 28 * </code> 29 */ 30class FoldersTimeSeries extends \Google\Service\Resource 31{ 32 /** 33 * Lists time series that match a filter. (timeSeries.listFoldersTimeSeries) 34 * 35 * @param string $name Required. The project 36 * (https://cloud.google.com/monitoring/api/v3#project_name), organization or 37 * folder on which to execute the request. The format is: 38 * projects/[PROJECT_ID_OR_NUMBER] organizations/[ORGANIZATION_ID] 39 * folders/[FOLDER_ID] 40 * @param array $optParams Optional parameters. 41 * 42 * @opt_param string aggregation.alignmentPeriod The alignment_period specifies 43 * a time interval, in seconds, that is used to divide the data in all the time 44 * series into consistent blocks of time. This will be done before the per- 45 * series aligner can be applied to the data.The value must be at least 60 46 * seconds. If a per-series aligner other than ALIGN_NONE is specified, this 47 * field is required or an error is returned. If no per-series aligner is 48 * specified, or the aligner ALIGN_NONE is specified, then this field is 49 * ignored.The maximum value of the alignment_period is 104 weeks (2 years) for 50 * charts, and 90,000 seconds (25 hours) for alerting policies. 51 * @opt_param string aggregation.crossSeriesReducer The reduction operation to 52 * be used to combine time series into a single time series, where the value of 53 * each data point in the resulting series is a function of all the already 54 * aligned values in the input time series.Not all reducer operations can be 55 * applied to all time series. The valid choices depend on the metric_kind and 56 * the value_type of the original time series. Reduction can yield a time series 57 * with a different metric_kind or value_type than the input time series.Time 58 * series data must first be aligned (see per_series_aligner) in order to 59 * perform cross-time series reduction. If cross_series_reducer is specified, 60 * then per_series_aligner must be specified, and must not be ALIGN_NONE. An 61 * alignment_period must also be specified; otherwise, an error is returned. 62 * @opt_param string aggregation.groupByFields The set of fields to preserve 63 * when cross_series_reducer is specified. The group_by_fields determine how the 64 * time series are partitioned into subsets prior to applying the aggregation 65 * operation. Each subset contains time series that have the same value for each 66 * of the grouping fields. Each individual time series is a member of exactly 67 * one subset. The cross_series_reducer is applied to each subset of time 68 * series. It is not possible to reduce across different resource types, so this 69 * field implicitly contains resource.type. Fields not specified in 70 * group_by_fields are aggregated away. If group_by_fields is not specified and 71 * all the time series have the same resource type, then the time series are 72 * aggregated into a single output time series. If cross_series_reducer is not 73 * defined, this field is ignored. 74 * @opt_param string aggregation.perSeriesAligner An Aligner describes how to 75 * bring the data points in a single time series into temporal alignment. Except 76 * for ALIGN_NONE, all alignments cause all the data points in an 77 * alignment_period to be mathematically grouped together, resulting in a single 78 * data point for each alignment_period with end timestamp at the end of the 79 * period.Not all alignment operations may be applied to all time series. The 80 * valid choices depend on the metric_kind and value_type of the original time 81 * series. Alignment can change the metric_kind or the value_type of the time 82 * series.Time series data must be aligned in order to perform cross-time series 83 * reduction. If cross_series_reducer is specified, then per_series_aligner must 84 * be specified and not equal to ALIGN_NONE and alignment_period must be 85 * specified; otherwise, an error is returned. 86 * @opt_param string filter Required. A monitoring filter 87 * (https://cloud.google.com/monitoring/api/v3/filters) that specifies which 88 * time series should be returned. The filter must specify a single metric type, 89 * and can additionally specify metric labels and other information. For 90 * example: metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND 91 * metric.labels.instance_name = "my-instance-name" 92 * @opt_param string interval.endTime Required. The end of the time interval. 93 * @opt_param string interval.startTime Optional. The beginning of the time 94 * interval. The default value for the start time is the end time. The start 95 * time must not be later than the end time. 96 * @opt_param string orderBy Unsupported: must be left blank. The points in each 97 * time series are currently returned in reverse time order (most recent to 98 * oldest). 99 * @opt_param int pageSize A positive number that is the maximum number of 100 * results to return. If page_size is empty or more than 100,000 results, the 101 * effective page_size is 100,000 results. If view is set to FULL, this is the 102 * maximum number of Points returned. If view is set to HEADERS, this is the 103 * maximum number of TimeSeries 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 additional results from the previous 107 * method call. 108 * @opt_param string secondaryAggregation.alignmentPeriod The alignment_period 109 * specifies a time interval, in seconds, that is used to divide the data in all 110 * the time series into consistent blocks of time. This will be done before the 111 * per-series aligner can be applied to the data.The value must be at least 60 112 * seconds. If a per-series aligner other than ALIGN_NONE is specified, this 113 * field is required or an error is returned. If no per-series aligner is 114 * specified, or the aligner ALIGN_NONE is specified, then this field is 115 * ignored.The maximum value of the alignment_period is 104 weeks (2 years) for 116 * charts, and 90,000 seconds (25 hours) for alerting policies. 117 * @opt_param string secondaryAggregation.crossSeriesReducer The reduction 118 * operation to be used to combine time series into a single time series, where 119 * the value of each data point in the resulting series is a function of all the 120 * already aligned values in the input time series.Not all reducer operations 121 * can be applied to all time series. The valid choices depend on the 122 * metric_kind and the value_type of the original time series. Reduction can 123 * yield a time series with a different metric_kind or value_type than the input 124 * time series.Time series data must first be aligned (see per_series_aligner) 125 * in order to perform cross-time series reduction. If cross_series_reducer is 126 * specified, then per_series_aligner must be specified, and must not be 127 * ALIGN_NONE. An alignment_period must also be specified; otherwise, an error 128 * is returned. 129 * @opt_param string secondaryAggregation.groupByFields The set of fields to 130 * preserve when cross_series_reducer is specified. The group_by_fields 131 * determine how the time series are partitioned into subsets prior to applying 132 * the aggregation operation. Each subset contains time series that have the 133 * same value for each of the grouping fields. Each individual time series is a 134 * member of exactly one subset. The cross_series_reducer is applied to each 135 * subset of time series. It is not possible to reduce across different resource 136 * types, so this field implicitly contains resource.type. Fields not specified 137 * in group_by_fields are aggregated away. If group_by_fields is not specified 138 * and all the time series have the same resource type, then the time series are 139 * aggregated into a single output time series. If cross_series_reducer is not 140 * defined, this field is ignored. 141 * @opt_param string secondaryAggregation.perSeriesAligner An Aligner describes 142 * how to bring the data points in a single time series into temporal alignment. 143 * Except for ALIGN_NONE, all alignments cause all the data points in an 144 * alignment_period to be mathematically grouped together, resulting in a single 145 * data point for each alignment_period with end timestamp at the end of the 146 * period.Not all alignment operations may be applied to all time series. The 147 * valid choices depend on the metric_kind and value_type of the original time 148 * series. Alignment can change the metric_kind or the value_type of the time 149 * series.Time series data must be aligned in order to perform cross-time series 150 * reduction. If cross_series_reducer is specified, then per_series_aligner must 151 * be specified and not equal to ALIGN_NONE and alignment_period must be 152 * specified; otherwise, an error is returned. 153 * @opt_param string view Required. Specifies which information is returned 154 * about the time series. 155 * @return ListTimeSeriesResponse 156 */ 157 public function listFoldersTimeSeries($name, $optParams = []) 158 { 159 $params = ['name' => $name]; 160 $params = array_merge($params, $optParams); 161 return $this->call('list', [$params], ListTimeSeriesResponse::class); 162 } 163} 164 165// Adding a class alias for backwards compatibility with the previous class name. 166class_alias(FoldersTimeSeries::class, 'Google_Service_Monitoring_Resource_FoldersTimeSeries'); 167