Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sigmavirus24/6c7d43666ae8d99a2799056e8a80fe39 to your computer and use it in GitHub Desktop.
Save sigmavirus24/6c7d43666ae8d99a2799056e8a80fe39 to your computer and use it in GitHub Desktop.
from keystoneclient import session as ksc_session
from keystoneclient.auth.identity import v3
from keystoneclient.v3 import client as keystone_v3
from cratonclient.v1.client import Client
from cratonclient import session as c_session
import pdb
auth = v3.Password(auth_url='http://10.0.2.15:5000/v3', username = 'admin', password = 'secret', project_name = 'admin', user_domain_id = 'default', project_domain_id = 'default')
session = ksc_session.Session(auth=auth)
craton = Client(session=c_session.Session(session), url='127.0.0.1:8083/v1/')
craton.inventory(1).hosts.create(**{'name':'test', 'project_id':1,'ip_address':'1.1.1.1', 'region_id':1, 'device_type':'test'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment