Write files of a website
Up to 50 files written into the folder of a website of a web hosting package, all or none.
manitu_webhosting_web_file_write on https://mcp.manitu.de/mcpAnnotations as tools/list sends them
Description for the model
Writes files into the folder of a website of a web hosting package of the manitu customer account this connection works in, by site_id and fqdn: file_list with up to 50 files, 512 KB together - all written, or none. Before the first write in a conversation, call manitu_webhosting_web_file_guide_get and follow it. mode create (default) for a new file; mode replace for an existing one, with if_match = its sha256 from manitu_webhosting_web_file_get or manitu_webhosting_web_file_list - never guess it; a file changed since is refused (if_match_failed), read it again. mode overwrite replaces whatever is there without a check and cannot be undone - only when the customer explicitly asks to replace the existing files. Folders that are not there are created (create_parents, default true). PHP, .htaccess and .user.ini may be written (is_active_content) - they run on the website. dry_run checks everything and writes nothing. Refused with E2002 per item (/file_list/<n>/path: exists, not_found, path_invalid ...) - then nothing is written - or a conflict (quota_almost_exceeded, quota_exceeded, permission_denied, limit_reached, not_configurable). Tell the customer which files of which website change, and ask for an explicit yes first.
Arguments
site_idinteger | stringrequiredThe site_id from manitu_webhosting_list - never guess one.
fqdnstringrequiredThe website from manitu_webhosting_web_vhost_list, e.g. www.example.de - the paths are relative to its folder. Never guess one.
file_listarray of objectrequiredThe files.
file_list[].pathstringrequiredThe file. Below the website's folder, as the answers write it: a file "/index.php" or "/css/style.css", a folder "/css/" ("/" the website's folder). Names: letters, digits and . _ - + = @, no leading dot - except .htaccess, .user.ini and the folder .well-known.
file_list[].contentstringrequiredThe whole content - as text, or base64 with encoding base64.
file_list[].encodingstringtext (default; UTF-8, written as given) or base64 (any bytes, e.g. an image).
file_list[].modestringcreate (default): a new file; replace: an existing one, with if_match; overwrite: created or replaced without a check - only when the customer asks for it.
file_list[].if_matchstringFor replace (only): the sha256 of the file as it was read.
create_parentsbooleanCreate folders that are not there (default true).
dry_runbooleanCheck everything, write nothing (default false).
Result structuredContent, checked against the schema
fqdnstringrequireddry_runbooleanrequiredis_completebooleanrequiredEvery file was written (false for a dry run) - false otherwise: see status.
result_listarray of objectrequiredresult_list[].pathstringrequiredresult_list[].statusstringrequiredwould_*: a dry run.
result_list[].sha256_beforestring | nullrequiredOf the file replaced - null for a new one, or one overwrite could not read.
result_list[].sha256_afterstringrequiredOf the content written - if_match for the next replace.
result_list[].sizeintegerrequiredBytes.
result_list[].is_active_contentbooleanrequiredRun by the web server (PHP, CGI) or changing how it runs (.htaccess, .user.ini).
Authentication
One of X-API-Key, Authorization: Bearer … - never more than one in a request. More
Request body JSON; unknown fields are refused
site_idinteger | stringrequiredThe site_id from manitu_webhosting_list - never guess one.
fqdnstringrequiredThe website from manitu_webhosting_web_vhost_list, e.g. www.example.de - the paths are relative to its folder. Never guess one.
file_listarray of objectrequiredThe files.
file_list[].pathstringrequiredThe file. Below the website's folder, as the answers write it: a file "/index.php" or "/css/style.css", a folder "/css/" ("/" the website's folder). Names: letters, digits and . _ - + = @, no leading dot - except .htaccess, .user.ini and the folder .well-known.
file_list[].contentstringrequiredThe whole content - as text, or base64 with encoding base64.
file_list[].encodingstringtext (default; UTF-8, written as given) or base64 (any bytes, e.g. an image).
file_list[].modestringcreate (default): a new file; replace: an existing one, with if_match; overwrite: created or replaced without a check - only when the customer asks for it.
file_list[].if_matchstringFor replace (only): the sha256 of the file as it was read.
create_parentsbooleanCreate folders that are not there (default true).
dry_runbooleanCheck everything, write nothing (default false).
Response in data; the rest of the body as on every call
fqdnstringrequireddry_runbooleanrequiredis_completebooleanrequiredEvery file was written (false for a dry run) - false otherwise: see status.
result_listarray of objectrequiredresult_list[].pathstringrequiredresult_list[].statusstringrequiredwould_*: a dry run.
result_list[].sha256_beforestring | nullrequiredOf the file replaced - null for a new one, or one overwrite could not read.
result_list[].sha256_afterstringrequiredOf the content written - if_match for the next replace.
result_list[].sizeintegerrequiredBytes.
result_list[].is_active_contentbooleanrequiredRun by the web server (PHP, CGI) or changing how it runs (.htaccess, .user.ini).
Statuses
200Success.400The request does not match the declared input schema.401No credential was presented, or it was not recognised.403The credential is not permitted to use this operation.500The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.503The channel this operation forwards through is unavailable.