I am writing a Instance plugin and noticed that an api key is passed on to the account for the particular instance. What is the use case of the same api key? Is it similar to access token ?
Is there a way to get the access token within the plugin without making an external api call?
Not very much knowledge on plugins but happy to try help!
Do you have a value you can see when api key is passed, or are you exploring the plugin API?
Re your second point, I “think” you can access Cypher from the plugin via a service. Possible to pin your access token in there and then get via that route?
Pinning the access token to the cypher is one option.
But was wondering what is the use case of the api key.
The api key is similar to the access token, has the same length and is alpha numeric.
I don’t know.
Account - and I think tenant settings - currency provider API key, but I can’t see the a currency provider name in the class reference.
Instance - and think about the api key used by VMs when communicating back to the appliance to get the Morpheus Agent.
But I’m reaching.
That’s why I wondered if you had a value passed for the api key? If so you could cross reference it against a couple of things, certainly the above two things.
I will ask internally because I’m also intrigued, but I can’t make any guarantees re getting back.
EDIT : Ah, you do have a value - I missed that - check the tenant settings currency conversion provider, and go to the instance, virtual machine, on actions “download install agent script” and have a look in the bash file you get to rule out the above. You could also check all the access tokens for your user, though I imagine you have done that.
The field apiKey on com.morpheusdata.model.Account is populated directly from the api_key on the account table in Morpheus. apiKey will be an auto-generated UUID. You can use it as a unique ID for the account/tenant. Morpheus uses it as a unique ID internally, for example account_usage records will reference an account api_key field on the accountuuid field.
Understood thanks for clarifying