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

Commit

Permalink
chore: migrate samples to java-docs-samples/monitoring (#998)
Browse files Browse the repository at this point in the history
* chore: migrate samples to java-docs-samples/monitoring

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
minherz and gcf-owl-bot[bot] committed Nov 14, 2022
1 parent 1e29fa6 commit f234938
Show file tree
Hide file tree
Showing 40 changed files with 4 additions and 3,492 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/samples.yaml

This file was deleted.

60 changes: 2 additions & 58 deletions README.md
Expand Up @@ -18,49 +18,18 @@ The Maven artifact coordinates (`com.google.cloud:google-cloud-monitoring`) rema

## Quickstart

If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:

```xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.1.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-monitoring</artifactId>
</dependency>
</dependencies>

```

If you are using Maven without BOM, add this to your dependencies:
If you are using Maven, add this to your pom.xml file:


```xml
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-monitoring</artifactId>
<version>3.4.6</version>
<version>3.6.0</version>
</dependency>

```

If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.1.4')
implementation 'com.google.cloud:google-cloud-monitoring'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
Expand Down Expand Up @@ -108,31 +77,6 @@ use this Stackdriver Monitoring Client Library.



## Samples

Samples are in the [`samples/`](https://github.com/googleapis/java-monitoring/tree/main/samples) directory.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Create Alert Policy | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/CreateAlertPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/CreateAlertPolicy.java) |
| Create Metric Descriptor | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/CreateMetricDescriptor.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/CreateMetricDescriptor.java) |
| Create Time Series | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/CreateTimeSeries.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/CreateTimeSeries.java) |
| Delete Alert Policy | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/DeleteAlertPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/DeleteAlertPolicy.java) |
| Delete Metric Descriptor | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/DeleteMetricDescriptor.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/DeleteMetricDescriptor.java) |
| Delete Notification Channel | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/DeleteNotificationChannel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/DeleteNotificationChannel.java) |
| Enable Disable Alert Policy | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/EnableDisableAlertPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/EnableDisableAlertPolicy.java) |
| Get Alert Policy | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/GetAlertPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/GetAlertPolicy.java) |
| Get Monitored Resource | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/GetMonitoredResource.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/GetMonitoredResource.java) |
| List Alert Policy | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/ListAlertPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/ListAlertPolicy.java) |
| List Metric Descriptor | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/ListMetricDescriptor.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/ListMetricDescriptor.java) |
| List Time Series | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/ListTimeSeries.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/ListTimeSeries.java) |
| Monitored Resources List | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/MonitoredResourcesList.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/MonitoredResourcesList.java) |
| Quickstart Sample | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/QuickstartSample.java) |
| Time Series Headers List | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/TimeSeriesHeadersList.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/TimeSeriesHeadersList.java) |
| Update Alert Policy | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/UpdateAlertPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/UpdateAlertPolicy.java) |
| Uptime Sample | [source code](https://github.com/googleapis/java-monitoring/blob/main/samples/snippets/src/main/java/com/example/monitoring/UptimeSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-monitoring&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/monitoring/UptimeSample.java) |



## Troubleshooting

Expand Down
2 changes: 2 additions & 0 deletions owlbot.py
Expand Up @@ -42,4 +42,6 @@ def fix_resource(client, version, name):
s.remove_staging_dirs()
java.common_templates(excludes=[
'.kokoro/dependencies.sh',
'.github/workflows/samples.yaml',
'samples/**'
])
82 changes: 0 additions & 82 deletions samples/install-without-bom/pom.xml

This file was deleted.

82 changes: 0 additions & 82 deletions samples/pom.xml

This file was deleted.

92 changes: 0 additions & 92 deletions samples/snapshot/pom.xml

This file was deleted.

0 comments on commit f234938

Please sign in to comment.