Module Expr Str Assign NameStore Str Import alias Import alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Str Assign NameStore Call NameLoad Expr Str FunctionDef arguments args defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Global identifier Assign NameStore NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Dict FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq AttributeLoad NameLoad attr Num body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr orelse Expr Call AttributeLoad NameLoad attr Str NameLoad AttributeLoad NameLoad attr Expr Call NameLoad decorator_list If CompareIn Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign NameStore ListLoad NameLoad With Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameStore body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr keyword Num keyword Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr If AttributeLoad AttributeLoad NameLoad attr attr body ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num decorator_list decorator_list Assign NameStore Call AttributeLoad NameLoad attr ListLoad TupleLoad Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad FunctionDef arguments args NameParam defaults body Print NameLoad Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list Expr Call NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Return Num decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Call NameLoad
N/A N/A An interface to access Amazon Machine Instance (AMI) metadata.

The Metadata class provides a convenient interface to AMI metadata and
userdata. Metadata is configured dynamically and for each instance
individually; it contains values such as local and public IP
addresses, AMI instance and type information, launch index, and
security groups. Userdata is specified statically at instance launch
time and all instances receive the same userdata contents.

Internally, uses the tornado asynchronous http client to retrieve AMI
instance metadata from the static IP address:
http://169.254.169.254/latest/{meta-data,user-data}.

  Metadata: retrieves commonly used metadata and userdata and provides
            an interface for retrieving additional metadata.
 N/A __author__ spencer@emailscrubbed.com (Spencer Kimball) N/A logging N/A sys functools partial tornado httpclient options web ioloop viewfinder.backend.base util N/A N/A N/A options define mock default False help True to create a mock server for testing N/A _metadata N/A dict N/A Instance-specific AMI metadata. GetAMIMetadata N/A N/A N/A N/A N/A _metadata N/A SetAMIMetadata N/A N/A metadata N/A N/A N/A _metadata N/A _metadata metadata N/A Metadata N/A object N/A N/A Data object that provides a convenient interface to the Amazon AMI
  metdata and userdata. On instantiation, a default set of most
  commonly used metadata is queried asynchronously by default. If
  callback is specified, then it is invoked upon completion of this
  first set of queries. The default set contains:

  ami-id, ami-launch-index, hostname, instance-id, instance-type,
  local-hostname, local-ipv4, public-hostname, public-ipv4
   N/A _QUERY_IP 169.254.169.254 N/A _QUERY_VERSION latest __init__ N/A N/A self callback query_ip query_version N/A None _QUERY_IP _QUERY_VERSION N/A N/A Creates a `Metadata`.

    If `callback` is specified, launches async retrieval of commonly
    used metadata values and the userdata and invokes `callback` upon
    completion. Callback is invoked with a dictionary containing the
    common metadata and the userdata.

    :arg callback: invoked when default metadata is available
    :arg query_ip: IP address to query for metadata;
    default 169.254.169.254
    :arg query_version: Version of metadata; default 'latest'
     N/A N/A self _query_ip query_ip N/A N/A self _query_version query_version N/A callback N/A N/A N/A N/A self _FetchCommonMetadata callback N/A FetchMetadata N/A N/A self paths callback N/A N/A N/A Asynchronously fetches metadata for the specified path(s) and
    on completion invokes the callback with the retrieved metadata
    value. 'paths' can be iterable over multiple metadata to fetch;
    if not, adds it to a list.
     N/A metadata N/A _OnFetch N/A N/A path callback response N/A N/A N/A N/A N/A response code 200 N/A N/A N/A metadata N/A path N/A N/A N/A response body strip N/A N/A N/A N/A logging error error fetching '%s': %s path N/A response error N/A N/A callback N/A N/A N/A N/A type paths N/A unicode str N/A N/A paths N/A paths N/A N/A N/A util Barrier N/A partial callback metadata b N/A N/A path paths N/A N/A N/A N/A logging info N/A fetching metadata from %s N/A N/A self _GetQueryURL path N/A http_client N/A N/A httpclient AsyncHTTPClient N/A N/A N/A http_client fetch N/A N/A self _GetQueryURL path N/A partial _OnFetch path N/A N/A b Callback connect_timeout 1 request_timeout 5 N/A _GetQueryURL N/A N/A self path N/A N/A N/A Returns a query URL for instance metadata using the specified path.
     N/A N/A N/A http://{0}/{1}/{2} format N/A self _query_ip N/A self _query_version path N/A _FetchCommonMetadata N/A N/A self callback N/A N/A N/A Fetches common metadata values and compiles the results into
    a dictionary, which is passed to the callback on completion.

    NOTE: the AWS metadata server has some sort of internal rate-limiting
          for this data and will return 404 errors if too many are done
          in parallel. So, we fetch them serially.
     N/A paths N/A meta-data/hostname meta-data/instance-id user-data/passphrase N/A N/A N/A self FetchMetadata paths callback N/A N/A main N/A N/A N/A N/A N/A Creates a Metadata object, fetches the default dictionary of
  metadata values, and prints them.

  If --mock was specified on the command line, creates an http server
  for testing.
   N/A query_ip N/A Metadata _QUERY_IP N/A N/A N/A options parse_command_line N/A N/A N/A options options mock N/A tornado testing N/A port N/A N/A testing get_unused_port Handler N/A N/A web RequestHandler N/A get N/A N/A self path N/A N/A N/A N/A N/A self write N/A N/A N/A path split / N/A -1 N/A N/A N/A application N/A N/A web Application N/A N/A /(.*) Handler N/A N/A N/A application listen port N/A query_ip N/A N/A localhost:{0} format port _MetadataCallback N/A N/A metadata N/A N/A N/A metadata N/A N/A N/A N/A N/A N/A ioloop IOLoop current stop N/A N/A N/A Metadata callback _MetadataCallback query_ip query_ip N/A N/A N/A N/A N/A N/A ioloop IOLoop current start N/A 0 N/A N/A N/A __name__ __main__ N/A N/A N/A N/A sys exit N/A main