:doc:`Snowball <../../snowball>` / Client / cancel_job

**********
cancel_job
**********



.. py:method:: Snowball.Client.cancel_job(**kwargs)

  

  Cancels the specified job. You can only cancel a job before its ``JobState`` value changes to ``PreparingAppliance``. Requesting the ``ListJobs`` or ``DescribeJob`` action returns a job's ``JobState`` as part of the response element data returned.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/snowball-2016-06-30/CancelJob>`_  


  **Request Syntax**
  ::

    response = client.cancel_job(
        JobId='string'
    )
    
  :type JobId: string
  :param JobId: **[REQUIRED]** 

    The 39-character job ID for the job that you want to cancel, for example ``JID123e4567-e89b-12d3-a456-426655440000``.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`Snowball.Client.exceptions.InvalidResourceException`

  
  *   :py:class:`Snowball.Client.exceptions.InvalidJobStateException`

  
  *   :py:class:`Snowball.Client.exceptions.KMSRequestFailedException`

  

  **Examples**

  This operation cancels a job. You can only cancel a job before its JobState value changes to PreparingAppliance.
  ::

    response = client.cancel_job(
        JobId='JID123e4567-e89b-12d3-a456-426655440000',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  