34577913e8d62f0db23231f4882263b6825fa271,pubsub/cloud-client/iam.py,,get_subscription_policy,#Any#Any#,45
Before Change
def get_subscription_policy(topic_name, subscription_name):
Prints the IAM policy for the given subscription.
pubsub_client = pubsub.Client()
topic = pubsub_client.topic(topic_name)
subscription = topic.subscription(subscription_name)
policy = subscription.get_iam_policy()
print("Policy for subscription {} on topic {}:".format(
subscription.name, topic.name))
print("Version: {}".format(policy.version))
print("Owners: {}".format(policy.owners))
print("Editors: {}".format(policy.editors))
After Change
def get_subscription_policy(project, subscription_name):
Prints the IAM policy for the given subscription.
client = pubsub_v1.SubscriberClient()
subscription_path = client.subscription_path(project, subscription_name)
policy = client.get_iam_policy(subscription_path)
print("Policy for subscription {}:".format(subscription_path))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 13
Instances
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 34577913e8d62f0db23231f4882263b6825fa271
Time: 2017-08-28
Author: jonwayne@google.com
File Name: pubsub/cloud-client/iam.py
Class Name:
Method Name: get_subscription_policy
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 34577913e8d62f0db23231f4882263b6825fa271
Time: 2017-08-28
Author: jonwayne@google.com
File Name: pubsub/cloud-client/iam.py
Class Name:
Method Name: get_subscription_policy
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 34577913e8d62f0db23231f4882263b6825fa271
Time: 2017-08-28
Author: jonwayne@google.com
File Name: pubsub/cloud-client/iam.py
Class Name:
Method Name: set_subscription_policy
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 34577913e8d62f0db23231f4882263b6825fa271
Time: 2017-08-28
Author: jonwayne@google.com
File Name: pubsub/cloud-client/subscriber.py
Class Name:
Method Name: delete_subscription