from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NetworkTypes import NetworkType, NetworkTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddNetworkType(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
NetworkType.fields['type']
]
returns = Parameter(int, '1 if successful')
+
def call(self, auth, name):
network_type = NetworkType(self.api)
network_type['type'] = name
- network_type.sync()
+ network_type.sync(insert = True)
return 1