示例#1
0
文件: api.py 项目: smagowr/ralph
 class Meta:
     queryset = IPAddress.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_network_structure,
     ])
     filtering = {
         'address': ALL,
         'created': ALL,
         'device': ALL,
         'hostname': ALL,
         'http_family': ALL,
         'id': ALL,
         'is_management': ALL,
         'last_plugins': ALL,
         'last_puppet': ALL,
         'last_seen': ALL,
         'modified': ALL,
         'number': ALL,
         'snmp_community': ALL,
     }
     excludes = (
         'dns_info',
         'max_save_priority',
         'save_priorities',
         'snmp_name',
         'cache_version',
     )
     cache = SimpleCache()
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#2
0
 class Meta:
     queryset = CIOwner.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_configuration_item_info_generic,
     ])
     list_allowed_methods = ['get', 'post']
     filtering = {
         'cache_version': ALL,
         'created': ALL,
         'email': ALL,
         'first_name': ALL,
         'id': ALL,
         'last_name': ALL,
         'modified': ALL,
         'resource_uri': ALL,
         'sAMAccountName': ALL,
     }
     excludes = ('cache_version', )
     resource_name = 'ciowners'
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#3
0
文件: api.py 项目: smagowr/ralph
 class Meta:
     queryset = VentureRole.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(
         required_perms=[
             Perm.read_dc_structure,
         ]
     )
     filtering = {
         'created': ALL,
         'devices': ALL,
         'id': ALL,
         'modified': ALL,
         'name': ALL,
         'parent': ALL,
         'path': ALL,
         'properties': ALL,
         'venture': ALL_WITH_RELATIONS,
     }
     excludes = ('save_priorities', 'max_save_priority', 'cache_version', )
     cache = SimpleCache()
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#4
0
文件: api.py 项目: smagowr/ralph
 class Meta:
     queryset = Venture.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(
         required_perms=[
             Perm.read_dc_structure,
         ]
     )
     filtering = {
         'created': ALL,
         'data_center': ALL_WITH_RELATIONS,
         'business_segment': ALL_WITH_RELATIONS,
         'profit_center': ALL_WITH_RELATIONS,
         'department': ALL_WITH_RELATIONS,
         'devices': ALL,
         'id': ALL,
         'is_infrastructure': ALL,
         'modified': ALL,
         'name': ALL,
         'path': ALL,
         'roles': ALL,
         'show_in_ralph': ALL,
         'symbol': ALL,
     }
     excludes = ('save_priorities', 'max_save_priority', 'cache_version', )
     cache = SimpleCache()
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#5
0
文件: api.py 项目: pombreda/ralph
 class Meta:
     queryset = CIChangePuppet.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_configuration_item_info_puppet,
     ])
     filtering = {
         'configuration_version': ALL,
         'created': ALL,
         'host': ALL,
         'id': ALL,
         'kind': ALL,
         'modified': ALL,
         'resource_uri': ALL,
         'status': ALL,
         'time': ALL,
     }
     excludes = ('cache_version', )
     list_allowed_methods = ['get', 'post']
     resource_name = 'cichangepuppet'
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#6
0
文件: api.py 项目: smagowr/ralph
 class Meta:
     queryset = DeviceModel.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_dc_structure,
     ])
     filtering = {
         'chassis_size': ALL,
         'created': ALL,
         'group': ALL,
         'id': ALL,
         'modified': ALL,
         'name': ALL,
     }
     excludes = (
         'save_priorities',
         'max_save_priority',
         'cache_version',
     )
     cache = SimpleCache()
     filtering = {
         'type': ALL,
     }
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#7
0
文件: api.py 项目: pombreda/ralph
 class Meta:
     queryset = CIChangeCMDBHistory.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_configuration_item_info_generic,
     ])
     filtering = {
         'ci': ALL,
         'comment': ALL,
         'created': ALL,
         'field_name': ALL,
         'id': ALL,
         'modified': ALL,
         'new_value': ALL,
         'old_value': ALL,
         'resource_uri': ALL,
         'time': ALL,
     }
     excludes = ('cache_version', )
     list_allowed_methods = ['get']
     resource_name = 'cichangecmdbhistory'
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#8
0
文件: api.py 项目: pombreda/ralph
 class Meta:
     queryset = CIChangeZabbixTrigger.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_configuration_item_info_generic,
     ])
     filtering = {
         'comments': ALL,
         'created': ALL,
         'description': ALL,
         'host': ALL,
         'host_id': ALL,
         'id': ALL,
         'lastchange': ALL,
         'modified': ALL,
         'priority': ALL,
         'resource_uri': ALL,
         'status': ALL,
         'trigger_id': ALL,
     }
     excludes = ('cache_version', )
     list_allowed_methods = ['get', 'post']
     resource_name = 'cichangezabbixtrigger'
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#9
0
文件: api.py 项目: pombreda/ralph
 class Meta:
     queryset = CIChange.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_configuration_item_info_generic,
     ])
     filtering = {
         'created': ALL,
         'external_key': ALL,
         'id': ALL,
         'message': ALL,
         'modified': ALL,
         'object_id': ALL,
         'priority': ALL,
         'registration_type': ALL,
         'resource_uri': ALL,
         'time': ALL,
         'type': ALL,
     }
     excludes = ('cache_version', )
     allowed_methods = ['get']
     resource_name = 'cichange'
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#10
0
 class Meta:
     queryset = Deployment.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(
         required_perms=[
             Perm.read_deployment,
         ]
     )
     filtering = {
         'created': ALL,
         'device': ALL_WITH_RELATIONS,
         'done_plugins': ALL,
         'hostname': ALL,
         'id': ALL,
         'img_path': ALL,
         'ip': ALL,
         'is_running': ALL,
         'issue_key': ALL,
         'kickstart_path': ALL,
         'mac': ALL,
         'modified': ALL,
         'status': ALL,
         'status_lastchanged': ALL,
         'user': ALL_WITH_RELATIONS,
         'venture': ALL_WITH_RELATIONS,
         'venture_role': ALL_WITH_RELATIONS,
     }
     excludes = ('save_priorities', 'max_save_priority', 'cache_version', )
     cache = SimpleCache()
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#11
0
文件: api.py 项目: pombreda/ralph
 class Meta:
     queryset = CI.objects.filter(type__id=db.CI_TYPES.SERVICE.id).all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_configuration_item_info_generic,
     ])
     filtering = {
         'added_manually': ALL,
         'barcode': ALL,
         'business_service': ALL,
         'created': ALL,
         'modified': ALL,
         'name': ALL,
         'object_id': ALL,
         'pci_scope': ALL,
         'resource_uri': ALL,
         'state': ALL,
         'status': ALL,
         'technical_service': ALL,
         'uid': ALL,
         'zabbix_id': ALL,
     }
     excludes = ('cache_version', )
     list_allowed_methods = ['get']
     resource_name = 'service'
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#12
0
文件: api.py 项目: pombreda/ralph
 class Meta:
     excludes = ('save_priorities', 'max_save_priority')
     filtering = {
         'barcode': ALL,
         'boot_firmware': ALL,
         'cached_cost': ALL,
         'cached_price': ALL,
         'chassis_position': ALL,
         'created': ALL,
         'dc': ALL,
         'deleted': ALL,
         'deprecation_date': ALL,
         'diag_firmware': ALL,
         'hard_firmware': ALL,
         'id': ALL,
         'ip_addresses': ALL_WITH_RELATIONS,
         'last_seen': ALL,
         'management': ALL,
         'mgmt_firmware': ALL,
         'model': ALL_WITH_RELATIONS,
         'modified': ALL,
         'name': ALL,
         'position': ALL,
         'price': ALL,
         'properties': ALL,
         'purchase_date': ALL,
         'rack': ALL,
         'remarks': ALL,
         'role': ALL_WITH_RELATIONS,
         'service': ALL_WITH_RELATIONS,
         'device_environment': ALL_WITH_RELATIONS,
         'sn': ALL,
         'support_expiration_date': ALL,
         'support_kind': ALL,
         'uptime_seconds': ALL,
         'uptime_timestamp': ALL,
         'venture': ALL_WITH_RELATIONS,
         'verified': ALL,
         'warranty_expiration_date': ALL,
     }
     excludes = ('cache_version')
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(
         required_perms=[
             Perm.read_dc_structure,
         ]
     )
     cache = SimpleCache()
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
     limit = 100
示例#13
0
文件: api.py 项目: smagowr/ralph
 class Meta:
     queryset = Network.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_network_structure,
     ])
     filtering = {}
     excludes = ()
     cache = SimpleCache()
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#14
0
文件: api.py 项目: pombreda/ralph
 class Meta:
     queryset = CI.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_configuration_item_info_generic,
     ])
     list_allowed_methods = [
         'get',
         'post',
         'put',
         'patch',
         'delete',
         'head',
     ]
     resource_name = 'ci'
     filtering = {
         'attributes': ALL,
         'added_manually': ALL,
         'barcode': (
             'startswith',
             'exact',
         ),
         'business_service': ALL,
         'bussiness_owners': ALL,
         'cache_version': ALL,
         'created': ALL,
         'id': ALL,
         'layers': ALL_WITH_RELATIONS,
         'modified': ALL,
         'name': (
             'startswith',
             'exact',
         ),
         'object_id': ('exact', ),
         'pci_scope': ('exact', ),
         'resource_uri': ALL,
         'state': ALL,
         'status': ALL,
         'technical_owners': ALL,
         'technical_service': ALL,
         'type': ALL_WITH_RELATIONS,
         'uid': ALL,
         'zabbix_id': ALL,
     }
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#15
0
 class Meta:
     queryset = ProfitCenter.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_dc_structure,
     ])
     filtering = {
         'id': ALL,
         'name': ALL,
     }
     cache = SimpleCache()
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#16
0
文件: api.py 项目: pombreda/ralph
 class Meta:
     queryset = Profile.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_configuration_item_info_generic,
     ])
     list_allowed_methods = ['get']
     filtering = {
         'user': ALL_WITH_RELATIONS,
     }
     resource_name = 'profiles'
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#17
0
 class Meta:
     queryset = Record.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_dc_structure,
     ])
     filtering = {
         'type': ALL,
         'name': ALL,
         'content': ALL,
     }
     cache = SimpleCache()
     list_allowed_methods = ['get']
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#18
0
文件: api.py 项目: pombreda/ralph
 class Meta:
     queryset = CIType.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_configuration_item_info_generic,
     ])
     filtering = {
         'id': ALL,
         'name': ALL,
         'resource_uri': ALL,
     }
     list_allowed_methods = ['get']
     resourse_name = 'citypes'
     excludes = ['cache_version', 'created', 'modified']
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#19
0
文件: api.py 项目: pombreda/ralph
 class Meta:
     queryset = User.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_configuration_item_info_generic,
     ])
     list_allowed_methods = ['get']
     filtering = {
         'first_name': ALL,
         'last_name': ALL,
         'username': ALL,
     }
     resource_name = 'users'
     excludes = ['password', 'last_login', 'is_staff', 'is_superuser']
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#20
0
 class Meta:
     queryset = RolePropertyTypeValue.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_dc_structure,
     ])
     filtering = {
         'default': ALL,
         'id': ALL,
         'role': ALL,
         'symbol': ALL,
         'type': ALL,
         'value': ALL,
     }
     cache = SimpleCache()
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#21
0
 class Meta:
     queryset = RolePropertyValue.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_dc_structure,
     ])
     filtering = {
         'created': ALL,
         'device': ALL,
         'id': ALL,
         'modified': ALL,
         'property': ALL,
         'value': ALL,
     }
     excludes = ('cache_version', )
     cache = SimpleCache()
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )
示例#22
0
文件: api.py 项目: smagowr/ralph
 class Meta:
     queryset = DeviceModelGroup.objects.all()
     authentication = ApiKeyAuthentication()
     authorization = RalphAuthorization(required_perms=[
         Perm.read_dc_structure,
     ])
     filtering = {
         'created': ALL,
         'ip': ALL,
         'modified': ALL,
         'name': ALL,
         'price': ALL,
         'slots': ALL,
         'type': ALL,
     }
     excludes = ('cache_version', )
     cache = SimpleCache()
     throttle = CacheThrottle(
         throttle_at=THROTTLE_AT,
         timeframe=TIMEFRAME,
         expiration=EXPIRATION,
     )