Welcome to RAX-AutoScaler’s documentation!

RAX-AutoScaler use the rackspace APIs to allow for scaling based on aggregate metrics across a cluster. Can be used and installed on the auto-scale group members or on a dedicated management instance.

Contents:

common.check_file(fname)[source]

This function checks if file exists and is readable.

Parameters:fname – file name
Returns:file name with absolute path
common.exit_with_error(msg)[source]

This function prints error message and exit with error.

Parameters:msg – error message
Returns:1 (int) – the return code
common.get_auth_value(args, config, key)[source]
This function returns value associated with the key if its available in
user arguments else in json config file.
Parameters:
  • args – user arguments
  • config – json configuration data
  • key – key name
Returns:

value associated with key

common.get_config(config_file)[source]

This function read and returns jsons configuration data

Parameters:config_file – json configuration file name
Returns:json data
common.get_logger()[source]

This function instantiate the logger.

Returns:logger
common.get_machine_uuid(scaling_group)[source]

This function will search for the server’s UUID and return it.

First it searches in a rax-autoscaler cache, followed by cloud-init cache. If it cannot find a cached UUID, it will get the details of each server in the scaling group in turn and attempt to match the local IP address with that of the server object returned from the API

Parameters:scaling_group – raxas.scaling_group.ScalingGroup object
Returns:None if no UUID could be matched against a cache file or the API. UUID as a string
common.get_server(server_id)[source]

It gets Cloud server object by server_id

common.is_ipv4(address)[source]

It checks if address is valid IP v4

class auth.Auth(username, apikey, region, identity_type='rackspace', token_filename='/home/docs/.rax-autoscaler-token')[source]

This class implements Rackspace cloud account authentication

authenticate()[source]

This method loads a token from a file, authenticate with it, and if it fails then tries to authenticate with credentials

Returns:True or False (Boolean)
authenticate_credentials()[source]

This method try to authenticate with available credentials

Returns:True or False (Boolean)
authenticate_token()[source]

This authenticate with Rackspace cloud using existing token.

Returns:True or False (Boolean)
force_unauthenticate()[source]

This unauthenticate and delete token file

load_token()[source]

This loads token from a file

Returns:True or False (Boolean)
save_token()[source]

This saves token to a file

Returns:True or False (Boolean)
static status()[source]

This queries pyrax for values

Returns:list – the return value
token_filename[source]

This returns token filename

Returns:_token_filename
class colouredconsolehandler.ColouredConsoleHandler(stream=None)[source]

console handler with ANSI colours support Usage example:

def white_bold_underlined(self, msg):
return self.decorate(self.BOLD + self.UNDERLINE +
self.COLOR[‘white’], msg)

ref: http://cwoebker.com/posts/ansi-escape-codes

Indices and tables

License

Copyright 2014 Rackspace US, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.