code: func lookupNetworkID(cli *NetworkCli, nameID string) (string, error) {
  	obj, statusCode, err := readBody(cli.call("GET", "/networks?name="+nameID, nil, nil))
  	if err != nil {
  		return "", err
  	}
  
  	if statusCode != http.StatusOK {
  		return "", fmt.Errorf("name query failed for %s due to : statuscode(%d) %v", nameID, statusCode, string(obj))
  	}
  
  	var list []*networkResource
  	err = json.Unmarshal(obj, &list)
  	if err != nil {
  		return "", err
  	}
  	if len(list) > 0 {
  		// name query filter will always return a single-element collection
  		return list[0].ID, nil
  	}
  
  	// Check for Partial-id
  	obj, statusCode, err = readBody(cli.call("GET", "/networks?partial-id="+nameID, nil, nil))
  	if err != nil {
  		return "", err
  	}
  
  	if statusCode != http.StatusOK {
  		return "", fmt.Errorf("partial-id match query failed for %s due to : statuscode(%d) %v", nameID, statusCode, string(obj))
  	}
  
  	err = json.Unmarshal(obj, &list)
  	if err != nil {
  		return "", err
  	}
  	if len(list) == 0 {
  		return "", fmt.Errorf("resource not found %s", nameID)
  	}
  	if len(list) > 1 {
  		return "", fmt.Errorf("multiple Networks matching the partial identifier (%s). Please use full identifier", nameID)
  	}
  	return list[0].ID, nil
  }
docs: // Helper function to predict if a string is a name or id or partial-id
  // This provides a best-effort mechanism to identify an id with the help of GET Filter APIs
  // Being a UI, its most likely that name will be used by the user, which is used to lookup
  // the corresponding ID. If ID is not found, this function will assume that the passed string
  // is an ID by itself.