@alicloud/emr-serverless-spark20230808 2.0.0 → 2.1.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.
package/src/client.ts CHANGED
@@ -1179,6 +1179,89 @@ export default class Client extends OpenApi {
1179
1179
  return await this.createWorkspaceWithOptions(request, headers, runtime);
1180
1180
  }
1181
1181
 
1182
+ /**
1183
+ * Creates a workspace queue.
1184
+ *
1185
+ * @param request - CreateWorkspaceQueueRequest
1186
+ * @param headers - map
1187
+ * @param runtime - runtime options for this request RuntimeOptions
1188
+ * @returns CreateWorkspaceQueueResponse
1189
+ */
1190
+ async createWorkspaceQueueWithOptions(request: $_model.CreateWorkspaceQueueRequest, headers: {[key: string ]: string}, runtime: $dara.RuntimeOptions): Promise<$_model.CreateWorkspaceQueueResponse> {
1191
+ request.validate();
1192
+ let query : {[key: string ]: any} = { };
1193
+ if (!$dara.isNull(request.regionId)) {
1194
+ query["regionId"] = request.regionId;
1195
+ }
1196
+
1197
+ let body : {[key: string ]: any} = { };
1198
+ if (!$dara.isNull(request.description)) {
1199
+ body["description"] = request.description;
1200
+ }
1201
+
1202
+ if (!$dara.isNull(request.gpuSpec)) {
1203
+ body["gpuSpec"] = request.gpuSpec;
1204
+ }
1205
+
1206
+ if (!$dara.isNull(request.instanceId)) {
1207
+ body["instanceId"] = request.instanceId;
1208
+ }
1209
+
1210
+ if (!$dara.isNull(request.paymentType)) {
1211
+ body["paymentType"] = request.paymentType;
1212
+ }
1213
+
1214
+ if (!$dara.isNull(request.preheat)) {
1215
+ body["preheat"] = request.preheat;
1216
+ }
1217
+
1218
+ if (!$dara.isNull(request.queueCategory)) {
1219
+ body["queueCategory"] = request.queueCategory;
1220
+ }
1221
+
1222
+ if (!$dara.isNull(request.resourceSpec)) {
1223
+ body["resourceSpec"] = request.resourceSpec;
1224
+ }
1225
+
1226
+ if (!$dara.isNull(request.workspaceId)) {
1227
+ body["workspaceId"] = request.workspaceId;
1228
+ }
1229
+
1230
+ if (!$dara.isNull(request.workspaceQueueName)) {
1231
+ body["workspaceQueueName"] = request.workspaceQueueName;
1232
+ }
1233
+
1234
+ let req = new $OpenApiUtil.OpenApiRequest({
1235
+ headers: headers,
1236
+ query: OpenApiUtil.query(query),
1237
+ body: OpenApiUtil.parseToMap(body),
1238
+ });
1239
+ let params = new $OpenApiUtil.Params({
1240
+ action: "CreateWorkspaceQueue",
1241
+ version: "2023-08-08",
1242
+ protocol: "HTTPS",
1243
+ pathname: `/api/v1/workspaces/queues`,
1244
+ method: "POST",
1245
+ authType: "AK",
1246
+ style: "ROA",
1247
+ reqBodyType: "json",
1248
+ bodyType: "json",
1249
+ });
1250
+ return $dara.cast<$_model.CreateWorkspaceQueueResponse>(await this.callApi(params, req, runtime), new $_model.CreateWorkspaceQueueResponse({}));
1251
+ }
1252
+
1253
+ /**
1254
+ * Creates a workspace queue.
1255
+ *
1256
+ * @param request - CreateWorkspaceQueueRequest
1257
+ * @returns CreateWorkspaceQueueResponse
1258
+ */
1259
+ async createWorkspaceQueue(request: $_model.CreateWorkspaceQueueRequest): Promise<$_model.CreateWorkspaceQueueResponse> {
1260
+ let runtime = new $dara.RuntimeOptions({ });
1261
+ let headers : {[key: string ]: string} = { };
1262
+ return await this.createWorkspaceQueueWithOptions(request, headers, runtime);
1263
+ }
1264
+
1182
1265
  /**
1183
1266
  * Deletes a Kyuubi gateway.
1184
1267
  *
@@ -0,0 +1,184 @@
1
+ // This file is auto-generated, don't edit it
2
+ import * as $dara from '@darabonba/typescript';
3
+
4
+
5
+ export class CreateWorkspaceQueueRequestResourceSpec extends $dara.Model {
6
+ /**
7
+ * @remarks
8
+ * The maximum workspace resource capacity.
9
+ *
10
+ * @example
11
+ * 1000
12
+ */
13
+ cu?: number;
14
+ /**
15
+ * @remarks
16
+ * The number of GPUs.
17
+ *
18
+ * @example
19
+ * 100
20
+ */
21
+ gpu?: number;
22
+ /**
23
+ * @remarks
24
+ * The number of GPU machines. This parameter is valid only for subscription instances.
25
+ *
26
+ * @example
27
+ * 8
28
+ */
29
+ gpuMachineNum?: number;
30
+ /**
31
+ * @remarks
32
+ * The maximum number of CUs.
33
+ *
34
+ * @example
35
+ * 0.5
36
+ */
37
+ maxCu?: number;
38
+ static names(): { [key: string]: string } {
39
+ return {
40
+ cu: 'cu',
41
+ gpu: 'gpu',
42
+ gpuMachineNum: 'gpuMachineNum',
43
+ maxCu: 'maxCu',
44
+ };
45
+ }
46
+
47
+ static types(): { [key: string]: any } {
48
+ return {
49
+ cu: 'number',
50
+ gpu: 'number',
51
+ gpuMachineNum: 'number',
52
+ maxCu: 'number',
53
+ };
54
+ }
55
+
56
+ validate() {
57
+ super.validate();
58
+ }
59
+
60
+ constructor(map?: { [key: string]: any }) {
61
+ super(map);
62
+ }
63
+ }
64
+
65
+ export class CreateWorkspaceQueueRequest extends $dara.Model {
66
+ /**
67
+ * @remarks
68
+ * The description.
69
+ *
70
+ * @example
71
+ * Ray Cluster for dev.
72
+ */
73
+ description?: string;
74
+ /**
75
+ * @remarks
76
+ * The list of GPU models.
77
+ */
78
+ gpuSpec?: string[];
79
+ /**
80
+ * @remarks
81
+ * The Ray cluster instance ID.
82
+ *
83
+ * @example
84
+ * ray-k7nm8ahl5te4tg91-ey7blpbg
85
+ */
86
+ instanceId?: string;
87
+ /**
88
+ * @remarks
89
+ * The billing method of the instance. Valid values:
90
+ *
91
+ * - PayAsYouGo: pay-as-you-go
92
+ * - Pre: subscription
93
+ *
94
+ * @example
95
+ * PayAsYouGo
96
+ */
97
+ paymentType?: string;
98
+ /**
99
+ * @remarks
100
+ * Indicates whether resource prefetch is enabled.
101
+ */
102
+ preheat?: boolean;
103
+ /**
104
+ * @remarks
105
+ * The queue type. Valid values: CPU and GPU.
106
+ *
107
+ * @example
108
+ * CPU
109
+ */
110
+ queueCategory?: string;
111
+ /**
112
+ * @remarks
113
+ * The resource specifications.
114
+ */
115
+ resourceSpec?: CreateWorkspaceQueueRequestResourceSpec;
116
+ /**
117
+ * @remarks
118
+ * The workspace ID.
119
+ *
120
+ * @example
121
+ * w-975bcfda9625****
122
+ */
123
+ workspaceId?: string;
124
+ /**
125
+ * @remarks
126
+ * The workspace queue name.
127
+ *
128
+ * @example
129
+ * dev_queue
130
+ */
131
+ workspaceQueueName?: string;
132
+ /**
133
+ * @remarks
134
+ * The region ID.
135
+ *
136
+ * @example
137
+ * cn-hangzhou
138
+ */
139
+ regionId?: string;
140
+ static names(): { [key: string]: string } {
141
+ return {
142
+ description: 'description',
143
+ gpuSpec: 'gpuSpec',
144
+ instanceId: 'instanceId',
145
+ paymentType: 'paymentType',
146
+ preheat: 'preheat',
147
+ queueCategory: 'queueCategory',
148
+ resourceSpec: 'resourceSpec',
149
+ workspaceId: 'workspaceId',
150
+ workspaceQueueName: 'workspaceQueueName',
151
+ regionId: 'regionId',
152
+ };
153
+ }
154
+
155
+ static types(): { [key: string]: any } {
156
+ return {
157
+ description: 'string',
158
+ gpuSpec: { 'type': 'array', 'itemType': 'string' },
159
+ instanceId: 'string',
160
+ paymentType: 'string',
161
+ preheat: 'boolean',
162
+ queueCategory: 'string',
163
+ resourceSpec: CreateWorkspaceQueueRequestResourceSpec,
164
+ workspaceId: 'string',
165
+ workspaceQueueName: 'string',
166
+ regionId: 'string',
167
+ };
168
+ }
169
+
170
+ validate() {
171
+ if(Array.isArray(this.gpuSpec)) {
172
+ $dara.Model.validateArray(this.gpuSpec);
173
+ }
174
+ if(this.resourceSpec && typeof (this.resourceSpec as any).validate === 'function') {
175
+ (this.resourceSpec as any).validate();
176
+ }
177
+ super.validate();
178
+ }
179
+
180
+ constructor(map?: { [key: string]: any }) {
181
+ super(map);
182
+ }
183
+ }
184
+
@@ -0,0 +1,40 @@
1
+ // This file is auto-generated, don't edit it
2
+ import * as $dara from '@darabonba/typescript';
3
+ import { CreateWorkspaceQueueResponseBody } from "./CreateWorkspaceQueueResponseBody";
4
+
5
+
6
+ export class CreateWorkspaceQueueResponse extends $dara.Model {
7
+ headers?: { [key: string]: string };
8
+ statusCode?: number;
9
+ body?: CreateWorkspaceQueueResponseBody;
10
+ static names(): { [key: string]: string } {
11
+ return {
12
+ headers: 'headers',
13
+ statusCode: 'statusCode',
14
+ body: 'body',
15
+ };
16
+ }
17
+
18
+ static types(): { [key: string]: any } {
19
+ return {
20
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
21
+ statusCode: 'number',
22
+ body: CreateWorkspaceQueueResponseBody,
23
+ };
24
+ }
25
+
26
+ validate() {
27
+ if(this.headers) {
28
+ $dara.Model.validateMap(this.headers);
29
+ }
30
+ if(this.body && typeof (this.body as any).validate === 'function') {
31
+ (this.body as any).validate();
32
+ }
33
+ super.validate();
34
+ }
35
+
36
+ constructor(map?: { [key: string]: any }) {
37
+ super(map);
38
+ }
39
+ }
40
+
@@ -0,0 +1,34 @@
1
+ // This file is auto-generated, don't edit it
2
+ import * as $dara from '@darabonba/typescript';
3
+
4
+
5
+ export class CreateWorkspaceQueueResponseBody extends $dara.Model {
6
+ /**
7
+ * @remarks
8
+ * The request ID.
9
+ *
10
+ * @example
11
+ * DD6B1B2A-5837-5237-ABE4-FF0C8944****
12
+ */
13
+ requestId?: string;
14
+ static names(): { [key: string]: string } {
15
+ return {
16
+ requestId: 'requestId',
17
+ };
18
+ }
19
+
20
+ static types(): { [key: string]: any } {
21
+ return {
22
+ requestId: 'string',
23
+ };
24
+ }
25
+
26
+ validate() {
27
+ super.validate();
28
+ }
29
+
30
+ constructor(map?: { [key: string]: any }) {
31
+ super(map);
32
+ }
33
+ }
34
+
@@ -38,6 +38,7 @@ export { CreateSessionClusterRequestAutoStopConfiguration } from './CreateSessio
38
38
  export { CreateSqlStatementResponseBodyData } from './CreateSqlStatementResponseBody';
39
39
  export { CreateWorkspaceRequestResourceSpec } from './CreateWorkspaceRequest';
40
40
  export { CreateWorkspaceRequestTag } from './CreateWorkspaceRequest';
41
+ export { CreateWorkspaceQueueRequestResourceSpec } from './CreateWorkspaceQueueRequest';
41
42
  export { EditWorkspaceQueueRequestResourceSpec } from './EditWorkspaceQueueRequest';
42
43
  export { GetCuHoursResponseBodyData } from './GetCuHoursResponseBody';
43
44
  export { GetDoctorApplicationResponseBodyData } from './GetDoctorApplicationResponseBody';
@@ -215,6 +216,9 @@ export { CreateSqlStatementResponse } from './CreateSqlStatementResponse';
215
216
  export { CreateWorkspaceRequest } from './CreateWorkspaceRequest';
216
217
  export { CreateWorkspaceResponseBody } from './CreateWorkspaceResponseBody';
217
218
  export { CreateWorkspaceResponse } from './CreateWorkspaceResponse';
219
+ export { CreateWorkspaceQueueRequest } from './CreateWorkspaceQueueRequest';
220
+ export { CreateWorkspaceQueueResponseBody } from './CreateWorkspaceQueueResponseBody';
221
+ export { CreateWorkspaceQueueResponse } from './CreateWorkspaceQueueResponse';
218
222
  export { DeleteKyuubiServiceResponseBody } from './DeleteKyuubiServiceResponseBody';
219
223
  export { DeleteKyuubiServiceResponse } from './DeleteKyuubiServiceResponse';
220
224
  export { DeleteKyuubiTokenRequest } from './DeleteKyuubiTokenRequest';