diff --git a/lib/fog/rackspace/docs/auto_scale.md b/lib/fog/rackspace/docs/auto_scale.md index a3e5ab2c0..78704c932 100644 --- a/lib/fog/rackspace/docs/auto_scale.md +++ b/lib/fog/rackspace/docs/auto_scale.md @@ -1,6 +1,6 @@ #Auto Scale (AutoScale) -This document explains how to get started using auto scale with Fog. It assumes you have read the [Getting Started with Fog and the Rackspace Open Cloud](getting_started.md) document. +This document explains how to get started using Auto Scale with Fog. It assumes you have read the [Getting Started with Fog and the Rackspace Open Cloud](getting_started.md) document. ## Basic Concepts @@ -15,7 +15,7 @@ Auto Scale functions by linking three services: ## Workflow -A scaling group is monitored by Rackspace Cloud Monitoring. When Monitoring triggers an alarm for high utilization within the Autoscaling group, a webhook is triggered. The webhook calls the auto scale service, which consults a policy in accordance with the webhook. The policy determines how many additional Cloud Servers should be added or removed in accordance with the alarm. +A scaling group is monitored by Rackspace Cloud Monitoring. When Monitoring triggers an alarm for high utilization within the Autoscaling group, a webhook is triggered. The webhook calls the Auto Scale service, which consults a policy in accordance with the webhook. The policy determines how many additional Cloud Servers should be added or removed in accordance with the alarm. Alarms may trigger scaling up or scaling down. Scale-down events always remove the oldest server in the group. @@ -43,7 +43,7 @@ If using Ruby 1.9.x execute: ## Create Service -Next, create a connection to auto scale: +Next, create a connection to Auto Scale: Using a US-based account: @@ -68,7 +68,7 @@ To learn more about obtaining cloud credentials refer to the [Getting Started wi By default `Fog::Rackspace::AutoScale` will authenticate against the US authentication endpoint. You can specify alternative authentication endpoints using the key `:rackspace_auth_url`. Please refer to [Alternate Authentication Endpoints](http://docs.rackspace.com/auth/api/v2.0/auth-client-devguide/content/Endpoints-d1e180.html) for a list of alternative Rackspace authentication endpoints. -Alternative regions are specified using the key `:rackspace_region `. A list of regions available for auto scale can be found by executing the following: +Alternative regions are specified using the key `:rackspace_region `. A list of regions available for Auto Scale can be found by executing the following: identity_service = Fog::Identity({ :provider => 'Rackspace', # Rackspace Fog provider @@ -142,7 +142,7 @@ This returns: #### Example Request -To request a list of volume types: +To request a list of Auto Scale groups: response = service.list_groups @@ -165,7 +165,7 @@ returns: {"groups_links"=>[], "groups"=>[{"paused"=>false, "desiredCapacity"=>0, "links"=>[{"href"=>"https://ord.autoscale.api.rackspacecloud.com/v1.0/555/groups/b45e6107-26ca-4a93-869d-46bf20005df3/", "rel"=>"self"}], "active"=>[], "pendingCapacity"=>0, "activeCapacity"=>0, "id"=>"b45e6107-26ca-4a93-869d-46bf20005df3", "name"=>"fog-scailing-group"}]} -To learn more about auto scale request methods refer to [rdoc](http://rubydoc.info/gems/fog/Fog/Rackspace/AutoScale/Real). To learn more about Excon refer to [Excon GitHub repo](https://github.com/geemus/excon). +To learn more about Auto Scale request methods refer to [rdoc](http://rubydoc.info/gems/fog/Fog/Rackspace/AutoScale/Real). To learn more about Excon refer to [Excon GitHub repo](https://github.com/geemus/excon). ### Model Layer @@ -369,7 +369,7 @@ Available options on `group_config` include `:max_entities`, `:name`, `:cooldow group_config.max_entities = 16 group_config.save -**Note**: If you pass any metadata values in this call, it must be the full set of metadata for the Scaling Group, since the underlying API call **overwrites** any existing metadata. +**Note**: If you pass any metadata values in this call, it must be the full set of metadata for the scaling group, since the underlying API call **overwrites** any existing metadata. ### Deleting a Scaling Group @@ -400,7 +400,7 @@ To retrieve the launch config: launch_config = group.launch_config -The launch configuration contains two attributes `:type` and `:args`. The only launch type currently available for auto scale is `:launch_server`. The `args` attribute contains a hash with the launch server configuration options as follows: +The launch configuration contains two attributes `:type` and `:args`. The only launch type currently available for Auto Scale is `:launch_server`. The `args` attribute contains a hash with the launch server configuration options as follows: {"server"=>{ "name"=>"autoscale_server", @@ -436,7 +436,7 @@ To add a policy to a scaling group use the following: Parameter | Required | Default | Notes ---- | ---- | ---- | ---- **:name** | yes | | -**:type** | yes | | This can be "webhook", "schedule" or "cloud_monitoring" +**:type** | yes | | This can be "webhook", "schedule" or "cloud monitoring" **:cooldown** | yes | | Period in seconds after a policy execution in which further events are ignored. This is separate from the overall cooldown for the scaling group. **:change** | no | | Can be positive or negative, which makes this a scale-up or scale-down policy, respectively. If this value is specified you can not specify `:change_percent`. **:change_percent** | no | | The percentage change to the autoscale group's number of units. If this value is specified you can not specify `:change`. diff --git a/lib/fog/rackspace/docs/getting_started.md b/lib/fog/rackspace/docs/getting_started.md index a0e83ab47..8f4c24f4e 100644 --- a/lib/fog/rackspace/docs/getting_started.md +++ b/lib/fog/rackspace/docs/getting_started.md @@ -71,6 +71,7 @@ These services can be explored in further depth in the following documents: * [Cloud Files™ (storage)](storage.md) * [Cloud Block Storage (block_storage)](block_storage.md) * [Auto Scale (auto_scale)](auto_scale.md) +* [Queues](queues.md) **Note**: The compute service provides an interface to the First Geneneration Cloud Servers™ (compute). This service is deprecated. Users are encouraged to use Next Geneneration Cloud Servers™ (compute_v2). diff --git a/lib/fog/rackspace/docs/queues.md b/lib/fog/rackspace/docs/queues.md new file mode 100644 index 000000000..51bf37b75 --- /dev/null +++ b/lib/fog/rackspace/docs/queues.md @@ -0,0 +1,312 @@ +#Cloud Queues (queues) + +This document explains how to get started using queues with Fog. It assumes you have read the [Getting Started with Fog and the Rackspace Open Cloud](getting_started.md) document. + +## Basic Concepts + +Cloud Queues is an open source, scalable, and highly available message and notifications service, based on the OpenStack Marconi project. Users of this service can create and manage a producer-consumer or a publisher-subscriber model. Unlimited queues and messages give users the flexibility they need to create powerful web applications in the cloud. + +It consists of a few basic components: queues, messages, claims, and statistics. In the producer-consumer model, users create queues in which producers, or servers, can post messages. Workers, or consumers, can then claim those messages and delete them after they complete the actions associated with the messages. A single claim can contain multiple messages, and administrators can query claims for status. + +In the publisher-subscriber model, messages are posted to a queue as in the producer-consumer model, but messages are never claimed. Instead, subscribers, or watchers, send GET requests to pull all messages that have been posted since their last request. In this model, a message remains in the queue, unclaimed, until the message's time to live (TTL) has expired. + +In both of these models, administrators can get queue statistics that display the most recent and oldest messages, the number of unclaimed messages, and more. + +## Starting irb console + +Start by executing the following command: + + irb + +Once `irb` has launched you need to require the Fog library as follows: + + require 'fog' + +## Create Service + +Next, create a connection to queue service: + +Using a US-based account: + + service = Fog::Rackspace::Queues( + :rackspace_username => RACKSPACE_USER_NAME, # Your Rackspace Username + :rackspace_api_key => RACKSPACE_API, # Your Rackspace API key + :rackspace_region => :ord, # Your desired region + :rackspace_queues_client_id => CLIENT_ID, # Your client ID + :connection_options => {} # Optional connection options + ) + +Using a UK-based account: + + service = Fog::Rackspace::Queues( + :rackspace_username => RACKSPACE_USER_NAME, # Your Rackspace Username + :rackspace_api_key => RACKSPACE_API, # Your Rackspace API key + :rackspace_auth_url => Fog::Rackspace::UK_AUTH_ENDPOINT, + :rackspace_region => :lon, # Your desired region + :rackspace_queues_client_id => CLIENT_ID', # Your client ID + :connection_options => {} # Optional connection options + ) + +To learn more about obtaining cloud credentials refer to the [Getting Started with Fog and the Rackspace Open Cloud](getting_started.md) document. + +### Authentication Endpoint + +By default `Fog::Rackspace::Queues` will authenticate against the US authentication endpoint. You can specify alternative authentication endpoints using the key `:rackspace_auth_url`. Please refer to [Alternate Authentication Endpoints](http://docs.rackspace.com/auth/api/v2.0/auth-client-devguide/content/Endpoints-d1e180.html) for a list of alternative Rackspace authentication endpoints. + +### Regions + +Alternative regions are specified using the key `:rackspace_region `. A list of regions available for cloud queues can be found by executing the following: + + identity_service = Fog::Identity({ + :provider => 'Rackspace', # Rackspace Fog provider + :rackspace_username => RACKSPACE_USER_NAME, # Your Rackspace Username + :rackspace_api_key => RACKSPACE_API, # Your Rackspace API key + :rackspace_auth_url => Fog::Rackspace::UK_AUTH_ENDPOINT # Not specified for US Cloud + }) + + identity_service.service_catalog.display_service_regions :queues + +### Private Cloud + +Rackspace Private Cloud installations can skip specifying a region and directly specify their custom service endpoints using the key `:rackspace_queues_url`. + +**Note**: A`Fog::Rackspace::Queues` instance is needed for the desired region. + +### Client ID + +The Rackspace Queue service requires that every client define a client id to help identify messages and claims specific to the client. This client id should take the form of a UUID and can be generated using fog as follows: + + Fog::UUID.uuid + +If the client id is omitted fog will generate one for you. + +### Optional Connection Parameters + +Fog supports passing additional connection parameters to its underlying HTTP library (Excon) using the `:connection_options` parameter. + +
Key | +Description | +
---|---|
:connect_timeout | +Connection timeout (default: 60 seconds) | +
:read_timeout | +Read timeout for connection (default: 60 seconds) |
:write_timeout | +Write timeout for connection (default: 60 seconds) | +
:proxy | +Proxy for HTTP and HTTPS connections | +
:ssl_ca_path | +Path to SSL certificate authorities | +
:ssl_ca_file | +SSL certificate authority file | +
:ssl_verify_peer | +SSL verify peer (default: true) | +
Method | +Description | +
---|---|
create | +
+ Accepts hash of attributes and creates object. + Note: creation is a non-blocking call and you will be required to wait for a valid state before using resulting object. + |
+
save | +Saves object. + Note: not all objects support updating object. |
+
persisted? | +Returns true if the object has been persisted. | +
destroy | +
+ Destroys object. + Note: this is a non-blocking call and object deletion might not be instantaneous. + |
+
reload | +Updates object with latest state from service. | +
ready? | +Returns true if object is in a ready state and able to perform actions. This method will raise an exception if object is in an error state. | +
attributes | +Returns a hash containing the list of model attributes and values. | +identity | +
+ Returns the identity of the object. + Note: This might not always be equal to object.id. + |
+
+
wait_for | +This method periodically reloads model and then yields to specified block until block returns true or a timeout occurs. | +