def save(nsc)
      if @existing
        xml = nsc.make_xml('RoleUpdateRequest')
      else
        xml = nsc.make_xml('RoleCreateRequest')
      end
      xml.add_element(as_xml)

      response  = APIRequest.execute(nsc.url, xml, '1.2', { timeout: nsc.timeout, open_timeout: nsc.open_timeout })
      xml       = REXML::XPath.first(response.res, 'RoleCreateResponse')
      @id       = xml.attributes['id'].to_i unless @existing
      @existing = true
      response.success
    end
def save(nsc)
      if @existing
        xml = nsc.make_xml('RoleUpdateRequest')
      else
        xml = nsc.make_xml('RoleCreateRequest')
      end
      xml.add_element(as_xml)

      response  = APIRequest.execute(nsc.url, xml, '1.2', { timeout: nsc.timeout, open_timeout: nsc.open_timeout })
      xml       = REXML::XPath.first(response.res, 'RoleCreateResponse')
      @id       = xml.attributes['id'].to_i unless @existing
      @existing = true
      response.success
    end
Create or save a Role to the Nexpose console.

 @param [Connection] nsc Nexpose connection.