How to use perform method in Airtest

Best Python code snippet using Airtest

permission.js

Source:permission.js Github

copy

Full Screen

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// 已声明权限的资源...

Full Screen

Full Screen

light.py

Source:light.py Github

copy

Full Screen

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):...

Full Screen

Full Screen

minification.spec.ts

Source:minification.spec.ts Github

copy

Full Screen

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 });...

Full Screen

Full Screen

tutorial_part_2.py

Source:tutorial_part_2.py Github

copy

Full Screen

...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()...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Airtest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful