Beispiel #1
0
  def Run(self, args):
    """Lists Cloud SQL instances in a given project.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
          with.

    Returns:
      SQL instance resource iterator.
    Raises:
      HttpException: An http error response was received while executing api
          request.
      ToolException: An error other than an http error occured while executing
          the command.
    """
    sql_client = self.context['sql_client']
    sql_messages = self.context['sql_messages']

    project_id = properties.VALUES.core.project.Get(required=True)

    remote_completion.SetGetInstanceFun(self.GetRef)
    return apitools_base.YieldFromList(
        sql_client.instances,
        sql_messages.SqlInstancesListRequest(project=project_id),
        args.limit)
    def Run(self, args):
        """Run the list command."""

        projects_client = self.context['projects_client']
        messages = self.context['projects_messages']
        remote_completion.SetGetInstanceFun(self.ProjectIdToLink)
        return projects_api.List(client=projects_client,
                                 messages=messages,
                                 limit=args.limit)
  def Run(self, args):
    dns_client = self.context['dns_client']
    dns_messages = self.context['dns_messages']

    project_id = properties.VALUES.core.project.Get(required=True)
    remote_completion.SetGetInstanceFun(self.GetRef)

    return list_pager.YieldFromList(
        dns_client.managedZones,
        dns_messages.DnsManagedZonesListRequest(project=project_id),
        limit=args.limit, field='managedZones')
Beispiel #4
0
  def Run(self, args):
    """Run the list command."""

    projects = self.context['projects_client']
    messages = self.context['projects_messages']
    remote_completion.SetGetInstanceFun(self.ProjectIdToLink)
    for project in apitools_base.YieldFromList(
        projects.projects,
        messages.CloudresourcemanagerProjectsListRequest(),
        limit=args.limit,
        field='projects',
        predicate=util.IsActive,
        batch_size_attribute='pageSize'):
      yield project