1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- from common import config
- from common.util import req_api
- class AssertApi:
- def __init__(self):
- self.headers = None
- def get_assert(self, page_index: int = 10, page_size:int=4000, position_path:str = None, asset_status:list = None,
- dns:list = None):
- params = {}
- params['pageIndex'] = page_index
- params['pageSize'] = page_size
- if position_path is not None:
- params['positionPath'] = position_path
- if asset_status is not None:
- params['assetStatus'] = asset_status
- if dns is not None:
- params['dns'] = dns
- return req_api(f'{config.DCIM_BASE_URL}/rest/openapi/neteco/nbi/v2/assert', headers=self.headers,
- params=params)
- def get_capacity(self, page_index: int = 10, page_size:int=4000, dns:list = None):
- params = {}
- params['pageIndex'] = page_index
- params['pageSize'] = page_size
- if dns is not None:
- params['dns'] = dns
- return req_api(f'{config.DCIM_BASE_URL}/rest/openapi/neteco/capacity', headers=self.headers,
- params=params)
- def get_customer_and_rack(self, page_index: int = 10, page_size:int=4000, customer_ids:list = None):
- params = {}
- params['pageIndex'] = page_index
- params['pageSize'] = page_size
- if customer_ids is not None:
- params['customerIds'] = customer_ids
- return req_api(f'{config.DCIM_BASE_URL}/rest/openapi/neteco/nbi/asset/relation/customerAndRack',
- headers=self.headers, params=params)
- def get_customer_and_asset(self, page_index: int = 10, page_size:int=4000, customer_names:list = None):
- params = {}
- params['pageIndex'] = page_index
- params['pageSize'] = page_size
- if customer_names is not None:
- params['customerNames'] = customer_names
- return req_api(f'{config.DCIM_BASE_URL}/rest/openapi/neteco/nbi/v2/asset/relation/customerAndAsset',
- headers=self.headers, params=params)
|