Skip to content

Commit 08fcd9a

Browse files
authored
Proof-read Readme.md
1 parent 7407695 commit 08fcd9a

File tree

1 file changed

+52
-90
lines changed

1 file changed

+52
-90
lines changed

README.md

Lines changed: 52 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## EasyMorph Server .NET SDK
22

3-
This library allows you to interact with EasyMorph Server from a .NET application.
3+
This library allows interacting with [EasyMorph Server](https://easymorph.com/server.html) from a .NET application.
44

55

6-
**EasyMorph Server** runs on schedule projects created using desktop editions of EasyMorph (including the **free edition**). Project schedule and parameters are set up via Task properties. Every Task belongs to a Space. The Server has at least one Space named `Default`.
6+
EasyMorph Server runs on schedule projects created using desktop editions of EasyMorph (including the free edition). Project schedule and parameters are set up via task properties. Every task belongs to a space. The Server has at least one space named `Default`.
77

88

99
This document describes SDK which covers part of REST API v1 ( `http://[host:port]/api/v1/`).
@@ -16,50 +16,50 @@ This document describes SDK which covers part of REST API v1 ( `http://[host:por
1616
* Linux (.NET Standard 2.0 compatible framework required)
1717

1818
#### Download
19-
The .NET SDK can be installed as a Nuget package from [ nuget EasyMorph.Server.SDK](https://www.nuget.org/packages/EasyMorph.Server.SDK)
19+
The .NET SDK can be installed as a [NuGet package EasyMorph.Server.SDK](https://www.nuget.org/packages/EasyMorph.Server.SDK)
2020

2121
#### Introduction
2222

23-
To create an Api client, you have to provide the server host to the constructor:
23+
To create an API client, you have to provide the server host to the constructor:
2424
``` C#
2525
using Morph.Server.Sdk.Client;
2626
...
2727
var apiUri = new Uri("http://192.168.1.1:6330");
2828
var client = new MorphServerApiClient(apiUri);
2929
```
3030

31-
All commands are async.
32-
Every command may raise an exception. You must take care to handle exceptions in a right way. EasyMorph Server SDK also has own exceptions, they are described in corresponding sections.
31+
All commands are asynchronous.
32+
Every command may raise an exception. You must take care to handle exceptions in the right way. EasyMorph Server SDK also has its own exceptions. They are described in the corresponding sections.
3333

34-
**Spaces**. Workspace is splitted into several Spaces. Each space has its own security restrictions. Space contains Tasks and Files.
35-
There is at least one predefined space named `Default`.
34+
**Spaces**. EasyMorph Server may have one or several *spaces*. Each space has its own security restrictions. A space contains tasks and files.
35+
There is at least one predefined space named `Default` that cannot be deleted.
3636

3737
Space names are case-insensitive.
3838

3939
#### Sessions and Authentication
40-
Server Space can use one of the authentication method (User access restriction):
40+
Server Space can use one of the following authentication methods (user access restriction):
4141
* Anonymous (No restriction)
4242
* Space Password
4343
* Windows Authentication
4444

4545

46-
Accessing to any Space resource requires a valid ```ApiSession``` entity. Basically, there are two types of session: anonymous and a real one.
47-
* *Anonymous* - just contain a Space name, isn't really opening.
48-
Anonymous session is valid to access spaces with no protection.
49-
* *Real session* - session is actually created at the Server when user sends a valid credentials.
50-
It is automatically renewed each time when session used to interact with Server.
51-
Session is valid for a limited period of time and may be closed by inactivity or manually.
46+
Accessing any Space resource requires a valid ```ApiSession``` entity. Basically, there are two types of sessions: anonymous and real.
47+
* *Anonymous* session just contains a Space name and isn't really opened.
48+
An anonymous session is used to access spaces with no protection.
49+
* *Real session* is a session that is actually created in Server when a user sends valid credentials.
50+
It is automatically renewed each time when the session is used to interact with the Server.
51+
A session is valid for a limited period of time and can be closed either manually or automatically due to inactivity.
5252

5353

54-
```MorphServerApiClient``` able to detect required authentication method automatically.
54+
```MorphServerApiClient``` is able to detect the required authentication method automatically.
5555

56-
This sample shows how to construct client, open session, get data, close session and dispose client:
56+
This sample shows how to construct a client, open a session, get data, close the session, and dispose the client:
5757

5858
``` C#
5959
OpenSessionRequest openSessionRequest = new OpenSessionRequest
6060
{
6161
SpaceName = "space name", // Space name, required.
62-
Password = password // optinal property, required only when accessing a Password Protected Space.
62+
Password = password // optional property, required only when accessing a Password Protected Space.
6363
};
6464

6565
var apiUri = new Uri("http://192.168.1.1:6330");
@@ -72,21 +72,21 @@ This sample shows how to construct client, open session, get data, close session
7272
}
7373

7474
```
75-
Session opening requires some handshaking with the Server which is performed by a series of requests to the Server.
75+
Opening a session requires handshaking with the Server. It is performed by a series of requests to the Server.
7676

7777
Passing wrong credentials will throw `MorphApiUnauthorizedException`.
7878

79-
To close session, call ```apiSession.Dispose()``` or ```.CloseSessionAsync()``` method.
80-
Don't forget to dispose ```MorphServerApiClient```, if it's no more required.
79+
To close a session, call ```apiSession.Dispose()``` or ```.CloseSessionAsync()``` method.
80+
Don't forget to dispose ```MorphServerApiClient```, if it's no longer required.
8181

8282
To configure ```MorphServerApiClient``` use ```ClientConfiguration``` in ```MorphServerApiClient``` or use ```MorphServerApiClientGlobalConfig``` for global configuration.
8383

84-
Pay attention, that setting ```ClientConfiguration.AutoDisposeClientOnSessionClose``` to true will cause ```apiClient``` disposal on session close.
84+
Pay attention, that setting ```ClientConfiguration.AutoDisposeClientOnSessionClose``` to true will cause ```apiClient``` disposal on session closing.
8585

8686

8787
### Spaces API
8888
##### List of all spaces
89-
This method returns an entire list of all Server Spaces.
89+
This method returns a list of all Server Spaces.
9090
``` C#
9191
var result = await apiClient.GetSpacesListAsync(cancellationToken);
9292
foreach(space in result.Items){
@@ -97,16 +97,16 @@ This method returns an entire list of all Server Spaces.
9797

9898

9999
##### Space status
100-
Returns a short info for the Server Space and current user permissions.
100+
Returns short info for the current Server space and current user permissions.
101101
``` C#
102102
var spaceStaus = await apiClient.GetSpaceStatusAsync(apiSession, cancellationToken);
103103
```
104104

105105
### Tasks API
106106
Accessing tasks requires a valid ```apiSession```.
107107

108-
Assume that you have already created the task in space 'Default'. For these samples task id is `691ea42e-9e6b-438e-84d6-b743841c970e`.
109-
Also assume, that you have read Sessions section and know how to open a session.
108+
For the examples below, let's assume that you have already created a task in the 'Default' space, and the task ID is `691ea42e-9e6b-438e-84d6-b743841c970e`.
109+
Also, let's assume that you have read the "Sessions and Authentication" section above and know how to open a session.
110110

111111
##### Tasks list
112112

@@ -122,7 +122,7 @@ To get a list of tasks in Space, use ```GetTasksListAsync```.
122122
}
123123
}
124124
```
125-
If you want to get more details about a task (e.g. task parameters) use `GetTaskAsync` method.
125+
If you want to get more details about a task (e.g. task parameters), use the `GetTaskAsync` method.
126126

127127
##### Enabling/ disabling tasks
128128

@@ -149,7 +149,7 @@ To run the task:
149149
var result2 = await apiClient.StartTaskAsync(apiSession,
150150
new StartTaskRequest { TaskId = taskId, TaskParameters = taskParameters }, cancellationToken);
151151
```
152-
Caller gets control back immediately after the task initialized to start. If the task is already running, no exception is generated.
152+
The caller gets control back immediately after the task is started. If you attempt to start a task that is already running, no exception is generated.
153153

154154

155155
##### Stopping the Task
@@ -160,10 +160,10 @@ To stop the task, call ```StopTaskAsync```:
160160
var taskGuid = Guid.Parse("691ea42e-9e6b-438e-84d6-b743841c970e");
161161
await client.StopTaskAsync(apiSession, taskGuid, cancellationToken );
162162
```
163-
Caller gets control back immediately after the task is marked to stop.
163+
The caller gets control back immediately after the task is instructed to stop.
164164

165165
#### Retrieving task info
166-
Allows to get a task info (including info about the task parameters)
166+
Allows to get the task info (including the task parameters)
167167
``` C#
168168
try {
169169
var taskGuid = Guid.Parse("691ea42e-9e6b-438e-84d6-b743841c970e");
@@ -195,7 +195,7 @@ Allows to get a task info (including info about the task parameters)
195195

196196
#### Retrieving task status
197197

198-
To check task state (running/ not running / failed) and to retrieve task errors, call `GetTaskStatusAsync`:
198+
To check the task state (running/ not running / failed) and to retrieve task errors, call `GetTaskStatusAsync`:
199199

200200
``` C#
201201
try
@@ -217,11 +217,11 @@ To check task state (running/ not running / failed) and to retrieve task errors,
217217

218218
### Files API
219219

220-
EasyMorph Server API allows to access Server Space files remotely.
220+
The EasyMorph Server API allows accessing files of a Server space remotely.
221221

222222

223223
##### Browsing files
224-
To browse files and folders use `SpaceBrowseAsync`.
224+
To browse files and folders, use `SpaceBrowseAsync`.
225225

226226

227227
``` C#
@@ -262,18 +262,18 @@ To browse files and folders use `SpaceBrowseAsync`.
262262

263263
```
264264

265-
* `Folder` and `Files` contains folder and files details in the `folderPath` of Space `spaceName`.
265+
`Folder` and `Files` contain folder and file details in the `folderPath` of space `spaceName`.
266266

267267

268268

269-
Consider, that there is Folder 1 in space Default. *Folder 1* has nested Folder 2.
270-
So to browse Folder 2 you can call:
269+
Consider that there is "Folder 1" in space "Default". "Folder 1" has the nested "Folder 2".
270+
To browse "Folder 2", you can call:
271271

272272
``` C#
273273
OpenSessionRequest openSessionRequest = new OpenSessionRequest
274274
{
275275
SpaceName = "Default", // Space name, required.
276-
Password = password // optinal property, required only when accessing a Password Protected Space.
276+
Password = password // optional property, required only when accessing a Password Protected Space.
277277
};
278278

279279
var apiUri = new Uri("http://192.168.1.1:6330");
@@ -289,7 +289,7 @@ So to browse Folder 2 you can call:
289289

290290
##### Upload stream
291291

292-
To upload a data stream call `SpaceUploadDataStreamAsync`.
292+
To upload a data stream, call `SpaceUploadDataStreamAsync`.
293293

294294
``` C#
295295

@@ -334,11 +334,11 @@ To upload a data stream call `SpaceUploadDataStreamAsync`.
334334

335335
SpaceUploadContiniousStreamingAsync
336336

337-
Please consider that currently such kind of errors (file already exists, folder not found) are generated only AFTER entire request was sent to the server.
337+
Note that currently, such kind of errors (file already exists, folder not found) is generated only AFTER the entire request was sent to the Server.
338338

339-
It will be a good approach to check if a file/folder exists and you have appropriate permissions before sending huge files over a slow Internet connection. To do this, use `SpaceBrowseAsync`, `FileExistsAsync`.
339+
It will be a good idea to check if a file/folder exists and you have appropriate permissions before sending huge files over a slow internet connection. To do this, use `SpaceBrowseAsync`, `FileExistsAsync`.
340340

341-
To display a progress changes while a large files are uploaded subscribe to the `OnDataUploadProgress` event.
341+
To display progress changes while large files are uploaded, subscribe to the `OnDataUploadProgress` event.
342342

343343

344344

@@ -363,7 +363,7 @@ Use ```SpaceOpenDataStreamAsync``` to get a file content as a Stream.
363363
```
364364

365365

366-
To display a progress changes while a large files are downloaded subscribe to the `OnDataDownloadProgress` event.
366+
To display progress changes while large files are downloading, subscribe to the `OnDataDownloadProgress` event.
367367

368368

369369

@@ -382,7 +382,7 @@ Use ```DataTransferUtility.SpaceDownloadFileIntoFileAsync``` or ```DataTransferU
382382

383383
##### Check that file exists
384384

385-
You can check that the file exists by calling ```SpaceFileExistsAsync``` or by using `SpaceBrowseAsync`:
385+
You can check that a file exists by calling ```SpaceFileExistsAsync``` or by using `SpaceBrowseAsync`:
386386
``` C#
387387

388388
var listing = await apiClient.BrowseSpaceAsync(apiSession, "Folder 1/Folder 2",cancellationToken);
@@ -408,11 +408,11 @@ To remove the file use ```SpaceDeleteFileAsync``` method:
408408

409409
### Commands API
410410

411-
##### Task Validation
411+
##### Task validation
412412
You can check tasks for missing parameters.
413-
E.g a task has parameters that the project (used by the task) doesn't contain. It is useful to call this method right after the project has been uploaded to the Server.
413+
E.g. a task has parameters that the project (used by the task) doesn't contain. It is useful to call this method right after the project has been uploaded to the Server.
414414

415-
For now, there is no way to validate a project *before* upload.
415+
For now, there is no way to validate a project *before* uploading.
416416

417417
``` C#
418418

@@ -427,60 +427,22 @@ if(result.FailedTasks.Count !=0 ){
427427
```
428428

429429
### Exceptions
430-
Morph.Server.SDK may raise own exceptions like `MorphApiNotFoundException` if a resource not found, or `ParseResponseException` if it is not possible to parse server response.
431-
A full list of exceptions can be found in `Morph.Server.Sdk.Exceptions` namespace.
430+
Morph.Server.SDK may raise its own exceptions like `MorphApiNotFoundException` if a resource is not found or `ParseResponseException` if it is not possible to parse Server response.
431+
A full list of exceptions can be found in the `Morph.Server.Sdk.Exceptions` namespace.
432432

433433
### SSL
434-
We advise you to use SSL with EasyMorph Server with a trusted SSL certificate.
434+
We recommend configuring EasyMorph Server to use SSL with a trusted SSL certificate.
435435

436436
If you want to use a self-signed certificate, you need to handle this situation in your code.
437437

438-
In such case you should to setup a validation callback: https://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.servercertificatevalidationcallback
439-
440-
One of the possible solutions can be found at the stackoverflow: https://stackoverflow.com/a/526803/692329
441-
442-
**disclaimer:** use any kind of the self-signed certificates and security policy suppression are at your own risk. We highly DO NOT RECOMMEND doing this.
438+
In such a case, you should setup a validation callback: https://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.servercertificatevalidationcallback.
443439

440+
One of the possible solutions can be found at the StackOverflow: https://stackoverflow.com/a/526803/692329.
444441

442+
**Disclaimer:** use any kind of self-signed certificates and security policy suppression at your own risk. We highly DO NOT RECOMMEND doing this.
445443

446444

447445

448446
## License
449447

450448
**Morph.Server.SDK** is licensed under the [MIT license](https://github.com/easymorph/server-sdk/blob/master/LICENSE).
451-
452-
453-
454-
455-
456-
457-
458-
459-
460-
461-
462-
463-
464-
465-
466-
467-
468-
469-
470-
471-
472-
473-
474-
475-
476-
477-
478-
479-
480-
481-
482-
483-
484-
485-
486-

0 commit comments

Comments
 (0)