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