blawesom / api_caller

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

This is a low level API handler designed to addresse Outscale APIs, based of information found on the public API documentation:

Setup

As for the classic AWS CLI, you need to export the endpoints for the region you target. Access Key and Secret Key are also needed.

In your shell, export to your environment:

  • $> export FCU_ENDPOINT=fcu.eu-west-2.outscale.com
  • $> export LBU_ENDPOINT=lbu.eu-west-2.outscale.com
  • $> export ICU_ENDPOINT=icu.eu-west-2.outscale.com
  • $> export EIM_ENDPOINT=eim.eu-west-2.outscale.com
  • $> export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXXXX
  • $> export AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Examples

For a DescribeInstances:

  • $> python ows_cli.py fcu --Action=DescribeInstances

For a DescribeSecurityGroups with filter:

  • $> python ows_cli.py fcu --Action=DescribeSecurityGroups --Filter.1.Name vpc-id --Filter.1.Value vpc-x54x4f0x

For a ListUsers on EIM service:

  • $> python ows_cli.py eim --Action=ListUsers

ToDo

Package to be called directly as:

  • ows fcu --Action=ActionToExecute

You can always make an alias such as:

  • $> alias ows='python /path/to/api_caller/ows_cli.py'

About


Languages

Language:Python 100.0%