{"id":5947,"library":"google-cloud-filestore","title":"Google Cloud Filestore","description":"The `google-cloud-filestore` client library provides Python access to the Google Cloud Filestore API. Google Cloud Filestore offers fully managed NFS file servers that can be integrated with applications running on Compute Engine virtual machines (VMs) or Google Kubernetes Engine (GKE) clusters, providing high-performance, low-latency shared storage. The library is part of the actively developed `google-cloud-python` monorepo, receiving regular updates across its various client components.","status":"active","version":"1.16.0","language":"en","source_language":"en","source_url":"https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-filestore","tags":["google-cloud","filestore","nfs","storage","managed-service"],"install":[{"cmd":"pip install google-cloud-filestore","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"CloudFilestoreManagerClient","correct":"from google.cloud.filestore_v1 import CloudFilestoreManagerClient"},{"note":"The primary client class is `CloudFilestoreManagerClient` within the `filestore_v1` module, not a generic 'Client' directly under `google.cloud.filestore`.","wrong":"from google.cloud.filestore import Client","symbol":"filestore_v1","correct":"from google.cloud import filestore_v1"}],"quickstart":{"code":"import os\nfrom google.cloud.filestore_v1 import CloudFilestoreManagerClient\n\nproject_id = os.environ.get('GOOGLE_CLOUD_PROJECT', 'your-project-id') # Replace with your GCP project ID\nlocation = 'us-central1' # Replace with a suitable region, e.g., 'us-central1'\n\ndef list_filestore_instances():\n    \"\"\"Lists all Filestore instances in a given project and location.\"\"\"\n    client = CloudFilestoreManagerClient()\n    parent = f\"projects/{project_id}/locations/{location}\"\n\n    print(f\"Listing Filestore instances in {parent}:\")\n    try:\n        # The list_instances method returns a PagedAsyncIterator, which can be iterated directly\n        for instance in client.list_instances(parent=parent):\n            print(f\"  Instance: {instance.name.split('/')[-1]} (State: {instance.state.name}, Tier: {instance.tier.name})\")\n            print(f\"    IP Address: {instance.networks[0].ip_addresses[0] if instance.networks else 'N/A'}\")\n            print(f\"    Capacity: {instance.capacity_gb} GB\")\n    except Exception as e:\n        print(f\"Error listing instances: {e}\")\n\nif __name__ == '__main__':\n    list_filestore_instances()","lang":"python","description":"This quickstart demonstrates how to initialize the `CloudFilestoreManagerClient` and list existing Filestore instances within a specified Google Cloud project and location. Ensure your `GOOGLE_CLOUD_PROJECT` environment variable is set or replace 'your-project-id' and 'us-central1' with your actual project ID and desired region. Authentication is handled automatically via Application Default Credentials (ADC)."},"warnings":[{"fix":"Upgrade your Python environment to version 3.9 or later. The `google-cloud-filestore` library currently supports Python >= 3.9.","message":"Python 3.8 and older versions are no longer supported. Ensure your environment uses Python 3.9 or newer.","severity":"breaking","affected_versions":"<=1.x (older clients)"},{"fix":"Enable the Filestore API via the Google Cloud Console or using `gcloud services enable file.googleapis.com`.","message":"You must enable the Filestore API for your Google Cloud project before creating or managing instances. This is a common oversight leading to API permission errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Follow the Google Cloud authentication guide. For local development, `gcloud auth application-default login`. For production, ensure your service account has the necessary IAM roles (e.g., `roles/filestore.viewer` or `roles/filestore.editor`).","message":"Authentication is crucial. Ensure Application Default Credentials (ADC) are correctly set up, either by running `gcloud auth application-default login` for local development or by configuring service account credentials in production environments.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always place your Filestore instances in the same zone or region as the compute resources that will access them.","message":"Filestore instances are zonal or regional. Deploying your Filestore instance in a different zone or region than your Compute Engine VMs or GKE cluster can lead to increased latency and cross-zone networking costs.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Configure Python's logging module to handle logs from `google.cloud.filestore_v1` if you need to capture them. Exercise caution when storing logs that may contain sensitive data.","message":"The client library logs RPC events using Python's standard logging, and these logs might contain sensitive information. By default, these logs are not handled, so you must configure log handling explicitly.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}