Code Monkey home page Code Monkey logo

python-otcextensions's Introduction

OpenTelekomCloud extensions

https://travis-ci.org/OpenTelekomCloud/python-otcextensions.svg?branch=master Documentation Status

OTCExtensions is a project to bring OTC extensions into the native OpenStack toolstack. Covered are currently following items:

  • python-openstacksdk
  • python-openstackclient

The primary goal is to provide a possibility to use native OpenStack SDK and CLI with the OTC additional services

Getting Started

The very first step to get started is to install otcextensions into your system. For this please follow installation instructions

Next step would be logically configuration

Configuration

openstack.config

The recommended way, since it is the most efficient way to configure both SDK and the CLI in one place

openstack.config will find cloud configuration for as few as 1 clouds and as many as you want to put in a config file. It will read environment variables and config files, and it also contains some vendor specific default values so that you don't have to know extra info to use OpenStack

  • If you have a config file, you will get the clouds listed in it
  • If you have environment variables, you will get a cloud named envvars
  • If you have neither, you will get a cloud named defaults with base defaults

Sometimes an example is nice.

Create a clouds.yaml file:

clouds:
 otc:
   auth:
     username: 'USER_NAME'
     password: 'PASS'
     project_name: 'eu-de'
     auth_url: 'https://iam.eu-de.otc.t-systems.com:443/v3'
     user_domain_name: 'OTC00000000001000000xxx'
   interface: 'public'
   identity_api_version: 3 # !Important
   ak: 'AK_VALUE' # AK/SK pair for access to OBS
   sk: 'SK_VALUE'

Please note: openstack.config will look for a file called clouds.yaml in the following locations:

  • Current Directory
  • ~/.config/openstack
  • /etc/openstack

AK/SK values required for access to some services (i.e. OBS) can be either configured as shown above in the clouds.yaml/secure.yaml, or they can be automatically retrieved from the S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY. Values from the clouds.yaml/secure.yaml take precedence over the ones from environment.

With this configuration you can start using openstackCLI simply openstack --os-cloud otc

More information at https://developer.openstack.org/sdks/python/openstacksdk/users/config

Old style way

The CLI can be configured via environment variables and command-line options as listed in https://docs.openstack.org/python-openstackclient/latest/cli/authentication.html or https://developer.openstack.org/sdks/python/openstacksdk/users/config.

Authentication using username/password is often used:

export OS_AUTH_URL=<url-to-openstack-identity>
export OS_IDENTITY_API_VERSION=3
export OS_PROJECT_NAME=<project-name>
export OS_PROJECT_DOMAIN_NAME=<project-domain-name>
export OS_USERNAME=<username>
export OS_USER_DOMAIN_NAME=<user-domain-name>
export OS_PASSWORD=<password>  # (optional)
export S3_ACCESS_KEY_ID=<access_key>
export S3_SECRET_ACCESS_KEY=<secret_access_key>

The corresponding command-line options look very similar:

--os-auth-url <url>
--os-identity-api-version 3
--os-project-name <project-name>
--os-project-domain-name <project-domain-name>
--os-username <username>
--os-user-domain-name <user-domain-name>
[--os-password <password>]

If a password is not provided above (in plaintext), you will be interactively prompted to provide one securely.

Authentication may also be performed using an already-acquired token and a URL pointing directly to the service API that presumably was acquired from the Service Catalog:

export OS_TOKEN=<token>
export OS_URL=<url-to-openstack-service>

The corresponding command-line options look very similar:

--os-token <token>
--os-url <url-to-openstack-service>

In addition to that a regular clouds.yaml configuration file can be used

Links

python-otcextensions's People

Contributors

gtema avatar hodigy avatar otcbot avatar zsoltn avatar kucerakk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.