from parallels.core.utils.message_utils import single_line_message
from parallels.core.utils.message_utils import multi_line_message

PVPS_MIGRATION_NOT_SUPPORTED_FOR_OLD_PPA = single_line_message("""
	Migration from shared hosting to dedicated is not supported for PPA %s. Install PPA 11.6 or later to perform
	migration to Plesk in VPS.
""")
FAILED_TO_FIND_SUBSCRIPTION_IN_MODEL = single_line_message("""
	Failed to find subscription in model
""")
UNABLE_TO_RETRIEVE_INFO_ABOUT_PLESK_FOR_SUBSCRIPTION = single_line_message("""
	Unable to retrieve information about a Plesk installation for the subscription "{name}". Please check whether the
	subscription was created: Go to Provider's Panel > Operations > Tasks, and see if there are failed tasks for the
	subscription "{name}" (id:{id}). Resolve issues and re-run the failed tasks. After the tasks were completed, start
	the migration again.
""")
CREATE_CLIENTS_AND_SUBSCRIPTIONS = single_line_message("""
	Create clients and subscriptions
""")
SUBSCRIPTION_IS_MAPPED_TO_UNEXISTING_CLIENT = single_line_message("""
	Subscription is mapped to an unexisting client '%s'
""")
SOLUTION_CREATE_PLAN_IN_DESTINATION_PANEL_OR_MAP_TO_ANOTHER_PLAN = single_line_message("""
	Create this plan in destination panel, or map subscription to some existing plan
""")
SUBSCRIPTION_IS_MAPPED_TO_UNEXISTING_PLAN = single_line_message("""
	Subscription is mapped to an unexisting plan '%s'
""")
CREATE_CLIENT_IN_DESTINATION_PANEL = single_line_message("""
	Create this client in destination panel, or map subscription to some existing client
""")
FAILED_TO_CREATE_PLESK_SUBSCRIPTION = single_line_message("""
	Failed to create Plesk subscription '%s' in target panel
""")
CREATE_PLESK_SUBSCRIPTION = single_line_message("""
	Create Plesk subscription in target panel
""")
SUBSCRIPTION_ALREADY_EXISTS = single_line_message("""
	Subscription '%s' already exists in the target panel
""")
CONVERT_CLIENTS_AND_SUBSCRIPTIONS = single_line_message("""
	Convert clients and subscriptions
""")
MORE_THAN_ONE_PVPS_CONFIG_RESOURCES = multi_line_message("""
	There are more than one PVPS Config resources in the service template. Please choose one.
	PVPS Configs: %s
""")
UNABLE_TO_CONTINUE_MIGRATION = single_line_message("""
	Unable to continue migration until there are no issues at 'error' level in pre-migration checks. Please review pre-
	migration tree above and fix the errors.
""")
FAILED_TO_CONVERT_CLIENTS_AND_SUBSCRIPTIONS = single_line_message("""
	Failed to convert clients and subscriptions
""")
HOW_TO_FIX_LIMIT = single_line_message("""
	Please go to the Products>Service Templates>Failed Service Template>Resources and change limit to expected.
""")
HOW_TO_FIX_EXCESS_LIMIT = single_line_message("""
	Please go to the Products>Service Templates>Failed Service Template>Resources and set the excess PVPS Config
	resource limit to zero.
""")
ERROR_WHILE_CHECKING_CONNECTION_TO_PVPS = single_line_message("""
	Error while checking connection to Plesk in VPS
""")
CHECK_CONNECTIONS_TO_TARGET_NODES = single_line_message("""
	Check connections to target nodes
""")
CHECK_CONNECTIONS_TO_PVPS = single_line_message("""
	Check connections to Plesk in VPS
""")
FETCH_INFO_FROM_TARGET_PANEL = single_line_message("""
	Fetch information from target panel
""")
FAILED_TO_FETCH_INFO_FROM_TARGET = single_line_message("""
	Failed to fetch information from target panel
""")
TIMED_OUT_WAITING_UNTIL_PVPS_PROVISIONING = single_line_message("""
	Timed out waiting until Plesk in VPS %s is provisioned
""")
WAITING_FOR_PVPS_PROVISIONING = single_line_message("""
	Waiting for Plesk in VPS provisioning...
""")
CREATE_VPS_SUBSCRIPTION_FOR_CUSTOMER = single_line_message("""
	Create VPS subscription '%s' for customer '%s'
""")
FAILED_TO_CREATE_PVPS_SUBSCRIPTION = single_line_message("""
	Failed to create PVPS subscription in target panel, migration can not proceed to the next steps
""")
UNABLE_TO_RETRIEVE_INFO_ABOUT_PVPS = multi_line_message("""
	Unable to retrieve information about the Plesk in VPS installation for this subscription.
	Please check failed tasks in the Task Manager: 
	Go to Provider's Panel > Operations > Tasks, and see if there are failed tasks for
	the subscription "{name}" (id:{id}). Resolve issues and re-run the failed tasks.
	After the tasks were completed, start the migration again.
""")
CREATE_PVPS_SUBSCRIPTION_IN_TARGET_PANEL = single_line_message("""
	Create PVPS subscription in target panel
""")
TARGET_PVPS_SERVER = single_line_message("""
	target Plesk in VPS server '%s'
""")
REPORT_TITLE_CONVERSION_STATUS = single_line_message("""
	Conversion status
""")
WRONG_RESOURCE_LIMIT_VALUE = multi_line_message("""
	The resource type '{r_name}' (id:{r_id}) has wrong limit value.
	Expected limit: '{e_limit}'. Actual limit: '{a_limit}'
""")
PROVISIONING_FAILED = single_line_message("""
	Provisioning of '%s' is failed: %s
""")
DEBUG_SEND_METHOD_TO_APSC = single_line_message("""
	Send '{method}' to APSC: '{url}' \"{data}\"
""")
APS_REQUEST_FAILED = single_line_message("""
	Request to APS controller failed with status: '{status}'. Reason: '{reason}'
""")
PVPS_TARGET_TITLE = single_line_message("""
	Plesk in VPS
""")