def Display(self, args, result): """This method is called to print the result of the Run() method. Args: args: The arguments that command was run with. result: The value returned from the Run() method. """ if not (args.log or args.service or args.only_project_sinks): list_printer.PrintResourceList('logging.typedSinks', result) if self._truncated: sdk_log.Print( ('Some entries were truncated. ' 'Use "logging sinks describe" for full details.')) else: list_printer.PrintResourceList('logging.sinks', result)
def Display(self, unused_args, result): """Display prints information about what just happened to stdout. Args: unused_args: The same as the args in Run. result: an Operation (may be in progress or completed) to display or a list of Resources, if a synchronous preview or create completed. Raises: ValueError: if result is not a list of Resources or an Operation """ messages = self.context['deploymentmanager-messages'] if isinstance(result, messages.Operation): resource_printer.Print(resources=result, print_format=unused_args.format or 'yaml', out=log.out) elif isinstance(result, list) and not result: log.Print('No Deployments were found in your project!') elif isinstance(result, list) and isinstance(result[0], messages.Resource): list_printer.PrintResourceList('deploymentmanagerv2.resources', result) else: raise ValueError( 'result must be an Operation or list of Resources')
def Display(self, args, result): instance_refs = [] items = remote_completion.Iterate(result, instance_refs, self.ProjectIdToLink) list_printer.PrintResourceList('cloudresourcemanager.projects', items) cache = remote_completion.RemoteCompletion() cache.StoreInCache(instance_refs)
def Display(self, unused_args, result): """Display prints information about what just happened to stdout. Args: unused_args: The same as the args in Run. result: an Operation (may be in progress or completed) to display or a list of Resources, if a synchronous cancel completed successfully. Raises: ValueError: if result is None or not a dict """ messages = self.context['deploymentmanager-v2beta2-messages'] if isinstance(result, messages.Operation): resource_printer.Print(resources=result, print_format=unused_args.format or 'yaml', out=log.out) elif isinstance(result, list) and (not result or isinstance( result[0], messages.Resource)): list_printer.PrintResourceList( 'deploymentmanagerv2beta2.resources', result) else: raise ValueError( 'result must be an Operation or list of Resources')
def Display(self, unused_args, deployment): """Display prints information about what just happened to stdout. Args: unused_args: The same as the args in Run. deployment: a Deployment to print Raises: ValueError: if result is None or not a deployment """ client = self.context['deploymentmanager-client'] messages = self.context['deploymentmanager-messages'] if not isinstance(deployment, messages.Deployment): raise ValueError('result must be a Deployment') # Get resources belonging to the deployment to display project = properties.VALUES.core.project.Get(required=True) resources = None try: response = client.resources.List( messages.DeploymentmanagerResourcesListRequest( project=project, deployment=deployment.name)) resources = response.resources except apitools_base.HttpError: pass # Couldn't get resources, skip adding them to the table. resource_printer.Print(resources=deployment, print_format=unused_args.format or 'yaml', out=log.out) if resources: log.Print('resources:') list_printer.PrintResourceList('deploymentmanagerv2.resources', resources)
def Display(self, unused_args, result): """Display prints information about what just happened to stdout. Args: unused_args: The same as the args in Run. result: The database created, or the operation if async. """ list_printer.PrintResourceList('sql.instances', [result])
def Display(self, args, result): """This method is called to print the result of the Run() method. Args: args: The arguments that command was run with. result: The value returned from the Run() method. """ list_printer.PrintResourceList('bigquery.datasets', result)
def Display(self, args, jobs): """This method is called to print the result of the Run() method. Args: args: all the arguments that were provided to this command invocation. jobs: The iterator over Job messages returned from the Run() method. """ list_printer.PrintResourceList('dataflow.jobs', jobs)
def Display(self, args, repos): """This method is called to print the result of the Run() method. Args: args: The arguments that command was run with. repos: The iterator over Repo messages returned from the Run() method. """ list_printer.PrintResourceList('source.jobs.list', repos)
def Display(self, args, result): """Method called by Calliope to print the result of the Run() method. Args: args: The arguments that the command was run with. result: The Run() method's result, which is a list of AndroidModels. """ list_printer.PrintResourceList('test.android.devices', result)
def Display(self, unused_args, result): """This method is called to print the result of the Run() method. Args: unused_args: The arguments that command was run with. result: The value returned from the Run() method. """ list_printer.PrintResourceList('functions.projects.regions.functions', result)
def Display(self, args, result): """This method is called to print the result of the Run() method. Args: args: The arguments that command was run with. result: The value returned from the Run() method. """ list_printer.PrintResourceList('container.projects.zones.clusters', result.clusters)
def Display(self, unused_args, result): """This method is called to print the result of the Run() method. Args: unused_args: The arguments that command was run with. result: The value returned from the Run() method. """ list_printer.PrintResourceList('logging.sinks', [result]) util.PrintPermissionInstructions(result.destination)
def Display(self, unused_args, result): """Display prints information about what just happened to stdout. Args: unused_args: The same as the args in Run. result: A dict object representing the operations resource describing the clone operation if the clone was successful. """ list_printer.PrintResourceList('sql.instances', [result])
def Display(self, args, result): """This method is called to print the result of the Run() method. Args: args: The arguments that command was run with. result: The value returned from the Run() method. """ list_printer.PrintResourceList('cloudresourcemanager.projects', [result])
def Display(self, unused_args, result): # TODO(user): Consider getting rid of instance group manager in api. def CoalescedInstanceGroupGenerator(): for item in result: if item.instanceGroup: item.instanceGroupManager = item.instanceGroup yield item list_printer.PrintResourceList('replicapoolupdater.rollingUpdates', CoalescedInstanceGroupGenerator())
def Display(self, args, job): """This method is called to print the result of the Run() method. Args: args: The arguments that command was run with. job: A Job message. """ info = job_display.DisplayInfo(job) # Print information in the form of a one-row table: list_printer.PrintResourceList('bigquery.jobs.describe', [info])
def Display(self, args, result): """Display prints information about what just happened to stdout. Args: args: The same as the args in Run. result: A dict object representing the response if the api request was successful. """ list_printer.PrintResourceList('sql.sslCerts', [result.clientCert.certInfo])
def Display(self, args, tables): """This method is called to print the result of the Run() method. Args: args: The arguments that command was run with. tables: An iterator over TableList.TablesValueListEntry messages. """ try: list_printer.PrintResourceList('bigquery.tables.list', tables) except apitools_base.HttpError as server_error: raise bigquery.Error.ForHttpError(server_error)
def Display(self, args, jobs): """This method is called to print the result of the Run() method. Args: args: The arguments that command was run with. jobs: The iterator over JobsValueListEntry messages returned from the Run() method. """ list_printer.PrintResourceList( 'bigquery.jobs.list', [job_display.DisplayInfo(entry) for entry in jobs])
def Display(self, args, result): """Display prints information about what just happened to stdout. Args: args: The same as the args in Run. result: a list of Variant objects. Raises: ValueError: if result is None or not a list """ list_printer.PrintResourceList('genomics.variants', result)
def Display(self, args, result): """Method called by Calliope to print the result of the Run() method. Args: args: The arguments that command was run with. result: one of: - a list of TestOutcome tuples (if ToolResults are available). - a URL string pointing to the user's raw results in GCS. """ log.debug('gcloud test exit_code is: {0}'.format(self.exit_code)) if type(result) == types.ListType: list_printer.PrintResourceList('test.run.outcomes', result) elif type(result) == types.StringType: log.out.Print( '\nMore details are available at [{0}].'.format(result)) elif result is not None: log.out.Print(result)
def Display(self, args, job): """This method is called to print the result of the Run() method. Args: args: The arguments that command was run with. job: A Job message. Raises: bigquery.BackendError: if job has failed. """ info = job_display.DisplayInfo(job) # Print information in the form of a one-row table: list_printer.PrintResourceList('bigquery.jobs.wait', [info]) if job_control.IsFailedJob(job): if args.ignore_error: log.err.Print('\nFAILURE (ignored): {0}'.format( job.status.errorResult.message)) else: log.err.Print() raise bigquery.BackendError(job.status.errorResult.message, job.status.errorResult, [], job.jobReference)
def Display(self, args, result): """Display prints information about what just happened to stdout. Args: args: The same as the args in Run. result: a list of Operation objects. Raises: ValueError: if result is None or not a list """ if not isinstance(result, list): raise ValueError('result must be a list') if not result: log.Print('No Operations were found in your project!') return if args.simple_list: for operation in result: log.Print(operation.name) else: list_printer.PrintResourceList( 'deploymentmanagerv2beta2.operations', result)
def Display(self, args, result): list_printer.PrintResourceList('cloudresourcemanager.projects', result)
def Display(self, unused_args, result): list_printer.PrintResourceList('sql.operations', result)
def Display(self, unused_args, result): list_printer.PrintResourceList('sql.sslCerts', result)
def Display(self, unused_args, result): list_printer.PrintResourceList('sql.instances', result)
def Display(self, unused_args, result): instance_refs = [] items = remote_completion.Iterate(result, instance_refs, self.GetRef) list_printer.PrintResourceList('sql.instances', items) cache = remote_completion.RemoteCompletion() cache.StoreInCache(instance_refs)
def Display(self, args, result): list_printer.PrintResourceList('dns.changes', result)