code: def create_peer(self, name, url, username, password, peer_type="REPLICATION"):
      
      if self._get_resource_root().version < 11:
        peer_type = None
      peer = ApiCmPeer(self._get_resource_root(),
          name=name,
          url=url,
          username=username,
          password=password,
          type=peer_type)
      return self._post("peers", ApiCmPeer, data=peer, api_version=3)
docs: Create a new peer for replication.
  
      @param name: The name of the peer.
      @param url: The url of the peer.
      @param username: The admin username to use to setup the remote side of the peer connection.
      @param password: The password of the admin user.
      @param peer_type: Added in v11. The type of the peer. Defaults to 'REPLICATION'.
      @return: The newly created peer.
      @since: API v3