Skip to content

Commit

Permalink
feat: new APIs added to reflect updates to the filestore service (#93)
Browse files Browse the repository at this point in the history
* feat: new APIs added to reflect updates to the filestore service

- Add ENTERPRISE Tier
- Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot
- Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare
- Add ConnectMode to NetworkConfig (for Private Service Access support)
- New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING)
- Add SuspensionReason (for KMS related suspension)
- Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled

PiperOrigin-RevId: 487492758

Source-Link: googleapis/googleapis@5be5981

Source-Link: googleapis/googleapis-gen@ab0e217
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Nov 11, 2022
1 parent 97087c6 commit 832c765
Show file tree
Hide file tree
Showing 25 changed files with 15,940 additions and 2,150 deletions.

Large diffs are not rendered by default.

2,476 changes: 2,152 additions & 324 deletions packages/google-cloud-filestore/protos/protos.d.ts

Large diffs are not rendered by default.

6,457 changes: 5,442 additions & 1,015 deletions packages/google-cloud-filestore/protos/protos.js

Large diffs are not rendered by default.

641 changes: 639 additions & 2 deletions packages/google-cloud-filestore/protos/protos.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main(parent, backup, backupId) {
*/
/**
* Required. The backup's project and location, in the format
* `projects/{project_id}/locations/{location}`. In Cloud Filestore,
* `projects/{project_id}/locations/{location}`. In Filestore,
* backup locations map to GCP regions, for example **us-west1**.
*/
// const parent = 'abc123'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main(parent, instanceId, instance) {
*/
/**
* Required. The instance's project and location, in the format
* `projects/{project_id}/locations/{location}`. In Cloud Filestore,
* `projects/{project_id}/locations/{location}`. In Filestore,
* locations map to GCP zones, for example **us-west1-b**.
*/
// const parent = 'abc123'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(parent, shareId, share) {
// [START file_v1beta1_generated_CloudFilestoreManager_CreateShare_async]
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The Filestore Instance to create the share for, in the format
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const parent = 'abc123'
/**
* Required. The ID to use for the share.
* The ID must be unique within the specified instance.
* This value must start with a lowercase letter followed by up to 62
* lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
*/
// const shareId = 'abc123'
/**
* Required. A share resource
*/
// const share = {}

// Imports the Filestore library
const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

// Instantiates a client
const filestoreClient = new CloudFilestoreManagerClient();

async function callCreateShare() {
// Construct request
const request = {
parent,
shareId,
share,
};

// Run request
const [operation] = await filestoreClient.createShare(request);
const [response] = await operation.promise();
console.log(response);
}

callCreateShare();
// [END file_v1beta1_generated_CloudFilestoreManager_CreateShare_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(parent, snapshotId, snapshot) {
// [START file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_async]
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The Filestore Instance to create the snapshots of, in the format
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const parent = 'abc123'
/**
* Required. The ID to use for the snapshot.
* The ID must be unique within the specified instance.
* This value must start with a lowercase letter followed by up to 62
* lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
*/
// const snapshotId = 'abc123'
/**
* Required. A snapshot resource
*/
// const snapshot = {}

// Imports the Filestore library
const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

// Instantiates a client
const filestoreClient = new CloudFilestoreManagerClient();

async function callCreateSnapshot() {
// Construct request
const request = {
parent,
snapshotId,
snapshot,
};

// Run request
const [operation] = await filestoreClient.createSnapshot(request);
const [response] = await operation.promise();
console.log(response);
}

callCreateSnapshot();
// [END file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ function main(name) {
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
/**
* If set to true, any snapshots of the instance will also be deleted.
* (Otherwise, the request will only work if the instance has no snapshots.)
*/
// const force = true

// Imports the Filestore library
const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(name) {
// [START file_v1beta1_generated_CloudFilestoreManager_DeleteShare_async]
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The share resource name, in the format
* `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
*/
// const name = 'abc123'

// Imports the Filestore library
const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

// Instantiates a client
const filestoreClient = new CloudFilestoreManagerClient();

async function callDeleteShare() {
// Construct request
const request = {
name,
};

// Run request
const [operation] = await filestoreClient.deleteShare(request);
const [response] = await operation.promise();
console.log(response);
}

callDeleteShare();
// [END file_v1beta1_generated_CloudFilestoreManager_DeleteShare_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(name) {
// [START file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_async]
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The snapshot resource name, in the format
* `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
*/
// const name = 'abc123'

// Imports the Filestore library
const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

// Instantiates a client
const filestoreClient = new CloudFilestoreManagerClient();

async function callDeleteSnapshot() {
// Construct request
const request = {
name,
};

// Run request
const [operation] = await filestoreClient.deleteSnapshot(request);
const [response] = await operation.promise();
console.log(response);
}

callDeleteSnapshot();
// [END file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(name) {
// [START file_v1beta1_generated_CloudFilestoreManager_GetShare_async]
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The share resource name, in the format
* `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
*/
// const name = 'abc123'

// Imports the Filestore library
const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

// Instantiates a client
const filestoreClient = new CloudFilestoreManagerClient();

async function callGetShare() {
// Construct request
const request = {
name,
};

// Run request
const response = await filestoreClient.getShare(request);
console.log(response);
}

callGetShare();
// [END file_v1beta1_generated_CloudFilestoreManager_GetShare_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Loading

0 comments on commit 832c765

Please sign in to comment.