Reference documentation and code samples for the Cloud OS Config V1alpha API class Google::Cloud::OsConfig::V1alpha::OSPolicy::Resource::ExecResource::Exec.
A file or script to execute.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#args
defargs()->::Array<::String>
Returns
(::Array<::String>) — Optional arguments to pass to the source during execution.
#args=
defargs=(value)->::Array<::String>
Parameter
value (::Array<::String>) — Optional arguments to pass to the source during execution.
Returns
(::Array<::String>) — Optional arguments to pass to the source during execution.
Note: The following fields are mutually exclusive: file, script. 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, script. 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, script. If a field in that set is populated, all other fields in the set will automatically be cleared.
(::String) — Only recorded for enforce Exec.
Path to an output file (that is created by this Exec) whose
content will be recorded in OSPolicyResourceCompliance after a
successful run. Absence or failure to read this file will result in
this ExecResource being non-compliant. Output file size is limited to
100K bytes.
#output_file_path=
defoutput_file_path=(value)->::String
Parameter
value (::String) — Only recorded for enforce Exec.
Path to an output file (that is created by this Exec) whose
content will be recorded in OSPolicyResourceCompliance after a
successful run. Absence or failure to read this file will result in
this ExecResource being non-compliant. Output file size is limited to
100K bytes.
Returns
(::String) — Only recorded for enforce Exec.
Path to an output file (that is created by this Exec) whose
content will be recorded in OSPolicyResourceCompliance after a
successful run. Absence or failure to read this file will result in
this ExecResource being non-compliant. Output file size is limited to
100K bytes.
#script
defscript()->::String
Returns
(::String) — An inline script.
The size of the script is limited to 1024 characters.
Note: The following fields are mutually exclusive: script, file. If a field in that set is populated, all other fields in the set will automatically be cleared.
#script=
defscript=(value)->::String
Parameter
value (::String) — An inline script.
The size of the script is limited to 1024 characters.
Note: The following fields are mutually exclusive: script, file. If a field in that set is populated, all other fields in the set will automatically be cleared.
Returns
(::String) — An inline script.
The size of the script is limited to 1024 characters.
Note: The following fields are mutually exclusive: script, file. If a field in that set is populated, all other fields in the set will automatically be cleared.
[[["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-08-28 UTC."],[],[],null,["# Cloud OS Config V1alpha API - Class Google::Cloud::OsConfig::V1alpha::OSPolicy::Resource::ExecResource::Exec (v0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/ruby/docs/reference/google-cloud-os_config-v1alpha/latest/Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec)\n- [0.11.1](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.11.1/Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec)\n- [0.10.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.10.0/Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec)\n- [0.9.1](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.9.1/Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec)\n- [0.8.2](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.8.2/Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec)\n- [0.7.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.7.0/Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec)\n- [0.6.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.6.0/Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec)\n- [0.5.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.5.0/Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec)\n- [0.4.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.4.0/Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec)\n- [0.3.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.3.0/Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec)\n- [0.2.2](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.2.2/Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec) \nReference documentation and code samples for the Cloud OS Config V1alpha API class Google::Cloud::OsConfig::V1alpha::OSPolicy::Resource::ExecResource::Exec.\n\nA file or script to execute. \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### #args\n\n def args() -\u003e ::Array\u003c::String\u003e\n\n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- Optional arguments to pass to the source during execution.\n\n### #args=\n\n def args=(value) -\u003e ::Array\u003c::String\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c::String\\\u003e) --- Optional arguments to pass to the source during execution. \n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- Optional arguments to pass to the source during execution.\n\n### #file\n\n def file() -\u003e ::Google::Cloud::OsConfig::V1alpha::OSPolicy::Resource::File\n\n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1alpha::OSPolicy::Resource::File](./Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-File)) --- A remote or local file.\n\n\n Note: The following fields are mutually exclusive: `file`, `script`. 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::V1alpha::OSPolicy::Resource::File\n\n**Parameter**\n\n- **value** ([::Google::Cloud::OsConfig::V1alpha::OSPolicy::Resource::File](./Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-File)) --- A remote or local file.\n\n\nNote: The following fields are mutually exclusive: `file`, `script`. 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::V1alpha::OSPolicy::Resource::File](./Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-File)) --- A remote or local file.\n\n\n Note: The following fields are mutually exclusive: `file`, `script`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #interpreter\n\n def interpreter() -\u003e ::Google::Cloud::OsConfig::V1alpha::OSPolicy::Resource::ExecResource::Exec::Interpreter\n\n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1alpha::OSPolicy::Resource::ExecResource::Exec::Interpreter](./Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec-Interpreter)) --- Required. The script interpreter to use.\n\n### #interpreter=\n\n def interpreter=(value) -\u003e ::Google::Cloud::OsConfig::V1alpha::OSPolicy::Resource::ExecResource::Exec::Interpreter\n\n**Parameter**\n\n- **value** ([::Google::Cloud::OsConfig::V1alpha::OSPolicy::Resource::ExecResource::Exec::Interpreter](./Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec-Interpreter)) --- Required. The script interpreter to use. \n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1alpha::OSPolicy::Resource::ExecResource::Exec::Interpreter](./Google-Cloud-OsConfig-V1alpha-OSPolicy-Resource-ExecResource-Exec-Interpreter)) --- Required. The script interpreter to use.\n\n### #output_file_path\n\n def output_file_path() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Only recorded for enforce Exec. Path to an output file (that is created by this Exec) whose content will be recorded in OSPolicyResourceCompliance after a successful run. Absence or failure to read this file will result in this ExecResource being non-compliant. Output file size is limited to 100K bytes.\n\n### #output_file_path=\n\n def output_file_path=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Only recorded for enforce Exec. Path to an output file (that is created by this Exec) whose content will be recorded in OSPolicyResourceCompliance after a successful run. Absence or failure to read this file will result in this ExecResource being non-compliant. Output file size is limited to 100K bytes. \n**Returns**\n\n- (::String) --- Only recorded for enforce Exec. Path to an output file (that is created by this Exec) whose content will be recorded in OSPolicyResourceCompliance after a successful run. Absence or failure to read this file will result in this ExecResource being non-compliant. Output file size is limited to 100K bytes.\n\n### #script\n\n def script() -\u003e ::String\n\n**Returns**\n\n- (::String) --- An inline script. The size of the script is limited to 1024 characters.\n\n Note: The following fields are mutually exclusive: `script`, `file`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #script=\n\n def script=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- An inline script. The size of the script is limited to 1024 characters.\n\n\nNote: The following fields are mutually exclusive: `script`, `file`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- (::String) --- An inline script. The size of the script is limited to 1024 characters.\n\n Note: The following fields are mutually exclusive: `script`, `file`. If a field in that set is populated, all other fields in the set will automatically be cleared."]]