github.com/cloud-foundations/dominator@v0.0.0-20221004181915-6e4fee580046/hypervisor/rpcd/getVmAccessToken.go (about)

     1  package rpcd
     2  
     3  import (
     4  	"github.com/Cloud-Foundations/Dominator/lib/errors"
     5  	"github.com/Cloud-Foundations/Dominator/lib/srpc"
     6  	"github.com/Cloud-Foundations/Dominator/proto/hypervisor"
     7  )
     8  
     9  func (t *srpcType) GetVmAccessToken(conn *srpc.Conn,
    10  	request hypervisor.GetVmAccessTokenRequest,
    11  	reply *hypervisor.GetVmAccessTokenResponse) error {
    12  	token, err := t.manager.GetVmAccessToken(request.IpAddress,
    13  		conn.GetAuthInformation(), request.Lifetime)
    14  	response := hypervisor.GetVmAccessTokenResponse{
    15  		Token: token,
    16  		Error: errors.ErrorToString(err),
    17  	}
    18  	*reply = response
    19  	return nil
    20  }