1. A method implemented by a network controller for virtual network (VN) management, the method comprising: receiving, via an application programming interface (API), a request comprising program codes written in a declarative programming language describing aspects of a VN in terms of logics and goals and not describing how to accomplish the goals as a sequence of programming language primitives; converting the program codes into internal objects of the network controller, wherein the internal objects represent the aspects of the VN described by the program codes, wherein the aspects of the VN comprise at least one of network nodes, ports on the network nodes, or links between the ports, and wherein the program codes comprise instructions for creating the VN; and creating the VN using an internal API of the network controller according to the internal objects, which are understandable by the internal API.