def authenticate_with_username_password(): """Authenticate in by directly providing username/password to Yamcs.""" credentials = Credentials(username='******', password='******') client = YamcsClient('localhost:8090', credentials=credentials) for link in client.list_data_links('simulator'): print(link)
def authenticate_with_access_token(access_token): """Authenticate using an existing access token.""" credentials = Credentials(access_token=access_token) client = YamcsClient('localhost:8090', credentials=credentials) for link in client.list_data_links('simulator'): print(link)
def list_(self, args): opts = utils.CommandOptions(args) client = YamcsClient(**opts.client_kwargs) rows = [['NAME', 'CLASS', 'STATUS', 'IN', 'OUT']] for link in client.list_data_links(opts.instance): rows.append([ link.name, link.class_name, link.status, link.in_count, link.out_count, ]) utils.print_table(rows)