Skip to content

Commit 0489a1a

Browse files
Update quickstart.py comments
1 parent 9a0e403 commit 0489a1a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

iam/cloud-client/snippets/quickstart.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@
1919

2020

2121
def quickstart(project_id: str, member: str) -> None:
22-
"""Gets a policy, adds a member, prints their permissions, and removes the member.
22+
"""Gets a policy, adds a principal, prints their permissions, and removes the principal.
2323
2424
project_id: ID or number of the Google Cloud project you want to use.
25-
member: The principals requesting the access.
25+
member: The principal requesting the access.
2626
"""
2727

2828
# Role to be granted.
2929
role = "roles/logging.logWriter"
3030
crm_service = resourcemanager_v3.ProjectsClient()
3131

32-
# Grants your member the 'Log Writer' role for the project.
32+
# Grants your principal the 'Log Writer' role for the project.
3333
modify_policy_add_role(crm_service, project_id, role, member)
3434

35-
# Gets the project's policy and prints all members with the 'Log Writer' role.
35+
# Gets the project's policy and prints all principals with the 'Log Writer' role.
3636
policy = get_policy(crm_service, project_id)
3737
binding = next(b for b in policy.bindings if b.role == role)
3838
print(f"Role: {(binding.role)}")
3939
print("Members: ")
4040
for m in binding.members:
4141
print(f"[{m}]")
4242

43-
# Removes the member from the 'Log Writer' role.
43+
# Removes the principal from the 'Log Writer' role.
4444
modify_policy_remove_member(crm_service, project_id, role, member)
4545

4646

@@ -115,7 +115,8 @@ def modify_policy_remove_member(
115115
if __name__ == "__main__":
116116
# TODO: replace with your project ID
117117
project_id = "your-project-id"
118-
# TODO: Replace with the ID of your member in the form 'user:member@example.com'.
119-
member = "your-member"
118+
# TODO: Replace with the ID of your principal.
119+
# For examples, see https://cloud.google.com/iam/docs/principal-identifiers
120+
member = "your-principal"
120121
quickstart(project_id, member)
121122
# [END iam_quickstart]

0 commit comments

Comments
 (0)