Skip to content

Commit 516d576

Browse files
chore: add readme for storagetransfer (#1985)
1 parent 4fdc797 commit 516d576

File tree

3 files changed

+66
-3
lines changed

3 files changed

+66
-3
lines changed

appengine/standard/tasks/snippets/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Description
44

5-
Al code in the snippets directory demonstrate how to invoke Cloud Tasks from PHP.
5+
All code in the snippets directory demonstrate how to invoke Cloud Tasks from PHP.
66

77
`src/create_task.php` is a simple function to create tasks with App Engine routing.
88

storagetransfer/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Google Cloud Storage Transfer Samples
2+
3+
## Description
4+
5+
All code in the snippets directory demonstrate how to invoke
6+
[Cloud Storage Trasfer][cloud-storage-transfer] from PHP.
7+
8+
`src/quickstart.php` is a sample function to create and run a transfer job between two GCS buckets.
9+
10+
[cloud-storage-transfer]: https://cloud.google.com/storage-transfer/docs/create-transfers
11+
12+
## Setup:
13+
14+
1. **Enable APIs** - [Enable the Storage Transfer Service API](https://console.cloud.google.com/flows/enableapi?apiid=storagetransfer.googleapis.com)
15+
and create a new project or select an existing project.
16+
2. **Download The Credentials** - Click "Go to credentials" after enabling the APIs. Click "New Credentials"
17+
and select "Service Account Key". Create a new service account, use the JSON key type, and
18+
select "Create". Once downloaded, set the environment variable `GOOGLE_APPLICATION_CREDENTIALS`
19+
to the path of the JSON key that was downloaded.
20+
3. **Clone the repo** and cd into this directory
21+
22+
```sh
23+
$ git clone https://github.com/GoogleCloudPlatform/php-docs-samples
24+
$ cd php-docs-samples/storagetransfer
25+
```
26+
4. **Install dependencies** via [Composer](http://getcomposer.org/doc/00-intro.md).
27+
Run `php composer.phar install` (if composer is installed locally) or `composer install`
28+
(if composer is installed globally).
29+
30+
31+
## Samples
32+
33+
To run the Storage Transfer Samples, run any of the files in `src/` on the CLI:
34+
35+
```
36+
$ php src/quickstart.php
37+
38+
Usage: quickstart.php $bucketName $sourceGcsBucketName $sinkGcsBucketName
39+
40+
@param string $projectId The Project ID
41+
@param string $sourceGcsBucketName The Storage bucket name
42+
@param string $sinkGcsBucketName The Storage bucket name
43+
```
44+
45+
46+
## The client library
47+
48+
This sample uses the [Cloud Storage Transfer Client Library for PHP][google-cloud-php-storage-transfer].
49+
You can read the documentation for more details on API usage and use GitHub
50+
to [browse the source][google-cloud-php-source] and [report issues][google-cloud-php-issues].
51+
52+
[google-cloud-php-storage-transfer]: https://cloud.google.com/php/docs/reference/cloud-storage-transfer/latest
53+
[google-cloud-php-source]: https://github.com/GoogleCloudPlatform/google-cloud-php
54+
[google-cloud-php-issues]: https://github.com/GoogleCloudPlatform/google-cloud-php/issues
55+
[google-cloud-sdk]: https://cloud.google.com/sdk/
56+
57+
## Contributing changes
58+
59+
* See [CONTRIBUTING.md](../../CONTRIBUTING.md)
60+
61+
## Licensing
62+
63+
* See [LICENSE](../../LICENSE)

tasks/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Description
44

5-
Al code in the snippets directory demonstrate how to invoke
5+
All code in the snippets directory demonstrate how to invoke
66
[Cloud Tasks][cloud-tasks] from PHP.
77

88
`src/create_http_task.php` is a simple function to create tasks with an HTTP target.
@@ -44,7 +44,7 @@ Al code in the snippets directory demonstrate how to invoke
4444
* `PROJECT_ID` is your Google Cloud Project id.
4545
* `QUEUE_ID` is your queue id.
4646
Queue IDs already created can be listed with `gcloud tasks queues list`.
47-
* `LOCATION_ID` is the location of your queue.
47+
* `LOCATION_ID` is the location of your queue.
4848
Determine the location ID, which can be discovered with
4949
`gcloud tasks queues describe <QUEUE_NAME>`, with the location embedded in
5050
the "name" value (for instance, if the name is

0 commit comments

Comments
 (0)