def main(): args = parse_args() kc = keystone_example.get_keystone_client( os_username=args.os_username, os_password=args.os_password, os_tenant_name=args.os_tenant_name, os_tenant_id=args.os_tenant_id, os_auth_url=args.os_auth_url ) # Find an endpoint for the 'image' service. endpoint = kc.service_catalog.url_for( service_type='network', endpoint_type='publicURL') # Authenticate to neutron using our Keystone token. nc = get_neutron_client(kc, args) networks = nc.list_networks() for network in networks.get('networks', []): print network['id'], network['name'] for subnet in network['subnets']: try: data = nc.show_subnet(subnet) print ' ', subnet, data['subnet']['cidr'] except NeutronClientException: print ' ', subnet, 'not found'
def main(): args = parse_args() kc = keystone_example.get_keystone_client( os_username=args.os_username, os_password=args.os_password, os_tenant_name=args.os_tenant_name, os_tenant_id=args.os_tenant_id, os_auth_url=args.os_auth_url) # Find an endpoint for the 'image' service. endpoint = kc.service_catalog.url_for(service_type='network', endpoint_type='publicURL') # Authenticate to neutron using our Keystone token. nc = get_neutron_client(kc, args) networks = nc.list_networks() for network in networks.get('networks', []): print network['id'], network['name'] for subnet in network['subnets']: try: data = nc.show_subnet(subnet) print ' ', subnet, data['subnet']['cidr'] except NeutronClientException: print ' ', subnet, 'not found'
def main(): logging.basicConfig(level=logging.DEBUG) args = parse_args() kc = keystone_example.get_keystone_client( os_username=args.os_username, os_password=args.os_password, os_tenant_name=args.os_tenant_name, os_tenant_id=args.os_tenant_id, os_auth_url=args.os_auth_url) # Authenticate to neutron using our Keystone token. cc = get_ceilometer_client(kc) import pprint for sample in cc.samples.list(meter_name='cpu_util', limit=10): print sample.timestamp, sample.counter_name, sample.counter_volume
def main(): args = parse_args() kc = keystone_example.get_keystone_client( os_username=args.os_username, os_password=args.os_password, os_tenant_name=args.os_tenant_name, os_tenant_id=args.os_tenant_id, os_auth_url=args.os_auth_url) nc = get_nova_client(kc) # Print a list of running servers. for server in nc.servers.list( search_opts={'all_tenants': args.all_tenants}): print server.id, server.name for network_name, network in server.networks.items(): print ' ', network_name, ', '.join(network)
def main(): logging.basicConfig(level=logging.DEBUG) args = parse_args() kc = keystone_example.get_keystone_client( os_username=args.os_username, os_password=args.os_password, os_tenant_name=args.os_tenant_name, os_tenant_id=args.os_tenant_id, os_auth_url=args.os_auth_url ) # Authenticate to neutron using our Keystone token. cc = get_ceilometer_client(kc) import pprint for sample in cc.samples.list(meter_name='cpu_util', limit=10): print sample.timestamp, sample.counter_name, sample.counter_volume
def main(): args = parse_args() kc = keystone_example.get_keystone_client( os_username=args.os_username, os_password=args.os_password, os_tenant_name=args.os_tenant_name, os_tenant_id=args.os_tenant_id, os_auth_url=args.os_auth_url ) nc = get_nova_client(kc) # Print a list of running servers. for server in nc.servers.list(search_opts={'all_tenants': args.all_tenants}): print server.id, server.name for network_name, network in server.networks.items(): print ' ', network_name, ', '.join(network)
def main(): args = parse_args() kc = keystone_example.get_keystone_client( os_username=args.os_username, os_password=args.os_password, os_tenant_name=args.os_tenant_name, os_tenant_id=args.os_tenant_id, os_auth_url=args.os_auth_url) # Find an endpoint for the 'image' service. endpoint = kc.service_catalog.url_for(service_type='image', endpoint_type='publicURL') # Authenticate to glance using our Keystone token. gc = glanceclient.Client(endpoint=endpoint, token=kc.auth_token) # Print information about available images. for image in gc.images.list(): print image['id'], image['name'], image['disk_format']
def main(): args = parse_args() kc = keystone_example.get_keystone_client(args) # Find an endpoint for the 'image' service. endpoint = kc.service_catalog.url_for(service_type='volume', endpoint_type='publicURL') # The cinder library does not appear to know how to make use # of an existing Keystone auth_token, so we need to provide it with a # username and password. cc = cinderclient.Client(args.os_username, args.os_password, None, auth_url=args.os_auth_url, tenant_id=args.os_tenant_id) # Print information about available volumes. for volume in cc.volumes.list(): print volume.id, volume.name, volume.size
def main(): args = parse_args() kc = keystone_example.get_keystone_client(args) # Find an endpoint for the 'image' service. endpoint = kc.service_catalog.url_for( service_type='volume', endpoint_type='publicURL') # The cinder library does not appear to know how to make use # of an existing Keystone auth_token, so we need to provide it with a # username and password. cc = cinderclient.Client( args.os_username, args.os_password, None, auth_url=args.os_auth_url, tenant_id=args.os_tenant_id) # Print information about available volumes. for volume in cc.volumes.list(): print volume.id, volume.name, volume.size
def main(): args = parse_args() kc = keystone_example.get_keystone_client( os_username=args.os_username, os_password=args.os_password, os_tenant_name=args.os_tenant_name, os_tenant_id=args.os_tenant_id, os_auth_url=args.os_auth_url ) # Find an endpoint for the 'image' service. endpoint = kc.service_catalog.url_for( service_type='image', endpoint_type='publicURL') # Authenticate to glance using our Keystone token. gc = glanceclient.Client( endpoint=endpoint, token=kc.auth_token) # Print information about available images. for image in gc.images.list(): print image['id'], image['name'], image['disk_format']