-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalytics-admin.yaml
More file actions
799 lines (758 loc) · 27.6 KB
/
analytics-admin.yaml
File metadata and controls
799 lines (758 loc) · 27.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
openapi: 3.0.3
info:
title: Analytics Administration REST APIs
version: '8.0'
license:
name: Business Source License 1.1
url: https://github.com/couchbaselabs/cb-swagger/blob/release/8.0/licenses/BSL-Couchbase.txt
description: |
The Analytics Administration REST APIs are provided by the Analytics service.
These APIs enables you to manage and monitor the Analytics service.
servers:
- url: '{scheme}://{host}:{port}'
description: The URL scheme, host, and port are as follows.
variables:
scheme:
default: http
description: |-
The URL scheme.
Use `https` for secure access.
enum:
- http
- https
host:
default: localhost
description: The host name or IP address of a node running the Analytics Service.
port:
default: "8095"
description: |-
The Analytics Service REST port.
Use `18095` for secure access.
enum:
- "8095"
- "18095"
paths:
/analytics/admin/active_requests:
delete:
operationId: cancel_request
summary: Request Cancellation
description: Cancels an active request.
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
required:
- client_context_id
properties:
client_context_id:
type: string
description: Identifier passed by the client that is used to identify an active request to be cancelled.
security:
- AnalyticsManageAnalyticsSelect: []
responses:
"200":
description: >
The operation was successful.
"400":
description: >
Bad request.
Incorrect parameter or missing value.
"401":
$ref: '#/components/responses/Unauthorized'
"404":
description: >
Not found.
The path may be incorrect, or there is no active request with the specified identifier.
get:
operationId: return_active_requests
summary: Active Requests
description: Gets a list of the analytic requests that are running.
security:
- AnalyticsManageAnalyticsSelect: []
responses:
"200":
description: >
Success.
Returns an array id details on the running requests.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Request"
"401":
$ref: '#/components/responses/Unauthorized'
"404":
description: >
Not found.
The path may be incorrect.
/analytics/admin/completed_requests:
get:
operationId: completed_requests
summary: Completed Requests
description: Gets a list of all completed analytic requests.
security:
- AnalyticsManageAnalyticsSelect: []
responses:
"200":
description: >
Success. Returns a list of all completed analytic requests.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Request"
"401":
$ref: '#/components/responses/Unauthorized'
"404":
description: >
Not found.
The path may be incorrect.
/analytics/cluster:
get:
operationId: cluster_status
summary: Cluster Status
description: Shows various details about the current status of the Analytics Service, such as the service state, the state of each node partition, and the replicas of each partition.
security:
- ClusterReadPoolsRead: []
responses:
"200":
description: >
Success.
Returns an object giving the current status of the Analytics Service.
content:
application/json:
schema:
$ref: "#/components/schemas/Status"
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
/analytics/cluster/restart:
post:
operationId: restart_cluster
summary: Cluster Restart
description: Restarts all Analytics Service nodes in the cluster.
security:
- AnalyticsManage: []
responses:
"202":
description: >
Accepted.
Returns an object showing the status of the cluster.
content:
application/json:
schema:
type: object
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
/analytics/node/restart:
post:
operationId: restart_node
summary: Node Restart
description: Restarts the specified Analytics Service node.
security:
- AnalyticsManage: []
responses:
"202":
description: >
Accepted.
Returns an object showing the status of the node.
content:
application/json:
schema:
type: object
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
/analytics/status/ingestion:
get:
operationId: ingestion_status
summary: Ingestion Status
description: Shows the progress of ingestion by the Analytics service, for each Analytics collection.
security:
- AnalyticsManageAnalyticsSelect: []
responses:
"200":
description: >
Success.
Returns an object giving the ingestion status of each Analytics collection.
content:
application/json:
schema:
$ref: "#/components/schemas/Ingestion"
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
/analytics/node/agg/stats/remaining:
get:
operationId: monitor_node
deprecated: true
summary: Pending Mutations
description: >
Shows the number of mutations in the DCP queue that have not yet been ingested by the Analytics service, for each Analytics collection.
NOTE: This endpoint may not return meaningful results in Couchbase Server 7.0 and later.
The reported number of mutations may be different to the actual number of mutations in the Analytics collection.
For this reason, this endpoint has been deprecated, and you should use the [Ingestion Status](#ingestion_status) endpoint instead.
security:
- AnalyticsManageAnalyticsSelect: []
responses:
"200":
description: >
Success.
Returns an object giving the number of pending mutations for each Analytics collection.
content:
application/json:
schema:
$ref: "#/components/schemas/Mutations"
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
components:
schemas:
Status:
description: An object giving information about the status of the Analytics service.
type: object
properties:
authorizedNodes:
type: array
description: An array of strings, each of which is the ID of an authorized Analytics node.
items:
type: string
x-has-example: true
example:
- 86586a966202b5aa4aed31633f330aba
- 948fb3af810a9b7bc6c76e2a69ba35d9
ccNodeId:
type: string
description: The ID of the cluster controller node.
x-has-example: true
example: 86586a966202b5aa4aed31633f330aba
nodeConfigUri:
type: string
description: The path of the Analytics Node Configuration REST API.
x-has-example: true
example: /analytics/config/node
nodeDiagnosticsUri:
type: string
description: >
The path of the Analytics Node Diagnostics REST API.
For internal use only.
x-has-example: true
example: /analytics/node/diagnostics
nodeRestartUri:
type: string
description: The path of the Analytics Node Restart REST API.
x-has-example: true
example: /analytics/node/restart
nodeServiceUri:
type: string
description: The path of the Analytics Query Service REST API.
x-has-example: true
example: /analytics/service
serviceConfigUri:
type: string
description: The path of the Analytics Service Configuration REST API.
x-has-example: true
example: /analytics/config/service
serviceDiagnosticsUri:
type: string
description: >
The full URI of the Analytics Service Diagnostics REST API.
For internal use only.
x-has-example: true
example: http://localhost:8095/analytics/cluster/diagnostics
serviceRestartUri:
type: string
description: The full URI of the Analytics Cluster Restart REST API.
x-has-example: true
example: http://localhost:8095/analytics/cluster/restart
state:
type: string
enum:
- ACTIVE
- REBALANCE_REQUIRED
- UNUSABLE
- SHUTTING_DOWN
description: The state of the Analytics Service.
x-has-example: true
example: ACTIVE
nodes:
type: array
description: An array of objects, each giving information about one Analytics node.
items:
$ref: '#/components/schemas/StatusNodes'
partitions:
type: array
description: An array of objects, each giving information about one Analytics partition.
items:
$ref: '#/components/schemas/StatusPartitions'
partitionsTopology:
$ref: '#/components/schemas/StatusTopology'
StatusNodes:
type: object
title: Nodes
properties:
apiBase:
type: string
description: The URI scheme, host, and port for HTTP access to Analytics REST APIs on this node.
x-has-example: true
example: http://192.168.8.101:8095
apiBaseHttps:
type: string
description: The URI scheme, host, and port for secure HTTPS access to Analytics REST APIs on this node.
x-has-example: true
example: https://192.168.8.101:18095
nodeId:
type: string
description: The ID of the node.
x-has-example: true
example: 86586a966202b5aa4aed31633f330aba
nodeName:
type: string
description: The name or IP address of the node, including the cluster administration port.
x-has-example: true
example: 192.168.8.101:8091
StatusPartitions:
type: object
title: Partitions
properties:
active:
type: boolean
description: Indicates whether this partition is active.
x-has-example: true
example: true
activeNodeId:
type: string
description: The ID of the node where this partition is currently active.
x-has-example: true
example: 86586a966202b5aa4aed31633f330aba
iodeviceNum:
type: integer
description: The number of the IO Device where this partition is located.
x-has-example: true
example: 0
nodeId:
type: string
description: The ID of the node where this partition originated.
x-has-example: true
example: 86586a966202b5aa4aed31633f330aba
partitionId:
type: integer
description: The ID of this partition.
x-has-example: true
example: 0
path:
type: string
description: The path of the IO Device where this partition is located.
x-has-example: true
example: /data/@analytics/v_iodevice_0
pendingActivation:
type: boolean
description: Indicates whether this partition is waiting to become active.
x-has-example: true
example: false
StatusTopology:
type: object
description: An object giving information about the partition topology.
title: Partition Topology
properties:
balanced:
type: boolean
description: Indicates whether the Analytics nodes are balanced.
x-has-example: true
example: true
ccNodeId:
type: string
description: The ID of the cluster controller node.
x-has-example: true
example: 86586a966202b5aa4aed31633f330aba
metadataPartition:
type: integer
description: The ID of the metadata partition.
x-has-example: true
example: -1
numReplicas:
type: integer
description: The number of Analytics replicas.
x-has-example: true
example: 1
revision:
type: integer
description: The revision number of the partition topology.
x-has-example: true
example: 1
version:
type: integer
description: The version number of the partition topology.
x-has-example: true
example: 1
partitions:
type: array
description: An array of objects, each giving information about the state of one Analytics partition.
items:
$ref: '#/components/schemas/StatusTopologyState'
StatusTopologyState:
type: object
title: Partition States
properties:
id:
type: integer
description: The partition ID.
x-has-example: true
example: 0
master:
type: string
description: The ID of the node where the partition is currently active.
x-has-example: true
example: 86586a966202b5aa4aed31633f330aba
origin:
type: string
description: The ID of the node where the partition originated.
x-has-example: true
example: 86586a966202b5aa4aed31633f330aba
replicas:
type: array
description: An array of objects, each giving information about the state of one Analytics replica.
items:
$ref: '#/components/schemas/StatusTopologyStateReplicas'
StatusTopologyStateReplicas:
type: object
title: Replicas
properties:
location:
type: string
description: The name or IP address of the node where this replica is located, including the Analytics replication port.
x-has-example: true
example: 192.168.8.102:9120
nodeId:
type: string
description: The ID of the node where this replica is located.
x-has-example: true
example: 948fb3af810a9b7bc6c76e2a69ba35d9
status:
type: string
enum:
- IN_SYNC
- CATCHING_UP
- DISCONNECTED
description: The synchronization status of the replica.
x-has-example: true
example: IN_SYNC
syncProgress:
type: number
format: double
description: The percentage (fraction from 0 to 1) of synchronization progress for this replica at the current time.
minimum: 0
maximum: 1
x-has-example: true
example: 1
Ingestion:
description: An object containing a single links property.
type: object
properties:
links:
type: array
description: An array of objects, each giving information about a single linked Analytics scope.
items:
$ref: '#/components/schemas/IngestionLink'
IngestionLink:
type: object
title: Links
properties:
name:
type: string
description: The name of the link.
x-has-example: true
example: Local
scope:
type: string
description: The name of the Analytics scope.
x-has-example: true
example: travel-sample/inventory
status:
type: string
description: The status of the Analytics scope.
x-has-example: true
example: healthy
enum:
- healthy
- stopped
- unhealthy
- suspended
state:
type: array
description: >
An array of objects, each giving the ingestion state of one or more Analytics collections.
Analytics collections which have the same ingestion state within this Analytics scope are aggregated together.
items:
$ref: '#/components/schemas/IngestionLinkState'
IngestionLinkState:
type: object
title: States
required:
- timestamp
- progress
- scopes
properties:
timestamp:
type: integer
description: The time since epoch that this sample was calculated, in milliseconds.
x-has-example: true
example: 1631273689161
progress:
type: number
format: double
description: The percentage (fraction from 0 to 1) of ingestion progress at the current time.
minimum: 0
maximum: 1
x-has-example: true
example: 0
timeLag:
type: integer
description: >
The estimated time that the ingestion lags behind the Data service, in milliseconds.
Only displayed for Analytics collections that are not fully ingested.
x-has-example: true
example: 9744
itemsProcessed:
type: integer
description: >
The number of items ingested since last connect; that is, the total number of mutations and deletions processed.
Only displayed for Analytics collections that are not fully ingested.
Note that this value is reset on connect, so it may appear to get smaller.
x-has-example: true
example: 12301
seqnoAdvances:
type: integer
description: >
The change in sequence number (seqno) since last connect.
Only displayed for Analytics collections that are not fully ingested.
x-has-example: true
example: 61
scopes:
type: array
description: An array of objects, each one giving information about a single Analytics scope.
items:
$ref: '#/components/schemas/IngestionLinkStateScope'
IngestionLinkStateScope:
type: object
title: State Scopes
required:
- name
- collections
properties:
name:
type: string
description: The name of the Analytics scope.
x-has-example: true
example: travel-sample/inventory
collections:
type: array
description: An array of objects, each one giving information about a single Analytics collection.
items:
$ref: '#/components/schemas/IngestionLinkStateScopeColl'
IngestionLinkStateScopeColl:
type: object
title: State Collections
required:
- name
properties:
name:
type: string
description: The name of the Analytics collection.
x-has-example: true
example: route
Mutations:
description: An object containing one or more nested scope objects, one for each available Analytics scope.
type: object
title: Mutations
additionalProperties:
$ref: '#/components/schemas/MutationsColl'
example:
"`travel-sample`.inventory":
hotel: 1
landmark: 7
MutationsColl:
x-additionalPropertiesName: scope
type: object
description: >
An object containing one or more collection properties, one for each Analytics collection in the Analytics scope.
The name of the object is the name of the Analytics scope, in display form.
For example, `` `travel-sample`.inventory ``.
title: Collections
additionalProperties:
x-additionalPropertiesName: collection
type: integer
description: >
The number of mutations in the DCP queue that have not yet been ingested.
The name of the property is the name of the Analytics collection.
Request:
description: An object giving information about an Analytics service request.
type: object
properties:
cancellable:
type: boolean
description: Whether this request can be cancelled.
clientContextID:
type: string
description: A context ID for debugging purposes.
x-has-example: true
example: 28379d60-7139-44d6-b57a-95935540b586
elapsedTime:
type: number
description: How long the request has been running in seconds.
x-has-example: true
example: 0.126
jobCreateTime:
type: string
description: The date and time when the request's job was created.
x-has-example: true
example: 2024-05-28T19:47:02.512
jobId:
type: string
description: >
The request's job ID.
This value can be null if request did not run (for example, due to an error).
x-has-example: true
example: JID:0.14
jobQueueTime:
type: number
description: How long the request's job has been in the queue waiting to run in seconds.
x-has-example: true
example: 0
jobRequiredCPUs:
type: integer
description: The number of CPU cores required to run this request.
x-has-example: true
example: 1
jobRequiredMemory:
type: integer
description: >
The bytes of RAM being used to process this request.
x-has-example: true
example: 34013184
jobStartTime:
type: string
description: The date and time the request's job began running.
x-has-example: true
example: 2024-05-28T19:47:02.514
jobStatus:
type: string
enum:
- PENDING
- RUNNING
- TERMINATED
- FAILURE
- FAILURE_BEFORE_EXECUTION
- "null"
description: The state of the request's job.
x-has-example: true
example: RUNNING
plan:
type: string
description: The query plan for this request.
node:
type: string
description: The Analytics node that received the request.
x-has-example: true
example: 172.20.0.2:8095
remoteAddr:
type: string
description: The network address and port of the client that made the request.
x-has-example: true
example: 172.20.0.123:53612
requestTime:
type: string
description: The date and time the request was received.
x-has-example: true
example: 2024-05-28T19:44:07.730
scanConsistency:
type: string
description: The Scan Consistency setting used for the request's query.
x-has-example: true
example: not_bounded
state:
type: string
enum:
- received
- running
- cancelled
- completed
description: The state of the request.
x-has-example: true
example: running
statement:
type: string
description: The SQL++ query statement being run by the request.
x-has-example: true
example: select count(*) from hotel_endorsement_view;
userAgent:
type: string
description: The user agent string of the browser that made the request.
x-has-example: true
example: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0
users:
type: string
description: The user who made the request.
x-has-example: true
example: Administrator
uuid:
type: string
description: The unique identifier for this request.
x-has-example: true
example: 91f60338-a3e0-4163-9287-5e723fda29ef
responses:
Unauthorized:
description: >
Unauthorized.
The user name or password may be incorrect.
Returns an object containing an error message.
Refer to [Error Codes](/server/8.0/analytics/error-codes.html).
content:
application/json:
schema:
type: object
NotFound:
description: >
Not found.
The path may be incorrect.
securitySchemes:
AnalyticsManageAnalyticsSelect:
x-displayName: Analytics Manage / Analytics Select
type: http
scheme: basic
description: |
For the [Active Requests](#return_active_requests), [Request Cancellation](#cancel_request), [Completed Requests](#completed_requests), [Ingestion Status](#ingestion_status), and [Pending Mutations](#monitor_node) operations, users must have one of the following access roles:
* Full Admin
* Cluster Admin
* Analytics Manager
* Analytics Reader
* Analytics Select
* Analytics Admin
ClusterReadPoolsRead:
x-displayName: Cluster Read / Pools Read
type: http
scheme: basic
description: |
For the [Cluster Status](#cluster_status) operation, users must have one of the following access roles:
* Full Admin
* Cluster Admin
* Read-Only Admin
* Analytics Admin
AnalyticsManage:
x-displayName: Analytics Manage
type: http
scheme: basic
description: |
For the [Cluster Restart](#restart_cluster) and [Node Restart](#restart_node) operations, users must have one of the following RBAC roles:
* Full Admin
* Cluster Admin
* Analytics Admin