Agent SDK
|
Agent class performs all client/server communication with Ionic.com. More...
Public Member Functions | |
def | getLastServerResponse (self) |
Return the Server Response object from the last Agent call. More... | |
def | hasactiveprofile (self) |
Determine if any device profile is active. More... | |
def | setactiveprofile (self, deviceid) |
Set the current device profile of the agent. More... | |
def | getactiveprofile (self) |
Get the current device profile of the agent. More... | |
def | hasanyprofiles (self) |
Determine if any device profiles are loaded. More... | |
def | getallprofiles (self) |
Get all available device profiles. More... | |
def | addprofile (self, deviceprofile, makeactive=False) |
Add a device profile to the agent device profile collection. More... | |
def | removeprofile (self, deviceid) |
Remove a device profile from the agent device profile list. More... | |
def | getprofileforkeyid (self, keyid) |
Determine which device profile is associated with the provided key ID. More... | |
def | getmetadata (self) |
Get metadata dictionary that will be included with requests from this agent. More... | |
def | setmetadata (self, metadatadict) |
Set metadata dictionary to be included with requests from this agent. More... | |
def | loadprofiles (self, persistor) |
Load device profiles using the provided profile persistor. More... | |
def | saveprofiles (self, persistor) |
Save device profiles using the specified profile persistor. More... | |
def | createdevice (self, server, etag, token, uidauth, rsa_pub_key_base64, profilename='') |
Creates (registers) a device with Ionic.com. More... | |
def | createkey (self, attributes=None, metadata=None, mutableAttributes=None) |
Creates a single protection key with attributes through Ionic.com. More... | |
def | createkeys (self, keycount, attributes=None, metadata=None, mutableAttributes=None) |
Creates protection keys through Ionic.com. More... | |
def | getkey (self, keyid, metadata=None) |
Gets a single protection key from Ionic.com. More... | |
def | getkeys (self, keyids, metadata=None) |
Gets protection keys from Ionic.com. More... | |
def | getkeys2 (self, keyids, externalkeyids, metadata=None) |
Gets protection keys from Ionic.com. More... | |
def | updatekey (self, updateKeyData, metadata=None) |
Updates the mutable portion of the attributes on a protection key at Ionic.com. More... | |
def | updatekeys (self, KeyDataArray, metadata=None) |
Updates the mutable portion of the attributes on a list of protection keys at Ionic.com. More... | |
def | logmessage (self, msgtype, datajson, metadata=None) |
Logs a single messages to Ionic.com. More... | |
def | logmessages (self, msgtypes, datajsons, metadata=None) |
Logs one or more messages to Ionic.com. More... | |
def | createidassertion (self, foruri, nonce, metadata=None) |
Creates an identity assertion issued by an Ionic Key Server. More... | |
def | getresource (self, resourceid, args=None, metadata=None) |
Gets a generic resource from Ionic.com. More... | |
def | getresources (self, resourcelist, metadata=None) |
Gets one or more generic resource(s) from Ionic.com. More... | |
![]() | |
def | hasactiveprofile (self) |
Determine if any device profile is active. More... | |
def | getactiveprofile (self) |
Get the current device profile of the agent. More... | |
def | createkey (self, attributesdict=None, metadatadict=None, mutableAttributesdict=None) |
Creates a single protection key with attributes This method must be overridden in a subclass Otherwise, root class version will raise an exception. More... | |
def | createkeys (self, keycount, attributesdict=None, metadatadict=None, mutableAttributesdict=None) |
Creates protection keys. More... | |
def | getkey (self, keyidstring, metadatadict=None) |
Gets a single protection key. More... | |
def | getkeys (self, keyidstringlist, metadatadict=None) |
Gets protection keys. More... | |
def | updatekey (self, keydata, metadatadict=None) |
Updates the Mutable Attributes of a single protection key. More... | |
def | updatekeys (self, keydatalist, metadatadict=None) |
Updates the Mutable Attributes of protection keys. More... | |
Agent class performs all client/server communication with Ionic.com.
def ionicsdk.agent.Agent.addprofile | ( | self, | |
deviceprofile, | |||
makeactive = False |
|||
) |
Add a device profile to the agent device profile collection.
deviceprofile | (DeviceProfile): The device profile object. |
makeactive | (bool, optional): If true, then this profile will be set as the active profile (default: False). |
def ionicsdk.agent.Agent.createdevice | ( | self, | |
server, | |||
etag, | |||
token, | |||
uidauth, | |||
rsa_pub_key_base64, | |||
profilename = '' |
|||
) |
Creates (registers) a device with Ionic.com.
This method makes an HTTP call to Ionic.com to register a device.
It is the responsibility of the caller to save this new profile to a persistent store by calling Agent.saveprofiles() or by saving it in another way of their choice.
server | (string): The server to be used for the device registration call. |
etag | (string): The ETag (enrollment tag. |
token | (string): The token. |
uidauth | (string): The UIDAuth. |
rsa_pub_key_base64 | (string): The Base64 encoded RSA public key belonging to the EI (Enrollment Infrastructure). |
profilename | (string, optional): Device profile name to be used for the device being created (default: ''). |
def ionicsdk.agent.Agent.createidassertion | ( | self, | |
foruri, | |||
nonce, | |||
metadata = None |
|||
) |
Creates an identity assertion issued by an Ionic Key Server.
This method makes an HTTP call to Ionic.com to request the creation of an identity assertion by an Ionic Key Server. This assertion is useful for proving that the machine which requested the assertion is in fact a registered device in the Ionic Key Server. The Ionic Key Server which creates the assertion is the one associated with the currently active profile of this agent object (see Agent.getactiveprofile()).
foruri | (string): The URI for the assertion. |
nonce | (string): The nonce used for this assertion. |
metadata | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
def ionicsdk.agent.Agent.createkey | ( | self, | |
attributes = None , |
|||
metadata = None , |
|||
mutableAttributes = None |
|||
) |
Creates a single protection key with attributes through Ionic.com.
This method makes an HTTP call to Ionic.com to create a protection key with attributes.
attributes | (KeyAttributesDict, optional): The protection key attributes to use for creating the protection key. |
metadata | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
mutableAttributes | (KeyAttributesDict, optional): The protection key mutable attributes to use for creating the protection key. |
def ionicsdk.agent.Agent.createkeys | ( | self, | |
keycount, | |||
attributes = None , |
|||
metadata = None , |
|||
mutableAttributes = None |
|||
) |
Creates protection keys through Ionic.com.
This method makes an HTTP call to Ionic.com to create protection keys.
NOTE: please limit to 1,000 keys per request, otherwise the server will return an error.
keycount | (int): The number of keys to create. |
attributes | (KeyAttributesDict, optional): The protection key attributes to use for creating the protection keys. |
metadata | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
mutableAttributes | (KeyAttributesDict, optional): The protection key mutable attributes to use for creating the protection key. |
def ionicsdk.agent.Agent.getactiveprofile | ( | self | ) |
Get the current device profile of the agent.
def ionicsdk.agent.Agent.getallprofiles | ( | self | ) |
Get all available device profiles.
def ionicsdk.agent.Agent.getkey | ( | self, | |
keyid, | |||
metadata = None |
|||
) |
Gets a single protection key from Ionic.com.
This method makes an HTTP call to Ionic.com to get a protection key.
keyid | (string): The protection key ID to fetch. |
metadata | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
def ionicsdk.agent.Agent.getkeys | ( | self, | |
keyids, | |||
metadata = None |
|||
) |
Gets protection keys from Ionic.com.
This method makes an HTTP call to Ionic.com to get protection keys.
NOTE: please limit to 1,000 keys per request, otherwise the server will return an error.
keyids | (string): The list of protection key IDs to fetch. |
metadata | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
def ionicsdk.agent.Agent.getkeys2 | ( | self, | |
keyids, | |||
externalkeyids, | |||
metadata = None |
|||
) |
Gets protection keys from Ionic.com.
This method makes an HTTP call to Ionic.com to get protection keys.
NOTE: please limit to 1,000 keys per request, otherwise the server will return an error.
keyids | (string): The list of protection key IDs to fetch. |
externalkeyids | (string): Alternate list of external ids of keys to fetch. External ids reference keys with external ids in their AttributeMap. |
metadata | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
A list of keys that were successfully retrieved. It is important to note that even if the function succeeds, it does NOT mean that any or all of the requested keys were provided. The caller can iterate through the response object and determine which keys were returned by looking at the key ID property (KeyData.id).
A list of Query results. Each Query Result contains the external
key id and either a list of matching key ids (ionic) or an error code and error message. If a key just isn't found, there will be no Query result for it.
A list of per Key Errors. (Almost always empty) Each Error result
is generated when an error is generated from a specific key id such as a privilege error. Each Error is a dict containing a key id, a client error code, a server error code, and a server message
def ionicsdk.agent.Agent.getLastServerResponse | ( | self | ) |
Return the Server Response object from the last Agent call.
def ionicsdk.agent.Agent.getmetadata | ( | self | ) |
Get metadata dictionary that will be included with requests from this agent.
def ionicsdk.agent.Agent.getprofileforkeyid | ( | self, | |
keyid | |||
) |
Determine which device profile is associated with the provided key ID.
keyid | (string): The key ID for which to retrieve the associated device profile. |
def ionicsdk.agent.Agent.getresource | ( | self, | |
resourceid, | |||
args = None , |
|||
metadata = None |
|||
) |
Gets a generic resource from Ionic.com.
This method makes an HTTP call to Ionic.com to request a generic resource.
resourceid | (string): The resource/rpc ID string for this request. |
args | (string, optional): The optional arguments string for this request. |
metadata | (MetadataDict, optional): The metadata properties for this request. |
def ionicsdk.agent.Agent.getresources | ( | self, | |
resourcelist, | |||
metadata = None |
|||
) |
Gets one or more generic resource(s) from Ionic.com.
This method makes an HTTP call to Ionic.com to request generic resource(s).
resourcelist | (list[ResourceRequest]): A list of ResourceResquest Objects filled in with resource IDs and args. |
metadata | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
def ionicsdk.agent.Agent.hasactiveprofile | ( | self | ) |
Determine if any device profile is active.
def ionicsdk.agent.Agent.hasanyprofiles | ( | self | ) |
Determine if any device profiles are loaded.
def ionicsdk.agent.Agent.loadprofiles | ( | self, | |
persistor | |||
) |
Load device profiles using the provided profile persistor.
Attempts to load device profiles using the specified profile persistor.
If loading is successful, all existing profiles associated with the agent will be discarded in favor of the newly loaded profiles. The active profile provided by the persistor will replace the previous active profile (if any). It is also possible that the persistor does not provide an active profile, in which case the agent object will be left without an active profile.
If loading is not successful, then no changes are made to the state of the agent.
persistor | (DeviceProfilePersistorBase): The device profile persistor. |
def ionicsdk.agent.Agent.logmessage | ( | self, | |
msgtype, | |||
datajson, | |||
metadata = None |
|||
) |
Logs a single messages to Ionic.com.
This method makes an HTTP call to Ionic.com to post a single log message.
msgtype | (string): The message type string. |
datajson | (string): The message data in JSON format. |
metadata | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
def ionicsdk.agent.Agent.logmessages | ( | self, | |
msgtypes, | |||
datajsons, | |||
metadata = None |
|||
) |
Logs one or more messages to Ionic.com.
This method makes an HTTP call to Ionic.com to post one or more log messages.
msgtypes | (list[string]): The list of message type strings. |
datajsons | (list[string]): The list of message data strings in JSON format. |
metadata | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
def ionicsdk.agent.Agent.removeprofile | ( | self, | |
deviceid | |||
) |
Remove a device profile from the agent device profile list.
deviceid | (string): The device id of the profile to remove. |
def ionicsdk.agent.Agent.saveprofiles | ( | self, | |
persistor | |||
) |
Save device profiles using the specified profile persistor.
persistor | (DeviceProfilePersistorBase): The device profile persistor. |
def ionicsdk.agent.Agent.setactiveprofile | ( | self, | |
deviceid | |||
) |
Set the current device profile of the agent.
deviceid | (str): A string device id of a loaded profile to set as the active profile for the agent. If a DeviceProfile object is given instead it will use the deviceid parameter of the object as the string source. |
def ionicsdk.agent.Agent.setmetadata | ( | self, | |
metadatadict | |||
) |
Set metadata dictionary to be included with requests from this agent.
metadatadict | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
def ionicsdk.agent.Agent.updatekey | ( | self, | |
updateKeyData, | |||
metadata = None |
|||
) |
Updates the mutable portion of the attributes on a protection key at Ionic.com.
This method makes an HTTP call to Ionic.com to update protection keys.
updateKeyData | (UpdateKeyData): The key to be updated with mutable properties changed |
metadata | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
def ionicsdk.agent.Agent.updatekeys | ( | self, | |
KeyDataArray, | |||
metadata = None |
|||
) |
Updates the mutable portion of the attributes on a list of protection keys at Ionic.com.
This method makes an HTTP call to Ionic.com to update protection keys.
KeyDataArray | (UpdateKeyDataList): The keys to be updated with mutable properties changed |
metadata | (MetadataDict, optional): The metadata properties to send along with the HTTP request. |
You acknowledge your access, review and use of the documentation on this page is subject to the Ionic Security Inc. Documentation Use Rights.
© 2016-2018 Ionic Security Inc. All rights reserved.
Generated on Mon Jun 24 2019 10:20:14 for Agent SDK by
1.8.12