Skip to content

A project for gathering relevant data from GCP API about VMs/etc in GCP.

Notifications You must be signed in to change notification settings

iisti/cloud_infra_gather_api_data

Repository files navigation

Cloud Infrastructure Gather API Data

  • A project for gathering relevant data from cloud providers API about VMs/etc.
    • Relevant data means: what is running where and IPs/etc.

Development instructions

On Windows 10

  1. Install WSL (Windows Subsystem Linux (the easiest way to use Linux in Windows)

Installing Python3 and virtualenv on Debian WSL

  1. Clone the repository

    git clone https://github.com/iisti/cloud_infra_gather_api_data.git
    
  2. Install Python3 and pip3

    sudo apt-get install python3 python3-pip
    
  3. Install virtualenv using pip3

    pip3 install virtualenv
    
  4. Create virtual environment

    virtualenv cloud_infra_gather_api_data/virtualenv
    
  5. Activate virtual environment

    source cloud_infra_gather_api_data/virtualenv/bin/activate
    # If you get error "virtualenv: command not found", relogin into shell and try again.
    
  6. One can check which virtualenv is in use by:

    echo $VIRTUAL_ENV
    /home/iisti/scripts/cloud_infra_gather_api_data/virtualenv
    
  7. Deactivate (just to know how it's done)

    deactivate
    
  8. Install modules

     # Remember to activate virtualenv before
     pip3 install -r requirements.txt
    

GCP (Google Cloud Providor) instructions

  1. Create service account for connecting to GCP API.
    1. GCP Projcet -> IAM & Admin -> Service Accounts -> Create service account
    2. Input name.
    3. Step: Grant this service account access to project (optional)
      • User role "Basic: viewer" = Read access to all resources.
    4. Step: Grant users access to this service account (optional)
      • This is not needed.
    5. Select the new service account and create new key in JSON format.
    6. Copy/move the credential JSON to this project root and rename it with prefix "credential_", so that the credentials will not be uploaded to GitHub by accident.
    7. Required information from GCP:
      • Service account ID == api_key for Libcloud
      • Project ID, this string can be found from GCP Project Dashboard.

About

A project for gathering relevant data from GCP API about VMs/etc in GCP.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages