@djangocfg/api 1.2.19 → 1.2.21
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/dist/index.cjs +11846 -9936
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5466 -3236
- package/dist/index.d.ts +5466 -3236
- package/dist/index.mjs +11859 -9975
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_jobs.ts +105 -0
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_monitoring.ts +77 -0
- package/src/cfg/generated/_utils/fetchers/{cfg__dashboard.ts → cfg__rq__rq_queues.ts} +21 -20
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_registries.ts +132 -0
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_schedules.ts +92 -0
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_testing.ts +120 -0
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_workers.ts +62 -0
- package/src/cfg/generated/_utils/fetchers/index.ts +7 -2
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_jobs.ts +106 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_monitoring.ts +65 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_queues.ts +82 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_registries.ts +132 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_schedules.ts +89 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_testing.ts +124 -0
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_workers.ts +50 -0
- package/src/cfg/generated/_utils/hooks/index.ts +7 -2
- package/src/cfg/generated/_utils/schemas/JobActionResponse.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/JobDetail.schema.ts +40 -0
- package/src/cfg/generated/_utils/schemas/JobList.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/QueueDetail.schema.ts +34 -0
- package/src/cfg/generated/_utils/schemas/QueueStats.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/RQConfig.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/RunDemoRequestRequest.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/ScheduleActionResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/ScheduleCreateRequest.schema.ts +39 -0
- package/src/cfg/generated/_utils/schemas/ScheduledJob.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/StressTestRequestRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/TestScenario.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/TestingActionResponse.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/Worker.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/WorkerStats.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/index.ts +15 -10
- package/src/cfg/generated/cfg__dashboard__dashboard_overview/models.ts +3 -1
- package/src/cfg/generated/cfg__rq__rq_jobs/client.ts +76 -0
- package/src/cfg/generated/cfg__rq__rq_jobs/models.ts +62 -0
- package/src/cfg/generated/cfg__rq__rq_monitoring/client.ts +45 -0
- package/src/cfg/generated/cfg__rq__rq_monitoring/models.ts +39 -0
- package/src/cfg/generated/cfg__rq__rq_queues/client.ts +78 -0
- package/src/cfg/generated/cfg__rq__rq_queues/index.ts +2 -0
- package/src/cfg/generated/cfg__rq__rq_queues/models.ts +33 -0
- package/src/cfg/generated/cfg__rq__rq_registries/client.ts +161 -0
- package/src/cfg/generated/cfg__rq__rq_registries/index.ts +2 -0
- package/src/cfg/generated/cfg__rq__rq_registries/models.ts +17 -0
- package/src/cfg/generated/cfg__rq__rq_schedules/client.ts +91 -0
- package/src/cfg/generated/cfg__rq__rq_schedules/index.ts +2 -0
- package/src/cfg/generated/cfg__rq__rq_schedules/models.ts +84 -0
- package/src/cfg/generated/cfg__rq__rq_testing/client.ts +96 -0
- package/src/cfg/generated/cfg__rq__rq_testing/index.ts +2 -0
- package/src/cfg/generated/cfg__rq__rq_testing/models.ts +68 -0
- package/src/cfg/generated/cfg__rq__rq_workers/client.ts +46 -0
- package/src/cfg/generated/cfg__rq__rq_workers/index.ts +2 -0
- package/src/cfg/generated/cfg__rq__rq_workers/models.ts +52 -0
- package/src/cfg/generated/client.ts +21 -6
- package/src/cfg/generated/enums.ts +40 -60
- package/src/cfg/generated/index.ts +35 -10
- package/src/cfg/generated/schema.ts +6160 -5035
- package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +0 -123
- package/src/cfg/generated/_utils/hooks/cfg__dashboard.ts +0 -77
- package/src/cfg/generated/_utils/hooks/cfg__tasks.ts +0 -111
- package/src/cfg/generated/_utils/schemas/PaginatedTaskLogListList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/TaskLog.schema.ts +0 -42
- package/src/cfg/generated/_utils/schemas/TaskLogDetail.schema.ts +0 -50
- package/src/cfg/generated/_utils/schemas/TaskLogList.schema.ts +0 -35
- package/src/cfg/generated/_utils/schemas/TaskLogOverview.schema.ts +0 -43
- package/src/cfg/generated/_utils/schemas/TaskLogStats.schema.ts +0 -30
- package/src/cfg/generated/_utils/schemas/TaskLogTimeline.schema.ts +0 -28
- package/src/cfg/generated/_utils/schemas/TaskLogTimelineItem.schema.ts +0 -28
- package/src/cfg/generated/_utils/schemas/TasksByQueue.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/TasksByStatus.schema.ts +0 -24
- package/src/cfg/generated/cfg__dashboard/client.ts +0 -48
- package/src/cfg/generated/cfg__dashboard/models.ts +0 -0
- package/src/cfg/generated/cfg__tasks/client.ts +0 -104
- package/src/cfg/generated/cfg__tasks/models.ts +0 -285
- /package/src/cfg/generated/{cfg__dashboard → cfg__rq__rq_jobs}/index.ts +0 -0
- /package/src/cfg/generated/{cfg__tasks → cfg__rq__rq_monitoring}/index.ts +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as Models from "./models";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* API endpoints for RQ Monitoring.
|
|
6
|
+
*/
|
|
7
|
+
export class CfgRqMonitoring {
|
|
8
|
+
private client: any;
|
|
9
|
+
|
|
10
|
+
constructor(client: any) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Get RQ configuration
|
|
16
|
+
*
|
|
17
|
+
* Returns current RQ configuration from django-cfg.
|
|
18
|
+
*/
|
|
19
|
+
async rqMonitorConfigRetrieve(): Promise<Models.RQConfig> {
|
|
20
|
+
const response = await this.client.request('GET', "/cfg/rq/monitor/config/");
|
|
21
|
+
return response;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Health check
|
|
26
|
+
*
|
|
27
|
+
* Returns RQ cluster health status including worker count and queue
|
|
28
|
+
* status.
|
|
29
|
+
*/
|
|
30
|
+
async rqMonitorHealthRetrieve(): Promise<Models.HealthCheck> {
|
|
31
|
+
const response = await this.client.request('GET', "/cfg/rq/monitor/health/");
|
|
32
|
+
return response;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Prometheus metrics
|
|
37
|
+
*
|
|
38
|
+
* Returns Prometheus metrics for RQ queues and workers.
|
|
39
|
+
*/
|
|
40
|
+
async rqMonitorMetricsRetrieve(): Promise<any> {
|
|
41
|
+
const response = await this.client.request('GET', "/cfg/rq/monitor/metrics/");
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RQ configuration serializer. Returns current RQ configuration from
|
|
3
|
+
* django-cfg.
|
|
4
|
+
*
|
|
5
|
+
* Response model (includes read-only fields).
|
|
6
|
+
*/
|
|
7
|
+
export interface RQConfig {
|
|
8
|
+
/** RQ enabled status */
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
/** Configured queues */
|
|
11
|
+
queues: Record<string, any>;
|
|
12
|
+
/** Async mode enabled */
|
|
13
|
+
async_mode?: boolean;
|
|
14
|
+
/** Show admin link */
|
|
15
|
+
show_admin_link?: boolean;
|
|
16
|
+
/** Prometheus metrics enabled */
|
|
17
|
+
prometheus_enabled?: boolean;
|
|
18
|
+
/** API token is configured */
|
|
19
|
+
api_token_configured?: boolean;
|
|
20
|
+
/** Scheduled tasks from django-cfg config */
|
|
21
|
+
schedules?: Array<string>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Health check response.
|
|
26
|
+
*
|
|
27
|
+
* Response model (includes read-only fields).
|
|
28
|
+
*/
|
|
29
|
+
export interface HealthCheck {
|
|
30
|
+
/** Health status: healthy or unhealthy */
|
|
31
|
+
status: string;
|
|
32
|
+
/** Configured wrapper URL */
|
|
33
|
+
wrapper_url: string;
|
|
34
|
+
/** Whether API key is configured */
|
|
35
|
+
has_api_key: boolean;
|
|
36
|
+
/** Current timestamp */
|
|
37
|
+
timestamp: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as Models from "./models";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* API endpoints for RQ Queues.
|
|
6
|
+
*/
|
|
7
|
+
export class CfgRqQueues {
|
|
8
|
+
private client: any;
|
|
9
|
+
|
|
10
|
+
constructor(client: any) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async list(name?: string): Promise<any>;
|
|
15
|
+
async list(params?: { name?: string }): Promise<any>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* List all queues
|
|
19
|
+
*
|
|
20
|
+
* Returns list of all configured RQ queues with statistics. Supports
|
|
21
|
+
* filtering by queue name.
|
|
22
|
+
*/
|
|
23
|
+
async list(...args: any[]): Promise<any> {
|
|
24
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
25
|
+
|
|
26
|
+
let params;
|
|
27
|
+
if (isParamsObject) {
|
|
28
|
+
params = args[0];
|
|
29
|
+
} else {
|
|
30
|
+
params = { name: args[0] };
|
|
31
|
+
}
|
|
32
|
+
const response = await this.client.request('GET', "/cfg/rq/queues/", { params });
|
|
33
|
+
return response;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get queue details
|
|
38
|
+
*
|
|
39
|
+
* Returns detailed information about a specific queue.
|
|
40
|
+
*/
|
|
41
|
+
async retrieve(id: string): Promise<Models.QueueDetail> {
|
|
42
|
+
const response = await this.client.request('GET', `/cfg/rq/queues/${id}/`);
|
|
43
|
+
return response;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Empty queue
|
|
48
|
+
*
|
|
49
|
+
* Removes all jobs from the specified queue.
|
|
50
|
+
*/
|
|
51
|
+
async emptyCreate(id: string): Promise<any> {
|
|
52
|
+
const response = await this.client.request('POST', `/cfg/rq/queues/${id}/empty/`);
|
|
53
|
+
return response;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async jobsRetrieve(id: string, limit?: number, offset?: number): Promise<any>;
|
|
57
|
+
async jobsRetrieve(id: string, params?: { limit?: number; offset?: number }): Promise<any>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Get queue jobs
|
|
61
|
+
*
|
|
62
|
+
* Returns list of job IDs in the queue.
|
|
63
|
+
*/
|
|
64
|
+
async jobsRetrieve(...args: any[]): Promise<any> {
|
|
65
|
+
const id = args[0];
|
|
66
|
+
const isParamsObject = args.length === 2 && typeof args[1] === 'object' && args[1] !== null && !Array.isArray(args[1]);
|
|
67
|
+
|
|
68
|
+
let params;
|
|
69
|
+
if (isParamsObject) {
|
|
70
|
+
params = args[1];
|
|
71
|
+
} else {
|
|
72
|
+
params = { limit: args[1], offset: args[2] };
|
|
73
|
+
}
|
|
74
|
+
const response = await this.client.request('GET', `/cfg/rq/queues/${id}/jobs/`, { params });
|
|
75
|
+
return response;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detailed queue information serializer. Provides comprehensive queue
|
|
3
|
+
* statistics and metadata.
|
|
4
|
+
*
|
|
5
|
+
* Response model (includes read-only fields).
|
|
6
|
+
*/
|
|
7
|
+
export interface QueueDetail {
|
|
8
|
+
/** Queue name */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Total jobs in queue */
|
|
11
|
+
count: number;
|
|
12
|
+
/** Jobs waiting to be processed */
|
|
13
|
+
queued_jobs?: number;
|
|
14
|
+
/** Jobs currently being processed */
|
|
15
|
+
started_jobs?: number;
|
|
16
|
+
/** Completed jobs */
|
|
17
|
+
finished_jobs?: number;
|
|
18
|
+
/** Failed jobs */
|
|
19
|
+
failed_jobs?: number;
|
|
20
|
+
/** Deferred jobs */
|
|
21
|
+
deferred_jobs?: number;
|
|
22
|
+
/** Scheduled jobs */
|
|
23
|
+
scheduled_jobs?: number;
|
|
24
|
+
/** Number of workers for this queue */
|
|
25
|
+
workers?: number;
|
|
26
|
+
/** Timestamp of oldest job in queue */
|
|
27
|
+
oldest_job_timestamp?: string | null;
|
|
28
|
+
/** Redis connection parameters */
|
|
29
|
+
connection_kwargs?: Record<string, any>;
|
|
30
|
+
/** Queue is in async mode */
|
|
31
|
+
is_async?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import * as Models from "./models";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* API endpoints for RQ Registries.
|
|
6
|
+
*/
|
|
7
|
+
export class CfgRqRegistries {
|
|
8
|
+
private client: any;
|
|
9
|
+
|
|
10
|
+
constructor(client: any) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async rqJobsRegistriesDeferredList(queue?: string): Promise<any>;
|
|
15
|
+
async rqJobsRegistriesDeferredList(params?: { queue?: string }): Promise<any>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* List deferred jobs
|
|
19
|
+
*
|
|
20
|
+
* Returns list of all deferred jobs from deferred job registry.
|
|
21
|
+
*/
|
|
22
|
+
async rqJobsRegistriesDeferredList(...args: any[]): Promise<any> {
|
|
23
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
24
|
+
|
|
25
|
+
let params;
|
|
26
|
+
if (isParamsObject) {
|
|
27
|
+
params = args[0];
|
|
28
|
+
} else {
|
|
29
|
+
params = { queue: args[0] };
|
|
30
|
+
}
|
|
31
|
+
const response = await this.client.request('GET', "/cfg/rq/jobs/registries/deferred/", { params });
|
|
32
|
+
return response;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async rqJobsRegistriesFailedList(queue?: string): Promise<any>;
|
|
36
|
+
async rqJobsRegistriesFailedList(params?: { queue?: string }): Promise<any>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* List failed jobs
|
|
40
|
+
*
|
|
41
|
+
* Returns list of all failed jobs from failed job registry.
|
|
42
|
+
*/
|
|
43
|
+
async rqJobsRegistriesFailedList(...args: any[]): Promise<any> {
|
|
44
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
45
|
+
|
|
46
|
+
let params;
|
|
47
|
+
if (isParamsObject) {
|
|
48
|
+
params = args[0];
|
|
49
|
+
} else {
|
|
50
|
+
params = { queue: args[0] };
|
|
51
|
+
}
|
|
52
|
+
const response = await this.client.request('GET', "/cfg/rq/jobs/registries/failed/", { params });
|
|
53
|
+
return response;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async rqJobsRegistriesFailedClearCreate(queue: string): Promise<Models.JobActionResponse>;
|
|
57
|
+
async rqJobsRegistriesFailedClearCreate(params: { queue: string }): Promise<Models.JobActionResponse>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Clear failed jobs registry
|
|
61
|
+
*
|
|
62
|
+
* Removes all jobs from the failed job registry.
|
|
63
|
+
*/
|
|
64
|
+
async rqJobsRegistriesFailedClearCreate(...args: any[]): Promise<Models.JobActionResponse> {
|
|
65
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
66
|
+
|
|
67
|
+
let params;
|
|
68
|
+
if (isParamsObject) {
|
|
69
|
+
params = args[0];
|
|
70
|
+
} else {
|
|
71
|
+
params = { queue: args[0] };
|
|
72
|
+
}
|
|
73
|
+
const response = await this.client.request('POST', "/cfg/rq/jobs/registries/failed/clear/", { params });
|
|
74
|
+
return response;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async rqJobsRegistriesFailedRequeueAllCreate(queue: string): Promise<Models.JobActionResponse>;
|
|
78
|
+
async rqJobsRegistriesFailedRequeueAllCreate(params: { queue: string }): Promise<Models.JobActionResponse>;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Requeue all failed jobs
|
|
82
|
+
*
|
|
83
|
+
* Requeues all failed jobs in the failed job registry.
|
|
84
|
+
*/
|
|
85
|
+
async rqJobsRegistriesFailedRequeueAllCreate(...args: any[]): Promise<Models.JobActionResponse> {
|
|
86
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
87
|
+
|
|
88
|
+
let params;
|
|
89
|
+
if (isParamsObject) {
|
|
90
|
+
params = args[0];
|
|
91
|
+
} else {
|
|
92
|
+
params = { queue: args[0] };
|
|
93
|
+
}
|
|
94
|
+
const response = await this.client.request('POST', "/cfg/rq/jobs/registries/failed/requeue-all/", { params });
|
|
95
|
+
return response;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async rqJobsRegistriesFinishedList(queue?: string): Promise<any>;
|
|
99
|
+
async rqJobsRegistriesFinishedList(params?: { queue?: string }): Promise<any>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* List finished jobs
|
|
103
|
+
*
|
|
104
|
+
* Returns list of all finished jobs from finished job registry.
|
|
105
|
+
*/
|
|
106
|
+
async rqJobsRegistriesFinishedList(...args: any[]): Promise<any> {
|
|
107
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
108
|
+
|
|
109
|
+
let params;
|
|
110
|
+
if (isParamsObject) {
|
|
111
|
+
params = args[0];
|
|
112
|
+
} else {
|
|
113
|
+
params = { queue: args[0] };
|
|
114
|
+
}
|
|
115
|
+
const response = await this.client.request('GET', "/cfg/rq/jobs/registries/finished/", { params });
|
|
116
|
+
return response;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
async rqJobsRegistriesFinishedClearCreate(queue: string): Promise<Models.JobActionResponse>;
|
|
120
|
+
async rqJobsRegistriesFinishedClearCreate(params: { queue: string }): Promise<Models.JobActionResponse>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Clear finished jobs registry
|
|
124
|
+
*
|
|
125
|
+
* Removes all jobs from the finished job registry.
|
|
126
|
+
*/
|
|
127
|
+
async rqJobsRegistriesFinishedClearCreate(...args: any[]): Promise<Models.JobActionResponse> {
|
|
128
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
129
|
+
|
|
130
|
+
let params;
|
|
131
|
+
if (isParamsObject) {
|
|
132
|
+
params = args[0];
|
|
133
|
+
} else {
|
|
134
|
+
params = { queue: args[0] };
|
|
135
|
+
}
|
|
136
|
+
const response = await this.client.request('POST', "/cfg/rq/jobs/registries/finished/clear/", { params });
|
|
137
|
+
return response;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async rqJobsRegistriesStartedList(queue?: string): Promise<any>;
|
|
141
|
+
async rqJobsRegistriesStartedList(params?: { queue?: string }): Promise<any>;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* List started jobs
|
|
145
|
+
*
|
|
146
|
+
* Returns list of all currently running jobs from started job registry.
|
|
147
|
+
*/
|
|
148
|
+
async rqJobsRegistriesStartedList(...args: any[]): Promise<any> {
|
|
149
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
150
|
+
|
|
151
|
+
let params;
|
|
152
|
+
if (isParamsObject) {
|
|
153
|
+
params = args[0];
|
|
154
|
+
} else {
|
|
155
|
+
params = { queue: args[0] };
|
|
156
|
+
}
|
|
157
|
+
const response = await this.client.request('GET', "/cfg/rq/jobs/registries/started/", { params });
|
|
158
|
+
return response;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Job action response serializer. Used for job management actions (requeue,
|
|
3
|
+
* delete, etc.).
|
|
4
|
+
*
|
|
5
|
+
* Response model (includes read-only fields).
|
|
6
|
+
*/
|
|
7
|
+
export interface JobActionResponse {
|
|
8
|
+
/** Action success status */
|
|
9
|
+
success: boolean;
|
|
10
|
+
/** Action result message */
|
|
11
|
+
message: string;
|
|
12
|
+
/** Job ID */
|
|
13
|
+
job_id: string;
|
|
14
|
+
/** Action performed (requeue/delete/cancel) */
|
|
15
|
+
action: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as Models from "./models";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* API endpoints for RQ Schedules.
|
|
6
|
+
*/
|
|
7
|
+
export class CfgRqSchedules {
|
|
8
|
+
private client: any;
|
|
9
|
+
|
|
10
|
+
constructor(client: any) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async list(queue?: string): Promise<any>;
|
|
15
|
+
async list(params?: { queue?: string }): Promise<any>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* List scheduled jobs
|
|
19
|
+
*
|
|
20
|
+
* Returns list of all scheduled jobs across all queues.
|
|
21
|
+
*/
|
|
22
|
+
async list(...args: any[]): Promise<any> {
|
|
23
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
24
|
+
|
|
25
|
+
let params;
|
|
26
|
+
if (isParamsObject) {
|
|
27
|
+
params = args[0];
|
|
28
|
+
} else {
|
|
29
|
+
params = { queue: args[0] };
|
|
30
|
+
}
|
|
31
|
+
const response = await this.client.request('GET', "/cfg/rq/schedules/", { params });
|
|
32
|
+
return response;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create scheduled job
|
|
37
|
+
*
|
|
38
|
+
* Schedule a job to run at specific time, interval, or cron schedule.
|
|
39
|
+
*/
|
|
40
|
+
async create(data: Models.ScheduleCreateRequest): Promise<Models.ScheduleActionResponse> {
|
|
41
|
+
const response = await this.client.request('POST', "/cfg/rq/schedules/", { body: data });
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async retrieve(id: string, pk: string, queue?: string): Promise<Models.ScheduledJob>;
|
|
46
|
+
async retrieve(id: string, pk: string, params?: { queue?: string }): Promise<Models.ScheduledJob>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get scheduled job details
|
|
50
|
+
*
|
|
51
|
+
* Returns detailed information about a specific scheduled job.
|
|
52
|
+
*/
|
|
53
|
+
async retrieve(...args: any[]): Promise<Models.ScheduledJob> {
|
|
54
|
+
const id = args[0];
|
|
55
|
+
const pk = args[1];
|
|
56
|
+
const isParamsObject = args.length === 3 && typeof args[2] === 'object' && args[2] !== null && !Array.isArray(args[2]);
|
|
57
|
+
|
|
58
|
+
let params;
|
|
59
|
+
if (isParamsObject) {
|
|
60
|
+
params = args[2];
|
|
61
|
+
} else {
|
|
62
|
+
params = { queue: args[2] };
|
|
63
|
+
}
|
|
64
|
+
const response = await this.client.request('GET', `/cfg/rq/schedules/${id}/`, { params });
|
|
65
|
+
return response;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async destroy(id: string, pk: string, queue?: string): Promise<Models.ScheduleActionResponse>;
|
|
69
|
+
async destroy(id: string, pk: string, params?: { queue?: string }): Promise<Models.ScheduleActionResponse>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Cancel scheduled job
|
|
73
|
+
*
|
|
74
|
+
* Cancel a scheduled job by ID.
|
|
75
|
+
*/
|
|
76
|
+
async destroy(...args: any[]): Promise<Models.ScheduleActionResponse> {
|
|
77
|
+
const id = args[0];
|
|
78
|
+
const pk = args[1];
|
|
79
|
+
const isParamsObject = args.length === 3 && typeof args[2] === 'object' && args[2] !== null && !Array.isArray(args[2]);
|
|
80
|
+
|
|
81
|
+
let params;
|
|
82
|
+
if (isParamsObject) {
|
|
83
|
+
params = args[2];
|
|
84
|
+
} else {
|
|
85
|
+
params = { queue: args[2] };
|
|
86
|
+
}
|
|
87
|
+
const response = await this.client.request('DELETE', `/cfg/rq/schedules/${id}/`, { params });
|
|
88
|
+
return response;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serializer for creating a scheduled job. Supports three scheduling methods:
|
|
3
|
+
* 1. scheduled_time: Schedule job at specific time 2. interval: Schedule job
|
|
4
|
+
* to repeat at intervals 3. cron: Schedule job with cron expression
|
|
5
|
+
*
|
|
6
|
+
* Request model (no read-only fields).
|
|
7
|
+
*/
|
|
8
|
+
export interface ScheduleCreateRequest {
|
|
9
|
+
/** Function path (e.g., 'myapp.tasks.my_task') */
|
|
10
|
+
func: string;
|
|
11
|
+
/** Function arguments */
|
|
12
|
+
args?: Array<string>;
|
|
13
|
+
/** Function keyword arguments */
|
|
14
|
+
kwargs?: Record<string, any>;
|
|
15
|
+
/** Queue name to schedule job in */
|
|
16
|
+
queue_name?: string;
|
|
17
|
+
/** Schedule job at specific time (ISO 8601) */
|
|
18
|
+
scheduled_time?: string | null;
|
|
19
|
+
/** Schedule job to repeat every N seconds */
|
|
20
|
+
interval?: number | null;
|
|
21
|
+
/** Cron expression (e.g., '0 0 * * *' for daily at midnight) */
|
|
22
|
+
cron?: string | null;
|
|
23
|
+
/** Job timeout in seconds */
|
|
24
|
+
timeout?: number | null;
|
|
25
|
+
/** Result TTL in seconds */
|
|
26
|
+
result_ttl?: number | null;
|
|
27
|
+
/** Number of times to repeat (None = infinite) */
|
|
28
|
+
repeat?: number | null;
|
|
29
|
+
/** Job description */
|
|
30
|
+
description?: string | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Response serializer for schedule actions (create/delete).
|
|
35
|
+
*
|
|
36
|
+
* Response model (includes read-only fields).
|
|
37
|
+
*/
|
|
38
|
+
export interface ScheduleActionResponse {
|
|
39
|
+
/** Action success status */
|
|
40
|
+
success: boolean;
|
|
41
|
+
/** Action result message */
|
|
42
|
+
message: string;
|
|
43
|
+
/** Job ID (for create action) */
|
|
44
|
+
job_id?: string | null;
|
|
45
|
+
/** Action performed (create/delete/cancel) */
|
|
46
|
+
action: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Serializer for scheduled job information.
|
|
51
|
+
*
|
|
52
|
+
* Response model (includes read-only fields).
|
|
53
|
+
*/
|
|
54
|
+
export interface ScheduledJob {
|
|
55
|
+
/** Job ID */
|
|
56
|
+
id: string;
|
|
57
|
+
/** Function path */
|
|
58
|
+
func: string;
|
|
59
|
+
/** Function arguments */
|
|
60
|
+
args?: Array<string>;
|
|
61
|
+
/** Function keyword arguments */
|
|
62
|
+
kwargs?: Record<string, any>;
|
|
63
|
+
/** Queue name */
|
|
64
|
+
queue_name: string;
|
|
65
|
+
/** Next scheduled time */
|
|
66
|
+
scheduled_time?: string | null;
|
|
67
|
+
/** Repeat interval in seconds */
|
|
68
|
+
interval?: number | null;
|
|
69
|
+
/** Cron expression */
|
|
70
|
+
cron?: string | null;
|
|
71
|
+
/** Job timeout in seconds */
|
|
72
|
+
timeout?: number | null;
|
|
73
|
+
/** Result TTL in seconds */
|
|
74
|
+
result_ttl?: number | null;
|
|
75
|
+
/** Times to repeat (None = infinite) */
|
|
76
|
+
repeat?: number | null;
|
|
77
|
+
/** Job description */
|
|
78
|
+
description?: string | null;
|
|
79
|
+
/** Job creation time */
|
|
80
|
+
created_at?: string | null;
|
|
81
|
+
/** Job metadata */
|
|
82
|
+
meta?: Record<string, any>;
|
|
83
|
+
}
|
|
84
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as Models from "./models";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* API endpoints for RQ Testing.
|
|
6
|
+
*/
|
|
7
|
+
export class CfgRqTesting {
|
|
8
|
+
private client: any;
|
|
9
|
+
|
|
10
|
+
constructor(client: any) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* List test scenarios
|
|
16
|
+
*
|
|
17
|
+
* Returns list of all available test scenarios with metadata.
|
|
18
|
+
*/
|
|
19
|
+
async list(): Promise<any> {
|
|
20
|
+
const response = await this.client.request('GET', "/cfg/rq/testing/");
|
|
21
|
+
return response;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async cleanupDestroy(delete_demo_jobs_only?: boolean, queue?: string, registries?: string): Promise<Models.TestingActionResponse>;
|
|
25
|
+
async cleanupDestroy(params?: { delete_demo_jobs_only?: boolean; queue?: string; registries?: string }): Promise<Models.TestingActionResponse>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Cleanup test jobs
|
|
29
|
+
*
|
|
30
|
+
* Clean demo jobs from registries.
|
|
31
|
+
*/
|
|
32
|
+
async cleanupDestroy(...args: any[]): Promise<Models.TestingActionResponse> {
|
|
33
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
34
|
+
|
|
35
|
+
let params;
|
|
36
|
+
if (isParamsObject) {
|
|
37
|
+
params = args[0];
|
|
38
|
+
} else {
|
|
39
|
+
params = { delete_demo_jobs_only: args[0], queue: args[1], registries: args[2] };
|
|
40
|
+
}
|
|
41
|
+
const response = await this.client.request('DELETE', "/cfg/rq/testing/cleanup/", { params });
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async resultsRetrieve(queue?: string, scenario?: string): Promise<any>;
|
|
46
|
+
async resultsRetrieve(params?: { queue?: string; scenario?: string }): Promise<any>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get test results
|
|
50
|
+
*
|
|
51
|
+
* Get aggregated results of test jobs execution.
|
|
52
|
+
*/
|
|
53
|
+
async resultsRetrieve(...args: any[]): Promise<any> {
|
|
54
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
55
|
+
|
|
56
|
+
let params;
|
|
57
|
+
if (isParamsObject) {
|
|
58
|
+
params = args[0];
|
|
59
|
+
} else {
|
|
60
|
+
params = { queue: args[0], scenario: args[1] };
|
|
61
|
+
}
|
|
62
|
+
const response = await this.client.request('GET', "/cfg/rq/testing/results/", { params });
|
|
63
|
+
return response;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Run demo task
|
|
68
|
+
*
|
|
69
|
+
* Enqueue a single demo task for testing.
|
|
70
|
+
*/
|
|
71
|
+
async runDemoCreate(data: Models.RunDemoRequestRequest): Promise<Models.TestingActionResponse> {
|
|
72
|
+
const response = await this.client.request('POST', "/cfg/rq/testing/run-demo/", { body: data });
|
|
73
|
+
return response;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Schedule demo tasks
|
|
78
|
+
*
|
|
79
|
+
* Register demo scheduled tasks using rq-scheduler.
|
|
80
|
+
*/
|
|
81
|
+
async scheduleDemoCreate(data: any): Promise<Models.TestingActionResponse> {
|
|
82
|
+
const response = await this.client.request('POST', "/cfg/rq/testing/schedule-demo/", { body: data });
|
|
83
|
+
return response;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Stress test
|
|
88
|
+
*
|
|
89
|
+
* Generate N jobs for load testing and performance benchmarking.
|
|
90
|
+
*/
|
|
91
|
+
async stressTestCreate(data: Models.StressTestRequestRequest): Promise<Models.TestingActionResponse> {
|
|
92
|
+
const response = await this.client.request('POST', "/cfg/rq/testing/stress-test/", { body: data });
|
|
93
|
+
return response;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
}
|