The API keys are for accessing the Memset API programatically not using a username and password. Their scope can be limited on creation so that it is possible to create API keys with just a single purpose.
API keys can be scoped with “name”, “method” or with both.
API keys created with “name” scopes can only be called with a parameter called “name” with one of the values supplied in the scope when it was created.
API keys created with “method” scopes can only be used to call those named methods and no others.
For example if an API key was created with the scopes:
{
"name": [ "server1", "server2" ]
}
Then it could only be used to access methods which take a “name” parameter and with that set to either “server1” or “server2”
If an API key was created with the scopes:
{
"method": [ "server.reboot" ]
}
Then it could only be used to call the “server.reboot” method.
If an API key was created with the scopes:
{
"method": [ "server.reboot" ],
"name": [ "server1", "server2" ]
}
Then it could only be used to call the “server.reboot” method on “server1” or “server2”.
Adds a single scope to an API key
Parameters: |
|
---|---|
Returns: | Dictionary: as described in apikey.info(). |
Creates a new API key for this account.
Parameters: |
|
---|---|
Returns: | a dictionary containing the new api key as described in apikey.info(). |
Deletes an API key.
Parameters: | id (String) – The API key. API Keys are 32 hex digits. |
---|---|
Returns: | an empty dictionary. |
Deletes a single scope to an API key. Doesn’t raise an error if it didn’t exist.
Parameters: |
|
---|---|
Returns: | Dictionary: as described in apikey.info(). |
Describes the API key.
Parameters: | id (String) – The API key. API Keys are 32 hex digits. |
---|---|
Returns: | a dictionary with the following keys:
|
List all the API keys for this account.
Returns: | a list of dictionaries where each dictionary is as described in apikey.info(). |
---|