public static Operation createOperationToUpdateOrCreateNetworkInterface(ComputeState existingComputeState,NetworkInterfaceState networkInterface,List<String> tenantLinks,StatelessService service,boolean isPublic){
  String existingInterfaceLink=getExistingNetworkInterfaceLink(existingComputeState,isPublic);
  Operation networkInterfaceOperation=null;
  if (existingInterfaceLink == null) {
    networkInterfaceOperation=createPostOperation(service,networkInterface,NetworkInterfaceService.FACTORY_LINK);
  }
 else {
    networkInterfaceOperation=createPatchOperation(service,networkInterface,existingInterfaceLink);
  }
  return networkInterfaceOperation;
}

public static Operation createOperationToUpdateOrCreateNetworkInterface ( ComputeState existingComputeState , NetworkInterfaceState networkInterface , List < String > tenantLinks , StatelessService service , boolean isPublic ) { String existingInterfaceLink = getExistingNetworkInterfaceLink ( existingComputeState , isPublic ) ; Operation networkInterfaceOperation = null ; if ( existingInterfaceLink == null ) { networkInterfaceOperation = createPostOperation ( service , networkInterface , NetworkInterfaceService . FACTORY_LINK ) ; } else { networkInterfaceOperation = createPatchOperation ( service , networkInterface , existingInterfaceLink ) ; } return networkInterfaceOperation ; }
compares the ip addresses of the instance on aws and maps those to the network interfaces in the system . 1 ) if an existing mapping is found for a private or public interface then it is updated . 2 ) else a new mapping is creating . 3 ) the string " public - interface / private - interfaces " is embedded in the document self link along with the uuid to avoid collisions while save some extra lookups during updates .
