def upgrade()

in src/sfctl/custom_compose.py [0:0]


def upgrade(client, deployment_name, file_path, user=None, has_pass=False, #pylint: disable=missing-docstring,too-many-locals,too-many-arguments
            encrypted_pass=None, upgrade_kind='Rolling',
            upgrade_mode='UnmonitoredAuto', replica_set_check=None,
            force_restart=False, failure_action=None, health_check_wait=None,
            health_check_stable=None, health_check_retry=None,
            upgrade_timeout=None, upgrade_domain_timeout=None,
            warning_as_error=False, unhealthy_app=0,
            default_svc_type_health_map=None, svc_type_health_map=None,
            timeout=60):
    from azure.servicefabric.models import ComposeDeploymentUpgradeDescription
    from sfctl.custom_cluster_upgrade import create_monitoring_policy

    file_contents = read_file(file_path)

    credentials = repo_creds(user, encrypted_pass, has_pass)

    monitoring_policy = create_monitoring_policy(failure_action,
                                                 health_check_wait,
                                                 health_check_stable,
                                                 health_check_retry,
                                                 upgrade_timeout,
                                                 upgrade_domain_timeout)

    app_health_policy = create_app_health_policy(warning_as_error,
                                                 unhealthy_app,
                                                 default_svc_type_health_map,
                                                 svc_type_health_map)

    desc = ComposeDeploymentUpgradeDescription(
        deployment_name=deployment_name,
        compose_file_content=file_contents,
        registry_credential=credentials,
        upgrade_kind=upgrade_kind,
        rolling_upgrade_mode=upgrade_mode,
        upgrade_replica_set_check_timeout_in_seconds=replica_set_check,
        force_restart=force_restart,
        monitoring_policy=monitoring_policy,
        application_health_policy=app_health_policy)

    client.start_compose_deployment_upgrade(deployment_name,
                                            desc,
                                            timeout=timeout)