コード例 #1
0
 def list_deployments(namespace, platform, limit, labels, order_by, asc,
                      output):
     yatai_client = get_default_yatai_client()
     list_result = yatai_client.deployment.list(
         limit=limit,
         labels_query=labels,
         namespace=namespace,
         operator=platform,
         order_by=order_by,
         ascending_order=asc,
     )
     if list_result.status.status_code != yatai_proto.status_pb2.Status.OK:
         error_code, error_message = status_pb_to_error_code_and_message(
             list_result.status)
         raise CLIException(f'{error_code}:{error_message}')
     _print_deployments_info(list_result.deployments, output)
コード例 #2
0
 def list_deployments(namespace, platform, limit, labels, order_by, asc, output):
     yatai_client = YataiClient()
     track_cli('deploy-list')
     try:
         list_result = yatai_client.deployment.list(
             limit=limit,
             labels_query=labels,
             namespace=namespace,
             operator=platform,
             order_by=order_by,
             ascending_order=asc,
         )
         if list_result.status.status_code != status_pb2.Status.OK:
             error_code, error_message = status_pb_to_error_code_and_message(
                 list_result.status
             )
             _echo(
                 f'Failed to list deployments {error_code}:{error_message}',
                 CLI_COLOR_ERROR,
             )
             return
         _print_deployments_info(list_result.deployments, output)
     except BentoMLException as e:
         _echo(f'Failed to list deployments {str(e)}')