Best Python code snippet using autotest_python
SyncRules.py
Source:SyncRules.py
...13 * @return list14 '''15 def describeSyncRulesObjInfo(self, body):16 17 url = '{0}/active/rule/sync_obj_info'.format(config.get_default('default_api_host'))18 19 res = https._post(url, body, self.auth)20 return res2122 '''23 * å¢é失败DMLç»è®¡24 * 25 * @param dict $body åæ°è¯¦è§ API æå26 * @return list27 '''28 def describeSyncRulesDML(self, body):29 30 url = '{0}/active/rule/incre_dml_summary'.format(config.get_default('default_api_host'))31 32 res = https._post(url, body, self.auth)33 return res3435 '''36 * æ°å»º-åå¤-è·å代çç¶æ37 * 38 * @return list39 '''40 def describeSyncRulesProxyStatus(self, body):41 42 url = '{0}/active/rule/proxy_status'.format(config.get_default('default_api_host'))43 44 res = https._get(url, None, self.auth)45 return res4647 '''48 * æ°å»º49 * 50 * @param dict $body åæ°è¯¦è§ API æå51 * @return list52 '''53 def createSyncRules(self, body):54 55 url = '{0}/active/rule'.format(config.get_default('default_api_host'))56 57 res = https._post(url, body, self.auth)58 return res5960 '''61 * ä¿®æ¹62 * 63 * @param dict $body åæ°è¯¦è§ API æå64 * @return list65 '''66 def modifySyncRules(self, body):67 68 url = '{0}/active/rule'.format(config.get_default('default_api_host'))69 70 res = https._put(url, body, self.auth)71 return res7273 '''74 * å·²åæ¥ç对象75 * 76 * @param dict $body åæ°è¯¦è§ API æå77 * @return list78 '''79 def describeSyncRulesHasSync(self, body):80 81 url = '{0}/active/rule/sync_obj'.format(config.get_default('default_api_host'))82 83 res = https._post(url, body, self.auth)84 return res8586 '''87 * 失败ç对象88 * 89 * @param dict $body åæ°è¯¦è§ API æå90 * @return list91 '''92 def describeSyncRulesFailObj(self, body):93 94 url = '{0}/active/rule/fail_obj'.format(config.get_default('default_api_host'))95 96 res = https._post(url, body, self.auth)97 return res9899 '''100 * è£
载信æ¯æµéå¾101 * 102 * @param dict $body åæ°è¯¦è§ API æå103 * @return list104 '''105 def describeSyncRulesLoadInfo(self, body):106 107 url = '{0}/active/rule/load_info'.format(config.get_default('default_api_host'))108 109 res = https._post(url, body, self.auth)110 return res111112 '''113 * å é¤114 * 115 * @param dict $body åæ°è¯¦è§ API æå116 * @return list117 '''118 def deleteSyncRules(self, body):119 120 url = '{0}/active/rule'.format(config.get_default('default_api_host'))121 122 res = https._delete(url, body, self.auth)123 return res124125 '''126 * å表127 * 128 * @param dict $body åæ°è¯¦è§ API æå129 * @return list130 '''131 def listSyncRules(self, body):132 133 url = '{0}/active/rule'.format(config.get_default('default_api_host'))134 135 res = https._get(url, body, self.auth)136 return res137138 '''139 * æä½åæ¥è§å140 * 141 * @param dict $body åæ°è¯¦è§ API æå142 * @return list143 '''144 def operateSyncRules(self, body):145 146 url = '{0}/active/rule/operate'.format(config.get_default('default_api_host'))147 148 res = https._post(url, body, self.auth)149 return res150151 '''152 * ç¶æ153 * 154 * @param dict $body åæ°è¯¦è§ API æå155 * @return list156 '''157 def listSyncRulesStatus(self, body):158 159 url = '{0}/active/rule/status'.format(config.get_default('default_api_host'))160 161 res = https._get(url, body, self.auth)162 return res163164 '''165 * æµéå¾166 * 167 * @param dict $body åæ°è¯¦è§ API æå168 * @return list169 '''170 def describeSyncRulesMrtg(self, body):171 172 url = '{0}/active/rule/mrtg'.format(config.get_default('default_api_host'))173 174 res = https._post(url, body, self.auth)175 return res176177 '''178 * å¢é失败ddl179 * 180 * @param dict $body åæ°è¯¦è§ API æå181 * @return list182 '''183 def describeSyncRulesIncreDdl(self, body):184 185 url = '{0}/active/rule/incre_ddl'.format(config.get_default('default_api_host'))186 187 res = https._post(url, body, self.auth)188 return res189190 '''191 * è·åå个192 * 193 * @body['uuid'] String å¿
å¡« èç¹uuid194 * @param dict $body åæ°è¯¦è§ API æå195 * @return list196 '''197 def describeSyncRules(self, body, uuid):198 if uuid is None:199 exit()200 url = '{0}/active/rule/{1}'.format(config.get_default('default_api_host'), uuid)201 202 res = https._get(url, body, self.auth)203 return res204205 '''206 * å表207 * 208 * @param dict $body åæ°è¯¦è§ API æå209 * @return list210 '''211 def listObjCmp(self, body):212 213 url = '{0}/active/obj_cmp'.format(config.get_default('default_api_host'))214 215 res = https._get(url, body, self.auth)216 return res217218 '''219 * æ°å»º220 * 221 * @param dict $body åæ°è¯¦è§ API æå222 * @return list223 '''224 def createObjCmp(self, body):225 226 url = '{0}/active/obj_cmp'.format(config.get_default('default_api_host'))227 228 res = https._post(url, body, self.auth)229 return res230231 '''232 * å é¤233 * 234 * @param dict $body åæ°è¯¦è§ API æå235 * @return list236 '''237 def deleteObjCmp(self, body):238 239 url = '{0}/active/obj_cmp'.format(config.get_default('default_api_host'))240 241 res = https._delete(url, body, self.auth)242 return res243244 '''245 * è·åå个246 * 247 * @body['uuid'] String å¿
å¡« èç¹uuid248 * @return list249 '''250 def describeObjCmp(self, body, uuid):251 if uuid is None:252 exit()253 url = '{0}/active/obj_cmp/{1}'.format(config.get_default('default_api_host'), uuid)254 255 res = https._get(url, None, self.auth)256 return res257258 '''259 * æ¯è¾ç»ææ¶é´å表260 * 261 * @param dict $body åæ°è¯¦è§ API æå262 * @return list263 '''264 def listObjCmpResultTimeList(self, body):265 266 url = '{0}/active/obj_cmp/result_time_list'.format(config.get_default('default_api_host'))267 268 res = https._get(url, body, self.auth)269 return res270271 '''272 * æ¯è¾ä»»å¡ç»æ273 * 274 * @param dict $body åæ°è¯¦è§ API æå275 * @return list276 '''277 def describeObjCmpResult(self, body):278 279 url = '{0}/active/obj_cmp/result'.format(config.get_default('default_api_host'))280 281 res = https._get(url, body, self.auth)282 return res283284 '''285 * è·å对象æ¯è¾ç¶æ286 * 287 * @param dict $body åæ°è¯¦è§ API æå288 * @return list289 '''290 def listObjCmpStatus(self, body):291 292 url = '{0}/active/obj_cmp/status'.format(config.get_default('default_api_host'))293 294 res = https._post(url, body, self.auth)295 return res296297 '''298 * æ¯è¾ç»æçå é¤299 * 300 * @param dict $body åæ°è¯¦è§ API æå301 * @return list302 '''303 def describeObjCmpResultTimeList(self, body):304 305 url = '{0}/active/obj_cmp/result_time_list'.format(config.get_default('default_api_host'))306 307 res = https._delete(url, body, self.auth)308 return res309310 '''311 * æ¯è¾ç»æ详ç»ä¿¡æ¯312 * 313 * @param dict $body åæ°è¯¦è§ API æå314 * @return list315 '''316 def listObjCmpCmpInfo(self, body):317 318 url = '{0}/active/obj_cmp/cmp_info'.format(config.get_default('default_api_host'))319 320 res = https._get(url, body, self.auth)321 return res322323 '''324 * æ°å»º325 * 326 * @param dict $body åæ°è¯¦è§ API æå327 * @return list328 '''329 def createObjFix(self, body):330 331 url = '{0}/active/obj_fix'.format(config.get_default('default_api_host'))332 333 res = https._post(url, body, self.auth)334 return res335336 '''337 * è·åå个338 * 339 * @body['uuid'] String å¿
å¡« èç¹uuid340 * @param dict $body åæ°è¯¦è§ API æå341 * @return list342 '''343 def describeObjFix(self, body, uuid):344 if uuid is None:345 exit()346 url = '{0}/active/obj_fix/{1}'.format(config.get_default('default_api_host'), uuid)347 348 res = https._get(url, body, self.auth)349 return res350351 '''352 * å é¤353 * 354 * @param dict $body åæ°è¯¦è§ API æå355 * @return list356 '''357 def deleteObjFix(self, body):358 359 url = '{0}/active/obj_fix'.format(config.get_default('default_api_host'))360 361 res = https._delete(url, body, self.auth)362 return res363364 '''365 * å表366 * 367 * @param dict $body åæ°è¯¦è§ API æå368 * @return list369 '''370 def listObjFix(self, body):371 372 url = '{0}/active/obj_fix'.format(config.get_default('default_api_host'))373 374 res = https._get(url, body, self.auth)375 return res376377 '''378 * 对象修å¤-æä½379 * 380 * @param dict $body åæ°è¯¦è§ API æå381 * @return list382 '''383 def operateObjFix(self, body):384 385 url = '{0}/active/obj_fix/operate'.format(config.get_default('default_api_host'))386 387 res = https._post(url, body, self.auth)388 return res389390 '''391 * ä¿®å¤ç»æ392 * 393 * @param dict $body åæ°è¯¦è§ API æå394 * @return list395 '''396 def describeObjFixResult(self, body):397 398 url = '{0}/active/obj_fix/result'.format(config.get_default('default_api_host'))399 400 res = https._get(url, body, self.auth)401 return res402403 '''404 * -è·åç¶æ405 * 406 * @param dict $body åæ°è¯¦è§ API æå407 * @return list408 '''409 def listObjFixStatus(self, body):410 411 url = '{0}/active/obj_fix/status'.format(config.get_default('default_api_host'))412 413 res = https._post(url, body, self.auth)414 return res415416 '''417 * æ°å»º418 * 419 * @param dict $body åæ°è¯¦è§ API æå420 * @return list421 '''422 def createTbCmp(self, body):423 424 url = '{0}/active/tb_cmp'.format(config.get_default('default_api_host'))425 426 res = https._post(url, body, self.auth)427 return res428429 '''430 * è·åå个431 * 432 * @body['uuid'] String å¿
å¡« èç¹uuid433 * @param dict $body åæ°è¯¦è§ API æå434 * @return list435 '''436 def describeTbCmp(self, body, uuid):437 if uuid is None:438 exit()439 url = '{0}/active/tb_cmp/{1}'.format(config.get_default('default_api_host'), uuid)440 441 res = https._get(url, body, self.auth)442 return res443444 '''445 * å é¤446 * 447 * @param dict $body åæ°è¯¦è§ API æå448 * @return list449 '''450 def deleteTbCmp(self, body):451 452 url = '{0}/active/tb_cmp'.format(config.get_default('default_api_host'))453 454 res = https._delete(url, body, self.auth)455 return res456457 '''458 * å表459 * 460 * @param dict $body åæ°è¯¦è§ API æå461 * @return list462 '''463 def listTbCmp(self, body):464 465 url = '{0}/active/tb_cmp'.format(config.get_default('default_api_host'))466 467 res = https._get(url, body, self.auth)468 return res469470 '''471 * ç¶ææ¥å£472 * 473 * @param dict $body åæ°è¯¦è§ API æå474 * @return list475 '''476 def listTbCmpStatus(self, body):477 478 url = '{0}/active/tb_cmp/status'.format(config.get_default('default_api_host'))479 480 res = https._get(url, body, self.auth)481 return res482483 '''484 * åå²ç»æï¼æ¥ç表æ¯è¾æ¶é´ç»æéï¼485 * 486 * @param dict $body åæ°è¯¦è§ API æå487 * @return list488 '''489 def listTbCmpResultTimeList(self, body):490 491 url = '{0}/active/tb_cmp/result_time_list'.format(config.get_default('default_api_host'))492 493 res = https._get(url, body, self.auth)494 return res495496 '''497 * 表æ¯è¾-æä½498 * 499 * @param dict $body åæ°è¯¦è§ API æå500 * @return list501 '''502 def operateTbCmp(self, body):503 504 url = '{0}/active/tb_cmp/operate'.format(config.get_default('default_api_host'))505 506 res = https._post(url, body, self.auth)507 return res508509 '''510 * æ¯è¾ç»æçå é¤511 * 512 * @param dict $body åæ°è¯¦è§ API æå513 * @return list514 '''515 def describeTbCmpResuluTimeList(self, body):516 517 url = '{0}/active/tb_cmp/result_time_list'.format(config.get_default('default_api_host'))518 519 res = https._delete(url, body, self.auth)520 return res521522 '''523 * æ¯è¾ä»»å¡ç»æ524 * 525 * @param dict $body åæ°è¯¦è§ API æå526 * @return list527 '''528 def describeTbCmpResult(self, body):529 530 url = '{0}/active/tb_cmp/result'.format(config.get_default('default_api_host'))531 532 res = https._get(url, body, self.auth)533 return res534535 '''536 * é误信æ¯537 * 538 * @param dict $body åæ°è¯¦è§ API æå539 * @return list540 '''541 def describeTbCmpErrorMsg(self, body):542 543 url = '{0}/active/tb_cmp/error_msg'.format(config.get_default('default_api_host'))544 545 res = https._get(url, body, self.auth)546 return res547548 '''549 * æ¯è¾ç»æ550 * 551 * @param dict $body åæ°è¯¦è§ API æå552 * @return list553 '''554 def describeTbCmpCmpResult(self, body):555 556 url = '{0}/active/tb_cmp/cmp_result'.format(config.get_default('default_api_host'))557 558 res = https._get(url, body, self.auth)559 return res560561 '''562 * æ°å»º563 * 564 * @param dict $body åæ°è¯¦è§ API æå565 * @return list566 '''567 def createBkTakeover(self, body):568 569 url = '{0}/active/bk_takeover'.format(config.get_default('default_api_host'))570 571 res = https._post(url, body, self.auth)572 return res573574 '''575 * æ¥ç576 * 577 * @body['uuid'] String å¿
å¡« èç¹uuid578 * @return list579 '''580 def describeBkTakeover(self, body, uuid):581 if uuid is None:582 exit()583 url = '{0}/active/bk_takeover/{1}'.format(config.get_default('default_api_host'), uuid)584 585 res = https._get(url, None, self.auth)586 return res587588 '''589 * å é¤590 * 591 * @param dict $body åæ°è¯¦è§ API æå592 * @return list593 '''594 def deleteBkTakeover(self, body):595 596 url = '{0}/active/bk_takeover'.format(config.get_default('default_api_host'))597 598 res = https._delete(url, body, self.auth)599 return res600601 '''602 * æ¥ç®¡ç»æ603 * 604 * @param dict $body åæ°è¯¦è§ API æå605 * @return list606 '''607 def describeBkTakeoverResult(self, body):608 609 url = '{0}/active/bk_takeover/result'.format(config.get_default('default_api_host'))610 611 res = https._get(url, body, self.auth)612 return res613614 '''615 * å¤æºæ¥ç®¡-æä½616 * 617 * @param dict $body åæ°è¯¦è§ API æå618 * @return list619 '''620 def operateBkTakeover(self, body):621 622 url = '{0}/active/bk_takeover/operate'.format(config.get_default('default_api_host'))623 624 res = https._post(url, body, self.auth)625 return res626627 '''628 * è·åç¶æ629 * 630 * @param dict $body åæ°è¯¦è§ API æå631 * @return list632 '''633 def listBkTakeoverStatus(self, body):634 635 url = '{0}/active/bk_takeover/status'.format(config.get_default('default_api_host'))636 637 res = https._post(url, body, self.auth)638 return res639640 '''641 * å¤ç«¯æ¥ç®¡å表642 * 643 * @return list644 '''645 def listBkTakeover(self, ):646 647 url = '{0}/active/bk_takeover'.format(config.get_default('default_api_host'))648 649 res = https._get(url, None, self.auth)650 return res651652 '''653 * æ°å»º654 * 655 * @param dict $body åæ°è¯¦è§ API æå656 * @return list657 '''658 def createReverse(self, body):659 660 url = '{0}/active/reverse'.format(config.get_default('default_api_host'))661 662 res = https._post(url, body, self.auth)663 return res664665 '''666 * å é¤667 * 668 * @param dict $body åæ°è¯¦è§ API æå669 * @return list670 '''671 def deleteReverse(self, body):672 673 url = '{0}/active/reverse'.format(config.get_default('default_api_host'))674 675 res = https._delete(url, body, self.auth)676 return res677678 '''679 * è·åå个è§åä¿¡æ¯680 * 681 * @param dict $body åæ°è¯¦è§ API æå682 * @return list683 '''684 def describeReverse(self, body):685 686 url = '{0}/active/reverse/rule_single'.format(config.get_default('default_api_host'))687 688 res = https._get(url, body, self.auth)689 return res690691 '''692 * è·åå表693 * 694 * @param dict $body åæ°è¯¦è§ API æå695 * @return list696 '''697 def listReverse(self, body):698 699 url = '{0}/active/reverse'.format(config.get_default('default_api_host'))700 701 res = https._get(url, body, self.auth)702 return res703704 '''705 * ç¶æ706 * 707 * @param dict $body åæ°è¯¦è§ API æå708 * @return list709 '''710 def listReverseStatus(self, body):711 712 url = '{0}/active/reverse/status'.format(config.get_default('default_api_host'))713 714 res = https._get(url, body, self.auth)715 return res716717 '''718 * åæ¢719 * 720 * @param dict $body åæ°è¯¦è§ API æå721 * @return list722 '''723 def stopReverse(self, body):724 725 url = '{0}/active/reverse/stop'.format(config.get_default('default_api_host'))726 727 res = https._post(url, body, self.auth)728 return res729730 '''731 * éå¯ååä»»å¡732 * 733 * @param dict $body åæ°è¯¦è§ API æå734 * @return list735 '''736 def restartReverse(self, body):737 738 url = '{0}/active/reverse/restart'.format(config.get_default('default_api_host'))739 740 res = https._post(url, body, self.auth)741 return res742743 '''744 * æ¥ç745 * 746 * @param dict $body åæ°è¯¦è§ API æå747 * @return list748 '''749 def describeSingleReverse(self, body):750 751 url = '{0}/active/reverse'.format(config.get_default('default_api_host'))752 753 res = https._put(url, body, self.auth)754 return res755756 '''757 * éæ©ç¨æ·758 * 759 * @param dict $body åæ°è¯¦è§ API æå760 * @return list761 '''762 def describeRuleSelectUser(self, body):763 764 url = '{0}/active/rule/select_user'.format(config.get_default('default_api_host'))765 766 res = https._post(url, body, self.auth)767 return res768769 '''770 * è·åæ°æ®åºè¡¨å段771 * 772 * @param dict $body åæ°è¯¦è§ API æå773 * @return list774 '''775 def describeRuleZStructure(self, body):776 777 url = '{0}/active/rule/z_structure'.format(config.get_default('default_api_host'))778 779 res = https._post(url, body, self.auth)780 return res781782 '''783 * æ¥å¿784 * 785 * @param dict $body åæ°è¯¦è§ API æå786 * @return list787 '''788 def listRuleLog(self, body):789 790 url = '{0}/active/rule/log'.format(config.get_default('default_api_host'))791 792 res = https._post(url, body, self.auth)793 return res794795 '''796 * 表修å¤797 * 798 * @param dict $body åæ°è¯¦è§ API æå799 * @return list800 '''801 def describeRuleTableFix(self, body):802 803 url = '{0}/active/rule/table_fix'.format(config.get_default('default_api_host'))804 805 res = https._post(url, body, self.auth)806 return res807808 '''809 * å·²åæ¥è¡¨810 * 811 * @param dict $body åæ°è¯¦è§ API æå812 * @return list813 '''814 def listRuleSyncTable(self, body):815 816 url = '{0}/active/rule/sync_table'.format(config.get_default('default_api_host'))817 818 res = https._post(url, body, self.auth)819 return res820821 '''822 * å¢é失败dml823 * 824 * @param dict $body åæ°è¯¦è§ API æå825 * @return list826 '''827 def listRuleIncreDml(self, body):828 829 url = '{0}/active/rule/incre_dml'.format(config.get_default('default_api_host'))830 831 res = https._post(url, body, self.auth)832 return res833834 '''835 * è·åæ®çè§å836 * 837 * @return list838 '''839 def describeRuleGetFalseRule(self, body):840 841 url = '{0}/active/rule/get_false_rule'.format(config.get_default('default_api_host'))842 843 res = https._get(url, None, self.auth)844 return res845846 '''847 * è·åscnå·848 * 849 * @param dict $body åæ°è¯¦è§ API æå850 * @return list851 '''852 def describeRuleGetScn(self, body):853 854 url = '{0}/active/rule/get_scn'.format(config.get_default('default_api_host'))855 856 res = https._get(url, body, self.auth)857 return res858859 '''860 * è£
è½½ç»è®¡æ¥è¡¨861 * 862 * @param dict $body åæ°è¯¦è§ API æå863 * @return list864 '''865 def listRuleLoadReport(self, body):866 867 url = '{0}/active/rule/load_report'.format(config.get_default('default_api_host'))868 869 res = https._post(url, body, self.auth)870 return res871872 '''873 * è£
载延è¿ç»è®¡æ¥è¡¨874 * 875 * @param dict $body åæ°è¯¦è§ API æå876 * @return list877 '''878 def listRuleLoadDelayReport(self, body):879 880 url = '{0}/active/rule/load_delay_report'.format(config.get_default('default_api_host'))881 882 res = https._post(url, body, self.auth)883 return res884885 '''886 * æ°æ®åºé¢æ£887 * 888 * @param dict $body åæ°è¯¦è§ API æå889 * @return list890 '''891 def describeRuleDbCheck(self, body):892 893 url = '{0}/active/rule/db_check'.format(config.get_default('default_api_host'))894 895 res = https._post(url, body, self.auth)896 return res897898 '''899 * åæ¥è§å - æä½ ç»§ç»900 * 901 * @param dict $body åæ°è¯¦è§ API æå902 * @return list903 '''904 def resumeSyncRules(self, body):905906 url = '{0}/active/rule/operate'.format(config.get_default('default_api_host'))907908 res = https._post(url, body, self.auth)909 return res910911 '''912 * åæ¥è§å - æä½ åæ¢913 * 914 * @param dict $body åæ°è¯¦è§ API æå915 * @return list916 '''917 def stopSyncRules(self, body):918919 url = '{0}/active/rule/operate'.format(config.get_default('default_api_host'))920921 res = https._post(url, body, self.auth)922 return res923924 '''925 * åæ¥è§å - æä½ éå¯926 * 927 * @param dict $body åæ°è¯¦è§ API æå928 * @return list929 '''930 def restartSyncRules(self, body):931932 url = '{0}/active/rule/operate'.format(config.get_default('default_api_host'))933934 res = https._post(url, body, self.auth)935 return res936937 '''938 * åæ¥è§å - æä½ å¼å§æ¥å¿è§£æ939 * 940 * @param dict $body åæ°è¯¦è§ API æå941 * @return list942 '''943 def startAnalysisSyncRules(self, body):944945 url = '{0}/active/rule/operate'.format(config.get_default('default_api_host'))946947 res = https._post(url, body, self.auth)948 return res949950 '''951 * åæ¥è§å - æä½ åæ¢æ¥å¿è§£æ952 * 953 * @param dict $body åæ°è¯¦è§ API æå954 * @return list955 '''956 def stopAnalysisSyncRules(self, body):957958 url = '{0}/active/rule/operate'.format(config.get_default('default_api_host'))959960 res = https._post(url, body, self.auth)961 return res962963 '''964 * åæ¥è§å - æä½ éæ°æ¥å¿è§£æ965 * 966 * @param dict $body åæ°è¯¦è§ API æå967 * @return list968 '''969 def resetAnalysisSyncRules(self, body):970971 url = '{0}/active/rule/operate'.format(config.get_default('default_api_host'))972973 res = https._post(url, body, self.auth)974 return res975976 '''977 * åæ¥è§å - åæ¢è§å并åæ¢æ¥å¿è§£æ978 * 979 * @param dict $body åæ°è¯¦è§ API æå980 * @return list981 '''982 def stopAndStopanalysisSyncRules(self, body):983984 url = '{0}/active/rule/operate'.format(config.get_default('default_api_host'))985986 res = https._post(url, body, self.auth)987 return res988989 '''990 * 对象修å¤-æä½ éå¯991 * 992 * @param dict $body åæ°è¯¦è§ API æå993 * @return list994 '''995 def restartObjFix(self, body):996997 url = '{0}/active/obj_fix/operate'.format(config.get_default('default_api_host'))998999 res = https._post(url, body, self.auth)1000 return res10011002 '''1003 * 对象修å¤-æä½ åæ¢1004 * 1005 * @param dict $body åæ°è¯¦è§ API æå1006 * @return list1007 '''1008 def stopObjFix(self, body):10091010 url = '{0}/active/obj_fix/operate'.format(config.get_default('default_api_host'))10111012 res = https._post(url, body, self.auth)1013 return res10141015 '''1016 * 表æ¯è¾-æä½ åæ¢1017 * 1018 * @param dict $body åæ°è¯¦è§ API æå1019 * @return list1020 '''1021 def stopTbCmp(self, body):10221023 url = '{0}/active/tb_cmp/operate'.format(config.get_default('default_api_host'))10241025 res = https._post(url, body, self.auth)1026 return res10271028 '''1029 * 表æ¯è¾-æä½ éå¯1030 * 1031 * @param dict $body åæ°è¯¦è§ API æå1032 * @return list1033 '''1034 def restartTbCmp(self, body):10351036 url = '{0}/active/tb_cmp/operate'.format(config.get_default('default_api_host'))10371038 res = https._post(url, body, self.auth)1039 return res10401041 '''1042 * å¤æºæ¥ç®¡-æä½ åæ¢1043 * 1044 * @param dict $body åæ°è¯¦è§ API æå1045 * @return list1046 '''1047 def stopBkTakeover(self, body):10481049 url = '{0}/active/bk_takeover/operate'.format(config.get_default('default_api_host'))10501051 res = https._post(url, body, self.auth)1052 return res10531054 '''1055 * å¤æºæ¥ç®¡-æä½ éå¯1056 * 1057 * @param dict $body åæ°è¯¦è§ API æå1058 * @return list1059 '''1060 def restartBkTakeover(self, body):10611062 url = '{0}/active/bk_takeover/operate'.format(config.get_default('default_api_host'))10631064 res = https._post(url, body, self.auth)1065 return res10661067 '''1068 * æ¥å¿ä¸è½½1069 * 1070 * @param dict $body åæ°è¯¦è§ API æå1071 * @return list1072 '''1073 def downloadLog(self, body):10741075 url = '{0}/active/rule/log_download'.format(config.get_default('default_api_host'))10761077 res = https._get(url, body, self.auth)1078 return res
...
Storage.py
Source:Storage.py
...9 * @param dict $body åæ°è¯¦è§ API æå10 * @return list11 '''12 def createStorageConfig(self, body):13 url = '{0}/storage'.format(config.get_default('default_api_host'))14 res = https._post(url, body, self.auth)15 return res16 '''17 * ä¿®æ¹18 * 19 * @body['uuid'] String å¿
å¡« èç¹uuid20 * @param dict $body åæ°è¯¦è§ API æå21 * @return list22 '''23 def modifyStorageConfig(self, body):24 url = '{0}/storage/{1}'.format(config.get_default('default_api_host'), body['uuid'])25 del body['uuid']26 res = https._put(url, body, self.auth)27 return res28 '''29 * è·åå个30 * 31 * @body['uuid'] String å¿
å¡« èç¹uuid32 * @return list33 '''34 def describeStorageConfig(self, body):35 if body is None or 'uuid' not in body: exit()36 url = '{0}/storage/{1}'.format(config.get_default('default_api_host'), body['uuid'])37 res = https._get(url, None, self.auth)38 return res39 '''40 * è·åå表41 * 42 * @return list43 '''44 def listStorageConfig(self, ):45 url = '{0}/storage'.format(config.get_default('default_api_host'))46 res = https._get(url, None, self.auth)47 return res48 '''49 * å é¤50 * 51 * @param dict $body åæ°è¯¦è§ API æå52 * @return list53 '''54 def deleteStorageConfig(self, body):55 url = '{0}/storage'.format(config.get_default('default_api_host'))56 res = https._delete(url, body, self.auth)57 return res58 '''59 * 容éä¿¡æ¯60 * 61 * @param dict $body åæ°è¯¦è§ API æå62 * @return list63 '''64 def listStorageInfo(self, body):65 url = '{0}/ /storage/info'.format(config.get_default('default_api_host'))66 res = https._get(url, body, self.auth)67 return res68 '''69 * è·åå¯ç¨èç¹å表70 * 71 * @return list72 '''73 def listAvailableNode(self, ):74 url = '{0}/storage/node'.format(config.get_default('default_api_host'))75 res = https._get(url, None, self.auth)76 return res77 '''78 * ---------------------79 * 80 * @return list81 '''82 '''83 * è·åå表84 * 85 * @param dict $body åæ°è¯¦è§ API æå86 * @return list87 '''88 def listDevice(self, body):89 url = '{0}/storage/dev'.format(config.get_default('default_api_host'))90 res = https._get(url, body, self.auth)91 return res92 '''93 * è·åå¯ç¨å表94 * 95 * @param dict $body åæ°è¯¦è§ API æå96 * @return list97 '''98 def listAvailableDevice(self, body):99 url = '{0}/storage/available_dev'.format(config.get_default('default_api_host'))100 res = https._get(url, body, self.auth)101 return res102 '''103 * ---------------------104 * 105 * @return list106 '''107 '''108 * å建109 * 110 * @param dict $body åæ°è¯¦è§ API æå111 * @return list112 '''113 def createPool(self, body):114 url = '{0}/storage/pool'.format(config.get_default('default_api_host'))115 res = https._post(url, body, self.auth)116 return res117 '''118 * æ©å±119 * 120 * @param dict $body åæ°è¯¦è§ API æå121 * @return list122 '''123 def expandPool(self, body):124 url = '{0}/storage/pool'.format(config.get_default('default_api_host'))125 res = https._put(url, body, self.auth)126 return res127 '''128 * å é¤129 * 130 * @param dict $body åæ°è¯¦è§ API æå131 * @return list132 '''133 def deletePool(self, body):134 url = '{0}/storage/pool'.format(config.get_default('default_api_host'))135 res = https._delete(url, body, self.auth)136 return res137 '''138 * è·å139 * 140 * @param dict $body åæ°è¯¦è§ API æå141 * @return list142 '''143 def listPool(self, body):144 url = '{0}/storage/pool'.format(config.get_default('default_api_host'))145 res = https._get(url, body, self.auth)146 return res147 '''148 * è·åä¿¡æ¯149 * 150 * @param dict $body åæ°è¯¦è§ API æå151 * @return list152 '''153 def listPoolInfo(self, body):154 url = '{0}/storage/pool/info'.format(config.get_default('default_api_host'))155 res = https._get(url, body, self.auth)156 return res157 '''158 * ---------------------159 * 160 * @return list161 '''162 '''163 * å建164 * 165 * @param dict $body åæ°è¯¦è§ API æå166 * @return list167 '''168 def createFs(self, body):169 url = '{0}/storage/file_system'.format(config.get_default('default_api_host'))170 res = https._post(url, body, self.auth)171 return res172 '''173 * å é¤174 * 175 * @param dict $body åæ°è¯¦è§ API æå176 * @return list177 '''178 def deleteFs(self, body):179 url = '{0}/storage/file_system'.format(config.get_default('default_api_host'))180 res = https._delete(url, body, self.auth)181 return res182 '''183 * è·å184 * 185 * @param dict $body åæ°è¯¦è§ API æå186 * @return list187 '''188 def listFs(self, body):189 url = '{0}/storage/file_system'.format(config.get_default('default_api_host'))190 res = https._get(url, body, self.auth)191 return res192 '''193 * å建194 * 195 * @param dict $body åæ°è¯¦è§ API æå196 * @return list197 '''198 def createFsSnapshot(self, body):199 url = '{0}/storage/file_system/snap'.format(config.get_default('default_api_host'))200 res = https._post(url, body, self.auth)201 return res202 '''203 * å é¤204 * 205 * @param dict $body åæ°è¯¦è§ API æå206 * @return list207 '''208 def deleteFsSnapshot(self, body):209 url = '{0}/storage/file_system/snap'.format(config.get_default('default_api_host'))210 res = https._delete(url, body, self.auth)211 return res212 '''213 * è·å214 * 215 * @param dict $body åæ°è¯¦è§ API æå216 * @return list217 '''218 def listFsSnapshot(self, body):219 url = '{0}/storage/file_system/snap'.format(config.get_default('default_api_host'))220 res = https._get(url, body, self.auth)221 return res222 '''223 * å建224 * 225 * @param dict $body åæ°è¯¦è§ API æå226 * @return list227 '''228 def createFsCloneSnapshot(self, body):229 url = '{0}/storage/file_system/snap/clone'.format(config.get_default('default_api_host'))230 res = https._post(url, body, self.auth)231 return res232 '''233 * å é¤234 * 235 * @param dict $body åæ°è¯¦è§ API æå236 * @return list237 '''238 def deleteFsCloneSnapshot(self, body):239 url = '{0}/storage/file_system/snap/clone'.format(config.get_default('default_api_host'))240 res = https._delete(url, body, self.auth)241 return res242 '''243 * å表244 * 245 * @param dict $body åæ°è¯¦è§ API æå246 * @return list247 '''248 def listFsCloneSnapshot(self, body):249 url = '{0}/storage/file_system/snap/clone'.format(config.get_default('default_api_host'))250 res = https._get(url, body, self.auth)251 return res252 '''253 * ---------------------254 * 255 * @return list256 '''257 '''258 * å建259 * 260 * @param dict $body åæ°è¯¦è§ API æå261 * @return list262 '''263 def createVolume(self, body):264 url = '{0}/storage/volume'.format(config.get_default('default_api_host'))265 res = https._post(url, body, self.auth)266 return res267 '''268 * å é¤269 * 270 * @param dict $body åæ°è¯¦è§ API æå271 * @return list272 '''273 def deleteVolume(self, body):274 url = '{0}/storage/volume'.format(config.get_default('default_api_host'))275 res = https._delete(url, body, self.auth)276 return res277 '''278 * è·å279 * 280 * @param dict $body åæ°è¯¦è§ API æå281 * @return list282 '''283 def listVolume(self, body):284 url = '{0}/storage/volume'.format(config.get_default('default_api_host'))285 res = https._get(url, body, self.auth)286 return res287 '''288 * å建289 * 290 * @param dict $body åæ°è¯¦è§ API æå291 * @return list292 '''293 def createVolumeSnapshot(self, body):294 url = '{0}/storage/volume/snap'.format(config.get_default('default_api_host'))295 res = https._post(url, body, self.auth)296 return res297 '''298 * å é¤299 * 300 * @param dict $body åæ°è¯¦è§ API æå301 * @return list302 '''303 def deleteVolumeSnapshot(self, body):304 url = '{0}/storage/volume/snap'.format(config.get_default('default_api_host'))305 res = https._delete(url, body, self.auth)306 return res307 '''308 * è·å309 * 310 * @param dict $body åæ°è¯¦è§ API æå311 * @return list312 '''313 def listVolumeSnapshot(self, body):314 url = '{0}/storage/volume/snap'.format(config.get_default('default_api_host'))315 res = https._get(url, body, self.auth)316 return res317 '''318 * å建319 * 320 * @param dict $body åæ°è¯¦è§ API æå321 * @return list322 '''323 def createVolumeCloneSnapshot(self, body):324 url = '{0}/storage/volume/snap/clone'.format(config.get_default('default_api_host'))325 res = https._post(url, body, self.auth)326 return res327 '''328 * å é¤329 * 330 * @param dict $body åæ°è¯¦è§ API æå331 * @return list332 '''333 def deleteVolumeCloneSnapshot(self, body):334 url = '{0}/storage/volume/snap/clone'.format(config.get_default('default_api_host'))335 res = https._delete(url, body, self.auth)336 return res337 '''338 * å表339 * 340 * @param dict $body åæ°è¯¦è§ API æå341 * @return list342 '''343 def listVolumeCloneSnapshot(self, body):344 url = '{0}/storage/volume/snap/clone'.format(config.get_default('default_api_host'))345 res = https._get(url, body, self.auth)346 return res347 '''348 * ---------------------349 * 350 * @return list351 '''352 '''353 * å建354 * 355 * @return list356 '''357 def create(self, ):358 url = '{0}/storage/vmdk'.format(config.get_default('default_api_host'))359 res = https._post(url, None, self.auth)360 return res361 '''362 * å é¤363 * 364 * @return list365 '''366 def delete(self, ):367 url = '{0}/storage/vmdk'.format(config.get_default('default_api_host'))368 res = https._delete(url, None, self.auth)369 return res370 '''371 * --------------------- åå¨åºåç½ç»ï¼SANï¼ç®¡ç372 * 373 * @return list374 '''375 '''376 * å建377 * 378 * @param dict $body åæ°è¯¦è§ API æå379 * @return list380 '''381 def createBackStore(self, body):382 url = '{0}/storage/backstore'.format(config.get_default('default_api_host'))383 res = https._post(url, body, self.auth)384 return res385 '''386 * å é¤387 * 388 * @param dict $body åæ°è¯¦è§ API æå389 * @return list390 '''391 def deleteBackStore(self, body):392 url = '{0}/storage/backstore'.format(config.get_default('default_api_host'))393 res = https._delete(url, body, self.auth)394 return res395 '''396 * è·åä¿¡æ¯397 * 398 * @param dict $body åæ°è¯¦è§ API æå399 * @return list400 '''401 def listBackStore(self, body):402 url = '{0}/storage/backstore/info'.format(config.get_default('default_api_host'))403 res = https._get(url, body, self.auth)404 return res405 '''406 * åé
ç»ISCSIåèµ·è
407 * 408 * @param dict $body åæ°è¯¦è§ API æå409 * @return list410 '''411 def createAssignBackStore(self, body):412 url = '{0}/storage/backstore/assign'.format(config.get_default('default_api_host'))413 res = https._post(url, body, self.auth)414 return res415 '''416 * æ¥ç被åé
ç»åªäºISCSIåèµ·è
417 * 418 * @param dict $body åæ°è¯¦è§ API æå419 * @return list420 '''421 def listAssignBackStore(self, body):422 url = '{0}/storage/backstore/assign'.format(config.get_default('default_api_host'))423 res = https._get(url, body, self.auth)424 return res425 '''426 * è·åå¯å建 å ç ç ç è·¯å¾427 * 428 * @param dict $body åæ°è¯¦è§ API æå429 * @return list430 '''431 def listBackStoreAvailablePath(self, body):432 url = '{0}/storage/backstore/available_path'.format(config.get_default('default_api_host'))433 res = https._get(url, body, self.auth)434 return res435 '''436 * è·åçæ¬ä¿¡æ¯437 * 438 * @param dict $body åæ°è¯¦è§ API æå439 * @return list440 '''441 def describeIscsiVersion(self, body):442 url = '{0}/storage/iscsi/version'.format(config.get_default('default_api_host'))443 res = https._get(url, body, self.auth)444 return res445 '''446 * è·ååç°æé447 * 448 * @param dict $body åæ°è¯¦è§ API æå449 * @return list450 '''451 def describeIscsiAuth(self, body):452 url = '{0}/storage/iscsi/auth'.format(config.get_default('default_api_host'))453 res = https._get(url, body, self.auth)454 return res455 '''456 * 设置åç°æé457 * 458 * @param dict $body åæ°è¯¦è§ API æå459 * @return list460 '''461 def createIscsiDiscoverAuth(self, body):462 url = '{0}/storage/iscsi/auth'.format(config.get_default('default_api_host'))463 res = https._post(url, body, self.auth)464 return res465 '''466 * åæ¶åç°æé467 * 468 * @param dict $body åæ°è¯¦è§ API æå469 * @return list470 '''471 def deleteIscsiDiscoverAuth(self, body):472 url = '{0}/storage/iscsi/auth'.format(config.get_default('default_api_host'))473 res = https._delete(url, body, self.auth)474 return res475 '''476 * å
¨å±åæ°è®¾ç½®ï¼èªå¨æ·»å ISCSIç®æ 端 é¨æ·477 * 478 * @param dict $body åæ°è¯¦è§ API æå479 * @return list480 '''481 def createAutoAddPortal(self, body):482 url = '{0}/storage/iscsi/auto_add_portal'.format(config.get_default('default_api_host'))483 res = https._post(url, body, self.auth)484 return res485 '''486 * å
¨å±åæ°è®¾ç½®ï¼èªå¨æ·»å åå
é»è¾å·æ å°487 * 488 * @param dict $body åæ°è¯¦è§ API æå489 * @return list490 '''491 def createAutoAddLun(self, body):492 url = '{0}/storage/iscsi/auto_add_luns'.format(config.get_default('default_api_host'))493 res = https._post(url, body, self.auth)494 return res495 '''496 * è·åå
¨å±åæ°ï¼èªå¨æ·»å ISCSIç®æ 端 é¨æ·497 * 498 * @param dict $body åæ°è¯¦è§ API æå499 * @return list500 '''501 def describeAutoAddPortal(self, body):502 url = '{0}/storage/iscsi/auto_add_portal'.format(config.get_default('default_api_host'))503 res = https._get(url, body, self.auth)504 return res505 '''506 * è·åå
¨å±åæ°ï¼èªå¨æ·»å åå
é»è¾æ å°507 * 508 * @param dict $body åæ°è¯¦è§ API æå509 * @return list510 '''511 def describeAutoAddLun(self, body):512 url = '{0}/storage/iscsi/auto_add_luns'.format(config.get_default('default_api_host'))513 res = https._get(url, body, self.auth)514 return res515 '''516 * è·åç¶æ517 * 518 * @param dict $body åæ°è¯¦è§ API æå519 * @return list520 '''521 def describeIscsiTargetStatus(self, body):522 url = '{0}/storage/target/status'.format(config.get_default('default_api_host'))523 res = https._get(url, body, self.auth)524 return res525 '''526 * è·åä¿¡æ¯527 * 528 * @param dict $body åæ°è¯¦è§ API æå529 * @return list530 '''531 def listIscsiTarget(self, body):532 url = '{0}/storage/target/info'.format(config.get_default('default_api_host'))533 res = https._get(url, body, self.auth)534 return res535 '''536 * æ·»å 537 * 538 * @param dict $body åæ°è¯¦è§ API æå539 * @return list540 '''541 def createIscsiTarget(self, body):542 url = '{0}/storage/target'.format(config.get_default('default_api_host'))543 res = https._post(url, body, self.auth)544 return res545 '''546 * å é¤547 * 548 * @param dict $body åæ°è¯¦è§ API æå549 * @return list550 '''551 def deleteIscsiTarget(self, body):552 url = '{0}/storage/target'.format(config.get_default('default_api_host'))553 res = https._delete(url, body, self.auth)554 return res555 '''556 * æ·»å 557 * 558 * @param dict $body åæ°è¯¦è§ API æå559 * @return list560 '''561 def createIscsiInitiator(self, body):562 url = '{0}/storage/initiator'.format(config.get_default('default_api_host'))563 res = https._post(url, body, self.auth)564 return res565 '''566 * å é¤567 * 568 * @param dict $body åæ°è¯¦è§ API æå569 * @return list570 '''571 def deleteIscsiInitiator(self, body):572 url = '{0}/storage/initiator'.format(config.get_default('default_api_host'))573 res = https._delete(url, body, self.auth)574 return res575 '''576 * 设置è¿æ¥æé577 * 578 * @param dict $body åæ°è¯¦è§ API æå579 * @return list580 '''581 def createIscsiInitiatorConnectAuth(self, body):582 url = '{0}/storage/initiator/auth'.format(config.get_default('default_api_host'))583 res = https._post(url, body, self.auth)584 return res585 '''586 * æ·»å é»è¾åå
å·ï¼LUNï¼587 * 588 * @param dict $body åæ°è¯¦è§ API æå589 * @return list590 '''591 def createIscsiInitiatorLun(self, body):592 url = '{0}/storage/initiator/lun'.format(config.get_default('default_api_host'))593 res = https._post(url, body, self.auth)594 return res595 '''596 * å é¤ é»è¾åå
å·ï¼LUNï¼597 * 598 * @param dict $body åæ°è¯¦è§ API æå599 * @return list600 '''601 def deleteIscsiInitiatorLun(self, body):602 url = '{0}/storage/initiator/lun'.format(config.get_default('default_api_host'))603 res = https._delete(url, body, self.auth)604 return res605 '''606 * åç°ç®æ 端607 * 608 * @param dict $body åæ°è¯¦è§ API æå609 * @return list610 '''611 def createIscsiInitiatorDiscoverTarget(self, body):612 url = '{0}/storage/initiator/discover'.format(config.get_default('default_api_host'))613 res = https._post(url, body, self.auth)614 return res615 '''616 * è¿æ¥ç®æ 端617 * 618 * @param dict $body åæ°è¯¦è§ API æå619 * @return list620 '''621 def createIscsiInitiatorConnectTarget(self, body):622 url = '{0}/storage/initiator/connect'.format(config.get_default('default_api_host'))623 res = https._post(url, body, self.auth)624 return res625 '''626 * æå¼ç®æ 段è¿æ¥627 * 628 * @param dict $body åæ°è¯¦è§ API æå629 * @return list630 '''631 def deleteIscsiInitiatorConnectTarget(self, body):632 url = '{0}/storage/initiator/connect'.format(config.get_default('default_api_host'))633 res = https._delete(url, body, self.auth)634 return res635 '''636 * è·ååç°é¨æ·å表637 * 638 * @param dict $body åæ°è¯¦è§ API æå639 * @return list640 '''641 def listIscsiInitiatorPortal(self, body):642 url = '{0}/storage/initiator/portal'.format(config.get_default('default_api_host'))643 res = https._get(url, body, self.auth)644 return res645 '''646 * å é¤åç°é¨æ·647 * 648 * @param dict $body åæ°è¯¦è§ API æå649 * @return list650 '''651 def deleteIscsiInitiatorPortal(self, body):652 url = '{0}/storage/initiator/portal'.format(config.get_default('default_api_host'))653 res = https._delete(url, body, self.auth)654 return res655 '''656 * è·åä¿¡æ¯657 * 658 * @param dict $body åæ°è¯¦è§ API æå659 * @return list660 '''661 def listTpg(self, body):662 url = '{0}/storage/tpg/info'.format(config.get_default('default_api_host'))663 res = https._get(url, body, self.auth)664 return res665 '''666 * æ·»å 667 * 668 * @param dict $body åæ°è¯¦è§ API æå669 * @return list670 '''671 def createTpg(self, body):672 url = '{0}/storage/tpg'.format(config.get_default('default_api_host'))673 res = https._post(url, body, self.auth)674 return res675 '''676 * å é¤677 * 678 * @param dict $body åæ°è¯¦è§ API æå679 * @return list680 '''681 def deleteTpg(self, body):682 url = '{0}/storage/tpg'.format(config.get_default('default_api_host'))683 res = https._delete(url, body, self.auth)684 return res685 '''686 * 设置è¿æ¥æé687 * 688 * @param dict $body åæ°è¯¦è§ API æå689 * @return list690 '''691 def createTpgConnectAuth(self, body):692 url = '{0}/storage/tpg/auth'.format(config.get_default('default_api_host'))693 res = https._post(url, body, self.auth)694 return res695 '''696 * åæ¶è¿æ¥æé697 * 698 * @param dict $body åæ°è¯¦è§ API æå699 * @return list700 '''701 def deleteTpgConnectAuth(self, body):702 url = '{0}/storage/tpg/auth'.format(config.get_default('default_api_host'))703 res = https._delete(url, body, self.auth)704 return res705 '''706 * æ·»å é»è¾åå
ï¼LUNï¼707 * 708 * @param dict $body åæ°è¯¦è§ API æå709 * @return list710 '''711 def createTpgLun(self, body):712 url = '{0}/storage/tpg/lun'.format(config.get_default('default_api_host'))713 res = https._post(url, body, self.auth)714 return res715 '''716 * æ¯å¦å¼å¯è¿æ¥æé717 * 718 * @param dict $body åæ°è¯¦è§ API æå719 * @return list720 '''721 def describeTpgConnectAuth(self, body):722 url = '{0}/storage/tpg/auth'.format(config.get_default('default_api_host'))723 res = https._get(url, body, self.auth)724 return res725 '''726 * å é¤ é»è¾åå
å·ï¼LUNï¼727 * 728 * @param dict $body åæ°è¯¦è§ API æå729 * @return list730 '''731 def deleteTpgLun(self, body):732 url = '{0}/storage/tpg/lun'.format(config.get_default('default_api_host'))733 res = https._delete(url, body, self.auth)734 return res735 '''736 * æ·»å é¨æ·ï¼Portalï¼737 * 738 * @param dict $body åæ°è¯¦è§ API æå739 * @return list740 '''741 def createTpgPortal(self, body):742 url = '{0}/storage/tpg/portal'.format(config.get_default('default_api_host'))743 res = https._post(url, body, self.auth)744 return res745 '''746 * å é¤ é¨æ·ï¼Portalï¼747 * 748 * @param dict $body åæ°è¯¦è§ API æå749 * @return list750 '''751 def deleteTpgPortal(self, body):752 url = '{0}/storage/tpg/portal'.format(config.get_default('default_api_host'))753 res = https._delete(url, body, self.auth)...
config.py
Source:config.py
...9 def __init__(self, **kwargs):10 # Transformation configurations.11 #12 # Initial permutation.13 self.first_perm = misc.get_default(kwargs, 'first_perm')14 # Initial linear mapping.15 self.first_do_linear_map = misc.get_default(16 kwargs, 'first_do_linear_map', False)17 self.first_init_mat_params = misc.get_default(18 kwargs, 'first_init_mat_params')19 self.first_init_b = misc.get_default(kwargs, 'first_init_b')20 self.first_trainable_A = misc.get_default(21 kwargs, 'first_trainable_A', False)22 self.first_trainable_b = misc.get_default(23 kwargs, 'first_trainable_b', False)24 # Subsequent linear mappings.25 self.init_mat_params = misc.get_default(kwargs, 'init_mat_params')26 self.init_b = misc.get_default(kwargs, 'init_b')27 self.trainable_A = misc.get_default(kwargs, 'trainable_A', True)28 self.trainable_b = misc.get_default(kwargs, 'trainable_b', True)29 self.mat_func = misc.get_default(kwargs, 'mat_func', trans.get_LU_map)30 # RNN transformation parameters.31 self.trans_state_size = misc.get_default(32 kwargs, 'trans_state_size', 16)33 self.trans_alpha = misc.get_default(kwargs, 'trans_alpha', None)34 self.trans_state_activation = misc.get_default(35 kwargs, 'trans_state_activation', tf.nn.relu36 )37 # RNN coupling parameters.38 self.rnn_coupling_params = misc.get_default(39 kwargs, 'rnn_coupling_params', {'nunits': 256, 'num_layers': 1})40 self.rnn_coupling_type = misc.get_default(kwargs, 'rnn_coupling_type',41 cells.GRUCell)42 self.rnn_coupling_class = self.rnn_coupling_type(43 **self.rnn_coupling_params)44 # Image tiling arguments.45 self.tile_hw = misc.get_default(kwargs, 'tile_hw', 28)46 self.tile_chans = misc.get_default(kwargs, 'tile_chans', 1)47 # Additive transformation parameters.48 self.add_hidden_sizes = misc.get_default(49 kwargs, 'add_hidden_sizes', [256]*2)50 self.add_irange = misc.get_default(51 kwargs, 'add_irange', None)52 self.add_output_irange = misc.get_default(53 kwargs, 'add_output_irange', None)54 # Rescaling transformation parameters.55 self.rescale_init_constant = misc.get_default(56 kwargs, 'rescale_init_constant', 1.0)57 self.trans_funcs = misc.get_default(kwargs, 'trans_funcs')58 # Conditional transformation parameters.59 self.do_init_cond_trans = misc.get_default(60 kwargs, 'do_init_cond_trans', False)61 self.do_final_cond_trans = misc.get_default(62 kwargs, 'do_final_cond_trans', False)63 self.cond_hidden_sizes = misc.get_default(64 kwargs, 'cond_hidden_sizes', [256]*2)65 self.cond_irange = misc.get_default(66 kwargs, 'cond_irange', None)67 self.cond_output_irange = misc.get_default(68 kwargs, 'cond_output_irange', 1e-6)69 # Leaky ReLU parameters70 self.relu_alpha = misc.get_default(71 kwargs, 'relu_alpha', None)72 # Make list of transformation functions.73 #74 # Do an initial permuation and linear transformation.75 self.first_transformations = []76 if self.first_perm is not None:77 self.first_transformations += [78 lambda x: trans.permute(x, self.first_perm)79 ]80 if self.first_do_linear_map:81 self.first_transformations += [82 lambda x: trans.linear_map(83 x,84 init_mat_params=self.first_init_mat_params,85 init_b=self.first_init_b,86 mat_func=self.mat_func,87 trainable_A=self.first_trainable_A,88 trainable_b=self.first_trainable_b89 )90 ]91 # TODO: untracked transformations should still work.92 # Make the default arguments for the various transformations.93 self.transform_arguments = {94 trans.linear_map: {95 'init_mat_params': self.init_mat_params,96 'init_b': self.init_b,97 'mat_func': self.mat_func,98 'trainable_A': self.trainable_A,99 'trainable_b': self.trainable_b},100 trans.additive_coupling: {101 'hidden_sizes': self.add_hidden_sizes,102 'irange': self.add_irange,103 'output_irange': self.add_output_irange},104 trans.rescale: {105 'init_constant': self.rescale_init_constant},106 trans.simple_rnn_transform: {107 'state_size': self.trans_state_size,108 'alpha': self.trans_alpha,109 'state_activation': self.trans_state_activation},110 trans.rnn_coupling: {111 'rnn_class': self.rnn_coupling_class},112 trans.negate: {},113 trans.reverse: {},114 trans.log_rescale: {},115 trans.shift: {},116 trans.leaky_transformation: {117 'alpha': self.relu_alpha},118 }119 # Likelihood parameters.120 #121 self.ncomps = misc.get_default(kwargs, 'ncomps', 40)122 self.nparams = 3*self.ncomps123 self.base_distribution = misc.get_default(124 kwargs, 'base_distribution', 'gaussian')125 self.likefunc = misc.get_default(126 kwargs, 'likefunc', likes.mixture_likelihoods)127 self.param_nlayers = misc.get_default(kwargs, 'param_nlayers')128 # Conditional density parameters.129 # TODO: Add options to use conditioning information at fc and/or130 # autoregressive levels.131 #132 self.nhidparams = misc.get_default(kwargs, 'nhidparams', self.nparams)133 # Independent model.134 self.single_marginal = misc.get_default(kwargs, 'single_marginal',135 False)136 self.standard = misc.get_default(kwargs, 'standard', False)137 # Conditional model.138 self.cond_tied_model = misc.get_default(kwargs, 'cond_tied_model', True)139 # RNN Model.140 self.rnn_params = misc.get_default(141 kwargs, 'rnn_params', {'nunits': 256, 'num_layers': 1})142 self.rnn_type = misc.get_default(kwargs, 'rnn_type', cells.GRUCell)143 self.rnn_class = self.rnn_type(**self.rnn_params)144 # Conditional model arguments.145 self.conditional_argument = {146 conds.independent_model: {'single_marginal': self.single_marginal,147 'standard': self.standard},148 conds.cond_model: {'tied_model': self.cond_tied_model},149 conds.rnn_model: {'rnn_class': self.rnn_class}150 }151 # Orderless methods that get all covariates as inputs.152 self.orderless_models = set([]) # TODO: remove153 # Make conditional function.154 self.cond_func = misc.get_default(kwargs, 'cond_func', conds.rnn_model)155 self.orderless = self.cond_func in self.orderless_models # TODO: remove156 self.conditional_model = lambda x, f, c: self.cond_func(157 x, self.nhidparams, param_func=f, conditioning=c,158 **self.conditional_argument[self.cond_func]159 )160 self.hidden_activation = misc.get_default(161 kwargs, 'hidden_activation', tf.nn.relu)162 self.cond_param_irange = misc.get_default(163 kwargs, 'cond_param_irange', None)164 # Conditioning value usage.165 #166 self.trans_conditioning = misc.get_default(167 kwargs, 'trans_conditioning', True)168 self.conditional_conditioning = misc.get_default(169 kwargs, 'conditional_conditioning', True)170 self.fc_conditioning = misc.get_default(kwargs, 'fc_conditioning', True)171 # Sampling Options.172 #173 self.sample_batch_size = misc.get_default(174 kwargs, 'sample_batch_size', 128)175 self.nsample_batches = misc.get_default(kwargs, 'nsample_batches', 10)176 self.samp_per_cond = misc.get_default(kwargs, 'samp_per_cond', 500)177 # Training configurations.178 #179 self.initializer_class = misc.get_default(kwargs, 'initializer_class',180 None)181 self.initializer_args = misc.get_default(182 kwargs, 'initializer_args', {'minval': -0.05, 'maxval': 0.05})183 self.initializer = None if self.initializer_class is None else \184 self.initializer_class(**self.initializer_args)185 self.batch_size = misc.get_default(kwargs, 'batch_size', 128)186 self.init_lr = misc.get_default(kwargs, 'init_lr', 0.1)187 self.min_lr = misc.get_default(kwargs, 'min_lr', None)188 self.lr_decay = misc.get_default(kwargs, 'lr_decay', 0.9)189 self.decay_interval = misc.get_default(kwargs, 'decay_interval', 10000)190 self.penalty = misc.get_default(kwargs, 'penalty', 0.0)191 self.dropout_keeprate_val = misc.get_default(192 kwargs, 'dropout_keeprate_val', 1.0)193 self.train_iters = misc.get_default(kwargs, 'train_iters', 30000)194 self.hold_iters = misc.get_default(kwargs, 'hold_iters', 100)195 self.print_iters = misc.get_default(kwargs, 'print_iters', 250)196 self.hold_interval = misc.get_default(kwargs, 'hold_interval', 2500)197 self.optimizer_class = misc.get_default(198 kwargs, 'optimizer_class', tf.train.AdamOptimizer)199 self.max_grad_norm = misc.get_default(kwargs, 'max_grad_norm', None)200 self.do_check = misc.get_default(kwargs, 'do_check', False)201 self.momentum = misc.get_default(kwargs, 'momentum', None)202 self.momentum_iter = misc.get_default(203 kwargs, 'momentum_iter', 10000000000)204 self.pretrain_scope = misc.get_default(kwargs, 'pretrain_scope', None)205 self.pretrain_iters = misc.get_default(kwargs, 'pretrain_iters', 5000)206 self.noise_scale = misc.get_default(kwargs, 'noise_scale', None)207 # Image configurations.208 #209 self.img_size = misc.get_default(kwargs, 'img_size', (64, 64, 3))210 self.downsample = misc.get_default(kwargs, 'downsample', 1)211 self.do_resize = misc.get_default(kwargs, 'do_resize', True)212 self.center_crop = misc.get_default(kwargs, 'center_crop', None)213 self.do_bw = misc.get_default(kwargs, 'do_bw', False)214 self.do_read_logit = misc.get_default(kwargs, 'do_read_logit', False)215 self.do_init_logit = misc.get_default(kwargs, 'do_init_logit', False)216 self.seq_feats = misc.get_default(kwargs, 'seq_feats', 256)217 self.mean_layers = misc.get_default(kwargs, 'mean_layers', None)218 self.conv_feats = misc.get_default(kwargs, 'conv_feats', 64)219 self.conv_hid = misc.get_default(kwargs, 'conv_hid', [64, 64, 64])220 self.use_markov_feats = misc.get_default(221 kwargs, 'use_markov_feats', False)222 # self.use_discrete_probs = misc.get_default(223 # kwargs, 'use_discrete_probs', False)224 # flat, column, double_seq, sub_column225 self.image_model = misc.get_default(kwargs, 'image_model', 'column')226 self.use_2nd_markov = misc.get_default(kwargs, 'use_2nd_markov', False)227 self.image_sublevels = misc.get_default(kwargs, 'image_sublevels', 2)228 self.image_cell_class = misc.get_default(kwargs, 'image_cell_class',229 cells.GRUCell)230 self.logit_iters = misc.get_default(kwargs, 'logit_iters', None)231 self.seq_logit_trans = misc.get_default(232 kwargs, 'seq_logit_trans', False)233 self.seq_cell_layers = misc.get_default(kwargs, 'seq_cell_layers', 1)234 self.seq_fc_layers = misc.get_default(kwargs, 'seq_fc_layers', None)235 self.predict_layers = misc.get_default(kwargs, 'predict_layers', None)236 self.predict_alpha = misc.get_default(kwargs, 'predict_alpha', 0.5)237 # Embeddings.238 self.embed_size = misc.get_default(kwargs, 'embed_size', 256)239 self.embed_layers = misc.get_default(kwargs, 'embed_layers', [256, 256])240 self.embed_irange = misc.get_default(kwargs, 'embed_irange', 1e-6)241 self.embed_activation = misc.get_default(242 kwargs, 'embed_activation', tf.nn.relu)243 self.set_regression = misc.get_default(kwargs, 'set_regression', False)244 self.set_classification = misc.get_default(245 kwargs, 'set_classification', False)246 self.set_loss_alpha = misc.get_default(kwargs, 'set_loss_alpha', 0.5)247 self.set_layers = misc.get_default(kwargs, 'set_layers', [256, 256])248 def transformations_generator(self):249 """ Helper function to dynamically build transformation functions based250 on configuration parameters. """251 for func in self.first_transformations:252 yield func253 # TODO: Move to front?254 if self.do_init_cond_trans:255 yield lambda x, c: trans.conditioning_transformation(256 x, c, hidden_sizes=self.cond_hidden_sizes,257 irange=self.cond_irange, output_irange=self.cond_output_irange)258 if self.trans_funcs is not None:259 for func in self.trans_funcs:260 yield lambda x: func(261 x, **self.transform_arguments[func])...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!