code: func (c *Cluster) CreateNetwork(s apitypes.NetworkCreateRequest) (string, error) {
  	if runconfig.IsPreDefinedNetwork(s.Name) {
  		err := notAllowedError(fmt.Sprintf("%s is a pre-defined network and cannot be created", s.Name))
  		return "", errors.WithStack(err)
  	}
  
  	var resp *swarmapi.CreateNetworkResponse
  	if err := c.lockedManagerAction(func(ctx context.Context, state nodeState) error {
  		networkSpec := convert.BasicNetworkCreateToGRPC(s)
  		r, err := state.controlClient.CreateNetwork(ctx, &swarmapi.CreateNetworkRequest{Spec: &networkSpec})
  		if err != nil {
  			return err
  		}
  		resp = r
  		return nil
  	}); err != nil {
  		return "", err
  	}
  
  	return resp.Network.ID, nil
  }
docs: // CreateNetwork creates a new cluster managed network.