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

Commit

Permalink
refactor(samples): Fix documentation, typos, and function names (#72)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
d-goog and gcf-owl-bot[bot] authored Jun 16, 2022
1 parent 1056c9f commit 74bc990
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions samples/manifest-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ async function main(
// const sourceAgentPoolName = 'projects/my-project/agentPools/transfer_service_default'

// The root directory path on the source filesystem
// const rootDirectory = '/directory/to/transfer/source',
// const rootDirectory = '/directory/to/transfer/source'

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

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

// Creates a client
Expand All @@ -54,7 +54,7 @@ async function main(
/**
* Creates a request to transfer from the local file system to the sink bucket
*/
async function transferDirectory() {
async function transferViaManifest() {
const createRequest = {
transferJob: {
projectId,
Expand Down Expand Up @@ -87,7 +87,7 @@ async function main(
);
}

transferDirectory();
transferViaManifest();
// [END storagetransfer_manifest_request]
}

Expand Down
8 changes: 4 additions & 4 deletions samples/posix-download.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ async function main(
// An optional path on the Google Cloud Storage bucket to download from
// const gcsSourcePath = 'foo/bar/'

// The root directory path on the source filesystem
// const rootDirectory = '/directory/to/transfer/source',
// The root directory path on the destination filesystem
// const rootDirectory = '/directory/to/transfer/sink'

// Creates a client
const client = new StorageTransferServiceClient();

/**
* Creates a request to transfer from the local file system to the sink bucket
*/
async function transferDirectory() {
async function downloadFromGCS() {
const createRequest = {
transferJob: {
projectId,
Expand Down Expand Up @@ -87,7 +87,7 @@ async function main(
);
}

transferDirectory();
downloadFromGCS();
// [END storagetransfer_download_to_posix]
}

Expand Down
2 changes: 1 addition & 1 deletion samples/posix-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function main(
// const sourceAgentPoolName = 'projects/my-project/agentPools/transfer_service_default'

// The root directory path on the source filesystem
// const rootDirectory = '/directory/to/transfer/source',
// const rootDirectory = '/directory/to/transfer/source'

// The ID of the GCS bucket to transfer data to
// const gcsSinkBucket = 'my-sink-bucket'
Expand Down
2 changes: 1 addition & 1 deletion samples/posix-to-posix-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function main(
// const sinkAgentPoolName = 'projects/my-project/agentPools/transfer_service_default'

// The root directory path on the source filesystem
// const rootDirectory = '/directory/to/transfer/source',
// const rootDirectory = '/directory/to/transfer/source'

// The root directory path on the sink filesystem
// const destinationDirectory = '/directory/to/transfer/sink'
Expand Down
2 changes: 1 addition & 1 deletion samples/test/manifest-request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('manifest-request', () => {
await fs.rmdir(rootDirectory);
});

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

0 comments on commit 74bc990

Please sign in to comment.