Exemple #1
0
 def delete(self, deployment_name, namespace, force_delete=False):
     return self.yatai_service.DeleteDeployment(
         DeleteDeploymentRequest(
             deployment_name=deployment_name,
             namespace=namespace,
             force_delete=force_delete,
         ))
Exemple #2
0
def delete_deployment(deployment_name,
                      namespace,
                      force_delete=False,
                      yatai_service=None):
    if yatai_service is None:
        from bentoml.yatai import get_yatai_service

        yatai_service = get_yatai_service()

    return yatai_service.DeleteDeployment(
        DeleteDeploymentRequest(
            deployment_name=deployment_name,
            namespace=namespace,
            force_delete=force_delete,
        ))
Exemple #3
0
 def delete(name):
     track_cli('deploy-delete')
     result = get_yatai_service().DeleteDeployment(
         DeleteDeploymentRequest(deployment_name=name))
     if result.status.status_code != Status.OK:
         _echo(
             'Failed to delete deployment {name}. code: {error_code}, message: {error_message}'
             .format(
                 name=name,
                 error_code=Status.Code.Name(result.status.status_code),
                 error_message=result.status.error_message,
             ),
             CLI_COLOR_ERROR,
         )
     else:
         _echo('Successfully delete deployment {}'.format(name),
               CLI_COLOR_SUCCESS)