def register_bundle_id(cls, bundle_id, team_id, name): result = ConnectManager().register_bundle_id( ConnectApi.connect_api_bundle_ids.value[0], bundle_id, team_id, name) if result['status'] == 201: return {'status': 200, 'data': result['data']} return result
def register_certificate(cls,out_path,csr_path,type): csr = Certificate.get_certSigningRequest(path=csr_path) result = ConnectManager().register_certificate(ConnectApi.connect_api_certificates.value[0],csr,type=type) if result['status'] == 201: res = result["data"]['data'] file_path = os.path.join(out_path,res['id']+'.cer') decode_content = connectool.base64decode(res['attributes']['certificateContent']) connectool.saveByteFile(decode_content,file_path) return {'status':200,'path':file_path,'data':result['data']} return result
def create_profile(cls, name, bundle_id, certificate_id, devices, type, out_path): result = ConnectManager().create_profile( ConnectApi.connect_api_profiles.value[0], name=name, bundle_id=bundle_id, cerificate_id=certificate_id, devices=devices, type=type) if result['status'] == 201: res = result['data']['data']['attributes'] path = os.path.join(out_path, res['name'] + '.mobileprovision') decode_content = connectool.base64decode(res['profileContent']) connectool.saveByteFile(decode_content, path) return { 'status': 200, 'data': result['data']['data'], 'path': path } return result
def create_app_version(cls, app_id, version_string, platform='IOS', release_type='MANUAL', copyright=None, build_id=None, earliest_release_date=None, uses_idfa=False): result = ConnectManager().create_app_version( ConnectApi.connect_api_app_versions.value[0], app_id=app_id, version_string=version_string, platform=platform, release_type=release_type, copyright=copyright, build_id=build_id, earliest_release_date=earliest_release_date, uses_idfa=uses_idfa) if result['status'] == 201: return {'status': 200, 'data': result['data']} return result
def get_bundle_id_profiles(cls, id): return ConnectManager().get_bundle_id_profiles( ConnectApi.connect_api_bundle_ids.value[0], id)
def delete_bundle_id(cls, id): return ConnectManager().delete_bundle_id( ConnectApi.connect_api_bundle_ids.value[0], id)
def list_bundle_ids(cls, limit, sort): return ConnectManager().list_bundle_ids( ConnectApi.connect_api_bundle_ids.value[0], limit, sort)
def __init__(self, api_key, issuer_id, private_path=None, timeout=15): token_object = ConnectToken(api_key, issuer_id, key_path=private_path, timeout=timeout) ConnectManager().tokenConfig = token_object
def list_devices(cls, limit, sort): result = ConnectManager().list_devices( ConnectApi.connect_api_devices.value[0], limit, sort) if result['status'] == 200: return {'status': 200, 'data': result['data']['data']} return result
def get_app_version_localizations(cls, id): return ConnectManager().get_app_version_localizations( ConnectApi.connect_api_app_versions.value[0], id)
def request_profile(cls, id): return ConnectManager().request_profile( ConnectApi.connect_api_profiles.value[0], id)
def list_profiles(cls, limit, sort): return ConnectManager().list_profiles( ConnectApi.connect_api_profiles.value[0], limit=limit, sort=sort)
def delete_profile(cls, id): return ConnectManager().delete_profile( ConnectApi.connect_api_profiles.value[0], id)
def list_cerificate(cls,limit,sort): return ConnectManager().list_certificates(ConnectApi.connect_api_certificates.value[0],limit,sort)
def delete_certificate(cls,id): return ConnectManager().delete_certificate(ConnectApi.connect_api_certificates.value[0],id)
def list_apps(cls, limit, sort, filter_bundle_id=None): return ConnectManager().list_apps(ConnectApi.connect_api_apps.value, limit, sort, filter_bundle_id)
def get_app_versions(cls, id): return ConnectManager().get_app_versions( ConnectApi.connect_api_apps.value, id)
def regist_device(cls, name, udid): return ConnectManager().register_device( ConnectApi.connect_api_devices.value[0], name, udid)