Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit 74bc990

Browse files
refactor(samples): Fix documentation, typos, and function names (#72)
* feat(samples): Add POSIX samples * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Fix: `fs.promises` import * fix: clean-up created transfer job * chore: Add (safe) debug log * fix: misc bugs * chore: remove debug log * feat: add POSIX to POSIX sample - Also, update tests and comments * chore: typo & clean-up * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * refactor: styling * feat: Add POSIX Download sample * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: Add ending '/' * style: shorten variable * feat: Transfer Manifest request * fix: typo * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: `replaceAll` (not available in Node 12) -> `replace` * refactor(samples): Fix documentation, typos, and function names * fix: typo Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 1056c9f commit 74bc990

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

samples/manifest-request.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ async function main(
4040
// const sourceAgentPoolName = 'projects/my-project/agentPools/transfer_service_default'
4141

4242
// The root directory path on the source filesystem
43-
// const rootDirectory = '/directory/to/transfer/source',
43+
// const rootDirectory = '/directory/to/transfer/source'
4444

4545
// The ID of the GCS bucket to transfer data to
4646
// const gcsSinkBucket = 'my-sink-bucket'
4747

48-
// Transfer manifest location. Must be a
48+
// Transfer manifest location. Must be a `gs:` URL
4949
// const manifestLocation = 'gs://my-bucket/sample_manifest.csv'
5050

5151
// Creates a client
@@ -54,7 +54,7 @@ async function main(
5454
/**
5555
* Creates a request to transfer from the local file system to the sink bucket
5656
*/
57-
async function transferDirectory() {
57+
async function transferViaManifest() {
5858
const createRequest = {
5959
transferJob: {
6060
projectId,
@@ -87,7 +87,7 @@ async function main(
8787
);
8888
}
8989

90-
transferDirectory();
90+
transferViaManifest();
9191
// [END storagetransfer_manifest_request]
9292
}
9393

samples/posix-download.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ async function main(
4545
// An optional path on the Google Cloud Storage bucket to download from
4646
// const gcsSourcePath = 'foo/bar/'
4747

48-
// The root directory path on the source filesystem
49-
// const rootDirectory = '/directory/to/transfer/source',
48+
// The root directory path on the destination filesystem
49+
// const rootDirectory = '/directory/to/transfer/sink'
5050

5151
// Creates a client
5252
const client = new StorageTransferServiceClient();
5353

5454
/**
5555
* Creates a request to transfer from the local file system to the sink bucket
5656
*/
57-
async function transferDirectory() {
57+
async function downloadFromGCS() {
5858
const createRequest = {
5959
transferJob: {
6060
projectId,
@@ -87,7 +87,7 @@ async function main(
8787
);
8888
}
8989

90-
transferDirectory();
90+
downloadFromGCS();
9191
// [END storagetransfer_download_to_posix]
9292
}
9393

samples/posix-request.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function main(
3939
// const sourceAgentPoolName = 'projects/my-project/agentPools/transfer_service_default'
4040

4141
// The root directory path on the source filesystem
42-
// const rootDirectory = '/directory/to/transfer/source',
42+
// const rootDirectory = '/directory/to/transfer/source'
4343

4444
// The ID of the GCS bucket to transfer data to
4545
// const gcsSinkBucket = 'my-sink-bucket'

samples/posix-to-posix-request.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async function main(
4444
// const sinkAgentPoolName = 'projects/my-project/agentPools/transfer_service_default'
4545

4646
// The root directory path on the source filesystem
47-
// const rootDirectory = '/directory/to/transfer/source',
47+
// const rootDirectory = '/directory/to/transfer/source'
4848

4949
// The root directory path on the sink filesystem
5050
// const destinationDirectory = '/directory/to/transfer/sink'

samples/test/manifest-request.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('manifest-request', () => {
7272
await fs.rmdir(rootDirectory);
7373
});
7474

75-
it('should create a transfer job with a manifest from POSIX to GCS', async () => {
75+
it('should create a transfer job using a manifest from POSIX to GCS', async () => {
7676
const output = await runSample('manifest-request', [
7777
projectId,
7878
sourceAgentPoolName,

0 commit comments

Comments
 (0)