Ejemplo 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.
    """
        instance_ref = resources.REGISTRY.Parse(
            args.instance, collection='spanner.projects.instances')
        return iam.SetInstanceIamPolicy(instance_ref, args.policy_file)
Ejemplo 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.
    """
        instance_ref = resources.REGISTRY.Parse(
            args.instance,
            params={'projectsId': properties.VALUES.core.project.GetOrFail},
            collection='spanner.projects.instances')
        result = iam.SetInstanceIamPolicy(instance_ref, args.policy_file)
        iam_util.LogSetIamPolicy(instance_ref.Name(), 'instance')
        return result