@devopness/sdk-js 2.60.0 → 2.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,12 @@ export declare class ServersApiService extends ApiBaseService {
25
25
  * @param {number} serverId The ID of the server.
26
26
  */
27
27
  connectServer(activationToken: string, serverId: number): Promise<ApiResponse<string>>;
28
+ /**
29
+ *
30
+ * @summary Delete a given server
31
+ * @param {number} serverId The ID of the server.
32
+ */
33
+ deleteServer(serverId: number): Promise<ApiResponse<void>>;
28
34
  /**
29
35
  *
30
36
  * @summary Get a server by ID
@@ -37,6 +43,30 @@ export declare class ServersApiService extends ApiBaseService {
37
43
  * @param {number} serverId The ID of the server.
38
44
  */
39
45
  getServerCommands(serverId: number): Promise<ApiResponse<ServerCommand>>;
46
+ /**
47
+ *
48
+ * @summary Get current status of the server on the cloud provider
49
+ * @param {number} serverId The ID of the server.
50
+ */
51
+ getStatusServer(serverId: number): Promise<ApiResponse<void>>;
52
+ /**
53
+ *
54
+ * @summary Restart a current running server
55
+ * @param {number} serverId The ID of the server.
56
+ */
57
+ restartServer(serverId: number): Promise<ApiResponse<void>>;
58
+ /**
59
+ *
60
+ * @summary Start a previously stopped server
61
+ * @param {number} serverId The ID of the server.
62
+ */
63
+ startServer(serverId: number): Promise<ApiResponse<void>>;
64
+ /**
65
+ *
66
+ * @summary Stop a running server
67
+ * @param {number} serverId The ID of the server.
68
+ */
69
+ stopServer(serverId: number): Promise<ApiResponse<void>>;
40
70
  /**
41
71
  *
42
72
  * @summary Update an existing server
@@ -49,6 +49,22 @@ class ServersApiService extends ApiBaseService_1.ApiBaseService {
49
49
  return new ApiResponse_1.ApiResponse(response);
50
50
  });
51
51
  }
52
+ /**
53
+ *
54
+ * @summary Delete a given server
55
+ * @param {number} serverId The ID of the server.
56
+ */
57
+ deleteServer(serverId) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ if (serverId === null || serverId === undefined) {
60
+ throw new Exceptions_1.ArgumentNullException('serverId', 'deleteServer');
61
+ }
62
+ let queryString = '';
63
+ const requestUrl = '/servers/{server_id}' + (queryString ? `?${queryString}` : '');
64
+ const response = yield this.delete(requestUrl.replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
65
+ return new ApiResponse_1.ApiResponse(response);
66
+ });
67
+ }
52
68
  /**
53
69
  *
54
70
  * @summary Get a server by ID
@@ -81,6 +97,70 @@ class ServersApiService extends ApiBaseService_1.ApiBaseService {
81
97
  return new ApiResponse_1.ApiResponse(response);
82
98
  });
83
99
  }
100
+ /**
101
+ *
102
+ * @summary Get current status of the server on the cloud provider
103
+ * @param {number} serverId The ID of the server.
104
+ */
105
+ getStatusServer(serverId) {
106
+ return __awaiter(this, void 0, void 0, function* () {
107
+ if (serverId === null || serverId === undefined) {
108
+ throw new Exceptions_1.ArgumentNullException('serverId', 'getStatusServer');
109
+ }
110
+ let queryString = '';
111
+ const requestUrl = '/servers/{server_id}/get-status' + (queryString ? `?${queryString}` : '');
112
+ const response = yield this.post(requestUrl.replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
113
+ return new ApiResponse_1.ApiResponse(response);
114
+ });
115
+ }
116
+ /**
117
+ *
118
+ * @summary Restart a current running server
119
+ * @param {number} serverId The ID of the server.
120
+ */
121
+ restartServer(serverId) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ if (serverId === null || serverId === undefined) {
124
+ throw new Exceptions_1.ArgumentNullException('serverId', 'restartServer');
125
+ }
126
+ let queryString = '';
127
+ const requestUrl = '/servers/{server_id}/restart' + (queryString ? `?${queryString}` : '');
128
+ const response = yield this.post(requestUrl.replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
129
+ return new ApiResponse_1.ApiResponse(response);
130
+ });
131
+ }
132
+ /**
133
+ *
134
+ * @summary Start a previously stopped server
135
+ * @param {number} serverId The ID of the server.
136
+ */
137
+ startServer(serverId) {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ if (serverId === null || serverId === undefined) {
140
+ throw new Exceptions_1.ArgumentNullException('serverId', 'startServer');
141
+ }
142
+ let queryString = '';
143
+ const requestUrl = '/servers/{server_id}/start' + (queryString ? `?${queryString}` : '');
144
+ const response = yield this.post(requestUrl.replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
145
+ return new ApiResponse_1.ApiResponse(response);
146
+ });
147
+ }
148
+ /**
149
+ *
150
+ * @summary Stop a running server
151
+ * @param {number} serverId The ID of the server.
152
+ */
153
+ stopServer(serverId) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ if (serverId === null || serverId === undefined) {
156
+ throw new Exceptions_1.ArgumentNullException('serverId', 'stopServer');
157
+ }
158
+ let queryString = '';
159
+ const requestUrl = '/servers/{server_id}/stop' + (queryString ? `?${queryString}` : '');
160
+ const response = yield this.post(requestUrl.replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
161
+ return new ApiResponse_1.ApiResponse(response);
162
+ });
163
+ }
84
164
  /**
85
165
  *
86
166
  * @summary Update an existing server
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devopness/sdk-js",
3
- "version": "2.60.0",
3
+ "version": "2.61.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },