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,17 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class Address < Fog::Model
|
5
|
+
identity :id, :aliases => 'id'
|
6
|
+
attribute :network_id, :aliases => 'networkid'
|
7
|
+
attribute :ip_address, :aliases => 'ipaddress'
|
8
|
+
attribute :traffic_type, :aliases => 'traffictype'
|
9
|
+
attribute :is_default, :aliases => 'isdefault'
|
10
|
+
attribute :mac_address, :aliases => 'macaddress'
|
11
|
+
attribute :netmask
|
12
|
+
attribute :gateway
|
13
|
+
attribute :type
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class DiskOffering < Fog::Model
|
5
|
+
identity :id, :aliases => 'id'
|
6
|
+
attribute :created
|
7
|
+
attribute :disk_size, :aliases => 'disk_size'
|
8
|
+
attribute :display_text, :aliases => 'display_text'
|
9
|
+
attribute :domain
|
10
|
+
attribute :domain_id, :aliases => 'domainid'
|
11
|
+
attribute :is_customized, :aliases => 'iscustomized'
|
12
|
+
attribute :name
|
13
|
+
attribute :storage_type, :aliases => 'storagetype'
|
14
|
+
attribute :tags
|
15
|
+
|
16
|
+
def save
|
17
|
+
requires :display_text, :name
|
18
|
+
|
19
|
+
options = {
|
20
|
+
'displaytext' => display_text,
|
21
|
+
'name' => name,
|
22
|
+
'customized' => is_customized,
|
23
|
+
'disksize' => disk_size,
|
24
|
+
'domain_id' => domain_id,
|
25
|
+
'storagetype' => storage_type,
|
26
|
+
'tags' => tags
|
27
|
+
}
|
28
|
+
|
29
|
+
response = service.create_disk_offering(options)
|
30
|
+
merge_attributes(response['creatediskofferingresponse'])
|
31
|
+
end
|
32
|
+
|
33
|
+
def destroy
|
34
|
+
requires :id
|
35
|
+
|
36
|
+
response = service.delete_disk_offering('id' => id )
|
37
|
+
success_status = response['deletediskofferingresponse']['success']
|
38
|
+
|
39
|
+
success_status == 'true'
|
40
|
+
end
|
41
|
+
end # DiskOffering
|
42
|
+
end # Cosmic
|
43
|
+
end # Compute
|
44
|
+
end # Fog
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/cosmic/models/compute/disk_offering'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Cosmic
|
6
|
+
class Compute
|
7
|
+
class DiskOfferings < Fog::Collection
|
8
|
+
model Fog::Cosmic::Compute::DiskOffering
|
9
|
+
|
10
|
+
def all(options = {})
|
11
|
+
response = service.list_disk_offerings(options)
|
12
|
+
disk_offerings_data = response["listdiskofferingsresponse"]["diskoffering"] || []
|
13
|
+
load(disk_offerings_data)
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(disk_offering_id)
|
17
|
+
response = service.list_disk_offerings('id' => disk_offering_id)
|
18
|
+
disk_offering_data = response["listdiskofferingsresponse"]["diskoffering"].first
|
19
|
+
new(disk_offering_data)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class EgressFirewallRule < Fog::Model
|
5
|
+
identity :id, :aliases => 'id'
|
6
|
+
attribute :protocol, :aliases => 'protocol'
|
7
|
+
attribute :network_id, :aliases => 'networkid'
|
8
|
+
attribute :state, :aliases => 'state'
|
9
|
+
attribute :cidr_list, :aliases => 'cidrlist'
|
10
|
+
attribute :tags, :type => :array
|
11
|
+
attribute :job_id, :aliases => 'jobid' # only on create
|
12
|
+
|
13
|
+
def save
|
14
|
+
requires :protocol, :network_id
|
15
|
+
|
16
|
+
options = {
|
17
|
+
'protocol' => protocol,
|
18
|
+
'networkid' => network_id,
|
19
|
+
'cidrlist' => cidr_list,
|
20
|
+
}
|
21
|
+
|
22
|
+
response = service.create_egress_firewall_rule(options)
|
23
|
+
merge_attributes(response['createegressfirewallruleresponse'])
|
24
|
+
end
|
25
|
+
|
26
|
+
def destroy
|
27
|
+
requires :id
|
28
|
+
|
29
|
+
response = service.delete_egress_firewall_rule('id' => id )
|
30
|
+
success_status = response['deleteegressfirewallruleresponse']['success']
|
31
|
+
|
32
|
+
success_status == 'true'
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/cosmic/models/compute/egress_firewall_rule'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Cosmic
|
6
|
+
class Compute
|
7
|
+
class EgressFirewallRules < Fog::Collection
|
8
|
+
model Fog::Cosmic::Compute::EgressFirewallRule
|
9
|
+
|
10
|
+
def all(options = {})
|
11
|
+
response = service.list_egress_firewall_rules(options)
|
12
|
+
egress_firewall_rules = response["listegressfirewallrulesresponse"]["firewallrule"] || []
|
13
|
+
load(egress_firewall_rules)
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(address_id)
|
17
|
+
options = { 'id' => address_id }
|
18
|
+
response = service.list_egress_firewall_rules(options)
|
19
|
+
egress_firewall_rules = response["listegressfirewallrulesresponse"]["firewallrule"].first
|
20
|
+
new(egress_firewall_rules)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class FirewallRule < Fog::Model
|
5
|
+
identity :id, :aliases => 'id'
|
6
|
+
attribute :cidr_list, :aliases => 'cidrlist'
|
7
|
+
attribute :start_port, :aliases => 'startport', :type => :integer
|
8
|
+
attribute :end_port, :aliases => 'endport', :type => :integer
|
9
|
+
attribute :icmp_code, :aliases => 'icmpcode'
|
10
|
+
attribute :icmp_type, :aliases => 'icmptype'
|
11
|
+
attribute :ip_address, :aliases => 'ipaddress'
|
12
|
+
attribute :ip_address_id, :aliases => 'ipaddressid'
|
13
|
+
attribute :network_id, :aliases => 'networkid'
|
14
|
+
attribute :protocol
|
15
|
+
attribute :state
|
16
|
+
attribute :tags, :type => :array
|
17
|
+
|
18
|
+
# def save
|
19
|
+
# end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/cosmic/models/compute/firewall_rule'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Cosmic
|
6
|
+
class Compute
|
7
|
+
class FirewallRules < Fog::Collection
|
8
|
+
model Fog::Cosmic::Compute::FirewallRule
|
9
|
+
|
10
|
+
def all(options = {})
|
11
|
+
response = service.list_firewall_rules(options)
|
12
|
+
firewall_rules = response["listfirewallrulesresponse"]["firewallrule"] || []
|
13
|
+
load(firewall_rules)
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(address_id)
|
17
|
+
options = { 'id' => address_id }
|
18
|
+
response = service.list_firewall_rules(options)
|
19
|
+
firewall_rules = response["listfirewallrulesresponse"]["firewallrule"].first
|
20
|
+
new(firewall_rules)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class Flavor < Fog::Model
|
5
|
+
identity :id, :aliases => 'id'
|
6
|
+
attribute :cpu_number, :aliases => 'cpunumber'
|
7
|
+
attribute :cpu_speed, :aliases => 'cpuspeed'
|
8
|
+
attribute :created, :type => :time
|
9
|
+
attribute :default_use, :aliases => 'defaultuse'
|
10
|
+
attribute :display_text, :aliases => 'display_text'
|
11
|
+
attribute :domain
|
12
|
+
attribute :host_tags, :aliases => 'host_tags'
|
13
|
+
attribute :is_system, :aliases => 'issystem', :type => :boolean
|
14
|
+
attribute :is_volatile, :aliases => 'isvolatile', :type => :boolean
|
15
|
+
attribute :is_customized, :aliases => 'iscustomized', :type => :boolean
|
16
|
+
attribute :limit_cpu_use, :aliases => 'limitcpuuse'
|
17
|
+
attribute :tags
|
18
|
+
attribute :system_vm_type, :aliases => 'systemvm'
|
19
|
+
attribute :storage_type, :aliases => 'storagetype'
|
20
|
+
attribute :offer_ha, :aliases => 'offerha'
|
21
|
+
attribute :network_rate, :aliases => 'networkrate'
|
22
|
+
attribute :name
|
23
|
+
attribute :memory
|
24
|
+
|
25
|
+
def save
|
26
|
+
raise Fog::Errors::Error.new('Creating a flavor is not supported')
|
27
|
+
end
|
28
|
+
|
29
|
+
def destroy
|
30
|
+
raise Fog::Errors::Error.new('Destroying a flavor is not supported')
|
31
|
+
end
|
32
|
+
|
33
|
+
end # Flavor
|
34
|
+
end # Cosmic
|
35
|
+
end # Compute
|
36
|
+
end # Fog
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/cosmic/models/compute/flavor'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Cosmic
|
6
|
+
class Compute
|
7
|
+
class Flavors < Fog::Collection
|
8
|
+
model Fog::Cosmic::Compute::Flavor
|
9
|
+
|
10
|
+
def all
|
11
|
+
data = service.list_service_offerings["listserviceofferingsresponse"]["serviceoffering"] || []
|
12
|
+
load(data)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(flavor_id)
|
16
|
+
if flavor = service.list_service_offerings('id' => flavor_id)["listserviceofferingsresponse"]["serviceoffering"].first
|
17
|
+
new(flavor)
|
18
|
+
end
|
19
|
+
rescue Fog::Cosmic::Compute::BadRequest
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class Image < Fog::Model
|
5
|
+
identity :id, :aliases => 'id'
|
6
|
+
attribute :account
|
7
|
+
attribute :account_id, :aliases => 'accountid'
|
8
|
+
attribute :bootable
|
9
|
+
attribute :checksum
|
10
|
+
attribute :created, :type => :time
|
11
|
+
attribute :cross_zones, :aliases => 'crossZones'
|
12
|
+
attribute :details
|
13
|
+
attribute :display_text, :aliases => 'displaytext'
|
14
|
+
attribute :domain
|
15
|
+
attribute :domain_id, :aliases => 'domainid'
|
16
|
+
attribute :format
|
17
|
+
attribute :host_id, :aliases => 'hostid'
|
18
|
+
attribute :host_name, :aliases => 'hostname'
|
19
|
+
attribute :hypervisor
|
20
|
+
attribute :job_id, :aliases => 'jobid'
|
21
|
+
attribute :job_status, :aliases => 'jobstatus'
|
22
|
+
attribute :is_extractable, :aliases => 'isextractable', :type => :boolean
|
23
|
+
attribute :is_featured, :aliases => 'isfeatured', :type => :boolean
|
24
|
+
attribute :is_public, :aliases => 'ispublic', :type => :boolean
|
25
|
+
attribute :is_ready, :aliases => 'isready', :type => :boolean
|
26
|
+
attribute :name
|
27
|
+
attribute :os_type_id, :aliases => 'ostypeid'
|
28
|
+
attribute :os_type_name, :aliases => 'ostypename'
|
29
|
+
attribute :password_enabled, :aliases => 'passwordenabled'
|
30
|
+
attribute :project
|
31
|
+
attribute :project_id, :aliases => 'projectid'
|
32
|
+
attribute :removed
|
33
|
+
attribute :size
|
34
|
+
attribute :source_template_id, :aliases => 'sourcetemplateid'
|
35
|
+
attribute :status
|
36
|
+
attribute :template_tag, :aliases => 'templatetag'
|
37
|
+
attribute :template_type, :aliases => 'templatetype'
|
38
|
+
attribute :zone_id, :aliases => 'zoneid'
|
39
|
+
attribute :zone_name, :aliases => 'zonename'
|
40
|
+
|
41
|
+
attr_accessor :bits, :requires_hvm, :snapshot_id, :url, :virtual_machine_id, :volume_id
|
42
|
+
|
43
|
+
def save
|
44
|
+
options = {
|
45
|
+
'displaytext' => display_text,
|
46
|
+
'name' => name,
|
47
|
+
'ostypeid' => os_type_id,
|
48
|
+
'bits' => bits,
|
49
|
+
'details' => details,
|
50
|
+
'isfeatured' => is_featured,
|
51
|
+
'ispublic' => is_public,
|
52
|
+
'passwordenabled' => password_enabled,
|
53
|
+
'requireshvm' => requires_hvm,
|
54
|
+
'snapshotid' => snapshot_id,
|
55
|
+
'templatetag' => template_tag,
|
56
|
+
'url' => url,
|
57
|
+
'virtualmachineid' => virtual_machine_id,
|
58
|
+
'volumeid' => volume_id
|
59
|
+
}
|
60
|
+
data = service.create_template(options)
|
61
|
+
merge_attributes(data['createtemplateresponse'])
|
62
|
+
end
|
63
|
+
|
64
|
+
def destroy
|
65
|
+
requires :id
|
66
|
+
service.delete_template('id' => self.id)
|
67
|
+
true
|
68
|
+
end
|
69
|
+
end # Server
|
70
|
+
end # Cosmic
|
71
|
+
end # Compute
|
72
|
+
end # Fog
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/cosmic/models/compute/image'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Cosmic
|
6
|
+
class Compute
|
7
|
+
class Images < Fog::Collection
|
8
|
+
model Fog::Cosmic::Compute::Image
|
9
|
+
|
10
|
+
def all(filters={})
|
11
|
+
options = get_filter_options(filters)
|
12
|
+
data = service.list_templates(options)["listtemplatesresponse"]["template"] || []
|
13
|
+
load(data)
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(template_id, filters={})
|
17
|
+
filter_option = get_filter_options(filters)
|
18
|
+
options = filter_option.merge('id' => template_id)
|
19
|
+
if template = service.list_templates(options)["listtemplatesresponse"]["template"].first
|
20
|
+
new(template)
|
21
|
+
end
|
22
|
+
rescue Fog::Cosmic::Compute::BadRequest
|
23
|
+
nil
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def get_filter_options(filters)
|
29
|
+
default_filter = {
|
30
|
+
'templatefilter' => 'self'
|
31
|
+
}
|
32
|
+
default_filter.merge(filters)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class Job < Fog::Model
|
5
|
+
identity :id, :aliases => 'jobid'
|
6
|
+
attribute :user_id, :aliases => 'userid'
|
7
|
+
attribute :account_id, :aliases => 'accountid'
|
8
|
+
attribute :cmd
|
9
|
+
attribute :job_status, :aliases => 'jobstatus', :type => :integer
|
10
|
+
attribute :job_result_type, :aliases => 'jobresulttype'
|
11
|
+
attribute :job_result_code, :aliases => 'jobresultcode', :type => :integer
|
12
|
+
attribute :job_proc_status, :aliases => 'jobprocstatus', :type => :integer
|
13
|
+
|
14
|
+
attribute :created_at, :aliases => 'created', :type => :time
|
15
|
+
attribute :job_result, :aliases => 'jobresult'
|
16
|
+
|
17
|
+
def reload
|
18
|
+
requires :id
|
19
|
+
merge_attributes(service.query_async_job_result('jobid' => self.id)['queryasyncjobresultresponse'])
|
20
|
+
end
|
21
|
+
|
22
|
+
def ready?
|
23
|
+
self.job_status != 0
|
24
|
+
end
|
25
|
+
|
26
|
+
def successful?
|
27
|
+
self.job_result_code == 0
|
28
|
+
end
|
29
|
+
|
30
|
+
# so dirty
|
31
|
+
def result
|
32
|
+
if successful? && model = Fog::Cosmic::Compute.constants.find{|c| c.to_s.downcase == self.job_result.keys.first.to_s}.to_s
|
33
|
+
collection = model.gsub(/.[A-Z]/){|w| "#{w[0,1]}_#{w[1,1].downcase}"}.downcase + "s" # cheap underscorize, assume simple pluralization
|
34
|
+
service.send(collection).new(self.job_result.values.first)
|
35
|
+
else self.job_result
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def save
|
40
|
+
raise Fog::Errors::Error.new('Creating a job is not supported')
|
41
|
+
end
|
42
|
+
|
43
|
+
def destroy
|
44
|
+
raise Fog::Errors::Error.new('Destroying a job is not supported')
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
end # Job
|
49
|
+
end # Cosmic
|
50
|
+
end # Compute
|
51
|
+
end # Fog
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/cosmic/models/compute/job'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Cosmic
|
6
|
+
class Compute
|
7
|
+
class Jobs < Fog::Collection
|
8
|
+
model Fog::Cosmic::Compute::Job
|
9
|
+
|
10
|
+
def all
|
11
|
+
data = service.list_async_jobs["listasyncjobsresponse"]["asyncjobs"] || []
|
12
|
+
load(data)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(job_id)
|
16
|
+
if job = service.query_async_job_result('jobid' => job_id)["queryasyncjobresultresponse"]
|
17
|
+
new(job)
|
18
|
+
end
|
19
|
+
rescue Fog::Cosmic::Compute::BadRequest
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|