Skip to content

Commit 95cc6da

Browse files
committed
Support API DeleteSandbox.
1 parent 2131fa6 commit 95cc6da

File tree

9 files changed

+150
-11
lines changed

9 files changed

+150
-11
lines changed

agentrun-20250910/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alicloud/agentrun20250910",
3-
"version": "3.1.0",
3+
"version": "4.0.0",
44
"description": "",
55
"main": "dist/client.js",
66
"scripts": {

agentrun-20250910/src/client.ts

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,41 @@ export default class Client extends OpenApi {
874874
return await this.deleteModelServiceWithOptions(modelServiceName, headers, runtime);
875875
}
876876

877+
/**
878+
* 删除Sandbox
879+
*
880+
* @param headers - map
881+
* @param runtime - runtime options for this request RuntimeOptions
882+
* @returns DeleteSandboxResponse
883+
*/
884+
async deleteSandboxWithOptions(sandboxId: string, headers: {[key: string ]: string}, runtime: $dara.RuntimeOptions): Promise<$_model.DeleteSandboxResponse> {
885+
let req = new $OpenApiUtil.OpenApiRequest({
886+
headers: headers,
887+
});
888+
let params = new $OpenApiUtil.Params({
889+
action: "DeleteSandbox",
890+
version: "2025-09-10",
891+
protocol: "HTTPS",
892+
pathname: `/2025-09-10/sandboxes/${$dara.URL.percentEncode(sandboxId)}`,
893+
method: "DELETE",
894+
authType: "AK",
895+
style: "ROA",
896+
reqBodyType: "json",
897+
bodyType: "json",
898+
});
899+
return $dara.cast<$_model.DeleteSandboxResponse>(await this.callApi(params, req, runtime), new $_model.DeleteSandboxResponse({}));
900+
}
901+
902+
/**
903+
* 删除Sandbox
904+
* @returns DeleteSandboxResponse
905+
*/
906+
async deleteSandbox(sandboxId: string): Promise<$_model.DeleteSandboxResponse> {
907+
let runtime = new $dara.RuntimeOptions({ });
908+
let headers : {[key: string ]: string} = { };
909+
return await this.deleteSandboxWithOptions(sandboxId, headers, runtime);
910+
}
911+
877912
/**
878913
* 删除模板
879914
*
@@ -2273,6 +2308,14 @@ export default class Client extends OpenApi {
22732308
query["pageSize"] = request.pageSize;
22742309
}
22752310

2311+
if (!$dara.isNull(request.status)) {
2312+
query["status"] = request.status;
2313+
}
2314+
2315+
if (!$dara.isNull(request.templateName)) {
2316+
query["templateName"] = request.templateName;
2317+
}
2318+
22762319
if (!$dara.isNull(request.templateType)) {
22772320
query["templateType"] = request.templateType;
22782321
}
@@ -2418,7 +2461,7 @@ export default class Client extends OpenApi {
24182461
}
24192462

24202463
/**
2421-
* 停止沙箱
2464+
* 删除沙箱
24222465
*
24232466
* @remarks
24242467
* 停止指定的沙箱实例。停止后,沙箱将进入TERMINATED状态。
@@ -2435,8 +2478,8 @@ export default class Client extends OpenApi {
24352478
action: "StopSandbox",
24362479
version: "2025-09-10",
24372480
protocol: "HTTPS",
2438-
pathname: `/2025-09-10/sandboxes/${$dara.URL.percentEncode(sandboxId)}`,
2439-
method: "DELETE",
2481+
pathname: `/2025-09-10/sandboxes/${$dara.URL.percentEncode(sandboxId)}/stop`,
2482+
method: "POST",
24402483
authType: "AK",
24412484
style: "ROA",
24422485
reqBodyType: "json",
@@ -2446,7 +2489,7 @@ export default class Client extends OpenApi {
24462489
}
24472490

24482491
/**
2449-
* 停止沙箱
2492+
* 删除沙箱
24502493
*
24512494
* @remarks
24522495
* 停止指定的沙箱实例。停止后,沙箱将进入TERMINATED状态。

agentrun-20250910/src/models/CreateSandboxInput.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as $dara from '@darabonba/typescript';
33

44

55
export class CreateSandboxInput extends $dara.Model {
6+
sandboxId?: string;
67
/**
78
* @remarks
89
* 沙箱空闲超时时间(秒)
@@ -17,13 +18,15 @@ export class CreateSandboxInput extends $dara.Model {
1718
templateName?: string;
1819
static names(): { [key: string]: string } {
1920
return {
21+
sandboxId: 'sandboxId',
2022
sandboxIdleTimeoutSeconds: 'sandboxIdleTimeoutSeconds',
2123
templateName: 'templateName',
2224
};
2325
}
2426

2527
static types(): { [key: string]: any } {
2628
return {
29+
sandboxId: 'string',
2730
sandboxIdleTimeoutSeconds: 'number',
2831
templateName: 'string',
2932
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// This file is auto-generated, don't edit it
2+
import * as $dara from '@darabonba/typescript';
3+
import { DeleteSandboxResult } from "./DeleteSandboxResult";
4+
5+
6+
export class DeleteSandboxResponse extends $dara.Model {
7+
headers?: { [key: string]: string };
8+
statusCode?: number;
9+
body?: DeleteSandboxResult;
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: DeleteSandboxResult,
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+

agentrun-20250910/src/models/ListTemplatesRequest.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ export class ListTemplatesRequest extends $dara.Model {
1919
* 20
2020
*/
2121
pageSize?: number;
22+
/**
23+
* @example
24+
* READY
25+
*/
26+
status?: string;
27+
/**
28+
* @example
29+
* temp-abc
30+
*/
31+
templateName?: string;
2232
/**
2333
* @remarks
2434
* 按模板类型过滤
@@ -31,6 +41,8 @@ export class ListTemplatesRequest extends $dara.Model {
3141
return {
3242
pageNumber: 'pageNumber',
3343
pageSize: 'pageSize',
44+
status: 'status',
45+
templateName: 'templateName',
3446
templateType: 'templateType',
3547
};
3648
}
@@ -39,6 +51,8 @@ export class ListTemplatesRequest extends $dara.Model {
3951
return {
4052
pageNumber: 'number',
4153
pageSize: 'number',
54+
status: 'string',
55+
templateName: 'string',
4256
templateType: 'string',
4357
};
4458
}

agentrun-20250910/src/models/Sandbox.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as $dara from '@darabonba/typescript';
33

44

55
export class Sandbox extends $dara.Model {
6-
sandboxIdleTTLInSeconds?: number;
76
/**
87
* @remarks
98
* 沙箱创建时间
@@ -24,6 +23,7 @@ export class Sandbox extends $dara.Model {
2423
* This parameter is required.
2524
*/
2625
sandboxId?: string;
26+
sandboxIdleTTLInSeconds?: number;
2727
/**
2828
* @remarks
2929
* 沙箱空闲超时时间(秒)
@@ -42,13 +42,13 @@ export class Sandbox extends $dara.Model {
4242
templateName?: string;
4343
static names(): { [key: string]: string } {
4444
return {
45-
sandboxIdleTTLInSeconds: 'SandboxIdleTTLInSeconds',
4645
createdAt: 'createdAt',
4746
endedAt: 'endedAt',
4847
lastUpdatedAt: 'lastUpdatedAt',
4948
metadata: 'metadata',
5049
sandboxArn: 'sandboxArn',
5150
sandboxId: 'sandboxId',
51+
sandboxIdleTTLInSeconds: 'sandboxIdleTTLInSeconds',
5252
sandboxIdleTimeoutSeconds: 'sandboxIdleTimeoutSeconds',
5353
status: 'status',
5454
templateId: 'templateId',
@@ -58,13 +58,13 @@ export class Sandbox extends $dara.Model {
5858

5959
static types(): { [key: string]: any } {
6060
return {
61-
sandboxIdleTTLInSeconds: 'number',
6261
createdAt: 'string',
6362
endedAt: 'string',
6463
lastUpdatedAt: 'string',
6564
metadata: { 'type': 'map', 'keyType': 'string', 'valueType': 'any' },
6665
sandboxArn: 'string',
6766
sandboxId: 'string',
67+
sandboxIdleTTLInSeconds: 'number',
6868
sandboxIdleTimeoutSeconds: 'number',
6969
status: 'string',
7070
templateId: 'string',

agentrun-20250910/src/models/StopSandboxResponse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// This file is auto-generated, don't edit it
22
import * as $dara from '@darabonba/typescript';
3-
import { DeleteSandboxResult } from "./DeleteSandboxResult";
3+
import { StopSandboxResult } from "./StopSandboxResult";
44

55

66
export class StopSandboxResponse extends $dara.Model {
77
headers?: { [key: string]: string };
88
statusCode?: number;
9-
body?: DeleteSandboxResult;
9+
body?: StopSandboxResult;
1010
static names(): { [key: string]: string } {
1111
return {
1212
headers: 'headers',
@@ -19,7 +19,7 @@ export class StopSandboxResponse extends $dara.Model {
1919
return {
2020
headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
2121
statusCode: 'number',
22-
body: DeleteSandboxResult,
22+
body: StopSandboxResult,
2323
};
2424
}
2525

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// This file is auto-generated, don't edit it
2+
import * as $dara from '@darabonba/typescript';
3+
import { Sandbox } from "./Sandbox";
4+
5+
6+
export class StopSandboxResult extends $dara.Model {
7+
code?: string;
8+
data?: Sandbox;
9+
requestId?: string;
10+
static names(): { [key: string]: string } {
11+
return {
12+
code: 'code',
13+
data: 'data',
14+
requestId: 'requestId',
15+
};
16+
}
17+
18+
static types(): { [key: string]: any } {
19+
return {
20+
code: 'string',
21+
data: Sandbox,
22+
requestId: 'string',
23+
};
24+
}
25+
26+
validate() {
27+
if(this.data && typeof (this.data as any).validate === 'function') {
28+
(this.data as any).validate();
29+
}
30+
super.validate();
31+
}
32+
33+
constructor(map?: { [key: string]: any }) {
34+
super(map);
35+
}
36+
}
37+

agentrun-20250910/src/models/model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export { StartBrowserSessionResult } from './StartBrowserSessionResult';
171171
export { StartCodeInterpreterSessionInput } from './StartCodeInterpreterSessionInput';
172172
export { StartCodeInterpreterSessionResult } from './StartCodeInterpreterSessionResult';
173173
export { StopCodeInterpreterSessionResult } from './StopCodeInterpreterSessionResult';
174+
export { StopSandboxResult } from './StopSandboxResult';
174175
export { Target } from './Target';
175176
export { TargetConfiguration } from './TargetConfiguration';
176177
export { TargetServiceConfig } from './TargetServiceConfig';
@@ -230,6 +231,7 @@ export { DeleteMemoryResponseBody } from './DeleteMemoryResponseBody';
230231
export { DeleteMemoryResponse } from './DeleteMemoryResponse';
231232
export { DeleteModelProxyResponse } from './DeleteModelProxyResponse';
232233
export { DeleteModelServiceResponse } from './DeleteModelServiceResponse';
234+
export { DeleteSandboxResponse } from './DeleteSandboxResponse';
233235
export { DeleteTemplateResponse } from './DeleteTemplateResponse';
234236
export { GetAccessTokenRequest } from './GetAccessTokenRequest';
235237
export { GetAccessTokenResponseBody } from './GetAccessTokenResponseBody';

0 commit comments

Comments
 (0)