Exemplo n.º 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.
    """
        database_ref = args.CONCEPTS.database.Parse()
        result = iam.SetDatabaseIamPolicy(database_ref, args.policy_file)
        iam_util.LogSetIamPolicy(database_ref.Name(), 'database')
        return result
Exemplo n.º 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 iam.SetDatabaseIamPolicy(database_ref, args.policy_file)
Exemplo n.º 3
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={
                'projectsId': properties.VALUES.core.project.GetOrFail,
                'instancesId': args.instance
            },
            collection='spanner.projects.instances.databases')
        result = iam.SetDatabaseIamPolicy(database_ref, args.policy_file)
        iam_util.LogSetIamPolicy(database_ref.Name(), 'database')
        return result