4.3.2.1. UpdateUser¶
-
class
dyn.tm.accounts.
UpdateUser
(*args, **kwargs)[source]¶ UpdateUser
type objects are a special form of aUser
which are tied to a specific Dynamic DNS services.-
__init__
(*args, **kwargs)[source]¶ Create an
UpdateUser
objectParameters: - user_name – the Username this
UpdateUser
uses or will use to log in to the DynECT System. AUpdateUser
‘s user_name is required for both creating and gettingUpdateUser
‘s. - nickname – When creating a new
UpdateUser
on the DynECT System, this nickname will be the System nickname for thisUpdateUser
- password – When creating a new
UpdateUser
on the DynECT System, this password will be the password thisUpdateUser
uses to log into the System
- user_name – the Username this
-
block
()[source]¶ Set the status of this
UpdateUser
to ‘blocked’. This will prevent thisUpdateUser
from logging in until they are explicitly unblocked.
-
delete
()[source]¶ Delete this
UpdateUser
from the DynECT System. It is important to note that this operation may not be undone.
-
nickname
¶ This
UpdateUser`s `nickname
. AnUpdateUser
‘s nickname is a read-only property which can not be updated after theUpdateUser
has been created.
-
password
¶ The current password for this
UpdateUser
. AnUpdateUser
‘s password may be reassigned.
-
status
¶ The current status of an
UpdateUser
will be one of either ‘active’ or ‘blocked’. BlockedUpdateUser
‘s are unable to log into the DynECT System, where activeUpdateUser
‘s are.
-
sync_password
()[source]¶ Pull in this
UpdateUser
current password from the DynECT System, in the unlikely event that thisUpdateUser
object’s password may have gotten out of sync
-
unblock
()[source]¶ Set the status of this
UpdateUser
to ‘active’. This will re-enable thisUpdateUser
to be able to login if they were previously blocked.
-
user_name
¶ This
UpdateUser
‘s user_name. AnUpdateUser
‘s user_name is a read-only property which can not be updated after theUpdateUser
has been created.
-
4.3.2.1.1. UpdateUser Examples¶
The following examples highlight how to use the UpdateUser
class to
get/create UpdateUser
‘s on the dyn.tm System and how to edit these
objects from within a Python script.
4.3.2.1.1.1. Creating a new UpdateUser¶
The following example shows how to create a new UpdateUser
on the
dyn.tm System and how to edit some of the fields using the returned
UpdateUser
object.
>>> from dyn.tm.accounts import UpdateUser
>>> # Create a dyn.tmSession
>>> new_user = UpdateUser('ausername', 'anickname', 'passw0rd')
>>> new_user.user_name
u'ausername'
>>> newuser.nickname
u'anickname'
>>> new_user.block()
>>> new_user.status
u'blocked'
>>> new_user.unblock()
>>> new_user.password = 'anewpassword'
>>> new_user.password
u'anewpassword'
4.3.2.1.1.2. Getting an Existing UpdateUser¶
The following example shows how to get an existing UpdateUser
from the
dyn.tm System and how to edit some of the same fields mentioned above.
>>> from dyn.tm.accounts import UpdateUser
>>> # Create a dyn.tmSession
>>> my_user = UpdateUser('myusername')
>>> my_user.user_name
u'myusername'
>>> my_user.status
u'blocked'
>>> my_user.unblock()
>>> my_user.status
u'active'