Skip to content

update_kx_cluster_code_configuration

update_kx_cluster_code_configuration(
    environment_id: KxEnvironmentId,
    cluster_name: KxClusterName,
    code: CodeConfiguration,
    *,
    config_overrides: Optional[finspaceClientConfig] = None,
    client_token: Optional[ClientTokenString] = None,
    initialization_script: Optional[InitializationScriptFilePath] = None,
    command_line_arguments: Optional[KxCommandLineArguments] = None,
    deployment_configuration: Optional[KxClusterCodeDeploymentConfiguration] = None,
) -> UpdateKxClusterCodeConfigurationResponse

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.

Parameters:

  • environment_id (KxEnvironmentId) –

    A unique identifier of the kdb environment.

  • cluster_name (KxClusterName) –

    The name of the cluster.

  • client_token (Optional[ClientTokenString], default: None ) –

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

  • initialization_script (Optional[InitializationScriptFilePath], default: None ) –

    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.

  • command_line_arguments (Optional[KxCommandLineArguments], default: None ) –

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

    You cannot update this parameter for a NO_RESTART deployment.

  • deployment_configuration (Optional[KxClusterCodeDeploymentConfiguration], default: None ) –

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

Raises:

Source code in docs_src/capo_finspace/_services/finspace.py
def update_kx_cluster_code_configuration(
    self,
    environment_id: "capo_finspace.types.kx_environment_id.KxEnvironmentId",
    cluster_name: "capo_finspace.types.kx_cluster_name.KxClusterName",
    code: "capo_finspace.types.code_configuration.CodeConfiguration",
    *,
    config_overrides: Optional[finspaceClientConfig] = None,
    client_token: Optional[
        "capo_finspace.types.client_token_string.ClientTokenString"
    ] = None,
    initialization_script: Optional[
        "capo_finspace.types.initialization_script_file_path.InitializationScriptFilePath"
    ] = None,
    command_line_arguments: Optional[
        "capo_finspace.types.kx_command_line_arguments.KxCommandLineArguments"
    ] = None,
    deployment_configuration: Optional[
        "capo_finspace.types.kx_cluster_code_deployment_configuration.KxClusterCodeDeploymentConfiguration"
    ] = None,
) -> "capo_finspace.types.update_kx_cluster_code_configuration_response.UpdateKxClusterCodeConfigurationResponse":
    """<p> 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. </p>

    Args:
        environment_id: <p> A unique identifier of the kdb environment. </p>
        cluster_name: <p>The name of the cluster.</p>
        client_token: <p>A token that ensures idempotency. This token expires in 10 minutes.</p>
        initialization_script: <p>Specifies a Q program that will be run at launch of a cluster. It is a relative path within <i>.zip</i> file that contains the custom code, which will be loaded on the cluster. It must include the file name itself. For example, <code>somedir/init.q</code>.</p> <p>You cannot update this parameter for a <code>NO_RESTART</code> deployment.</p>
        command_line_arguments: <p>Specifies the key-value pairs to make them available inside the cluster.</p> <p>You cannot update this parameter for a <code>NO_RESTART</code> deployment.</p>
        deployment_configuration: <p> The configuration that allows you to choose how you want to update the code on a cluster. </p>

    Raises:
        capo_finspace.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_finspace.errors.conflict_exception.ConflictException: <p>There was a conflict with this action, and it could not be completed.</p>
        capo_finspace.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_finspace.errors.limit_exceeded_exception.LimitExceededException: <p>A service limit or quota is exceeded.</p>
        capo_finspace.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_finspace.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_finspace.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_finspace.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_finspace.types.update_kx_cluster_code_configuration_request.UpdateKxClusterCodeConfigurationRequest]",
    ) -> OperationResponse[
        "capo_finspace.types.update_kx_cluster_code_configuration_response.UpdateKxClusterCodeConfigurationResponse"
    ]:
        import capo_finspace._operations.aws_habanero_management_service.update_kx_cluster_code_configuration

        output, http_response = (
            capo_finspace._operations.aws_habanero_management_service.update_kx_cluster_code_configuration.update_kx_cluster_code_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateKxClusterCodeConfiguration")
    )
    input_: capo_finspace.types.update_kx_cluster_code_configuration_request.UpdateKxClusterCodeConfigurationRequest = {
        "environment_id": environment_id,
        "cluster_name": cluster_name,
        "code": code,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if initialization_script is not None:
        input_["initialization_script"] = initialization_script
    if command_line_arguments is not None:
        input_["command_line_arguments"] = command_line_arguments
    if deployment_configuration is not None:
        input_["deployment_configuration"] = deployment_configuration

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output