Class: Google::Apis::IamV2::IamService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::IamV2::IamService
- Defined in:
- lib/google/apis/iam_v2/service.rb
Overview
Identity and Access Management (IAM) API
Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://iam.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#create_policy_policy(parent, google_iam_v2_policy_object = nil, policy_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleLongrunningOperation
Creates a policy.
-
#delete_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleLongrunningOperation
Deletes a policy.
-
#get_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleIamV2Policy
Gets a policy.
-
#get_policy_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleLongrunningOperation
Gets the latest state of a long-running operation.
-
#initialize ⇒ IamService
constructor
A new instance of IamService.
-
#list_policy_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleIamV2ListPoliciesResponse
Retrieves the policies of the specified kind that are attached to a resource.
-
#update_policy(name, google_iam_v2_policy_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleLongrunningOperation
Updates the specified policy.
Constructor Details
#initialize ⇒ IamService
Returns a new instance of IamService.
51 52 53 54 55 56 |
# File 'lib/google/apis/iam_v2/service.rb', line 51 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-iam_v2', client_version: Google::Apis::IamV2::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
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.
44 45 46 |
# File 'lib/google/apis/iam_v2/service.rb', line 44 def key @key end |
#quota_user ⇒ String
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.
49 50 51 |
# File 'lib/google/apis/iam_v2/service.rb', line 49 def quota_user @quota_user end |
Instance Method Details
#create_policy_policy(parent, google_iam_v2_policy_object = nil, policy_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleLongrunningOperation
Creates a policy.
90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/google/apis/iam_v2/service.rb', line 90 def create_policy_policy(parent, google_iam_v2_policy_object = nil, policy_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2/{+parent}', ) command.request_representation = Google::Apis::IamV2::GoogleIamV2Policy::Representation command.request_object = google_iam_v2_policy_object command.response_representation = Google::Apis::IamV2::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::IamV2::GoogleLongrunningOperation command.params['parent'] = parent unless parent.nil? command.query['policyId'] = policy_id unless policy_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleLongrunningOperation
Deletes a policy. This action is permanent.
134 135 136 137 138 139 140 141 142 143 |
# File 'lib/google/apis/iam_v2/service.rb', line 134 def delete_policy(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v2/{+name}', ) command.response_representation = Google::Apis::IamV2::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::IamV2::GoogleLongrunningOperation command.params['name'] = name unless name.nil? command.query['etag'] = etag unless etag.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_policy(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleIamV2Policy
Gets a policy.
171 172 173 174 175 176 177 178 179 |
# File 'lib/google/apis/iam_v2/service.rb', line 171 def get_policy(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/{+name}', ) command.response_representation = Google::Apis::IamV2::GoogleIamV2Policy::Representation command.response_class = Google::Apis::IamV2::GoogleIamV2Policy 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 |
#get_policy_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleLongrunningOperation
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
292 293 294 295 296 297 298 299 300 |
# File 'lib/google/apis/iam_v2/service.rb', line 292 def get_policy_operation(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/{+name}', ) command.response_representation = Google::Apis::IamV2::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::IamV2::GoogleLongrunningOperation 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 |
#list_policy_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleIamV2ListPoliciesResponse
Retrieves the policies of the specified kind that are attached to a resource. The response lists only policy metadata. In particular, policy rules are omitted.
215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/google/apis/iam_v2/service.rb', line 215 def list_policy_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/{+parent}', ) command.response_representation = Google::Apis::IamV2::GoogleIamV2ListPoliciesResponse::Representation command.response_class = Google::Apis::IamV2::GoogleIamV2ListPoliciesResponse 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['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_policy(name, google_iam_v2_policy_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::IamV2::GoogleLongrunningOperation
Updates the specified policy. You can update only the rules and the display
name for the policy. To update a policy, you should use a read-modify-write
loop: 1. Use GetPolicy to read the current version of the policy. 2. Modify
the policy as needed. 3. Use UpdatePolicy
to write the updated policy. This
pattern helps prevent conflicts between concurrent updates.
259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/google/apis/iam_v2/service.rb', line 259 def update_policy(name, google_iam_v2_policy_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'v2/{+name}', ) command.request_representation = Google::Apis::IamV2::GoogleIamV2Policy::Representation command.request_object = google_iam_v2_policy_object command.response_representation = Google::Apis::IamV2::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::IamV2::GoogleLongrunningOperation 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 |