from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.AddressTypes import AddressType, AddressTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field not in ['address_type_id']
address_type_fields = dict(filter(can_update, AddressType.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
address_type_fields
]
from PLC.Parameter import Parameter, Mixed
from PLC.AddressTypes import AddressType, AddressTypes
from PLC.Addresses import Address, Addresses
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddAddressTypeToAddress(Method):
"""
roles = ['admin', 'pi']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(AddressType.fields['address_type_id'],
AddressType.fields['name']),
Address.fields['address_id']
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.BootStates import BootState, BootStates
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddBootState(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
BootState.fields['boot_state']
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.ConfFiles import ConfFile, ConfFiles
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field not in \
['conf_file_id', 'node_ids', 'nodegroup_ids']
conf_file_fields = dict(filter(can_update, ConfFile.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
conf_file_fields
]
from PLC.Parameter import Parameter, Mixed
from PLC.ConfFiles import ConfFile, ConfFiles
from PLC.Nodes import Node, Nodes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddConfFileToNode(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
ConfFile.fields['conf_file_id'],
Mixed(Node.fields['node_id'],
Node.fields['hostname'])
from PLC.Parameter import Parameter, Mixed
from PLC.ConfFiles import ConfFile, ConfFiles
from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddConfFileToNodeGroup(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
ConfFile.fields['conf_file_id'],
Mixed(NodeGroup.fields['nodegroup_id'],
NodeGroup.fields['name'])
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.KeyTypes import KeyType, KeyTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddKeyType(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
KeyType.fields['key_type']
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NetworkMethods import NetworkMethod, NetworkMethods
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddNetworkMethod(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
NetworkMethod.fields['method']
]
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']
]
from PLC.Nodes import Node, Nodes
from PLC.NodeGroups import NodeGroup, NodeGroups
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['hostname', 'boot_state', 'model', 'version']
node_fields = dict(filter(can_update, Node.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Site.fields['site_id'],
Site.fields['login_base']),
node_fields
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['name', 'description']
nodegroup_fields = dict(filter(can_update, NodeGroup.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
nodegroup_fields
]
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field not in ['nodenetwork_id', 'node_id']
nodenetwork_fields = dict(filter(can_update, NodeNetwork.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname']),
nodenetwork_fields
from PLC.Parameter import Parameter, Mixed
from PLC.NodeGroups import NodeGroup, NodeGroups
from PLC.Nodes import Node, Nodes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddNodeToNodeGroup(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(NodeGroup.fields['nodegroup_id'],
NodeGroup.fields['name']),
Mixed(Node.fields['node_id'],
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.PCUs import PCU, PCUs
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddNodeToPCU(Method):
"""
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname']),
PCU.fields['pcu_id'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.PCUs import PCU, PCUs
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Sites import Site, Sites
can_update = lambda (field, value): field in \
pcu_fields = dict(filter(can_update, PCU.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Site.fields['site_id'],
Site.fields['login_base']),
pcu_fields
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['first_name', 'last_name', 'title',
person_fields = dict(filter(can_update, Person.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
person_fields
]
from PLC.Parameter import Parameter, Mixed
from PLC.Keys import Key, Keys
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field not in ['key_id']
key_fields = dict(filter(can_update, Key.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
key_fields
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddPersonToSite(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
Mixed(Site.fields['site_id'],
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Slices import Slice, Slices
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddPersonToSlice(Method):
"""
roles = ['admin', 'pi']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
Mixed(Slice.fields['slice_id'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Roles import Role, Roles
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddRole(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Role.fields['role_id'],
Role.fields['name']
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Roles import Role, Roles
class AddRoleToPerson(Method):
roles = ['admin', 'pi']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Role.fields['role_id'],
Role.fields['name']),
Mixed(Person.fields['person_id'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['name', 'abbreviated_name', 'login_base',
site_fields = dict(filter(can_update, Site.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
site_fields
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Addresses import Address, Addresses
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Sites import Site, Sites
can_update = lambda (field, value): field in \
address_fields = dict(filter(can_update, Address.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Site.fields['site_id'],
Site.fields['login_base']),
address_fields
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Slices import Slice, Slices
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Sites import Site, Sites
can_update = lambda (field, value): field in \
slice_fields = dict(filter(can_update, Slice.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
slice_fields
]
from PLC.Slices import Slice, Slices
from PLC.Nodes import Node, Nodes
from PLC.SliceAttributes import SliceAttribute, SliceAttributes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddSliceAttribute(Method):
"""
roles = ['admin', 'pi', 'user']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(SliceAttribute.fields['slice_id'],
SliceAttribute.fields['name']),
Mixed(SliceAttribute.fields['attribute_type_id'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['name', 'description', 'min_role_id']
attribute_type_fields = dict(filter(can_update, SliceAttributeType.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
attribute_type_fields
]
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.Slices import Slice, Slices
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AddSliceToNodes(Method):
"""
roles = ['admin', 'pi', 'user']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Slice.fields['slice_id'],
Slice.fields['name']),
[Mixed(Node.fields['node_id'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.AddressTypes import AddressType, AddressTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.AddAddressType import AddAddressType
class AdmAddAddressType(AddAddressType):
status = "deprecated"
accepts = [
- PasswordAuth(),
+ Auth(),
AddressType.fields['name']
]
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.AddNode import AddNode
can_update = lambda (field, value): field in \
node_fields = dict(filter(can_update, Node.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Site.fields['site_id'],
Node.fields['hostname'],
Node.fields['boot_state'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.AddNodeGroup import AddNodeGroup
class AdmAddNodeGroup(AddNodeGroup):
status = "deprecated"
accepts = [
- PasswordAuth(),
+ Auth(),
NodeGroup.fields['name'],
NodeGroup.fields['description']
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.AddNodeNetwork import AddNodeNetwork
can_update = lambda (field, value): field not in ['nodenetwork_id', 'node_id', 'method', 'type']
nodenetwork_fields = dict(filter(can_update, NodeNetwork.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
NodeNetwork.fields['node_id'],
NodeNetwork.fields['method'],
NodeNetwork.fields['type'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.AddPerson import AddPerson
can_update = lambda (field, value): field in \
person_fields = dict(filter(can_update, Person.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Person.fields['first_name'],
Person.fields['last_name'],
person_fields
from PLC.Parameter import Parameter, Mixed
from PLC.Keys import Key, Keys
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.AddPersonKey import AddPersonKey
class AdmAddPersonKey(AddPersonKey):
status = "deprecated"
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
Key.fields['key_type'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.AddSite import AddSite
can_update = lambda (field, value): field in \
site_fields = dict(filter(can_update, Site.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Site.fields['name'],
Site.fields['abbreviated_name'],
Site.fields['login_base'],
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.PCUs import PCU, PCUs
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.AddNodeToPCU import AddNodeToPCU
class AdmAssociateNodeToPowerControlUnitPort(AddNodeToPCU):
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
PCU.fields['pcu_id'],
Parameter(int, 'PCU port number'),
Mixed(Node.fields['node_id'],
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Keys import Key, Keys
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmDeleteAllPersonKeys(Method):
"""
roles = ['admin', 'pi', 'tech', 'user']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email'])
]
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Nodes import Node, Nodes
from PLC.NodeNetworks import NodeNetwork, NodeNetworks
from PLC.Methods.DeleteNodeNetwork import DeleteNodeNetwork
status = "deprecated"
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname']),
Mixed(NodeNetwork.fields['nodenetwork_id'],
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Keys import Key, Keys
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmDeletePersonKeys(Method):
"""
roles = ['admin', 'pi', 'tech', 'user']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
[Key.fields['key_id']]
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.PCUs import PCU, PCUs
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.DeleteNodeFromPCU import DeleteNodeFromPCU
class AdmDisassociatePowerControlUnitPort(DeleteNodeFromPCU):
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
PCU.fields['pcu_id'],
Parameter(int, 'PCU port number'),
]
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmGenerateNodeConfFile(Method):
"""
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname'])
]
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.GetNodeNetworks import GetNodeNetworks
class AdmGetAllNodeNetworks(GetNodeNetworks):
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname'])
]
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.GetRoles import GetRoles
class AdmGetAllRoles(GetRoles):
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.NodeGroups import NodeGroup, NodeGroups
class AdmGetNodeGroupNodes(Method):
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(NodeGroup.fields['nodegroup_id'],
NodeGroup.fields['name'])
]
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Keys import Key, Keys
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.GetKeys import GetKeys
class AdmGetPersonKeys(GetKeys):
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
[Key.fields['key_id']]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmGetPersonRoles(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email'])
]
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmGetPersonSites(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email'])
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.PCUs import PCU, PCUs
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmGetPowerControlUnitNodes(Method):
"""
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
PCU.fields['pcu_id']
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmGetSiteNodes(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[Mixed(Site.fields['site_id'],
Site.fields['name'])],
]
from PLC.Parameter import Parameter, Mixed
from PLC.Sites import Site, Sites
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmGetSitePIs(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Site.fields['site_id'],
Site.fields['login_base'])
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmGetSitePersons(Method):
"""
roles = ['admin', 'pi']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Site.fields['site_id'],
Site.fields['login_base'])
]
from PLC.Parameter import Parameter, Mixed
from PLC.PCUs import PCU, PCUs
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmGetSitePowerControlUnits(Method):
"""
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Site.fields['site_id'],
Site.fields['login_base'])
]
from PLC.Parameter import Parameter, Mixed
from PLC.Sites import Site, Sites
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmGetSiteTechContacts(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Site.fields['site_id'],
Site.fields['login_base'])
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Roles import Role, Roles
class AdmIsPersonInRole(Method):
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
Mixed(Parameter(int, "Role identifier"),
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.ConfFiles import ConfFile, ConfFiles
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmQueryConfFile(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
{'node_id': Node.fields['node_id']}
]
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.NodeNetworks import NodeNetwork, NodeNetworks, valid_ip
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmQueryNode(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
{'node_hostname': Node.fields['hostname'],
'nodenetwork_ip': NodeNetwork.fields['ip'],
'nodenetwork_mac': NodeNetwork.fields['mac'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmQueryPerson(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
{'email': Person.fields['email']}
]
from PLC.PCUs import PCU, PCUs
from PLC.Nodes import Node, Nodes
from PLC.NodeNetworks import NodeNetwork, NodeNetworks, valid_ip
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmQueryPowerControlUnit(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
{'pcu_hostname': PCU.fields['hostname'],
'pcu_ip': PCU.fields['ip'],
'node_hostname': Node.fields['hostname'],
from PLC.Sites import Site, Sites
from PLC.Nodes import Node, Nodes
from PLC.NodeNetworks import NodeNetwork, NodeNetworks, valid_ip
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmQuerySite(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
{'site_name': Site.fields['name'],
'site_abbreviatedname': Site.fields['abbreviated_name'],
'site_loginbase': Site.fields['login_base'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.UpdatePerson import UpdatePerson
class AdmSetPersonEnabled(UpdatePerson):
status = "deprecated"
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
Person.fields['enabled']
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Methods.UpdateNodeGroup import UpdateNodeGroup
class AdmUpdateNodeGroup(UpdateNodeGroup):
status = "deprecated"
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(NodeGroup.fields['nodegroup_id'],
NodeGroup.fields['name']),
NodeGroup.fields['name'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Keys import Key, Keys
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class BlacklistKey(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Key.fields['key_id'],
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth, BootAuth
+from PLC.Auth import Auth, BootAuth
class BootUpdateNode(Method):
"""
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Addresses import Address, Addresses
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteAddress(Method):
"""
roles = ['admin', 'pi']
accepts = [
- PasswordAuth(),
+ Auth(),
Address.fields['address_id'],
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.AddressTypes import AddressType, AddressTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteAddressType(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(AddressType.fields['address_type_id'],
AddressType.fields['name'])
]
from PLC.Parameter import Parameter, Mixed
from PLC.AddressTypes import AddressType, AddressTypes
from PLC.Addresses import Address, Addresses
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteAddressTypeFromAddress(Method):
"""
roles = ['admin', 'pi']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(AddressType.fields['address_type_id'],
AddressType.fields['name']),
Address.fields['address_id']
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.BootStates import BootState, BootStates
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteBootState(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
BootState.fields['boot_state']
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.ConfFiles import ConfFile, ConfFiles
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteConfFile(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
ConfFile.fields['conf_file_id']
]
from PLC.Parameter import Parameter, Mixed
from PLC.ConfFiles import ConfFile, ConfFiles
from PLC.Nodes import Node, Nodes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteConfFileFromNode(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
ConfFile.fields['conf_file_id'],
Mixed(Node.fields['node_id'],
Node.fields['hostname'])
from PLC.Parameter import Parameter, Mixed
from PLC.ConfFiles import ConfFile, ConfFiles
from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteConfFileFromNodeGroup(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
ConfFile.fields['conf_file_id'],
Mixed(NodeGroup.fields['nodegroup_id'],
NodeGroup.fields['name'])
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Keys import Key, Keys
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteKey(Method):
"""
roles = ['admin', 'pi', 'tech', 'user']
accepts = [
- PasswordAuth(),
+ Auth(),
Key.fields['key_id'],
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.KeyTypes import KeyType, KeyTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteKeyType(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
KeyType.fields['key_type']
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NetworkMethods import NetworkMethod, NetworkMethods
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteNetworkMethod(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
NetworkMethod.fields['method']
]
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 DeleteNetworkType(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
NetworkType.fields['type']
]
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Nodes import Node, Nodes
class DeleteNode(Method):
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname'])
]
from PLC.Parameter import Parameter, Mixed
from PLC.NodeGroups import NodeGroup, NodeGroups
from PLC.Nodes import Node, Nodes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteNodeFromNodeGroup(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(NodeGroup.fields['nodegroup_id'],
NodeGroup.fields['name']),
Mixed(Node.fields['node_id'],
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.PCUs import PCU, PCUs
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteNodeFromPCU(Method):
"""
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname']),
PCU.fields['pcu_id']
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.NodeGroups import NodeGroup, NodeGroups
class DeleteNodeGroup(Method):
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(NodeGroup.fields['nodegroup_id'],
NodeGroup.fields['name'])
]
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Nodes import Node, Nodes
from PLC.NodeNetworks import NodeNetwork, NodeNetworks
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(NodeNetwork.fields['nodenetwork_id'],
NodeNetwork.fields['ip'])
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.PCUs import PCU, PCUs
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeletePCU(Method):
"""
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
PCU.fields['pcu_id'],
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeletePerson(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email'])
]
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeletePersonFromSite(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
Mixed(Site.fields['site_id'],
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Slices import Slice, Slices
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeletePersonFromSlice(Method):
"""
roles = ['admin', 'pi']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
Mixed(Slice.fields['slice_id'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Roles import Role, Roles
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteRole(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Role.fields['role_id'],
Role.fields['name'])
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Roles import Role, Roles
class DeleteRoleFromPerson(Method):
roles = ['admin', 'pi']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Role.fields['role_id'],
Role.fields['name']),
Mixed(Person.fields['person_id'],
from PLC.Persons import Person, Persons
from PLC.Nodes import Node, Nodes
from PLC.PCUs import PCU, PCUs
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteSite(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Site.fields['site_id'],
Site.fields['login_base'])
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Slices import Slice, Slices
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteSlice(Method):
"""
roles = ['admin', 'pi', 'user']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Slice.fields['slice_id'],
Slice.fields['name']),
]
from PLC.SliceAttributes import SliceAttribute, SliceAttributes
from PLC.Slices import Slice, Slices
from PLC.Nodes import Node, Nodes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteSliceAttribute(Method):
"""
roles = ['admin', 'pi', 'user']
accepts = [
- PasswordAuth(),
+ Auth(),
SliceAttribute.fields['slice_attribute_id']
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteSliceAttributeType(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(SliceAttributeType.fields['attribute_type_id'],
SliceAttributeType.fields['name']),
]
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.Slices import Slice, Slices
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class DeleteSliceFromNodes(Method):
"""
roles = ['admin', 'pi', 'user']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Slice.fields['slice_id'],
Slice.fields['name']),
[Mixed(Node.fields['node_id'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.AddressTypes import AddressType, AddressTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetAddressTypes(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[Mixed(AddressType.fields['address_type_id'],
AddressType.fields['name'])]
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Addresses import Address, Addresses
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetAddresses(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[Address.fields['address_id']],
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.BootStates import BootState, BootStates
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetBootStates(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth()
+ Auth()
]
returns = [BootState.fields['boot_state']]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.ConfFiles import ConfFile, ConfFiles
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetConfFiles(Method):
"""
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
[ConfFile.fields['conf_file_id']]
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Events import Event, Events
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetEvents(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[Event.fields['event_id']],
[Event.fields['person_id']],
Event.fields['object_ids'],
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.KeyTypes import KeyType, KeyTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetKeyTypes(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth()
+ Auth()
]
returns = [KeyType.fields['key_type']]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Keys import Key, Keys
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetKeys(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[Key.fields['key_id']]
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NetworkMethods import NetworkMethod, NetworkMethods
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetNetworkMethods(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth()
+ Auth()
]
returns = [NetworkMethod.fields['method']]
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 GetNetworkTypes(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth()
+ Auth()
]
returns = [NetworkType.fields['type']]
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.NodeGroups import NodeGroup, NodeGroups
class GetNodeGroups(Method):
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[Mixed(NodeGroup.fields['nodegroup_id'],
NodeGroup.fields['name'])]
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetNodeNetworks(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[Mixed(NodeNetwork.fields['nodenetwork_id'],
NodeNetwork.fields['ip'])]
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetNodes(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[Mixed(Node.fields['node_id'],
Node.fields['hostname'])],
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.PCUs import PCU, PCUs
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetPCUs(Method):
"""
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[PCU.fields['pcu_id']]
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetPersons(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[Mixed(Person.fields['person_id'],
Person.fields['email'])],
Parameter([str], 'List of fields to return')
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Roles import Role, Roles
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetRoles(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth()
+ Auth()
]
returns = [Role.fields]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Sites import Site, Sites
class GetSites(Method):
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[Mixed(Site.fields['site_id'],
Site.fields['login_base'])]
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
class GetSliceAttributeTypes(Method):
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
[Mixed(SliceAttributeType.fields['attribute_type_id'],
SliceAttributeType.fields['name'])],
]
from PLC.Sites import Site, Sites
from PLC.Slices import Slice, Slices
from PLC.Nodes import Node, Nodes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class GetSliceAttributes(Method):
"""
roles = ['admin', 'pi', 'user']
accepts = [
- PasswordAuth(),
+ Auth(),
[SliceAttribute.fields['slice_attribute_id']],
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Slices import Slice, Slices
class GetSlices(Method):
roles = ['admin', 'pi', 'user']
accepts = [
- PasswordAuth(),
+ Auth(),
[Mixed(Slice.fields['slice_id'],
Slice.fields['name'])]
]
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Nodes import Node, Nodes
from PLC.NodeNetworks import NodeNetwork, NodeNetworks
from PLC.NodeGroups import NodeGroup, NodeGroups
roles = ['admin']
accepts = [
- PasswordAuth(),
+ Auth(),
[Mixed(Node.fields['node_id'],
Node.fields['hostname'])]
]
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.POD import udp_pod
class RebootNode(Method):
roles = ['admin', 'pi', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname'])
]
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class SetPersonPrimarySite(Method):
"""
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
Mixed(Site.fields['site_id'],
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Slices import Slice, Slices
from PLC.Methods.AddSlice import AddSlice
status = "deprecated"
accepts = [
- PasswordAuth(),
+ Auth(),
Slice.fields['name'],
AddSlice.accepts[1]
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Addresses import Address, Addresses
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['line1', 'line2', 'line3',
address_fields = dict(filter(can_update, Address.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Address.fields['address_id'],
address_fields
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.AddressTypes import AddressType, AddressTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in ['name', 'description']
address_type_fields = dict(filter(can_update, AddressType.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(AddressType.fields['address_type_id'],
AddressType.fields['name']),
address_type_fields
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.ConfFiles import ConfFile, ConfFiles
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field not in \
['conf_file_id', 'node_ids', 'nodegroup_ids']
conf_file_fields = dict(filter(can_update, ConfFile.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
ConfFile.fields['conf_file_id'],
conf_file_fields
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Keys import Key, Keys
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['key_type', 'key']
key_fields = dict(filter(can_update, Key.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Key.fields['key_id'],
key_fields
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['hostname', 'boot_state', 'model', 'version',
node_fields = dict(filter(can_update, Node.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname']),
node_fields
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['name', 'description']
nodegroup_fields = dict(filter(can_update, NodeGroup.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(NodeGroup.fields['nodegroup_id'],
NodeGroup.fields['name']),
nodegroup_fields
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field not in \
['nodenetwork_id']
nodenetwork_fields = dict(filter(can_update, NodeNetwork.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(NodeNetwork.fields['nodenetwork_id'],
NodeNetwork.fields['ip']),
nodenetwork_fields
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.PCUs import PCU, PCUs
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field not in \
['pcu_id', 'site_id']
update_fields = dict(filter(can_update, PCU.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
PCU.fields['pcu_id'],
update_fields
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['first_name', 'last_name', 'title', 'email',
person_fields = dict(filter(can_update, Person.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email']),
person_fields
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['name', 'abbreviated_name',
site_fields = dict(filter(can_update, Site.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Site.fields['site_id'],
Site.fields['login_base']),
site_fields
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Slices import Slice, Slices
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
from PLC.Sites import Site, Sites
can_update = lambda (field, value): field in \
slice_fields = dict(filter(can_update, Slice.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Slice.fields['slice_id'],
Slice.fields['name']),
slice_fields
from PLC.Parameter import Parameter, Mixed
from PLC.SliceAttributes import SliceAttribute, SliceAttributes
from PLC.Slices import Slice, Slices
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class UpdateSliceAttribute(Method):
"""
roles = ['admin', 'pi', 'user']
accepts = [
- PasswordAuth(),
+ Auth(),
SliceAttribute.fields['slice_attribute_id'],
SliceAttribute.fields['value']
]
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
can_update = lambda (field, value): field in \
['name', 'description', 'min_role_id']
attribute_type_fields = dict(filter(can_update, SliceAttributeType.fields.items()))
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(SliceAttributeType.fields['attribute_type_id'],
SliceAttributeType.fields['name']),
attribute_type_fields
-methods = 'AddAddressType AddAddressTypeToAddress AddBootState AddConfFile AddConfFileToNodeGroup AddConfFileToNode AddKeyType AddNetworkMethod AddNetworkType AddNodeGroup AddNodeNetwork AddNode AddNodeToNodeGroup AddNodeToPCU AddPCU AddPersonKey AddPerson AddPersonToSite AddPersonToSlice AddRole AddRoleToPerson AddSiteAddress AddSite AddSliceAttribute AddSliceAttributeType AddSlice AddSliceToNodes AdmAddAddressType AdmAddNodeGroup AdmAddNodeNetwork AdmAddNode AdmAddNodeToNodeGroup AdmAddPersonKey AdmAddPerson AdmAddPersonToSite AdmAddSitePowerControlUnit AdmAddSite AdmAssociateNodeToPowerControlUnitPort AdmAuthCheck AdmDeleteAddressType AdmDeleteAllPersonKeys AdmDeleteNodeGroup AdmDeleteNodeNetwork AdmDeleteNode AdmDeletePersonKeys AdmDeletePerson AdmDeleteSitePowerControlUnit AdmDeleteSite AdmDisassociatePowerControlUnitPort AdmGenerateNodeConfFile AdmGetAllAddressTypes AdmGetAllKeyTypes AdmGetAllNodeNetworks AdmGetAllRoles AdmGetNodeGroupNodes AdmGetNodeGroups AdmGetNodes AdmGetPersonKeys AdmGetPersonRoles AdmGetPersonSites AdmGetPersons AdmGetPowerControlUnitNodes AdmGetPowerControlUnits AdmGetSiteNodes AdmGetSitePersons AdmGetSitePIs AdmGetSitePowerControlUnits AdmGetSites AdmGetSiteTechContacts AdmGrantRoleToPerson AdmIsPersonInRole AdmQueryConfFile AdmQueryNode AdmQueryPerson AdmQueryPowerControlUnit AdmQuerySite AdmRebootNode AdmRemoveNodeFromNodeGroup AdmRemovePersonFromSite AdmRevokeRoleFromPerson AdmSetPersonEnabled AdmSetPersonPrimarySite AdmUpdateNodeGroup AdmUpdateNodeNetwork AdmUpdateNode AdmUpdatePerson AdmUpdateSitePowerControlUnit AdmUpdateSite AuthCheck BlacklistKey BootCheckAuthentication BootUpdateNode DeleteAddress DeleteAddressTypeFromAddress DeleteAddressType DeleteBootState DeleteConfFileFromNodeGroup DeleteConfFileFromNode DeleteConfFile DeleteKey DeleteKeyType DeleteNetworkMethod DeleteNetworkType DeleteNodeFromNodeGroup DeleteNodeFromPCU DeleteNodeGroup DeleteNodeNetwork DeleteNode DeletePCU DeletePersonFromSite DeletePersonFromSlice DeletePerson DeleteRoleFromPerson DeleteRole DeleteSite DeleteSliceAttribute DeleteSliceAttributeType DeleteSliceFromNodes DeleteSlice GetAddresses GetAddressTypes GetBootStates GetConfFiles GetEvents GetKeys GetKeyTypes GetNetworkMethods GetNetworkTypes GetNodeGroups GetNodeNetworks GetNodes GetPCUs GetPersons GetRoles GetSites GetSliceAttributes GetSliceAttributeTypes GetSlices GetSlivers RebootNode SetPersonPrimarySite SliceCreate SliceDelete UpdateAddress UpdateAddressType UpdateConfFile UpdateKey UpdateNodeGroup UpdateNodeNetwork UpdateNode UpdatePCU UpdatePerson UpdateSite UpdateSliceAttribute UpdateSliceAttributeType UpdateSlice system.listMethods system.methodHelp system.methodSignature system.multicall'.split()
+methods = 'AddAddressType AddAddressTypeToAddress AddBootState AddConfFile AddConfFileToNodeGroup AddConfFileToNode AddKeyType AddNetworkMethod AddNetworkType AddNodeGroup AddNodeNetwork AddNode AddNodeToNodeGroup AddNodeToPCU AddPCU AddPersonKey AddPerson AddPersonToSite AddPersonToSlice AddRole AddRoleToPerson AddSiteAddress AddSite AddSliceAttribute AddSliceAttributeType AddSlice AddSliceToNodes AdmAddAddressType AdmAddNodeGroup AdmAddNodeNetwork AdmAddNode AdmAddNodeToNodeGroup AdmAddPersonKey AdmAddPerson AdmAddPersonToSite AdmAddSitePowerControlUnit AdmAddSite AdmAssociateNodeToPowerControlUnitPort AdmAuthCheck AdmDeleteAddressType AdmDeleteAllPersonKeys AdmDeleteNodeGroup AdmDeleteNodeNetwork AdmDeleteNode AdmDeletePersonKeys AdmDeletePerson AdmDeleteSitePowerControlUnit AdmDeleteSite AdmDisassociatePowerControlUnitPort AdmGenerateNodeConfFile AdmGetAllAddressTypes AdmGetAllKeyTypes AdmGetAllNodeNetworks AdmGetAllRoles AdmGetNodeGroupNodes AdmGetNodeGroups AdmGetNodes AdmGetPersonKeys AdmGetPersonRoles AdmGetPersonSites AdmGetPersons AdmGetPowerControlUnitNodes AdmGetPowerControlUnits AdmGetSiteNodes AdmGetSitePersons AdmGetSitePIs AdmGetSitePowerControlUnits AdmGetSites AdmGetSiteTechContacts AdmGrantRoleToPerson AdmIsPersonInRole AdmQueryConfFile AdmQueryNode AdmQueryPerson AdmQueryPowerControlUnit AdmQuerySite AdmRebootNode AdmRemoveNodeFromNodeGroup AdmRemovePersonFromSite AdmRevokeRoleFromPerson AdmSetPersonEnabled AdmSetPersonPrimarySite AdmUpdateNodeGroup AdmUpdateNodeNetwork AdmUpdateNode AdmUpdatePerson AdmUpdateSitePowerControlUnit AdmUpdateSite AuthCheck BlacklistKey BootCheckAuthentication BootGetNodeDetails BootUpdateNode DeleteAddress DeleteAddressTypeFromAddress DeleteAddressType DeleteBootState DeleteConfFileFromNodeGroup DeleteConfFileFromNode DeleteConfFile DeleteKey DeleteKeyType DeleteNetworkMethod DeleteNetworkType DeleteNodeFromNodeGroup DeleteNodeFromPCU DeleteNodeGroup DeleteNodeNetwork DeleteNode DeletePCU DeletePersonFromSite DeletePersonFromSlice DeletePerson DeleteRoleFromPerson DeleteRole DeleteSession DeleteSite DeleteSliceAttribute DeleteSliceAttributeType DeleteSliceFromNodes DeleteSlice GetAddresses GetAddressTypes GetBootStates GetConfFiles GetEvents GetKeys GetKeyTypes GetNetworkMethods GetNetworkTypes GetNodeGroups GetNodeNetworks GetNodes GetPCUs GetPersons GetRoles GetSession GetSites GetSliceAttributes GetSliceAttributeTypes GetSlices GetSlivers RebootNode SetPersonPrimarySite SliceCreate SliceDelete UpdateAddress UpdateAddressType UpdateConfFile UpdateKey UpdateNodeGroup UpdateNodeNetwork UpdateNode UpdatePCU UpdatePerson UpdateSite UpdateSliceAttribute UpdateSliceAttributeType UpdateSlice system.listMethods system.methodHelp system.methodSignature system.multicall'.split()