Module: Fog::Rackspace
- Extended by:
- Provider
- Defined in:
- lib/fog/rackspace/core.rb,
lib/fog/rackspace/errors.rb,
lib/fog/rackspace/queues.rb,
lib/fog/rackspace/service.rb,
lib/fog/rackspace/identity.rb,
lib/fog/rackspace/databases.rb,
lib/fog/rackspace/mock_data.rb,
lib/fog/rackspace/auto_scale.rb,
lib/fog/rackspace/monitoring.rb,
lib/fog/rackspace/networking.rb,
lib/fog/rackspace/block_storage.rb,
lib/fog/rackspace/orchestration.rb,
lib/fog/rackspace/load_balancers.rb,
lib/fog/rackspace/models/queues/claim.rb,
lib/fog/rackspace/models/queues/queue.rb,
lib/fog/rackspace/models/identity/role.rb,
lib/fog/rackspace/models/identity/user.rb,
lib/fog/rackspace/models/queues/claims.rb,
lib/fog/rackspace/models/queues/queues.rb,
lib/fog/rackspace/models/databases/user.rb,
lib/fog/rackspace/models/identity/roles.rb,
lib/fog/rackspace/models/identity/users.rb,
lib/fog/rackspace/models/queues/message.rb,
lib/fog/rackspace/models/databases/users.rb,
lib/fog/rackspace/models/identity/tenant.rb,
lib/fog/rackspace/models/monitoring/base.rb,
lib/fog/rackspace/models/queues/messages.rb,
lib/fog/rackspace/models/auto_scale/group.rb,
lib/fog/rackspace/models/databases/flavor.rb,
lib/fog/rackspace/models/identity/tenants.rb,
lib/fog/rackspace/models/monitoring/alarm.rb,
lib/fog/rackspace/models/monitoring/check.rb,
lib/fog/rackspace/models/auto_scale/groups.rb,
lib/fog/rackspace/models/auto_scale/policy.rb,
lib/fog/rackspace/models/databases/flavors.rb,
lib/fog/rackspace/models/monitoring/alarms.rb,
lib/fog/rackspace/models/monitoring/checks.rb,
lib/fog/rackspace/models/monitoring/entity.rb,
lib/fog/rackspace/models/monitoring/metric.rb,
lib/fog/rackspace/models/auto_scale/webhook.rb,
lib/fog/rackspace/models/databases/database.rb,
lib/fog/rackspace/models/databases/instance.rb,
lib/fog/rackspace/models/monitoring/metrics.rb,
lib/fog/rackspace/models/networking/network.rb,
lib/fog/rackspace/requests/queues/get_claim.rb,
lib/fog/rackspace/requests/queues/get_queue.rb,
lib/fog/rackspace/models/auto_scale/policies.rb,
lib/fog/rackspace/models/auto_scale/webhooks.rb,
lib/fog/rackspace/models/databases/databases.rb,
lib/fog/rackspace/models/databases/instances.rb,
lib/fog/rackspace/models/identity/credential.rb,
lib/fog/rackspace/models/load_balancers/node.rb,
lib/fog/rackspace/models/monitoring/entities.rb,
lib/fog/rackspace/models/networking/networks.rb,
lib/fog/rackspace/models/orchestration/event.rb,
lib/fog/rackspace/models/orchestration/stack.rb,
lib/fog/rackspace/models/block_storage/volume.rb,
lib/fog/rackspace/models/identity/credentials.rb,
lib/fog/rackspace/models/load_balancers/nodes.rb,
lib/fog/rackspace/models/orchestration/events.rb,
lib/fog/rackspace/models/orchestration/stacks.rb,
lib/fog/rackspace/requests/queues/get_message.rb,
lib/fog/rackspace/requests/queues/list_queues.rb,
lib/fog/rackspace/models/block_storage/volumes.rb,
lib/fog/rackspace/models/monitoring/check_type.rb,
lib/fog/rackspace/models/monitoring/data_point.rb,
lib/fog/rackspace/requests/identity/list_users.rb,
lib/fog/rackspace/requests/queues/create_claim.rb,
lib/fog/rackspace/requests/queues/create_queue.rb,
lib/fog/rackspace/requests/queues/delete_claim.rb,
lib/fog/rackspace/requests/queues/delete_queue.rb,
lib/fog/rackspace/requests/queues/update_claim.rb,
lib/fog/rackspace/models/block_storage/snapshot.rb,
lib/fog/rackspace/models/monitoring/agent_token.rb,
lib/fog/rackspace/models/monitoring/check_types.rb,
lib/fog/rackspace/models/monitoring/data_points.rb,
lib/fog/rackspace/models/orchestration/resource.rb,
lib/fog/rackspace/models/orchestration/template.rb,
lib/fog/rackspace/requests/auto_scale/get_group.rb,
lib/fog/rackspace/requests/databases/get_flavor.rb,
lib/fog/rackspace/requests/databases/list_users.rb,
lib/fog/rackspace/requests/identity/create_user.rb,
lib/fog/rackspace/requests/identity/delete_user.rb,
lib/fog/rackspace/requests/identity/update_user.rb,
lib/fog/rackspace/requests/monitoring/get_agent.rb,
lib/fog/rackspace/requests/monitoring/get_alarm.rb,
lib/fog/rackspace/requests/monitoring/get_check.rb,
lib/fog/rackspace/requests/queues/list_messages.rb,
lib/fog/rackspace/models/auto_scale/group_config.rb,
lib/fog/rackspace/models/block_storage/snapshots.rb,
lib/fog/rackspace/models/monitoring/agent_tokens.rb,
lib/fog/rackspace/models/monitoring/notification.rb,
lib/fog/rackspace/models/orchestration/resources.rb,
lib/fog/rackspace/models/orchestration/templates.rb,
lib/fog/rackspace/requests/auto_scale/get_policy.rb,
lib/fog/rackspace/requests/databases/create_user.rb,
lib/fog/rackspace/requests/databases/delete_user.rb,
lib/fog/rackspace/requests/identity/create_token.rb,
lib/fog/rackspace/requests/identity/list_tenants.rb,
lib/fog/rackspace/requests/monitoring/get_entity.rb,
lib/fog/rackspace/requests/queues/create_message.rb,
lib/fog/rackspace/requests/queues/delete_message.rb,
lib/fog/rackspace/models/auto_scale/group_builder.rb,
lib/fog/rackspace/models/auto_scale/launch_config.rb,
lib/fog/rackspace/models/identity/service_catalog.rb,
lib/fog/rackspace/models/monitoring/alarm_example.rb,
lib/fog/rackspace/models/monitoring/notifications.rb,
lib/fog/rackspace/requests/auto_scale/get_webhook.rb,
lib/fog/rackspace/requests/auto_scale/list_groups.rb,
lib/fog/rackspace/requests/databases/get_instance.rb,
lib/fog/rackspace/requests/databases/list_flavors.rb,
lib/fog/rackspace/requests/monitoring/list_agents.rb,
lib/fog/rackspace/requests/monitoring/list_alarms.rb,
lib/fog/rackspace/requests/monitoring/list_checks.rb,
lib/fog/rackspace/requests/networking/get_network.rb,
lib/fog/rackspace/requests/queues/get_queue_stats.rb,
lib/fog/rackspace/models/block_storage/volume_type.rb,
lib/fog/rackspace/models/load_balancers/virtual_ip.rb,
lib/fog/rackspace/models/monitoring/alarm_examples.rb,
lib/fog/rackspace/requests/auto_scale/create_group.rb,
lib/fog/rackspace/requests/auto_scale/delete_group.rb,
lib/fog/rackspace/requests/identity/get_user_by_id.rb,
lib/fog/rackspace/requests/load_balancers/get_node.rb,
lib/fog/rackspace/requests/monitoring/create_alarm.rb,
lib/fog/rackspace/requests/monitoring/create_check.rb,
lib/fog/rackspace/requests/monitoring/delete_alarm.rb,
lib/fog/rackspace/requests/monitoring/delete_check.rb,
lib/fog/rackspace/requests/monitoring/list_metrics.rb,
lib/fog/rackspace/requests/monitoring/update_alarm.rb,
lib/fog/rackspace/requests/monitoring/update_check.rb,
lib/fog/rackspace/models/block_storage/volume_types.rb,
lib/fog/rackspace/models/load_balancers/access_rule.rb,
lib/fog/rackspace/models/load_balancers/virtual_ips.rb,
lib/fog/rackspace/requests/auto_scale/create_policy.rb,
lib/fog/rackspace/requests/auto_scale/delete_policy.rb,
lib/fog/rackspace/requests/auto_scale/list_policies.rb,
lib/fog/rackspace/requests/auto_scale/list_webhooks.rb,
lib/fog/rackspace/requests/auto_scale/update_policy.rb,
lib/fog/rackspace/requests/block_storage/get_volume.rb,
lib/fog/rackspace/requests/databases/list_databases.rb,
lib/fog/rackspace/requests/databases/list_instances.rb,
lib/fog/rackspace/requests/identity/list_user_roles.rb,
lib/fog/rackspace/requests/load_balancers/get_stats.rb,
lib/fog/rackspace/requests/load_balancers/get_usage.rb,
lib/fog/rackspace/requests/monitoring/create_entity.rb,
lib/fog/rackspace/requests/monitoring/delete_entity.rb,
lib/fog/rackspace/requests/monitoring/get_cpus_info.rb,
lib/fog/rackspace/requests/monitoring/list_entities.rb,
lib/fog/rackspace/requests/monitoring/list_overview.rb,
lib/fog/rackspace/requests/monitoring/update_entity.rb,
lib/fog/rackspace/requests/networking/list_networks.rb,
lib/fog/rackspace/requests/orchestration/build_info.rb,
lib/fog/rackspace/models/load_balancers/access_rules.rb,
lib/fog/rackspace/requests/auto_scale/create_webhook.rb,
lib/fog/rackspace/requests/auto_scale/delete_webhook.rb,
lib/fog/rackspace/requests/auto_scale/execute_policy.rb,
lib/fog/rackspace/requests/auto_scale/update_webhook.rb,
lib/fog/rackspace/requests/databases/check_root_user.rb,
lib/fog/rackspace/requests/databases/create_database.rb,
lib/fog/rackspace/requests/databases/create_instance.rb,
lib/fog/rackspace/requests/databases/delete_database.rb,
lib/fog/rackspace/requests/databases/delete_instance.rb,
lib/fog/rackspace/requests/databases/resize_instance.rb,
lib/fog/rackspace/requests/identity/get_user_by_name.rb,
lib/fog/rackspace/requests/identity/list_credentials.rb,
lib/fog/rackspace/requests/load_balancers/list_nodes.rb,
lib/fog/rackspace/requests/monitoring/get_disks_info.rb,
lib/fog/rackspace/requests/networking/create_network.rb,
lib/fog/rackspace/requests/networking/delete_network.rb,
lib/fog/rackspace/models/load_balancers/load_balancer.rb,
lib/fog/rackspace/models/networking/virtual_interface.rb,
lib/fog/rackspace/requests/auto_scale/get_group_state.rb,
lib/fog/rackspace/requests/block_storage/get_snapshot.rb,
lib/fog/rackspace/requests/block_storage/list_volumes.rb,
lib/fog/rackspace/requests/databases/enable_root_user.rb,
lib/fog/rackspace/requests/databases/restart_instance.rb,
lib/fog/rackspace/requests/load_balancers/create_node.rb,
lib/fog/rackspace/requests/load_balancers/delete_node.rb,
lib/fog/rackspace/requests/load_balancers/get_monitor.rb,
lib/fog/rackspace/requests/load_balancers/set_monitor.rb,
lib/fog/rackspace/requests/load_balancers/update_node.rb,
lib/fog/rackspace/requests/monitoring/get_agent_token.rb,
lib/fog/rackspace/requests/monitoring/get_memory_info.rb,
lib/fog/rackspace/requests/monitoring/get_system_info.rb,
lib/fog/rackspace/requests/orchestration/create_stack.rb,
lib/fog/rackspace/requests/orchestration/delete_stack.rb,
lib/fog/rackspace/requests/orchestration/update_stack.rb,
lib/fog/rackspace/models/load_balancers/load_balancers.rb,
lib/fog/rackspace/models/networking/virtual_interfaces.rb,
lib/fog/rackspace/requests/auto_scale/get_group_config.rb,
lib/fog/rackspace/requests/block_storage/create_volume.rb,
lib/fog/rackspace/requests/block_storage/delete_volume.rb,
lib/fog/rackspace/requests/databases/grant_user_access.rb,
lib/fog/rackspace/requests/load_balancers/delete_nodes.rb,
lib/fog/rackspace/requests/monitoring/get_notification.rb,
lib/fog/rackspace/requests/monitoring/list_check_types.rb,
lib/fog/rackspace/requests/monitoring/list_data_points.rb,
lib/fog/rackspace/requests/orchestration/abandon_stack.rb,
lib/fog/rackspace/requests/orchestration/preview_stack.rb,
lib/fog/rackspace/models/orchestration/resource_schemas.rb,
lib/fog/rackspace/requests/auto_scale/get_launch_config.rb,
lib/fog/rackspace/requests/auto_scale/pause_group_state.rb,
lib/fog/rackspace/requests/block_storage/list_snapshots.rb,
lib/fog/rackspace/requests/databases/revoke_user_access.rb,
lib/fog/rackspace/requests/monitoring/get_alarm_example.rb,
lib/fog/rackspace/requests/monitoring/list_agent_tokens.rb,
lib/fog/rackspace/requests/orchestration/list_resources.rb,
lib/fog/rackspace/requests/auto_scale/resume_group_state.rb,
lib/fog/rackspace/requests/block_storage/create_snapshot.rb,
lib/fog/rackspace/requests/block_storage/delete_snapshot.rb,
lib/fog/rackspace/requests/block_storage/get_volume_type.rb,
lib/fog/rackspace/requests/load_balancers/get_error_page.rb,
lib/fog/rackspace/requests/load_balancers/list_protocols.rb,
lib/fog/rackspace/requests/load_balancers/remove_monitor.rb,
lib/fog/rackspace/requests/load_balancers/set_error_page.rb,
lib/fog/rackspace/requests/monitoring/create_agent_token.rb,
lib/fog/rackspace/requests/monitoring/delete_agent_token.rb,
lib/fog/rackspace/requests/monitoring/get_processes_info.rb,
lib/fog/rackspace/requests/monitoring/list_notifications.rb,
lib/fog/rackspace/requests/orchestration/list_stack_data.rb,
lib/fog/rackspace/requests/auto_scale/update_group_config.rb,
lib/fog/rackspace/requests/load_balancers/list_algorithms.rb,
lib/fog/rackspace/requests/monitoring/create_notification.rb,
lib/fog/rackspace/requests/monitoring/delete_notification.rb,
lib/fog/rackspace/requests/monitoring/get_monitoring_zone.rb,
lib/fog/rackspace/requests/monitoring/list_alarm_examples.rb,
lib/fog/rackspace/requests/monitoring/update_notification.rb,
lib/fog/rackspace/requests/auto_scale/update_launch_config.rb,
lib/fog/rackspace/requests/block_storage/list_volume_types.rb,
lib/fog/rackspace/requests/load_balancers/list_virtual_ips.rb,
lib/fog/rackspace/requests/monitoring/get_filesystems_info.rb,
lib/fog/rackspace/requests/orchestration/list_stack_events.rb,
lib/fog/rackspace/requests/orchestration/validate_template.rb,
lib/fog/rackspace/requests/databases/resize_instance_volume.rb,
lib/fog/rackspace/requests/load_balancers/create_virtual_ip.rb,
lib/fog/rackspace/requests/load_balancers/delete_virtual_ip.rb,
lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb,
lib/fog/rackspace/requests/load_balancers/list_access_rules.rb,
lib/fog/rackspace/requests/load_balancers/remove_error_page.rb,
lib/fog/rackspace/requests/monitoring/list_monitoring_zones.rb,
lib/fog/rackspace/requests/orchestration/get_stack_template.rb,
lib/fog/rackspace/requests/orchestration/show_event_details.rb,
lib/fog/rackspace/requests/orchestration/show_resource_data.rb,
lib/fog/rackspace/requests/orchestration/show_stack_details.rb,
lib/fog/rackspace/requests/load_balancers/create_access_rule.rb,
lib/fog/rackspace/requests/load_balancers/delete_access_rule.rb,
lib/fog/rackspace/requests/monitoring/evaluate_alarm_example.rb,
lib/fog/rackspace/requests/orchestration/list_resource_types.rb,
lib/fog/rackspace/requests/load_balancers/get_content_caching.rb,
lib/fog/rackspace/requests/load_balancers/get_ssl_termination.rb,
lib/fog/rackspace/requests/load_balancers/list_load_balancers.rb,
lib/fog/rackspace/requests/load_balancers/set_content_caching.rb,
lib/fog/rackspace/requests/load_balancers/set_ssl_termination.rb,
lib/fog/rackspace/requests/monitoring/get_logged_in_user_info.rb,
lib/fog/rackspace/requests/monitoring/list_notification_plans.rb,
lib/fog/rackspace/requests/networking/list_virtual_interfaces.rb,
lib/fog/rackspace/requests/orchestration/list_resource_events.rb,
lib/fog/rackspace/requests/orchestration/show_resource_schema.rb,
lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb,
lib/fog/rackspace/requests/load_balancers/delete_load_balancer.rb,
lib/fog/rackspace/requests/load_balancers/update_load_balancer.rb,
lib/fog/rackspace/requests/networking/create_virtual_interface.rb,
lib/fog/rackspace/requests/networking/delete_virtual_interface.rb,
lib/fog/rackspace/requests/auto_scale/execute_anonymous_webhook.rb,
lib/fog/rackspace/requests/orchestration/show_resource_metadata.rb,
lib/fog/rackspace/requests/orchestration/show_resource_template.rb,
lib/fog/rackspace/requests/load_balancers/get_connection_logging.rb,
lib/fog/rackspace/requests/load_balancers/remove_ssl_termination.rb,
lib/fog/rackspace/requests/load_balancers/set_connection_logging.rb,
lib/fog/rackspace/requests/load_balancers/delete_all_access_rules.rb,
lib/fog/rackspace/requests/load_balancers/get_load_balancer_usage.rb,
lib/fog/rackspace/requests/load_balancers/get_session_persistence.rb,
lib/fog/rackspace/requests/load_balancers/set_session_persistence.rb,
lib/fog/rackspace/requests/monitoring/get_network_interfaces_info.rb,
lib/fog/rackspace/requests/load_balancers/get_connection_throttling.rb,
lib/fog/rackspace/requests/load_balancers/set_connection_throttling.rb,
lib/fog/rackspace/requests/load_balancers/remove_session_persistence.rb,
lib/fog/rackspace/requests/load_balancers/remove_connection_throttling.rb
Defined Under Namespace
Modules: Errors, MockData
Classes: AutoScale, BlockStorage, Databases, Identity, LoadBalancers, Monitoring, Networking, Orchestration, Queues, Service
Constant Summary
collapse
- US_AUTH_ENDPOINT =
'https://identity.api.rackspacecloud.com/v2.0'
- UK_AUTH_ENDPOINT =
'https://lon.identity.api.rackspacecloud.com/v2.0'
Class Method Summary
collapse
Class Method Details
.authenticate(options, connection_options = {}) ⇒ Object
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
# File 'lib/fog/rackspace/core.rb', line 103
def self.authenticate(options, connection_options = {})
rackspace_auth_url = options[:rackspace_auth_url]
rackspace_auth_url ||= options[:rackspace_endpoint] == Fog::Compute::RackspaceV2::LON_ENDPOINT ? UK_AUTH_ENDPOINT : US_AUTH_ENDPOINT
url = rackspace_auth_url.match(/^https?:/) ? \
rackspace_auth_url : 'https://' + rackspace_auth_url
uri = URI.parse(url)
connection = Fog::Core::Connection.new(url, false, connection_options)
@rackspace_api_key = options[:rackspace_api_key]
@rackspace_username = options[:rackspace_username]
response = connection.request({
:expects => [200, 204],
:headers => {
'X-Auth-Key' => @rackspace_api_key,
'X-Auth-User' => @rackspace_username
},
:method => 'GET',
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v1.0'
})
response..reject do |key, value|
!['X-Server-Management-Url', 'X-Storage-Url', 'X-CDN-Management-Url', 'X-Auth-Token'].include?(key)
end
end
|
.escape(str, extra_exclude_chars = '') ⇒ Object
CGI.escape, but without special treatment on spaces
139
140
141
142
143
144
145
146
|
# File 'lib/fog/rackspace/core.rb', line 139
def self.escape(str, = '')
str.gsub(/([^a-zA-Z0-9_.#{}-]+)/) do
'%' + $1.unpack('H2' * $1.bytesize).join('%').upcase
end
end
|
.json_response?(response) ⇒ Boolean
126
127
128
129
|
# File 'lib/fog/rackspace/core.rb', line 126
def self.json_response?(response)
return false unless response && response.
response.('Content-Type') =~ %r{application/json}i ? true : false
end
|
.normalize_url(endpoint) ⇒ Object
131
132
133
134
135
136
|
# File 'lib/fog/rackspace/core.rb', line 131
def self.normalize_url(endpoint)
return nil unless endpoint
str = endpoint.chomp " "
str = str.chomp "/"
str.downcase
end
|