Skip to content
Permalink
Browse files

util/messages: tweaking comments

  • Loading branch information...
haraldschilly committed Aug 23, 2019
1 parent ff5c47e commit 39d8cd867c165a9ea042378b0922b05ee23ccda6
Showing with 30 additions and 23 deletions.
  1. +30 −23 src/smc-util/message.js
@@ -1113,18 +1113,20 @@ API(
}
},
desc: `\
Read a text file in the project whose id is supplied.
User must be owner or collaborator in the target project.
Argument 'path' is relative to home directory in target project.
Unix user in the target project must have permissions to read file
and containing directories if they do not already exist.
Read a text file in the project whose \`project_id\` is supplied.
Argument \`'path'\` is relative to home directory in target project.
You can also read multiple project_id/path's at once by
making project_id and path arrays (of the same length).
You can also read multiple \`project_id\`/\`path\`'s at once by
making \`project_id\` and \`path\` arrays (of the same length).
In that case, the result will be an array
of {project_id, path, content} objects, in some
random order. If there is an error reading a particular
file, instead {project_id, path, error} is included.
of \`{project_id, path, content}\` objects, in some random order.
If there is an error reading a particular file,
instead \`{project_id, path, error}\` is included.
**Note:** You need to have read access to the project,
the Linux user \`user\` in the target project must have permissions to read the file
and containing directories.
Example:
@@ -1189,13 +1191,14 @@ API(
}
},
desc: `\
Create a text file in the target project.
User must be owner or collaborator in the target project.
Create a text file in the target project with the given \`project_id\`.
Directories containing the file are created if they do not exist already.
Unix user in the target project must have permissions to create file
and containing directories if they do not already exist.
If a file already exists at the destination path, it is overwritten.
**Note:** You need to have read access to the project.
The Linux user \`user\` in the target project must have permissions to create files
and containing directories if they do not already exist.
Example:
Create a text file.
@@ -1752,25 +1755,28 @@ API(
},
desc: `\
Copy a file or directory from one project to another.
User must be owner or collaborator on both projects.
Note: the \`timeout\` option is passed to a call to the \`rsync\` command.
**Note:** the \`timeout\` option is passed to a call to the \`rsync\` command.
If no data is transferred for the specified number of seconds, then
the copy terminates. The default is 0, which means no timeout.
Relative paths (paths not beginning with '/') are relative to the user's
home directory in source and target projects.
**Note:** You need to have read/write access to the associated src/target project.
Further options:
- \`wait_until_done\`: set this to false to immediately retrieve the \`copy_path_id\`.
This is the **recommended way** to use this ednpoint,
This is the **recommended way** to use this endpoint,
because a blocking request might time out and you'll never learn about outcome of the copy operation.
Learn about the status (success or failure, including an error message) via the :doc:\`copy_path_status\` endpoint.
- \`scheduled\`: set this to a date in the future or postpone the copy operation.
Suiteable timestamps are created for example like that:
Suitable timestamps can be created as follows:
- Bash: 1 minute in the future \`date -d '+1 minute' --utc +'%Y-%m-%dT%H:%M:%S'\`
- Python using [arrow](https://arrow.readthedocs.io/en/latest/) library: \`arrow.now('UTC').shift(minutes=+1).for_json()\`
- Python using [arrow](https://arrow.readthedocs.io/en/latest/) library:
- 1 minute in the future: \`arrow.now('UTC').shift(minutes=+1).for_json()\`
- At a specific time: \`arrow.get("2019-08-29 22:00").for_json()\`
Later, learn about its outcome via :doc:\`copy_path_status\` as well.
Example:
@@ -2098,7 +2104,7 @@ Attempt to read a file which is not public.
-d path=Private/hello.txt
https://cocalc.com/api/v1/public_get_text_file
==> {"event":"error","id":"0288b7d0-dda9-4895-87ba-aa71929b2bfb",
"error":"path 'Private/hello.txt' of project with id 'e49e86aa-192f-410b-8269-4b89fd934fba' is not public"}+
"error":"path 'Private/hello.txt' of project with id 'e49e86aa-192f-410b-8269-4b89fd934fba' is not public"}
\`\`\`\
`
})
@@ -2157,13 +2163,14 @@ API(
}
},
desc: `\
Copy a file or directory from public project to a project for which the
user is owner or collaborator.
Copy a file or directory from a public project to a target project.
Note: the \`timeout\` option is passed to a call to the \`rsync\` command.
**Note:** the \`timeout\` option is passed to a call to the \`rsync\` command.
If no data is transferred for the specified number of seconds, then
the copy terminates. The default is 0, which means no timeout.
**Note:** You need to have write access to the target project.
Example:
Copy public file \`PUBLIC/doc.txt\` from source project to private file

0 comments on commit 39d8cd8

Please sign in to comment.
You can’t perform that action at this time.