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,73 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class Network < Fog::Model
|
5
|
+
identity :id, :aliases => 'id'
|
6
|
+
attribute :name, :aliases => 'name'
|
7
|
+
attribute :display_text, :aliases => 'displaytext'
|
8
|
+
|
9
|
+
attribute :broadcast_domain_type, :aliases => 'broadcastdomaintype'
|
10
|
+
attribute :traffic_type, :aliases => 'traffictype'
|
11
|
+
attribute :gateway, :aliases => 'gateway'
|
12
|
+
attribute :cidr, :aliases => 'cidr'
|
13
|
+
attribute :zone_id, :aliases => 'zoneid'
|
14
|
+
attribute :zone_name, :aliases => 'zonename'
|
15
|
+
|
16
|
+
attribute :network_offering_id, :aliases => 'networkofferingid'
|
17
|
+
attribute :network_offering_name, :aliases => 'networkofferingname'
|
18
|
+
attribute :network_offering_display_text, :aliases => 'networkofferingdisplaytext'
|
19
|
+
attribute :network_offering_conserve_mode, :aliases => 'networkofferingconservemode'
|
20
|
+
attribute :network_offering_availability, :aliases => 'networkofferingavailability'
|
21
|
+
attribute :is_system, :aliases => 'issystem', :type => :boolean
|
22
|
+
attribute :state, :aliases => 'state'
|
23
|
+
|
24
|
+
attribute :related, :aliases => 'related'
|
25
|
+
attribute :dns1, :aliases => 'dns1'
|
26
|
+
attribute :dns2, :aliases => 'dns2'
|
27
|
+
attribute :type, :aliases => 'type'
|
28
|
+
attribute :acl_type, :aliases => 'acltype'
|
29
|
+
attribute :project_id, :aliases => 'projectid'
|
30
|
+
attribute :domain_id, :aliases => 'domainid'
|
31
|
+
attribute :domain, :aliases => 'domain'
|
32
|
+
|
33
|
+
# attribute :service, :aliases => 'service'
|
34
|
+
attribute :network_domain, :aliases => 'domain'
|
35
|
+
attribute :physical_network_id, :aliases => 'physicalnetworkid'
|
36
|
+
attribute :restart_required, :aliases => 'restartrequired'
|
37
|
+
attribute :specify_ip_ranges, :aliases => 'specifyipranges'
|
38
|
+
attribute :canuse_for_deploy, :aliases => 'canusefordeploy'
|
39
|
+
attribute :is_persistent, :aliases => 'ispersistent', :type => :boolean
|
40
|
+
attribute :display_network, :aliases => 'displaynetwork'
|
41
|
+
attribute :is_default, :aliases => 'isdefault', :type => :boolean
|
42
|
+
|
43
|
+
# restart network - will return a job
|
44
|
+
def restart(options={})
|
45
|
+
response = service.restart_network( options.merge({'id'=> self.id}))
|
46
|
+
service.jobs.new(response['restartnetworkresponse'])
|
47
|
+
end
|
48
|
+
|
49
|
+
# create a new network
|
50
|
+
def save
|
51
|
+
requires :display_text, :name, :network_offering_id, :zone_id
|
52
|
+
|
53
|
+
options = {
|
54
|
+
'displaytext' => display_text,
|
55
|
+
'name' => name,
|
56
|
+
'zoneid' => zone_id,
|
57
|
+
'networkofferingid' => network_offering_id
|
58
|
+
}
|
59
|
+
|
60
|
+
response = service.create_network(options)
|
61
|
+
merge_attributes(response['createnetworkresponse']['network'])
|
62
|
+
end
|
63
|
+
|
64
|
+
# delete given network - will return a job
|
65
|
+
def destroy(options={})
|
66
|
+
response = service.delete_network(options.merge({'id'=> self.id}))
|
67
|
+
service.jobs.new(response["deletenetworkresponse"])
|
68
|
+
end
|
69
|
+
|
70
|
+
end # Network
|
71
|
+
end # Cosmic
|
72
|
+
end # Compute
|
73
|
+
end # Fog
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class NetworkOffering < Fog::Model
|
5
|
+
identity :id, :aliases => 'id'
|
6
|
+
attribute :name, :aliases => 'name'
|
7
|
+
attribute :display_text, :aliases => 'displaytext'
|
8
|
+
attribute :traffic_type, :aliases => 'traffictype'
|
9
|
+
attribute :is_default, :aliases => 'isdefault', :type => :boolean
|
10
|
+
attribute :specify_vlan, :aliases => 'specifyvlan'
|
11
|
+
attribute :conserve_mode, :aliases => 'conservemode'
|
12
|
+
attribute :specify_ip_ranges, :aliases => 'specifyipranges'
|
13
|
+
attribute :availability, :aliases => 'availability'
|
14
|
+
attribute :network_rate, :aliases => 'networkrate'
|
15
|
+
attribute :state, :aliases => 'state'
|
16
|
+
attribute :guest_ip_type, :aliases => 'guestiptype'
|
17
|
+
attribute :service_offering_id, :aliases => 'serviceofferingid'
|
18
|
+
attribute :service, :aliases => 'service'
|
19
|
+
attribute :for_vpc, :aliases => 'forvpc'
|
20
|
+
attribute :is_persistent, :aliases => 'ispersistent', :type => :boolean
|
21
|
+
attribute :egress_default_policy, :aliases => 'egressdefaultpolicy'
|
22
|
+
end # NetworkOffering
|
23
|
+
end # Cosmic
|
24
|
+
end # Compute
|
25
|
+
end # Fog
|
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
require 'fog/core/collection'
|
4
|
+
require 'fog/cosmic/models/compute/network_offering'
|
5
|
+
|
6
|
+
module Fog
|
7
|
+
module Cosmic
|
8
|
+
class Compute
|
9
|
+
class NetworkOfferings < Fog::Collection
|
10
|
+
model Fog::Cosmic::Compute::NetworkOffering
|
11
|
+
|
12
|
+
def all(filters={})
|
13
|
+
options = get_filter_options(filters)
|
14
|
+
data = service.list_network_offerings(options)["listnetworkofferingsresponse"]["networkoffering"] || []
|
15
|
+
load(data)
|
16
|
+
end
|
17
|
+
|
18
|
+
def get(network_offering_id, filters={})
|
19
|
+
filter_option = get_filter_options(filters)
|
20
|
+
options = filter_option.merge('id' => network_offering_id)
|
21
|
+
if data = service.list_network_offerings(options)["listnetworkofferingsresponse"]["networkoffering"].first
|
22
|
+
new(data)
|
23
|
+
end
|
24
|
+
rescue Fog::Cosmic::Compute::BadRequest
|
25
|
+
nil
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def get_filter_options(filters)
|
31
|
+
default_filter = {
|
32
|
+
'projectfilter' => 'self'
|
33
|
+
}
|
34
|
+
default_filter.merge(filters)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
|
2
|
+
require 'fog/core/collection'
|
3
|
+
require 'fog/cosmic/models/compute/network'
|
4
|
+
|
5
|
+
module Fog
|
6
|
+
module Cosmic
|
7
|
+
class Compute
|
8
|
+
class Networks < Fog::Collection
|
9
|
+
model Fog::Cosmic::Compute::Network
|
10
|
+
|
11
|
+
def all(filters={})
|
12
|
+
options = get_filter_options(filters)
|
13
|
+
data = service.list_networks(options)["listnetworksresponse"]["network"] || []
|
14
|
+
load(data)
|
15
|
+
end
|
16
|
+
|
17
|
+
def get(network_id, filters={})
|
18
|
+
filter_option = get_filter_options(filters)
|
19
|
+
options = filter_option.merge('id' => network_id)
|
20
|
+
if data = service.list_networks(options)["listnetworksresponse"]["network"].first
|
21
|
+
new(data)
|
22
|
+
end
|
23
|
+
rescue Fog::Cosmic::Compute::BadRequest
|
24
|
+
nil
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def get_filter_options(filters)
|
30
|
+
default_filter = {
|
31
|
+
'projectfilter' => 'self'
|
32
|
+
}
|
33
|
+
default_filter.merge(filters)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class PortForwardingRule < Fog::Model
|
5
|
+
identity :id, :aliases => 'id'
|
6
|
+
|
7
|
+
attribute :private_port, :aliases => 'privateport'
|
8
|
+
attribute :private_end_port, :aliases => 'privateendport'
|
9
|
+
attribute :protocol, :aliases => 'protocol'
|
10
|
+
attribute :public_port, :aliases => 'publicport'
|
11
|
+
attribute :public_end_port, :aliases => 'publicendport'
|
12
|
+
attribute :virtual_machine_id, :aliases => 'virtualmachineid'
|
13
|
+
attribute :virtualmachinename, :aliases => 'virtualmachinename'
|
14
|
+
attribute :virtualmachinedisplayname, :aliases => 'virtualmachinedisplayname'
|
15
|
+
attribute :ipaddressid, :aliases => 'ipaddressid'
|
16
|
+
attribute :ipaddress, :aliases => 'ipaddress'
|
17
|
+
attribute :state, :aliases => 'state'
|
18
|
+
attribute :cidrlist, :aliases => 'cidrlist'
|
19
|
+
attribute :vmguestip, :aliases => 'vmguestip'
|
20
|
+
attribute :networkid, :aliases => 'networkid'
|
21
|
+
attribute :tags, :type => :array
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/cosmic/models/compute/port_forwarding_rule'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Cosmic
|
6
|
+
class Compute
|
7
|
+
class PortForwardingRules < Fog::Collection
|
8
|
+
model Fog::Cosmic::Compute::PortForwardingRule
|
9
|
+
|
10
|
+
def all(options = {})
|
11
|
+
response = service.list_port_forwarding_rules(options)
|
12
|
+
port_forwarding_rules = response["listportforwardingrulesresponse"]["portforwardingrule"] || []
|
13
|
+
load(port_forwarding_rules)
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(address_id)
|
17
|
+
options = { 'id' => address_id }
|
18
|
+
response = service.list_port_forwarding_rules(options)
|
19
|
+
port_forwarding_rules = response["listportforwardingrulesresponse"]["portforwardingrule"].first
|
20
|
+
new(port_forwarding_rules)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class Project < Fog::Model
|
5
|
+
identity :id, :aliases => 'id'
|
6
|
+
attribute :name, :aliases => 'name'
|
7
|
+
attribute :display_text, :aliases => 'displaytext'
|
8
|
+
attribute :domain_id, :aliases => 'domainid'
|
9
|
+
attribute :domain, :aliases => 'domain'
|
10
|
+
attribute :account, :aliases => 'account'
|
11
|
+
attribute :state, :aliases => 'state'
|
12
|
+
attribute :tags, :aliases => 'tags'
|
13
|
+
attribute :network_limit, :aliases => 'networklimit'
|
14
|
+
attribute :network_total, :aliases => 'networktotal', :type => :integer
|
15
|
+
attribute :network_available, :aliases => 'networkavailable'
|
16
|
+
attribute :vpc_limit, :aliases => 'vpclimit'
|
17
|
+
attribute :vpc_total, :aliases => 'vpctotal', :type => :integer
|
18
|
+
attribute :vpc_available, :aliases => 'vpcavailable'
|
19
|
+
attribute :cpu_limit, :aliases => 'cpulimit'
|
20
|
+
attribute :cpu_total, :aliases => 'cputotal', :type => :integer
|
21
|
+
attribute :cpu_available, :aliases => 'cpuavailable'
|
22
|
+
attribute :memory_limit, :aliases => 'memorylimit'
|
23
|
+
attribute :memory_total, :aliases => 'memorytotal', :type => :integer
|
24
|
+
attribute :memory_available, :aliases => 'memoryavailable'
|
25
|
+
attribute :primary_storage_limit, :aliases => 'primarystoragelimit'
|
26
|
+
attribute :primary_storage_total, :aliases => 'primarystoragetotal', :type => :integer
|
27
|
+
attribute :primary_storage_available, :aliases => 'primarystorageavailable'
|
28
|
+
attribute :secondary_storage_limit, :aliases => 'secondarystoragelimit'
|
29
|
+
attribute :secondary_storage_total, :aliases => 'secondarystoragetotal', :type => :integer
|
30
|
+
attribute :secondary_storage_available, :aliases => 'secondarystorageavailable'
|
31
|
+
attribute :vm_limit, :aliases => 'vmlimit'
|
32
|
+
attribute :vm_total, :aliases => 'vmtotal', :type => :integer
|
33
|
+
attribute :vm_available, :aliases => 'vmavailable'
|
34
|
+
attribute :ip_limit, :aliases => 'iplimit'
|
35
|
+
attribute :ip_total, :aliases => 'iptotal', :type => :integer
|
36
|
+
attribute :ip_available, :aliases => 'ipavailable'
|
37
|
+
attribute :volume_limit, :aliases => 'volumelimit'
|
38
|
+
attribute :volume_total, :aliases => 'volumetotal', :type => :integer
|
39
|
+
attribute :volume_available, :aliases => 'volumeavailable'
|
40
|
+
attribute :snapshot_limit, :aliases => 'snapshotlimit'
|
41
|
+
attribute :snapshot_total, :aliases => 'snapshottotal', :type => :integer
|
42
|
+
attribute :snapshot_available, :aliases => 'snapshotavailable'
|
43
|
+
attribute :template_limit, :aliases => 'templatelimit'
|
44
|
+
attribute :template_total, :aliases => 'templatetotal', :type => :integer
|
45
|
+
attribute :template_available, :aliases => 'templateavailable'
|
46
|
+
|
47
|
+
def save
|
48
|
+
raise Fog::Errors::Error.new('Creating a project is not supported')
|
49
|
+
end
|
50
|
+
|
51
|
+
def destroy
|
52
|
+
raise Fog::Errors::Error.new('Destroying a project is not supported')
|
53
|
+
end
|
54
|
+
|
55
|
+
end # Project
|
56
|
+
end # Cosmic
|
57
|
+
end # Compute
|
58
|
+
end # Fog
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/cosmic/models/compute/project'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Cosmic
|
6
|
+
class Compute
|
7
|
+
class Projects < Fog::Collection
|
8
|
+
model Fog::Cosmic::Compute::Project
|
9
|
+
|
10
|
+
def all(filters={})
|
11
|
+
options = get_filter_options(filters)
|
12
|
+
|
13
|
+
data = service.list_projects(options)["listprojectsresponse"]["project"] || []
|
14
|
+
load(data)
|
15
|
+
end
|
16
|
+
|
17
|
+
def get(project_id, filters={})
|
18
|
+
filter_option = get_filter_options(filters)
|
19
|
+
options = filter_option.merge('id' => project_id)
|
20
|
+
|
21
|
+
if template = service.list_projects(options)["listprojectsresponse"]["project"].first
|
22
|
+
new(template)
|
23
|
+
end
|
24
|
+
rescue Fog::Cosmic::Compute::BadRequest
|
25
|
+
nil
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def get_filter_options(filters)
|
31
|
+
default_filter = {
|
32
|
+
'projectfilter' => 'self'
|
33
|
+
}
|
34
|
+
default_filter.merge(filters)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
module Fog
|
2
|
+
module Cosmic
|
3
|
+
class Compute
|
4
|
+
class PublicIpAddress < Fog::Model
|
5
|
+
identity :id
|
6
|
+
|
7
|
+
attribute :account
|
8
|
+
attribute :allocated, :type => :time
|
9
|
+
attribute :associated_network_id, :aliases => 'associatednetworkid'
|
10
|
+
attribute :associated_network_name, :aliases => 'associatednetworkname'
|
11
|
+
attribute :domain
|
12
|
+
attribute :domain_id, :aliases => 'domainid'
|
13
|
+
attribute :for_virtual_network, :type => :boolean, :aliases => 'forvirtualnetwork'
|
14
|
+
attribute :ip_address, :aliases => 'ipaddress'
|
15
|
+
attribute :is_portable, :type => :boolean, :aliases => 'isportable'
|
16
|
+
attribute :is_source_nat, :type => :boolean, :aliases => 'issourcenat'
|
17
|
+
attribute :is_static_nat, :type => :boolean, :aliases => 'isstaticnat'
|
18
|
+
attribute :is_system, :type => :boolean, :aliases => 'issystem'
|
19
|
+
attribute :network_id, :type => :boolean, :aliases => 'networkid'
|
20
|
+
attribute :physical_network_id, :aliases => 'physicalnetworkid'
|
21
|
+
attribute :project
|
22
|
+
attribute :project_id, :aliases => 'projectid'
|
23
|
+
attribute :purpose
|
24
|
+
attribute :state
|
25
|
+
attribute :server_display_name, :aliases => 'virtualmachinedisplayname'
|
26
|
+
attribute :server_id, :aliases => 'virtualmachineid'
|
27
|
+
attribute :server_name, :aliases => 'virtualmachinename'
|
28
|
+
attribute :vlan_id, :aliases => 'vlanid'
|
29
|
+
attribute :vlan_name, :aliases => 'vlanname'
|
30
|
+
attribute :server_ip_address, :aliases => 'vmipaddress'
|
31
|
+
attribute :vpc_id, :aliases => 'vpcid'
|
32
|
+
attribute :zone_id, :aliases => 'zoneid'
|
33
|
+
attribute :zone_name, :aliases => 'zonename'
|
34
|
+
attribute :tags, :type => :array
|
35
|
+
attribute :job_id, :aliases => 'jobid' # only on associate
|
36
|
+
|
37
|
+
def initialize(attributes = {})
|
38
|
+
# assign server first to prevent race condition with persisted?
|
39
|
+
self.server = attributes.delete(:server)
|
40
|
+
super
|
41
|
+
end
|
42
|
+
|
43
|
+
def ready?
|
44
|
+
state == 'Allocated'
|
45
|
+
end
|
46
|
+
|
47
|
+
def destroy
|
48
|
+
requires :identity
|
49
|
+
service.disassociate_ip_address('id' => id)
|
50
|
+
true
|
51
|
+
end
|
52
|
+
|
53
|
+
def server=(new_server)
|
54
|
+
@server = new_server
|
55
|
+
if persisted?
|
56
|
+
if !server_id.nil? && (new_server.nil? || server_id != new_server.id)
|
57
|
+
service.disable_static_nat('ipaddressid' => id)
|
58
|
+
self.server_display_name = nil
|
59
|
+
self.server_id = nil
|
60
|
+
self.server_name = nil
|
61
|
+
self.server_ip_address = nil
|
62
|
+
self.is_static_nat = false
|
63
|
+
end
|
64
|
+
unless new_server.nil?
|
65
|
+
service.enable_static_nat(
|
66
|
+
'ipaddressid' => id, 'virtualmachineid' => new_server.id)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def server
|
72
|
+
service.servers.get(server_id)
|
73
|
+
end
|
74
|
+
|
75
|
+
def save
|
76
|
+
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
|
77
|
+
options = {
|
78
|
+
'account' => account,
|
79
|
+
'domainid' => domain_id,
|
80
|
+
'isportable' => is_portable,
|
81
|
+
'networkid' => network_id,
|
82
|
+
'projectid' => project_id,
|
83
|
+
'vpcid' => vpc_id,
|
84
|
+
'zoneid' => zone_id,
|
85
|
+
}
|
86
|
+
response = service.associate_ip_address(options)
|
87
|
+
merge_attributes(response['associateipaddressresponse'])
|
88
|
+
if @server
|
89
|
+
self.server = @server
|
90
|
+
end
|
91
|
+
true
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/cosmic/models/compute/public_ip_address'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Cosmic
|
6
|
+
class Compute
|
7
|
+
class PublicIpAddresses < Fog::Collection
|
8
|
+
model Fog::Cosmic::Compute::PublicIpAddress
|
9
|
+
|
10
|
+
def all(options = {})
|
11
|
+
response = service.list_public_ip_addresses(options)
|
12
|
+
public_ip_addresses = response["listpublicipaddressesresponse"]["publicipaddress"] || []
|
13
|
+
load(public_ip_addresses)
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(address_id)
|
17
|
+
response = service.list_public_ip_addresses('id' => address_id)
|
18
|
+
if public_ip_address = response["listpublicipaddressesresponse"]["publicipaddress"].first
|
19
|
+
new(public_ip_address)
|
20
|
+
end
|
21
|
+
rescue Fog::Cosmic::Compute::BadRequest
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|