Skip to content

Commit 2ce90f1

Browse files
daniel-sanchedpebot
authored andcommitted
Container Analysis Samples (#1024)
* added container analysis samples and client lib * changed library version from -0 to -alpha * renamed package * added new jar file * added readme
1 parent b60ecb3 commit 2ce90f1

File tree

9 files changed

+718
-0
lines changed

9 files changed

+718
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Container Analysis
2+
These samples demonstrate how to interact with the [Container Analysis API](https://cloud-dot-devsite.googleplex.com/container-analysis/api/reference/rest/) through Java.
3+
4+
5+
## Getting Started
6+
7+
8+
1. [Download](https://maven.apache.org/download.cgi) and [install](https://maven.apache.org/install.html) maven to handle the project's dependencies
9+
2. [Register your Google Cloud Platform project with the Container Analysis API]((https://console.cloud.google.com/flows/enableapi?apiid=containeranalysis.googleapis.com))
10+
3. Set your GOOGLE_CLOUD_PROJECT environment variable to your Project ID
11+
4. run `mvn clean verify` to build the project and run the tests
12+
13+
## Samples
14+
- **getDiscoveryInfo**
15+
- Retrieves the Discovery occurrence created for a specified image
16+
- **getOccurrencesForNote**
17+
- Retrieves all the occurrences associated with a specified note
18+
- **getOccurrencesForImage**
19+
- Retrieves all the occurrences associated with a specified image
20+
- **pubSub**
21+
- Handle incoming occurrences using a pubsub subscription
22+
- **createOccurrenceSubscription**
23+
- Creates and returns a pubsub subscription object listening to the occurrence topic
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>com.google.containerregistry</groupId>
6+
<artifactId>containeranalysis</artifactId>
7+
<version>1.0</version>
8+
<packaging>jar</packaging>
9+
10+
<name>containeranalysis</name>
11+
<url>http://maven.apache.org</url>
12+
13+
<!-- local maven repo contains container analysis client library -->
14+
<repositories>
15+
<repository>
16+
<id>project.local</id>
17+
<url>file:///${project.basedir}/repo</url>
18+
</repository>
19+
</repositories>
20+
21+
<!--
22+
The parent pom defines common style checks and testing strategies for our samples.
23+
Removing or replacing it should not affect the execution of the samples in anyway.
24+
-->
25+
<parent>
26+
<groupId>com.google.cloud.samples</groupId>
27+
<artifactId>shared-configuration</artifactId>
28+
<version>1.0.8</version>
29+
</parent>
30+
31+
<properties>
32+
<maven.compiler.source>1.8</maven.compiler.source>
33+
<maven.compiler.target>1.8</maven.compiler.target>
34+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
35+
</properties>
36+
37+
<dependencies>
38+
<!-- [START dependencies] -->
39+
<dependency>
40+
<groupId>com.google.cloud</groupId>
41+
<artifactId>google-cloud-containeranalysis</artifactId>
42+
<version>0.1.1-alpha</version>
43+
</dependency>
44+
<dependency>
45+
<groupId>com.google.cloud</groupId>
46+
<artifactId>google-cloud-pubsub</artifactId>
47+
<version>0.32.0-beta</version>
48+
</dependency>
49+
<dependency>
50+
<groupId>com.google.api</groupId>
51+
<artifactId>gax</artifactId>
52+
<version>1.15.0</version>
53+
</dependency>
54+
<dependency>
55+
<groupId>com.google.api</groupId>
56+
<artifactId>gax-grpc</artifactId>
57+
<version>1.15.0</version>
58+
</dependency>
59+
<dependency>
60+
<groupId>commons-cli</groupId>
61+
<artifactId>commons-cli</artifactId>
62+
<version>1.4</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>commons-lang</groupId>
66+
<artifactId>commons-lang</artifactId>
67+
<version>2.6</version>
68+
</dependency>
69+
<dependency>
70+
<groupId>io.netty</groupId>
71+
<artifactId>netty-tcnative-boringssl-static</artifactId>
72+
<version>2.0.7.Final</version>
73+
</dependency>
74+
75+
<!-- [END dependencies] -->
76+
<dependency>
77+
<groupId>junit</groupId>
78+
<artifactId>junit</artifactId>
79+
<version>4.12</version>
80+
<scope>test</scope>
81+
</dependency>
82+
</dependencies>
83+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.google.cloud</groupId>
6+
<artifactId>google-cloud-containeranalysis</artifactId>
7+
<version>0.1.1-alpha</version>
8+
<description>POM was created from install:install-file</description>
9+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<metadata>
3+
<groupId>com.google.cloud</groupId>
4+
<artifactId>google-cloud-containeranalysis</artifactId>
5+
<versioning>
6+
<release>0.1.1-alpha</release>
7+
<versions>
8+
<version>0.1.1-alpha</version>
9+
</versions>
10+
<lastUpdated>20180212185424</lastUpdated>
11+
</versioning>
12+
</metadata>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Manifest-Version: 1.0
2+
Main-Class: com.google.cloud.devtools.containeranalysis.v1alpha1.Sampl
3+
eApp
4+

0 commit comments

Comments
 (0)