# Cloud Run V2 API - Class Google::Cloud::Run::V2::Volume (v0.29.0)

0.29.0 (latest) 0.28.1 0.27.0 0.26.0 0.25.0 0.24.1 0.23.0 0.22.1 0.21.0 0.20.0 0.19.0 0.18.0 0.17.0 0.16.1 0.15.0 0.14.0 0.13.2 0.12.0 0.11.0 0.10.1 0.9.1 0.8.0 0.7.0 0.6.0 0.5.0 0.4.0 0.3.1 0.2.0 0.1.0 Reference documentation and code samples for the Cloud Run V2 API class Google::Cloud::Run::V2::Volume.

Volume represents a named volume in a container.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #cloud_sql_instance

    def cloud_sql_instance() -> ::Google::Cloud::Run::V2::CloudSqlInstance

**Returns**

- ([::Google::Cloud::Run::V2::CloudSqlInstance](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-CloudSqlInstance)) --- For Cloud SQL volumes, contains the specific instances that should be mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run.


  Note: The following fields are mutually exclusive: `cloud_sql_instance`, `secret`, `empty_dir`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #cloud_sql_instance=

    def cloud_sql_instance=(value) -> ::Google::Cloud::Run::V2::CloudSqlInstance

**Parameter**

- **value** ([::Google::Cloud::Run::V2::CloudSqlInstance](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-CloudSqlInstance)) --- For Cloud SQL volumes, contains the specific instances that should be mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run.


  Note: The following fields are mutually exclusive: `cloud_sql_instance`, `secret`, `empty_dir`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Run::V2::CloudSqlInstance](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-CloudSqlInstance)) --- For Cloud SQL volumes, contains the specific instances that should be mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run.


  Note: The following fields are mutually exclusive: `cloud_sql_instance`, `secret`, `empty_dir`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #empty_dir

    def empty_dir() -> ::Google::Cloud::Run::V2::EmptyDirVolumeSource

**Returns**

- ([::Google::Cloud::Run::V2::EmptyDirVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-EmptyDirVolumeSource)) --- Ephemeral storage used as a shared volume.


  Note: The following fields are mutually exclusive: `empty_dir`, `secret`, `cloud_sql_instance`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #empty_dir=

    def empty_dir=(value) -> ::Google::Cloud::Run::V2::EmptyDirVolumeSource

**Parameter**

- **value** ([::Google::Cloud::Run::V2::EmptyDirVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-EmptyDirVolumeSource)) --- Ephemeral storage used as a shared volume.


  Note: The following fields are mutually exclusive: `empty_dir`, `secret`, `cloud_sql_instance`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Run::V2::EmptyDirVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-EmptyDirVolumeSource)) --- Ephemeral storage used as a shared volume.


  Note: The following fields are mutually exclusive: `empty_dir`, `secret`, `cloud_sql_instance`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #gcs

    def gcs() -> ::Google::Cloud::Run::V2::GCSVolumeSource

**Returns**

- ([::Google::Cloud::Run::V2::GCSVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-GCSVolumeSource)) --- Persistent storage backed by a Google Cloud Storage bucket.


  Note: The following fields are mutually exclusive: `gcs`, `secret`, `cloud_sql_instance`, `empty_dir`, `nfs`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #gcs=

    def gcs=(value) -> ::Google::Cloud::Run::V2::GCSVolumeSource

**Parameter**

- **value** ([::Google::Cloud::Run::V2::GCSVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-GCSVolumeSource)) --- Persistent storage backed by a Google Cloud Storage bucket.


  Note: The following fields are mutually exclusive: `gcs`, `secret`, `cloud_sql_instance`, `empty_dir`, `nfs`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Run::V2::GCSVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-GCSVolumeSource)) --- Persistent storage backed by a Google Cloud Storage bucket.


  Note: The following fields are mutually exclusive: `gcs`, `secret`, `cloud_sql_instance`, `empty_dir`, `nfs`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #name

    def name() -> ::String

**Returns**

- (::String) --- Required. Volume's name.

### #name=

    def name=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. Volume's name.
**Returns**

- (::String) --- Required. Volume's name.

### #nfs

    def nfs() -> ::Google::Cloud::Run::V2::NFSVolumeSource

**Returns**

- ([::Google::Cloud::Run::V2::NFSVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-NFSVolumeSource)) --- For NFS Voumes, contains the path to the nfs Volume


  Note: The following fields are mutually exclusive: `nfs`, `secret`, `cloud_sql_instance`, `empty_dir`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #nfs=

    def nfs=(value) -> ::Google::Cloud::Run::V2::NFSVolumeSource

**Parameter**

- **value** ([::Google::Cloud::Run::V2::NFSVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-NFSVolumeSource)) --- For NFS Voumes, contains the path to the nfs Volume


  Note: The following fields are mutually exclusive: `nfs`, `secret`, `cloud_sql_instance`, `empty_dir`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Run::V2::NFSVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-NFSVolumeSource)) --- For NFS Voumes, contains the path to the nfs Volume


  Note: The following fields are mutually exclusive: `nfs`, `secret`, `cloud_sql_instance`, `empty_dir`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #secret

    def secret() -> ::Google::Cloud::Run::V2::SecretVolumeSource

**Returns**

- ([::Google::Cloud::Run::V2::SecretVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-SecretVolumeSource)) --- Secret represents a secret that should populate this volume.


  Note: The following fields are mutually exclusive: `secret`, `cloud_sql_instance`, `empty_dir`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #secret=

    def secret=(value) -> ::Google::Cloud::Run::V2::SecretVolumeSource

**Parameter**

- **value** ([::Google::Cloud::Run::V2::SecretVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-SecretVolumeSource)) --- Secret represents a secret that should populate this volume.


  Note: The following fields are mutually exclusive: `secret`, `cloud_sql_instance`, `empty_dir`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Run::V2::SecretVolumeSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-SecretVolumeSource)) --- Secret represents a secret that should populate this volume.


  Note: The following fields are mutually exclusive: `secret`, `cloud_sql_instance`, `empty_dir`, `nfs`, `gcs`. If a field in that set is populated, all other fields in the set will automatically be cleared.