Class: Google::Apis::ResourcesettingsV1::ResourceSettingsService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/resourcesettings_v1/service.rb

Overview

Resource Settings API

The Resource Settings API allows users to control and modify the behavior of their GCP resources (e.g., VM, firewall, Project, etc.) across the Cloud Resource Hierarchy.

Examples:

require 'google/apis/resourcesettings_v1'

Resourcesettings = Google::Apis::ResourcesettingsV1 # Alias the module
service = Resourcesettings::ResourceSettingsService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://resourcesettings.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResourceSettingsService

Returns a new instance of ResourceSettingsService.



49
50
51
52
53
54
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 49

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-resourcesettings_v1',
        client_version: Google::Apis::ResourcesettingsV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



42
43
44
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 42

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



47
48
49
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 47

def quota_user
  @quota_user
end

Instance Method Details

#get_folder_setting(name, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting

Returns a specified setting. Returns a google.rpc.Status with google.rpc. Code.NOT_FOUND if the setting does not exist.

Parameters:

  • name (String)

    Required. The name of the setting to get. See Setting for naming requirements.

  • view (String) (defaults to: nil)

    The SettingView for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



79
80
81
82
83
84
85
86
87
88
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 79

def get_folder_setting(name, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting::Representation
  command.response_class = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting
  command.params['name'] = name unless name.nil?
  command.query['view'] = view unless view.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_organization_setting(name, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting

Returns a specified setting. Returns a google.rpc.Status with google.rpc. Code.NOT_FOUND if the setting does not exist.

Parameters:

  • name (String)

    Required. The name of the setting to get. See Setting for naming requirements.

  • view (String) (defaults to: nil)

    The SettingView for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



198
199
200
201
202
203
204
205
206
207
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 198

def get_organization_setting(name, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting::Representation
  command.response_class = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting
  command.params['name'] = name unless name.nil?
  command.query['view'] = view unless view.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_setting(name, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting

Returns a specified setting. Returns a google.rpc.Status with google.rpc. Code.NOT_FOUND if the setting does not exist.

Parameters:

  • name (String)

    Required. The name of the setting to get. See Setting for naming requirements.

  • view (String) (defaults to: nil)

    The SettingView for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



317
318
319
320
321
322
323
324
325
326
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 317

def get_project_setting(name, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting::Representation
  command.response_class = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting
  command.params['name'] = name unless name.nil?
  command.query['view'] = view unless view.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_folder_settings(parent, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1ListSettingsResponse

Lists all the settings that are available on the Cloud resource parent.

Parameters:

  • parent (String)

    Required. The project, folder, or organization that is the parent resource for this setting. Must be in one of the following forms: * projects/ project_number* `projects/`project_id * folders/folder_id* ` organizations/`organization_id

  • page_size (Fixnum) (defaults to: nil)

    Unused. The size of the page to be returned.

  • page_token (String) (defaults to: nil)

    Unused. A page token used to retrieve the next page.

  • view (String) (defaults to: nil)

    The SettingView for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 119

def list_folder_settings(parent, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/settings', options)
  command.response_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1ListSettingsResponse::Representation
  command.response_class = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1ListSettingsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['view'] = view unless view.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_organization_settings(parent, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1ListSettingsResponse

Lists all the settings that are available on the Cloud resource parent.

Parameters:

  • parent (String)

    Required. The project, folder, or organization that is the parent resource for this setting. Must be in one of the following forms: * projects/ project_number* `projects/`project_id * folders/folder_id* ` organizations/`organization_id

  • page_size (Fixnum) (defaults to: nil)

    Unused. The size of the page to be returned.

  • page_token (String) (defaults to: nil)

    Unused. A page token used to retrieve the next page.

  • view (String) (defaults to: nil)

    The SettingView for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 238

def list_organization_settings(parent, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/settings', options)
  command.response_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1ListSettingsResponse::Representation
  command.response_class = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1ListSettingsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['view'] = view unless view.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_settings(parent, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1ListSettingsResponse

Lists all the settings that are available on the Cloud resource parent.

Parameters:

  • parent (String)

    Required. The project, folder, or organization that is the parent resource for this setting. Must be in one of the following forms: * projects/ project_number* `projects/`project_id * folders/folder_id* ` organizations/`organization_id

  • page_size (Fixnum) (defaults to: nil)

    Unused. The size of the page to be returned.

  • page_token (String) (defaults to: nil)

    Unused. A page token used to retrieve the next page.

  • view (String) (defaults to: nil)

    The SettingView for this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 357

def list_project_settings(parent, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/settings', options)
  command.response_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1ListSettingsResponse::Representation
  command.response_class = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1ListSettingsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['view'] = view unless view.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_folder_setting(name, google_cloud_resourcesettings_v1_setting_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting

Updates a specified setting. Returns a google.rpc.Status with google.rpc. Code.NOT_FOUND if the setting does not exist. Returns a google.rpc.Status with google.rpc.Code.FAILED_PRECONDITION if the setting is flagged as read only. Returns a google.rpc.Status with google.rpc.Code.ABORTED if the etag supplied in the request does not match the persisted etag of the setting value. On success, the response will contain only name, local_value and etag. The metadata and effective_value cannot be updated through this API. Note: the supplied setting will perform a full overwrite of the local_value field.

Parameters:

  • name (String)

    The resource name of the setting. Must be in one of the following forms: * projects/project_number/settings/setting_name* `folders/`folder_id`/ settings/`setting_name * organizations/organization_id/settings/ setting_name`` For example, "/projects/123/settings/gcp-enableMyFeature"

  • google_cloud_resourcesettings_v1_setting_object (Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



163
164
165
166
167
168
169
170
171
172
173
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 163

def patch_folder_setting(name, google_cloud_resourcesettings_v1_setting_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting::Representation
  command.request_object = google_cloud_resourcesettings_v1_setting_object
  command.response_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting::Representation
  command.response_class = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_organization_setting(name, google_cloud_resourcesettings_v1_setting_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting

Updates a specified setting. Returns a google.rpc.Status with google.rpc. Code.NOT_FOUND if the setting does not exist. Returns a google.rpc.Status with google.rpc.Code.FAILED_PRECONDITION if the setting is flagged as read only. Returns a google.rpc.Status with google.rpc.Code.ABORTED if the etag supplied in the request does not match the persisted etag of the setting value. On success, the response will contain only name, local_value and etag. The metadata and effective_value cannot be updated through this API. Note: the supplied setting will perform a full overwrite of the local_value field.

Parameters:

  • name (String)

    The resource name of the setting. Must be in one of the following forms: * projects/project_number/settings/setting_name* `folders/`folder_id`/ settings/`setting_name * organizations/organization_id/settings/ setting_name`` For example, "/projects/123/settings/gcp-enableMyFeature"

  • google_cloud_resourcesettings_v1_setting_object (Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



282
283
284
285
286
287
288
289
290
291
292
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 282

def patch_organization_setting(name, google_cloud_resourcesettings_v1_setting_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting::Representation
  command.request_object = google_cloud_resourcesettings_v1_setting_object
  command.response_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting::Representation
  command.response_class = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_setting(name, google_cloud_resourcesettings_v1_setting_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting

Updates a specified setting. Returns a google.rpc.Status with google.rpc. Code.NOT_FOUND if the setting does not exist. Returns a google.rpc.Status with google.rpc.Code.FAILED_PRECONDITION if the setting is flagged as read only. Returns a google.rpc.Status with google.rpc.Code.ABORTED if the etag supplied in the request does not match the persisted etag of the setting value. On success, the response will contain only name, local_value and etag. The metadata and effective_value cannot be updated through this API. Note: the supplied setting will perform a full overwrite of the local_value field.

Parameters:

  • name (String)

    The resource name of the setting. Must be in one of the following forms: * projects/project_number/settings/setting_name* `folders/`folder_id`/ settings/`setting_name * organizations/organization_id/settings/ setting_name`` For example, "/projects/123/settings/gcp-enableMyFeature"

  • google_cloud_resourcesettings_v1_setting_object (Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



401
402
403
404
405
406
407
408
409
410
411
# File 'lib/google/apis/resourcesettings_v1/service.rb', line 401

def patch_project_setting(name, google_cloud_resourcesettings_v1_setting_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting::Representation
  command.request_object = google_cloud_resourcesettings_v1_setting_object
  command.response_representation = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting::Representation
  command.response_class = Google::Apis::ResourcesettingsV1::GoogleCloudResourcesettingsV1Setting
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end