Reference documentation and code samples for the Cloud OS Config V1 API class Google::Cloud::OsConfig::V1::OSPolicy::Resource::FileResource.
A resource that manages the state of a file.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#content
defcontent()->::String
Returns
(::String) — A a file with this content.
The size of the content is limited to 1024 characters.
Note: The following fields are mutually exclusive: content, file. If a field in that set is populated, all other fields in the set will automatically be cleared.
#content=
defcontent=(value)->::String
Parameter
value (::String) — A a file with this content.
The size of the content is limited to 1024 characters.
Note: The following fields are mutually exclusive: content, file. If a field in that set is populated, all other fields in the set will automatically be cleared.
Returns
(::String) — A a file with this content.
The size of the content is limited to 1024 characters.
Note: The following fields are mutually exclusive: content, file. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: file, content. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: file, content. If a field in that set is populated, all other fields in the set will automatically be cleared.
Note: The following fields are mutually exclusive: file, content. If a field in that set is populated, all other fields in the set will automatically be cleared.
#path
defpath()->::String
Returns
(::String) — Required. The absolute path of the file within the VM.
#path=
defpath=(value)->::String
Parameter
value (::String) — Required. The absolute path of the file within the VM.
Returns
(::String) — Required. The absolute path of the file within the VM.
#permissions
defpermissions()->::String
Returns
(::String) — Consists of three octal digits which represent, in
order, the permissions of the owner, group, and other users for the
file (similarly to the numeric mode used in the linux chmod
utility). Each digit represents a three bit number with the 4 bit
corresponding to the read permissions, the 2 bit corresponds to the
write bit, and the one bit corresponds to the execute permission.
Default behavior is 755.
Below are some examples of permissions and their associated values:
read, write, and execute: 7
read and execute: 5
read and write: 6
read only: 4
#permissions=
defpermissions=(value)->::String
Parameter
value (::String) — Consists of three octal digits which represent, in
order, the permissions of the owner, group, and other users for the
file (similarly to the numeric mode used in the linux chmod
utility). Each digit represents a three bit number with the 4 bit
corresponding to the read permissions, the 2 bit corresponds to the
write bit, and the one bit corresponds to the execute permission.
Default behavior is 755.
Below are some examples of permissions and their associated values:
read, write, and execute: 7
read and execute: 5
read and write: 6
read only: 4
Returns
(::String) — Consists of three octal digits which represent, in
order, the permissions of the owner, group, and other users for the
file (similarly to the numeric mode used in the linux chmod
utility). Each digit represents a three bit number with the 4 bit
corresponding to the read permissions, the 2 bit corresponds to the
write bit, and the one bit corresponds to the execute permission.
Default behavior is 755.
Below are some examples of permissions and their associated values:
read, write, and execute: 7
read and execute: 5
read and write: 6
read only: 4
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Cloud OS Config V1 API - Class Google::Cloud::OsConfig::V1::OSPolicy::Resource::FileResource (v1.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.0 (latest)](/ruby/docs/reference/google-cloud-os_config-v1/latest/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [1.3.0](/ruby/docs/reference/google-cloud-os_config-v1/1.3.0/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [1.2.1](/ruby/docs/reference/google-cloud-os_config-v1/1.2.1/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [1.1.0](/ruby/docs/reference/google-cloud-os_config-v1/1.1.0/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [1.0.1](/ruby/docs/reference/google-cloud-os_config-v1/1.0.1/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [0.16.0](/ruby/docs/reference/google-cloud-os_config-v1/0.16.0/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [0.15.2](/ruby/docs/reference/google-cloud-os_config-v1/0.15.2/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [0.14.0](/ruby/docs/reference/google-cloud-os_config-v1/0.14.0/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [0.13.0](/ruby/docs/reference/google-cloud-os_config-v1/0.13.0/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [0.12.0](/ruby/docs/reference/google-cloud-os_config-v1/0.12.0/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [0.11.0](/ruby/docs/reference/google-cloud-os_config-v1/0.11.0/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [0.10.0](/ruby/docs/reference/google-cloud-os_config-v1/0.10.0/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource)\n- [0.9.1](/ruby/docs/reference/google-cloud-os_config-v1/0.9.1/Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource) \nReference documentation and code samples for the Cloud OS Config V1 API class Google::Cloud::OsConfig::V1::OSPolicy::Resource::FileResource.\n\nA resource that manages the state of a file. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #content\n\n def content() -\u003e ::String\n\n**Returns**\n\n- (::String) --- A a file with this content. The size of the content is limited to 1024 characters.\n\n Note: The following fields are mutually exclusive: `content`, `file`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #content=\n\n def content=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- A a file with this content. The size of the content is limited to 1024 characters.\n\n\nNote: The following fields are mutually exclusive: `content`, `file`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- (::String) --- A a file with this content. The size of the content is limited to 1024 characters.\n\n Note: The following fields are mutually exclusive: `content`, `file`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #file\n\n def file() -\u003e ::Google::Cloud::OsConfig::V1::OSPolicy::Resource::File\n\n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1::OSPolicy::Resource::File](./Google-Cloud-OsConfig-V1-OSPolicy-Resource-File)) --- A remote or local source.\n\n\n Note: The following fields are mutually exclusive: `file`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #file=\n\n def file=(value) -\u003e ::Google::Cloud::OsConfig::V1::OSPolicy::Resource::File\n\n**Parameter**\n\n- **value** ([::Google::Cloud::OsConfig::V1::OSPolicy::Resource::File](./Google-Cloud-OsConfig-V1-OSPolicy-Resource-File)) --- A remote or local source.\n\n\nNote: The following fields are mutually exclusive: `file`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1::OSPolicy::Resource::File](./Google-Cloud-OsConfig-V1-OSPolicy-Resource-File)) --- A remote or local source.\n\n\n Note: The following fields are mutually exclusive: `file`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #path\n\n def path() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. The absolute path of the file within the VM.\n\n### #path=\n\n def path=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. The absolute path of the file within the VM. \n**Returns**\n\n- (::String) --- Required. The absolute path of the file within the VM.\n\n### #permissions\n\n def permissions() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755.\n\n Below are some examples of permissions and their associated values:\n read, write, and execute: 7\n read and execute: 5\n read and write: 6\n read only: 4\n\n### #permissions=\n\n def permissions=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755.\n\n\n Below are some examples of permissions and their associated values:\n read, write, and execute: 7\n read and execute: 5\n read and write: 6\nread only: 4 \n**Returns**\n\n- (::String) --- Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755.\n\n Below are some examples of permissions and their associated values:\n read, write, and execute: 7\n read and execute: 5\n read and write: 6\n read only: 4\n\n### #state\n\n def state() -\u003e ::Google::Cloud::OsConfig::V1::OSPolicy::Resource::FileResource::DesiredState\n\n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1::OSPolicy::Resource::FileResource::DesiredState](./Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource-DesiredState)) --- Required. Desired state of the file.\n\n### #state=\n\n def state=(value) -\u003e ::Google::Cloud::OsConfig::V1::OSPolicy::Resource::FileResource::DesiredState\n\n**Parameter**\n\n- **value** ([::Google::Cloud::OsConfig::V1::OSPolicy::Resource::FileResource::DesiredState](./Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource-DesiredState)) --- Required. Desired state of the file. \n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1::OSPolicy::Resource::FileResource::DesiredState](./Google-Cloud-OsConfig-V1-OSPolicy-Resource-FileResource-DesiredState)) --- Required. Desired state of the file."]]