:doc:`ApiGatewayV2 <../../apigatewayv2>` / Client / update_stage

************
update_stage
************



.. py:method:: ApiGatewayV2.Client.update_stage(**kwargs)

  

  Updates a Stage.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/UpdateStage>`_  


  **Request Syntax**
  ::

    response = client.update_stage(
        AccessLogSettings={
            'DestinationArn': 'string',
            'Format': 'string'
        },
        ApiId='string',
        AutoDeploy=True|False,
        ClientCertificateId='string',
        DefaultRouteSettings={
            'DataTraceEnabled': True|False,
            'DetailedMetricsEnabled': True|False,
            'LoggingLevel': 'ERROR'|'INFO'|'OFF',
            'ThrottlingBurstLimit': 123,
            'ThrottlingRateLimit': 123.0
        },
        DeploymentId='string',
        Description='string',
        RouteSettings={
            'string': {
                'DataTraceEnabled': True|False,
                'DetailedMetricsEnabled': True|False,
                'LoggingLevel': 'ERROR'|'INFO'|'OFF',
                'ThrottlingBurstLimit': 123,
                'ThrottlingRateLimit': 123.0
            }
        },
        StageName='string',
        StageVariables={
            'string': 'string'
        }
    )
    
  :type AccessLogSettings: dict
  :param AccessLogSettings: 

    Settings for logging access in this stage.

    

  
    - **DestinationArn** *(string) --* 

      The ARN of the CloudWatch Logs log group to receive access logs.

      

    
    - **Format** *(string) --* 

      A single line format of the access logs of data, as specified by selected $context variables. The format must include at least $context.requestId.

      

    
  
  :type ApiId: string
  :param ApiId: **[REQUIRED]** 

    The API identifier.

    

  
  :type AutoDeploy: boolean
  :param AutoDeploy: 

    Specifies whether updates to an API automatically trigger a new deployment. The default value is false.

    

  
  :type ClientCertificateId: string
  :param ClientCertificateId: 

    The identifier of a client certificate for a Stage.

    

  
  :type DefaultRouteSettings: dict
  :param DefaultRouteSettings: 

    The default route settings for the stage.

    

  
    - **DataTraceEnabled** *(boolean) --* 

      Specifies whether (true) or not (false) data trace logging is enabled for this route. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs.

      

    
    - **DetailedMetricsEnabled** *(boolean) --* 

      Specifies whether detailed metrics are enabled.

      

    
    - **LoggingLevel** *(string) --* 

      Specifies the logging level for this route: INFO, ERROR, or OFF. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs.

      

    
    - **ThrottlingBurstLimit** *(integer) --* 

      Specifies the throttling burst limit.

      

    
    - **ThrottlingRateLimit** *(float) --* 

      Specifies the throttling rate limit.

      

    
  
  :type DeploymentId: string
  :param DeploymentId: 

    The deployment identifier for the API stage. Can't be updated if autoDeploy is enabled.

    

  
  :type Description: string
  :param Description: 

    The description for the API stage.

    

  
  :type RouteSettings: dict
  :param RouteSettings: 

    Route settings for the stage.

    

  
    - *(string) --* 

    
      - *(dict) --* 

        Represents a collection of route settings.

        

      
        - **DataTraceEnabled** *(boolean) --* 

          Specifies whether (true) or not (false) data trace logging is enabled for this route. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs.

          

        
        - **DetailedMetricsEnabled** *(boolean) --* 

          Specifies whether detailed metrics are enabled.

          

        
        - **LoggingLevel** *(string) --* 

          Specifies the logging level for this route: INFO, ERROR, or OFF. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs.

          

        
        - **ThrottlingBurstLimit** *(integer) --* 

          Specifies the throttling burst limit.

          

        
        - **ThrottlingRateLimit** *(float) --* 

          Specifies the throttling rate limit.

          

        
      


  :type StageName: string
  :param StageName: **[REQUIRED]** 

    The stage name. Stage names can contain only alphanumeric characters, hyphens, and underscores, or be $default. Maximum length is 128 characters.

    

  
  :type StageVariables: dict
  :param StageVariables: 

    A map that defines the stage variables for a Stage. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+.

    

  
    - *(string) --* 

    
      - *(string) --* 

        A string with a length between [0-2048].

        

      


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

    
    ::

      {
          'AccessLogSettings': {
              'DestinationArn': 'string',
              'Format': 'string'
          },
          'ApiGatewayManaged': True|False,
          'AutoDeploy': True|False,
          'ClientCertificateId': 'string',
          'CreatedDate': datetime(2015, 1, 1),
          'DefaultRouteSettings': {
              'DataTraceEnabled': True|False,
              'DetailedMetricsEnabled': True|False,
              'LoggingLevel': 'ERROR'|'INFO'|'OFF',
              'ThrottlingBurstLimit': 123,
              'ThrottlingRateLimit': 123.0
          },
          'DeploymentId': 'string',
          'Description': 'string',
          'LastDeploymentStatusMessage': 'string',
          'LastUpdatedDate': datetime(2015, 1, 1),
          'RouteSettings': {
              'string': {
                  'DataTraceEnabled': True|False,
                  'DetailedMetricsEnabled': True|False,
                  'LoggingLevel': 'ERROR'|'INFO'|'OFF',
                  'ThrottlingBurstLimit': 123,
                  'ThrottlingRateLimit': 123.0
              }
          },
          'StageName': 'string',
          'StageVariables': {
              'string': 'string'
          },
          'Tags': {
              'string': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Success

      
      

      - **AccessLogSettings** *(dict) --* 

        Settings for logging access in this stage.

        
        

        - **DestinationArn** *(string) --* 

          The ARN of the CloudWatch Logs log group to receive access logs.

          
        

        - **Format** *(string) --* 

          A single line format of the access logs of data, as specified by selected $context variables. The format must include at least $context.requestId.

          
    
      

      - **ApiGatewayManaged** *(boolean) --* 

        Specifies whether a stage is managed by API Gateway. If you created an API using quick create, the $default stage is managed by API Gateway. You can't modify the $default stage.

        
      

      - **AutoDeploy** *(boolean) --* 

        Specifies whether updates to an API automatically trigger a new deployment. The default value is false.

        
      

      - **ClientCertificateId** *(string) --* 

        The identifier of a client certificate for a Stage. Supported only for WebSocket APIs.

        
      

      - **CreatedDate** *(datetime) --* 

        The timestamp when the stage was created.

        
      

      - **DefaultRouteSettings** *(dict) --* 

        Default route settings for the stage.

        
        

        - **DataTraceEnabled** *(boolean) --* 

          Specifies whether (true) or not (false) data trace logging is enabled for this route. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs.

          
        

        - **DetailedMetricsEnabled** *(boolean) --* 

          Specifies whether detailed metrics are enabled.

          
        

        - **LoggingLevel** *(string) --* 

          Specifies the logging level for this route: INFO, ERROR, or OFF. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs.

          
        

        - **ThrottlingBurstLimit** *(integer) --* 

          Specifies the throttling burst limit.

          
        

        - **ThrottlingRateLimit** *(float) --* 

          Specifies the throttling rate limit.

          
    
      

      - **DeploymentId** *(string) --* 

        The identifier of the Deployment that the Stage is associated with. Can't be updated if autoDeploy is enabled.

        
      

      - **Description** *(string) --* 

        The description of the stage.

        
      

      - **LastDeploymentStatusMessage** *(string) --* 

        Describes the status of the last deployment of a stage. Supported only for stages with autoDeploy enabled.

        
      

      - **LastUpdatedDate** *(datetime) --* 

        The timestamp when the stage was last updated.

        
      

      - **RouteSettings** *(dict) --* 

        Route settings for the stage, by routeKey.

        
        

        - *(string) --* 
          

          - *(dict) --* 

            Represents a collection of route settings.

            
            

            - **DataTraceEnabled** *(boolean) --* 

              Specifies whether (true) or not (false) data trace logging is enabled for this route. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs.

              
            

            - **DetailedMetricsEnabled** *(boolean) --* 

              Specifies whether detailed metrics are enabled.

              
            

            - **LoggingLevel** *(string) --* 

              Specifies the logging level for this route: INFO, ERROR, or OFF. This property affects the log entries pushed to Amazon CloudWatch Logs. Supported only for WebSocket APIs.

              
            

            - **ThrottlingBurstLimit** *(integer) --* 

              Specifies the throttling burst limit.

              
            

            - **ThrottlingRateLimit** *(float) --* 

              Specifies the throttling rate limit.

              
        
    
  
      

      - **StageName** *(string) --* 

        The name of the stage.

        
      

      - **StageVariables** *(dict) --* 

        A map that defines the stage variables for a stage resource. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+.

        
        

        - *(string) --* 
          

          - *(string) --* 

            A string with a length between [0-2048].

            
    
  
      

      - **Tags** *(dict) --* 

        The collection of tags. Each tag element is associated with a given resource.

        
        

        - *(string) --* 
          

          - *(string) --* 

            A string with a length between [0-1600].

            
    
  
  
  **Exceptions**
  
  *   :py:class:`ApiGatewayV2.Client.exceptions.NotFoundException`

  
  *   :py:class:`ApiGatewayV2.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`ApiGatewayV2.Client.exceptions.BadRequestException`

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

  