fog-cosmic 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ci.yml +29 -0
- data/.gitignore +18 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +8 -0
- data/CONTRIBUTORS.md +2 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +49 -0
- data/LICENSE.md +21 -0
- data/README.md +44 -0
- data/Rakefile +10 -0
- data/fog-cosmic.gemspec +32 -0
- data/lib/fog/cosmic.rb +45 -0
- data/lib/fog/cosmic/compute.rb +861 -0
- data/lib/fog/cosmic/models/compute/address.rb +17 -0
- data/lib/fog/cosmic/models/compute/disk_offering.rb +44 -0
- data/lib/fog/cosmic/models/compute/disk_offerings.rb +24 -0
- data/lib/fog/cosmic/models/compute/egress_firewall_rule.rb +38 -0
- data/lib/fog/cosmic/models/compute/egress_firewall_rules.rb +25 -0
- data/lib/fog/cosmic/models/compute/firewall_rule.rb +24 -0
- data/lib/fog/cosmic/models/compute/firewall_rules.rb +25 -0
- data/lib/fog/cosmic/models/compute/flavor.rb +36 -0
- data/lib/fog/cosmic/models/compute/flavors.rb +25 -0
- data/lib/fog/cosmic/models/compute/image.rb +72 -0
- data/lib/fog/cosmic/models/compute/images.rb +37 -0
- data/lib/fog/cosmic/models/compute/job.rb +51 -0
- data/lib/fog/cosmic/models/compute/jobs.rb +25 -0
- data/lib/fog/cosmic/models/compute/network.rb +73 -0
- data/lib/fog/cosmic/models/compute/network_offering.rb +25 -0
- data/lib/fog/cosmic/models/compute/network_offerings.rb +39 -0
- data/lib/fog/cosmic/models/compute/networks.rb +38 -0
- data/lib/fog/cosmic/models/compute/port_forwarding_rule.rb +25 -0
- data/lib/fog/cosmic/models/compute/port_forwarding_rules.rb +25 -0
- data/lib/fog/cosmic/models/compute/project.rb +58 -0
- data/lib/fog/cosmic/models/compute/projects.rb +39 -0
- data/lib/fog/cosmic/models/compute/public_ip_address.rb +96 -0
- data/lib/fog/cosmic/models/compute/public_ip_addresses.rb +27 -0
- data/lib/fog/cosmic/models/compute/server.rb +151 -0
- data/lib/fog/cosmic/models/compute/servers.rb +39 -0
- data/lib/fog/cosmic/models/compute/snapshot.rb +46 -0
- data/lib/fog/cosmic/models/compute/snapshots.rb +23 -0
- data/lib/fog/cosmic/models/compute/volume.rb +121 -0
- data/lib/fog/cosmic/models/compute/volumes.rb +26 -0
- data/lib/fog/cosmic/models/compute/zone.rb +36 -0
- data/lib/fog/cosmic/models/compute/zones.rb +29 -0
- data/lib/fog/cosmic/requests/compute/activate_project.rb +25 -0
- data/lib/fog/cosmic/requests/compute/add_account_to_project.rb +25 -0
- data/lib/fog/cosmic/requests/compute/add_cluster.rb +29 -0
- data/lib/fog/cosmic/requests/compute/add_guest_os.rb +26 -0
- data/lib/fog/cosmic/requests/compute/add_guest_os_mapping.rb +27 -0
- data/lib/fog/cosmic/requests/compute/add_host.rb +30 -0
- data/lib/fog/cosmic/requests/compute/add_image_store.rb +25 -0
- data/lib/fog/cosmic/requests/compute/add_ip_to_nic.rb +25 -0
- data/lib/fog/cosmic/requests/compute/add_ldap_configuration.rb +26 -0
- data/lib/fog/cosmic/requests/compute/add_network_device.rb +24 -0
- data/lib/fog/cosmic/requests/compute/add_network_service_provider.rb +26 -0
- data/lib/fog/cosmic/requests/compute/add_nic_to_virtual_machine.rb +26 -0
- data/lib/fog/cosmic/requests/compute/add_nicira_nvp_device.rb +29 -0
- data/lib/fog/cosmic/requests/compute/add_region.rb +27 -0
- data/lib/fog/cosmic/requests/compute/add_resource_detail.rb +27 -0
- data/lib/fog/cosmic/requests/compute/add_secondary_storage.rb +25 -0
- data/lib/fog/cosmic/requests/compute/add_traffic_type.rb +26 -0
- data/lib/fog/cosmic/requests/compute/add_vpn_user.rb +26 -0
- data/lib/fog/cosmic/requests/compute/archive_alerts.rb +24 -0
- data/lib/fog/cosmic/requests/compute/archive_events.rb +24 -0
- data/lib/fog/cosmic/requests/compute/assign_cert_to_load_balancer.rb +26 -0
- data/lib/fog/cosmic/requests/compute/assign_to_load_balancer_rule.rb +25 -0
- data/lib/fog/cosmic/requests/compute/assign_virtual_machine.rb +27 -0
- data/lib/fog/cosmic/requests/compute/associate_ip_address.rb +55 -0
- data/lib/fog/cosmic/requests/compute/attach_iso.rb +26 -0
- data/lib/fog/cosmic/requests/compute/attach_volume.rb +76 -0
- data/lib/fog/cosmic/requests/compute/cancel_host_maintenance.rb +25 -0
- data/lib/fog/cosmic/requests/compute/cancel_storage_maintenance.rb +25 -0
- data/lib/fog/cosmic/requests/compute/change_service_for_router.rb +26 -0
- data/lib/fog/cosmic/requests/compute/change_service_for_system_vm.rb +26 -0
- data/lib/fog/cosmic/requests/compute/change_service_for_virtual_machine.rb +26 -0
- data/lib/fog/cosmic/requests/compute/clean_vmreservations.rb +24 -0
- data/lib/fog/cosmic/requests/compute/configure_virtual_router_element.rb +26 -0
- data/lib/fog/cosmic/requests/compute/copy_iso.rb +26 -0
- data/lib/fog/cosmic/requests/compute/copy_template.rb +26 -0
- data/lib/fog/cosmic/requests/compute/create_account.rb +30 -0
- data/lib/fog/cosmic/requests/compute/create_affinity_group.rb +26 -0
- data/lib/fog/cosmic/requests/compute/create_disk_offering.rb +56 -0
- data/lib/fog/cosmic/requests/compute/create_domain.rb +25 -0
- data/lib/fog/cosmic/requests/compute/create_egress_firewall_rule.rb +44 -0
- data/lib/fog/cosmic/requests/compute/create_firewall_rule.rb +48 -0
- data/lib/fog/cosmic/requests/compute/create_instance_group.rb +25 -0
- data/lib/fog/cosmic/requests/compute/create_ip_forwarding_rule.rb +27 -0
- data/lib/fog/cosmic/requests/compute/create_lb_health_check_policy.rb +25 -0
- data/lib/fog/cosmic/requests/compute/create_lb_stickiness_policy.rb +27 -0
- data/lib/fog/cosmic/requests/compute/create_load_balancer_rule.rb +28 -0
- data/lib/fog/cosmic/requests/compute/create_network.rb +30 -0
- data/lib/fog/cosmic/requests/compute/create_network_acl.rb +25 -0
- data/lib/fog/cosmic/requests/compute/create_network_acl_list.rb +26 -0
- data/lib/fog/cosmic/requests/compute/create_network_offering.rb +55 -0
- data/lib/fog/cosmic/requests/compute/create_physical_network.rb +26 -0
- data/lib/fog/cosmic/requests/compute/create_pod.rb +29 -0
- data/lib/fog/cosmic/requests/compute/create_port_forwarding_rule.rb +55 -0
- data/lib/fog/cosmic/requests/compute/create_private_gateway.rb +29 -0
- data/lib/fog/cosmic/requests/compute/create_project.rb +26 -0
- data/lib/fog/cosmic/requests/compute/create_remote_access_vpn.rb +25 -0
- data/lib/fog/cosmic/requests/compute/create_secondary_staging_store.rb +25 -0
- data/lib/fog/cosmic/requests/compute/create_service_offering.rb +55 -0
- data/lib/fog/cosmic/requests/compute/create_snapshot.rb +48 -0
- data/lib/fog/cosmic/requests/compute/create_ssh_key_pair.rb +27 -0
- data/lib/fog/cosmic/requests/compute/create_static_route.rb +26 -0
- data/lib/fog/cosmic/requests/compute/create_storage_network_ip_range.rb +28 -0
- data/lib/fog/cosmic/requests/compute/create_storage_pool.rb +27 -0
- data/lib/fog/cosmic/requests/compute/create_tags.rb +27 -0
- data/lib/fog/cosmic/requests/compute/create_template.rb +27 -0
- data/lib/fog/cosmic/requests/compute/create_user.rb +30 -0
- data/lib/fog/cosmic/requests/compute/create_virtual_router_element.rb +25 -0
- data/lib/fog/cosmic/requests/compute/create_vlan_ip_range.rb +24 -0
- data/lib/fog/cosmic/requests/compute/create_vm_snapshot.rb +25 -0
- data/lib/fog/cosmic/requests/compute/create_volume.rb +69 -0
- data/lib/fog/cosmic/requests/compute/create_vpc.rb +29 -0
- data/lib/fog/cosmic/requests/compute/create_vpcoffering.rb +27 -0
- data/lib/fog/cosmic/requests/compute/create_vpn_connection.rb +26 -0
- data/lib/fog/cosmic/requests/compute/create_vpn_customer_gateway.rb +29 -0
- data/lib/fog/cosmic/requests/compute/create_vpn_gateway.rb +25 -0
- data/lib/fog/cosmic/requests/compute/create_zone.rb +28 -0
- data/lib/fog/cosmic/requests/compute/dedicate_cluster.rb +26 -0
- data/lib/fog/cosmic/requests/compute/dedicate_guest_vlan_range.rb +28 -0
- data/lib/fog/cosmic/requests/compute/dedicate_host.rb +26 -0
- data/lib/fog/cosmic/requests/compute/dedicate_pod.rb +26 -0
- data/lib/fog/cosmic/requests/compute/dedicate_public_ip_range.rb +27 -0
- data/lib/fog/cosmic/requests/compute/dedicate_zone.rb +26 -0
- data/lib/fog/cosmic/requests/compute/delete_account.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_account_from_project.rb +26 -0
- data/lib/fog/cosmic/requests/compute/delete_affinity_group.rb +24 -0
- data/lib/fog/cosmic/requests/compute/delete_alerts.rb +24 -0
- data/lib/fog/cosmic/requests/compute/delete_cluster.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_disk_offering.rb +33 -0
- data/lib/fog/cosmic/requests/compute/delete_domain.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_egress_firewall_rule.rb +34 -0
- data/lib/fog/cosmic/requests/compute/delete_events.rb +24 -0
- data/lib/fog/cosmic/requests/compute/delete_firewall_rule.rb +34 -0
- data/lib/fog/cosmic/requests/compute/delete_host.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_image_store.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_instance_group.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_ip_forwarding_rule.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_iso.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_lb_health_check_policy.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_lb_stickiness_policy.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_ldap_configuration.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_load_balancer_rule.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_network.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_network_acl.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_network_acl_list.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_network_device.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_network_offering.rb +34 -0
- data/lib/fog/cosmic/requests/compute/delete_network_service_provider.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_nicira_nvp_device.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_physical_network.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_pod.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_port_forwarding_rule.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_private_gateway.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_project.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_project_invitation.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_remote_access_vpn.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_secondary_staging_store.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_service_offering.rb +34 -0
- data/lib/fog/cosmic/requests/compute/delete_snapshot.rb +61 -0
- data/lib/fog/cosmic/requests/compute/delete_ssh_key_pair.rb +27 -0
- data/lib/fog/cosmic/requests/compute/delete_ssl_cert.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_static_route.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_storage_network_ip_range.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_storage_pool.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_tags.rb +26 -0
- data/lib/fog/cosmic/requests/compute/delete_template.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_traffic_type.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_user.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_vlan_ip_range.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_vm_snapshot.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_volume.rb +45 -0
- data/lib/fog/cosmic/requests/compute/delete_vpc.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_vpcoffering.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_vpn_connection.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_vpn_customer_gateway.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_vpn_gateway.rb +25 -0
- data/lib/fog/cosmic/requests/compute/delete_zone.rb +25 -0
- data/lib/fog/cosmic/requests/compute/deploy_virtual_machine.rb +127 -0
- data/lib/fog/cosmic/requests/compute/destroy_router.rb +25 -0
- data/lib/fog/cosmic/requests/compute/destroy_system_vm.rb +25 -0
- data/lib/fog/cosmic/requests/compute/destroy_virtual_machine.rb +54 -0
- data/lib/fog/cosmic/requests/compute/detach_iso.rb +25 -0
- data/lib/fog/cosmic/requests/compute/detach_volume.rb +64 -0
- data/lib/fog/cosmic/requests/compute/disable_account.rb +25 -0
- data/lib/fog/cosmic/requests/compute/disable_static_nat.rb +51 -0
- data/lib/fog/cosmic/requests/compute/disable_user.rb +25 -0
- data/lib/fog/cosmic/requests/compute/disassociate_ip_address.rb +35 -0
- data/lib/fog/cosmic/requests/compute/enable_account.rb +24 -0
- data/lib/fog/cosmic/requests/compute/enable_static_nat.rb +69 -0
- data/lib/fog/cosmic/requests/compute/enable_storage_maintenance.rb +25 -0
- data/lib/fog/cosmic/requests/compute/enable_user.rb +25 -0
- data/lib/fog/cosmic/requests/compute/expunge_virtual_machine.rb +25 -0
- data/lib/fog/cosmic/requests/compute/extract_iso.rb +26 -0
- data/lib/fog/cosmic/requests/compute/extract_template.rb +65 -0
- data/lib/fog/cosmic/requests/compute/extract_volume.rb +27 -0
- data/lib/fog/cosmic/requests/compute/find_hosts_for_migration.rb +25 -0
- data/lib/fog/cosmic/requests/compute/find_storage_pools_for_migration.rb +25 -0
- data/lib/fog/cosmic/requests/compute/generate_alert.rb +27 -0
- data/lib/fog/cosmic/requests/compute/get_api_limit.rb +24 -0
- data/lib/fog/cosmic/requests/compute/get_cloud_identifier.rb +25 -0
- data/lib/fog/cosmic/requests/compute/get_user.rb +25 -0
- data/lib/fog/cosmic/requests/compute/get_virtual_machine_user_data.rb +25 -0
- data/lib/fog/cosmic/requests/compute/get_vm_password.rb +25 -0
- data/lib/fog/cosmic/requests/compute/import_ldap_users.rb +25 -0
- data/lib/fog/cosmic/requests/compute/ldap_create_account.rb +26 -0
- data/lib/fog/cosmic/requests/compute/list_accounts.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_affinity_group_types.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_affinity_groups.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_alerts.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_apis.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_async_jobs.rb +36 -0
- data/lib/fog/cosmic/requests/compute/list_capabilities.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_capacity.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_clusters.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_configurations.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_dedicated_clusters.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_dedicated_guest_vlan_ranges.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_dedicated_hosts.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_dedicated_pods.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_dedicated_zones.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_deployment_planners.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_disk_offerings.rb +32 -0
- data/lib/fog/cosmic/requests/compute/list_domain_children.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_domains.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_egress_firewall_rules.rb +35 -0
- data/lib/fog/cosmic/requests/compute/list_event_types.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_events.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_firewall_rules.rb +35 -0
- data/lib/fog/cosmic/requests/compute/list_guest_os_mapping.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_hosts.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_hypervisor_capabilities.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_hypervisors.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_image_stores.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_instance_groups.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_ip_forwarding_rules.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_iso_permissions.rb +25 -0
- data/lib/fog/cosmic/requests/compute/list_isos.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_lb_health_check_policies.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_lb_stickiness_policies.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_ldap_configurations.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_ldap_users.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_load_balancer_rule_instances.rb +25 -0
- data/lib/fog/cosmic/requests/compute/list_load_balancer_rules.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_network_acl_lists.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_network_acls.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_network_device.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_network_isolation_methods.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_network_offerings.rb +31 -0
- data/lib/fog/cosmic/requests/compute/list_network_service_providers.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_networks.rb +28 -0
- data/lib/fog/cosmic/requests/compute/list_nicira_nvp_device_networks.rb +25 -0
- data/lib/fog/cosmic/requests/compute/list_nicira_nvp_devices.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_nics.rb +25 -0
- data/lib/fog/cosmic/requests/compute/list_os_categories.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_os_types.rb +32 -0
- data/lib/fog/cosmic/requests/compute/list_physical_networks.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_pods.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_port_forwarding_rules.rb +40 -0
- data/lib/fog/cosmic/requests/compute/list_private_gateways.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_project_accounts.rb +25 -0
- data/lib/fog/cosmic/requests/compute/list_project_invitations.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_projects.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_public_ip_addresses.rb +45 -0
- data/lib/fog/cosmic/requests/compute/list_regions.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_remote_access_vpns.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_resource_details.rb +25 -0
- data/lib/fog/cosmic/requests/compute/list_resource_limits.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_routers.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_secondary_staging_stores.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_service_offerings.rb +44 -0
- data/lib/fog/cosmic/requests/compute/list_snapshots.rb +43 -0
- data/lib/fog/cosmic/requests/compute/list_ssh_key_pairs.rb +26 -0
- data/lib/fog/cosmic/requests/compute/list_ssl_certs.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_static_routes.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_storage_network_ip_range.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_storage_pools.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_storage_providers.rb +25 -0
- data/lib/fog/cosmic/requests/compute/list_supported_network_services.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_system_vms.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_tags.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_template_permissions.rb +25 -0
- data/lib/fog/cosmic/requests/compute/list_templates.rb +42 -0
- data/lib/fog/cosmic/requests/compute/list_traffic_types.rb +25 -0
- data/lib/fog/cosmic/requests/compute/list_users.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_virtual_machines.rb +32 -0
- data/lib/fog/cosmic/requests/compute/list_virtual_router_elements.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_vlan_ip_ranges.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_vm_snapshot.rb +26 -0
- data/lib/fog/cosmic/requests/compute/list_volumes.rb +43 -0
- data/lib/fog/cosmic/requests/compute/list_vpc_offerings.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_vpcs.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_vpn_connections.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_vpn_customer_gateways.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_vpn_gateways.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_vpn_users.rb +24 -0
- data/lib/fog/cosmic/requests/compute/list_zones.rb +37 -0
- data/lib/fog/cosmic/requests/compute/lock_account.rb +26 -0
- data/lib/fog/cosmic/requests/compute/lock_user.rb +25 -0
- data/lib/fog/cosmic/requests/compute/mark_default_zone_for_account.rb +27 -0
- data/lib/fog/cosmic/requests/compute/migrate_system_vm.rb +26 -0
- data/lib/fog/cosmic/requests/compute/migrate_virtual_machine.rb +25 -0
- data/lib/fog/cosmic/requests/compute/migrate_virtual_machine_with_volume.rb +26 -0
- data/lib/fog/cosmic/requests/compute/migrate_volume.rb +26 -0
- data/lib/fog/cosmic/requests/compute/prepare_host_for_maintenance.rb +25 -0
- data/lib/fog/cosmic/requests/compute/prepare_template.rb +26 -0
- data/lib/fog/cosmic/requests/compute/query_async_job_result.rb +38 -0
- data/lib/fog/cosmic/requests/compute/reboot_router.rb +25 -0
- data/lib/fog/cosmic/requests/compute/reboot_system_vm.rb +25 -0
- data/lib/fog/cosmic/requests/compute/reboot_virtual_machine.rb +35 -0
- data/lib/fog/cosmic/requests/compute/reconnect_host.rb +25 -0
- data/lib/fog/cosmic/requests/compute/recover_virtual_machine.rb +25 -0
- data/lib/fog/cosmic/requests/compute/register_iso.rb +28 -0
- data/lib/fog/cosmic/requests/compute/register_ssh_key_pair.rb +28 -0
- data/lib/fog/cosmic/requests/compute/register_template.rb +45 -0
- data/lib/fog/cosmic/requests/compute/register_user_keys.rb +25 -0
- data/lib/fog/cosmic/requests/compute/release_dedicated_cluster.rb +25 -0
- data/lib/fog/cosmic/requests/compute/release_dedicated_guest_vlan_range.rb +25 -0
- data/lib/fog/cosmic/requests/compute/release_dedicated_host.rb +25 -0
- data/lib/fog/cosmic/requests/compute/release_dedicated_pod.rb +25 -0
- data/lib/fog/cosmic/requests/compute/release_dedicated_zone.rb +25 -0
- data/lib/fog/cosmic/requests/compute/release_host_reservation.rb +25 -0
- data/lib/fog/cosmic/requests/compute/release_public_ip_range.rb +25 -0
- data/lib/fog/cosmic/requests/compute/remove_cert_from_load_balancer.rb +25 -0
- data/lib/fog/cosmic/requests/compute/remove_from_load_balancer_rule.rb +25 -0
- data/lib/fog/cosmic/requests/compute/remove_guest_os.rb +25 -0
- data/lib/fog/cosmic/requests/compute/remove_guest_os_mapping.rb +25 -0
- data/lib/fog/cosmic/requests/compute/remove_ip_from_nic.rb +25 -0
- data/lib/fog/cosmic/requests/compute/remove_nic_from_virtual_machine.rb +26 -0
- data/lib/fog/cosmic/requests/compute/remove_region.rb +25 -0
- data/lib/fog/cosmic/requests/compute/remove_resource_detail.rb +26 -0
- data/lib/fog/cosmic/requests/compute/remove_vpn_user.rb +25 -0
- data/lib/fog/cosmic/requests/compute/replace_network_acl_list.rb +25 -0
- data/lib/fog/cosmic/requests/compute/reset_api_limit.rb +24 -0
- data/lib/fog/cosmic/requests/compute/reset_password_for_virtual_machine.rb +25 -0
- data/lib/fog/cosmic/requests/compute/reset_ssh_key_for_virtual_machine.rb +28 -0
- data/lib/fog/cosmic/requests/compute/reset_vpn_connection.rb +25 -0
- data/lib/fog/cosmic/requests/compute/resize_volume.rb +25 -0
- data/lib/fog/cosmic/requests/compute/restart_network.rb +25 -0
- data/lib/fog/cosmic/requests/compute/restart_vpc.rb +25 -0
- data/lib/fog/cosmic/requests/compute/restore_virtual_machine.rb +25 -0
- data/lib/fog/cosmic/requests/compute/revert_snapshot.rb +25 -0
- data/lib/fog/cosmic/requests/compute/revert_to_vm_snapshot.rb +25 -0
- data/lib/fog/cosmic/requests/compute/scale_system_vm.rb +26 -0
- data/lib/fog/cosmic/requests/compute/scale_virtual_machine.rb +26 -0
- data/lib/fog/cosmic/requests/compute/start_router.rb +25 -0
- data/lib/fog/cosmic/requests/compute/start_system_vm.rb +25 -0
- data/lib/fog/cosmic/requests/compute/start_virtual_machine.rb +25 -0
- data/lib/fog/cosmic/requests/compute/stop_router.rb +25 -0
- data/lib/fog/cosmic/requests/compute/stop_system_vm.rb +25 -0
- data/lib/fog/cosmic/requests/compute/stop_virtual_machine.rb +25 -0
- data/lib/fog/cosmic/requests/compute/suspend_project.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_account.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_cluster.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_configuration.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_default_nic_for_virtual_machine.rb +26 -0
- data/lib/fog/cosmic/requests/compute/update_disk_offering.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_domain.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_egress_firewall_rule.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_firewall_rule.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_guest_os.rb +26 -0
- data/lib/fog/cosmic/requests/compute/update_guest_os_mapping.rb +26 -0
- data/lib/fog/cosmic/requests/compute/update_host.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_host_password.rb +26 -0
- data/lib/fog/cosmic/requests/compute/update_hypervisor_capabilities.rb +24 -0
- data/lib/fog/cosmic/requests/compute/update_instance_group.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_ip_address.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_iso.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_iso_permissions.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_lb_health_check_policy.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_lb_stickiness_policy.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_load_balancer_rule.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_network.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_network_acl_item.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_network_acl_list.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_network_offering.rb +24 -0
- data/lib/fog/cosmic/requests/compute/update_network_service_provider.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_physical_network.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_pod.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_port_forwarding_rule.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_project.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_project_invitation.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_region.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_remote_access_vpn.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_resource_count.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_resource_limit.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_service_offering.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_storage_network_ip_range.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_storage_pool.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_template.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_template_permissions.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_user.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_virtual_machine.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_vm_affinity_group.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_volume.rb +24 -0
- data/lib/fog/cosmic/requests/compute/update_vpc.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_vpcoffering.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_vpn_connection.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_vpn_customer_gateway.rb +30 -0
- data/lib/fog/cosmic/requests/compute/update_vpn_gateway.rb +25 -0
- data/lib/fog/cosmic/requests/compute/update_zone.rb +25 -0
- data/lib/fog/cosmic/requests/compute/upgrade_router_template.rb +24 -0
- data/lib/fog/cosmic/requests/compute/upload_custom_certificate.rb +26 -0
- data/lib/fog/cosmic/requests/compute/upload_ssl_cert.rb +26 -0
- data/lib/fog/cosmic/requests/compute/upload_volume.rb +30 -0
- data/lib/fog/cosmic/version.rb +5 -0
- data/tests/compute/models/disk_offering_tests.rb +7 -0
- data/tests/compute/models/egress_firewall_rule_tests.rb +9 -0
- data/tests/compute/models/public_ip_address_tests.rb +42 -0
- data/tests/compute/models/public_ip_addresses_tests.rb +3 -0
- data/tests/compute/models/server_tests.rb +20 -0
- data/tests/compute/models/snapshot_tests.rb +17 -0
- data/tests/compute/models/volume_tests.rb +46 -0
- data/tests/compute/models/volumes_tests.rb +14 -0
- data/tests/helper.rb +5 -0
- data/tests/helpers/collection_helper.rb +91 -0
- data/tests/helpers/formats_helper.rb +98 -0
- data/tests/helpers/mock_helper.rb +20 -0
- data/tests/helpers/model_helper.rb +31 -0
- data/tests/helpers/responds_to_helper.rb +11 -0
- data/tests/helpers/succeeds_helper.rb +9 -0
- data/tests/requests/disk_offering_tests.rb +29 -0
- data/tests/requests/egress_firewall_rule_tests.rb +25 -0
- data/tests/requests/firewall_rule_tests.rb +29 -0
- data/tests/requests/network_offering_tests.rb +32 -0
- data/tests/requests/os_type_tests.rb +37 -0
- data/tests/requests/port_forwarding_rule_tests.rb +33 -0
- data/tests/requests/public_ip_address_tests.rb +38 -0
- data/tests/requests/service_offering_tests.rb +31 -0
- data/tests/requests/snapshot_tests.rb +32 -0
- data/tests/requests/ssh_key_pair_tests.rb +23 -0
- data/tests/requests/template_tests.rb +52 -0
- data/tests/requests/virtual_machine_tests.rb +66 -0
- data/tests/requests/volume_tests.rb +47 -0
- data/tests/requests/zone_tests.rb +32 -0
- data/tests/signed_params_tests.rb +12 -0
- metadata +583 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
|
5
|
+
class Real
|
6
|
+
# Updates a Zone.
|
7
|
+
#
|
8
|
+
# {Cosmic API Reference}[https://apidoc.mcc.schubergphilis.com/root_admin/updateZone.html]
|
9
|
+
def update_zone(*args)
|
10
|
+
options = {}
|
11
|
+
if args[0].is_a? Hash
|
12
|
+
options = args[0]
|
13
|
+
options.merge!('command' => 'updateZone')
|
14
|
+
else
|
15
|
+
options.merge!('command' => 'updateZone',
|
16
|
+
'id' => args[0])
|
17
|
+
end
|
18
|
+
request(options)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
|
5
|
+
class Real
|
6
|
+
# Upgrades router to use newer template
|
7
|
+
#
|
8
|
+
# {Cosmic API Reference}[https://apidoc.mcc.schubergphilis.com/root_admin/upgradeRouterTemplate.html]
|
9
|
+
def upgrade_router_template(*args)
|
10
|
+
options = {}
|
11
|
+
if args[0].is_a? Hash
|
12
|
+
options = args[0]
|
13
|
+
options.merge!('command' => 'upgradeRouterTemplate')
|
14
|
+
else
|
15
|
+
options.merge!('command' => 'upgradeRouterTemplate')
|
16
|
+
end
|
17
|
+
request(options)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
|
5
|
+
class Real
|
6
|
+
# Uploads a custom certificate for the console proxy VMs to use for SSL. Can be used to upload a single certificate signed by a known CA. Can also be used, through multiple calls, to upload a chain of certificates from CA to the custom certificate itself.
|
7
|
+
#
|
8
|
+
# {Cosmic API Reference}[https://apidoc.mcc.schubergphilis.com/root_admin/uploadCustomCertificate.html]
|
9
|
+
def upload_custom_certificate(*args)
|
10
|
+
options = {}
|
11
|
+
if args[0].is_a? Hash
|
12
|
+
options = args[0]
|
13
|
+
options.merge!('command' => 'uploadCustomCertificate')
|
14
|
+
else
|
15
|
+
options.merge!('command' => 'uploadCustomCertificate',
|
16
|
+
'domainsuffix' => args[0],
|
17
|
+
'certificate' => args[1])
|
18
|
+
end
|
19
|
+
request(options)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
|
5
|
+
class Real
|
6
|
+
# Upload a certificate to Cosmic
|
7
|
+
#
|
8
|
+
# {Cosmic API Reference}[https://apidoc.mcc.schubergphilis.com/root_admin/uploadSslCert.html]
|
9
|
+
def upload_ssl_cert(*args)
|
10
|
+
options = {}
|
11
|
+
if args[0].is_a? Hash
|
12
|
+
options = args[0]
|
13
|
+
options.merge!('command' => 'uploadSslCert')
|
14
|
+
else
|
15
|
+
options.merge!('command' => 'uploadSslCert',
|
16
|
+
'certificate' => args[0],
|
17
|
+
'privatekey' => args[1])
|
18
|
+
end
|
19
|
+
request(options)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
|
5
|
+
class Real
|
6
|
+
# Uploads a data disk.
|
7
|
+
#
|
8
|
+
# {Cosmic API Reference}[https://apidoc.mcc.schubergphilis.com/root_admin/uploadVolume.html]
|
9
|
+
def upload_volume(*args)
|
10
|
+
options = {}
|
11
|
+
if args[0].is_a? Hash
|
12
|
+
options = args[0]
|
13
|
+
options.merge!('command' => 'uploadVolume')
|
14
|
+
else
|
15
|
+
options.merge!('command' => 'uploadVolume',
|
16
|
+
'url' => args[0],
|
17
|
+
'format' => args[1],
|
18
|
+
'zoneid' => args[2],
|
19
|
+
'name' => args[3])
|
20
|
+
end
|
21
|
+
# add project id if we have one
|
22
|
+
@cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
|
23
|
+
request(options)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Shindo.tests("Fog::Compute[:cosmic] | egress_firewall_rule", ['cosmic']) do
|
2
|
+
@params = {
|
3
|
+
:protocol => "tcp",
|
4
|
+
:network_id => "8aacae29-e0a4-4b7b-8a7a-3ee11cfb4362",
|
5
|
+
:cidr_list =>"10.1.1.0/24"
|
6
|
+
}
|
7
|
+
|
8
|
+
model_tests(Fog::Compute[:cosmic].egress_firewall_rules, @params, true)
|
9
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
Shindo.tests("Fog::Compute[:cosmic] | public_ip_address", ['cosmic']) do
|
2
|
+
@params = {}.tap do |hash|
|
3
|
+
[:zone_id].each do |k|
|
4
|
+
key = "cosmic_#{k}".to_sym
|
5
|
+
if Fog.credentials[key]
|
6
|
+
hash[k]= Fog.credentials[key]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
@server_attributes = {}.tap do |hash|
|
12
|
+
[:zone_id, :network_ids, :template_id, :service_offering_id].each do |k|
|
13
|
+
key = "cosmic_#{k}".to_sym
|
14
|
+
if Fog.credentials[key]
|
15
|
+
hash[k]= Fog.credentials[key]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
model_tests(Fog::Compute[:cosmic].public_ip_addresses, @params, true) do
|
21
|
+
@server = Fog::Compute[:cosmic].servers.create(@server_attributes)
|
22
|
+
@server.wait_for { ready? }
|
23
|
+
|
24
|
+
tests('#server=').succeeds do
|
25
|
+
@instance.server = @server
|
26
|
+
end
|
27
|
+
|
28
|
+
tests('#server') do
|
29
|
+
test(' == @server') do
|
30
|
+
@instance.reload
|
31
|
+
@instance.server_id == @server.id
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
test('#server = nil') do
|
36
|
+
@instance.server = nil
|
37
|
+
@instance.server_id.nil?
|
38
|
+
end
|
39
|
+
|
40
|
+
@server.destroy
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Shindo.tests("Fog::Compute[:cosmic] | servers", ['cosmic']) do
|
2
|
+
@server_params = {}.tap do |hash|
|
3
|
+
[:zone_id, :network_ids, :template_id, :service_offering_id].each do |k|
|
4
|
+
key = "cosmic_#{k}".to_sym
|
5
|
+
if Fog.credentials[key]
|
6
|
+
hash[k]= Fog.credentials[key]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
@server = Fog::Compute[:cosmic].servers.create(@server_params)
|
11
|
+
|
12
|
+
tests('#create').succeeds do
|
13
|
+
@server.wait_for { ready? }
|
14
|
+
end
|
15
|
+
|
16
|
+
tests('#destroy').succeeds do
|
17
|
+
@server.destroy.wait_for { ready? }
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Shindo.tests("Fog::Compute[:cosmic] | snapshot", ['cosmic']) do
|
2
|
+
@params = {:volume_id => "89198f7c-0245-aa1d-136a-c5f479ef9db7"}.tap do |hash|
|
3
|
+
[:volume_id, :domain_id, :policy_id].each do |k|
|
4
|
+
key = "cosmic_#{k}".to_sym
|
5
|
+
if Fog.credentials[key]
|
6
|
+
hash[k]= Fog.credentials[key]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
model_tests(Fog::Compute[:cosmic].snapshots, @params, true)
|
12
|
+
|
13
|
+
tests('has volume relation') do
|
14
|
+
responds_to(:volume)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
def volume_tests(connection, params, mocks_implemented = true)
|
2
|
+
model_tests(connection.volumes, params[:volume_attributes], mocks_implemented) do
|
3
|
+
if !Fog.mocking? || mocks_implemented
|
4
|
+
@instance.wait_for { ready? }
|
5
|
+
end
|
6
|
+
|
7
|
+
@server = @instance.service.servers.create(params[:server_attributes])
|
8
|
+
@server.wait_for { ready? }
|
9
|
+
|
10
|
+
tests('attach').succeeds do
|
11
|
+
@instance.attach(@server)
|
12
|
+
end
|
13
|
+
|
14
|
+
tests('detach').succeeds do
|
15
|
+
@instance.detach
|
16
|
+
end
|
17
|
+
|
18
|
+
@server.destroy
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
Shindo.tests("Fog::Compute[:cosmic] | volume", ['cosmic']) do
|
23
|
+
@params = {
|
24
|
+
:volume_attributes => {:name => "somevolume"}.tap do |hash|
|
25
|
+
[:zone_id, :disk_offering_id].each do |k|
|
26
|
+
key = "cosmic_#{k}".to_sym
|
27
|
+
if Fog.credentials[key]
|
28
|
+
hash[k]= Fog.credentials[key]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end,
|
32
|
+
:server_attributes => {}.tap do |hash|
|
33
|
+
[:zone_id, :network_ids, :template_id, :service_offering_id].each do |k|
|
34
|
+
key = "cosmic_#{k}".to_sym
|
35
|
+
if Fog.credentials[key]
|
36
|
+
hash[k]= Fog.credentials[key]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
}
|
41
|
+
|
42
|
+
volume_tests(Fog::Compute[:cosmic], @params, true) do
|
43
|
+
responds_to(:ready?)
|
44
|
+
responds_to(:flavor)
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Shindo.tests("Fog::Compute[:cosmic] | volumes", ['cosmic']) do
|
2
|
+
@params = {:name => "somevolume"}.tap do |hash|
|
3
|
+
[:zone_id, :disk_offering_id].each do |k|
|
4
|
+
key = "cosmic_#{k}".to_sym
|
5
|
+
if Fog.credentials[key]
|
6
|
+
hash[k]= Fog.credentials[key]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
collection_tests(Fog::Compute[:cosmic].volumes, @params, true) do
|
12
|
+
@instance.wait_for { ready? }
|
13
|
+
end
|
14
|
+
end
|
data/tests/helper.rb
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
def collection_tests(collection, params = {}, mocks_implemented = true)
|
2
|
+
tests('success') do
|
3
|
+
|
4
|
+
tests("#new(#{params.inspect})").succeeds do
|
5
|
+
pending if Fog.mocking? && !mocks_implemented
|
6
|
+
collection.new(params)
|
7
|
+
end
|
8
|
+
|
9
|
+
tests("#create(#{params.inspect})").succeeds do
|
10
|
+
pending if Fog.mocking? && !mocks_implemented
|
11
|
+
@instance = collection.create(params)
|
12
|
+
end
|
13
|
+
# FIXME: work around for timing issue on AWS describe_instances mocks
|
14
|
+
|
15
|
+
if Fog.mocking? && @instance.respond_to?(:ready?)
|
16
|
+
@instance.wait_for { ready? }
|
17
|
+
end
|
18
|
+
|
19
|
+
tests("#all").succeeds do
|
20
|
+
pending if Fog.mocking? && !mocks_implemented
|
21
|
+
collection.all
|
22
|
+
end
|
23
|
+
|
24
|
+
if !Fog.mocking? || mocks_implemented
|
25
|
+
@identity = @instance.identity
|
26
|
+
end
|
27
|
+
|
28
|
+
tests("#get(#{@identity})").succeeds do
|
29
|
+
pending if Fog.mocking? && !mocks_implemented
|
30
|
+
collection.get(@identity)
|
31
|
+
end
|
32
|
+
|
33
|
+
tests('Enumerable') do
|
34
|
+
pending if Fog.mocking? && !mocks_implemented
|
35
|
+
|
36
|
+
methods = [
|
37
|
+
'all?', 'any?', 'find', 'detect', 'collect', 'map',
|
38
|
+
'find_index', 'flat_map', 'collect_concat', 'group_by',
|
39
|
+
'none?', 'one?'
|
40
|
+
]
|
41
|
+
|
42
|
+
methods.each do |enum_method|
|
43
|
+
if collection.respond_to?(enum_method)
|
44
|
+
tests("##{enum_method}").succeeds do
|
45
|
+
block_called = false
|
46
|
+
collection.send(enum_method) {|x| block_called = true }
|
47
|
+
block_called
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
[
|
53
|
+
'max_by','min_by'
|
54
|
+
].each do |enum_method|
|
55
|
+
if collection.respond_to?(enum_method)
|
56
|
+
tests("##{enum_method}").succeeds do
|
57
|
+
block_called = false
|
58
|
+
collection.send(enum_method) {|x| block_called = true; 0 }
|
59
|
+
block_called
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
if block_given?
|
68
|
+
yield(@instance)
|
69
|
+
end
|
70
|
+
|
71
|
+
if !Fog.mocking? || mocks_implemented
|
72
|
+
@instance.destroy
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
tests('failure') do
|
77
|
+
|
78
|
+
if !Fog.mocking? || mocks_implemented
|
79
|
+
@identity = @identity.to_s
|
80
|
+
@identity = @identity.gsub(/[a-zA-Z]/) { Fog::Mock.random_letters(1) }
|
81
|
+
@identity = @identity.gsub(/\d/) { Fog::Mock.random_numbers(1) }
|
82
|
+
@identity
|
83
|
+
end
|
84
|
+
|
85
|
+
tests("#get('#{@identity}')").returns(nil) do
|
86
|
+
pending if Fog.mocking? && !mocks_implemented
|
87
|
+
collection.get(@identity)
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
require 'fog/schema/data_validator'
|
2
|
+
|
3
|
+
# format related hackery
|
4
|
+
# allows both true.is_a?(Fog::Boolean) and false.is_a?(Fog::Boolean)
|
5
|
+
# allows both nil.is_a?(Fog::Nullable::String) and ''.is_a?(Fog::Nullable::String)
|
6
|
+
module Fog
|
7
|
+
module Boolean; end
|
8
|
+
module Nullable
|
9
|
+
module Boolean; end
|
10
|
+
module Integer; end
|
11
|
+
module String; end
|
12
|
+
module Time; end
|
13
|
+
module Float; end
|
14
|
+
module Hash; end
|
15
|
+
module Array; end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
[FalseClass, TrueClass].each {|klass| klass.send(:include, Fog::Boolean)}
|
19
|
+
[FalseClass, TrueClass, NilClass, Fog::Boolean].each {|klass| klass.send(:include, Fog::Nullable::Boolean)}
|
20
|
+
[NilClass, String].each {|klass| klass.send(:include, Fog::Nullable::String)}
|
21
|
+
[NilClass, Time].each {|klass| klass.send(:include, Fog::Nullable::Time)}
|
22
|
+
[Integer, NilClass].each {|klass| klass.send(:include, Fog::Nullable::Integer)}
|
23
|
+
[Float, NilClass].each {|klass| klass.send(:include, Fog::Nullable::Float)}
|
24
|
+
[Hash, NilClass].each {|klass| klass.send(:include, Fog::Nullable::Hash)}
|
25
|
+
[Array, NilClass].each {|klass| klass.send(:include, Fog::Nullable::Array)}
|
26
|
+
|
27
|
+
module Shindo
|
28
|
+
class Tests
|
29
|
+
# Generates a Shindo test that compares a hash schema to the result
|
30
|
+
# of the passed in block returning true if they match.
|
31
|
+
#
|
32
|
+
# The schema that is passed in is a Hash or Array of hashes that
|
33
|
+
# have Classes in place of values. When checking the schema the
|
34
|
+
# value should match the Class.
|
35
|
+
#
|
36
|
+
# Strict mode will fail if the data has additional keys. Setting
|
37
|
+
# +strict+ to +false+ will allow additional keys to appear.
|
38
|
+
#
|
39
|
+
# @param [Hash] schema A Hash schema
|
40
|
+
# @param [Hash] options Options to change validation rules
|
41
|
+
# @option options [Boolean] :allow_extra_keys
|
42
|
+
# If +true+ does not fail when keys are in the data that are
|
43
|
+
# not specified in the schema. This allows new values to
|
44
|
+
# appear in API output without breaking the check.
|
45
|
+
# @option options [Boolean] :allow_optional_rules
|
46
|
+
# If +true+ does not fail if extra keys are in the schema
|
47
|
+
# that do not match the data. Not recommended!
|
48
|
+
# @yield Data to check with schema
|
49
|
+
#
|
50
|
+
# @example Using in a test
|
51
|
+
# Shindo.tests("comparing welcome data against schema") do
|
52
|
+
# data = {:welcome => "Hello" }
|
53
|
+
# data_matches_schema(:welcome => String) { data }
|
54
|
+
# end
|
55
|
+
#
|
56
|
+
# comparing welcome data against schema
|
57
|
+
# + data matches schema
|
58
|
+
#
|
59
|
+
# @example Example schema
|
60
|
+
# {
|
61
|
+
# "id" => String,
|
62
|
+
# "ram" => Integer,
|
63
|
+
# "disks" => [
|
64
|
+
# {
|
65
|
+
# "size" => Float
|
66
|
+
# }
|
67
|
+
# ],
|
68
|
+
# "dns_name" => Fog::Nullable::String,
|
69
|
+
# "active" => Fog::Boolean,
|
70
|
+
# "created" => DateTime
|
71
|
+
# }
|
72
|
+
#
|
73
|
+
# @return [Boolean]
|
74
|
+
def data_matches_schema(schema, options = {})
|
75
|
+
test('data matches schema') do
|
76
|
+
validator = Fog::Schema::DataValidator.new
|
77
|
+
valid = validator.validate(yield, schema, options)
|
78
|
+
@message = validator.message unless valid
|
79
|
+
valid
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# @deprecated #formats is deprecated. Use #data_matches_schema instead
|
84
|
+
def formats(format, strict = true)
|
85
|
+
test('has proper format') do
|
86
|
+
if strict
|
87
|
+
options = {:allow_extra_keys => false, :allow_optional_rules => true}
|
88
|
+
else
|
89
|
+
options = {:allow_extra_keys => true, :allow_optional_rules => true}
|
90
|
+
end
|
91
|
+
validator = Fog::Schema::DataValidator.new
|
92
|
+
valid = validator.validate(yield, format, options)
|
93
|
+
@message = validator.message unless valid
|
94
|
+
valid
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|