コード例 #1
0
    def Run(self, args):
        """This is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      Some value that we want to have printed later.
    """
        return databases.GetIamPolicy(args.CONCEPTS.database.Parse())
コード例 #2
0
    def Run(self, args):
        """This is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      Some value that we want to have printed later.
    """
        database_ref = resources.REGISTRY.Parse(
            args.database,
            params={'instancesId': args.instance},
            collection='spanner.projects.instances.databases')
        return databases.GetIamPolicy(database_ref)
コード例 #3
0
ファイル: iam.py プロジェクト: eduardofacanha/Robin
def RemoveDatabaseIamPolicyBinding(database_ref, member, role):
    """Removes a policy binding from a database IAM policy."""
    policy = databases.GetIamPolicy(database_ref)
    iam_util.RemoveBindingFromIamPolicy(policy, member, role)
    return databases.SetPolicy(database_ref, policy)
コード例 #4
0
ファイル: iam.py プロジェクト: eduardofacanha/Robin
def AddDatabaseIamPolicyBinding(database_ref, member, role):
    """Adds a policy binding to a database IAM policy."""
    msgs = apis.GetMessagesModule('spanner', 'v1')
    policy = databases.GetIamPolicy(database_ref)
    iam_util.AddBindingToIamPolicy(msgs, policy, member, role)
    return databases.SetPolicy(database_ref, policy)