:doc:`finspace <../../finspace>` / Client / update_kx_cluster_code_configuration

************************************
update_kx_cluster_code_configuration
************************************



.. py:method:: finspace.Client.update_kx_cluster_code_configuration(**kwargs)

  

  Allows you to update code configuration on a running cluster. By using this API you can update the code, the initialization script path, and the command line arguments for a specific cluster. The configuration that you want to update will override any existing configurations on the cluster.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/UpdateKxClusterCodeConfiguration>`_  


  **Request Syntax**
  ::

    response = client.update_kx_cluster_code_configuration(
        environmentId='string',
        clusterName='string',
        clientToken='string',
        code={
            's3Bucket': 'string',
            's3Key': 'string',
            's3ObjectVersion': 'string'
        },
        initializationScript='string',
        commandLineArguments=[
            {
                'key': 'string',
                'value': 'string'
            },
        ],
        deploymentConfiguration={
            'deploymentStrategy': 'NO_RESTART'|'ROLLING'|'FORCE'
        }
    )
    
  :type environmentId: string
  :param environmentId: **[REQUIRED]** 

    A unique identifier of the kdb environment.

    

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

    The name of the cluster.

    

  
  :type clientToken: string
  :param clientToken: 

    A token that ensures idempotency. This token expires in 10 minutes.

    This field is autopopulated if not provided.

  
  :type code: dict
  :param code: **[REQUIRED]** 

    The structure of the customer code available within the running cluster.

    

  
    - **s3Bucket** *(string) --* 

      A unique name for the S3 bucket.

      

    
    - **s3Key** *(string) --* 

      The full S3 path (excluding bucket) to the .zip file. This file contains the code that is loaded onto the cluster when it's started.

      

    
    - **s3ObjectVersion** *(string) --* 

      The version of an S3 object.

      

    
  
  :type initializationScript: string
  :param initializationScript: 

    Specifies a Q program that will be run at launch of a cluster. It is a relative path within *.zip* file that contains the custom code, which will be loaded on the cluster. It must include the file name itself. For example, ``somedir/init.q``.

     

    You cannot update this parameter for a ``NO_RESTART`` deployment.

    

  
  :type commandLineArguments: list
  :param commandLineArguments: 

    Specifies the key-value pairs to make them available inside the cluster.

     

    You cannot update this parameter for a ``NO_RESTART`` deployment.

    

  
    - *(dict) --* 

      Defines the key-value pairs to make them available inside the cluster.

      

    
      - **key** *(string) --* 

        The name of the key.

        

      
      - **value** *(string) --* 

        The value of the key.

        

      
    

  :type deploymentConfiguration: dict
  :param deploymentConfiguration: 

    The configuration that allows you to choose how you want to update the code on a cluster.

    

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

      The type of deployment that you want on a cluster.

       

      
      * ROLLING – This options updates the cluster by stopping the exiting q process and starting a new q process with updated configuration.
       
      * NO_RESTART – This option updates the cluster without stopping the running q process. It is only available for ``GP`` type cluster. This option is quicker as it reduces the turn around time to update configuration on a cluster. With this deployment mode, you cannot update the ``initializationScript`` and ``commandLineArguments`` parameters.
       
      * FORCE – This option updates the cluster by immediately stopping all the running processes before starting up new ones with the updated configuration.
      

      

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`finspace.Client.exceptions.InternalServerException`

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

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

  
  *   :py:class:`finspace.Client.exceptions.LimitExceededException`

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

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

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

  