Best JavaScript code snippet using root
permission.js
Source:permission.js
1import _ from 'lodash'2/**3 * [0] æå¡å称4 * [1] èµæºå称5 * [2] Action å称6 * ...7 */8export const PERMISSION = {9 // 计ç®10 servers_list: ['compute', 'servers', 'list'],11 // éå12 images_list: ['image', 'images', 'list'],13 // 主æºéå14 guestimages_list: ['image', 'guestimages', 'list'],15 // 硬ç16 disks_list: ['compute', 'disks', 'list'],17 // å¿«ç
§18 snapshots_list: ['compute', 'snapshots', 'list'],19 // èªå¨å¿«ç
§çç¥20 snapshotpolicy_list: ['compute', 'snapshotpolicies', 'list'],21 snapshotpolicy_create: ['compute', 'snapshotpolicies', 'create'],22 snapshotpolicy_delete: ['compute', 'snapshotpolicies', 'delete'],23 // 主æºå¿«ç
§24 instance_snapshots_list: ['compute', 'instance_snapshots', 'list'],25 // å®å
¨ç»26 secgroups_list: ['compute', 'secgroups', 'list'],27 // å®å
¨ç»ç¼å28 secgroupcaches_list: ['compute', 'secgroupcaches', 'list'],29 // å¼¹æ§å
¬ç½IP30 eips_list: ['compute', 'eips', 'list'],31 // å¼¹æ§ç½å¡32 networkcard_list: ['compute', 'networkinterfaces', 'list'],33 // å¯é¥34 keypairs_list: ['compute', 'keypairs', 'list'],35 // åæ¶ç«36 recyclebins_list: ['compute', 'recyclebins', 'list'],37 // é群èç¹38 k8s_kubemachines_list: ['k8s', 'kubemachines', 'list'],39 // 容å¨é群40 k8s_kubeclusters_list: ['k8s', 'kubeclusters', 'list'],41 // 容å¨æ ç¶æ42 k8s_deployments_list: ['k8s', 'deployments', 'list'],43 // 容å¨æç¶æ44 k8s_statefulsets_list: ['k8s', 'statefulsets', 'list'],45 // å®æ¤è¿ç¨46 k8s_daemonsets_list: ['k8s', 'daemonsets', 'list'],47 // 容å¨ä»»å¡48 k8s_jobs_list: ['k8s', 'jobs', 'list'],49 // 容å¨ä»»å¡50 k8s_cronjobs_list: ['k8s', 'cronjobs', 'list'],51 // 容å¨ç»52 k8s_pods_list: ['k8s', 'pods', 'list'],53 // 容å¨æå¡54 k8s_services_list: ['k8s', 'k8s_services', 'list'],55 // 容å¨è·¯ç±56 k8s_ingresses_list: ['k8s', 'ingresses', 'list'],57 // 容å¨é
置项58 k8s_configmaps_list: ['k8s', 'configmaps', 'list'],59 // åå¨å£°æ60 k8s_persistentvolumeclaims_list: ['k8s', 'persistentvolumeclaims', 'list'],61 // 容å¨åå
¸62 k8s_secrets_list: ['k8s', 'secrets', 'list'],63 // 容å¨åºç¨å¸åº64 k8s_charts_list: ['k8s', 'charts', 'list'],65 // Helmä»åºå°å66 k8s_repos_list: ['k8s', 'repos', 'list'],67 // 容å¨åºç¨ç¼æ68 k8s_releases_list: ['k8s', 'releases', 'list'],69 // é群èç¹(导å
¥)70 k8s_k8sNode_list: ['k8s', 'k8s_nodes', 'list'],71 // åå¨ç±»72 k8s_storageclasses_list: ['k8s', 'storageclasses', 'list'],73 // å½å空é´74 k8s_namespace_list: ['k8s', 'namespaces', 'list'],75 // rbacroles76 k8s_rbacroles_list: ['k8s', 'rbacroles', 'list'],77 // rbacrolebindings78 k8s_rbacrolebindings_list: ['k8s', 'rbacrolebindings', 'list'],79 // rbacroles80 k8s_serviceaccounts_list: ['k8s', 'serviceaccounts', 'list'],81 // rbacclusterroles82 k8s_rbacclusterroles_list: ['k8s', 'rbacclusterroles', 'list'],83 // rbacclusterrolebindings84 k8s_rbacclusterrolebindings_list: ['k8s', 'rbacrolebindings', 'list'],85 /* å¤é群èµæº */86 k8s_federatednamespaces_list: ['k8s', 'federatednamespaces', 'list'],87 k8s_federatedroles_list: ['k8s', 'federatedroles', 'list'],88 k8s_federatedclusterroles_list: ['k8s', 'federatedclusterroles', 'list'],89 k8s_federatedrolebindings_list: ['k8s', 'federatedrolebindings', 'list'],90 k8s_federatedclusterrolebindings_list: ['k8s', 'federatedclusterrolebindings', 'list'],91 // 主æºæ¨¡æ¿92 servertemplates_list: ['compute', 'servertemplates', 'list'],93 // å¼¹æ§ä¼¸ç¼©ç»94 scalinggroups_list: ['compute', 'scalinggroups', 'list'],95 // è´è½½åè¡¡å®ä¾ç®¡ç96 lb_loadbalancers_list: ['compute', 'loadbalancers', 'list'],97 // è´è½½åè¡¡çå¬98 lb_loadbalancerlisteners_list: ['compute', 'loadbalancerlisteners', 'list'],99 // è´è½½åè¡¡æå¡å¨ç»100 lb_loadbalancerbackendgroups_list: ['compute', 'loadbalancerbackendgroups', 'list'],101 // è´è½½å衡访é®æ§å¶102 lb_loadbalanceracls_list: ['compute', 'loadbalanceracls', 'list'],103 // è´è½½åè¡¡è¯ä¹¦ç®¡ç104 lb_loadbalancercertificates_list: ['compute', 'loadbalancercertificates', 'list'],105 // è´è½½åè¡¡é群106 lb_loadbalancerclusters_list: ['compute', 'loadbalancerclusters', 'list'],107 // è´è½½åè¡¡èç¹108 lb_loadbalanceragents_list: ['compute', 'loadbalanceragents', 'list'],109 // ssh 代çèç¹110 sshproxy_node_list: ['compute', 'proxy_endpoints', 'list'],111 // ssh 代çèç¹112 sshproxy_service_list: ['compute', 'proxy_agents', 'list'],113 // åºå114 areas_list: ['compute', 'cloudregions', 'list'],115 // åºå116 areas_get: ['compute', 'cloudregions', 'get'],117 // å¯ç¨åº118 zones_list: ['compute', 'zones', 'list'],119 // æå¡å¨120 hosts_list: ['compute', 'hosts', 'list'],121 // æå¡å¨è¯¦æ
122 hosts_get: ['compute', 'hosts', 'get'],123 // è°åº¦æ ç¾124 schedtags_list: ['compute', 'schedtags', 'list'],125 // å¨æè°åº¦æ ç¾126 dynamicschedtags_list: ['compute', 'dynamicschedtags', 'list'],127 // è°åº¦çç¥128 schedpolicies_list: ['compute', 'schedpolicies', 'list'],129 // GPUéä¼ 130 isolated_devices_list: ['compute', 'isolated-devices', 'list'],131 // GPUéä¼ è¯¦æ
132 isolated_devices_get: ['compute', 'isolated-devices', 'get'],133 // è·¯ç±è¡¨134 route_tables_list: ['compute', 'route_tables', 'list'],135 // NATç½å
³136 natgateways_list: ['compute', 'natgateways', 'list'],137 // èæè·¯ç±å¨138 wires_list: ['compute', 'wires', 'list'],139 // èæè·¯ç±å¨è¯¦æ
140 wires_get: ['compute', 'wires', 'get'],141 // IPåç½142 networks_list: ['compute', 'networks', 'list'],143 // VPC144 vpcs_list: ['compute', 'vpcs', 'list'],145 // VPC详æ
146 vpcs_get: ['compute', 'vpcs', 'get'],147 // é¢çIP148 reservedips_list: ['compute', 'reservedips', 'list'],149 // ååæå¡150 dnsrecords_list: ['compute', 'dnsrecords', 'list'],151 // åå¨152 storages_list: ['compute', 'storages', 'list'],153 // 对象åå¨154 buckets_list: ['compute', 'buckets', 'list'],155 // äºè´¦å·156 cloudaccounts_list: ['compute', 'cloudaccounts', 'list'],157 // 代ç158 proxysettings_list: ['compute', 'proxysettings', 'list'],159 // å160 domains_list: ['identity', 'domains', 'list'],161 // å详æ
162 domains_get: ['identity', 'domains', 'get'],163 // ç»164 groups_list: ['identity', 'groups', 'list'],165 // ç¨æ·166 users_list: ['identity', 'users', 'list'],167 // èç³»æ¹å¼168 contacts_list: ['notify', 'receivers', 'list'],169 // 项ç®170 projects_list: ['identity', 'projects', 'list'],171 // 项ç®è¯¦æ
172 projects_get: ['identity', 'projects', 'get'],173 // è§è²174 roles_list: ['identity', 'roles', 'list'],175 // çç¥æé176 policies_list: ['identity', 'policies', 'list'],177 // æä½æ¥å¿178 log_list: ['log', 'log', 'list'],179 // æ¶æ¯ä¸å¿180 notifications_list: ['notify', 'notifications', 'list'],181 // ä¼ä¸ä¿¡æ¯182 infos_list: ['yunionagent', 'infos', 'list'],183 // é®ä»¶çä¿¡184 configs_list: ['notify', 'configs', 'list'],185 // å
¬å186 notices_list: ['yunionagent', 'notices', 'list'],187 // ç§æäºå¥é¤188 serverskus_list: ['compute', 'serverskus', 'list'],189 // 认è¯æº190 idps_list: ['identity', 'identity_providers', 'list'],191 // 常ç¨ç³»ç»(æ¥å
¥ç«¯)192 endpoints_list: ['identity', 'endpoints', 'list'],193 // æ¥è¦194 commonalerts_list: ['monitor', 'commonalerts', 'list'],195 // èµæºæ¶è´¹é¢è¦196 costalerts_list: ['meter', 'costalerts', 'list'],197 /**198 * server ç¸å
³æä½199 */200 server_create: ['compute', 'servers', 'create'],201 server_update: ['compute', 'servers', 'update'],202 server_delete: ['compute', 'servers', 'delete'],203 server_get: ['compute', 'servers', 'get'],204 server_get_vnc: ['compute', 'servers', 'get', 'vnc'],205 server_perform_start: ['compute', 'servers', 'perform', 'start'],206 server_perform_stop: ['compute', 'servers', 'perform', 'stop'],207 server_perform_restart: ['compute', 'servers', 'perform', 'restart'],208 server_perform_rebuild_root: ['compute', 'servers', 'perform', 'rebuild-root'],209 server_perform_change_config: ['compute', 'servers', 'perform', 'change-config'],210 server_perform_syncstatus: ['compute', 'servers', 'perform', 'syncstatus'],211 server_perform_change_owner: ['compute', 'servers', 'perform', 'change-owner'],212 server_perform_deploy: ['compute', 'servers', 'perform', 'deploy'],213 server_perform_save_image: ['compute', 'servers', 'perform', 'save-image'],214 server_perform_insertiso: ['compute', 'servers', 'perform', 'insertiso'],215 server_perform_ejectiso: ['compute', 'servers', 'perform', 'ejectiso'],216 server_perform_add_secgroup: ['compute', 'servers', 'perform', 'add-secgroup'],217 server_perform_revoke_secgroup: ['compute', 'servers', 'perform', 'revoke-secgroup'],218 server_perform_cancel_delete: ['compute', 'servers', 'perform', 'cancel-delete'],219 server_perform_cancel_expire: ['compute', 'servers', 'perform', 'cancel-expire'],220 /**221 * images ç¸å
³æä½222 */223 images_create: ['image', 'images', 'create'],224 images_update: ['image', 'images', 'update'],225 images_delete: ['image', 'images', 'delete'],226 images_get: ['image', 'images', 'get'],227 images_perform_cancel_delete: ['image', 'images', 'perform', 'cancel-delete'],228 /**229 * disks ç¸å
³æä½230 */231 disks_create: ['compute', 'disks', 'create'],232 disks_update: ['compute', 'disks', 'update'],233 disks_delete: ['compute', 'disks', 'delete'],234 disks_get: ['compute', 'disks', 'get'],235 disks_perform_resize: ['compute', 'disks', 'perform', 'resize'],236 disks_perform_attachdisk: ['compute', 'disks', 'perform', 'attachdisk'],237 disks_perform_detachdisk: ['compute', 'disks', 'perform', 'detachdisk'],238 disks_perform_create_snapshot: ['compute', 'disks', 'perform', 'create-snapshot'],239 disks_perform_disk_reset: ['compute', 'disks', 'perform', 'disk-reset'],240 disks_perform_cancel_delete: ['compute', 'disks', 'perform', 'cancel-delete'],241 disks_perform_syncstatus: ['compute', 'disks', 'perform', 'syncstatus'],242 /**243 * snapshots ç¸å
³æä½244 */245 snapshots_create: ['compute', 'snapshots', 'create'],246 snapshots_update: ['compute', 'snapshots', 'update'],247 snapshots_delete: ['compute', 'snapshots', 'delete'],248 snapshots_get: ['compute', 'snapshots', 'get'],249 /**250 * secgroups ç¸å
³æä½251 */252 secgroups_create: ['compute', 'secgroups', 'create'],253 secgroups_update: ['compute', 'secgroups', 'update'],254 secgroups_delete: ['compute', 'secgroups', 'delete'],255 secgroups_get: ['compute', 'secgroups', 'get'],256 /**257 * secgroupcache ç¸å
³æä½258 */259 secgroupcache_create: ['compute', 'secgroupcaches', 'create'],260 secgroupcache_update: ['compute', 'secgroupcaches', 'update'],261 secgroupcache_delete: ['compute', 'secgroupcaches', 'delete'],262 secgroupcache_get: ['compute', 'secgroupcaches', 'get'],263 /**264 * secgroups ç¸å
³æä½265 */266 secgrouprules_create: ['compute', 'secgrouprules', 'create'],267 secgrouprules_update: ['compute', 'secgrouprules', 'update'],268 secgrouprules_delete: ['compute', 'secgrouprules', 'delete'],269 secgrouprules_get: ['compute', 'secgrouprules', 'get'],270 /**271 * elasticips ç¸å
³æä½272 */273 // 'elasticips_create': ['compute', 'elasticips', 'create'],274 // 'elasticips_update': ['compute', 'elasticips', 'update'],275 // 'elasticips_delete': ['compute', 'elasticips', 'delete'],276 // 'elasticips_get': ['compute', 'elasticips', 'get'],277 // 'elasticips_perform_associate': ['compute', 'elasticips', 'perform', 'associate'],278 // 'elasticips_perform_dissociate': ['compute', 'elasticips', 'perform', 'dissociate'],279 // 'elasticips_perform_change_bandwidth': ['compute', 'elasticips', 'perform', 'change-bandwidth'],280 /**281 * keypairs ç¸å
³æä½282 */283 keypairs_create: ['compute', 'keypairs', 'create'],284 keypairs_update: ['compute', 'keypairs', 'update'],285 keypairs_delete: ['compute', 'keypairs', 'delete'],286 keypairs_get: ['compute', 'keypairs', 'get'],287 /**288 * recyclebins ç¸å
³æä½289 */290 recyclebins_create: ['compute', 'recyclebins', 'create'],291 recyclebins_update: ['compute', 'recyclebins', 'update'],292 recyclebins_delete: ['compute', 'recyclebins', 'delete'],293 recyclebins_get: ['compute', 'recyclebins', 'get'],294 /**295 * k8s ç¸å
³æä½296 */297 k8s_deployments_create: ['k8s', 'deployments', 'create'],298 k8s_deployments_update: ['k8s', 'deployments', 'update'],299 k8s_deployments_delete: ['k8s', 'deployments', 'delete'],300 k8s_deployments_get: ['k8s', 'deployments', 'get'],301 k8s_daemonsets_create: ['k8s', 'daemonsets', 'create'],302 k8s_daemonsets_update: ['k8s', 'daemonsets', 'update'],303 k8s_daemonsets_delete: ['k8s', 'daemonsets', 'delete'],304 k8s_daemonsets_get: ['k8s', 'daemonsets', 'get'],305 k8s_statefulsets_create: ['k8s', 'statefulsets', 'create'],306 k8s_statefulsets_update: ['k8s', 'statefulsets', 'update'],307 k8s_statefulsets_delete: ['k8s', 'statefulsets', 'delete'],308 k8s_statefulsets_get: ['k8s', 'statefulsets', 'get'],309 k8s_jobs_create: ['k8s', 'jobs', 'create'],310 k8s_jobs_update: ['k8s', 'jobs', 'update'],311 k8s_jobs_delete: ['k8s', 'jobs', 'delete'],312 k8s_jobs_get: ['k8s', 'jobs', 'get'],313 k8s_cronjobs_create: ['k8s', 'cronjobs', 'create'],314 k8s_cronjobs_update: ['k8s', 'cronjobs', 'update'],315 k8s_cronjobs_delete: ['k8s', 'cronjobs', 'delete'],316 k8s_cronjobs_get: ['k8s', 'cronjobs', 'get'],317 k8s_pods_create: ['k8s', 'pods', 'create'],318 k8s_pods_update: ['k8s', 'pods', 'update'],319 k8s_pods_delete: ['k8s', 'pods', 'delete'],320 k8s_pods_get: ['k8s', 'pods', 'get'],321 k8s_repos_create: ['k8s', 'repos', 'create'],322 k8s_repos_delete: ['k8s', 'repos', 'delete'],323 k8s_repos_update: ['k8s', 'repos', 'update'],324 k8s_charts_create: ['k8s', 'charts', 'create'],325 k8s_services_create: ['k8s', 'k8s_services', 'create'],326 k8s_services_update: ['k8s', 'k8s_services', 'update'],327 k8s_services_delete: ['k8s', 'k8s_services', 'delete'],328 k8s_services_get: ['k8s', 'k8s_services', 'get'],329 k8s_ingresses_create: ['k8s', 'ingresses', 'create'],330 k8s_ingresses_update: ['k8s', 'ingresses', 'update'],331 k8s_ingresses_delete: ['k8s', 'ingresses', 'delete'],332 k8s_ingresses_get: ['k8s', 'ingresses', 'get'],333 k8s_configmaps_create: ['k8s', 'configmaps', 'create'],334 k8s_configmaps_update: ['k8s', 'configmaps', 'update'],335 k8s_configmaps_delete: ['k8s', 'configmaps', 'delete'],336 k8s_configmaps_get: ['k8s', 'configmaps', 'get'],337 k8s_persistentvolumeclaims_create: ['k8s', 'persistentvolumeclaims', 'create'],338 k8s_persistentvolumeclaims_update: ['k8s', 'persistentvolumeclaims', 'update'],339 k8s_persistentvolumeclaims_delete: ['k8s', 'persistentvolumeclaims', 'delete'],340 k8s_persistentvolumeclaims_get: ['k8s', 'persistentvolumeclaims', 'get'],341 k8s_secrets_create: ['k8s', 'secrets', 'create'],342 k8s_secrets_update: ['k8s', 'secrets', 'update'],343 k8s_secrets_delete: ['k8s', 'secrets', 'delete'],344 k8s_secrets_get: ['k8s', 'secrets', 'get'],345 k8s_releases_create: ['k8s', 'releases', 'create'],346 k8s_releases_update: ['k8s', 'releases', 'update'],347 k8s_releases_delete: ['k8s', 'releases', 'delete'],348 k8s_releases_get: ['k8s', 'releases', 'get'],349 k8s_releases_perform_rollback: ['k8s', 'releases', 'perform', 'rollback'],350 k8s_kubeclusters_create: ['k8s', 'kubeclusters', 'create'],351 k8s_kubeclusters_perform_sync: ['k8s', 'kubeclusters', 'perform', 'sync'],352 k8s_kubeclusters_perform_add_machines: ['k8s', 'kubeclusters', 'perform', 'add-machines'],353 k8s_kubeclusters_get_kubeconfig: ['k8s', 'kubeclusters', 'get', 'kubeconfig'],354 k8s_kubeclusters_delete: ['k8s', 'kubeclusters', 'delete'],355 k8s_nodes_perform_uncordon: ['k8s', 'nodes', 'perform', 'uncordon'],356 k8s_nodes_perform_cordon: ['k8s', 'nodes', 'perform', 'cordon'],357 k8s_nodes_update: ['k8s', 'nodes', 'update'],358 k8s_storageclasses_perform_set_default: ['k8s', 'storageclasses', 'perform', 'set-default'],359 k8s_storageclasses_update: ['k8s', 'storageclasses', 'update'],360 k8s_storageclasses_create: ['k8s', 'storageclasses', 'create'],361 k8s_storageclasses_delete: ['k8s', 'storageclasses', 'delete'],362 k8s_namespaces_update: ['k8s', 'namespaces', 'update'],363 k8s_namespaces_create: ['k8s', 'namespaces', 'create'],364 k8s_namespaces_delete: ['k8s', 'namespaces', 'delete'],365 k8s_rbacroles_create: ['k8s', 'rbacroles', 'create'],366 k8s_rbacroles_update: ['k8s', 'rbacroles', 'update'],367 k8s_rbacroles_delete: ['k8s', 'rbacroles', 'delete'],368 k8s_rbacrolebindings_create: ['k8s', 'rbacrolebindings', 'update'],369 k8s_rbacrolebindings_update: ['k8s', 'rbacrolebindings', 'update'],370 k8s_rbacrolebindings_delete: ['k8s', 'rbacrolebindings', 'delete'],371 k8s_serviceaccounts_update: ['k8s', 'serviceaccounts', 'update'],372 k8s_serviceaccounts_delete: ['k8s', 'serviceaccounts', 'delete'],373 k8s_kubecomponent_update: ['k8s', 'kubecomponent', 'update'],374 k8s_kubecomponent_create: ['k8s', 'kubecomponent', 'create'],375 k8s_kubemachines_delete: ['k8s', 'kubemachines', 'delete'],376 k8s_rbacclusterroles_create: ['k8s', 'rbacclusterroles', 'create'],377 k8s_rbacclusterroles_update: ['k8s', 'rbacclusterroles', 'update'],378 k8s_rbacclusterroles_delete: ['k8s', 'rbacclusterroles', 'delete'],379 k8s_rbacclusterrolebindings_create: ['k8s', 'rbacclusterrolebindings', 'update'],380 k8s_rbacclusterrolebindings_update: ['k8s', 'rbacclusterrolebindings', 'update'],381 k8s_rbacclusterrolebindings_delete: ['k8s', 'rbacclusterrolebindings', 'delete'],382 k8s_federatednamespaces_create: ['k8s', 'federatednamespaces', 'create'],383 k8s_federatednamespaces_delete: ['k8s', 'federatednamespaces', 'delete'],384 k8s_federatednamespaces_perform_attach_cluster: ['k8s', 'federatednamespaces', 'perform', 'attach-cluster'],385 k8s_federatednamespaces_perform_detach_cluster: ['k8s', 'federatednamespaces', 'perform', 'detach-cluster'],386 k8s_federatedroles_create: ['k8s', 'federatedroles', 'create'],387 k8s_federatedroles_delete: ['k8s', 'federatedroles', 'delete'],388 k8s_federatedroles_perform_attach_cluster: ['k8s', 'federatedroles', 'perform', 'attach-cluster'],389 k8s_federatedroles_perform_detach_cluster: ['k8s', 'federatedroles', 'perform', 'detach-cluster'],390 k8s_federatedclusterroles_create: ['k8s', 'federatedclusterroles', 'create'],391 k8s_federatedclusterroles_delete: ['k8s', 'federatedclusterroles', 'delete'],392 k8s_federatedclusterroles_perform_attach_cluster: ['k8s', 'federatedclusterroles', 'perform', 'attach-cluster'],393 k8s_federatedclusterroles_perform_detach_cluster: ['k8s', 'federatedclusterroles', 'perform', 'detach-cluster'],394 k8s_federatedrolebindings_create: ['k8s', 'federatedrolebindings', 'create'],395 k8s_federatedrolebindings_delete: ['k8s', 'federatedrolebindings', 'delete'],396 k8s_federatedrolebindings_perform_attach_cluster: ['k8s', 'federatedrolebindings', 'perform', 'attach-cluster'],397 k8s_federatedrolebindings_perform_detach_cluster: ['k8s', 'federatedrolebindings', 'perform', 'detach-cluster'],398 k8s_federatedclusterrolebindings_create: ['k8s', 'federatedclusterrolebindings', 'create'],399 k8s_federatedclusterrolebindings_delete: ['k8s', 'federatedclusterrolebindings', 'delete'],400 k8s_federatedclusterrolebindings_perform_attach_cluster: ['k8s', 'federatedclusterrolebindings', 'perform', 'attach-cluster'],401 k8s_federatedclusterrolebindings_perform_detach_cluster: ['k8s', 'federatedclusterrolebindings', 'perform', 'detach-cluster'],402 /**403 * è´è´£åè¡¡ ç¸å
³æä½404 */405 lb_loadbalancers_perform_syncstatus: ['compute', 'loadbalancers', 'perform', 'syncstatus'],406 lb_loadbalancers_create: ['compute', 'loadbalancers', 'create'],407 lb_loadbalancers_update: ['compute', 'loadbalancers', 'update'],408 lb_loadbalancers_delete: ['compute', 'loadbalancers', 'delete'],409 lb_loadbalancers_get: ['compute', 'loadbalancers', 'get'],410 lb_loadbalancers_perform_status: ['compute', 'loadbalancers', 'perform', 'status'],411 lb_loadbalancerlisteners_create: ['compute', 'loadbalancerlisteners', 'create'],412 lb_loadbalancerlisteners_update: ['compute', 'loadbalancerlisteners', 'update'],413 lb_loadbalancerlisteners_delete: ['compute', 'loadbalancerlisteners', 'delete'],414 lb_loadbalancerlisteners_get: ['compute', 'loadbalancerlisteners', 'get'],415 lb_loadbalancerlisteners_enable: ['compute', 'loadbalancerlisteners', 'perform', 'enble'],416 lb_loadbalancerlisteners_disable: ['compute', 'loadbalancerlisteners', 'perform', 'disable'],417 lb_loadbalancerlistenerrules_create: ['compute', 'loadbalancerlistenerrules', 'create'],418 lb_loadbalancerlistenerrules_update: ['compute', 'loadbalancerlistenerrules', 'update'],419 lb_loadbalancerlistenerrules_delete: ['compute', 'loadbalancerlistenerrules', 'delete'],420 lb_loadbalancerlistenerrules_get: ['compute', 'loadbalancerlistenerrules', 'get'],421 lb_loadbalancerbackendgroups_create: ['compute', 'loadbalancerbackendgroups', 'create'],422 lb_loadbalancerbackendgroups_update: ['compute', 'loadbalancerbackendgroups', 'update'],423 lb_loadbalancerbackendgroups_delete: ['compute', 'loadbalancerbackendgroups', 'delete'],424 lb_loadbalancerbackendgroups_get: ['compute', 'loadbalancerbackendgroups', 'get'],425 lb_loadbalancerbackends_create: ['compute', 'loadbalancerbackends', 'create'],426 lb_loadbalancerbackends_update: ['compute', 'loadbalancerbackends', 'update'],427 lb_loadbalancerbackends_delete: ['compute', 'loadbalancerbackends', 'delete'],428 lb_loadbalancerbackends_get: ['compute', 'loadbalancerbackends', 'get'],429 lb_loadbalanceracls_create: ['compute', 'loadbalanceracls', 'create'],430 lb_loadbalanceracls_update: ['compute', 'loadbalanceracls', 'update'],431 lb_loadbalanceracls_delete: ['compute', 'loadbalanceracls', 'delete'],432 lb_loadbalanceracls_get: ['compute', 'loadbalanceracls', 'get'],433 lb_loadbalancercertificates_create: ['compute', 'loadbalancercertificates', 'create'],434 lb_loadbalancercertificates_update: ['compute', 'loadbalancercertificates', 'update'],435 lb_loadbalancercertificates_delete: ['compute', 'loadbalancercertificates', 'delete'],436 lb_loadbalancercertificates_get: ['compute', 'loadbalancercertificates', 'get'],437 /**438 * 主æºæ¨¡æ¿439 */440 servertemplates_create: ['compute', 'servertemplates', 'create'],441 servertemplates_delete: ['compute', 'servertemplates', 'delete'],442 servertemplates_perform_public: ['compute', 'servertemplates', 'perform', 'public'],443 /**444 * å¼¹æ§ä¼¸ç¼©ç»445 */446 scalinggroups_create: ['compute', 'scalinggroups', 'create'],447 scalinggroups_delete: ['compute', 'scalinggroups', 'delete'],448 scalinggroups_perform_enable: ['compute', 'scalinggroups', 'perform', 'enable'],449 scalinggroups_perform_disable: ['compute', 'scalinggroups', 'perform', 'disable'],450 /**451 * å¼¹æ§ä¼¸ç¼©ç»-伸缩çç¥452 */453 scalingpolicies_list: ['compute', 'scalingpolicies', 'list'],454 scalingpolicies_create: ['compute', 'scalingpolicies', 'create'],455 scalingpolicies_delete: ['compute', 'scalingpolicies', 'delete'],456 scalingpolicies_perform_enable: ['compute', 'scalingpolicies', 'perform', 'enable'],457 scalingpolicies_perform_disable: ['compute', 'scalingpolicies', 'perform', 'disable'],458 /**459 * cloudregions ç¸å
³æä½460 */461 cloudregions_get: ['compute', 'cloudregions', 'get'],462 cloudregions_perform_sync_skus: ['compute', 'cloudregions', 'perform', 'sync-skus'],463 /**464 * zones ç¸å
³æä½465 */466 zones_create: ['compute', 'zones', 'create'],467 zones_update: ['compute', 'zones', 'update'],468 zones_delete: ['compute', 'zones', 'delete'],469 zones_get: ['compute', 'zones', 'get'],470 /**471 * networks ç¸å
³æä½472 */473 networks_create: ['compute', 'networks', 'create'],474 networks_update: ['compute', 'networks', 'update'],475 networks_delete: ['compute', 'networks', 'delete'],476 networks_get: ['compute', 'networks', 'get'],477 networks_perform_public: ['compute', 'networks', 'perform', 'public'],478 networks_perform_private: ['compute', 'networks', 'perform', 'private'],479 networks_perform_split: ['compute', 'networks', 'perform', 'split'],480 networks_perform_merge: ['compute', 'networks', 'perform', 'merge'],481 networks_perform_change_owner: ['compute', 'networks', 'perform', 'change-owner'],482 networks_perform_syncstatus: ['compute', 'networks', 'perform', 'syncstatus'],483 networks_perform_set_schedtag: ['compute', 'networks', 'perform', 'set-schedtag'],484 /**485 * VPC ç¸å
³æä½486 */487 vpcs_create: ['compute', 'vpcs', 'create'],488 vpcs_update: ['compute', 'vpcs', 'update'],489 vpcs_delete: ['compute', 'vpcs', 'delete'],490 vpcs_perform_change_owner: ['compute', 'vpcs', 'perform', 'change-owner'],491 vpcs_perform_syncstatus: ['compute', 'vpcs', 'perform', 'syncstatus'],492 vpcs_perform_public: ['compute', 'vpcs', 'perform', 'public'],493 vpcs_perform_private: ['compute', 'vpcs', 'perform', 'private'],494 vpcs_perform_set_schedtag: ['compute', 'vpcs', 'perform', 'set-schedtag'],495 /**496 * äºå±ç½ç» ç¸å
³æä½497 */498 wires_create: ['compute', 'wires', 'create'],499 wires_update: ['compute', 'wires', 'update'],500 wires_delete: ['compute', 'wires', 'delete'],501 wires_perform_change_owner: ['compute', 'wires', 'perform', 'change-owner'],502 wires_perform_syncstatus: ['compute', 'wires', 'perform', 'syncstatus'],503 wires_perform_public: ['compute', 'wires', 'perform', 'public'],504 wires_perform_private: ['compute', 'wires', 'perform', 'private'],505 wires_perform_set_schedtag: ['compute', 'wires', 'perform', 'set-schedtag'],506 /**507 * notices ç¸å
³æä½508 */509 notices_create: ['yunionagent', 'notices', 'create'],510 notices_update: ['yunionagent', 'notices', 'update'],511 notices_delete: ['yunionagent', 'notices', 'delete'],512 notices_get: ['yunionagent', 'notices', 'get'],513 /**514 * schedtags ç¸å
³æä½515 */516 schedtags_create: ['compute', 'schedtags', 'create'],517 schedtags_update: ['compute', 'schedtags', 'update'],518 schedtags_delete: ['compute', 'schedtags', 'delete'],519 schedtags_perform_set_scope: ['compute', 'schedtags', 'perform', 'set-scope'],520 schedtags_get: ['compute', 'schedtags', 'get'],521 dynamicschedtags_create: ['compute', 'schedtags', 'create'],522 dynamicschedtags_update: ['compute', 'schedtags', 'update'],523 dynamicschedtags_delete: ['compute', 'schedtags', 'delete'],524 /**525 * storages ç¸å
³æä½526 */527 storages_create: ['compute', 'storages', 'create'],528 storages_update: ['compute', 'storages', 'update'],529 storages_delete: ['compute', 'storages', 'delete'],530 storages_get: ['compute', 'storages', 'get'],531 storages_perform_enable: ['compute', 'storages', 'perform', 'enable'],532 storages_perform_disable: ['compute', 'storages', 'perform', 'disable'],533 storages_perform_storages: ['compute', 'storages', 'perform', 'storages'],534 /**535 * buckets ç¸å
³æä½536 */537 buckets_get: ['compute', 'buckets', 'get'],538 buckets_create: ['compute', 'buckets', 'create'],539 buckets_update: ['compute', 'buckets', 'update'],540 buckets_delete: ['compute', 'buckets', 'delete'],541 buckets_perform_delete: ['compute', 'buckets', 'perform', 'delete'],542 buckets_perform_temp_url: ['compute', 'buckets', 'perform', 'temp-url'],543 buckets_perform_acl: ['compute', 'buckets', 'perform', 'acl'],544 buckets_perform_makedir: ['compute', 'buckets', 'perform', 'makedir'],545 buckets_perform_upload: ['compute', 'buckets', 'perform', 'upload'],546 buckets_perform_change_owner: ['compute', 'buckets', 'perform', 'change_owner'],547 buckets_perform_limit: ['compute', 'buckets', 'perform', 'limit'],548 /**549 * sku ç¸å
³æä½550 */551 skus_create: ['compute', 'serverskus', 'create'],552 skus_update: ['compute', 'serverskus', 'update'],553 skus_delete: ['compute', 'serverskus', 'delete'],554 /**555 * cloudaccounts ç¸å
³æä½556 */557 cloudproviders_list: ['compute', 'cloudproviders', 'list'],558 cloudproviders_get: ['compute', 'cloudproviders', 'get'],559 /**560 * cloudaccounts ç¸å
³æä½561 */562 cloudaccounts_create: ['compute', 'cloudaccounts', 'create'],563 cloudaccounts_update: ['compute', 'cloudaccounts', 'update'],564 cloudaccounts_delete: ['compute', 'cloudaccounts', 'delete'],565 cloudaccounts_get: ['compute', 'cloudaccounts', 'get'],566 cloudaccounts_perform_change_project: ['compute', 'cloudaccounts', 'perform', 'change-project'],567 cloudaccounts_perform_sync: ['compute', 'cloudaccounts', 'perform', 'sync'],568 cloudaccounts_perform_enable: ['compute', 'cloudaccounts', 'perform', 'enable'],569 cloudaccounts_perform_disable: ['compute', 'cloudaccounts', 'perform', 'disable'],570 cloudaccounts_perform_update_credential: ['compute', 'cloudaccounts', 'perform', 'update-credential'],571 cloudaccounts_perform_import: ['compute', 'cloudaccounts', 'perform', 'import'],572 cloudaccounts_perform_enable_auto_sync: ['compute', 'cloudaccounts', 'perform', 'enable_auto_sync'],573 cloudaccounts_perform_disable_auto_sync: ['compute', 'cloudaccounts', 'perform', 'disable_auto_sync'],574 externalprojects_update: ['compute', 'externalprojects', 'update'], // äºè´¦å·å订é
é¡¹ç® -> æ´æ¹é¡¹ç®575 /**576 * proxysettings 代çæä½577 */578 proxysettings_create: ['compute', 'proxysettings', 'create'],579 proxysettings_update: ['compute', 'proxysettings', 'update'],580 proxysettings_delete: ['compute', 'proxysettings', 'delete'],581 /**582 * eips ç¸å
³æä½583 */584 eips_perform_change_owner: ['compute', 'eips', 'perform', 'change-owner'],585 eips_delete: ['compute', 'eips', 'delete'],586 eips_get: ['compute', 'eips', 'get'],587 eips_create: ['compute', 'eips', 'create'],588 /**589 * meter ç¸å
³æä½590 */591 bill_balances_get: ['meter', 'bill_balances', 'get'],592 bill_balances_list: ['meter', 'bill_balances', 'list'],593 bill_analysises_list: ['meter', 'bill_analysises', 'list'],594 bill_conditions_list: ['meter', 'bill_conditions', 'list'],595 bill_resources_list: ['meter', 'bill_resources', 'list'],596 bill_associates_list: ['meter', 'associate_bills', 'list'],597 bill_details_list: ['meter', 'bill_details', 'list'],598 rates_list: ['meter', 'rates', 'list'],599 rates_update: ['meter', 'rates', 'post'],600 bill_budgets_get: ['meter', 'budgets', 'get'],601 bill_budgets_list: ['meter', 'budgets', 'list'],602 bill_budgets_create: ['meter', 'budgets', 'create'],603 bill_budgets_delete: ['meter', 'budgets', 'delete'],604 bill_budgets_perform: ['meter', 'budgets', 'perform'],605 /**606 * cloudwatcher ç¸å
³æä½607 */608 // underutilizedinstances_list: ['monitor', 'underutilizedinstances', 'list'],609 // å·¥å管çç¸å
³æä½610 process_manage_list: ['itsm', 'process-definitions', 'list'],611 /**612 * 主æºç»613 */614 instancegroups_list: ['compute', 'instancegroups', 'list'],615 instancegroups_create: ['compute', 'instancegroups', 'create'],616 /**617 * æ°æ®åº-RDS618 */619 rds_dbinstances_list: ['compute', 'dbinstances', 'list'],620 rds_dbinstances_delete: ['compute', 'dbinstances', 'delete'],621 rds_dbinstances_get: ['compute', 'dbinstances', 'get'],622 rds_dbinstances_create: ['compute', 'dbinstances', 'create'],623 /**624 * æ°æ®åº-RDSå¤ä»½å表625 */626 rds_dbinstancebackups_list: ['compute', 'dbinstancebackups', 'list'],627 rds_dbinstancebackups_delete: ['compute', 'dbinstancebackups', 'delete'],628 rds_dbinstancebackups_create: ['compute', 'dbinstancebackups', 'create'],629 /**630 * æ°æ®åº-RDSè´¦å·631 */632 rds_dbinstanceaccounts_list: ['compute', 'dbinstanceaccounts', 'list'],633 rds_dbinstanceaccounts_delete: ['compute', 'dbinstanceaccounts', 'delete'],634 rds_dbinstanceaccounts_create: ['compute', 'dbinstanceaccounts', 'create'],635 /**636 * æ°æ®åº-RDSæ°æ®åºç®¡ç637 */638 rds_dbinstancedatabases_list: ['compute', 'dbinstancedatabases', 'list'],639 rds_dbinstancedatabases_delete: ['compute', 'dbinstancedatabases', 'delete'],640 rds_dbinstancedatabases_create: ['compute', 'dbinstancedatabases', 'create'],641 /**642 * æ°æ®åº-redis643 */644 redis_elasticcaches_list: ['compute', 'elasticcaches', 'list'],645 redis_elasticcaches_delete: ['compute', 'elasticcaches', 'delete'],646 redis_elasticcaches_create: ['compute', 'elasticcaches', 'create'],647 /**648 * æ°æ®åº-redisè´¦å·649 */650 redis_elasticcacheaccounts_list: ['compute', 'elasticcacheaccounts', 'list'],651 redis_elasticcacheaccounts_delete: ['compute', 'elasticcacheaccounts', 'delete'],652 redis_elasticcacheaccounts_create: ['compute', 'elasticcacheaccounts', 'create'],653 /**654 * æ°æ®åº-redisç½åå655 */656 redis_elasticcacheacls_list: ['compute', 'elasticcacheacls', 'list'],657 redis_elasticcacheacls_delete: ['compute', 'elasticcacheacls', 'delete'],658 redis_elasticcacheacls_create: ['compute', 'elasticcacheacls', 'create'],659 /**660 * é¢çIP661 */662 reservedips_create: ['compute', 'reservedips', 'create'],663 reservedips_delete: ['compute', 'reservedips', 'delete'],664 /**665 * è¿ç»´å·¥å
·-模ç666 */667 ansible_devtool_templates_list: ['compute', 'devtool_templates', 'list'],668 /**669 * è¿ç»´å·¥å
·-ä»»å¡670 */671 ansible_ansibleplaybooks_list: ['compute', 'ansibleplaybooks', 'list'],672 /**673 * ç½ç»-å
¨å±vpc674 */675 network_globalvpcs_list: ['compute', 'globalvpcs', 'list'],676 // å
¬æäºæ¥å¿677 cloudevents_list: ['cloudevent', 'cloudevents', 'list'],678 // æ¥è¦èµæº679 alertresources_list: ['monitor', 'alertresources', 'list'],680 // æ¥è¦è®°å½681 alertrecords_list: ['monitor', 'alertrecords', 'list'],682 /**683 * é
é¢æ´æ°684 */685 quota_create: ['compute', 'quotas', 'create'],686 quota_delete: ['compute', 'quotas', 'delete'],687 quota_update: ['compute', 'quotas', 'update'],688 quota_list: ['compute', 'quotas', 'list'],689 project_quota_create: ['compute', 'project_quotas', 'create'],690 project_quota_delete: ['compute', 'project_quotas', 'delete'],691 project_quota_update: ['compute', 'project_quotas', 'update'],692 project_quota_list: ['compute', 'project_quotas', 'list'],693 region_quota_create: ['compute', 'region_quotas', 'create'],694 region_quota_delete: ['compute', 'region_quotas', 'delete'],695 region_quota_update: ['compute', 'region_quotas', 'update'],696 region_quota_list: ['compute', 'region_quotas', 'list'],697 zone_quota_create: ['compute', 'zone_quotas', 'create'],698 zone_quota_delete: ['compute', 'zone_quotas', 'delete'],699 zone_quota_update: ['compute', 'zone_quotas', 'update'],700 zone_quota_list: ['compute', 'zone_quotas', 'list'],701 image_quota_create: ['image', 'image_quotas', 'create'],702 image_quota_delete: ['image', 'image_quotas', 'delete'],703 image_quota_update: ['image', 'image_quotas', 'update'],704 image_quota_list: ['image', 'image_quotas', 'list'],705 domain_quota_create: ['compute', 'domain_quotas', 'create'],706 domain_quota_delete: ['compute', 'domain_quotas', 'delete'],707 domain_quota_update: ['compute', 'domain_quotas', 'update'],708 domain_quota_list: ['compute', 'domain_quotas', 'list'],709 identity_quota_create: ['identity', 'identity_quotas', 'create'],710 identity_quota_delete: ['identity', 'identity_quotas', 'delete'],711 identity_quota_update: ['identity', 'identity_quotas', 'update'],712 identity_quota_list: ['identity', 'identity_quotas', 'list'],713 infras_quota_create: ['compute', 'infras_quotas', 'create'],714 infras_quota_delete: ['compute', 'infras_quotas', 'delete'],715 infras_quota_update: ['compute', 'infras_quotas', 'update'],716 infras_quota_list: ['compute', 'infras_quotas', 'list'],717 /**718 * çç¥719 */720 policydefinitions_list: ['compute', 'policydefinitions', 'list'],721 // æé722 policies_get: ['identity', 'policies', 'get'],723 // å®æ¶ä»»å¡724 scheduledtasks_list: ['compute', 'scheduledtasks', 'list'],725 scheduledtasks_create: ['compute', 'scheduledtasks', 'create'],726 scheduledtasks_update: ['compute', 'scheduledtasks', 'update'],727 scheduledtasks_delete: ['compute', 'scheduledtasks', 'delete'],728 scheduledtasks_perform_enable: ['compute', 'scheduledtasks', 'perform', 'enable'],729 scheduledtasks_perform_disable: ['compute', 'scheduledtasks', 'perform', 'disable'],730 scheduledtasks_perform_set_label: ['compute', 'scheduledtasks', 'perform', 'set-labels'],731 // æéç»732 cloudgroup_create: ['cloudid', 'cloudgroups', 'create'],733 cloudgroup_list: ['cloudid', 'cloudgroups', 'list'],734 cloudgroup_get: ['cloudid', 'cloudgroups', 'get'],735 cloudgroup_perform_add_user: ['cloudid', 'cloudgroups', 'perform', 'add-user'],736 cloudgroup_perform_set_policy: ['cloudid', 'cloudgroups', 'perform', 'set-policies'],737 cloudgroup_delete: ['cloudid', 'cloudgroups', 'delete'],738 cloudgroup_perform_remove_user: ['cloudid', 'cloudgroups', 'perform', 'remove-user'],739 cloudgroup_perform_syncstatus: ['cloudid', 'cloudgroups', 'perform', 'syncstatus'],740 // äºç¨æ·741 clouduser_perform_leave_group: ['cloudid', 'cloudusers', 'perform', 'leave-group'],742 // äºæé743 cloudpolicy_list: ['cloudid', 'cloudpolicies', 'list'],744 cloudpolicy_perform_revoke_group: ['cloudid', 'cloudpolicies', 'perform', 'revoke-group'],745 // äºç¨æ·746 clouduser_list: ['cloudid', 'cloudusers', 'list'],747 clouduser_get: ['cloudid', 'cloudusers', 'get'],748 clouduser_create: ['cloudid', 'cloudusers', 'create'],749 clouduser_update: ['cloudid', 'cloudusers', 'update'],750 clouduser_delete: ['cloudid', 'cloudusers', 'delete'],751 clouduser_perform_change_owner: ['cloudid', 'cloudusers', 'perform', 'change-owner'],752 clouduser_perform_set_groups: ['cloudid', 'cloudusers', 'perform', 'set-groups'],753 clouduser_perform_syncstatus: ['cloudid', 'cloudusers', 'perform', 'syncstatus'],754 // æéç»ç¼å755 cloudgroupcache_get: ['cloudid', 'cloudgroupcaches', 'get'],756 cloudgroupcache_delete: ['cloudid', 'cloudgroupcaches', 'delete'],757 // çæ§æ¥è¦758 unifiedmonitors_get: ['monitor', 'unifiedmonitors', 'get'],759 // æ¥è¦760 commonalerts_get: ['monitor', 'commonalerts', 'get'],761 commonalerts_create: ['monitor', 'commonalerts', 'create'],762 commonalerts_update: ['monitor', 'commonalerts', 'update'],763 commonalerts_delete: ['monitor', 'commonalerts', 'delete'],764 commonalerts_perform_enable: ['monitor', 'commonalerts', 'perform', 'enable'],765 commonalerts_perform_disable: ['monitor', 'commonalerts', 'perform', 'disable'],766 /** è´¹ç¨ä¼å */767 suggestsysruleconfigs_list: ['suggestion', 'suggestsysruleconfigs', 'list'],768 suggestsysrules_list: ['suggestion', 'suggestsysrules', 'list'],769 suggestsysalerts_list: ['suggestion', 'suggestsysalerts', 'list'],770 // èµæºæ¶è´¹é¢è¦771 costalerts_create: ['meter', 'costalerts', 'create'],772 costalerts_delete: ['meter', 'costalerts', 'delete'],773 // DNS解æç¸å
³774 dns_zones_list: ['compute', 'dns_zones', 'list'],775 dns_zones_get: ['compute', 'dns_zones', 'get'],776 dns_zones_create: ['compute', 'dns_zones', 'create'],777 dns_zones_update: ['compute', 'dns_zones', 'update'],778 dns_zones_delete: ['compute', 'dns_zones', 'delete'],779 dns_zones_add_vpcs: ['compute', 'dns_zones', 'perform', 'add-vpcs'],780 dns_zones_remove_vpcs: ['compute', 'dns_zones', 'perform', 'remove-vpcs'],781 dns_zones_syncstatus: ['compute', 'dns_zones', 'perform', 'syncstatus'],782 dns_zones_sync_recordsets: ['compute', 'dns_zones', 'perform', 'sync-recordsets'],783 dns_zones_change_owner: ['compute', 'dns_zones', 'perform', 'change-owner'],784 dns_recordsets_create: ['compute', 'dns_recordsets', 'create'],785 dns_recordsets_update: ['compute', 'dns_recordsets', 'update'],786 dns_recordsets_get: ['compute', 'dns_recordsets', 'get'],787 dns_recordsets_delete: ['compute', 'dns_recordsets', 'delete'],788 dns_recordsets_disable: ['compute', 'dns_recordsets', 'perform', 'disable'],789 dns_recordsets_enable: ['compute', 'dns_recordsets', 'perform', 'enable'],790 dns_zonecaches_get: ['compute', 'dns_zonecaches', 'get'],791 dns_zonecaches_create: ['compute', 'dns_zonecaches', 'create'],792 dns_zonecaches_delete: ['compute', 'dns_zonecaches', 'delete'],793 // çç¥ç¸å
³794 scopedpolicybindings_delete: ['yunionconf', 'scopedpolicybindings', 'delete'],795 scopedpolicies_list: ['yunionconf', 'scopedpolicies', 'list'],796 scopedpolicies_create: ['yunionconf', 'scopedpolicies', 'create'],797 scopedpolicies_update: ['yunionconf', 'scopedpolicies', 'update'],798 scopedpolicies_delete: ['yunionconf', 'scopedpolicies', 'delete'],799 // 主æºç£ç800 guestdisks_list: ['compute', 'guestdisks', 'list'],801 // 主æºç½å¡802 guestnetworks_list: ['compute', 'guestnetworks', 'list'],803 // 主æºå®å
¨ç»804 guestsecgroups_list: ['compute', 'guestsecgroups', 'list'],805 // 主æºå¼¹æ§ä¼¸ç¼©ç»806 scalinggroupguests_list: ['compute', 'scalinggroupguests', 'list'],807 // 宿主æºç½ç»808 baremetalnetworks_list: ['compute', 'baremetalnetworks', 'list'],809 // 宿主æºåå¨810 hoststorages_list: ['compute', 'hoststorages', 'list'],811 // 宿主æºäºå±ç½ç»812 hostwires_list: ['compute', 'hostwires', 'list'],813 // NASæéç»814 access_groups_list: ['compute', 'access_groups', 'list'],815 access_groups_create: ['compute', 'access_groups', 'create'],816 access_groups_delete: ['compute', 'access_groups', 'delete'],817 // NASæéç»ç¼å818 access_group_caches_list: ['compute', 'access_group_caches', 'list'],819 access_group_caches_delete: ['compute', 'access_group_caches', 'delete'],820 // NASæéç»è§å821 access_group_rules_list: ['compute', 'access_group_rules', 'list'],822 access_group_rules_create: ['compute', 'access_group_rules', 'create'],823 access_group_rules_delete: ['compute', 'access_group_rules', 'delete'],824 // æ件系ç»825 file_systems_list: ['compute', 'file_systems', 'list'],826 file_systems_create: ['compute', 'file_systems', 'create'],827 file_systems_delete: ['compute', 'file_systems', 'delete'],828 // æè½½ç¹829 mount_targets_list: ['compute', 'mount_targets', 'list'],830 mount_targets_create: ['compute', 'mount_targets', 'create'],831 mount_targets_delete: ['compute', 'mount_targets', 'delete'],832}833// 已声ææéçèµæº...
light.py
Source:light.py
1import pyvex2import logging3from typing import Optional4from ...engine import SimEngineBase5from ....utils.constants import DEFAULT_STATEMENT6l = logging.getLogger(name=__name__)7#pylint: disable=arguments-differ8class VEXMixin(SimEngineBase):9 def __init__(self, project, **kwargs):10 super().__init__(project, **kwargs)11 self._vex_expr_handlers = []12 self._vex_stmt_handlers = []13 self.__init_handlers()14 self.irsb = None15 self.stmt_idx = None16 self.tmps = None17 __tls = ('irsb', 'stmt_idx', 'tmps')18 def __init_handlers(self):19 self._vex_expr_handlers = [None]*pyvex.expr.tag_count20 self._vex_stmt_handlers = [None]*pyvex.stmt.tag_count21 for name, cls in vars(pyvex.expr).items():22 if isinstance(cls, type) and issubclass(cls, pyvex.expr.IRExpr) and cls is not pyvex.expr.IRExpr:23 self._vex_expr_handlers[cls.tag_int] = getattr(self, '_handle_vex_expr_' + name)24 for name, cls in vars(pyvex.stmt).items():25 if isinstance(cls, type) and issubclass(cls, pyvex.stmt.IRStmt) and cls is not pyvex.stmt.IRStmt:26 self._vex_stmt_handlers[cls.tag_int] = getattr(self, '_handle_vex_stmt_' + name)27 assert None not in self._vex_expr_handlers28 assert None not in self._vex_stmt_handlers29 def __getstate__(self):30 return super().__getstate__(), # return unary tuple to not trip special behavior with falsey states31 def __setstate__(self, s):32 self.__init_handlers()33 super().__setstate__(s[0])34 # one size fits all?35 def _ty_to_bytes(self, ty):36 return pyvex.get_type_size(ty) // getattr(getattr(getattr(self, 'state', None), 'arch', None), 'byte_width', 8)37 def _handle_vex_stmt(self, stmt: pyvex.stmt.IRStmt):38 handler = self._vex_stmt_handlers[stmt.tag_int]39 handler(stmt)40 def _handle_vex_expr(self, expr: pyvex.expr.IRExpr):41 handler = self._vex_expr_handlers[expr.tag_int]42 result = handler(expr)43 return self._instrument_vex_expr(result)44 def _instrument_vex_expr(self, result):45 return result46 def _handle_vex_const(self, const: pyvex.const.IRConst):47 return const.value48 #49 # Individual expression handlers go here50 #51 # expressions dependent on the state impl52 def _handle_vex_expr_RdTmp(self, expr: pyvex.expr.RdTmp):53 return self._perform_vex_expr_RdTmp(expr.tmp)54 def _perform_vex_expr_RdTmp(self, tmp):55 return self.tmps[tmp]56 def _handle_vex_expr_Get(self, expr: pyvex.expr.Get):57 return self._perform_vex_expr_Get(58 self._handle_vex_const(pyvex.const.U32(expr.offset)),59 expr.ty)60 def _perform_vex_expr_Get(self, offset, ty, **kwargs):61 return NotImplemented62 def _analyze_vex_expr_Load_addr(self, *a, **kw): return self._handle_vex_expr(*a, **kw)63 def _handle_vex_expr_Load(self, expr: pyvex.expr.Load):64 return self._perform_vex_expr_Load(65 self._analyze_vex_expr_Load_addr(expr.addr),66 expr.ty,67 expr.end)68 def _perform_vex_expr_Load(self, addr, ty, endness, **kwargs):69 return NotImplemented70 # expressions dependent on the data domain71 def _analyze_vex_expr_CCall_arg(self, *a, **kw): return self._handle_vex_expr(*a, **kw)72 def _handle_vex_expr_CCall(self, expr: pyvex.expr.CCall):73 return self._perform_vex_expr_CCall(74 expr.cee.name,75 expr.retty,76 [self._analyze_vex_expr_CCall_arg(arg) for arg in expr.args],77 )78 def _perform_vex_expr_CCall(self, func_name, ty, args, func=None):79 return NotImplemented80 def _handle_vex_expr_ITE(self, expr: pyvex.expr.ITE):81 return self._perform_vex_expr_ITE(82 self._handle_vex_expr(expr.cond),83 self._handle_vex_expr(expr.iftrue),84 self._handle_vex_expr(expr.iffalse))85 def _perform_vex_expr_ITE(self, cond, ifTrue, ifFalse):86 return NotImplemented87 def _handle_vex_expr_Unop(self, expr: pyvex.expr.Unop):88 return self._handle_vex_expr_Op(expr)89 def _handle_vex_expr_Binop(self, expr: pyvex.expr.Unop):90 return self._handle_vex_expr_Op(expr)91 def _handle_vex_expr_Triop(self, expr: pyvex.expr.Unop):92 return self._handle_vex_expr_Op(expr)93 def _handle_vex_expr_Qop(self, expr: pyvex.expr.Unop):94 return self._handle_vex_expr_Op(expr)95 def _handle_vex_expr_Op(self, expr):96 return self._perform_vex_expr_Op(expr.op, [self._handle_vex_expr(arg) for arg in expr.args])97 def _perform_vex_expr_Op(self, op, args):98 return NotImplemented99 # fully implemented expressions100 def _handle_vex_expr_Const(self, expr: pyvex.expr.Const):101 return self._handle_vex_const(expr.con)102 def _analyze_vex_expr_GetI_ix(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)103 def _handle_vex_expr_GetI(self, expr: pyvex.expr.GetI):104 return self._perform_vex_expr_GetI(105 expr.descr.base,106 expr.descr.elemTy,107 expr.bias,108 self._analyze_vex_expr_GetI_ix(expr.ix),109 expr.descr.nElems,110 )111 def _perform_vex_expr_GetI_get(self, *a, **kw): return self. _perform_vex_expr_Get(*a, **kw)112 def _perform_vex_expr_GetI(self, base, ty, bias, ix, nElems):113 offset = self._perform_vex_stmt_PutI_compute(base, ty, bias, ix, nElems)114 return self._perform_vex_expr_GetI_get(offset, ty)115 # oh boy.116 def _handle_vex_expr_GSPTR(self, expr: pyvex.expr.GSPTR):117 return NotImplemented118 def _handle_vex_expr_VECRET(self, expr: pyvex.expr.VECRET):119 return NotImplemented120 def _handle_vex_expr_Binder(self, expr: pyvex.expr.Binder):121 return NotImplemented122 #123 # Individual statement handlers go here124 #125 # stmt category 1: fluff126 def _handle_vex_stmt_IMark(self, stmt):127 pass128 def _handle_vex_stmt_NoOp(self, stmt):129 pass130 def _handle_vex_stmt_AbiHint(self, stmt):131 pass132 def _handle_vex_stmt_MBE(self, stmt):133 pass134 # stmt category 2: real shit135 def _analyze_vex_stmt_Put_data(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)136 def _handle_vex_stmt_Put(self, stmt):137 self._perform_vex_stmt_Put(138 self._handle_vex_const(pyvex.const.U32(stmt.offset)),139 self._analyze_vex_stmt_Put_data(stmt.data))140 def _perform_vex_stmt_Put(self, offset, data, **kwargs):141 pass142 def _analyze_vex_stmt_WrTmp_data(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)143 def _handle_vex_stmt_WrTmp(self, stmt):144 self._perform_vex_stmt_WrTmp(145 stmt.tmp,146 self._analyze_vex_stmt_WrTmp_data(stmt.data)147 )148 def _perform_vex_stmt_WrTmp(self, tmp, data):149 self.tmps[tmp] = data150 def _analyze_vex_stmt_Store_address(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)151 def _analyze_vex_stmt_Store_data(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)152 def _handle_vex_stmt_Store(self, stmt: pyvex.stmt.Store):153 self._perform_vex_stmt_Store(154 self._analyze_vex_stmt_Store_address(stmt.addr),155 self._analyze_vex_stmt_Store_data(stmt.data),156 stmt.end157 )158 def _perform_vex_stmt_Store(self, addr, data, endness, **kwargs):159 pass160 def _analyze_vex_stmt_Exit_guard(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)161 def _handle_vex_stmt_Exit(self, stmt: pyvex.stmt.Exit):162 self._perform_vex_stmt_Exit(163 self._analyze_vex_stmt_Exit_guard(stmt.guard),164 self._handle_vex_const(stmt.dst),165 stmt.jk166 )167 def _perform_vex_stmt_Exit(self, guard, target, jumpkind):168 pass169 def _analyze_vex_stmt_Dirty_arg(self, *a, **kw): return self._handle_vex_expr(*a, **kw)170 def _handle_vex_stmt_Dirty(self, stmt: pyvex.stmt.Dirty):171 return self._perform_vex_stmt_Dirty(172 stmt.cee.name,173 self.irsb.tyenv.lookup(stmt.tmp) if stmt.tmp not in (-1, 0xffffffff) else None,174 stmt.tmp,175 [self._analyze_vex_stmt_Dirty_arg(arg) for arg in stmt.args]176 )177 def _perform_vex_stmt_Dirty_wrtmp(self, *a, **kw): return self._perform_vex_stmt_WrTmp(*a, **kw)178 def _perform_vex_stmt_Dirty(self, func_name, ty, tmp, args):179 retval = self._perform_vex_stmt_Dirty_call(func_name, ty, args)180 if tmp not in (-1, 0xffffffff):181 self._perform_vex_stmt_Dirty_wrtmp(tmp, retval)182 def _perform_vex_stmt_Dirty_call(self, func_name, ty, args, func=None):183 return NotImplemented184 # stmt category 3: weird load/store patterns implemented in terms of above185 def _analyze_vex_stmt_PutI_ix(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)186 def _analyze_vex_stmt_PutI_data(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)187 def _handle_vex_stmt_PutI(self, stmt: pyvex.stmt.PutI):188 self._perform_vex_stmt_PutI(189 stmt.descr.base,190 stmt.descr.elemTy,191 stmt.bias,192 self._analyze_vex_stmt_PutI_ix(stmt.ix),193 stmt.descr.nElems,194 self._analyze_vex_stmt_PutI_data(stmt.data)195 )196 def _perform_vex_stmt_PutI_compute(self, base, elemTy, bias, ix, nElems):197 # base + ((bias + ix) % nElems) * elemSize198 elemSize = self._ty_to_bytes(elemTy)199 index = self._perform_vex_expr_Op('Iop_Add32', (self._handle_vex_const(pyvex.const.U32(bias)), ix))200 big_index = self._perform_vex_expr_Op('Iop_32HLto64', (self._handle_vex_const(pyvex.const.U32(0)), index))201 divmod_index = self._perform_vex_expr_Op('Iop_DivModU64to32', (big_index, self._handle_vex_const(pyvex.const.U32(nElems))))202 mod_index = self._perform_vex_expr_Op('Iop_64HIto32', (divmod_index,))203 offset = self._perform_vex_expr_Op('Iop_Mul32', (mod_index, self._handle_vex_const(pyvex.const.U32(elemSize))))204 return self._perform_vex_expr_Op('Iop_Add32', (self._handle_vex_const(pyvex.const.U32(base)), offset))205 def _perform_vex_stmt_PutI(self, base, elemSize, bias, ix, nElems, data):206 offset = self._perform_vex_stmt_PutI_compute(base, elemSize, bias, ix, nElems)207 self._perform_vex_stmt_Put(offset, data)208 def _analyze_vex_stmt_LLSC_addr(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)209 def _analyze_vex_stmt_LLSC_storedata(self, *a, **kw): return self._handle_vex_expr(*a, **kw)210 def _handle_vex_stmt_LLSC(self, stmt: pyvex.stmt.LLSC):211 self._perform_vex_stmt_LLSC(212 stmt.result,213 self._analyze_vex_stmt_LLSC_addr(stmt.addr),214 stmt.endness,215 self._analyze_vex_stmt_LLSC_storedata(stmt.storedata) if stmt.storedata is not None else None,216 self.irsb.tyenv.lookup(stmt.result))217 def _perform_vex_stmt_LLSC_load(self, *a, **kw): return self. _perform_vex_expr_Load(*a, **kw)218 def _perform_vex_stmt_LLSC_store(self, *a, **kw): return self. _perform_vex_stmt_Store(*a, **kw)219 def _perform_vex_stmt_LLSC_wrtmp(self, *a, **kw): return self. _perform_vex_stmt_WrTmp(*a, **kw)220 def _perform_vex_stmt_LLSC(self, result, addr, endness, storedata, ty):221 if storedata is None:222 load_result = self._perform_vex_stmt_LLSC_load(addr, ty, endness)223 self._perform_vex_stmt_LLSC_wrtmp(result, load_result)224 else:225 self._perform_vex_stmt_LLSC_store(addr, storedata, endness)226 self._perform_vex_stmt_LLSC_wrtmp(result, self._handle_vex_const(pyvex.const.U1(1)))227 def _analyze_vex_stmt_LoadG_addr(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)228 def _analyze_vex_stmt_LoadG_alt(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)229 def _analyze_vex_stmt_LoadG_guard(self, *a, **kw): return self._handle_vex_expr(*a, **kw)230 def _handle_vex_stmt_LoadG(self, stmt: pyvex.stmt.LoadG):231 self._perform_vex_stmt_LoadG(232 self._analyze_vex_stmt_LoadG_addr(stmt.addr),233 self._analyze_vex_stmt_LoadG_alt(stmt.alt),234 self._analyze_vex_stmt_LoadG_guard(stmt.guard),235 stmt.dst,236 stmt.cvt,237 stmt.end)238 def _perform_vex_stmt_LoadG_load(self, *a, **kw): return self. _perform_vex_expr_Load(*a, **kw)239 def _perform_vex_stmt_LoadG_widen(self, *a, **kw): return self. _perform_vex_expr_Op(*a, **kw)240 def _perform_vex_stmt_LoadG_ite(self, *a, **kw): return self. _perform_vex_expr_ITE(*a, **kw)241 def _perform_vex_stmt_LoadG_wrtmp(self, *a, **kw): return self. _perform_vex_stmt_WrTmp(*a, **kw)242 def _perform_vex_stmt_LoadG(self, addr, alt, guard, dst, cvt, end):243 cvt_properties = {244 'ILGop_IdentV128': ('Ity_V128', None), # 128 bit vector, no conversion */245 'ILGop_Ident64': ('Ity_I64', None), # 64 bit, no conversion */246 'ILGop_Ident32': ('Ity_I32', None), # 32 bit, no conversion */247 'ILGop_16Uto32': ('Ity_I16', 'Iop_16Uto32'), # 16 bit load, Z-widen to 32 */248 'ILGop_16Sto32': ('Ity_I16', 'Iop_16Sto32'), # 16 bit load, S-widen to 32 */249 'ILGop_8Uto32': ('Ity_I8', 'Iop_8Uto32'), # 8 bit load, Z-widen to 32 */250 'ILGop_8Sto32': ('Ity_I8', 'Iop_8Sto32') # 8 bit load, S-widen to 32 */251 }252 ty, cvt_op = cvt_properties[cvt]253 load_result = self._perform_vex_stmt_LoadG_load(addr, ty, end)254 if cvt_op is None:255 cvt_result = load_result256 else:257 cvt_result = self._perform_vex_stmt_LoadG_widen(cvt_op, (load_result,))258 ite_result = self._perform_vex_stmt_LoadG_ite(guard, cvt_result, alt)259 self._perform_vex_stmt_LoadG_wrtmp(dst, ite_result)260 def _analyze_vex_stmt_StoreG_addr(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)261 def _analyze_vex_stmt_StoreG_data(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)262 def _analyze_vex_stmt_StoreG_guard(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)263 def _handle_vex_stmt_StoreG(self, stmt: pyvex.stmt.StoreG):264 self._perform_vex_stmt_StoreG(265 self._analyze_vex_stmt_StoreG_addr(stmt.addr),266 self._analyze_vex_stmt_StoreG_data(stmt.data),267 self._analyze_vex_stmt_StoreG_guard(stmt.guard),268 stmt.data.result_type(self.irsb.tyenv),269 stmt.end270 )271 def _perform_vex_stmt_StoreG_load(self, *a, **kw): return self. _perform_vex_expr_Load(*a, **kw)272 def _perform_vex_stmt_StoreG_ite(self, *a, **kw): return self. _perform_vex_expr_ITE(*a, **kw)273 def _perform_vex_stmt_StoreG_store(self, *a, **kw): return self. _perform_vex_stmt_Store(*a, **kw)274 def _perform_vex_stmt_StoreG(self, addr, data, guard, ty, endness, **kwargs):275 load_result = self._perform_vex_stmt_StoreG_load(addr, ty, endness)276 ite_result = self._perform_vex_stmt_StoreG_ite(guard, data, load_result)277 self._perform_vex_stmt_StoreG_store(addr, ite_result, endness, **kwargs)278 def _analyze_vex_stmt_CAS_addr(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)279 def _analyze_vex_stmt_CAS_dataLo(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)280 def _analyze_vex_stmt_CAS_dataHi(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)281 def _analyze_vex_stmt_CAS_expdLo(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)282 def _analyze_vex_stmt_CAS_expdHi(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)283 def _handle_vex_stmt_CAS(self, stmt: pyvex.stmt.CAS):284 self._perform_vex_stmt_CAS(285 self._analyze_vex_stmt_CAS_addr(stmt.addr),286 self._analyze_vex_stmt_CAS_dataLo(stmt.dataLo),287 self._analyze_vex_stmt_CAS_dataHi(stmt.dataHi) if stmt.dataHi is not None else None,288 self._analyze_vex_stmt_CAS_expdLo(stmt.expdLo),289 self._analyze_vex_stmt_CAS_expdHi(stmt.expdHi) if stmt.expdHi is not None else None,290 stmt.oldLo,291 stmt.oldHi,292 stmt.endness,293 stmt.expdLo.result_type(self.irsb.tyenv)294 )295 def _perform_vex_stmt_CAS_load(self, *a, **kw): return self. _perform_vex_expr_Load(*a, **kw)296 def _perform_vex_stmt_CAS_wrtmp(self, *a, **kw): return self. _perform_vex_stmt_WrTmp(*a, **kw)297 def _perform_vex_stmt_CAS_cmp(self, *a, **kw): return self. _perform_vex_expr_Op(*a, **kw)298 def _perform_vex_stmt_CAS_narrow(self, *a, **kw): return self. _perform_vex_expr_Op(*a, **kw)299 def _perform_vex_stmt_CAS_widen(self, *a, **kw): return self. _perform_vex_expr_Op(*a, **kw)300 def _perform_vex_stmt_CAS_storeg(self, *a, **kw): return self. _perform_vex_stmt_StoreG(*a, **kw)301 def _perform_vex_stmt_CAS(self, addr, dataLo, dataHi, expdLo, expdHi, oldLo, oldHi, endness, ty):302 # - load mem303 # - compare304 # - store mem conditional305 # - store tmp306 double = dataHi is not None307 if double:308 ty, narrow_lo_op, narrow_hi_op, widen_op = {309 'Ity_I8': ('Ity_I16', 'Iop_16to8', 'Iop_16Hito8', 'Iop_8HLto16'),310 'Ity_I16': ('Ity_I32', 'Iop_32to16', 'Iop_32HIto16', 'Iop_16HLto32'),311 'Ity_I32': ('Ity_I64', 'Iop_64to32', 'Iop_64HIto32', 'Iop_32HLto64'),312 'Ity_I64': ('Ity_V128', 'Iop_128to64', 'Iop_128HIto64', 'Iop_64HLto128'),313 }[ty]314 data = self._perform_vex_stmt_CAS_widen(widen_op, (dataHi, dataLo))315 expd = self._perform_vex_stmt_CAS_widen(widen_op, (expdHi, expdLo))316 else:317 narrow_lo_op = narrow_hi_op = None318 data = dataLo319 expd = expdLo320 cmp_op = {321 'Ity_I8': 'Iop_CmpEQ8',322 'Ity_I16': 'Iop_CmpEQ16',323 'Ity_I32': 'Iop_CmpEQ32',324 'Ity_I64': 'Iop_CmpEQ64',325 'Ity_V128': 'Iop_CmpEQ128',326 }[ty]327 val = self._perform_vex_stmt_CAS_load(addr, ty, endness)328 cmp = self._perform_vex_stmt_CAS_cmp(cmp_op, (val, expd))329 self._perform_vex_stmt_CAS_storeg(addr, data, cmp, ty, endness)330 if double:331 valHi = self._perform_vex_stmt_CAS_narrow(narrow_hi_op, (val,))332 valLo = self._perform_vex_stmt_CAS_narrow(narrow_lo_op, (val,))333 self._perform_vex_stmt_CAS_wrtmp(oldLo, valLo)334 self._perform_vex_stmt_CAS_wrtmp(oldHi, valHi)335 else:336 self._perform_vex_stmt_CAS_wrtmp(oldLo, val)337 #338 # block level handling339 #340 def _analyze_vex_defaultexit(self, *a, **kw): return self. _handle_vex_expr(*a, **kw)341 def handle_vex_block(self, irsb: pyvex.IRSB):342 self.irsb = irsb343 self.tmps = [None]*self.irsb.tyenv.types_used344 for stmt_idx, stmt in enumerate(irsb.statements):345 self.stmt_idx = stmt_idx346 self._handle_vex_stmt(stmt)347 self.stmt_idx = DEFAULT_STATEMENT348 self._handle_vex_defaultexit(irsb.next, irsb.jumpkind)349 def _handle_vex_defaultexit(self, expr: Optional[pyvex.expr.IRExpr], jumpkind: str):350 self._perform_vex_defaultexit(351 self._analyze_vex_defaultexit(expr) if expr is not None else None,352 jumpkind353 )354 def _perform_vex_defaultexit(self, expr, jumpkind):...
minification.spec.ts
Source:minification.spec.ts
1import * as T from '../../types'2import * as Path from 'path';3import { compile } from '../..';4function perform(name: string, sample: string) {5 const path = `../../samples/${sample}`;6 let minified: string;7 let compilerOptions: T.CompilerOptions | undefined;8 const entry = Path.join(__dirname, `../../samples/${sample}.wyrd`);9 beforeAll(async () => {10 const testCase = await import(path);11 minified = testCase.minified;12 compilerOptions = testCase.compilerOptions;13 });14 it(`minifies and compiles \`${name}\` correctly`, () => {15 const { result } = compile({ minify: true, ...compilerOptions, entry });16 expect(result).toBe(minified);17 });18}19perform.todo = function (name: string, sample?: string) {20 it.todo(`minifies and compiles \`${name}\` correctly`);21}22function todo(name: string) {23 it.todo(`minifies and compiles \`${name}\` correctly`);24}25describe('Compiler Option: Minification', () => {26 describe('Arithmetics', () => {27 perform('basic arithmetic expressions', 'arithmetics/pure-expression');28 perform('with prioritized expression', 'arithmetics/with-prioritization');29 });30 describe('Logical', () => {31 perform('pure logical expression', 'logical/pure-logics');32 perform('logical expression with prioritization', 'logical/with-prioritization');33 perform('logical comparison expression', 'logical/comparison');34 });35 describe('Assignment', () => {36 perform('constant declaration', 'assignment/constant-declaration');37 perform('assignment with arithmetic expressions', 'assignment/arithmetic-expression');38 perform('assignment with logical expressions', 'assignment/logical-expression');39 perform('assignment with method invocation', 'assignment/method-invocation');40 perform('assignment with method invocation and prioritization', 'assignment/method-invocation-with-prioritization');41 perform('mutable variable declaration & assignment', 'assignment/mutable');42 perform('mutable variable declaration & assignment with prioritization', 'assignment/mutable-with-prioritization');43 perform('maybe-types declaration', 'assignment/maybe-types-declaration');44 perform('maybe-record-types declaration', 'assignment/maybe-records');45 });46 describe('Builtin Types', () => {47 perform('primitives', 'builtin-types/primitives');48 describe('List', () => {49 perform('list literals', 'builtin-types/list/literal');50 perform('multidimensional list', 'builtin-types/list/multidimension');51 perform('list with function invocation', 'builtin-types/list/with-function-invocation');52 perform('list with prioritization expressions', 'builtin-types/list/with-prioritization');53 perform('builtin-methods invocation', 'builtin-types/list/builtin-methods');54 perform('builtin-methods invocation by type', 'builtin-types/list/builtin-methods-invoke-by-type');55 });56 describe('Record', () => {57 perform('record declaration', 'record/basic-declaration');58 perform('record maybe types value declaration', 'record/maybe-types');59 perform('multiline record declaration', 'record/multiline');60 perform('record assignment', 'record/record-assignment');61 perform('nested record', 'record/nested');62 perform('record method declaration', 'record/method-declaration');63 perform('record method overloading', 'record/method-overloading');64 perform('record method overriding', 'record/method-overriding');65 });66 });67 describe('Comment', () => {68 perform('single-line comment', 'comment/singleline-comment');69 perform('multi-line comment', 'comment/multiline-comment');70 perform('multi-line comment between expression', 'comment/multiline-in-expr');71 });72 describe('Conditional Expression', () => {73 perform('If-Arrow expression', 'conditional/if-arrow-expression');74 perform('If-Arrow complex expression', 'conditional/if-arrow-complex');75 perform('If-Arrow-Else-If complex expression', 'conditional/if-arrow-else-if-complex');76 perform('If-Arrow without Else expression', 'conditional/if-arrow-without-else-expression');77 perform('If-Then expression', 'conditional/if-then-expression');78 perform('If-Then complex expression', 'conditional/if-then-complex');79 perform('If-Then-Else-If complex expression', 'conditional/if-then-else-if-complex');80 perform('If-Then without Else expression', 'conditional/if-then-without-else-expression');81 perform('If-Block expression', 'conditional/if-else-block-expression');82 perform('If-Block complex expression', 'conditional/if-block-complex');83 perform('If-Block-Else-If complex expression', 'conditional/if-block-else-if-complex');84 perform('If-Else-If-Block expression', 'conditional/if-else-if-block-expression');85 perform('If-Block without Else expression', 'conditional/if-block-without-else-expression');86 perform('If-Else-If-Block without Else expression', 'conditional/if-else-if-block-without-else-expression');87 perform('If-Mixed expression', 'conditional/if-mixed-expression');88 perform('If-Mixed without Else expression', 'conditional/if-mixed-without-else-expression');89 });90 describe('Function Declaration', () => {91 perform('function arrow declaration', 'function-declaration/function-arrow-declaration');92 perform('function block expression declaration', 'function-declaration/function-block-declaration');93 perform('uses variables from parent scope', 'function-declaration/using-vars-from-parent-scope');94 perform('invoking other declared function', 'function-declaration/invoke-declared-function');95 perform('nested declaration', 'function-declaration/nested-declaration');96 perform('override function declaration', 'function-declaration/override-function-declaration');97 perform('function overloading', 'function-declaration/function-overloading');98 perform('override function overloading', 'function-declaration/override-function-overloading');99 });100 describe('Function Invocation', () => {101 perform('basic function invocation', 'function-invocation/basic-invocation');102 perform('nested function invocation', 'function-invocation/nested-invocation');103 perform('function invocation with prioritization', 'function-invocation/with-prioritization');104 perform('declare function before function invocation', 'function-invocation/declare-before-invoke');105 });106 describe('Method Declaration', () => {107 perform('method arrow declaration', 'method-declaration/method-arrow-declaration');108 perform('method block declaration', 'method-declaration/method-block-declaration');109 perform('method declaration overloading', 'method-declaration/method-overloading');110 perform('method declaration overriding', 'method-declaration/method-overriding');111 });112 describe('Method Invocation', () => {113 perform('method invocation with direct method mapping', 'method-invocation/direct-method-mapping');114 perform('expression invoke method expression', 'method-invocation/expr-invoke-method');115 perform('chained method invocation', 'method-invocation/chained');116 perform('method invocation as parameters', 'method-invocation/as-params');117 perform('method invocation mixed binary operation', 'method-invocation/with-binary-operation');118 perform('builtin-type method invocation', 'method-invocation/builtin-type-invocation');119 });120 describe('Pipe Operation', () => {121 perform('function invocation pipeline', 'pipe-operation/on-function');122 perform('method invocation pipeline', 'pipe-operation/on-method');123 perform('function and method invocation mixed pipeline', 'pipe-operation/on-mixed');124 });...
tutorial_part_2.py
Source:tutorial_part_2.py
...34 'images/tutorial/little_villager_girl_done_talking_LITTLEROOT.png',35 grayscale=True)36 print('Shes done talking!')37 except Exception as e:38 perform('c')39 perform_super_quick('up')40 perform_super_quick('up')41 perform_super_quick('up')42 perform_super_quick('c')43 birch_done_talking = None44 while (birch_done_talking == None):45 try:46 birch_done_talking = pyautogui.locateOnScreen(47 'images/tutorial/birch_is_done_talking.png',48 grayscale=True)49 print('Time to select starter')50 except Exception as e:51 perform('c')52 return select_starter()53def get_out_of_rival_room():54 perform_super_quick('left')55 perform_super_quick('left')56 perform_super_quick('left')57 perform_super_quick('left')58 perform_super_quick('left')59 perform_super_quick('up')60 perform_super_quick('up')61 perform_super_quick('up')62 perform_super_quick('up')63 perform_super_quick('down')64 perform_super_quick('down')65 perform_super_quick('down')66 perform_super_quick('down')67 perform_super_quick('down')68 perform_super_quick('down')69 save_file()70 return check_professor()71def go_to_neighboor():72 perform_super_quick('right')73 perform_super_quick('right')74 perform_super_quick('right')75 perform_super_quick('right')76 perform_super_quick('right')77 perform_super_quick('right')78 perform_super_quick('right')79 perform_super_quick('right')80 perform_super_quick('right')81 perform_super_quick('right')82 perform_super_quick('up')83 rival_mom_done = None84 while (rival_mom_done == None):85 try:86 rival_mom_done = pyautogui.locateOnScreen(87 'images/tutorial/rival_mom_talking_done_male.png',88 grayscale=True)89 print('Shes done talking!')90 except Exception as e:91 perform('c')92 perform_super_quick('up')93 perform_super_quick('up')94 perform_super_quick('up')95 perform_super_quick('up')96 perform_super_quick('up')97 perform_super_quick('up')98 perform_super_quick('up')99 time.sleep(2.5)100 perform_super_quick('down')101 perform_super_quick('down')102 perform_super_quick('down')103 perform_super_quick('right')104 perform_super_quick('right')105 perform_super_quick('right')106 perform_super_quick('right')107 perform_super_quick('right')108 perform_super_quick('up')109 perform_super_quick('x')110 rival_done_pc = None111 while (rival_done_pc == None):112 try:113 rival_done_pc = pyautogui.locateOnScreen(114 'images/tutorial/rival_is_done_male.png',115 grayscale=True)116 print('Shes done talking!')117 except Exception as e:118 perform('c')119def see_dad_on_tv():120 is_mom_done = None121 while (is_mom_done == None):122 try:123 is_mom_done = pyautogui.locateOnScreen(124 'images/tutorial/mom_after_clock_male.png',125 grayscale=True)126 print('YAY WE OUT!')127 except Exception as e:128 perform('c')129 print('Mom is done talking, lets head out')130 perform_super_quick('right')131 perform_super_quick('right')132 perform_super_quick('right')133 perform_super_quick('right')134 perform_super_quick('right')135 perform_super_quick('down')136 perform_super_quick('down')137 perform_super_quick('down')138 perform_super_quick('down')139 perform_super_quick('down')140 time.sleep(2.5)141 save_file()142 return go_to_neighboor()...
transaction.command.mapper.ts
Source:transaction.command.mapper.ts
1import { PerformTransferRequestDto } from '../dto/perform.transfer.request.dto';2import { PerformTransfer } from '../commands/perform.transfer';3import { TransactionStatus } from '../../domain/enums/transaction.status.enum';4import { DateTime } from 'src/app/infra/utils/datetime';5import { TransactionTypeOrm } from '../../infra/persistence/typeorm/entities/transaction.typeorm';6import { PerformTransferResponseDto } from '../dto/perform.transfer.response.dto';7import { PerformDepositRequestDto } from '../dto/perform.deposit.request.dto';8import { PerformDeposit } from '../commands/perform.deposit';9import { PerformDepositResponseDto } from '../dto/perform.deposit.response.dto';10import { PerformWithdraw } from '../commands/perform.withdraw';11import { PerformWithdrawRequestDto } from '../dto/perform.withdraw.request.dto';12import { PerformWithdrawResponseDto } from '../dto/perform.withdraw.response.dto';13import { TransactionTypeLabel } from '../../domain/enums/transaction.type.enum';14export class TransactionCommandMapper {15 public static toPerformDepositCommand(16 performDepositRequestDto: PerformDepositRequestDto,17 ): PerformDeposit {18 let performDeposit: PerformDeposit = new PerformDeposit();19 performDeposit.accountNumber = performDepositRequestDto.accountNumber;20 performDeposit.amount = performDepositRequestDto.amount;21 performDeposit.status = TransactionStatus.COMPLETED;22 performDeposit.createdAt = DateTime.getUtcDateTime();23 return performDeposit;24 }25 public static toPerformDepositResponseDto(26 transactionTypeOrm: TransactionTypeOrm,27 ): PerformDepositResponseDto {28 let performDepositResponseDto: PerformDepositResponseDto = new PerformDepositResponseDto();29 performDepositResponseDto.transactionId = Number(transactionTypeOrm.id);30 performDepositResponseDto.transactionType = TransactionTypeLabel.get(31 transactionTypeOrm.type,32 );33 performDepositResponseDto.accountNumber =34 transactionTypeOrm.toAccount.number;35 performDepositResponseDto.amount = Number(transactionTypeOrm.amount);36 performDepositResponseDto.status =37 TransactionStatus[transactionTypeOrm.status];38 performDepositResponseDto.createdAt = transactionTypeOrm.createdAt;39 return performDepositResponseDto;40 }41 public static toPerformWithdrawCommand(42 performWithdrawRequestDto: PerformWithdrawRequestDto,43 ): PerformWithdraw {44 let performWithdraw: PerformWithdraw = new PerformWithdraw();45 performWithdraw.accountNumber = performWithdrawRequestDto.accountNumber;46 performWithdraw.amount = performWithdrawRequestDto.amount;47 performWithdraw.status = TransactionStatus.COMPLETED;48 performWithdraw.createdAt = DateTime.getUtcDateTime();49 return performWithdraw;50 }51 public static toPerformWithdrawResponseDto(52 transactionTypeOrm: TransactionTypeOrm,53 ): PerformWithdrawResponseDto {54 let performWithdrawResponseDto: PerformWithdrawResponseDto = new PerformWithdrawResponseDto();55 performWithdrawResponseDto.transactionId = Number(transactionTypeOrm.id);56 performWithdrawResponseDto.transactionType = TransactionTypeLabel.get(57 transactionTypeOrm.type,58 );59 performWithdrawResponseDto.accountNumber =60 transactionTypeOrm.fromAccount.number;61 performWithdrawResponseDto.amount = Number(transactionTypeOrm.amount);62 performWithdrawResponseDto.status =63 TransactionStatus[transactionTypeOrm.status];64 performWithdrawResponseDto.createdAt = transactionTypeOrm.createdAt;65 return performWithdrawResponseDto;66 }67 public static toPerformTransferCommand(68 performTransferRequestDto: PerformTransferRequestDto,69 ): PerformTransfer {70 let performTransfer: PerformTransfer = new PerformTransfer();71 performTransfer.fromAccountNumber =72 performTransferRequestDto.fromAccountNumber;73 performTransfer.toAccountNumber = performTransferRequestDto.toAccountNumber;74 performTransfer.amount = performTransferRequestDto.amount;75 performTransfer.status = TransactionStatus.COMPLETED;76 performTransfer.createdAt = DateTime.getUtcDateTime();77 return performTransfer;78 }79 public static toPerformTransferResponseDto(80 transactionTypeOrm: TransactionTypeOrm,81 ): PerformTransferResponseDto {82 let performTransferResponseDto: PerformTransferResponseDto = new PerformTransferResponseDto();83 performTransferResponseDto.transactionId = Number(transactionTypeOrm.id);84 performTransferResponseDto.transactionType = TransactionTypeLabel.get(85 transactionTypeOrm.type,86 );87 performTransferResponseDto.fromAccountNumber =88 transactionTypeOrm.fromAccount.number;89 performTransferResponseDto.toAccountNumber =90 transactionTypeOrm.toAccount.number;91 performTransferResponseDto.amount = Number(transactionTypeOrm.amount);92 performTransferResponseDto.status =93 TransactionStatus[transactionTypeOrm.status];94 performTransferResponseDto.createdAt = transactionTypeOrm.createdAt;95 return performTransferResponseDto;96 }...
test_pente.py
Source:test_pente.py
1"""2Initialize a game of Pente.3 >>> from pybrain.rl.environments.twoplayergames.pente import PenteGame4 >>> dim = 55 >>> c = PenteGame((dim, dim))6 >>> print(c)7 _ _ _ _ _8 _ _ _ _ _9 _ _ * _ _10 _ _ _ _ _11 _ _ _ _ _12 Black captured:0, white captured:0.13Do some moves to produce a situation14 >>> c.performAction([1, (0,1)])15 >>> c.performAction([-1, (1,0)])16 >>> c.performAction([1, (1,1)])17 >>> c.performAction([-1, (1,2)])18 >>> c.performAction([1, (2,0)])19 >>> c.performAction([-1, (2,1)])20 >>> c.performAction([1, (0,2)])21Show the updated board:22 >>> print(c)23 _ # # _ _24 * # * _ _25 # * * _ _26 _ _ _ _ _27 _ _ _ _ _28 Black captured:0, white captured:0.29Do some captures:30 >>> c.performAction([-1, (0,3)])31 >>> c.performAction([1, (3,2)])32 >>> c.performAction([-1, (0,0)])33Stepping between black stones is not deadly though:34 >>> c.performAction([1, (2,3)])35 >>> c.performAction([-1, (2,2)])36 >>> print(c)37 * _ _ * _38 * # _ _ _39 # * * # _40 _ _ # _ _41 _ _ _ _ _42 Black captured:1, white captured:1.43Fast forward to the end:44 >>> c.performAction([-1, (0,4)])45 >>> c.performAction([-1, (3,1)])46 >>> c.performAction([-1, (4,0)])47Now it is almost decided, white has a killing move!48 >>> c.getKilling(-1)49 [(1, 3)]50 >>> c.getWinner()51Do it!52 >>> c.performAction([-1, (1,3)])53White wins.54 >>> c.getWinner()55 -156Check if all the values are right:57 >>> print(c)58 * _ _ * *59 * # _ x _60 # * * # _61 _ * # _ _62 * _ _ _ _63 Winner: White (*) (moves done:17)64 Black captured:1, white captured:1.65"""66__author__ = 'Tom Schaul, tom@idsia.ch'67from pybrain.tests import runModuleTestSuite68if __name__ == '__main__':...
test_perform.py
Source:test_perform.py
1from unittest import mock, TestCase2from .....didcomm_prefix import DIDCommPrefix3from ...message_types import PERFORM, PROTOCOL_PACKAGE4from ..perform import Perform, PerformSchema5class TestPerform(TestCase):6 test_name = "option_name"7 test_params = {"a": "aaa"}8 def setUp(self):9 self.perform = Perform(name=self.test_name, params=self.test_params)10 def test_init(self):11 """Test initialization."""12 assert self.perform.name == self.test_name13 assert self.perform.params == self.test_params14 def test_type(self):15 """Test type."""16 assert self.perform._type == DIDCommPrefix.qualify_current(PERFORM)17 @mock.patch(f"{PROTOCOL_PACKAGE}.messages.perform.PerformSchema.load")18 def test_deserialize(self, mock_perform_schema_load):19 """20 Test deserialization.21 """22 obj = {"obj": "obj"}23 request = Perform.deserialize(obj)24 mock_perform_schema_load.assert_called_once_with(obj)25 assert request is mock_perform_schema_load.return_value26 @mock.patch(f"{PROTOCOL_PACKAGE}.messages.perform.PerformSchema.dump")27 def test_serialize(self, mock_perform_schema_dump):28 """29 Test serialization.30 """31 request_dict = self.perform.serialize()32 mock_perform_schema_dump.assert_called_once_with(self.perform)33 assert request_dict is mock_perform_schema_dump.return_value34 def test_make_model(self):35 data = self.perform.serialize()36 model_instance = Perform.deserialize(data)...
perform.py
Source:perform.py
1"""Represents a request to perform a menu action."""2from typing import Mapping3from marshmallow import EXCLUDE, fields4from .....messaging.agent_message import AgentMessage, AgentMessageSchema5from ..message_types import PERFORM, PROTOCOL_PACKAGE6HANDLER_CLASS = f"{PROTOCOL_PACKAGE}.handlers.perform_handler.PerformHandler"7class Perform(AgentMessage):8 """Class representing a request to perform a menu action."""9 class Meta:10 """Perform metadata."""11 handler_class = HANDLER_CLASS12 message_type = PERFORM13 schema_class = "PerformSchema"14 def __init__(self, *, name: str = None, params: Mapping[str, str] = None, **kwargs):15 """16 Initialize a Perform object.17 Args:18 name: The name of the menu option19 params: Input parameter values20 """21 super().__init__(**kwargs)22 self.name = name23 self.params = params24class PerformSchema(AgentMessageSchema):25 """Perform schema class."""26 class Meta:27 """Perform schema metadata."""28 model_class = Perform29 unknown = EXCLUDE30 name = fields.Str(31 required=True,32 description="Menu option name",33 example="Query",34 )35 params = fields.Dict(36 required=False,37 keys=fields.Str(example="parameter"), # marshmallow/apispec v3.0 ignores38 values=fields.Str(example="value"),...
Using AI Code Generation
1var rootController = require('./rootController.js');2rootController.perform();3var childController = require('./childController.js');4childController.perform();5var perform = function() {6 console.log('Perform method of childController');7}8module.exports = {9}
Using AI Code Generation
1var rootclass = require("./rootclass");2rootclass.perform();3var childclass = require("./childclass");4childclass.perform();5exports.perform = function() {6 console.log("Performing task");7};8var childclass = require("./childclass");9childclass.perform();10var childclass = require("./childclass");11childclass.perform();12exports.perform = function() {13 console.log("Performing task");14};15Related Posts: How to use the require() method in Node.js
Using AI Code Generation
1root.perform("test", "test2", "test3");2root.perform("test", "test2", "test3");3root.perform("test", "test2", "test3");4root.perform("test", "test2", "test3");5root.perform("test", "test2", "test3");6root.perform("test", "test2", "test3");7root.perform("test", "test2", "test3");8root.perform("test", "test2", "test3");9root.perform("test", "test2", "test3");10root.perform("test", "test2", "test3");11root.perform("test", "test2", "test3");12root.perform("test", "test2", "test3");13root.perform("test", "test2", "test3");14root.perform("test", "test2", "test3");15root.perform("test", "test2", "test3");16root.perform("test", "test2", "test3");17root.perform("test", "test2", "test3");
Using AI Code Generation
1var root = require('root');2var result = root.perform(5, 6);3console.log('Result: ' + result);4var root = require('root');5var result = root.perform(5, 6);6console.log('Result: ' + result);7var root = require('root');8var result = root.perform(5, 6);9console.log('Result: ' + result);10var root = require('root');11var result = root.perform(5, 6);12console.log('Result: ' + result);13var root = require('root');14var result = root.perform(5, 6);15console.log('Result: ' + result);16var root = require('root');17var result = root.perform(5, 6);18console.log('Result: ' + result);19var root = require('root');20var result = root.perform(5, 6);21console.log('Result: ' + result);22var root = require('root');23var result = root.perform(5, 6);24console.log('Result: ' + result);25var root = require('root');26var result = root.perform(5, 6);27console.log('Result: ' + result);28var root = require('root');29var result = root.perform(5, 6);30console.log('Result: ' + result);31var root = require('root');32var result = root.perform(5, 6);33console.log('Result: ' + result);34var root = require('root');35var result = root.perform(5, 6);36console.log('Result: ' + result);37var root = require('root');38var result = root.perform(5, 6);39console.log('Result: ' + result);40var root = require('root');41var result = root.perform(5,
Using AI Code Generation
1var root = require('./root');2root.perform();3var perform = function() {4 console.log('Performing');5}6module.exports.perform = perform;7var perform = function() {8 console.log('Performing');9}10module.exports.perform = perform;11var child = require('./child');12child.perform();13var perform = function() {14 console.log('Performing');15}16module.exports.perform = perform;17var perform = function() {18 console.log('Performing');19}20module.exports.perform = perform;
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!!