def add(ctx, vapp_name, access_list): try: client = ctx.obj['client'] vdc_href = ctx.obj['profiles'].get('vdc_href') vdc = VDC(client, href=vdc_href) vapp = VApp(client, resource=vdc.get_vapp(vapp_name)) vapp.add_access_settings( access_settings_list=acl_str_to_list_of_dict(access_list)) stdout('Access settings added to vapp \'%s\'.' % vapp_name, ctx) except Exception as e: stderr(e, ctx)
def add(ctx, catalog_name, access_list): try: client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') org = Org(client, in_use_org_href) org.add_catalog_access_settings( catalog_name=catalog_name, access_settings_list=acl_str_to_list_of_dict(access_list)) stdout('Access settings added to catalog \'%s\'.' % catalog_name, ctx) except Exception as e: stderr(e, ctx)
def add(ctx, catalog_name, access_list): try: restore_session(ctx) client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') org = Org(client, in_use_org_href) org.add_catalog_access_settings( catalog_name=catalog_name, access_settings_list=acl_str_to_list_of_dict(access_list)) stdout('Access settings added to catalog \'%s\'.' % catalog_name, ctx) except Exception as e: stderr(e, ctx)
def add(ctx, vdc_name, access_list): try: client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') org = Org(client, in_use_org_href) vdc_resource = org.get_vdc(vdc_name) vdc = VDC(client, resource=vdc_resource) vdc.add_access_settings( access_settings_list=acl_str_to_list_of_dict(access_list)) stdout('Access settings added to vdc \'%s\'.' % vdc_name, ctx) except Exception as e: stderr(e, ctx)
def add(ctx, vapp_name, access_list): try: restore_session(ctx, vdc_required=True) client = ctx.obj['client'] vdc_href = ctx.obj['profiles'].get('vdc_href') vdc = VDC(client, href=vdc_href) vapp = VApp(client, resource=vdc.get_vapp(vapp_name)) vapp.add_access_settings( access_settings_list=acl_str_to_list_of_dict(access_list)) stdout('Access settings added to vapp \'%s\'.' % vapp_name, ctx) except Exception as e: stderr(e, ctx)
def add(ctx, vdc_name, access_list): try: restore_session(ctx) client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') org = Org(client, in_use_org_href) vdc_resource = org.get_vdc(vdc_name) vdc = VDC(client, resource=vdc_resource) vdc.add_access_settings( access_settings_list=acl_str_to_list_of_dict(access_list)) stdout('Access settings added to vdc \'%s\'.' % vdc_name, ctx) except Exception as e: stderr(e, ctx)
def add(ctx, catalog_name, access_list): try: client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') org = Org(client, in_use_org_href) updated_acl = org.add_catalog_access_settings( catalog_name=catalog_name, access_settings_list=acl_str_to_list_of_dict(access_list)) stdout( access_settings_to_list( updated_acl, ctx.obj['profiles'].get('org_in_use')), ctx, sort_headers=False) except Exception as e: stderr(e, ctx)
def remove(ctx, vapp_name, access_list, all): try: if all: click.confirm( 'Do you want to remove all access settings from the vapp ' '\'%s\'' % vapp_name, abort=True) client = ctx.obj['client'] vdc_href = ctx.obj['profiles'].get('vdc_href') vdc = VDC(client, href=vdc_href) vapp = VApp(client, resource=vdc.get_vapp(vapp_name)) vapp.remove_access_settings( access_settings_list=acl_str_to_list_of_dict(access_list), remove_all=all) stdout('Access settings removed from vapp \'%s\'.' % vapp_name, ctx) except Exception as e: stderr(e, ctx)
def remove(ctx, catalog_name, access_list, all): try: client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') org = Org(client, in_use_org_href) if all: click.confirm( 'Do you want to remove all access settings from the catalog ' '\'%s\'' % catalog_name, abort=True) org.remove_catalog_access_settings( catalog_name=catalog_name, access_settings_list=acl_str_to_list_of_dict(access_list), remove_all=all) stdout('Access settings removed from catalog \'%s\'.' % catalog_name, ctx) except Exception as e: stderr(e, ctx)
def remove(ctx, vapp_name, access_list, all): try: if all: click.confirm( 'Do you want to remove all access settings from the vapp ' '\'%s\'' % vapp_name, abort=True) restore_session(ctx, vdc_required=True) client = ctx.obj['client'] vdc_href = ctx.obj['profiles'].get('vdc_href') vdc = VDC(client, href=vdc_href) vapp = VApp(client, resource=vdc.get_vapp(vapp_name)) vapp.remove_access_settings( access_settings_list=acl_str_to_list_of_dict(access_list), remove_all=all) stdout('Access settings removed from vapp \'%s\'.' % vapp_name, ctx) except Exception as e: stderr(e, ctx)
def remove(ctx, catalog_name, access_list, all): try: restore_session(ctx) client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') org = Org(client, in_use_org_href) if all: click.confirm( 'Do you want to remove all access settings from the catalog ' '\'%s\'' % catalog_name, abort=True) org.remove_catalog_access_settings( catalog_name=catalog_name, access_settings_list=acl_str_to_list_of_dict(access_list), remove_all=all) stdout('Access settings removed from catalog \'%s\'.' % catalog_name, ctx) except Exception as e: stderr(e, ctx)
def remove(ctx, vdc_name, access_list, all): try: client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') if all: click.confirm( 'Do you want to remove all access settings from the vdc ' '\'%s\'' % vdc_name, abort=True) org = Org(client, in_use_org_href) vdc_resource = org.get_vdc(vdc_name) vdc = VDC(client, resource=vdc_resource) vdc.remove_access_settings( access_settings_list=acl_str_to_list_of_dict(access_list), remove_all=all) stdout('Access settings removed from vdc \'%s\'.' % vdc_name, ctx) except Exception as e: stderr(e, ctx)
def remove(ctx, vdc_name, access_list, all): try: restore_session(ctx) client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') if all: click.confirm( 'Do you want to remove all access settings from the vdc ' '\'%s\'' % vdc_name, abort=True) org = Org(client, in_use_org_href) vdc_resource = org.get_vdc(vdc_name) vdc = VDC(client, resource=vdc_resource) vdc.remove_access_settings( access_settings_list=acl_str_to_list_of_dict(access_list), remove_all=all) stdout('Access settings removed from vdc \'%s\'.' % vdc_name, ctx) except Exception as e: stderr(e, ctx)