You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-90Lines changed: 52 additions & 90 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
## EasyMorph Server .NET SDK
2
2
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.
4
4
5
5
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`.
7
7
8
8
9
9
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
16
16
* Linux (.NET Standard 2.0 compatible framework required)
17
17
18
18
#### 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)
20
20
21
21
#### Introduction
22
22
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:
24
24
```C#
25
25
usingMorph.Server.Sdk.Client;
26
26
...
27
27
varapiUri=newUri("http://192.168.1.1:6330");
28
28
varclient=newMorphServerApiClient(apiUri);
29
29
```
30
30
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.
33
33
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.
36
36
37
37
Space names are case-insensitive.
38
38
39
39
#### 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):
41
41
* Anonymous (No restriction)
42
42
* Space Password
43
43
* Windows Authentication
44
44
45
45
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.
52
52
53
53
54
-
```MorphServerApiClient``` able to detect required authentication method automatically.
54
+
```MorphServerApiClient```is able to detect the required authentication method automatically.
55
55
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:
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.
63
63
};
64
64
65
65
varapiUri=newUri("http://192.168.1.1:6330");
@@ -72,21 +72,21 @@ This sample shows how to construct client, open session, get data, close session
72
72
}
73
73
74
74
```
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.
76
76
77
77
Passing wrong credentials will throw `MorphApiUnauthorizedException`.
78
78
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.
81
81
82
82
To configure ```MorphServerApiClient``` use ```ClientConfiguration``` in ```MorphServerApiClient``` or use ```MorphServerApiClientGlobalConfig``` for global configuration.
83
83
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.
85
85
86
86
87
87
### Spaces API
88
88
##### List of all spaces
89
-
This method returns an entire list of all Server Spaces.
Accessing tasks requires a valid ```apiSession```.
107
107
108
-
Assume that you have already created the task in space 'Default'. For these samples task id is `691ea42e-9e6b-438e-84d6-b743841c970e`.
109
-
Alsoassume, 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.
110
110
111
111
##### Tasks list
112
112
@@ -122,7 +122,7 @@ To get a list of tasks in Space, use ```GetTasksListAsync```.
122
122
}
123
123
}
124
124
```
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.
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.
277
277
};
278
278
279
279
varapiUri=newUri("http://192.168.1.1:6330");
@@ -289,7 +289,7 @@ So to browse Folder 2 you can call:
289
289
290
290
##### Upload stream
291
291
292
-
To upload a data stream call `SpaceUploadDataStreamAsync`.
292
+
To upload a data stream, call `SpaceUploadDataStreamAsync`.
293
293
294
294
```C#
295
295
@@ -334,11 +334,11 @@ To upload a data stream call `SpaceUploadDataStreamAsync`.
334
334
335
335
SpaceUploadContiniousStreamingAsync
336
336
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.
338
338
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`.
340
340
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.
342
342
343
343
344
344
@@ -363,7 +363,7 @@ Use ```SpaceOpenDataStreamAsync``` to get a file content as a Stream.
363
363
```
364
364
365
365
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.
367
367
368
368
369
369
@@ -382,7 +382,7 @@ Use ```DataTransferUtility.SpaceDownloadFileIntoFileAsync``` or ```DataTransferU
382
382
383
383
##### Check that file exists
384
384
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`:
@@ -408,11 +408,11 @@ To remove the file use ```SpaceDeleteFileAsync``` method:
408
408
409
409
### Commands API
410
410
411
-
##### Task Validation
411
+
##### Task validation
412
412
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.
414
414
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.
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.
432
432
433
433
### 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.
435
435
436
436
If you want to use a self-signed certificate, you need to handle this situation in your code.
437
437
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.
443
439
440
+
One of the possible solutions can be found at the StackOverflow: https://stackoverflow.com/a/526803/692329.
444
441
442
+
**Disclaimer:** use any kind of self-signed certificates and security policy suppression at your own risk. We highly DO NOT RECOMMEND doing this.
445
443
446
444
447
445
448
446
## License
449
447
450
448
**Morph.Server.SDK** is licensed under the [MIT license](https://github.com/easymorph/server-sdk/blob/master/LICENSE).
0 commit comments