-
Notifications
You must be signed in to change notification settings - Fork 0
/
definitions.go
1226 lines (913 loc) · 32.7 KB
/
definitions.go
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
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
package common
import (
"math"
"time"
)
const (
// HTTPCreate create method
HTTPCreate = "POST"
// HTTPSelectPost select method
HTTPSelectPost = "POST"
// HTTPSelectGet select method
HTTPSelectGet = "GET"
// HTTPUpdate update method
HTTPUpdate = "PUT"
// HTTPDelete delete method
HTTPDelete = "DELETE"
// BKNoLimit no limit definition
BKNoLimit = 999999999
// max limit of a page
BKMaxPageSize = 1000
// max limit of instance count
BKMaxInstanceLimit = 500
// 一次最大操作记录数
BKMaxRecordsAtOnce = 2000
// BKDefaultLimit the default limit definition
BKDefaultLimit = 20
// BKAuditLogPageLimit the audit log page limit
BKAuditLogPageLimit = 200
// BKParent the parent code
BKParent = 1
// BKChild the child code
BKChild = 2
// BKParentStr the parent name
BKParentStr = "bk_parentid"
// BKChildStr the child name
BKChildStr = "bk_childid"
// BKInstParentStr the inst parent name
BKInstParentStr = "bk_parent_id"
// BKDefaultOwnerID the default owner value
BKDefaultOwnerID = "0"
// BKSuperOwnerID the super owner value
BKSuperOwnerID = "superadmin"
// BKDefaultDirSubArea the default dir subarea
BKDefaultDirSubArea = 0
// BKTimeTypeParseFlag the time flag
BKTimeTypeParseFlag = "cc_time_type"
// BKTopoBusinessLevelLimit the mainline topo level limit
BKTopoBusinessLevelLimit = "level.businessTopoMax"
// BKTopoBusinessLevelDefault the mainline topo level default level
BKTopoBusinessLevelDefault = 7
)
const (
// BKInnerObjIDApp the inner object
BKInnerObjIDApp = "biz"
// BKInnerObjIDSet the inner object
BKInnerObjIDSet = "set"
// BKInnerObjIDModule the inner object
BKInnerObjIDModule = "module"
// BKInnerObjIDHost the inner object
BKInnerObjIDHost = "host"
// BKInnerObjIDObject the inner object
BKInnerObjIDObject = "object"
// BKInnerObjIDProc the inner object
BKInnerObjIDProc = "process"
// BKInnerObjIDConfigTemp the inner object
BKInnerObjIDConfigTemp = "config_template"
// BKInnerObjIDTempVerion the inner object
BKInnerObjIDTempVersion = "template_version"
// BKInnerObjIDPlat the inner object
BKInnerObjIDPlat = "plat"
// BKInnerObjIDSwitch the inner object
BKInnerObjIDSwitch = "bk_switch"
// BKInnerObjIDRouter the inner object
BKInnerObjIDRouter = "bk_router"
// BKInnerObjIDBlance the inner object
BKInnerObjIDBlance = "bk_load_balance"
// BKInnerObjIDFirewall the inner object
BKInnerObjIDFirewall = "bk_firewall"
// BKInnerObjIDWeblogic the inner object
BKInnerObjIDWeblogic = "bk_weblogic"
// BKInnerObjIDTomcat the inner object
BKInnerObjIDTomcat = "bk_tomcat"
// BKInnerObjIDApache the inner object
BKInnerObjIDApache = "bk_apache"
)
// Revision
const (
RevisionEnterprise = "enterprise"
RevisionCommunity = "community"
RevisionOpensource = "opensource"
)
const (
// used only for host search
BKDBMULTIPLELike = "$multilike"
// BKDBIN the db operator
BKDBIN = "$in"
// BKDBOR the db operator
BKDBOR = "$or"
// BKDBAND the db operator
BKDBAND = "$and"
// BKDBLIKE the db operator
BKDBLIKE = "$regex"
// BKDBOPTIONS the db operator,used with $regex
// detail to see https://docs.mongodb.com/manual/reference/operator/query/regex/#op._S_options
BKDBOPTIONS = "$options"
// BKDBEQ the db operator
BKDBEQ = "$eq"
// BKDBNE the db operator
BKDBNE = "$ne"
// BKDBNIN the db oeprator
BKDBNIN = "$nin"
// BKDBLT the db operator
BKDBLT = "$lt"
// BKDBLTE the db operator
BKDBLTE = "$lte"
// BKDBGT the db operator
BKDBGT = "$gt"
// BKDBGTE the db opeartor
BKDBGTE = "$gte"
// BKDBExists the db opeartor
BKDBExists = "$exists"
// BKDBNot the db opeartor
BKDBNot = "$not"
// BKDBCount the db opeartor
BKDBCount = "$count"
// BKDBGroup the db opeartor
BKDBGroup = "$group"
// BKDBMatch the db opeartor
BKDBMatch = "$match"
// BKDBSum the db opeartor
BKDBSum = "$sum"
// BKDBPush the db opeartor
BKDBPush = "$push"
// BKDBUNSET the db opeartor
BKDBUNSET = "$unset"
// BKDBAddToSet The $addToSet operator adds a value to an array unless the value is already present, in which case $addToSet does nothing to that array.
BKDBAddToSet = "$addToSet"
// BKDBPull The $pull operator removes from an existing array all instances of a value or values that match a specified condition.
BKDBPull = "$pull"
// BKDBAll matches arrays that contain all elements specified in the query.
BKDBAll = "$all"
// BKDBSize selects documents if the array field is a specified size.
BKDBSize = "$size"
// BKDBSortFieldSep the db sort field split char
BKDBSortFieldSep = ","
)
const (
// DefaultResModuleName the default idle module name
DefaultResModuleName string = "空闲机"
// DefaultFaultModuleName the default fault module name
DefaultFaultModuleName string = "故障机"
// DefaultRecycleModuleName the default fault module name
DefaultRecycleModuleName string = "待回收"
)
const (
// BKFieldID the id definition
BKFieldID = "id"
BKFieldName = "name"
// BKDefaultField the default field
BKDefaultField = "default"
// BKOwnerIDField the owner field
BKOwnerIDField = "bk_supplier_account"
// BKAppIDField the appid field
BKAppIDField = "bk_biz_id"
// BKIPArr the ip address
BKIPArr = "ipArr"
// BKAssetIDField the asset id field
BKAssetIDField = "bk_asset_id"
// BKSNField the sn field
BKSNField = "bk_sn"
// BKHostInnerIPField the host innerip field
BKHostInnerIPField = "bk_host_innerip"
// BKHostCloudRegionField the host cloud region field
BKHostCloudRegionField = "bk_cloud_region"
// BKHostOuterIPField the host outerip field
BKHostOuterIPField = "bk_host_outerip"
// BKCloudInstIDField the cloud instance id field
BKCloudInstIDField = "bk_cloud_inst_id"
// BKCloudHostStatusField the cloud host status field
BKCloudHostStatusField = "bk_cloud_host_status"
// TimeTransferModel the time transferModel field
TimeTransferModel = "2006-01-02 15:04:05"
// BKCloudTaskID the cloud sync task id
BKCloudTaskID = "bk_task_id"
// BKNewAddHost the cloud sync new add hosts
BKNewAddHost = "new_add"
// BKImportFrom the host import from field
BKImportFrom = "import_from"
// BKHostIDField the host id field
BKHostIDField = "bk_host_id"
// BKHostNameField the host name field
BKHostNameField = "bk_host_name"
// BKAppNameField the app name field
BKAppNameField = "bk_biz_name"
// BKSetIDField the setid field
BKSetIDField = "bk_set_id"
// BKSetNameField the set name field
BKSetNameField = "bk_set_name"
// BKModuleIDField the module id field
BKModuleIDField = "bk_module_id"
// BKModuleNameField the module name field
BKModuleNameField = "bk_module_name"
HostApplyEnabledField = "host_apply_enabled"
// BKSubscriptionIDField the subscription id field
BKSubscriptionIDField = "subscription_id"
// BKSubscriptionNameField the subscription name field
BKSubscriptionNameField = "subscription_name"
// BKOSTypeField the os type field
BKOSTypeField = "bk_os_type"
// BKOSNameField the os name field
BKOSNameField = "bk_os_name"
// BKHttpGet the http get
BKHttpGet = "GET"
// BKTencentCloudTimeOut the tencent cloud timeout
BKTencentCloudTimeOut = 10
// TencentCloudUrl the tencent cloud url
TencentCloudUrl = "cvm.tencentcloudapi.com"
// TencentCloudSignMethod the tencent cloud sign method
TencentCloudSignMethod = "HmacSHA1"
// BKCloudIDField the cloud id field
BKCloudIDField = "bk_cloud_id"
// BKCloudNameField the cloud name field
BKCloudNameField = "bk_cloud_name"
// BKObjIDField the obj id field
BKObjIDField = "bk_obj_id"
// BKObjNameField the obj name field
BKObjNameField = "bk_obj_name"
// BKObjIconField the obj icon field
BKObjIconField = "bk_obj_icon"
// BKInstIDField the inst id field
BKInstIDField = "bk_inst_id"
// BKInstNameField the inst name field
BKInstNameField = "bk_inst_name"
// ExportCustomFields the use custom display columns
ExportCustomFields = "export_custom_fields"
// BKProcIDField the proc id field
BKProcIDField = "bk_process_id"
// BKConfTempId is the config template id field
BKConfTempIdField = "bk_conftemp_id"
// BKProcNameField the proc name field
BKProcNameField = "bk_process_name"
// BKTemlateIDField the process template id field
BKTemlateIDField = "template_id"
// BKVesionIDField the version id field
BKVersionIDField = "version_id"
// BKTemplateNameField the template name field
BKTemplateNameField = "template_name"
// BKFileNameField the file name field
BKFileNameField = "file_name"
// BKPropertyIDField the propety id field
BKPropertyIDField = "bk_property_id"
// BKPropertyNameField the property name field
BKPropertyNameField = "bk_property_name"
BKPropertyIndexField = "bk_property_index"
// BKPropertyTypeField the property type field
BKPropertyTypeField = "bk_property_type"
BKPropertyGroupField = "bk_property_group"
// BKPropertyValueField the property value field
BKPropertyValueField = "bk_property_value"
// BKObjAttIDField the obj att id field
BKObjAttIDField = "bk_object_att_id"
// BKClassificationIDField the classification id field
BKClassificationIDField = "bk_classification_id"
// BKClassificationNameField the classification name field
BKClassificationNameField = "bk_classification_name"
// BKClassificationIconField the classification icon field
BKClassificationIconField = "bk_classification_icon"
// BKPropertyGroupIDField the property group id field
BKPropertyGroupIDField = "bk_group_id"
// BKPropertyGroupNameField the property group name field
BKPropertyGroupNameField = "bk_group_name"
// BKPropertyGroupIndexField the property group index field
BKPropertyGroupIndexField = "bk_group_index"
// BKAsstObjIDField the property obj id field
BKAsstObjIDField = "bk_asst_obj_id"
// BKAsstInstIDField the property inst id field
BKAsstInstIDField = "bk_asst_inst_id"
// BKOptionField the option field
BKOptionField = "option"
// BKAuditTypeField the audit type field
BKAuditTypeField = "audit_type"
// BKResourceTypeField the audit resource type field
BKResourceTypeField = "resource_type"
// BKOperateFromField the platform where operation from field
BKOperateFromField = "operate_from"
// BKOperationDetailField the audit operation detail field
BKOperationDetailField = "operation_detail"
// BKOperationTimeField the audit operation time field
BKOperationTimeField = "operation_time"
// BKResourceIDField the audit resource ID field
BKResourceIDField = "resource_id"
// BKResourceNameField the audit resource name field
BKResourceNameField = "resource_name"
// BKLabelField the audit resource name field
BKLabelField = "label"
// BKSetEnvField the set env field
BKSetEnvField = "bk_set_env"
// BKSetStatusField the set status field
BKSetStatusField = "bk_service_status"
// BKSetDescField the set desc field
BKSetDescField = "bk_set_desc"
// BKSetCapacityField the set capacity field
BKSetCapacityField = "bk_capacity"
// BKPort the port
BKPort = "port"
// BKProcPortEnable whether enable port, enable port use for monitor app. default value
BKProcPortEnable = "bk_enable_port"
// BKProcGatewayIP the process gateway ip
BKProcGatewayIP = "bk_gateway_ip"
// BKProcGatewayPort the process gateway port
BKProcGatewayPort = "bk_gateway_port"
// BKProcGatewayProtocol the process gateway protocol
BKProcGatewayProtocol = "bk_gateway_protocol"
// BKProcGatewayCity the process gateway city
BKProcGatewayCity = "bk_gateway_city"
// BKProcBindInfo the process bind info
BKProcBindInfo = "bind_info"
// BKUser the user
BKUser = "user"
// BKProtocol the protocol
BKProtocol = "protocol"
// BKIP the ip
BKIP = "ip"
// BKEnable the enable
BKEnable = "enable"
// the process object name
BKProcessObjectName = "process"
// BKProcessIDField the process id field
BKProcessIDField = "bk_process_id"
BKServiceInstanceIDField = "service_instance_id"
BKServiceTemplateIDField = "service_template_id"
BKProcessTemplateIDField = "process_template_id"
BKServiceCategoryIDField = "service_category_id"
BKSetTemplateIDField = "set_template_id"
BKSetTemplateVersionField = "set_template_version"
HostApplyRuleIDField = "host_apply_rule_id"
BKParentIDField = "bk_parent_id"
BKRootIDField = "bk_root_id"
// BKProcessNameField the process name field
BKProcessNameField = "bk_process_name"
// BKFuncIDField the func id field
BKFuncIDField = "bk_func_id"
// BKFuncName the function name
BKFuncName = "bk_func_name"
BKStartParamRegex = "bk_start_param_regex"
// BKBindIP the bind ip
BKBindIP = "bind_ip"
// BKWorkPath the work path
BKWorkPath = "work_path"
// BKIsPre the ispre field
BKIsPre = "ispre"
// BKIsIncrementField the isincrement field
BKIsIncrementField = "is_increment"
BKIsCollapseField = "is_collapse"
// BKProxyListField the proxy list field
BKProxyListField = "bk_proxy_list"
// BKIPListField the ip list field
BKIPListField = "ip_list"
// BKInvalidIPSField the invalid ips field
BKInvalidIPSField = "invalid_ips"
// BKGseProxyField the gse proxy
BKGseProxyField = "bk_gse_proxy"
// BKSubAreaField the sub area field
BKSubAreaField = "bk_cloud_id"
// BKProcField the proc field
BKProcField = "bk_process"
// BKMaintainersField the maintainers field
BKMaintainersField = "bk_biz_maintainer"
// BKProductPMField the product pm field
BKProductPMField = "bk_biz_productor"
// BKTesterField the tester field
BKTesterField = "bk_biz_tester"
// BKOperatorField the operator field
BKOperatorField = "operator" // the operator of app of module, is means a job position
// BKLifeCycleField the life cycle field
BKLifeCycleField = "life_cycle"
// BKDeveloperField the developer field
BKDeveloperField = "bk_biz_developer"
// BKLanguageField the language field
BKLanguageField = "language"
// BKBakOperatorField the bak operator field
BKBakOperatorField = "bk_bak_operator"
// BKTimeZoneField the time zone field
BKTimeZoneField = "time_zone"
// BKIsRequiredField the required field
BKIsRequiredField = "isrequired"
// BKModuleTypeField the module type field
BKModuleTypeField = "bk_module_type"
// BKOrgIPField the org ip field
BKOrgIPField = "bk_org_ip"
// BKDstIPField the dst ip field
BKDstIPField = "bk_dst_ip"
// BKDescriptionField the description field
BKDescriptionField = "description"
// BKIsOnlyField the isonly name field
BKIsOnlyField = "isonly"
// BKGseTaskIdField the gse taskid
BKGseTaskIDField = "task_id"
// BKTaskIdField the gse taskid
BKTaskIDField = "task_id"
// BKGseOpTaskIDField the gse taskid
BKGseOpTaskIDField = "gse_task_id"
BKProcPidFile = "pid_file"
BKProcStartCmd = "start_cmd"
BKProcStopCmd = "stop_cmd"
BKProcReloadCmd = "reload_cmd"
BKProcRestartCmd = "restart_cmd"
BKProcTimeOut = "timeout"
BKProcWorkPath = "work_path"
BKProcInstNum = "proc_num"
// BKInstKeyField the inst key field for metric discover
BKInstKeyField = "bk_inst_key"
// for net collect device
BKDeviceIDField = "device_id"
BKDeviceNameField = "device_name"
BKDeviceModelField = "device_model"
BKVendorField = "bk_vendor"
// for net collect property of device
BKNetcollectPropertyIDField = "netcollect_property_id"
BKOIDField = "oid"
BKPeriodField = "period"
BKActionField = "action"
BKProcinstanceID = "proc_instance_id"
// BKGseOpProcTaskDetailField gse operate process return detail
BKGseOpProcTaskDetailField = "detail"
BKGroupField = "group"
BKAttributeIDField = "bk_attribute_id"
)
const (
BKRequestField = "bk_request_id"
BKTxnIDField = "bk_txn_id"
)
// DefaultResSetName the inner module set
const DefaultResSetName string = "空闲机池"
// WhiteListAppName the white list app name
const WhiteListAppName = "蓝鲸"
// WhiteListSetName the white list set name
const WhiteListSetName = "公共组件"
// WhiteListModuleName the white list module name
const WhiteListModuleName = "gitserver"
// the inst record's logging information
const (
// CreatorField the creator
CreatorField = "creator"
// CreateTimeField the create time field
CreateTimeField = "create_time"
// ConfirmTimeField the cloud resource confirm time filed
ConfirmTimeField = "confirm_time"
// StartTimeField the cloud sync start time field
StartTimeFiled = "start_time"
// ModifierField the modifier field
ModifierField = "modifier"
// LastTimeField the last time field
LastTimeField = "last_time"
)
const (
// ValidCreate valid create
ValidCreate = "create"
// ValidUpdate valid update
ValidUpdate = "update"
)
// DefaultResSetFlag the default resource set flat
const DefaultResSetFlag int = 1
const DefaultFlagDefaultValue int = 0
// DefaultAppFlag the default app flag
const DefaultAppFlag int = 1
// DefaultAppName the default app name
const DefaultAppName string = "资源池"
const DefaultCloudName string = "default area"
const DefaultInstName string = "实例名"
// BKAppName the default app name
const BKAppName string = "蓝鲸"
// bk_classification_id value
const BKNetwork = "bk_network"
const (
SNMPActionGet = "get"
SNMPActionGetNext = "getnext"
)
const (
// DefaultResModuleFlag the default resource module flag
DefaultResModuleFlag int = 1
// DefaultFaultModuleFlag the default fault module flag
DefaultFaultModuleFlag int = 2
// NormalModuleFlag create module by user , default =0
NormalModuleFlag int = 0
// NormalSetDefaultFlag user create set default field value
NormalSetDefaultFlag int64 = 0
// DefaultRecycleModuleFlag default recycle module flag
DefaultRecycleModuleFlag int = 3
// DefaultResSelfDefinedModuleFlag the default resource self-defined module flag
DefaultResSelfDefinedModuleFlag int = 4
)
const (
DefaultModuleType string = "1"
)
const (
// FieldTypeSingleChar the single char filed type
FieldTypeSingleChar string = "singlechar"
// FieldTypeLongChar the long char field type
FieldTypeLongChar string = "longchar"
// FieldTypeInt the int field type
FieldTypeInt string = "int"
// FieldTypeFloat the float field type
FieldTypeFloat string = "float"
// FieldTypeEnum the enum field type
FieldTypeEnum string = "enum"
// FieldTypeDate the date field type
FieldTypeDate string = "date"
// FieldTypeTime the time field type
FieldTypeTime string = "time"
// FieldTypeUser the user field type
FieldTypeUser string = "objuser"
// FieldTypeTimeZone the timezone field type
FieldTypeTimeZone string = "timezone"
// FieldTypeBool the bool type
FieldTypeBool string = "bool"
// FieldTypeList the list type
FieldTypeList string = "list"
// FieldTypeTable the table type, inner type.
FieldTypeTable string = "table"
// FieldTypeOrganization the organization field type
FieldTypeOrganization string = "organization"
// FieldTypeSingleLenChar the single char length limit
FieldTypeSingleLenChar int = 256
// FieldTypeLongLenChar the long char length limit
FieldTypeLongLenChar int = 2000
// FieldTypeUserLenChar the user char length limit
FieldTypeUserLenChar int = 2000
//FieldTypeStrictCharRegexp the single char regex expression
FieldTypeStrictCharRegexp string = `^[a-zA-Z]\w*$`
//FieldTypeServiceCategoryRegexp the service category regex expression
FieldTypeServiceCategoryRegexp string = `^([\w\p{Han}]|[:\-\(\)])+$`
//FieldTypeMainlineRegexp the mainline instance name regex expression
FieldTypeMainlineRegexp string = `^[^#/,><|]+$`
//FieldTypeSingleCharRegexp the single char regex expression
//FieldTypeSingleCharRegexp string = `^([\w\p{Han}]|[,。?!={}|?<>~~、:#;%*——……&·$()‘’“”\[\]『』〔〕{}【】¥£♀‖〖〗《》「」:,;\."'\/\\\+\-\s#@\(\)])+$`
FieldTypeSingleCharRegexp string = `\S`
//FieldTypeLongCharRegexp the long char regex expression\
//FieldTypeLongCharRegexp string = `^([\w\p{Han}]|[,。?!={}|?<>~~、:#;%*——……&·$()‘’“”\[\]『』〔〕{}【】¥£♀‖〖〗《》「」:,;\."'\/\\\+\-\s#@\(\)])+$`
FieldTypeLongCharRegexp string = `\S`
)
const (
// HostAddMethodExcel add a host method
HostAddMethodExcel = "1"
// HostAddMethodAgent add a agent method
HostAddMethodAgent = "2"
// HostAddMethodAPI add api method
HostAddMethodAPI = "3"
// HostAddMethodExcelIndexOffset the height of the table header
HostAddMethodExcelIndexOffset = 3
// HostAddMethodExcelAssociationIndexOffset
HostAddMethodExcelAssociationIndexOffset = 1
/*EXCEL color AARRGGBB :
AA means Alpha
RRGGBB means Red, in hex.
GG means Red, in hex.
BB means Red, in hex.
*/
// ExcelHeaderFirstRowColor cell bg color
ExcelHeaderFirstRowColor = "FF92D050"
// ExcelHeaderFirstRowFontColor font color
ExcelHeaderFirstRowFontColor = "00000000"
// ExcelHeaderFirstRowRequireFontColor require font color
ExcelHeaderFirstRowRequireFontColor = "FFFF0000"
// ExcelHeaderOtherRowColor cell bg color
ExcelHeaderOtherRowColor = "FFC6EFCE"
// ExcelHeaderOtherRowFontColor font color
ExcelHeaderOtherRowFontColor = "FF000000"
// ExcelCellDefaultBorderColor black color
ExcelCellDefaultBorderColor = "FFD4D4D4"
// ExcelHeaderFirstColumnColor light gray
ExcelHeaderFirstColumnColor = "fee9da"
// ExcelFirstColumnCellColor dark gray
ExcelFirstColumnCellColor = "fabf8f"
// ExcelAsstPrimaryKeySplitChar split char
ExcelAsstPrimaryKeySplitChar = ","
// ExcelAsstPrimaryKeyJoinChar split char
ExcelAsstPrimaryKeyJoinChar = "="
// ExcelAsstPrimaryKeyRowChar split char
ExcelAsstPrimaryKeyRowChar = "\n"
// ExcelDelAsstObjectRelation delete asst object relation
ExcelDelAsstObjectRelation = "/"
// ExcelDataValidationListLen excel dropdown list item count
ExcelDataValidationListLen = 50
// ExcelCommentSheetCotentLangPrefixKey excel comment sheet centent language prefixe key
ExcelCommentSheetCotentLangPrefixKey = "import_comment"
// ExcelFirstColumnFieldName export excel first column for tips
ExcelFirstColumnFieldName = "field_name"
ExcelFirstColumnFieldType = "field_type"
ExcelFirstColumnFieldID = "field_id"
ExcelFirstColumnInstData = "inst_data"
)
const (
// InputTypeExcel data from excel
InputTypeExcel = "excel"
// InputTypeApiHostSync data from api for synchronize new host
InputTypeApiNewHostSync = "api_sync_host"
// BatchHostAddMaxRow batch sync add host max row
BatchHostAddMaxRow = 128
)
const (
// HTTPBKAPIErrorMessage apiserver error message
HTTPBKAPIErrorMessage = "bk_error_msg"
// HTTPBKAPIErrorCode apiserver error code
HTTPBKAPIErrorCode = "bk_error_code"
)
// KvMap the map definition
type KvMap map[string]interface{}
const (
// CCSystemOperatorUserName the system user
CCSystemOperatorUserName = "cc_system"
CCSystemCollectorUserName = "cc_collector"
)
// APIRsp the result the http requst
type APIRsp struct {
HTTPCode int `json:"-"`
Result bool `json:"result"`
Code int `json:"code"`
Message interface{} `json:"message"`
Data interface{} `json:"data"`
}
const (
// BKCacheKeyV3Prefix the prefix definition
BKCacheKeyV3Prefix = "cc:v3:"
)
// event cache keys
const (
EventCacheEventIDKey = BKCacheKeyV3Prefix + "event:inst_id"
EventCacheEventQueueKey = BKCacheKeyV3Prefix + "event:inst_queue"
EventCacheEventTxnQueuePrefix = BKCacheKeyV3Prefix + "event:inst_txn_queue:"
EventCacheEventTxnCommitQueueKey = BKCacheKeyV3Prefix + "event:inst_txn_commit_queue"
EventCacheEventTxnAbortQueueKey = BKCacheKeyV3Prefix + "event:inst_txn_abort_queue"
RedisSnapKeyPrefix = BKCacheKeyV3Prefix + "snapshot:"
)
// api cache keys
const (
ApiCacheLimiterRulePrefix = BKCacheKeyV3Prefix + "api:limiter_rule:"
)
const (
// BKHTTPHeaderUser current request http request header fields name for login user
BKHTTPHeaderUser = "BK_User"
// BKHTTPLanguage the language key word
BKHTTPLanguage = "HTTP_BLUEKING_LANGUAGE"
// BKHTTPOwnerID the owner
BKHTTPOwner = "HTTP_BK_SUPPLIER_ACCOUNT"
// BKHTTPOwnerID the owner id
BKHTTPOwnerID = "HTTP_BLUEKING_SUPPLIER_ID"
BKHTTPCookieLanugageKey = "blueking_language"
BKHTTPRequestAppCode = "Bk-App-Code"
BKHTTPRequestRealIP = "X-Real-Ip"
// BKHTTPCCRequestID cc request id cc_request_id
BKHTTPCCRequestID = "Cc_Request_Id"
// BKHTTPOtherRequestID esb request id X-Bkapi-Request-Id
BKHTTPOtherRequestID = "X-Bkapi-Request-Id"
BKHTTPSecretsToken = "BK-Secrets-Token"
BKHTTPSecretsProject = "BK-Secrets-Project"
BKHTTPSecretsEnv = "BK-Secrets-Env"
)
// transaction related
const (
TransactionIdHeader = "cc_transaction_id_string"
TransactionTimeoutHeader = "cc_transaction_timeout"
// mongodb default transaction timeout is 1 minute.
TransactionDefaultTimeout = 2 * time.Minute
)
const (
// DefaultAppLifeCycleNormal biz life cycle normal
DefaultAppLifeCycleNormal = "2"
)
// Host OS type enumeration value
const (
HostOSTypeEnumLinux = "1"
HostOSTypeEnumWindows = "2"
HostOSTypeEnumAIX = "3"
)
// integer const
const (
MaxUint64 = ^uint64(0)
MinUint64 = 0
MaxInt64 = int64(MaxUint64 >> 1)
MinInt64 = -MaxInt64 - 1
MaxUint = ^uint(0)
MinUint = 0
MaxInt = int(MaxUint >> 1)
MinInt = -MaxInt - 1
MaxFloat64 = math.MaxFloat64
MinFloat64 = -math.MaxFloat64
)
// flag
const HostCrossBizField = "hostcrossbiz"
const HostCrossBizValue = "e76fd4d1683d163e4e7e79cef45a74c1"
// config admin
const (
ConfigAdminID = "configadmin"
ConfigAdminValueField = "config"
)
const (
// APPConfigWaitTime application wait config from zookeeper time (unit sencend)
APPConfigWaitTime = 15
)
const (
// URLFilterWhiteList url filter white list not execute any filter
// multiple url separated by commas
URLFilterWhiteListSuffix = "/healthz,/version"
URLFilterWhiteListSepareteChar = ","
)
type DataStatusFlag string
const (
DataStatusDisabled DataStatusFlag = "disabled"
DataStatusEnable DataStatusFlag = "enable"
)
const (
BKDataStatusField = "bk_data_status"