def add_platform(name, platform_set, server_url):
 config = _get_asam_configuration(server_url)
 if (not config):
  return False
 platforms = list_platforms(server_url)
 if (name in platforms[server_url]):
  return {name: 'Specified platform already exists on {0}'.format(server_url)}
 platform_sets = list_platform_sets(server_url)
 if (platform_set not in platform_sets[server_url]):
  return {name: 'Specified platform set does not exist on {0}'.format(server_url)}
 url = config['platform_edit_url']
 data = {'platformName': name, 'platformSetName': platform_set, 'manual': 'false', 'previousURL': '/config/platformAdd.html', 'postType': 'PlatformAdd', 'Submit': 'Apply'}
 auth = (config['username'], config['password'])
 try:
  html_content = _make_post_request(url, data, auth, verify=False)
 except Exception as exc:
  err_msg = 'Failed to add platform on {0}'.format(server_url)
  log.error('{0}:\n{1}'.format(err_msg, exc))
  return {name: err_msg}
 platforms = list_platforms(server_url)
 if (name in platforms[server_url]):
  return {name: 'Successfully added platform on {0}'.format(server_url)}
 else:
  return {name: 'Failed to add platform on {0}'.format(server_url)}

def add_platform ( name , platform_set , server_url ) : config = _get_asam_configuration ( server_url ) if ( not config ) : return False platforms = list_platforms ( server_url ) if ( name in platforms [ server_url ] ) : return { name : 'Specified platform already exists on {0}' . format ( server_url ) } platform_sets = list_platform_sets ( server_url ) if ( platform_set not in platform_sets [ server_url ] ) : return { name : 'Specified platform set does not exist on {0}' . format ( server_url ) } url = config [ 'platform_edit_url' ] data = { 'platformName' : name , 'platformSetName' : platform_set , 'manual' : 'false' , 'previousURL' : '/config/platformAdd.html' , 'postType' : 'PlatformAdd' , 'Submit' : 'Apply' } auth = ( config [ 'username' ] , config [ 'password' ] ) try : html_content = _make_post_request ( url , data , auth , verify = False ) except Exception as exc : err_msg = 'Failed to add platform on {0}' . format ( server_url ) log . error ( '{0}:\n{1}' . format ( err_msg , exc ) ) return { name : err_msg } platforms = list_platforms ( server_url ) if ( name in platforms [ server_url ] ) : return { name : 'Successfully added platform on {0}' . format ( server_url ) } else : return { name : 'Failed to add platform on {0}' . format ( server_url ) }
to add an asam platform using the specified asam platform set on the novell fan-out driver cli example: .