Find and replace text in files (sed)
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/files/replace"
payload = {
"files": ["<string>"],
"pattern": "<string>",
"replacement": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/files/replace \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
"<string>"
],
"pattern": "<string>",
"replacement": "<string>"
}
'{
"replacements": 123,
"files_modified": 123,
"files_skipped": 123,
"binary_files_skipped": 123
}Files
Find and replace text in files (sed)
POST
/
v1
/
machines
/
{id}
/
files
/
replace
Find and replace text in files (sed)
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/files/replace"
payload = {
"files": ["<string>"],
"pattern": "<string>",
"replacement": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/files/replace \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
"<string>"
],
"pattern": "<string>",
"replacement": "<string>"
}
'{
"replacements": 123,
"files_modified": 123,
"files_skipped": 123,
"binary_files_skipped": 123
}Authorizations
API key passed as Bearer token
Path Parameters
Machine ID (e.g. mch_a1b2c3d4)
Body
application/json