Exemplo n.º 1
0
    def delete_id(id, client=None):
        """
        Delete the `Workflow` that has the provided ID, and every `VersionedGraft` it contains.

        **Warning:** this cannot be undone!

        Parameters
        ----------
        id: str
            The ID of the `Workflow` that we wish to delete.
        client: `.workflows.client.Client`, optional
            Allows you to use a specific client instance with non-default
            auth and parameters.

        Example
        -------
        >>> import descarteslabs.workflows as wf
        >>> workflow = wf.Workflow.get("[email protected]:cool_thing_wf") # doctest: +SKIP
        >>> wf.Workflow.delete_id(workflow.id) # doctest: +SKIP
        """
        if client is None:
            client = get_global_grpc_client()

        client.api["DeleteWorkflow"](
            workflow_pb2.DeleteWorkflowRequest(id=id),
            timeout=client.DEFAULT_TIMEOUT,
        )
 def test_delete_id(self, stub):
     workflow_id = "foo"
     Workflow.delete_id(workflow_id)
     stub.return_value.DeleteWorkflow.assert_called_once_with(
         workflow_pb2.DeleteWorkflowRequest(id=workflow_id),
         timeout=Client.DEFAULT_TIMEOUT,
         metadata=(("x-wf-channel", _channel.__channel__), ),
     )
Exemplo n.º 3
0
 def test_delete_id(self, stub):
     workflow_id = "foo"
     Workflow.delete_id(workflow_id)
     stub.return_value.DeleteWorkflow.assert_called_once_with(
         workflow_pb2.DeleteWorkflowRequest(id=workflow_id),
         timeout=Client.DEFAULT_TIMEOUT,
         metadata=mock.ANY,
     )
 def test_delete(self, stub):
     workflow_id = "[email protected]:test"
     wf = Workflow(id=workflow_id)
     wf.delete()
     stub.return_value.DeleteWorkflow.assert_called_once_with(
         workflow_pb2.DeleteWorkflowRequest(id=workflow_id),
         timeout=Client.DEFAULT_TIMEOUT,
         metadata=(("x-wf-channel", _channel.__channel__), ),
     )
Exemplo n.º 5
0
    def delete_id(id, client=None):
        """
        Delete the `Workflow` that has the provided ID, and every `VersionedGraft` it contains.

        **Warning:** this cannot be undone!

        Parameters
        ----------
        id: str
            The ID of the `Workflow` that we wish to delete.
        client: `.workflows.client.Client`, optional
            Allows you to use a specific client instance with non-default
            auth and parameters.
        """
        if client is None:
            client = get_global_grpc_client()

        client.api["DeleteWorkflow"](
            workflow_pb2.DeleteWorkflowRequest(id=id),
            timeout=client.DEFAULT_TIMEOUT,
        )