:doc:`DatabaseMigrationService <../../dms>` / Client / stop_replication

****************
stop_replication
****************



.. py:method:: DatabaseMigrationService.Client.stop_replication(**kwargs)

  

  For a given DMS Serverless replication configuration, DMS stops any and all ongoing DMS Serverless replications. This command doesn't deprovision the stopped replications.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StopReplication>`_  


  **Request Syntax**
  ::

    response = client.stop_replication(
        ReplicationConfigArn='string'
    )
    
  :type ReplicationConfigArn: string
  :param ReplicationConfigArn: **[REQUIRED]** 

    The Amazon Resource Name of the replication to stop.

    

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

    
    ::

      {
          'Replication': {
              'ReplicationConfigIdentifier': 'string',
              'ReplicationConfigArn': 'string',
              'SourceEndpointArn': 'string',
              'TargetEndpointArn': 'string',
              'ReplicationType': 'full-load'|'cdc'|'full-load-and-cdc',
              'Status': 'string',
              'ProvisionData': {
                  'ProvisionState': 'string',
                  'ProvisionedCapacityUnits': 123,
                  'DateProvisioned': datetime(2015, 1, 1),
                  'IsNewProvisioningAvailable': True|False,
                  'DateNewProvisioningDataAvailable': datetime(2015, 1, 1),
                  'ReasonForNewProvisioningData': 'string'
              },
              'PremigrationAssessmentStatuses': [
                  {
                      'PremigrationAssessmentRunArn': 'string',
                      'FailOnAssessmentFailure': True|False,
                      'Status': 'string',
                      'PremigrationAssessmentRunCreationDate': datetime(2015, 1, 1),
                      'AssessmentProgress': {
                          'IndividualAssessmentCount': 123,
                          'IndividualAssessmentCompletedCount': 123
                      },
                      'LastFailureMessage': 'string',
                      'ResultLocationBucket': 'string',
                      'ResultLocationFolder': 'string',
                      'ResultEncryptionMode': 'string',
                      'ResultKmsKeyArn': 'string',
                      'ResultStatistic': {
                          'Passed': 123,
                          'Failed': 123,
                          'Error': 123,
                          'Warning': 123,
                          'Cancelled': 123,
                          'Skipped': 123
                      }
                  },
              ],
              'StopReason': 'string',
              'FailureMessages': [
                  'string',
              ],
              'ReplicationStats': {
                  'FullLoadProgressPercent': 123,
                  'ElapsedTimeMillis': 123,
                  'TablesLoaded': 123,
                  'TablesLoading': 123,
                  'TablesQueued': 123,
                  'TablesErrored': 123,
                  'FreshStartDate': datetime(2015, 1, 1),
                  'StartDate': datetime(2015, 1, 1),
                  'StopDate': datetime(2015, 1, 1),
                  'FullLoadStartDate': datetime(2015, 1, 1),
                  'FullLoadFinishDate': datetime(2015, 1, 1)
              },
              'StartReplicationType': 'string',
              'CdcStartTime': datetime(2015, 1, 1),
              'CdcStartPosition': 'string',
              'CdcStopPosition': 'string',
              'RecoveryCheckpoint': 'string',
              'ReplicationCreateTime': datetime(2015, 1, 1),
              'ReplicationUpdateTime': datetime(2015, 1, 1),
              'ReplicationLastStopTime': datetime(2015, 1, 1),
              'ReplicationDeprovisionTime': datetime(2015, 1, 1),
              'IsReadOnly': True|False
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Replication** *(dict) --* 

        The replication that DMS stopped.

        
        

        - **ReplicationConfigIdentifier** *(string) --* 

          The identifier for the ``ReplicationConfig`` associated with the replication.

          
        

        - **ReplicationConfigArn** *(string) --* 

          The Amazon Resource Name for the ``ReplicationConfig`` associated with the replication.

          
        

        - **SourceEndpointArn** *(string) --* 

          The Amazon Resource Name for an existing ``Endpoint`` the serverless replication uses for its data source.

          
        

        - **TargetEndpointArn** *(string) --* 

          The Amazon Resource Name for an existing ``Endpoint`` the serverless replication uses for its data target.

          
        

        - **ReplicationType** *(string) --* 

          The type of the serverless replication.

          
        

        - **Status** *(string) --* 

          The current status of the serverless replication.

          
        

        - **ProvisionData** *(dict) --* 

          Information about provisioning resources for an DMS serverless replication.

          
          

          - **ProvisionState** *(string) --* 

            The current provisioning state

            
          

          - **ProvisionedCapacityUnits** *(integer) --* 

            The number of capacity units the replication is using.

            
          

          - **DateProvisioned** *(datetime) --* 

            The timestamp when DMS provisioned replication resources.

            
          

          - **IsNewProvisioningAvailable** *(boolean) --* 

            Whether the new provisioning is available to the replication.

            
          

          - **DateNewProvisioningDataAvailable** *(datetime) --* 

            The timestamp when provisioning became available.

            
          

          - **ReasonForNewProvisioningData** *(string) --* 

            A message describing the reason that DMS provisioned new resources for the serverless replication.

            
      
        

        - **PremigrationAssessmentStatuses** *(list) --* 

          The status output of premigration assessment in describe-replications.

          
          

          - *(dict) --* 

            The results returned in ``describe-replications`` to display the results of the premigration assessment from the replication configuration.

            
            

            - **PremigrationAssessmentRunArn** *(string) --* 

              The Amazon Resource Name (ARN) of this assessment run.

              
            

            - **FailOnAssessmentFailure** *(boolean) --* 

              A configurable setting you can set to ``true`` (the defualt setting) or ``false``. Use this setting to to stop the replication from starting automatically if the assessment fails. This can help you evaluate the issue that is preventing the replication from running successfully.

              
            

            - **Status** *(string) --* 

              This describes the assessment run status. The status can be one of the following values:

               

              
              * ``cancelling``: The assessment run was canceled.
               
              * ``deleting``: The assessment run was deleted.
               
              * ``failed``: At least one individual assessment completed with a failed status.
               
              * ``error-provisioning``: An internal error occurred while resources were provisioned (during the ``provisioning`` status).
               
              * ``error-executing`` An internal error occurred while individual assessments ran (during the ``running`` status).
               
              * ``invalid state``: The assessment run is in an unknown state.
               
              * ``passed``: All individual assessments have completed and none have a failed status.
               
              * ``provisioning``: The resources required to run individual assessments are being provisioned.
               
              * ``running``: Individual assessments are being run.
               
              * ``starting``: The assessment run is starting, but resources are not yet being provisioned for individual assessments.
               
              * ``warning``: At least one individual assessment completed with a warning status.
              

              
            

            - **PremigrationAssessmentRunCreationDate** *(datetime) --* 

              The date which the assessment run was created.

              
            

            - **AssessmentProgress** *(dict) --* 

              The progress values reported by the ``AssessmentProgress`` response element.

              
              

              - **IndividualAssessmentCount** *(integer) --* 

                The number of individual assessments that are specified to run.

                
              

              - **IndividualAssessmentCompletedCount** *(integer) --* 

                The number of individual assessments that have completed, successfully or not.

                
          
            

            - **LastFailureMessage** *(string) --* 

              The last message generated by an individual assessment failure.

              
            

            - **ResultLocationBucket** *(string) --* 

              The Amazon S3 bucket that Database Migration Service Serverless created to store the results of this assessment run.

              
            

            - **ResultLocationFolder** *(string) --* 

              The folder within an Amazon S3 bucket where you want Database Migration Service to store the results of this assessment run.

              
            

            - **ResultEncryptionMode** *(string) --* 

              The supported values are ``SSE_KMS`` and ``SSE_S3``. If these values are not provided, then the files are not encrypted at rest. For more information, see `Creating Amazon Web Services KMS keys to encrypt Amazon S3 target objects <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.S3.html#CHAP_Target.S3.KMSKeys>`__.

              
            

            - **ResultKmsKeyArn** *(string) --* 

              The ARN of a custom KMS encryption key that you specify when you set ``ResultEncryptionMode`` to ``SSE_KMS``.

              
            

            - **ResultStatistic** *(dict) --* 

              The object containing the result statistics for a completed assessment run.

              
              

              - **Passed** *(integer) --* 

                The number of individual assessments that successfully passed all checks in the assessment run.

                
              

              - **Failed** *(integer) --* 

                The number of individual assessments that failed to meet the criteria defined in the assessment run.

                
              

              - **Error** *(integer) --* 

                The number of individual assessments that encountered a critical error and could not complete properly.

                
              

              - **Warning** *(integer) --* 

                Indicates that the recent completed AssessmentRun triggered a warning.

                
              

              - **Cancelled** *(integer) --* 

                The number of individual assessments that were cancelled during the assessment run.

                
              

              - **Skipped** *(integer) --* 

                The number of individual assessments that were skipped during the assessment run.

                
          
        
      
        

        - **StopReason** *(string) --* 

          The reason the replication task was stopped. This response parameter can return one of the following values:

           

          
          * ``"Stop Reason NORMAL"``
           
          * ``"Stop Reason RECOVERABLE_ERROR"``
           
          * ``"Stop Reason FATAL_ERROR"``
           
          * ``"Stop Reason FULL_LOAD_ONLY_FINISHED"``
           
          * ``"Stop Reason STOPPED_AFTER_FULL_LOAD"`` – Full load completed, with cached changes not applied
           
          * ``"Stop Reason STOPPED_AFTER_CACHED_EVENTS"`` – Full load completed, with cached changes applied
           
          * ``"Stop Reason EXPRESS_LICENSE_LIMITS_REACHED"``
           
          * ``"Stop Reason STOPPED_AFTER_DDL_APPLY"`` – User-defined stop task after DDL applied
           
          * ``"Stop Reason STOPPED_DUE_TO_LOW_MEMORY"``
           
          * ``"Stop Reason STOPPED_DUE_TO_LOW_DISK"``
           
          * ``"Stop Reason STOPPED_AT_SERVER_TIME"`` – User-defined server time for stopping task
           
          * ``"Stop Reason STOPPED_AT_COMMIT_TIME"`` – User-defined commit time for stopping task
           
          * ``"Stop Reason RECONFIGURATION_RESTART"``
           
          * ``"Stop Reason RECYCLE_TASK"``
          

          
        

        - **FailureMessages** *(list) --* 

          Error and other information about why a serverless replication failed.

          
          

          - *(string) --* 
      
        

        - **ReplicationStats** *(dict) --* 

          This object provides a collection of statistics about a serverless replication.

          
          

          - **FullLoadProgressPercent** *(integer) --* 

            The percent complete for the full load serverless replication.

            
          

          - **ElapsedTimeMillis** *(integer) --* 

            The elapsed time of the replication, in milliseconds.

            
          

          - **TablesLoaded** *(integer) --* 

            The number of tables loaded for this replication.

            
          

          - **TablesLoading** *(integer) --* 

            The number of tables currently loading for this replication.

            
          

          - **TablesQueued** *(integer) --* 

            The number of tables queued for this replication.

            
          

          - **TablesErrored** *(integer) --* 

            The number of errors that have occured for this replication.

            
          

          - **FreshStartDate** *(datetime) --* 

            The date the replication was started either with a fresh start or a target reload.

            
          

          - **StartDate** *(datetime) --* 

            The date the replication is scheduled to start.

            
          

          - **StopDate** *(datetime) --* 

            The date the replication was stopped.

            
          

          - **FullLoadStartDate** *(datetime) --* 

            The date the replication full load was started.

            
          

          - **FullLoadFinishDate** *(datetime) --* 

            The date the replication full load was finished.

            
      
        

        - **StartReplicationType** *(string) --* 

          The type of replication to start.

          
        

        - **CdcStartTime** *(datetime) --* 

          Indicates the start time for a change data capture (CDC) operation. Use either ``CdcStartTime`` or ``CdcStartPosition`` to specify when you want a CDC operation to start. Specifying both values results in an error.

          
        

        - **CdcStartPosition** *(string) --* 

          Indicates the start time for a change data capture (CDC) operation. Use either ``CdcStartTime`` or ``CdcStartPosition`` to specify when you want a CDC operation to start. Specifying both values results in an error.

          
        

        - **CdcStopPosition** *(string) --* 

          Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.

          
        

        - **RecoveryCheckpoint** *(string) --* 

          Indicates the last checkpoint that occurred during a change data capture (CDC) operation. You can provide this value to the ``CdcStartPosition`` parameter to start a CDC operation that begins at that checkpoint.

          
        

        - **ReplicationCreateTime** *(datetime) --* 

          The time the serverless replication was created.

          
        

        - **ReplicationUpdateTime** *(datetime) --* 

          The time the serverless replication was updated.

          
        

        - **ReplicationLastStopTime** *(datetime) --* 

          The timestamp when replication was last stopped.

          
        

        - **ReplicationDeprovisionTime** *(datetime) --* 

          The timestamp when DMS will deprovision the replication.

          
        

        - **IsReadOnly** *(boolean) --* 

          Indicates whether the serverless replication is read-only. When set to ``true``, this replication is managed by DMS as part of a zero-ETL integration and cannot be modified or deleted directly. You can only modify or delete read-only replications through their associated zero-ETL integration.

          
    
  
  **Exceptions**
  
  *   :py:class:`DatabaseMigrationService.Client.exceptions.ResourceNotFoundFault`

  
  *   :py:class:`DatabaseMigrationService.Client.exceptions.InvalidResourceStateFault`

  
  *   :py:class:`DatabaseMigrationService.Client.exceptions.AccessDeniedFault`

  