Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
feat(v3): added support for TimeSeriesQueryLanguageCondition conditio…
Browse files Browse the repository at this point in the history
…n type in alert policies (#106)

This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/8dc67c4c-b602-45d4-bcb1-8c58b15f5c34/targets
  • Loading branch information
yoshi-automation committed Mar 26, 2020
1 parent 1cb9d5e commit ef9ee03
Show file tree
Hide file tree
Showing 114 changed files with 19,652 additions and 1,452 deletions.
19 changes: 12 additions & 7 deletions .kokoro/build.sh
Expand Up @@ -20,17 +20,22 @@ scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
## cd to the parent directory, i.e. the root of the git repo
cd ${scriptDir}/..

# include common functions
source ${scriptDir}/common.sh

# Print out Java version
java -version
echo ${JOB_TYPE}

mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-T 1C
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-T 1C

# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it
if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then
Expand Down
44 changes: 44 additions & 0 deletions .kokoro/common.sh
@@ -0,0 +1,44 @@
#!/bin/bash
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# set -eo pipefail

function retry_with_backoff {
attempts_left=$1
sleep_seconds=$2
shift 2
command=$@

echo "${command}"
${command}
exit_code=$?

if [[ $exit_code == 0 ]]
then
return 0
fi

# failure
if [[ ${attempts_left} > 0 ]]
then
echo "failure (${exit_code}), sleeping ${sleep_seconds}..."
sleep ${sleep_seconds}
new_attempts=$((${attempts_left} - 1))
new_sleep=$((${sleep_seconds} * 2))
retry_with_backoff ${new_attempts} ${new_sleep} ${command}
fi

return $exit_code
}
15 changes: 11 additions & 4 deletions .kokoro/dependencies.sh
Expand Up @@ -15,7 +15,13 @@

set -eo pipefail

cd github/java-monitoring/
## Get the directory of the build script
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
## cd to the parent directory, i.e. the root of the git repo
cd ${scriptDir}/..

# include common functions
source ${scriptDir}/common.sh

# Print out Java
java -version
Expand All @@ -24,8 +30,9 @@ echo $JOB_TYPE
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"

# this should run maven enforcer
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true
retry_with_backoff 3 10 \
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true

mvn -B dependency:analyze -DfailOnWarning=true
22 changes: 15 additions & 7 deletions .kokoro/linkage-monitor.sh
Expand Up @@ -17,18 +17,26 @@ set -eo pipefail
# Display commands being run.
set -x

cd github/java-monitoring/
## Get the directory of the build script
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
## cd to the parent directory, i.e. the root of the git repo
cd ${scriptDir}/..

# include common functions
source ${scriptDir}/common.sh

# Print out Java version
java -version
echo ${JOB_TYPE}

mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true

# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR
JAR=linkage-monitor-latest-all-deps.jar
Expand Down
Expand Up @@ -175,7 +175,7 @@ public MetricServiceStub getStub() {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists monitored resource descriptors that match a filter. This method does not require a
* Stackdriver account.
* Workspace.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -204,7 +204,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists monitored resource descriptors that match a filter. This method does not require a
* Stackdriver account.
* Workspace.
*
* <p>Sample code:
*
Expand All @@ -231,7 +231,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists monitored resource descriptors that match a filter. This method does not require a
* Stackdriver account.
* Workspace.
*
* <p>Sample code:
*
Expand All @@ -258,7 +258,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists monitored resource descriptors that match a filter. This method does not require a
* Stackdriver account.
* Workspace.
*
* <p>Sample code:
*
Expand All @@ -285,7 +285,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists monitored resource descriptors that match a filter. This method does not require a
* Stackdriver account.
* Workspace.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -318,8 +318,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a single monitored resource descriptor. This method does not require a Stackdriver
* account.
* Gets a single monitored resource descriptor. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand All @@ -346,8 +345,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a single monitored resource descriptor. This method does not require a Stackdriver
* account.
* Gets a single monitored resource descriptor. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand All @@ -371,8 +369,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(String n

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a single monitored resource descriptor. This method does not require a Stackdriver
* account.
* Gets a single monitored resource descriptor. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand All @@ -396,8 +393,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a single monitored resource descriptor. This method does not require a Stackdriver
* account.
* Gets a single monitored resource descriptor. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand All @@ -420,8 +416,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists metric descriptors that match a filter. This method does not require a Stackdriver
* account.
* Lists metric descriptors that match a filter. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand All @@ -448,8 +443,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(ProjectNam

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists metric descriptors that match a filter. This method does not require a Stackdriver
* account.
* Lists metric descriptors that match a filter. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand All @@ -474,8 +468,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(String nam

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists metric descriptors that match a filter. This method does not require a Stackdriver
* account.
* Lists metric descriptors that match a filter. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand All @@ -501,8 +494,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists metric descriptors that match a filter. This method does not require a Stackdriver
* account.
* Lists metric descriptors that match a filter. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand All @@ -527,8 +519,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists metric descriptors that match a filter. This method does not require a Stackdriver
* account.
* Lists metric descriptors that match a filter. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -560,7 +551,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a single metric descriptor. This method does not require a Stackdriver account.
* Gets a single metric descriptor. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand All @@ -587,7 +578,7 @@ public final MetricDescriptor getMetricDescriptor(MetricDescriptorName name) {

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a single metric descriptor. This method does not require a Stackdriver account.
* Gets a single metric descriptor. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand All @@ -612,7 +603,7 @@ public final MetricDescriptor getMetricDescriptor(String name) {

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a single metric descriptor. This method does not require a Stackdriver account.
* Gets a single metric descriptor. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand All @@ -635,7 +626,7 @@ public final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest req

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a single metric descriptor. This method does not require a Stackdriver account.
* Gets a single metric descriptor. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -872,7 +863,7 @@ public final void deleteMetricDescriptor(DeleteMetricDescriptorRequest request)

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists time series that match a filter. This method does not require a Stackdriver account.
* Lists time series that match a filter. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -918,7 +909,7 @@ public final ListTimeSeriesPagedResponse listTimeSeries(

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists time series that match a filter. This method does not require a Stackdriver account.
* Lists time series that match a filter. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -964,7 +955,7 @@ public final ListTimeSeriesPagedResponse listTimeSeries(

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists time series that match a filter. This method does not require a Stackdriver account.
* Lists time series that match a filter. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -995,7 +986,7 @@ public final ListTimeSeriesPagedResponse listTimeSeries(ListTimeSeriesRequest re

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists time series that match a filter. This method does not require a Stackdriver account.
* Lists time series that match a filter. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1026,7 +1017,7 @@ public final ListTimeSeriesPagedResponse listTimeSeries(ListTimeSeriesRequest re

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists time series that match a filter. This method does not require a Stackdriver account.
* Lists time series that match a filter. This method does not require a Workspace.
*
* <p>Sample code:
*
Expand Down

0 comments on commit ef9ee03

Please sign in to comment.