Skip to content

Commit 1fe331a

Browse files
authored
Remove Tasks samples (moved to java-tasks) (GoogleCloudPlatform#4050)
Fixes #issue > It's a good idea to open an issue first for discussion. - [ ] I have followed [Sample Format Guide](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/SAMPLE_FORMAT.md) - [ ] `pom.xml` parent set to latest `shared-configuration` - [ ] Appropriate changes to README are included in PR - [ ] API's need to be enabled to test (tell us) - [ ] Environment Variables need to be set (ask us to set them) - [ ] **Tests** pass: `mvn clean verify` **required** - [ ] **Lint** passes: `mvn -P lint checkstyle:check` **required** - [ ] **Static Analysis**: `mvn -P lint clean compile pmd:cpd-check spotbugs:check` **advisory only** - [ ] Please **merge** this PR for me once it is approved.
1 parent 2d15a2e commit 1fe331a

File tree

11 files changed

+1
-805
lines changed

11 files changed

+1
-805
lines changed

tasks/README.md

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,3 @@
11
# Google Cloud Tasks Samples
22

3-
This sample demonstrates using the Cloud Tasks client library. These code snippets
4-
are not executable, but are a copy-and-pasteable resource for your own code
5-
base. For executable code, see the [App Engine Quickstart](https://cloud.google.com/tasks/docs/quickstart-appengine).
6-
7-
See the [Cloud Tasks documentation](https://cloud.google.com/tasks/docs/) for more info on [Creating HTTP Target tasks](https://cloud.google.com/tasks/docs/creating-http-target-tasks).
8-
9-
`CreateHttpTask.java` constructs a task with an HTTP target and pushes it
10-
to your queue.
11-
12-
`CreateHttpTask.java` constructs a task with an HTTP target and OIDC token and
13-
pushes it to your queue.
14-
15-
## Initial Setup
16-
17-
* Set up a Google Cloud Project and enable billing.
18-
* Enable the
19-
[Cloud Tasks API](https://console.cloud.google.com/launcher/details/google/cloudtasks.googleapis.com).
20-
* Download and install the [Cloud SDK](https://cloud.google.com/sdk).
21-
* Download and install [Maven](http://maven.apache.org/install.html).
22-
* Set up [Google Application Credentials](https://cloud.google.com/docs/authentication/getting-started).
23-
24-
## Creating a queue
25-
26-
To create a queue using the Cloud SDK, use the following `gcloud` command:
27-
28-
```
29-
gcloud tasks queues create <QUEUE_NAME>
30-
```
31-
32-
The location of your queue is the same as your Google Cloud Project. It can be discovered by using the following `gcloud` command:
33-
34-
```
35-
gcloud tasks queues describe <QUEUE_NAME>
36-
```
37-
the location embedded in the "name" value (for instance, if the name is
38-
"projects/my-project/locations/us-central1/queues/my-queue", then the
39-
location is "us-central1").
40-
41-
## Creating Tasks with HTTP Targets
42-
43-
Set an endpoint to your task handler by replacing the variable `url` with your
44-
HTTP target in `CreateHttpTask.java`.
45-
46-
The sample will create a task and add it to your queue. As the queue processes
47-
each task, it will send the task to the specific URL endpoint.
48-
49-
## Using HTTP Targets with Authentication Tokens
50-
51-
Set an endpoint to your task handler by replacing the variable `url` with your
52-
HTTP target in `CreateHttpTaskWithToken.java`.
53-
54-
Your Cloud Tasks [service account][sa],
55-
56-
have the role of: `Service Account Token Creator` to generate a tokens.
57-
58-
Create or use an existing [service account][sa] to authenticate the OIDC token.
59-
60-
[sa]: https://cloud.google.com/iam/docs/service-accounts
3+
These samples have moved to [googleapis/java-tasks](https://github.com/googleapis/java-tasks/tree/master/samples).

tasks/pom.xml

Lines changed: 0 additions & 90 deletions
This file was deleted.

tasks/src/main/java/com/example/task/CreateHttpTask.java

Lines changed: 0 additions & 67 deletions
This file was deleted.

tasks/src/main/java/com/example/task/CreateHttpTaskWithToken.java

Lines changed: 0 additions & 78 deletions
This file was deleted.

tasks/src/main/java/com/example/task/CreateQueue.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)