How to use describe method in fast-check-monorepo

Best JavaScript code snippet using fast-check-monorepo

bruteforce_tests.py

Source:bruteforce_tests.py Github

copy

Full Screen

1BRUTEFORCE_TESTS = {2 "a4b": [3 "get_conference_preference",4 "get_device",5 "get_invitation_configuration",6 "get_profile",7 "get_room",8 "get_skill_group",9 "list_business_report_schedules",10 "list_conference_providers",11 "list_skills",12 "list_skills_store_categories"13 ],14 "acm": [15 "list_certificates"16 ],17 "amplify": [18 "list_apps"19 ],20 "apigateway": [21 "get_account",22 "get_api_keys",23 "get_client_certificates",24 "get_domain_names",25 "get_rest_apis",26 "get_sdk_types",27 "get_usage_plans",28 "get_vpc_links",29 "get_domain_names"30 ],31 "appmesh": [32 "list_meshes",33 "list_meshes"34 ],35 "appstream2": [36 "describe_directory_configs",37 "describe_fleets",38 "describe_image_builders",39 "describe_images",40 "describe_user_stack_associations"41 ],42 "appsync": [43 "list_graphql_apis"44 ],45 "athena": [46 "list_named_queries",47 "list_query_executions",48 "list_work_groups"49 ],50 "autoscaling": [51 "describe_account_limits",52 "describe_adjustment_types",53 "describe_auto_scaling_groups",54 "describe_auto_scaling_instances",55 "describe_auto_scaling_notification_types",56 "describe_launch_configurations",57 "describe_lifecycle_hook_types",58 "describe_metric_collection_types",59 "describe_notification_configurations",60 "describe_policies",61 "describe_scaling_activities",62 "describe_scaling_process_types",63 "describe_scheduled_actions",64 "describe_tags",65 "describe_termination_policy_types"66 ],67 "backup": [68 "get_supported_resource_types",69 "list_backup_jobs",70 "list_backup_plan_templates",71 "list_backup_plans",72 "list_backup_vaults",73 "list_protected_resources",74 "list_restore_jobs"75 ],76 "batch": [77 "describe_compute_environments",78 "describe_job_definitions",79 "describe_job_queues",80 "list_jobs"81 ],82 "chime": [83 "list_accounts"84 ],85 "cloud9": [86 "describe_environment_memberships",87 "list_environments"88 ],89 "clouddirectory": [90 "list_development_schema_arns",91 "list_directories",92 "list_published_schema_arns",93 "list_development_schema_arns",94 "list_directories",95 "list_managed_schema_arns",96 "list_published_schema_arns"97 ],98 "cloudformation": [99 "describe_account_limits",100 "describe_stack_events",101 "describe_stack_resources",102 "get_template",103 "get_template_summary",104 "list_exports",105 "list_stack_sets",106 "list_stacks"107 ],108 "cloudfront": [109 "list_cloud_front_origin_access_identities",110 "list_distributions",111 "list_field_level_encryption_configs",112 "list_field_level_encryption_profiles",113 "list_streaming_distributions",114 "list_cloud_front_origin_access_identities",115 "list_distributions",116 "list_streaming_distributions",117 "list_cloud_front_origin_access_identities",118 "list_distributions",119 "list_field_level_encryption_configs",120 "list_field_level_encryption_profiles",121 "list_streaming_distributions",122 "list_cloud_front_origin_access_identities",123 "list_distributions",124 "list_field_level_encryption_configs",125 "list_field_level_encryption_profiles",126 "list_streaming_distributions",127 "list_cloud_front_origin_access_identities",128 "list_distributions",129 "list_streaming_distributions"130 ],131 "cloudhsm": [132 "describe_hsm",133 "describe_luna_client",134 "list_available_zones",135 "list_hapgs",136 "list_hsms",137 "list_luna_clients"138 ],139 "cloudhsmv2": [140 "describe_backups",141 "describe_clusters"142 ],143 "cloudsearch": [144 "describe_domains",145 "list_domain_names",146 "describe_domains"147 ],148 "cloudtrail": [149 "describe_trails"150 ],151 "codebuild": [152 "list_builds",153 "list_curated_environment_images",154 "list_projects",155 "list_source_credentials"156 ],157 "codecommit": [158 "get_branch",159 "list_repositories"160 ],161 "codedeploy": [162 "batch_get_deployment_targets",163 "get_deployment_target",164 "list_applications",165 "list_deployment_configs",166 "list_deployment_targets",167 "list_deployments",168 "list_git_hub_account_token_names",169 "list_on_premises_instances"170 ],171 "codepipeline": [172 "list_action_types",173 "list_pipelines",174 "list_webhooks"175 ],176 "codestar": [177 "list_projects",178 "list_user_profiles"179 ],180 "cognito-sync": [181 "list_identity_pool_usage"182 ],183 "comprehend": [184 "list_document_classification_jobs",185 "list_document_classifiers",186 "list_dominant_language_detection_jobs",187 "list_entities_detection_jobs",188 "list_entity_recognizers",189 "list_key_phrases_detection_jobs",190 "list_sentiment_detection_jobs",191 "list_topics_detection_jobs"192 ],193 "config": [194 "describe_aggregation_authorizations",195 "describe_compliance_by_config_rule",196 "describe_compliance_by_resource",197 "describe_config_rule_evaluation_status",198 "describe_config_rules",199 "describe_configuration_aggregators",200 "describe_configuration_recorder_status",201 "describe_configuration_recorders",202 "describe_delivery_channel_status",203 "describe_delivery_channels",204 "describe_pending_aggregation_requests",205 "describe_retention_configurations",206 "get_compliance_summary_by_config_rule",207 "get_compliance_summary_by_resource_type",208 "get_discovered_resource_counts"209 ],210 "cur": [211 "describe_report_definitions"212 ],213 "data.mediastore": [214 "list_items"215 ],216 "datapipeline": [217 "list_pipelines"218 ],219 "datasync": [220 "list_agents",221 "list_locations",222 "list_task_executions",223 "list_tasks"224 ],225 "dax": [226 "describe_clusters",227 "describe_default_parameters",228 "describe_parameter_groups",229 "describe_subnet_groups"230 ],231 "devicefarm": [232 "get_account_settings",233 "get_offering_status",234 "list_device_instances",235 "list_devices",236 "list_instance_profiles",237 "list_offering_promotions",238 "list_offering_transactions",239 "list_offerings",240 "list_projects",241 "list_vpce_configurations"242 ],243 "devices.iot1click": [244 "list_devices"245 ],246 "directconnect": [247 "describe_connections",248 "describe_direct_connect_gateway_associations",249 "describe_direct_connect_gateway_attachments",250 "describe_direct_connect_gateways",251 "describe_interconnects",252 "describe_lags",253 "describe_locations",254 "describe_virtual_gateways",255 "describe_virtual_interfaces"256 ],257 "discovery": [258 "describe_agents",259 "describe_continuous_exports",260 "describe_export_configurations",261 "describe_export_tasks",262 "describe_import_tasks",263 "get_discovery_summary"264 ],265 "dlm": [266 "get_lifecycle_policies"267 ],268 "dms": [269 "describe_account_attributes",270 "describe_certificates",271 "describe_connections",272 "describe_endpoint_types",273 "describe_endpoints",274 "describe_event_categories",275 "describe_event_subscriptions",276 "describe_orderable_replication_instances",277 "describe_replication_instances",278 "describe_replication_subnet_groups",279 "describe_replication_task_assessment_results",280 "describe_replication_tasks"281 ],282 "ds": [283 "describe_directories",284 "describe_event_topics",285 "describe_snapshots",286 "describe_trusts",287 "get_directory_limits",288 "list_log_subscriptions"289 ],290 "dynamodb": [291 "describe_endpoints",292 "describe_limits",293 "list_backups",294 "list_global_tables",295 "list_tables",296 "list_tables"297 ],298 "ec2": [299 "describe_account_attributes",300 "describe_addresses",301 "describe_aggregate_id_format",302 "describe_availability_zones",303 "describe_bundle_tasks",304 "describe_capacity_reservations",305 "describe_classic_link_instances",306 "describe_client_vpn_endpoints",307 "describe_conversion_tasks",308 "describe_customer_gateways",309 "describe_dhcp_options",310 "describe_egress_only_internet_gateways",311 "describe_elastic_gpus",312 "describe_export_tasks",313 "describe_fleets",314 "describe_flow_logs",315 "describe_fpga_images",316 "describe_host_reservation_offerings",317 "describe_host_reservations",318 "describe_hosts",319 "describe_iam_instance_profile_associations",320 "describe_id_format",321 "describe_images",322 "describe_import_image_tasks",323 "describe_import_snapshot_tasks",324 "describe_instance_credit_specifications",325 "describe_instance_status",326 "describe_instances",327 "describe_internet_gateways",328 "describe_key_pairs",329 "describe_launch_template_versions",330 "describe_launch_templates",331 "describe_moving_addresses",332 "describe_nat_gateways",333 "describe_network_acls",334 "describe_network_interface_permissions",335 "describe_network_interfaces",336 "describe_placement_groups",337 "describe_prefix_lists",338 "describe_principal_id_format",339 "describe_public_ipv4_pools",340 "describe_regions",341 "describe_reserved_instances",342 "describe_reserved_instances_listings",343 "describe_reserved_instances_modifications",344 "describe_reserved_instances_offerings",345 "describe_route_tables",346 "describe_scheduled_instances",347 "describe_security_groups",348 "describe_snapshots",349 "describe_spot_datafeed_subscription",350 "describe_spot_fleet_requests",351 "describe_spot_instance_requests",352 "describe_spot_price_history",353 "describe_subnets",354 "describe_tags",355 "describe_transit_gateway_attachments",356 "describe_transit_gateway_route_tables",357 "describe_transit_gateway_vpc_attachments",358 "describe_transit_gateways",359 "describe_volume_status",360 "describe_volumes",361 "describe_volumes_modifications",362 "describe_vpc_classic_link",363 "describe_vpc_classic_link_dns_support",364 "describe_vpc_endpoint_connection_notifications",365 "describe_vpc_endpoint_connections",366 "describe_vpc_endpoint_service_configurations",367 "describe_vpc_endpoint_services",368 "describe_vpc_endpoints",369 "describe_vpc_peering_connections",370 "describe_vpcs",371 "describe_vpn_connections",372 "describe_vpn_gateways"373 ],374 "ecr": [375 "describe_repositories",376 "get_authorization_token"377 ],378 "ecs": [379 "describe_clusters",380 "list_account_settings",381 "list_clusters",382 "list_container_instances",383 "list_services",384 "list_task_definition_families",385 "list_task_definitions",386 "list_tasks"387 ],388 "eks": [389 "list_clusters"390 ],391 "elasticache": [392 "describe_cache_clusters",393 "describe_cache_engine_versions",394 "describe_cache_parameter_groups",395 "describe_cache_security_groups",396 "describe_cache_subnet_groups",397 "describe_replication_groups",398 "describe_reserved_cache_nodes",399 "describe_reserved_cache_nodes_offerings",400 "describe_snapshots",401 "list_allowed_node_type_modifications"402 ],403 "elasticbeanstalk": [404 "describe_account_attributes",405 "describe_configuration_options",406 "describe_environment_health",407 "describe_environment_managed_action_history",408 "describe_environment_managed_actions",409 "describe_environment_resources",410 "describe_instances_health",411 "describe_platform_version"412 ],413 "elasticfilesystem": [414 "describe_file_systems",415 "describe_mount_targets"416 ],417 "elasticloadbalancing": [418 "describe_account_limits",419 "describe_load_balancer_policies",420 "describe_load_balancer_policy_types",421 "describe_load_balancers",422 "describe_account_limits",423 "describe_listeners",424 "describe_load_balancers",425 "describe_rules",426 "describe_ssl_policies",427 "describe_target_groups"428 ],429 "elasticmapreduce": [430 "describe_job_flows",431 "list_clusters",432 "list_security_configurations"433 ],434 "elastictranscoder": [435 "list_pipelines",436 "list_presets"437 ],438 "email": [439 "get_account",440 "get_dedicated_ips",441 "get_deliverability_dashboard_options",442 "list_configuration_sets",443 "list_dedicated_ip_pools",444 "list_deliverability_test_reports",445 "list_email_identities",446 "describe_active_receipt_rule_set",447 "get_account_sending_enabled",448 "get_send_quota",449 "get_send_statistics",450 "list_configuration_sets",451 "list_custom_verification_email_templates",452 "list_identities",453 "list_receipt_filters",454 "list_receipt_rule_sets",455 "list_templates",456 "list_verified_email_addresses"457 ],458 "es": [459 "describe_reserved_elasticsearch_instance_offerings",460 "describe_reserved_elasticsearch_instances",461 "get_compatible_elasticsearch_versions",462 "list_domain_names",463 "list_elasticsearch_versions"464 ],465 "events": [466 "describe_event_bus",467 "list_rules"468 ],469 "firehose": [470 "list_delivery_streams"471 ],472 "fms": [473 "get_admin_account",474 "get_notification_channel",475 "list_member_accounts",476 "list_policies"477 ],478 "fsx": [479 "describe_backups",480 "describe_file_systems"481 ],482 "gamelift": [483 "describe_ec2_instance_limits",484 "describe_fleet_attributes",485 "describe_fleet_capacity",486 "describe_fleet_utilization",487 "describe_game_session_details",488 "describe_game_session_queues",489 "describe_game_sessions",490 "describe_matchmaking_configurations",491 "describe_matchmaking_rule_sets",492 "describe_player_sessions",493 "describe_vpc_peering_authorizations",494 "describe_vpc_peering_connections",495 "list_aliases",496 "list_builds",497 "list_fleets"498 ],499 "globalaccelerator": [500 "describe_accelerator_attributes",501 "list_accelerators"502 ],503 "glue": [504 "get_catalog_import_status",505 "get_classifiers",506 "get_connections",507 "get_crawler_metrics",508 "get_crawlers",509 "get_data_catalog_encryption_settings",510 "get_databases",511 "get_dataflow_graph",512 "get_dev_endpoints",513 "get_jobs",514 "get_resource_policy",515 "get_security_configurations",516 "get_triggers",517 "list_crawlers",518 "list_dev_endpoints",519 "list_jobs",520 "list_triggers"521 ],522 "greengrass": [523 "get_service_role_for_account",524 "list_bulk_deployments",525 "list_connector_definitions",526 "list_core_definitions",527 "list_device_definitions",528 "list_function_definitions",529 "list_groups",530 "list_logger_definitions",531 "list_resource_definitions",532 "list_subscription_definitions"533 ],534 "guardduty": [535 "get_invitations_count",536 "list_detectors",537 "list_invitations"538 ],539 "health": [540 "describe_entity_aggregates",541 "describe_event_types"542 ],543 "iam": [544 "get_account_authorization_details",545 "get_account_password_policy",546 "get_account_summary",547 "get_credential_report",548 "get_user",549 "list_access_keys",550 "list_account_aliases",551 "list_groups",552 "list_instance_profiles",553 "list_mfa_devices",554 "list_open_id_connect_providers",555 "list_policies",556 "list_roles",557 "list_saml_providers",558 "list_server_certificates",559 "list_service_specific_credentials",560 "list_signing_certificates",561 "list_ssh_public_keys",562 "list_users",563 "list_virtual_mfa_devices"564 ],565 "importexport": [566 "list_jobs"567 ],568 "inspector": [569 "describe_cross_account_access_role",570 "list_assessment_runs",571 "list_assessment_targets",572 "list_assessment_templates",573 "list_event_subscriptions",574 "list_findings",575 "list_rules_packages"576 ],577 "iot": [578 "describe_account_audit_configuration",579 "describe_default_authorizer",580 "describe_endpoint",581 "describe_event_configurations",582 "get_effective_policies",583 "get_indexing_configuration",584 "get_logging_options",585 "get_registration_code",586 "get_v2_logging_options",587 "list_active_violations",588 "list_audit_findings",589 "list_authorizers",590 "list_billing_groups",591 "list_ca_certificates",592 "list_certificates",593 "list_indices",594 "list_jobs",595 "list_ota_updates",596 "list_outgoing_certificates",597 "list_policies",598 "list_role_aliases",599 "list_scheduled_audits",600 "list_security_profiles",601 "list_streams",602 "list_thing_groups",603 "list_thing_registration_tasks",604 "list_thing_types",605 "list_things",606 "list_topic_rules",607 "list_v2_logging_levels"608 ],609 "iotanalytics": [610 "describe_logging_options",611 "list_channels",612 "list_datasets",613 "list_datastores",614 "list_pipelines"615 ],616 "kafka": [617 "list_clusters"618 ],619 "kinesis": [620 "describe_limits",621 "describe_stream_consumer",622 "list_shards",623 "list_streams"624 ],625 "kinesisanalytics": [626 "list_applications",627 "list_applications"628 ],629 "kinesisvideo": [630 "describe_stream",631 "list_streams",632 "list_tags_for_stream"633 ],634 "kms": [635 "describe_custom_key_stores",636 "list_aliases",637 "list_keys"638 ],639 "lambda": [640 "list_functions",641 "get_account_settings",642 "list_event_source_mappings",643 "list_functions",644 "list_layers"645 ],646 "license-manager": [647 "get_service_settings",648 "list_license_configurations"649 ],650 "lightsail": [651 "get_active_names",652 "get_blueprints",653 "get_bundles",654 "get_cloud_formation_stack_records",655 "get_disk_snapshots",656 "get_disks",657 "get_domains",658 "get_export_snapshot_records",659 "get_instance_snapshots",660 "get_instances",661 "get_key_pairs",662 "get_load_balancers",663 "get_operations",664 "get_regions",665 "get_relational_database_blueprints",666 "get_relational_database_bundles",667 "get_relational_database_snapshots",668 "get_relational_databases",669 "get_static_ips"670 ],671 "logs": [672 "describe_destinations",673 "describe_export_tasks",674 "describe_log_groups",675 "describe_metric_filters",676 "describe_queries",677 "describe_resource_policies"678 ],679 "machinelearning": [680 "describe_batch_predictions",681 "describe_data_sources",682 "describe_evaluations",683 "describe_ml_models"684 ],685 "macie": [686 "list_member_accounts",687 "list_s3_resources"688 ],689 "mediaconnect": [690 "list_entitlements",691 "list_flows"692 ],693 "mediaconvert": [694 "describe_endpoints",695 "list_job_templates",696 "list_jobs",697 "list_presets",698 "list_queues"699 ],700 "medialive": [701 "list_channels",702 "list_input_security_groups",703 "list_inputs",704 "list_offerings",705 "list_reservations"706 ],707 "mediapackage": [708 "list_channels",709 "list_origin_endpoints"710 ],711 "mediastore": [712 "describe_container",713 "list_containers"714 ],715 "mediatailor": [716 "list_playback_configurations"717 ],718 "mgh": [719 "list_migration_tasks",720 "list_progress_update_streams"721 ],722 "mobile": [723 "list_bundles",724 "list_projects"725 ],726 "models.lex": [727 "get_bots",728 "get_builtin_intents",729 "get_builtin_slot_types",730 "get_intents",731 "get_slot_types"732 ],733 "monitoring": [734 "describe_alarm_history",735 "describe_alarms",736 "list_dashboards"737 ],738 "mq": [739 "list_brokers",740 "list_configurations"741 ],742 "mturk-requester": [743 "get_account_balance",744 "list_bonus_payments",745 "list_hi_ts",746 "list_qualification_requests",747 "list_reviewable_hi_ts",748 "list_worker_blocks"749 ],750 "opsworks": [751 "describe_agent_versions",752 "describe_apps",753 "describe_commands",754 "describe_deployments",755 "describe_ecs_clusters",756 "describe_elastic_ips",757 "describe_elastic_load_balancers",758 "describe_instances",759 "describe_layers",760 "describe_my_user_profile",761 "describe_operating_systems",762 "describe_permissions",763 "describe_raid_arrays",764 "describe_user_profiles",765 "describe_volumes"766 ],767 "opworks": [768 "describe_account_attributes",769 "describe_backups",770 "describe_servers"771 ],772 "organizations": [773 "describe_organization",774 "list_accounts",775 "list_aws_service_access_for_organization",776 "list_create_account_status",777 "list_handshakes_for_account",778 "list_handshakes_for_organization",779 "list_roots"780 ],781 "pinpoint": [782 "get_apps"783 ],784 "polly": [785 "describe_voices",786 "list_lexicons",787 "list_speech_synthesis_tasks"788 ],789 "pricing": [790 "describe_services"791 ],792 "projects.iot1click": [793 "list_projects"794 ],795 "ram": [796 "get_resource_share_invitations"797 ],798 "rds": [799 "describe_db_engine_versions",800 "describe_db_instances",801 "describe_db_parameter_groups",802 "describe_db_security_groups",803 "describe_db_snapshots",804 "describe_db_subnet_groups",805 "describe_event_categories",806 "describe_event_subscriptions",807 "describe_option_groups",808 "describe_reserved_db_instances",809 "describe_reserved_db_instances_offerings",810 "describe_db_engine_versions",811 "describe_db_instances",812 "describe_db_parameter_groups",813 "describe_db_security_groups",814 "describe_db_snapshots",815 "describe_db_subnet_groups",816 "describe_event_categories",817 "describe_event_subscriptions",818 "describe_option_groups",819 "describe_reserved_db_instances",820 "describe_reserved_db_instances_offerings",821 "describe_account_attributes",822 "describe_certificates",823 "describe_db_cluster_endpoints",824 "describe_db_cluster_parameter_groups",825 "describe_db_cluster_snapshots",826 "describe_db_clusters",827 "describe_db_engine_versions",828 "describe_db_instance_automated_backups",829 "describe_db_instances",830 "describe_db_parameter_groups",831 "describe_db_security_groups",832 "describe_db_snapshots",833 "describe_db_subnet_groups",834 "describe_event_categories",835 "describe_event_subscriptions",836 "describe_global_clusters",837 "describe_option_groups",838 "describe_pending_maintenance_actions",839 "describe_reserved_db_instances",840 "describe_reserved_db_instances_offerings",841 "describe_source_regions",842 "describe_db_cluster_parameter_groups",843 "describe_db_cluster_snapshots",844 "describe_db_clusters",845 "describe_db_engine_versions",846 "describe_db_instances",847 "describe_db_parameter_groups",848 "describe_db_subnet_groups",849 "describe_event_categories",850 "describe_event_subscriptions",851 "describe_pending_maintenance_actions",852 "describe_db_engine_versions",853 "describe_db_instances",854 "describe_db_parameter_groups",855 "describe_db_security_groups",856 "describe_db_snapshots",857 "describe_db_subnet_groups",858 "describe_event_categories",859 "describe_event_subscriptions",860 "describe_option_groups",861 "describe_reserved_db_instances",862 "describe_reserved_db_instances_offerings",863 "describe_db_engine_versions",864 "describe_db_instances",865 "describe_db_parameter_groups",866 "describe_db_security_groups",867 "describe_db_snapshots",868 "describe_db_subnet_groups",869 "describe_event_categories",870 "describe_event_subscriptions",871 "describe_option_groups",872 "describe_reserved_db_instances",873 "describe_reserved_db_instances_offerings",874 "describe_db_cluster_parameter_groups",875 "describe_db_cluster_snapshots",876 "describe_db_clusters",877 "describe_db_engine_versions",878 "describe_db_instances",879 "describe_db_subnet_groups",880 "describe_event_categories",881 "describe_pending_maintenance_actions"882 ],883 "redshift": [884 "describe_account_attributes",885 "describe_cluster_db_revisions",886 "describe_cluster_parameter_groups",887 "describe_cluster_security_groups",888 "describe_cluster_subnet_groups",889 "describe_cluster_tracks",890 "describe_cluster_versions",891 "describe_clusters",892 "describe_event_categories",893 "describe_event_subscriptions",894 "describe_hsm_client_certificates",895 "describe_hsm_configurations",896 "describe_orderable_cluster_options",897 "describe_reserved_node_offerings",898 "describe_reserved_nodes",899 "describe_snapshot_copy_grants",900 "describe_snapshot_schedules",901 "describe_storage",902 "describe_table_restore_status",903 "describe_tags"904 ],905 "rekognition": [906 "list_collections",907 "list_stream_processors"908 ],909 "robomaker": [910 "list_deployment_jobs",911 "list_fleets",912 "list_robot_applications",913 "list_robots",914 "list_simulation_applications",915 "list_simulation_jobs"916 ],917 "route53": [918 "get_health_check_count",919 "get_hosted_zone_count",920 "get_traffic_policy_instance_count",921 "list_health_checks",922 "list_hosted_zones",923 "list_hosted_zones_by_name",924 "list_query_logging_configs",925 "list_reusable_delegation_sets",926 "list_traffic_policies",927 "list_traffic_policy_instances"928 ],929 "route53domains": [930 "get_contact_reachability_status",931 "list_domains",932 "list_operations"933 ],934 "route53resolver": [935 "list_resolver_endpoints",936 "list_resolver_rule_associations",937 "list_resolver_rules"938 ],939 "s3": [940 "list_buckets"941 ],942 "sagemaker": [943 "list_algorithms",944 "list_code_repositories",945 "list_compilation_jobs",946 "list_endpoint_configs",947 "list_endpoints",948 "list_hyper_parameter_tuning_jobs",949 "list_labeling_jobs",950 "list_model_packages",951 "list_models",952 "list_notebook_instance_lifecycle_configs",953 "list_notebook_instances",954 "list_subscribed_workteams",955 "list_training_jobs",956 "list_transform_jobs",957 "list_workteams"958 ],959 "sdb": [960 "list_domains"961 ],962 "secretsmanager": [963 "get_random_password",964 "list_secrets"965 ],966 "securityhub": [967 "get_enabled_standards",968 "get_findings",969 "get_insights",970 "get_invitations_count",971 "get_master_account",972 "list_enabled_products_for_import",973 "list_invitations",974 "list_members"975 ],976 "serverlessrepo": [977 "list_applications"978 ],979 "servicecatalog": [980 "get_aws_organizations_access_status",981 "list_accepted_portfolio_shares",982 "list_portfolios",983 "list_provisioned_product_plans",984 "list_record_history",985 "list_service_actions",986 "list_tag_options"987 ],988 "shield": [989 "describe_drt_access",990 "describe_emergency_contact_settings",991 "describe_protection",992 "describe_subscription",993 "get_subscription_state",994 "list_attacks",995 "list_protections"996 ],997 "signer": [998 "list_signing_jobs",999 "list_signing_platforms",1000 "list_signing_profiles"1001 ],1002 "sms": [1003 "get_app",1004 "get_app_launch_configuration",1005 "get_app_replication_configuration",1006 "get_connectors",1007 "get_replication_jobs",1008 "get_servers",1009 "list_apps"1010 ],1011 "sms-voice.pinpoint": [1012 "list_configuration_sets"1013 ],1014 "snowball": [1015 "describe_addresses",1016 "get_snowball_usage",1017 "list_clusters",1018 "list_compatible_images",1019 "list_jobs"1020 ],1021 "sns": [1022 "get_sms_attributes",1023 "list_phone_numbers_opted_out",1024 "list_platform_applications",1025 "list_subscriptions",1026 "list_topics"1027 ],1028 "sqs": [1029 "list_queues"1030 ],1031 "ssm": [1032 "describe_activations",1033 "describe_association",1034 "describe_available_patches",1035 "describe_inventory_deletions",1036 "describe_maintenance_window_schedule",1037 "describe_maintenance_windows",1038 "describe_patch_baselines",1039 "describe_patch_groups",1040 "get_default_patch_baseline",1041 "get_inventory_schema",1042 "list_command_invocations",1043 "list_commands",1044 "list_compliance_items",1045 "list_compliance_summaries",1046 "list_resource_compliance_summaries",1047 "list_resource_data_sync"1048 ],1049 "states": [1050 "list_activities",1051 "list_state_machines"1052 ],1053 "storagegateway": [1054 "describe_tape_archives",1055 "list_file_shares",1056 "list_gateways",1057 "list_tapes",1058 "list_volumes"1059 ],1060 "streams.dynamodb": [1061 "list_streams"1062 ],1063 "sts": [1064 "get_caller_identity",1065 "get_session_token"1066 ],1067 "support": [1068 "describe_cases",1069 "describe_services",1070 "describe_severity_levels"1071 ],1072 "tagging": [1073 "get_resources",1074 "get_tag_keys"1075 ],1076 "transcribe": [1077 "list_transcription_jobs",1078 "list_vocabularies"1079 ],1080 "transfer": [1081 "list_servers"1082 ],1083 "translate": [1084 "list_terminologies"1085 ],1086 "waf": [1087 "get_change_token",1088 "list_activated_rules_in_rule_group",1089 "list_byte_match_sets",1090 "list_geo_match_sets",1091 "list_ip_sets",1092 "list_logging_configurations",1093 "list_rate_based_rules",1094 "list_regex_match_sets",1095 "list_regex_pattern_sets",1096 "list_rule_groups",1097 "list_rules",1098 "list_size_constraint_sets",1099 "list_sql_injection_match_sets",1100 "list_subscribed_rule_groups",1101 "list_xss_match_sets"1102 ],1103 "waf-regional": [1104 "get_change_token",1105 "list_activated_rules_in_rule_group",1106 "list_byte_match_sets",1107 "list_geo_match_sets",1108 "list_ip_sets",1109 "list_logging_configurations",1110 "list_rate_based_rules",1111 "list_regex_match_sets",1112 "list_regex_pattern_sets",1113 "list_rule_groups",1114 "list_rules",1115 "list_size_constraint_sets",1116 "list_sql_injection_match_sets",1117 "list_subscribed_rule_groups",1118 "list_xss_match_sets"1119 ],1120 "workdocs": [1121 "describe_activities",1122 "describe_users",1123 "get_resources"1124 ],1125 "worklink": [1126 "list_fleets"1127 ],1128 "workmail": [1129 "list_organizations"1130 ],1131 "workspaces": [1132 "describe_account",1133 "describe_account_modifications",1134 "describe_ip_groups",1135 "describe_workspace_bundles",1136 "describe_workspace_directories",1137 "describe_workspace_images",1138 "describe_workspaces",1139 "describe_workspaces_connection_status"1140 ],1141 "xray": [1142 "get_encryption_config",1143 "get_group",1144 "get_groups",1145 "get_sampling_rules",1146 "get_sampling_statistic_summaries"1147 ]...

Full Screen

Full Screen

ec2.pyi

Source:ec2.pyi Github

copy

Full Screen

1"""2This type stub file was generated by pyright.3"""4from .aws import Action as BaseAction5from .aws import BaseARN6service_name = "Amazon EC2"7prefix = "ec2"8class Action(BaseAction):9 def __init__(self, action=...) -> None: ...10class ARN(BaseARN):11 def __init__(self, resource=..., region=..., account=...) -> None: ...12AcceptReservedInstancesExchangeQuote = Action("AcceptReservedInstancesExchangeQuote")13AcceptTransitGatewayPeeringAttachment = Action("AcceptTransitGatewayPeeringAttachment")14AcceptTransitGatewayVpcAttachment = Action("AcceptTransitGatewayVpcAttachment")15AcceptVpcEndpointConnections = Action("AcceptVpcEndpointConnections")16AcceptVpcPeeringConnection = Action("AcceptVpcPeeringConnection")17AdvertiseByoipCidr = Action("AdvertiseByoipCidr")18AllocateAddress = Action("AllocateAddress")19AllocateHosts = Action("AllocateHosts")20ApplySecurityGroupsToClientVpnTargetNetwork = Action(21 "ApplySecurityGroupsToClientVpnTargetNetwork"22)23AssignIpv6Addresses = Action("AssignIpv6Addresses")24AssignPrivateIpAddresses = Action("AssignPrivateIpAddresses")25AssociateAddress = Action("AssociateAddress")26AssociateClientVpnTargetNetwork = Action("AssociateClientVpnTargetNetwork")27AssociateDhcpOptions = Action("AssociateDhcpOptions")28AssociateIamInstanceProfile = Action("AssociateIamInstanceProfile")29AssociateRouteTable = Action("AssociateRouteTable")30AssociateSubnetCidrBlock = Action("AssociateSubnetCidrBlock")31AssociateTransitGatewayMulticastDomain = Action(32 "AssociateTransitGatewayMulticastDomain"33)34AssociateTransitGatewayRouteTable = Action("AssociateTransitGatewayRouteTable")35AssociateVpcCidrBlock = Action("AssociateVpcCidrBlock")36AttachClassicLinkVpc = Action("AttachClassicLinkVpc")37AttachInternetGateway = Action("AttachInternetGateway")38AttachNetworkInterface = Action("AttachNetworkInterface")39AttachVolume = Action("AttachVolume")40AttachVpnGateway = Action("AttachVpnGateway")41AuthorizeClientVpnIngress = Action("AuthorizeClientVpnIngress")42AuthorizeSecurityGroupEgress = Action("AuthorizeSecurityGroupEgress")43AuthorizeSecurityGroupIngress = Action("AuthorizeSecurityGroupIngress")44BundleInstance = Action("BundleInstance")45CancelBundleTask = Action("CancelBundleTask")46CancelCapacityReservation = Action("CancelCapacityReservation")47CancelConversionTask = Action("CancelConversionTask")48CancelExportTask = Action("CancelExportTask")49CancelImportTask = Action("CancelImportTask")50CancelReservedInstancesListing = Action("CancelReservedInstancesListing")51CancelSpotFleetRequests = Action("CancelSpotFleetRequests")52CancelSpotInstanceRequests = Action("CancelSpotInstanceRequests")53ConfirmProductInstance = Action("ConfirmProductInstance")54CopyFpgaImage = Action("CopyFpgaImage")55CopyImage = Action("CopyImage")56CopySnapshot = Action("CopySnapshot")57CreateCapacityReservation = Action("CreateCapacityReservation")58CreateCarrierGateway = Action("CreateCarrierGateway")59CreateClientVpnEndpoint = Action("CreateClientVpnEndpoint")60CreateClientVpnRoute = Action("CreateClientVpnRoute")61CreateCustomerGateway = Action("CreateCustomerGateway")62CreateDefaultSubnet = Action("CreateDefaultSubnet")63CreateDefaultVpc = Action("CreateDefaultVpc")64CreateDhcpOptions = Action("CreateDhcpOptions")65CreateEgressOnlyInternetGateway = Action("CreateEgressOnlyInternetGateway")66CreateFleet = Action("CreateFleet")67CreateFlowLogs = Action("CreateFlowLogs")68CreateFpgaImage = Action("CreateFpgaImage")69CreateImage = Action("CreateImage")70CreateInstanceExportTask = Action("CreateInstanceExportTask")71CreateInternetGateway = Action("CreateInternetGateway")72CreateKeyPair = Action("CreateKeyPair")73CreateLaunchTemplate = Action("CreateLaunchTemplate")74CreateLaunchTemplateVersion = Action("CreateLaunchTemplateVersion")75CreateLocalGatewayRoute = Action("CreateLocalGatewayRoute")76CreateLocalGatewayRouteTableVpcAssociation = Action(77 "CreateLocalGatewayRouteTableVpcAssociation"78)79CreateManagedPrefixList = Action("CreateManagedPrefixList")80CreateNatGateway = Action("CreateNatGateway")81CreateNetworkAcl = Action("CreateNetworkAcl")82CreateNetworkAclEntry = Action("CreateNetworkAclEntry")83CreateNetworkInterface = Action("CreateNetworkInterface")84CreateNetworkInterfacePermission = Action("CreateNetworkInterfacePermission")85CreatePlacementGroup = Action("CreatePlacementGroup")86CreateReservedInstancesListing = Action("CreateReservedInstancesListing")87CreateRoute = Action("CreateRoute")88CreateRouteTable = Action("CreateRouteTable")89CreateSecurityGroup = Action("CreateSecurityGroup")90CreateSnapshot = Action("CreateSnapshot")91CreateSnapshots = Action("CreateSnapshots")92CreateSpotDatafeedSubscription = Action("CreateSpotDatafeedSubscription")93CreateSubnet = Action("CreateSubnet")94CreateTags = Action("CreateTags")95CreateTrafficMirrorFilter = Action("CreateTrafficMirrorFilter")96CreateTrafficMirrorFilterRule = Action("CreateTrafficMirrorFilterRule")97CreateTrafficMirrorSession = Action("CreateTrafficMirrorSession")98CreateTrafficMirrorTarget = Action("CreateTrafficMirrorTarget")99CreateTransitGateway = Action("CreateTransitGateway")100CreateTransitGatewayMulticastDomain = Action("CreateTransitGatewayMulticastDomain")101CreateTransitGatewayPeeringAttachment = Action("CreateTransitGatewayPeeringAttachment")102CreateTransitGatewayPrefixListReference = Action(103 "CreateTransitGatewayPrefixListReference"104)105CreateTransitGatewayRoute = Action("CreateTransitGatewayRoute")106CreateTransitGatewayRouteTable = Action("CreateTransitGatewayRouteTable")107CreateTransitGatewayVpcAttachment = Action("CreateTransitGatewayVpcAttachment")108CreateVolume = Action("CreateVolume")109CreateVpc = Action("CreateVpc")110CreateVpcEndpoint = Action("CreateVpcEndpoint")111CreateVpcEndpointConnectionNotification = Action(112 "CreateVpcEndpointConnectionNotification"113)114CreateVpcEndpointServiceConfiguration = Action("CreateVpcEndpointServiceConfiguration")115CreateVpcPeeringConnection = Action("CreateVpcPeeringConnection")116CreateVpnConnection = Action("CreateVpnConnection")117CreateVpnConnectionRoute = Action("CreateVpnConnectionRoute")118CreateVpnGateway = Action("CreateVpnGateway")119DeleteCarrierGateway = Action("DeleteCarrierGateway")120DeleteClientVpnEndpoint = Action("DeleteClientVpnEndpoint")121DeleteClientVpnRoute = Action("DeleteClientVpnRoute")122DeleteCustomerGateway = Action("DeleteCustomerGateway")123DeleteDhcpOptions = Action("DeleteDhcpOptions")124DeleteEgressOnlyInternetGateway = Action("DeleteEgressOnlyInternetGateway")125DeleteFleets = Action("DeleteFleets")126DeleteFlowLogs = Action("DeleteFlowLogs")127DeleteFpgaImage = Action("DeleteFpgaImage")128DeleteInternetGateway = Action("DeleteInternetGateway")129DeleteKeyPair = Action("DeleteKeyPair")130DeleteLaunchTemplate = Action("DeleteLaunchTemplate")131DeleteLaunchTemplateVersions = Action("DeleteLaunchTemplateVersions")132DeleteLocalGatewayRoute = Action("DeleteLocalGatewayRoute")133DeleteLocalGatewayRouteTableVpcAssociation = Action(134 "DeleteLocalGatewayRouteTableVpcAssociation"135)136DeleteManagedPrefixList = Action("DeleteManagedPrefixList")137DeleteNatGateway = Action("DeleteNatGateway")138DeleteNetworkAcl = Action("DeleteNetworkAcl")139DeleteNetworkAclEntry = Action("DeleteNetworkAclEntry")140DeleteNetworkInterface = Action("DeleteNetworkInterface")141DeleteNetworkInterfacePermission = Action("DeleteNetworkInterfacePermission")142DeletePlacementGroup = Action("DeletePlacementGroup")143DeleteRoute = Action("DeleteRoute")144DeleteRouteTable = Action("DeleteRouteTable")145DeleteSecurityGroup = Action("DeleteSecurityGroup")146DeleteSnapshot = Action("DeleteSnapshot")147DeleteSpotDatafeedSubscription = Action("DeleteSpotDatafeedSubscription")148DeleteSubnet = Action("DeleteSubnet")149DeleteTags = Action("DeleteTags")150DeleteTrafficMirrorFilter = Action("DeleteTrafficMirrorFilter")151DeleteTrafficMirrorFilterRule = Action("DeleteTrafficMirrorFilterRule")152DeleteTrafficMirrorSession = Action("DeleteTrafficMirrorSession")153DeleteTrafficMirrorTarget = Action("DeleteTrafficMirrorTarget")154DeleteTransitGateway = Action("DeleteTransitGateway")155DeleteTransitGatewayMulticastDomain = Action("DeleteTransitGatewayMulticastDomain")156DeleteTransitGatewayPeeringAttachment = Action("DeleteTransitGatewayPeeringAttachment")157DeleteTransitGatewayPrefixListReference = Action(158 "DeleteTransitGatewayPrefixListReference"159)160DeleteTransitGatewayRoute = Action("DeleteTransitGatewayRoute")161DeleteTransitGatewayRouteTable = Action("DeleteTransitGatewayRouteTable")162DeleteTransitGatewayVpcAttachment = Action("DeleteTransitGatewayVpcAttachment")163DeleteVolume = Action("DeleteVolume")164DeleteVpc = Action("DeleteVpc")165DeleteVpcEndpointConnectionNotifications = Action(166 "DeleteVpcEndpointConnectionNotifications"167)168DeleteVpcEndpointServiceConfigurations = Action(169 "DeleteVpcEndpointServiceConfigurations"170)171DeleteVpcEndpoints = Action("DeleteVpcEndpoints")172DeleteVpcPeeringConnection = Action("DeleteVpcPeeringConnection")173DeleteVpnConnection = Action("DeleteVpnConnection")174DeleteVpnConnectionRoute = Action("DeleteVpnConnectionRoute")175DeleteVpnGateway = Action("DeleteVpnGateway")176DeprovisionByoipCidr = Action("DeprovisionByoipCidr")177DeregisterImage = Action("DeregisterImage")178DeregisterInstanceEventNotificationAttributes = Action(179 "DeregisterInstanceEventNotificationAttributes"180)181DeregisterTransitGatewayMulticastGroupMembers = Action(182 "DeregisterTransitGatewayMulticastGroupMembers"183)184DeregisterTransitGatewayMulticastGroupSources = Action(185 "DeregisterTransitGatewayMulticastGroupSources"186)187DescribeAccountAttributes = Action("DescribeAccountAttributes")188DescribeAddresses = Action("DescribeAddresses")189DescribeAggregateIdFormat = Action("DescribeAggregateIdFormat")190DescribeAvailabilityZones = Action("DescribeAvailabilityZones")191DescribeBundleTasks = Action("DescribeBundleTasks")192DescribeByoipCidrs = Action("DescribeByoipCidrs")193DescribeCapacityReservations = Action("DescribeCapacityReservations")194DescribeCarrierGateways = Action("DescribeCarrierGateways")195DescribeClassicLinkInstances = Action("DescribeClassicLinkInstances")196DescribeClientVpnAuthorizationRules = Action("DescribeClientVpnAuthorizationRules")197DescribeClientVpnConnections = Action("DescribeClientVpnConnections")198DescribeClientVpnEndpoints = Action("DescribeClientVpnEndpoints")199DescribeClientVpnRoutes = Action("DescribeClientVpnRoutes")200DescribeClientVpnTargetNetworks = Action("DescribeClientVpnTargetNetworks")201DescribeCoipPools = Action("DescribeCoipPools")202DescribeConversionTasks = Action("DescribeConversionTasks")203DescribeCustomerGateways = Action("DescribeCustomerGateways")204DescribeDhcpOptions = Action("DescribeDhcpOptions")205DescribeEgressOnlyInternetGateways = Action("DescribeEgressOnlyInternetGateways")206DescribeElasticGpus = Action("DescribeElasticGpus")207DescribeExportImageTasks = Action("DescribeExportImageTasks")208DescribeExportTasks = Action("DescribeExportTasks")209DescribeFastSnapshotRestores = Action("DescribeFastSnapshotRestores")210DescribeFleetHistory = Action("DescribeFleetHistory")211DescribeFleetInstances = Action("DescribeFleetInstances")212DescribeFleets = Action("DescribeFleets")213DescribeFlowLogs = Action("DescribeFlowLogs")214DescribeFpgaImageAttribute = Action("DescribeFpgaImageAttribute")215DescribeFpgaImages = Action("DescribeFpgaImages")216DescribeHostReservationOfferings = Action("DescribeHostReservationOfferings")217DescribeHostReservations = Action("DescribeHostReservations")218DescribeHosts = Action("DescribeHosts")219DescribeIamInstanceProfileAssociations = Action(220 "DescribeIamInstanceProfileAssociations"221)222DescribeIdFormat = Action("DescribeIdFormat")223DescribeIdentityIdFormat = Action("DescribeIdentityIdFormat")224DescribeImageAttribute = Action("DescribeImageAttribute")225DescribeImages = Action("DescribeImages")226DescribeImportImageTasks = Action("DescribeImportImageTasks")227DescribeImportSnapshotTasks = Action("DescribeImportSnapshotTasks")228DescribeInstanceAttribute = Action("DescribeInstanceAttribute")229DescribeInstanceCreditSpecifications = Action("DescribeInstanceCreditSpecifications")230DescribeInstanceEventNotificationAttributes = Action(231 "DescribeInstanceEventNotificationAttributes"232)233DescribeInstanceStatus = Action("DescribeInstanceStatus")234DescribeInstanceTypeOfferings = Action("DescribeInstanceTypeOfferings")235DescribeInstanceTypes = Action("DescribeInstanceTypes")236DescribeInstances = Action("DescribeInstances")237DescribeInternetGateways = Action("DescribeInternetGateways")238DescribeKeyPairs = Action("DescribeKeyPairs")239DescribeLaunchTemplateVersions = Action("DescribeLaunchTemplateVersions")240DescribeLaunchTemplates = Action("DescribeLaunchTemplates")241DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations = Action(242 "DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations"243)244DescribeLocalGatewayRouteTableVpcAssociations = Action(245 "DescribeLocalGatewayRouteTableVpcAssociations"246)247DescribeLocalGatewayRouteTables = Action("DescribeLocalGatewayRouteTables")248DescribeLocalGatewayVirtualInterfaceGroups = Action(249 "DescribeLocalGatewayVirtualInterfaceGroups"250)251DescribeLocalGatewayVirtualInterfaces = Action("DescribeLocalGatewayVirtualInterfaces")252DescribeLocalGateways = Action("DescribeLocalGateways")253DescribeManagedPrefixLists = Action("DescribeManagedPrefixLists")254DescribeMovingAddresses = Action("DescribeMovingAddresses")255DescribeNatGateways = Action("DescribeNatGateways")256DescribeNetworkAcls = Action("DescribeNetworkAcls")257DescribeNetworkInterfaceAttribute = Action("DescribeNetworkInterfaceAttribute")258DescribeNetworkInterfacePermissions = Action("DescribeNetworkInterfacePermissions")259DescribeNetworkInterfaces = Action("DescribeNetworkInterfaces")260DescribePlacementGroups = Action("DescribePlacementGroups")261DescribePrefixLists = Action("DescribePrefixLists")262DescribePrincipalIdFormat = Action("DescribePrincipalIdFormat")263DescribePublicIpv4Pools = Action("DescribePublicIpv4Pools")264DescribeRegions = Action("DescribeRegions")265DescribeReservedInstances = Action("DescribeReservedInstances")266DescribeReservedInstancesListings = Action("DescribeReservedInstancesListings")267DescribeReservedInstancesModifications = Action(268 "DescribeReservedInstancesModifications"269)270DescribeReservedInstancesOfferings = Action("DescribeReservedInstancesOfferings")271DescribeRouteTables = Action("DescribeRouteTables")272DescribeScheduledInstanceAvailability = Action("DescribeScheduledInstanceAvailability")273DescribeScheduledInstances = Action("DescribeScheduledInstances")274DescribeSecurityGroupReferences = Action("DescribeSecurityGroupReferences")275DescribeSecurityGroups = Action("DescribeSecurityGroups")276DescribeSnapshotAttribute = Action("DescribeSnapshotAttribute")277DescribeSnapshots = Action("DescribeSnapshots")278DescribeSpotDatafeedSubscription = Action("DescribeSpotDatafeedSubscription")279DescribeSpotFleetInstances = Action("DescribeSpotFleetInstances")280DescribeSpotFleetRequestHistory = Action("DescribeSpotFleetRequestHistory")281DescribeSpotFleetRequests = Action("DescribeSpotFleetRequests")282DescribeSpotInstanceRequests = Action("DescribeSpotInstanceRequests")283DescribeSpotPriceHistory = Action("DescribeSpotPriceHistory")284DescribeStaleSecurityGroups = Action("DescribeStaleSecurityGroups")285DescribeSubnets = Action("DescribeSubnets")286DescribeTags = Action("DescribeTags")287DescribeTrafficMirrorFilters = Action("DescribeTrafficMirrorFilters")288DescribeTrafficMirrorSessions = Action("DescribeTrafficMirrorSessions")289DescribeTrafficMirrorTargets = Action("DescribeTrafficMirrorTargets")290DescribeTransitGatewayAttachments = Action("DescribeTransitGatewayAttachments")291DescribeTransitGatewayMulticastDomains = Action(292 "DescribeTransitGatewayMulticastDomains"293)294DescribeTransitGatewayPeeringAttachments = Action(295 "DescribeTransitGatewayPeeringAttachments"296)297DescribeTransitGatewayRouteTables = Action("DescribeTransitGatewayRouteTables")298DescribeTransitGatewayVpcAttachments = Action("DescribeTransitGatewayVpcAttachments")299DescribeTransitGateways = Action("DescribeTransitGateways")300DescribeVolumeAttribute = Action("DescribeVolumeAttribute")301DescribeVolumeStatus = Action("DescribeVolumeStatus")302DescribeVolumes = Action("DescribeVolumes")303DescribeVolumesModifications = Action("DescribeVolumesModifications")304DescribeVpcAttribute = Action("DescribeVpcAttribute")305DescribeVpcClassicLink = Action("DescribeVpcClassicLink")306DescribeVpcClassicLinkDnsSupport = Action("DescribeVpcClassicLinkDnsSupport")307DescribeVpcEndpointConnectionNotifications = Action(308 "DescribeVpcEndpointConnectionNotifications"309)310DescribeVpcEndpointConnections = Action("DescribeVpcEndpointConnections")311DescribeVpcEndpointServiceConfigurations = Action(312 "DescribeVpcEndpointServiceConfigurations"313)314DescribeVpcEndpointServicePermissions = Action("DescribeVpcEndpointServicePermissions")315DescribeVpcEndpointServices = Action("DescribeVpcEndpointServices")316DescribeVpcEndpoints = Action("DescribeVpcEndpoints")317DescribeVpcPeeringConnections = Action("DescribeVpcPeeringConnections")318DescribeVpcs = Action("DescribeVpcs")319DescribeVpnConnections = Action("DescribeVpnConnections")320DescribeVpnGateways = Action("DescribeVpnGateways")321DetachClassicLinkVpc = Action("DetachClassicLinkVpc")322DetachInternetGateway = Action("DetachInternetGateway")323DetachNetworkInterface = Action("DetachNetworkInterface")324DetachVolume = Action("DetachVolume")325DetachVpnGateway = Action("DetachVpnGateway")326DisableEbsEncryptionByDefault = Action("DisableEbsEncryptionByDefault")327DisableFastSnapshotRestores = Action("DisableFastSnapshotRestores")328DisableTransitGatewayRouteTablePropagation = Action(329 "DisableTransitGatewayRouteTablePropagation"330)331DisableVgwRoutePropagation = Action("DisableVgwRoutePropagation")332DisableVpcClassicLink = Action("DisableVpcClassicLink")333DisableVpcClassicLinkDnsSupport = Action("DisableVpcClassicLinkDnsSupport")334DisassociateAddress = Action("DisassociateAddress")335DisassociateClientVpnTargetNetwork = Action("DisassociateClientVpnTargetNetwork")336DisassociateIamInstanceProfile = Action("DisassociateIamInstanceProfile")337DisassociateRouteTable = Action("DisassociateRouteTable")338DisassociateSubnetCidrBlock = Action("DisassociateSubnetCidrBlock")339DisassociateTransitGatewayMulticastDomain = Action(340 "DisassociateTransitGatewayMulticastDomain"341)342DisassociateTransitGatewayRouteTable = Action("DisassociateTransitGatewayRouteTable")343DisassociateVpcCidrBlock = Action("DisassociateVpcCidrBlock")344EnableEbsEncryptionByDefault = Action("EnableEbsEncryptionByDefault")345EnableFastSnapshotRestores = Action("EnableFastSnapshotRestores")346EnableTransitGatewayRouteTablePropagation = Action(347 "EnableTransitGatewayRouteTablePropagation"348)349EnableVgwRoutePropagation = Action("EnableVgwRoutePropagation")350EnableVolumeIO = Action("EnableVolumeIO")351EnableVpcClassicLink = Action("EnableVpcClassicLink")352EnableVpcClassicLinkDnsSupport = Action("EnableVpcClassicLinkDnsSupport")353ExportClientVpnClientCertificateRevocationList = Action(354 "ExportClientVpnClientCertificateRevocationList"355)356ExportClientVpnClientConfiguration = Action("ExportClientVpnClientConfiguration")357ExportImage = Action("ExportImage")358ExportTransitGatewayRoutes = Action("ExportTransitGatewayRoutes")359GetCapacityReservationUsage = Action("GetCapacityReservationUsage")360GetCoipPoolUsage = Action("GetCoipPoolUsage")361GetConsoleOutput = Action("GetConsoleOutput")362GetConsoleScreenshot = Action("GetConsoleScreenshot")363GetDefaultCreditSpecification = Action("GetDefaultCreditSpecification")364GetEbsDefaultKmsKeyId = Action("GetEbsDefaultKmsKeyId")365GetEbsEncryptionByDefault = Action("GetEbsEncryptionByDefault")366GetHostReservationPurchasePreview = Action("GetHostReservationPurchasePreview")367GetLaunchTemplateData = Action("GetLaunchTemplateData")368GetManagedPrefixListAssociations = Action("GetManagedPrefixListAssociations")369GetManagedPrefixListEntries = Action("GetManagedPrefixListEntries")370GetPasswordData = Action("GetPasswordData")371GetReservedInstancesExchangeQuote = Action("GetReservedInstancesExchangeQuote")372GetTransitGatewayAttachmentPropagations = Action(373 "GetTransitGatewayAttachmentPropagations"374)375GetTransitGatewayMulticastDomainAssociations = Action(376 "GetTransitGatewayMulticastDomainAssociations"377)378GetTransitGatewayPrefixListReferences = Action("GetTransitGatewayPrefixListReferences")379GetTransitGatewayRouteTableAssociations = Action(380 "GetTransitGatewayRouteTableAssociations"381)382GetTransitGatewayRouteTablePropagations = Action(383 "GetTransitGatewayRouteTablePropagations"384)385ImportClientVpnClientCertificateRevocationList = Action(386 "ImportClientVpnClientCertificateRevocationList"387)388ImportImage = Action("ImportImage")389ImportInstance = Action("ImportInstance")390ImportKeyPair = Action("ImportKeyPair")391ImportSnapshot = Action("ImportSnapshot")392ImportVolume = Action("ImportVolume")393ModifyCapacityReservation = Action("ModifyCapacityReservation")394ModifyClientVpnEndpoint = Action("ModifyClientVpnEndpoint")395ModifyDefaultCreditSpecification = Action("ModifyDefaultCreditSpecification")396ModifyEbsDefaultKmsKeyId = Action("ModifyEbsDefaultKmsKeyId")397ModifyFleet = Action("ModifyFleet")398ModifyFpgaImageAttribute = Action("ModifyFpgaImageAttribute")399ModifyHosts = Action("ModifyHosts")400ModifyIdFormat = Action("ModifyIdFormat")401ModifyIdentityIdFormat = Action("ModifyIdentityIdFormat")402ModifyImageAttribute = Action("ModifyImageAttribute")403ModifyInstanceAttribute = Action("ModifyInstanceAttribute")404ModifyInstanceCapacityReservationAttributes = Action(405 "ModifyInstanceCapacityReservationAttributes"406)407ModifyInstanceCreditSpecification = Action("ModifyInstanceCreditSpecification")408ModifyInstanceEventStartTime = Action("ModifyInstanceEventStartTime")409ModifyInstanceMetadataOptions = Action("ModifyInstanceMetadataOptions")410ModifyInstancePlacement = Action("ModifyInstancePlacement")411ModifyLaunchTemplate = Action("ModifyLaunchTemplate")412ModifyManagedPrefixList = Action("ModifyManagedPrefixList")413ModifyNetworkInterfaceAttribute = Action("ModifyNetworkInterfaceAttribute")414ModifyReservedInstances = Action("ModifyReservedInstances")415ModifySnapshotAttribute = Action("ModifySnapshotAttribute")416ModifySpotFleetRequest = Action("ModifySpotFleetRequest")417ModifySubnetAttribute = Action("ModifySubnetAttribute")418ModifyTrafficMirrorFilterNetworkServices = Action(419 "ModifyTrafficMirrorFilterNetworkServices"420)421ModifyTrafficMirrorFilterRule = Action("ModifyTrafficMirrorFilterRule")422ModifyTrafficMirrorSession = Action("ModifyTrafficMirrorSession")423ModifyTransitGateway = Action("ModifyTransitGateway")424ModifyTransitGatewayPrefixListReference = Action(425 "ModifyTransitGatewayPrefixListReference"426)427ModifyTransitGatewayVpcAttachment = Action("ModifyTransitGatewayVpcAttachment")428ModifyVolume = Action("ModifyVolume")429ModifyVolumeAttribute = Action("ModifyVolumeAttribute")430ModifyVpcAttribute = Action("ModifyVpcAttribute")431ModifyVpcEndpoint = Action("ModifyVpcEndpoint")432ModifyVpcEndpointConnectionNotification = Action(433 "ModifyVpcEndpointConnectionNotification"434)435ModifyVpcEndpointServiceConfiguration = Action("ModifyVpcEndpointServiceConfiguration")436ModifyVpcEndpointServicePermissions = Action("ModifyVpcEndpointServicePermissions")437ModifyVpcPeeringConnectionOptions = Action("ModifyVpcPeeringConnectionOptions")438ModifyVpcTenancy = Action("ModifyVpcTenancy")439ModifyVpnConnection = Action("ModifyVpnConnection")440ModifyVpnTunnelCertificate = Action("ModifyVpnTunnelCertificate")441ModifyVpnTunnelOptions = Action("ModifyVpnTunnelOptions")442MonitorInstances = Action("MonitorInstances")443MoveAddressToVpc = Action("MoveAddressToVpc")444ProvisionByoipCidr = Action("ProvisionByoipCidr")445PurchaseHostReservation = Action("PurchaseHostReservation")446PurchaseReservedInstancesOffering = Action("PurchaseReservedInstancesOffering")447PurchaseScheduledInstances = Action("PurchaseScheduledInstances")448RebootInstances = Action("RebootInstances")449RegisterImage = Action("RegisterImage")450RegisterInstanceEventNotificationAttributes = Action(451 "RegisterInstanceEventNotificationAttributes"452)453RegisterTransitGatewayMulticastGroupMembers = Action(454 "RegisterTransitGatewayMulticastGroupMembers"455)456RegisterTransitGatewayMulticastGroupSources = Action(457 "RegisterTransitGatewayMulticastGroupSources"458)459RejectTransitGatewayPeeringAttachment = Action("RejectTransitGatewayPeeringAttachment")460RejectTransitGatewayVpcAttachment = Action("RejectTransitGatewayVpcAttachment")461RejectVpcEndpointConnections = Action("RejectVpcEndpointConnections")462RejectVpcPeeringConnection = Action("RejectVpcPeeringConnection")463ReleaseAddress = Action("ReleaseAddress")464ReleaseHosts = Action("ReleaseHosts")465ReplaceIamInstanceProfileAssociation = Action("ReplaceIamInstanceProfileAssociation")466ReplaceNetworkAclAssociation = Action("ReplaceNetworkAclAssociation")467ReplaceNetworkAclEntry = Action("ReplaceNetworkAclEntry")468ReplaceRoute = Action("ReplaceRoute")469ReplaceRouteTableAssociation = Action("ReplaceRouteTableAssociation")470ReplaceTransitGatewayRoute = Action("ReplaceTransitGatewayRoute")471ReportInstanceStatus = Action("ReportInstanceStatus")472RequestSpotFleet = Action("RequestSpotFleet")473RequestSpotInstances = Action("RequestSpotInstances")474ResetEbsDefaultKmsKeyId = Action("ResetEbsDefaultKmsKeyId")475ResetFpgaImageAttribute = Action("ResetFpgaImageAttribute")476ResetImageAttribute = Action("ResetImageAttribute")477ResetInstanceAttribute = Action("ResetInstanceAttribute")478ResetNetworkInterfaceAttribute = Action("ResetNetworkInterfaceAttribute")479ResetSnapshotAttribute = Action("ResetSnapshotAttribute")480RestoreAddressToClassic = Action("RestoreAddressToClassic")481RestoreManagedPrefixListVersion = Action("RestoreManagedPrefixListVersion")482RevokeClientVpnIngress = Action("RevokeClientVpnIngress")483RevokeSecurityGroupEgress = Action("RevokeSecurityGroupEgress")484RevokeSecurityGroupIngress = Action("RevokeSecurityGroupIngress")485RunInstances = Action("RunInstances")486RunScheduledInstances = Action("RunScheduledInstances")487SearchLocalGatewayRoutes = Action("SearchLocalGatewayRoutes")488SearchTransitGatewayMulticastGroups = Action("SearchTransitGatewayMulticastGroups")489SearchTransitGatewayRoutes = Action("SearchTransitGatewayRoutes")490SendDiagnosticInterrupt = Action("SendDiagnosticInterrupt")491StartInstances = Action("StartInstances")492StartVpcEndpointServicePrivateDnsVerification = Action(493 "StartVpcEndpointServicePrivateDnsVerification"494)495StopInstances = Action("StopInstances")496TerminateClientVpnConnections = Action("TerminateClientVpnConnections")497TerminateInstances = Action("TerminateInstances")498UnassignIpv6Addresses = Action("UnassignIpv6Addresses")499UnassignPrivateIpAddresses = Action("UnassignPrivateIpAddresses")500UnmonitorInstances = Action("UnmonitorInstances")501UpdateSecurityGroupRuleDescriptionsEgress = Action(502 "UpdateSecurityGroupRuleDescriptionsEgress"503)504UpdateSecurityGroupRuleDescriptionsIngress = Action(505 "UpdateSecurityGroupRuleDescriptionsIngress"506)...

Full Screen

Full Screen

test_discovery.py

Source:test_discovery.py Github

copy

Full Screen

1import time2from tests import mock3from tests import unittest4from botocore.awsrequest import AWSRequest5from botocore.client import ClientMeta6from botocore.hooks import HierarchicalEmitter7from botocore.model import ServiceModel8from botocore.exceptions import ConnectionError9from botocore.handlers import inject_api_version_header_if_needed10from botocore.discovery import (11 EndpointDiscoveryManager, EndpointDiscoveryHandler,12 EndpointDiscoveryRequired, EndpointDiscoveryRefreshFailed,13 block_endpoint_discovery_required_operations,14)15class BaseEndpointDiscoveryTest(unittest.TestCase):16 def setUp(self):17 self.service_description = {18 'version': '2.0',19 'metadata': {20 'apiVersion': '2018-08-31',21 'endpointPrefix': 'fooendpoint',22 'jsonVersion': '1.1',23 'protocol': 'json',24 'serviceAbbreviation': 'FooService',25 'serviceId': 'FooService',26 'serviceFullName': 'AwsFooService',27 'signatureVersion': 'v4',28 'signingName': 'awsfooservice',29 'targetPrefix': 'awsfooservice'30 },31 'operations': {32 'DescribeEndpoints': {33 'name': 'DescribeEndpoints',34 'http': {35 'method': 'POST',36 'requestUri': '/'37 },38 'input': {'shape': 'DescribeEndpointsRequest'},39 'output': {'shape': 'DescribeEndpointsResponse'},40 'endpointoperation': True41 },42 'TestDiscoveryRequired': {43 'name': 'TestDiscoveryRequired',44 'http': {45 'method': 'POST',46 'requestUri': '/'47 },48 'input': {'shape': 'TestDiscoveryIdsRequest'},49 'output': {'shape': 'EmptyStruct'},50 'endpointdiscovery': {'required': True}51 },52 'TestDiscoveryOptional': {53 'name': 'TestDiscoveryOptional',54 'http': {55 'method': 'POST',56 'requestUri': '/'57 },58 'input': {'shape': 'TestDiscoveryIdsRequest'},59 'output': {'shape': 'EmptyStruct'},60 'endpointdiscovery': {}61 },62 'TestDiscovery': {63 'name': 'TestDiscovery',64 'http': {65 'method': 'POST',66 'requestUri': '/'67 },68 'input': {'shape': 'EmptyStruct'},69 'output': {'shape': 'EmptyStruct'},70 'endpointdiscovery': {}71 },72 },73 'shapes': {74 'Boolean': {'type': 'boolean'},75 'DescribeEndpointsRequest': {76 'type': 'structure',77 'members': {78 'Operation': {'shape': 'String'},79 'Identifiers': {'shape': 'Identifiers'}80 }81 },82 'DescribeEndpointsResponse': {83 'type': 'structure',84 'required': ['Endpoints'],85 'members': {86 'Endpoints': {'shape': 'Endpoints'}87 }88 },89 'Endpoint': {90 'type': 'structure',91 'required': [92 'Address',93 'CachePeriodInMinutes'94 ],95 'members': {96 'Address': {'shape': 'String'},97 'CachePeriodInMinutes': {'shape': 'Long'}98 }99 },100 'Endpoints': {101 'type': 'list',102 'member': {'shape': 'Endpoint'}103 },104 'Identifiers': {105 'type': 'map',106 'key': {'shape': 'String'},107 'value': {'shape': 'String'}108 },109 'Long': {'type': 'long'},110 'String': {'type': 'string'},111 'TestDiscoveryIdsRequest': {112 'type': 'structure',113 'required': ['Foo', 'Nested'],114 'members': {115 'Foo': {116 'shape': 'String',117 'endpointdiscoveryid': True,118 },119 'Baz': {'shape': 'String'},120 'Nested': {'shape': 'Nested'}121 }122 },123 'EmptyStruct': {124 'type': 'structure',125 'members': {}126 },127 'Nested': {128 'type': 'structure',129 'required': 'Bar',130 'members': {131 'Bar': {132 'shape': 'String',133 'endpointdiscoveryid': True,134 }135 }136 }137 }138 }139class TestEndpointDiscoveryManager(BaseEndpointDiscoveryTest):140 def setUp(self):141 super(TestEndpointDiscoveryManager, self).setUp()142 self.construct_manager()143 def construct_manager(self, cache=None, time=None, side_effect=None):144 self.service_model = ServiceModel(self.service_description)145 self.meta = mock.Mock(spec=ClientMeta)146 self.meta.service_model = self.service_model147 self.client = mock.Mock()148 if side_effect is None:149 side_effect = [{150 'Endpoints': [{151 'Address': 'new.com',152 'CachePeriodInMinutes': 2,153 }]154 }]155 self.client.describe_endpoints.side_effect = side_effect156 self.client.meta = self.meta157 self.manager = EndpointDiscoveryManager(158 self.client, cache=cache, current_time=time159 )160 def test_injects_api_version_if_endpoint_operation(self):161 model = self.service_model.operation_model('DescribeEndpoints')162 params = {'headers': {}}163 inject_api_version_header_if_needed(model, params)164 self.assertEqual(params['headers'].get('x-amz-api-version'),165 '2018-08-31')166 def test_no_inject_api_version_if_not_endpoint_operation(self):167 model = self.service_model.operation_model('TestDiscoveryRequired')168 params = {'headers': {}}169 inject_api_version_header_if_needed(model, params)170 self.assertNotIn('x-amz-api-version', params['headers'])171 def test_gather_identifiers(self):172 params = {173 'Foo': 'value1',174 'Nested': {'Bar': 'value2'}175 }176 operation = self.service_model.operation_model('TestDiscoveryRequired')177 ids = self.manager.gather_identifiers(operation, params)178 self.assertEqual(ids, {'Foo': 'value1', 'Bar': 'value2'})179 def test_gather_identifiers_none(self):180 operation = self.service_model.operation_model('TestDiscovery')181 ids = self.manager.gather_identifiers(operation, {})182 self.assertEqual(ids, {})183 def test_describe_endpoint(self):184 kwargs = {185 'Operation': 'FooBar',186 'Identifiers': {'Foo': 'value1', 'Bar': 'value2'},187 }188 self.manager.describe_endpoint(**kwargs)189 self.client.describe_endpoints.assert_called_with(**kwargs)190 def test_describe_endpoint_no_input(self):191 describe = self.service_description['operations']['DescribeEndpoints']192 del describe['input']193 self.construct_manager()194 self.manager.describe_endpoint(Operation='FooBar', Identifiers={})195 self.client.describe_endpoints.assert_called_with()196 def test_describe_endpoint_empty_input(self):197 describe = self.service_description['operations']['DescribeEndpoints']198 describe['input'] = {'shape': 'EmptyStruct'}199 self.construct_manager()200 self.manager.describe_endpoint(Operation='FooBar', Identifiers={})201 self.client.describe_endpoints.assert_called_with()202 def test_describe_endpoint_ids_and_operation(self):203 cache = {}204 self.construct_manager(cache=cache)205 ids = {'Foo': 'value1', 'Bar': 'value2'}206 kwargs = {207 'Operation': 'TestDiscoveryRequired',208 'Identifiers': ids,209 }210 self.manager.describe_endpoint(**kwargs)211 self.client.describe_endpoints.assert_called_with(**kwargs)212 key = ((('Bar', 'value2'), ('Foo', 'value1')), 'TestDiscoveryRequired')213 self.assertIn(key, cache)214 self.assertEqual(cache[key][0]['Address'], 'new.com')215 self.manager.describe_endpoint(**kwargs)216 call_count = self.client.describe_endpoints.call_count217 self.assertEqual(call_count, 1)218 def test_describe_endpoint_no_ids_or_operation(self):219 cache = {}220 describe = self.service_description['operations']['DescribeEndpoints']221 describe['input'] = {'shape': 'EmptyStruct'}222 self.construct_manager(cache=cache)223 self.manager.describe_endpoint(224 Operation='TestDiscoveryRequired', Identifiers={}225 )226 self.client.describe_endpoints.assert_called_with()227 key = ()228 self.assertIn(key, cache)229 self.assertEqual(cache[key][0]['Address'], 'new.com')230 self.manager.describe_endpoint(231 Operation='TestDiscoveryRequired', Identifiers={}232 )233 call_count = self.client.describe_endpoints.call_count234 self.assertEqual(call_count, 1)235 def test_describe_endpoint_expired_entry(self):236 current_time = time.time()237 key = ()238 cache = {239 key: [{'Address': 'old.com', 'Expiration': current_time - 10}]240 }241 self.construct_manager(cache=cache)242 kwargs = {243 'Identifiers': {},244 'Operation': 'TestDiscoveryRequired',245 }246 self.manager.describe_endpoint(**kwargs)247 self.client.describe_endpoints.assert_called_with()248 self.assertIn(key, cache)249 self.assertEqual(cache[key][0]['Address'], 'new.com')250 self.manager.describe_endpoint(**kwargs)251 call_count = self.client.describe_endpoints.call_count252 self.assertEqual(call_count, 1)253 def test_describe_endpoint_cache_expiration(self):254 def _time():255 return float(0)256 cache = {}257 self.construct_manager(cache=cache, time=_time)258 self.manager.describe_endpoint(259 Operation='TestDiscoveryRequired', Identifiers={}260 )261 key = ()262 self.assertIn(key, cache)263 self.assertEqual(cache[key][0]['Expiration'], float(120))264 def test_delete_endpoints_present(self):265 key = ()266 cache = {267 key: [{'Address': 'old.com', 'Expiration': 0}]268 }269 self.construct_manager(cache=cache)270 kwargs = {271 'Identifiers': {},272 'Operation': 'TestDiscoveryRequired',273 }274 self.manager.delete_endpoints(**kwargs)275 self.assertEqual(cache, {})276 def test_delete_endpoints_absent(self):277 cache = {}278 self.construct_manager(cache=cache)279 kwargs = {280 'Identifiers': {},281 'Operation': 'TestDiscoveryRequired',282 }283 self.manager.delete_endpoints(**kwargs)284 self.assertEqual(cache, {})285 def test_describe_endpoint_optional_fails_no_cache(self):286 side_effect = [ConnectionError(error=None)]287 self.construct_manager(side_effect=side_effect)288 kwargs = {'Operation': 'TestDiscoveryOptional'}289 endpoint = self.manager.describe_endpoint(**kwargs)290 self.assertIsNone(endpoint)291 # This second call should be blocked as we just failed292 endpoint = self.manager.describe_endpoint(**kwargs)293 self.assertIsNone(endpoint)294 self.client.describe_endpoints.call_args_list == [mock.call()]295 def test_describe_endpoint_optional_fails_stale_cache(self):296 key = ()297 cache = {298 key: [{'Address': 'old.com', 'Expiration': 0}]299 }300 side_effect = [ConnectionError(error=None)] * 2301 self.construct_manager(cache=cache, side_effect=side_effect)302 kwargs = {'Operation': 'TestDiscoveryOptional'}303 endpoint = self.manager.describe_endpoint(**kwargs)304 self.assertEqual(endpoint, 'old.com')305 # This second call shouldn't go through as we just failed306 endpoint = self.manager.describe_endpoint(**kwargs)307 self.assertEqual(endpoint, 'old.com')308 self.client.describe_endpoints.call_args_list == [mock.call()]309 def test_describe_endpoint_required_fails_no_cache(self):310 side_effect = [ConnectionError(error=None)] * 2311 self.construct_manager(side_effect=side_effect)312 kwargs = {'Operation': 'TestDiscoveryRequired'}313 with self.assertRaises(EndpointDiscoveryRefreshFailed):314 self.manager.describe_endpoint(**kwargs)315 # This second call should go through, as we have no cache316 with self.assertRaises(EndpointDiscoveryRefreshFailed):317 self.manager.describe_endpoint(**kwargs)318 describe_count = self.client.describe_endpoints.call_count319 self.assertEqual(describe_count, 2)320 def test_describe_endpoint_required_fails_stale_cache(self):321 key = ()322 cache = {323 key: [{'Address': 'old.com', 'Expiration': 0}]324 }325 side_effect = [ConnectionError(error=None)] * 2326 self.construct_manager(cache=cache, side_effect=side_effect)327 kwargs = {'Operation': 'TestDiscoveryRequired'}328 endpoint = self.manager.describe_endpoint(**kwargs)329 self.assertEqual(endpoint, 'old.com')330 # We have a stale endpoint, so this shouldn't fail or force a refresh331 endpoint = self.manager.describe_endpoint(**kwargs)332 self.assertEqual(endpoint, 'old.com')333 self.client.describe_endpoints.call_args_list == [mock.call()]334 def test_describe_endpoint_required_force_refresh_success(self):335 side_effect = [336 ConnectionError(error=None),337 {'Endpoints': [{338 'Address': 'new.com',339 'CachePeriodInMinutes': 2,340 }]},341 ]342 self.construct_manager(side_effect=side_effect)343 kwargs = {'Operation': 'TestDiscoveryRequired'}344 # First call will fail345 with self.assertRaises(EndpointDiscoveryRefreshFailed):346 self.manager.describe_endpoint(**kwargs)347 self.client.describe_endpoints.call_args_list == [mock.call()]348 # Force a refresh if the cache is empty but discovery is required349 endpoint = self.manager.describe_endpoint(**kwargs)350 self.assertEqual(endpoint, 'new.com')351 def test_describe_endpoint_retries_after_failing(self):352 fake_time = mock.Mock()353 fake_time.side_effect = [0, 100, 200]354 side_effect = [355 ConnectionError(error=None),356 {'Endpoints': [{357 'Address': 'new.com',358 'CachePeriodInMinutes': 2,359 }]},360 ]361 self.construct_manager(side_effect=side_effect, time=fake_time)362 kwargs = {'Operation': 'TestDiscoveryOptional'}363 endpoint = self.manager.describe_endpoint(**kwargs)364 self.assertIsNone(endpoint)365 self.client.describe_endpoints.call_args_list == [mock.call()]366 # Second time should try again as enough time has elapsed367 endpoint = self.manager.describe_endpoint(**kwargs)368 self.assertEqual(endpoint, 'new.com')369class TestEndpointDiscoveryHandler(BaseEndpointDiscoveryTest):370 def setUp(self):371 super(TestEndpointDiscoveryHandler, self).setUp()372 self.manager = mock.Mock(spec=EndpointDiscoveryManager)373 self.handler = EndpointDiscoveryHandler(self.manager)374 self.service_model = ServiceModel(self.service_description)375 def test_register_handler(self):376 events = mock.Mock(spec=HierarchicalEmitter)377 self.handler.register(events, 'foo-bar')378 events.register.assert_any_call(379 'before-parameter-build.foo-bar', self.handler.gather_identifiers380 )381 events.register.assert_any_call(382 'needs-retry.foo-bar', self.handler.handle_retries383 )384 events.register_first.assert_called_with(385 'request-created.foo-bar', self.handler.discover_endpoint386 )387 def test_discover_endpoint(self):388 request = AWSRequest()389 request.context = {390 'discovery': {'identifiers': {}}391 }392 self.manager.describe_endpoint.return_value = 'https://new.foo'393 self.handler.discover_endpoint(request, 'TestOperation')394 self.assertEqual(request.url, 'https://new.foo')395 self.manager.describe_endpoint.assert_called_with(396 Operation='TestOperation', Identifiers={}397 )398 def test_discover_endpoint_fails(self):399 request = AWSRequest()400 request.context = {401 'discovery': {'identifiers': {}}402 }403 request.url = 'old.com'404 self.manager.describe_endpoint.return_value = None405 self.handler.discover_endpoint(request, 'TestOperation')406 self.assertEqual(request.url, 'old.com')407 self.manager.describe_endpoint.assert_called_with(408 Operation='TestOperation', Identifiers={}409 )410 def test_discover_endpoint_no_protocol(self):411 request = AWSRequest()412 request.context = {413 'discovery': {'identifiers': {}}414 }415 self.manager.describe_endpoint.return_value = 'new.foo'416 self.handler.discover_endpoint(request, 'TestOperation')417 self.assertEqual(request.url, 'https://new.foo')418 self.manager.describe_endpoint.assert_called_with(419 Operation='TestOperation', Identifiers={}420 )421 def test_inject_no_context(self):422 request = AWSRequest(url='https://original.foo')423 self.handler.discover_endpoint(request, 'TestOperation')424 self.assertEqual(request.url, 'https://original.foo')425 self.manager.describe_endpoint.assert_not_called()426 def test_gather_identifiers(self):427 context = {}428 params = {429 'Foo': 'value1',430 'Nested': {'Bar': 'value2'}431 }432 ids = {433 'Foo': 'value1',434 'Bar': 'value2'435 }436 model = self.service_model.operation_model('TestDiscoveryRequired')437 self.manager.gather_identifiers.return_value = ids438 self.handler.gather_identifiers(params, model, context)439 self.assertEqual(context['discovery']['identifiers'], ids)440 def test_gather_identifiers_not_discoverable(self):441 context = {}442 model = self.service_model.operation_model('DescribeEndpoints')443 self.handler.gather_identifiers({}, model, context)444 self.assertEqual(context, {})445 def test_discovery_disabled_but_required(self):446 model = self.service_model.operation_model('TestDiscoveryRequired')447 with self.assertRaises(EndpointDiscoveryRequired):448 block_endpoint_discovery_required_operations(model)449 def test_discovery_disabled_but_optional(self):450 context = {}451 model = self.service_model.operation_model('TestDiscoveryOptional')452 block_endpoint_discovery_required_operations(model, context=context)453 self.assertEqual(context, {})454 def test_does_not_retry_no_response(self):455 retry = self.handler.handle_retries(None, None, None)456 self.assertIsNone(retry)457 def test_does_not_retry_other_errors(self):458 parsed_response = {459 'ResponseMetadata': {'HTTPStatusCode': 200}460 }461 response = (None, parsed_response)462 retry = self.handler.handle_retries(None, response, None)463 self.assertIsNone(retry)464 def test_does_not_retry_if_no_context(self):465 request_dict = {'context': {}}466 parsed_response = {467 'ResponseMetadata': {'HTTPStatusCode': 421}468 }469 response = (None, parsed_response)470 retry = self.handler.handle_retries(request_dict, response, None)471 self.assertIsNone(retry)472 def _assert_retries(self, parsed_response):473 request_dict = {474 'context': {475 'discovery': {'identifiers': {}}476 }477 }478 response = (None, parsed_response)479 model = self.service_model.operation_model('TestDiscoveryOptional')480 retry = self.handler.handle_retries(request_dict, response, model)481 self.assertEqual(retry, 0)482 self.manager.delete_endpoints.assert_called_with(483 Operation='TestDiscoveryOptional', Identifiers={}484 )485 def test_retries_421_status_code(self):486 parsed_response = {487 'ResponseMetadata': {'HTTPStatusCode': 421}488 }489 self._assert_retries(parsed_response)490 def test_retries_invalid_endpoint_exception(self):491 parsed_response = {'Error': {'Code': 'InvalidEndpointException'}}...

Full Screen

Full Screen

descriptor_test.py

Source:descriptor_test.py Github

copy

Full Screen

...360 self.assertEquals(expected, described)361class DescribeTest(test_util.TestCase):362 def testModule(self):363 self.assertEquals(descriptor.describe_file(test_util),364 descriptor.describe(test_util))365 def testMethod(self):366 class Param(messages.Message):367 pass368 class Service(remote.Service):369 @remote.method(Param, Param)370 def fn(self):371 return Param()372 self.assertEquals(descriptor.describe_method(Service.fn),373 descriptor.describe(Service.fn))374 def testField(self):375 self.assertEquals(376 descriptor.describe_field(test_util.NestedMessage.a_value),377 descriptor.describe(test_util.NestedMessage.a_value))378 def testEnumValue(self):379 self.assertEquals(380 descriptor.describe_enum_value(381 test_util.OptionalMessage.SimpleEnum.VAL1),382 descriptor.describe(test_util.OptionalMessage.SimpleEnum.VAL1))383 def testMessage(self):384 self.assertEquals(descriptor.describe_message(test_util.NestedMessage),385 descriptor.describe(test_util.NestedMessage))386 def testEnum(self):387 self.assertEquals(388 descriptor.describe_enum(test_util.OptionalMessage.SimpleEnum),389 descriptor.describe(test_util.OptionalMessage.SimpleEnum))390 def testService(self):391 class Service(remote.Service):392 pass393 self.assertEquals(descriptor.describe_service(Service),394 descriptor.describe(Service))395 def testService(self):396 class Service(remote.Service):397 pass398 self.assertEquals(descriptor.describe_service(Service),399 descriptor.describe(Service))400 def testUndescribable(self):401 class NonService(object):402 def fn(self):403 pass404 for value in (NonService,405 NonService.fn,406 1,407 'string',408 1.2,409 None):410 self.assertEquals(None, descriptor.describe(value))411class ModuleFinderTest(test_util.TestCase):412 def testFindModule(self):413 self.assertEquals(descriptor.describe_file(registry),414 descriptor.import_descriptor_loader('protorpc.registry'))415 def testFindMessage(self):416 self.assertEquals(417 descriptor.describe_message(descriptor.FileSet),418 descriptor.import_descriptor_loader('protorpc.descriptor.FileSet'))419 def testFindField(self):420 self.assertEquals(421 descriptor.describe_field(descriptor.FileSet.files),422 descriptor.import_descriptor_loader('protorpc.descriptor.FileSet.files'))423 def testFindEnumValue(self):424 self.assertEquals(...

Full Screen

Full Screen

__init__.py

Source:__init__.py Github

copy

Full Screen

1# coding=UTF-82from support.init.base import BaseLoader3class RoleLoader(BaseLoader):4 def load(self):5 return [6 {7 'name': '超级管理员',8 'parent': "",9 'describe': "超级角色",10 'is_show_data': True,11 },12 {13 'name': '老板',14 'parent': "超级管理员",15 'describe': "老板",16 'is_show_data': True,17 },18 {19 'name': '电商部售前主管',20 'parent': "老板",21 'describe': "电商部售前主管",22 'is_show_data': True,23 },24 {25 'name': '电商售前组长',26 'parent': "电商部售前主管",27 'describe': "电商售前组长",28 'is_show_data': True,29 },30 {31 'name': '电商售前组员',32 'parent': "电商售前组长",33 'describe': "电商售前组员",34 'is_show_data': True,35 },36 {37 'name': '增值部主管',38 'parent': "老板",39 'describe': "增值部主管",40 'is_show_data': True,41 },42 {43 'name': '增值一部主管',44 'parent': "增值部主管",45 'describe': "增值一部主管",46 'is_show_data': True,47 },48 {49 'name': '增值一部组长',50 'parent': "增值一部主管",51 'describe': "增值一部组长",52 'is_show_data': True,53 },54 {55 'name': '增值一部组员',56 'parent': "增值一部组长",57 'describe': "增值一部组员",58 'is_show_data': True,59 },60 {61 'name': '数据录入员',62 'parent': "增值一部组长",63 'describe': "数据录入员",64 'is_show_data': True,65 },66 {67 'name': '增值二部主管',68 'parent': "增值部主管",69 'describe': "增值二部主管",70 'is_show_data': True,71 },72 {73 'name': '增值二部组员',74 'parent': "增值二部主管",75 'describe': "增值二部组员",76 'is_show_data': True,77 },78 {79 'name': '增值三部主管',80 'parent': "增值部主管",81 'describe': "增值三部主管",82 'is_show_data': True,83 },84 {85 'name': '增值三部组员',86 'parent': "增值三部主管",87 'describe': "增值三部组员",88 'is_show_data': True,89 },90 {91 'name': '增值四部主管',92 'parent': "增值部主管",93 'describe': "增值四部主管",94 'is_show_data': True,95 },96 {97 'name': '增值四部组员',98 'parent': "增值四部主管",99 'describe': "增值四部组员",100 'is_show_data': True,101 },102 {103 'name': '新媒体客服部主管',104 'parent': "老板",105 'describe': "新媒体客服部主管",106 'is_show_data': True,107 },108 {109 'name': '新媒体组长',110 'parent': "新媒体客服部主管",111 'describe': "新媒体组长",112 'is_show_data': True,113 },114 {115 'name': '新媒体组员',116 'parent': "新媒体组长",117 'describe': "新媒体组员",118 'is_show_data': True,119 },120 {121 'name': '新媒体运营部主管',122 'parent': "老板",123 'describe': "新媒体运营部主管",124 'is_show_data': True,125 },126 {127 'name': '美工',128 'parent': "新媒体运营部主管",129 'describe': "美工",130 'is_show_data': True,131 },132 {133 'name': '视频剪辑',134 'parent': "新媒体运营部主管",135 'describe': "视频剪辑",136 'is_show_data': True,137 },138 {139 'name': '运营',140 'parent': "新媒体运营部主管",141 'describe': "运营",142 'is_show_data': True,143 },144 {145 'name': '文案',146 'parent': "新媒体运营部主管",147 'describe': "文案",148 'is_show_data': True,149 },150 {151 'name': '数据',152 'parent': "新媒体运营部主管",153 'describe': "数据",154 'is_show_data': True,155 },156 {157 'name': 'SEO',158 'parent': "新媒体运营部主管",159 'describe': "SEO",160 'is_show_data': True,161 },162 {163 'name': '仓库主管',164 'parent': "老板",165 'describe': "仓库主管",166 'is_show_data': True,167 },168 {169 'name': '仓管员',170 'parent': "仓库主管",171 'describe': "仓管员",172 'is_show_data': True,173 },174 {175 'name': '电商运营主管',176 'parent': "老板",177 'describe': "电商运营主管",178 'is_show_data': True,179 },180 {181 'name': '电商运营组员',182 'parent': "电商运营主管",183 'describe': "电商运营组员",184 'is_show_data': True,185 },186 {187 'name': '招商业务部主管',188 'parent': "老板",189 'describe': "招商业务部主管",190 'is_show_data': True,191 },192 {193 'name': '商务助理',194 'parent': "招商业务部主管",195 'describe': "商务助理",196 'is_show_data': True,197 },198 {199 'name': '后勤技术部主管',200 'parent': "老板",201 'describe': "后勤技术部主管",202 'is_show_data': True,203 },204 {205 'name': '运维员',206 'parent': "后勤技术部主管",207 'describe': "运维员",208 'is_show_data': True,209 },210 {211 'name': '财务主管',212 'parent': "老板",213 'describe': "财务主管",214 'is_show_data': True,215 },216 {217 'name': '财务员',218 'parent': "财务主管",219 'describe': "财务员",220 'is_show_data': True,221 },222 {223 'name': '财务主管',224 'parent': "老板",225 'describe': "财务主管",226 'is_show_data': True,227 },228 {229 'name': '财务员',230 'parent': "财务主管",231 'describe': "财务员",232 'is_show_data': True,233 },234 {235 'name': '行政经理',236 'parent': "老板",237 'describe': "行政经理",238 'is_show_data': True,239 },240 {241 'name': '行政员',242 'parent': "行政经理",243 'describe': "行政员",244 'is_show_data': True,245 },246 {247 'name': '人事主管',248 'parent': "老板",249 'describe': "人事主管",250 'is_show_data': True,251 },252 {253 'name': '人事助理',254 'parent': "人事主管",255 'describe': "人事助理",256 'is_show_data': True,257 },258 {259 'name': '人事专员',260 'parent': "人事主管",261 'describe': "人事专员",262 'is_show_data': True,263 },264 {265 'name': '培训主管',266 'parent': "老板",267 'describe': "培训主管",268 'is_show_data': True,269 },270 {271 'name': '培训讲师',272 'parent': "培训主管",273 'describe': "培训讲师",274 'is_show_data': True,275 },276 {277 'name': '质检部主管',278 'parent': "老板",279 'describe': "质检部主管",280 'is_show_data': True,281 },282 {283 'name': '质检专员',284 'parent': "质检部主管",285 'describe': "质检专员",286 'is_show_data': True,287 },288 {289 'name': '微商售前主管',290 'parent': "老板",291 'describe': "微商售前主管",292 'is_show_data': True,293 },294 {295 'name': '微商售前组长',296 'parent': "微商售前主管",297 'describe': "微商售前组长",298 'is_show_data': True,299 },300 {301 'name': '微商售前组员',302 'parent': "微商售前组长",303 'describe': "微商售前组员",304 'is_show_data': True,305 },306 {307 'name': '微商售后主管',308 'parent': "老板",309 'describe': "微商售后主管",310 'is_show_data': True,311 },312 {313 'name': '微商售后组长',314 'parent': "微商售后主管",315 'describe': "微商售后组长",316 'is_show_data': True,317 },318 {319 'name': '微商售后组员',320 'parent': "微商售后组长",321 'describe': "微商售后组员",322 'is_show_data': True,323 },324 {325 'name': '电商售后组长',326 'parent': "微商售后主管",327 'describe': "电商售后组长",328 'is_show_data': True,329 },330 {331 'name': '电商售后组员',332 'parent': "电商售后组长",333 'describe': "电商售后组员",334 'is_show_data': True,335 },336 {337 'name': '微信运维主管',338 'parent': "老板",339 'describe': "微信运维主管",340 'is_show_data': True,341 },342 {343 'name': '微信运维组员',344 'parent': "微信运维主管",345 'describe': "微信运维组员",346 'is_show_data': True,347 },348 {349 'name': '研发部项目经理',350 'parent': "老板",351 'describe': "研发部项目经理",352 'is_show_data': True,353 },354 {355 'name': 'WEB前端',356 'parent': "研发部项目经理",357 'describe': "WEB前端",358 'is_show_data': True,359 },360 {361 'name': 'UI设计师',362 'parent': "研发部项目经理",363 'describe': "UI设计师",364 'is_show_data': True,365 },366 {367 'name': 'Java开发工程师',368 'parent': "研发部项目经理",369 'describe': "Java开发工程师",370 'is_show_data': True,371 },372 {373 'name': 'Python开发工程师',374 'parent': "研发部项目经理",375 'describe': "Python开发工程师",376 'is_show_data': True,377 },...

Full Screen

Full Screen

rds.pyi

Source:rds.pyi Github

copy

Full Screen

1"""2This type stub file was generated by pyright.3"""4from .aws import Action as BaseAction5from .aws import BaseARN6service_name = "Amazon RDS"7prefix = "rds"8class Action(BaseAction):9 def __init__(self, action=...) -> None: ...10class ARN(BaseARN):11 def __init__(self, resource=..., region=..., account=...) -> None: ...12AddRoleToDBCluster = Action("AddRoleToDBCluster")13AddRoleToDBInstance = Action("AddRoleToDBInstance")14AddSourceIdentifierToSubscription = Action("AddSourceIdentifierToSubscription")15AddTagsToResource = Action("AddTagsToResource")16ApplyPendingMaintenanceAction = Action("ApplyPendingMaintenanceAction")17AuthorizeDBSecurityGroupIngress = Action("AuthorizeDBSecurityGroupIngress")18BacktrackDBCluster = Action("BacktrackDBCluster")19CancelExportTask = Action("CancelExportTask")20CopyDBClusterParameterGroup = Action("CopyDBClusterParameterGroup")21CopyDBClusterSnapshot = Action("CopyDBClusterSnapshot")22CopyDBParameterGroup = Action("CopyDBParameterGroup")23CopyDBSnapshot = Action("CopyDBSnapshot")24CopyOptionGroup = Action("CopyOptionGroup")25CreateDBCluster = Action("CreateDBCluster")26CreateDBClusterEndpoint = Action("CreateDBClusterEndpoint")27CreateDBClusterParameterGroup = Action("CreateDBClusterParameterGroup")28CreateDBClusterSnapshot = Action("CreateDBClusterSnapshot")29CreateDBInstance = Action("CreateDBInstance")30CreateDBInstanceReadReplica = Action("CreateDBInstanceReadReplica")31CreateDBParameterGroup = Action("CreateDBParameterGroup")32CreateDBProxy = Action("CreateDBProxy")33CreateDBSecurityGroup = Action("CreateDBSecurityGroup")34CreateDBSnapshot = Action("CreateDBSnapshot")35CreateDBSubnetGroup = Action("CreateDBSubnetGroup")36CreateEventSubscription = Action("CreateEventSubscription")37CreateGlobalCluster = Action("CreateGlobalCluster")38CreateOptionGroup = Action("CreateOptionGroup")39DeleteDBCluster = Action("DeleteDBCluster")40DeleteDBClusterEndpoint = Action("DeleteDBClusterEndpoint")41DeleteDBClusterParameterGroup = Action("DeleteDBClusterParameterGroup")42DeleteDBClusterSnapshot = Action("DeleteDBClusterSnapshot")43DeleteDBInstance = Action("DeleteDBInstance")44DeleteDBInstanceAutomatedBackup = Action("DeleteDBInstanceAutomatedBackup")45DeleteDBParameterGroup = Action("DeleteDBParameterGroup")46DeleteDBProxy = Action("DeleteDBProxy")47DeleteDBSecurityGroup = Action("DeleteDBSecurityGroup")48DeleteDBSnapshot = Action("DeleteDBSnapshot")49DeleteDBSubnetGroup = Action("DeleteDBSubnetGroup")50DeleteEventSubscription = Action("DeleteEventSubscription")51DeleteGlobalCluster = Action("DeleteGlobalCluster")52DeleteOptionGroup = Action("DeleteOptionGroup")53DeregisterDBProxyTargets = Action("DeregisterDBProxyTargets")54DescribeAccountAttributes = Action("DescribeAccountAttributes")55DescribeCertificates = Action("DescribeCertificates")56DescribeDBClusterBacktracks = Action("DescribeDBClusterBacktracks")57DescribeDBClusterEndpoints = Action("DescribeDBClusterEndpoints")58DescribeDBClusterParameterGroups = Action("DescribeDBClusterParameterGroups")59DescribeDBClusterParameters = Action("DescribeDBClusterParameters")60DescribeDBClusterSnapshotAttributes = Action("DescribeDBClusterSnapshotAttributes")61DescribeDBClusterSnapshots = Action("DescribeDBClusterSnapshots")62DescribeDBClusters = Action("DescribeDBClusters")63DescribeDBEngineVersions = Action("DescribeDBEngineVersions")64DescribeDBInstanceAutomatedBackups = Action("DescribeDBInstanceAutomatedBackups")65DescribeDBInstances = Action("DescribeDBInstances")66DescribeDBLogFiles = Action("DescribeDBLogFiles")67DescribeDBParameterGroups = Action("DescribeDBParameterGroups")68DescribeDBParameters = Action("DescribeDBParameters")69DescribeDBProxies = Action("DescribeDBProxies")70DescribeDBProxyTargetGroups = Action("DescribeDBProxyTargetGroups")71DescribeDBProxyTargets = Action("DescribeDBProxyTargets")72DescribeDBSecurityGroups = Action("DescribeDBSecurityGroups")73DescribeDBSnapshotAttributes = Action("DescribeDBSnapshotAttributes")74DescribeDBSnapshots = Action("DescribeDBSnapshots")75DescribeDBSubnetGroups = Action("DescribeDBSubnetGroups")76DescribeEngineDefaultClusterParameters = Action(77 "DescribeEngineDefaultClusterParameters"78)79DescribeEngineDefaultParameters = Action("DescribeEngineDefaultParameters")80DescribeEventCategories = Action("DescribeEventCategories")81DescribeEventSubscriptions = Action("DescribeEventSubscriptions")82DescribeEvents = Action("DescribeEvents")83DescribeExportTasks = Action("DescribeExportTasks")84DescribeGlobalClusters = Action("DescribeGlobalClusters")85DescribeOptionGroupOptions = Action("DescribeOptionGroupOptions")86DescribeOptionGroups = Action("DescribeOptionGroups")87DescribeOrderableDBInstanceOptions = Action("DescribeOrderableDBInstanceOptions")88DescribePendingMaintenanceActions = Action("DescribePendingMaintenanceActions")89DescribeReservedDBInstances = Action("DescribeReservedDBInstances")90DescribeReservedDBInstancesOfferings = Action("DescribeReservedDBInstancesOfferings")91DescribeSourceRegions = Action("DescribeSourceRegions")92DescribeValidDBInstanceModifications = Action("DescribeValidDBInstanceModifications")93DownloadCompleteDBLogFile = Action("DownloadCompleteDBLogFile")94DownloadDBLogFilePortion = Action("DownloadDBLogFilePortion")95FailoverDBCluster = Action("FailoverDBCluster")96ListTagsForResource = Action("ListTagsForResource")97ModifyCurrentDBClusterCapacity = Action("ModifyCurrentDBClusterCapacity")98ModifyDBCluster = Action("ModifyDBCluster")99ModifyDBClusterEndpoint = Action("ModifyDBClusterEndpoint")100ModifyDBClusterParameterGroup = Action("ModifyDBClusterParameterGroup")101ModifyDBClusterSnapshotAttribute = Action("ModifyDBClusterSnapshotAttribute")102ModifyDBInstance = Action("ModifyDBInstance")103ModifyDBParameterGroup = Action("ModifyDBParameterGroup")104ModifyDBProxy = Action("ModifyDBProxy")105ModifyDBProxyTargetGroup = Action("ModifyDBProxyTargetGroup")106ModifyDBSnapshot = Action("ModifyDBSnapshot")107ModifyDBSnapshotAttribute = Action("ModifyDBSnapshotAttribute")108ModifyDBSubnetGroup = Action("ModifyDBSubnetGroup")109ModifyEventSubscription = Action("ModifyEventSubscription")110ModifyGlobalCluster = Action("ModifyGlobalCluster")111ModifyOptionGroup = Action("ModifyOptionGroup")112PromoteReadReplica = Action("PromoteReadReplica")113PromoteReadReplicaDBCluster = Action("PromoteReadReplicaDBCluster")114PurchaseReservedDBInstancesOffering = Action("PurchaseReservedDBInstancesOffering")115RebootDBInstance = Action("RebootDBInstance")116RegisterDBProxyTargets = Action("RegisterDBProxyTargets")117RemoveFromGlobalCluster = Action("RemoveFromGlobalCluster")118RemoveRoleFromDBCluster = Action("RemoveRoleFromDBCluster")119RemoveRoleFromDBInstance = Action("RemoveRoleFromDBInstance")120RemoveSourceIdentifierFromSubscription = Action(121 "RemoveSourceIdentifierFromSubscription"122)123RemoveTagsFromResource = Action("RemoveTagsFromResource")124ResetDBClusterParameterGroup = Action("ResetDBClusterParameterGroup")125ResetDBParameterGroup = Action("ResetDBParameterGroup")126RestoreDBClusterFromS3 = Action("RestoreDBClusterFromS3")127RestoreDBClusterFromSnapshot = Action("RestoreDBClusterFromSnapshot")128RestoreDBClusterToPointInTime = Action("RestoreDBClusterToPointInTime")129RestoreDBInstanceFromDBSnapshot = Action("RestoreDBInstanceFromDBSnapshot")130RestoreDBInstanceFromS3 = Action("RestoreDBInstanceFromS3")131RestoreDBInstanceToPointInTime = Action("RestoreDBInstanceToPointInTime")132RevokeDBSecurityGroupIngress = Action("RevokeDBSecurityGroupIngress")133StartActivityStream = Action("StartActivityStream")134StartDBCluster = Action("StartDBCluster")135StartDBInstance = Action("StartDBInstance")136StartExportTask = Action("StartExportTask")137StopActivityStream = Action("StopActivityStream")138StopDBCluster = Action("StopDBCluster")...

Full Screen

Full Screen

test_describe.py

Source:test_describe.py Github

copy

Full Screen

...4from frictionless import program, describe, Detector, helpers5runner = CliRunner()6IS_UNIX = not helpers.is_platform("windows")7# General8def test_program_describe():9 result = runner.invoke(program, "describe data/table.csv --stats")10 assert result.exit_code == 011 if IS_UNIX:12 assert result.stdout.count("metadata: data/table.csv")13 assert result.stdout.count("hash: 6c2c61dd9b0e9c6876139a449ed87933")14def test_program_describe_type_schema():15 result = runner.invoke(program, "describe data/table.csv --json --type schema")16 assert result.exit_code == 017 assert json.loads(result.stdout) == describe("data/table.csv", type="schema")18def test_program_describe_type_dialect():19 result = runner.invoke(program, "describe data/delimiter.csv --json --type dialect")20 assert result.exit_code == 021 assert json.loads(result.stdout) == describe("data/delimiter.csv", type="dialect")22def test_program_describe_header_rows():23 result = runner.invoke(program, "describe data/table.csv --json --header-rows '1,2'")24 assert result.exit_code == 025 assert json.loads(result.stdout) == describe(26 "data/table.csv", layout={"headerRows": [1, 2]}27 )28def test_program_describe_header_join():29 result = runner.invoke(30 program, "describe data/table.csv --json --header-rows '1,2' --header-join ':'"31 )32 assert result.exit_code == 033 assert json.loads(result.stdout) == describe(34 "data/table.csv", layout={"headerRows": [1, 2], "headerJoin": ":"}35 )36def test_program_describe_pick_fields():37 result = runner.invoke(program, "describe data/table.csv --json --pick-fields 'id'")38 assert result.exit_code == 039 assert json.loads(result.stdout) == describe(40 "data/table.csv", layout={"pickFields": ["id"]}41 )42def test_program_describe_skip_fields():43 result = runner.invoke(program, "describe data/table.csv --json --skip-fields 'id'")44 assert result.exit_code == 045 assert json.loads(result.stdout) == describe(46 "data/table.csv", layout={"skipFields": ["id"]}47 )48def test_program_describe_limit_fields():49 result = runner.invoke(program, "describe data/table.csv --json --limit-fields 1")50 assert result.exit_code == 051 assert json.loads(result.stdout) == describe(52 "data/table.csv", layout={"limitFields": 1}53 )54def test_program_describe_offset_fields():55 result = runner.invoke(program, "describe data/table.csv --json --offset-fields 1")56 assert result.exit_code == 057 assert json.loads(result.stdout) == describe(58 "data/table.csv", layout={"offsetFields": 1}59 )60def test_program_describe_pick_rows():61 result = runner.invoke(program, "describe data/table.csv --json --pick-rows 1")62 assert result.exit_code == 063 assert json.loads(result.stdout) == describe(64 "data/table.csv", layout={"pickRows": [1]}65 )66def test_program_describe_skip_rows():67 result = runner.invoke(program, "describe data/table.csv --json --skip-rows 1")68 assert result.exit_code == 069 assert json.loads(result.stdout) == describe(70 "data/table.csv", layout={"skipRows": [1]}71 )72def test_program_describe_limit_rows():73 result = runner.invoke(program, "describe data/table.csv --json --limit-rows 1")74 assert result.exit_code == 075 assert json.loads(result.stdout) == describe(76 "data/table.csv", layout={"limitRows": 1}77 )78def test_program_describe_offset_rows():79 result = runner.invoke(program, "describe data/table.csv --json --offset-rows 1")80 assert result.exit_code == 081 assert json.loads(result.stdout) == describe(82 "data/table.csv", layout={"offsetRows": 1}83 )84def test_program_describe_infer_type():85 result = runner.invoke(program, "describe data/table.csv --json --field-type string")86 assert result.exit_code == 087 assert json.loads(result.stdout) == describe(88 "data/table.csv", detector=Detector(field_type="string")89 )90def test_program_describe_infer_names():91 result = runner.invoke(program, "describe data/table.csv --json --field-names 'a,b'")92 assert result.exit_code == 093 assert json.loads(result.stdout) == describe(94 "data/table.csv", detector=Detector(field_names=["a", "b"])95 )96def test_program_describe_infer_missing_values():97 result = runner.invoke(98 program, "describe data/table.csv --json --field-missing-values 1"99 )100 assert result.exit_code == 0101 assert json.loads(result.stdout) == describe(102 "data/table.csv", detector=Detector(field_missing_values=["1"])103 )104def test_program_describe_expand():105 result = runner.invoke(program, "describe data/table.csv --json --expand")106 assert result.exit_code == 0107 assert json.loads(result.stdout) == describe("data/table.csv", expand=True)108def test_program_describe_yaml():109 result = runner.invoke(program, "describe data/table.csv --yaml")110 assert result.exit_code == 0111 assert yaml.safe_load(result.stdout) == describe("data/table.csv")112def test_program_describe_json():113 result = runner.invoke(program, "describe data/table.csv --json")114 assert result.exit_code == 0115 assert json.loads(result.stdout) == describe("data/table.csv")116def test_program_describe_error_not_found():117 result = runner.invoke(program, "describe data/bad.csv")118 assert result.exit_code == 1119 assert (120 result.stdout.count("[scheme-error]")121 and result.stdout.count("[Errno 2]")122 and result.stdout.count("data/bad.csv")123 )124def test_program_describe_basepath():125 result = runner.invoke(program, "describe --basepath data *-3.csv")126 assert result.exit_code == 0...

Full Screen

Full Screen

test_sagemaker_training.py

Source:test_sagemaker_training.py Github

copy

Full Screen

1#2# Licensed to the Apache Software Foundation (ASF) under one3# or more contributor license agreements. See the NOTICE file4# distributed with this work for additional information5# regarding copyright ownership. The ASF licenses this file6# to you under the Apache License, Version 2.0 (the7# "License"); you may not use this file except in compliance8# with the License. You may obtain a copy of the License at9#10# http://www.apache.org/licenses/LICENSE-2.011#12# Unless required by applicable law or agreed to in writing,13# software distributed under the License is distributed on an14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15# KIND, either express or implied. See the License for the16# specific language governing permissions and limitations17# under the License.18import unittest19from datetime import datetime20from unittest import mock21from airflow.exceptions import AirflowException22from airflow.providers.amazon.aws.hooks.logs import AwsLogsHook23from airflow.providers.amazon.aws.hooks.sagemaker import LogState, SageMakerHook24from airflow.providers.amazon.aws.sensors.sagemaker_training import SageMakerTrainingSensor25DESCRIBE_TRAINING_COMPLETED_RESPONSE = {26 'TrainingJobStatus': 'Completed',27 'ResourceConfig': {'InstanceCount': 1, 'InstanceType': 'ml.c4.xlarge', 'VolumeSizeInGB': 10},28 'TrainingStartTime': datetime(2018, 2, 17, 7, 15, 0, 103000),29 'TrainingEndTime': datetime(2018, 2, 17, 7, 19, 34, 953000),30 'ResponseMetadata': {31 'HTTPStatusCode': 200,32 },33}34DESCRIBE_TRAINING_INPROGRESS_RESPONSE = dict(DESCRIBE_TRAINING_COMPLETED_RESPONSE)35DESCRIBE_TRAINING_INPROGRESS_RESPONSE.update({'TrainingJobStatus': 'InProgress'})36DESCRIBE_TRAINING_FAILED_RESPONSE = dict(DESCRIBE_TRAINING_COMPLETED_RESPONSE)37DESCRIBE_TRAINING_FAILED_RESPONSE.update({'TrainingJobStatus': 'Failed', 'FailureReason': 'Unknown'})38DESCRIBE_TRAINING_STOPPING_RESPONSE = dict(DESCRIBE_TRAINING_COMPLETED_RESPONSE)39DESCRIBE_TRAINING_STOPPING_RESPONSE.update({'TrainingJobStatus': 'Stopping'})40class TestSageMakerTrainingSensor(unittest.TestCase):41 @mock.patch.object(SageMakerHook, 'get_conn')42 @mock.patch.object(SageMakerHook, '__init__')43 @mock.patch.object(SageMakerHook, 'describe_training_job')44 def test_sensor_with_failure(self, mock_describe_job, hook_init, mock_client):45 hook_init.return_value = None46 mock_describe_job.side_effect = [DESCRIBE_TRAINING_FAILED_RESPONSE]47 sensor = SageMakerTrainingSensor(48 task_id='test_task',49 poke_interval=2,50 aws_conn_id='aws_test',51 job_name='test_job_name',52 print_log=False,53 )54 self.assertRaises(AirflowException, sensor.execute, None)55 mock_describe_job.assert_called_once_with('test_job_name')56 @mock.patch.object(SageMakerHook, 'get_conn')57 @mock.patch.object(SageMakerHook, '__init__')58 @mock.patch.object(SageMakerHook, 'describe_training_job')59 def test_sensor(self, mock_describe_job, hook_init, mock_client):60 hook_init.return_value = None61 mock_describe_job.side_effect = [62 DESCRIBE_TRAINING_INPROGRESS_RESPONSE,63 DESCRIBE_TRAINING_STOPPING_RESPONSE,64 DESCRIBE_TRAINING_COMPLETED_RESPONSE,65 ]66 sensor = SageMakerTrainingSensor(67 task_id='test_task',68 poke_interval=2,69 aws_conn_id='aws_test',70 job_name='test_job_name',71 print_log=False,72 )73 sensor.execute(None)74 # make sure we called 3 times(terminated when its completed)75 self.assertEqual(mock_describe_job.call_count, 3)76 # make sure the hook was initialized with the specific params77 calls = [mock.call(aws_conn_id='aws_test')]78 hook_init.assert_has_calls(calls)79 @mock.patch.object(SageMakerHook, 'get_conn')80 @mock.patch.object(AwsLogsHook, 'get_conn')81 @mock.patch.object(SageMakerHook, '__init__')82 @mock.patch.object(SageMakerHook, 'describe_training_job_with_log')83 @mock.patch.object(SageMakerHook, 'describe_training_job')84 def test_sensor_with_log(85 self, mock_describe_job, mock_describe_job_with_log, hook_init, mock_log_client, mock_client86 ):87 hook_init.return_value = None88 mock_describe_job.return_value = DESCRIBE_TRAINING_COMPLETED_RESPONSE89 mock_describe_job_with_log.side_effect = [90 (LogState.WAIT_IN_PROGRESS, DESCRIBE_TRAINING_INPROGRESS_RESPONSE, 0),91 (LogState.JOB_COMPLETE, DESCRIBE_TRAINING_STOPPING_RESPONSE, 0),92 (LogState.COMPLETE, DESCRIBE_TRAINING_COMPLETED_RESPONSE, 0),93 ]94 sensor = SageMakerTrainingSensor(95 task_id='test_task',96 poke_interval=2,97 aws_conn_id='aws_test',98 job_name='test_job_name',99 print_log=True,100 )101 sensor.execute(None)102 self.assertEqual(mock_describe_job_with_log.call_count, 3)103 self.assertEqual(mock_describe_job.call_count, 1)104 calls = [mock.call(aws_conn_id='aws_test')]...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require('fast-check');2const { describe } = require('fast-check-monorepo');3describe('fast-check-monorepo', () => {4 it('should work', () => {5 fc.assert(6 fc.property(fc.integer(), fc.integer(), (a, b) => {7 return a + b >= a && a + b >= b;8 })9 );10 });11});12{13 "scripts": {14 },15 "devDependencies": {16 }17}

Full Screen

Using AI Code Generation

copy

Full Screen

1const { describe } = require('fast-check');2describe('test3', () => {3 it('test3', () => {});4});5const { describe } = require('fast-check');6describe('test4', () => {7 it('test4', () => {});8});9const { describe } = require('fast-check');10describe('test5', () => {11 it('test5', () => {});12});13const { describe } = require('fast-check');14describe('test6', () => {15 it('test6', () => {});16});17const { describe } = require('fast-check');18describe('test7', () => {19 it('test7', () => {});20});21const { describe } = require('fast-check');22describe('test8', () => {23 it('test8', () => {});24});25const { describe } = require('fast-check');26describe('test9', () => {27 it('test9', () => {});28});29const { describe } = require('fast-check');30describe('test10', () => {31 it('test10', () => {});32});33const { describe } = require('fast-check');34describe('test11', () => {35 it('test11', () => {});36});37const { describe } = require('fast-check');38describe('test12', () => {39 it('test12', () => {});40});41const { describe } = require('fast-check');42describe('test13', () => {

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require("fast-check");2describe("test 3", () => {3 it("should pass", () => {4 fc.assert(5 fc.property(fc.integer(), (a) => {6 expect(a).toBeGreaterThanOrEqual(0);7 })8 );9 });10});11const fc = require("fast-check");12describe("test 4", () => {13 it("should pass", () => {14 fc.assert(15 fc.property(fc.integer(), (a) => {16 expect(a).toBeGreaterThanOrEqual(0);17 })18 );19 });20});21const fc = require("fast-check");22describe("test 5", () => {23 it("should pass", () => {24 fc.assert(25 fc.property(fc.integer(), (a) => {26 expect(a).toBeGreaterThanOrEqual(0);27 })28 );29 });30});31const fc = require("fast-check");32describe("test 6", () => {33 it("should pass", () => {34 fc.assert(35 fc.property(fc.integer(), (a) => {36 expect(a).toBeGreaterThanOrEqual(0);37 })38 );39 });40});41const fc = require("fast-check");42describe("test 7", () => {43 it("should pass", () => {44 fc.assert(45 fc.property(fc.integer(), (a) => {46 expect(a).toBeGreaterThanOrEqual(0);47 })48 );49 });50});51const fc = require("fast-check");52describe("test 8", () => {53 it("should pass", () => {54 fc.assert(55 fc.property(fc.integer(), (a) => {56 expect(a).toBeGreaterThanOrEqual(0);57 })58 );59 });60});61const fc = require("fast-check");62describe("test 9", () => {63 it("should pass", ()

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require('fast-check');2const { describe } = require('fast-check-monorepo');3describe('Testing', () => {4 it('should pass', () => {5 fc.assert(6 fc.property(fc.integer(), (a) => {7 return a >= 0;8 })9 );10 });11});

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('test3', () => {2 it('test3', () => {3 fc.assert(4 fc.property(fc.array(fc.integer()), (arr) => {5 return arr.length < 10;6 })7 );8 });9});10describe(title: string, fn: () => void): void;11it(title: string, fn: () => void): void;12before(fn: () => void): void;13after(fn: () => void): void;14beforeEach(fn: () => void): void;15afterEach(fn: () => void): void;16[MIT](

Full Screen

Using AI Code Generation

copy

Full Screen

1const { describe } = require('fast-check-monorepo');2describe('My first test', () => {3 it('should pass', () => {4 expect(true).toBe(true);5 });6});7const { describe } = require('fast-check-monorepo');8describe('My second test', () => {9 it('should pass', () => {10 expect(true).toBe(true);11 });12});13const { describe } = require('fast-check-monorepo');14describe('My third test', () => {15 it('should pass', () => {16 expect(true).toBe(true);17 });18});19const { describe } = require('fast-check-monorepo');20describe('My fourth test', () => {21 it('should pass', () => {22 expect(true).toBe(true);23 });24});25const { describe } = require('fast-check-monorepo');26describe('My fifth test', () => {27 it('should pass', () => {28 expect(true).toBe(true);29 });30});31const { describe } = require('fast-check-monorepo');32describe('My sixth test', () => {33 it('should pass', () => {34 expect(true).toBe(true);35 });36});37const { describe } = require('fast-check-monorepo');38describe('My seventh test', () => {39 it('should pass', () => {40 expect(true).toBe(true);41 });42});43const { describe } = require('fast-check-monorepo');44describe('My eighth test', () => {45 it('should pass', () => {46 expect(true).toBe(true);47 });48});49const { describe } = require('fast-check-mon

Full Screen

Using AI Code Generation

copy

Full Screen

1const { describe } = require("fast-check");2const isEvenOrOdd = require("./isEvenOrOdd");3describe("isEvenOrOdd", (it) => {4 it("should return odd if the number is odd", (fc) => {5 fc.assert(6 fc.property(fc.integer(), (num) => {7 if (num % 2 !== 0) {8 return isEvenOrOdd(num) === "odd";9 }10 })11 );12 });13 it("should return even if the number is even", (fc) => {14 fc.assert(15 fc.property(fc.integer(), (num) => {16 if (num % 2 === 0) {17 return isEvenOrOdd(num) === "even";18 }19 })20 );21 });22});23function isEvenOrOdd(num) {24 if (num % 2 === 0) return "even";25 else return "odd";26}27module.exports = isEvenOrOdd;28const { describe } = require("fast-check");29const isEvenOrOdd = require("./isEvenOrOdd");30describe("isEvenOrOdd", (it) => {31 it("should return odd if the number is odd", (fc) => {32 fc.assert(33 fc.property(fc.integer(), (num) => {34 if (num % 2 !== 0) {35 return isEvenOrOdd(num) === "odd";36 }37 })38 );39 });40 it("should return even if the number is even", (fc) => {41 fc.assert(42 fc.property(fc.integer(), (num) => {43 if (num % 2 === 0) {44 return isEvenOrOdd(num) === "even";45 }46 })47 );48 });49});

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require('fast-check');2describe('describe', () => {3 it('should run', () => {4 fc.assert(fc.property(fc.nat(), (a) => a >= 0));5 });6});7const fc = require('fast-check');8describe('describe', () => {9 it('should run', () => {10 fc.assert(fc.property(fc.nat(), (a) => a >= 0));11 });12});13const fc = require('fast-check');14describe('describe', () => {15 it('should run', () => {16 fc.assert(fc.property(fc.nat(), (a) => a >= 0));17 });18});19const fc = require('fast-check');20describe('describe', () => {21 it('should run', () => {22 fc.assert(fc.property(fc.nat(), (a) => a >= 0));23 });24});25const fc = require('fast-check');26describe('describe', () => {27 it('should run', () => {28 fc.assert(fc.property(fc.nat(), (a) => a >= 0));29 });30});31const fc = require('fast-check');32describe('describe', () => {33 it('should run', () => {34 fc.assert(fc.property(fc.nat(), (a) => a >= 0));35 });36});37const fc = require('fast-check');38describe('describe', () => {39 it('should run', () => {40 fc.assert(fc.property(fc.nat(), (a) => a >= 0));41 });42});43const fc = require('fast-check');44describe('describe', () => {45 it('should run', () => {46 fc.assert(fc.property(fc.nat(), (a) => a >= 0));

Full Screen

Using AI Code Generation

copy

Full Screen

1const { describe } = require("fast-check");2describe("test", () => {3 it("should pass", () => {});4});5describe(name: string, cb: () => void): void;6it(name: string, cb: () => void): void;7beforeEach(cb: () => void): void;8afterEach(cb: () => void): void;9beforeAll(cb: () => void): void;10afterAll(cb: () => void): void;11expect(value: any): Expectation;12interface Expectation {13 toBe(expected: any): void;14 toBeCloseTo(expected: number, precision?: number): void;15 toBeDefined(): void;16 toBeFalsy(): void;17 toBeGreaterThan(expected: number): void;18 toBeGreaterThanOrEqual(expected: number): void;19 toBeLessThan(expected: number): void;20 toBeLessThanOrEqual(expected: number): void;21 toBeNaN(): void;22 toBeNull(): void;23 toBeTruthy(): void;24 toBeUndefined(): void;25 toContain(expected: any): void;26 toContainEqual(expected: any): void;27 toEqual(expected: any): void;28 toHaveLength(expected: number): void;29 toHaveProperty(key: string | number | symbol, value?: any): void;30 toMatch(expected: string | RegExp): void;31 toMatchObject(expected: any): void;32 toStrictEqual(expected: any): void;33}

Full Screen

Using AI Code Generation

copy

Full Screen

1describe("test3", () => {2 it("test3", () => {3 expect("test3").toEqual("test3");4 });5});6describe("test4", () => {7 it("test4", () => {8 expect("test4").toEqual("test4");9 });10});11describe("test5", () => {12 it("test5", () => {13 expect("test5").toEqual("test5");14 });15});16describe("test6", () => {17 it("test6", () => {18 expect("test6").toEqual("test6");19 });20});

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 fast-check-monorepo 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