code: func (r *resourceAllocator) AttachNetwork(ctx context.Context, id, target string, addresses []string) (string, error) {
  	var taskID string
  	if err := r.agent.withSession(ctx, func(session *session) error {
  		client := api.NewResourceAllocatorClient(session.conn.ClientConn)
  		r, err := client.AttachNetwork(ctx, &api.AttachNetworkRequest{
  			Config: &api.NetworkAttachmentConfig{
  				Target:    target,
  				Addresses: addresses,
  			},
  			ContainerID: id,
  		})
  		if err != nil {
  			return err
  		}
  		taskID = r.AttachmentID
  		return nil
  	}); err != nil {
  		return "", err
  	}
  
  	return taskID, nil
  }
docs: // AttachNetwork creates a network attachment.