:doc:`NetworkFlowMonitor <../../networkflowmonitor>` / Client / update_scope

************
update_scope
************



.. py:method:: NetworkFlowMonitor.Client.update_scope(**kwargs)

  

  Update a scope to add or remove resources that you want to be available for Network Flow Monitor to generate metrics for, when you have active agents on those resources sending metrics reports to the Network Flow Monitor backend.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/networkflowmonitor-2023-04-19/UpdateScope>`_  


  **Request Syntax**
  ::

    response = client.update_scope(
        scopeId='string',
        resourcesToAdd=[
            {
                'targetIdentifier': {
                    'targetId': {
                        'accountId': 'string'
                    },
                    'targetType': 'ACCOUNT'
                },
                'region': 'string'
            },
        ],
        resourcesToDelete=[
            {
                'targetIdentifier': {
                    'targetId': {
                        'accountId': 'string'
                    },
                    'targetType': 'ACCOUNT'
                },
                'region': 'string'
            },
        ]
    )
    
  :type scopeId: string
  :param scopeId: **[REQUIRED]** 

    The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.

    

  
  :type resourcesToAdd: list
  :param resourcesToAdd: 

    A list of resources to add to a scope.

    

  
    - *(dict) --* 

      A target resource in a scope. The resource is identified by a Region and an account, defined by a target identifier. A target identifier is made up of a target ID (currently always an account ID) and a target type (currently always ``ACCOUNT``).

      

    
      - **targetIdentifier** *(dict) --* **[REQUIRED]** 

        A target identifier is a pair of identifying information for a scope. A target identifier is made up of a targetID (currently always an account ID) and a targetType (currently always an account).

        

      
        - **targetId** *(dict) --* **[REQUIRED]** 

          The identifier for a target, which is currently always an account ID .

          .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``accountId``. 

        
          - **accountId** *(string) --* 

            The identifier for the account for a target.

            

          
        
        - **targetType** *(string) --* **[REQUIRED]** 

          The type of a target. A target type is currently always ``ACCOUNT``.

          

        
      
      - **region** *(string) --* **[REQUIRED]** 

        The Amazon Web Services Region for the scope.

        

      
    

  :type resourcesToDelete: list
  :param resourcesToDelete: 

    A list of resources to delete from a scope.

    

  
    - *(dict) --* 

      A target resource in a scope. The resource is identified by a Region and an account, defined by a target identifier. A target identifier is made up of a target ID (currently always an account ID) and a target type (currently always ``ACCOUNT``).

      

    
      - **targetIdentifier** *(dict) --* **[REQUIRED]** 

        A target identifier is a pair of identifying information for a scope. A target identifier is made up of a targetID (currently always an account ID) and a targetType (currently always an account).

        

      
        - **targetId** *(dict) --* **[REQUIRED]** 

          The identifier for a target, which is currently always an account ID .

          .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``accountId``. 

        
          - **accountId** *(string) --* 

            The identifier for the account for a target.

            

          
        
        - **targetType** *(string) --* **[REQUIRED]** 

          The type of a target. A target type is currently always ``ACCOUNT``.

          

        
      
      - **region** *(string) --* **[REQUIRED]** 

        The Amazon Web Services Region for the scope.

        

      
    

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

    
    ::

      {
          'scopeId': 'string',
          'status': 'SUCCEEDED'|'IN_PROGRESS'|'FAILED'|'DEACTIVATING'|'DEACTIVATED',
          'scopeArn': 'string',
          'tags': {
              'string': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **scopeId** *(string) --* 

        The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.

        
      

      - **status** *(string) --* 

        The status for a scope. The status can be one of the following: ``SUCCEEDED``, ``IN_PROGRESS``, ``FAILED``, ``DEACTIVATING``, or ``DEACTIVATED``.

         

        A status of ``DEACTIVATING`` means that you've requested a scope to be deactivated and Network Flow Monitor is in the process of deactivating the scope. A status of ``DEACTIVATED`` means that the deactivating process is complete.

        
      

      - **scopeArn** *(string) --* 

        The Amazon Resource Name (ARN) of the scope.

        
      

      - **tags** *(dict) --* 

        The tags for a scope.

        
        

        - *(string) --* 
          

          - *(string) --* 
    
  
  
  **Exceptions**
  
  *   :py:class:`NetworkFlowMonitor.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`NetworkFlowMonitor.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`NetworkFlowMonitor.Client.exceptions.ConflictException`

  
  *   :py:class:`NetworkFlowMonitor.Client.exceptions.ValidationException`

  
  *   :py:class:`NetworkFlowMonitor.Client.exceptions.ThrottlingException`

  
  *   :py:class:`NetworkFlowMonitor.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`NetworkFlowMonitor.Client.exceptions.InternalServerException`

  